Dali 3D User Interface Engine
Classes | Functions | Variables
anonymous_namespace{utc-Dali-ScrollView.cpp} Namespace Reference

Classes

struct  TestSumConstraint
 TestSumConstraint. More...
 

Functions

static void TestCallback (BaseHandle handle)
 
const float DEFAULT_SNAP_OVERSHOOT_DURATION (0.5f)
 Default overshoot snapping animation time. More...
 
const float DEFAULT_MAX_OVERSHOOT (100.0f)
 Default maximum allowed overshoot in pixels. More...
 
const float SCROLL_ANIMATION_DURATION (0.33f)
 Duration of scroll animation in Overshoot tests (i.e. 100 pixels of overshoot in the speed of 500 pixels per 100 frames, 100/(500/(100/60)) = 0.33) More...
 
Integration::PanGestureEvent GeneratePan (Gesture::State state, const Vector2 &previousPosition, const Vector2 &currentPosition, unsigned long timeDelta, unsigned int numberOfTouches=1)
 
static void SendPan (ToolkitTestApplication &application, Gesture::State state, const Vector2 &pos)
 Helper to generate PanGestureEvent. More...
 
int Wait (ToolkitTestApplication &application, int duration=0)
 
static void OnScrollStart (const Vector2 &position)
 Invoked when scrolling starts. More...
 
static void OnScrollUpdate (const Vector2 &position)
 Invoked when scrolling updates (via dragging) More...
 
static void OnScrollComplete (const Vector2 &position)
 Invoked when scrolling finishes. More...
 
static void OnSnapStart (const ScrollView::SnapEvent &event)
 Invoked when a snap or flick started. More...
 
static float TestOvershootSnapDuration (ToolkitTestApplication &application, ScrollView scrollView)
 
float TestAlphaFunction (float progress)
 y = 2x alpha function, which is clamped between 0.0f - 1.0f More...
 

Variables

static bool gObjectCreatedCallBackCalled
 
const int MILLISECONDS_PER_SECOND = 1000
 
const int RENDER_FRAME_INTERVAL = 16
 Duration of each frame in ms. (at approx 60FPS) More...
 
const int RENDER_ANIMATION_TEST_DURATION_MS = 1000
 1000ms to test animation More...
 
const int RENDER_DELAY_SCROLL = 1000
 duration to wait for any scroll to complete. More...
 
const float CLAMP_EXCESS_WIDTH = 200.0f
 Amount of width that can be panned outside scrollview. More...
 
const float CLAMP_EXCESS_HEIGHT = 200.0f
 Amount of height that can be panned outside scrollview. More...
 
const int CLAMP_STEP_0_CHECK_NOTCLAMPED = 0
 FSM: "First check that scrollview isn't clamped". More...
 
const int CLAMP_STEP_1_CHECK_CLAMPED_WEST = 1
 FSM: "Next check that scrollview clamps against left side". More...
 
const int CLAMP_STEP_2_CHECK_CLAMPED_SOUTH_WEST = 2
 FSM: "Then check that scrollview clamps against bottom-left side". More...
 
const int CLAMP_STEP_3_SUCCESS = 3
 FSM: "Finished (Success)". More...
 
const Vector2 CLAMP_START_SCROLL_POSITION (30.0f, 100.0f)
 Scroll start position for the Clamping tests. More...
 
const Vector2 CLAMP_TOUCH_START (100.0f, 100.0f)
 Start point to touch from for the Clamping tests. More...
 
const Vector2 CLAMP_TOUCH_MOVEMENT (5.0f,-5.0f)
 Amount to move touch for each frame for the Clamping tests. More...
 
const int CLAMP_GESTURE_FRAMES = 100
 Number of Frames to synthesize a gesture for the Clamping tests. More...
 
const Vector3 TEST_ACTOR_POSITION (100.0f, 100.0f, 0.0f)
 A Test actor position offset (arbitrary value) More...
 
const Vector3 TEST_CONSTRAINT_OFFSET (1.0f, 2.0f, 0.0f)
 A Test constraint offset (arbitrary value to test effects) More...
 
const float TEST_RATIO_TOLERANCE = 0.05
 +/-5% tolerance for ratio comparisons. More...
 
const int MAX_FRAMES_TO_TEST_OVERSHOOT = 600
 10 seconds (at 60 frames per second). More...
 
const Vector2 OVERSHOOT_START_SCROLL_POSITION (100.0f, 100.0f)
 Scroll start position for the Overshoot tests. More...
 
const Vector2 SNAP_POSITION_WITH_DECELERATED_VELOCITY (74.0f, 74.0f)
 the snap position for Overshoot tests with the decelerated velocity (i.e. Decelerated from 500 pixels per 100 frames). More...
 
const float TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION = 0.05f
 a Test duration More...
 
const float TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION = 1.5f
 another Test duration More...
 
const float TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION = TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * 0.5f
 
const float TIME_TOLERANCE = 0.05f
 Allow testing tolerance between a 10th of second (+/- 3 frames) More...
 
static bool gOnScrollStartCalled
 Whether the OnScrollStart signal was invoked. More...
 
static bool gOnScrollUpdateCalled
 Whether the OnScrollUpdate signal was invoked. More...
 
static bool gOnScrollCompleteCalled
 Whether the OnScrollComplete signal was invoked. More...
 
static bool gOnSnapStartCalled
 Whether the OnSnapStart signal was invoked. More...
 
static SnapType gLastSnapType
 Snaping information from SnapEvent. More...
 
static Vector3 gConstraintResult
 Result from constraint. More...
 

Function Documentation

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::DEFAULT_MAX_OVERSHOOT ( 100.  0f)

Default maximum allowed overshoot in pixels.

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::DEFAULT_SNAP_OVERSHOOT_DURATION ( 0.  5f)

Default overshoot snapping animation time.

Integration::PanGestureEvent anonymous_namespace{utc-Dali-ScrollView.cpp}::GeneratePan ( Gesture::State  state,
const Vector2 previousPosition,
const Vector2 currentPosition,
unsigned long  timeDelta,
unsigned int  numberOfTouches = 1 
)

Definition at line 82 of file utc-Dali-ScrollView.cpp.

static void anonymous_namespace{utc-Dali-ScrollView.cpp}::OnScrollComplete ( const Vector2 position)
static
static void anonymous_namespace{utc-Dali-ScrollView.cpp}::OnScrollStart ( const Vector2 position)
static
static void anonymous_namespace{utc-Dali-ScrollView.cpp}::OnScrollUpdate ( const Vector2 position)
static

Invoked when scrolling updates (via dragging)

Parameters
[in]positionThe current scroll position.

Definition at line 170 of file utc-Dali-ScrollView.cpp.

Referenced by anonymous_namespace{utc-Dali-ScrollViewEffect.cpp}::SetupTestScrollView(), UtcDaliToolkitScrollViewAxisAutoLock(), UtcDaliToolkitScrollViewOvershoot(), UtcDaliToolkitScrollViewScrollSensitive(), UtcDaliToolkitScrollViewSignalsStartComplete(), and UtcDaliToolkitScrollViewSignalsUpdate().

Here is the caller graph for this function:

static void anonymous_namespace{utc-Dali-ScrollView.cpp}::OnSnapStart ( const ScrollView::SnapEvent event)
static

Invoked when a snap or flick started.

Parameters
[in]eventThe type of snap and the target position/scale/rotation.

Definition at line 190 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewScrollSensitive(), and UtcDaliToolkitScrollViewSnapStartedSignalP().

Here is the caller graph for this function:

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::SCROLL_ANIMATION_DURATION ( 0.  33f)

Duration of scroll animation in Overshoot tests (i.e. 100 pixels of overshoot in the speed of 500 pixels per 100 frames, 100/(500/(100/60)) = 0.33)

Referenced by UtcDaliToolkitScrollViewOvershoot().

Here is the caller graph for this function:

static void anonymous_namespace{utc-Dali-ScrollView.cpp}::SendPan ( ToolkitTestApplication application,
Gesture::State  state,
const Vector2 pos 
)
static

Helper to generate PanGestureEvent.

Parameters
[in]applicationApplication instance
[in]stateThe Gesture State
[in]posThe current position of touch.

Definition at line 106 of file utc-Dali-ScrollView.cpp.

References anonymous_namespace{utc-Dali-PanGestureDetector.cpp}::GeneratePan(), Dali::Gesture::Possible, Dali::TestApplication::ProcessEvent(), Dali::Gesture::Started, Dali::Vector2::x, and Dali::Vector2::y.

Here is the call graph for this function:

float anonymous_namespace{utc-Dali-ScrollView.cpp}::TestAlphaFunction ( float  progress)

y = 2x alpha function, which is clamped between 0.0f - 1.0f

Animations should appear to finish (reach 100% point) at just half the time of a regular Linear AlphaFunction.

Parameters
[in]progressvalue (ranges from 0.0f - 1.0f)
Returns
interpolation value (ranges from 0.0f - 1.0f)

Definition at line 260 of file utc-Dali-ScrollView.cpp.

References Dali::Toolkit::Text::min().

Referenced by UtcDaliToolkitScrollViewOvershoot(), UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP(), and UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionP().

Here is the call graph for this function:

Here is the caller graph for this function:

static void anonymous_namespace{utc-Dali-ScrollView.cpp}::TestCallback ( BaseHandle  handle)
static

Definition at line 42 of file utc-Dali-ScrollView.cpp.

static float anonymous_namespace{utc-Dali-ScrollView.cpp}::TestOvershootSnapDuration ( ToolkitTestApplication application,
ScrollView  scrollView 
)
static
Parameters
[in]applicationThe application instance
[in]scrollViewThe scrollView instance
Returns
The time taken for the overshoot to reach origin (zero)

Definition at line 233 of file utc-Dali-ScrollView.cpp.

References Dali::Handle::GetProperty(), MAX_FRAMES_TO_TEST_OVERSHOOT, Dali::Toolkit::ScrollView::Property::OVERSHOOT_X, Dali::Toolkit::ScrollView::Property::OVERSHOOT_Y, and anonymous_namespace{utc-Dali-PropertyNotification.cpp}::Wait().

Referenced by UtcDaliToolkitScrollViewOvershoot().

Here is the call graph for this function:

Here is the caller graph for this function:

int anonymous_namespace{utc-Dali-ScrollView.cpp}::Wait ( ToolkitTestApplication application,
int  duration = 0 
)

Variable Documentation

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_EXCESS_HEIGHT = 200.0f
const float anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_EXCESS_WIDTH = 200.0f
const int anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_GESTURE_FRAMES = 100

Number of Frames to synthesize a gesture for the Clamping tests.

Definition at line 63 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewScrollSensitive().

const Vector2 anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_START_SCROLL_POSITION(30.0f, 100.0f)

Scroll start position for the Clamping tests.

Referenced by UtcDaliToolkitScrollViewScrollSensitive(), and UtcDaliToolkitScrollViewSnapStartedSignalP().

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_STEP_0_CHECK_NOTCLAMPED = 0

FSM: "First check that scrollview isn't clamped".

Definition at line 56 of file utc-Dali-ScrollView.cpp.

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_STEP_1_CHECK_CLAMPED_WEST = 1

FSM: "Next check that scrollview clamps against left side".

Definition at line 57 of file utc-Dali-ScrollView.cpp.

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_STEP_2_CHECK_CLAMPED_SOUTH_WEST = 2

FSM: "Then check that scrollview clamps against bottom-left side".

Definition at line 58 of file utc-Dali-ScrollView.cpp.

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_STEP_3_SUCCESS = 3

FSM: "Finished (Success)".

Definition at line 59 of file utc-Dali-ScrollView.cpp.

const Vector2 anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_TOUCH_MOVEMENT(5.0f,-5.0f)

Amount to move touch for each frame for the Clamping tests.

Referenced by UtcDaliToolkitScrollViewScrollSensitive().

const Vector2 anonymous_namespace{utc-Dali-ScrollView.cpp}::CLAMP_TOUCH_START(100.0f, 100.0f)
Vector3 anonymous_namespace{utc-Dali-ScrollView.cpp}::gConstraintResult
static
SnapType anonymous_namespace{utc-Dali-ScrollView.cpp}::gLastSnapType
static

Snaping information from SnapEvent.

Definition at line 152 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewSnapStartedSignalP().

bool anonymous_namespace{utc-Dali-ScrollView.cpp}::gObjectCreatedCallBackCalled
static

Definition at line 40 of file utc-Dali-ScrollView.cpp.

bool anonymous_namespace{utc-Dali-ScrollView.cpp}::gOnScrollCompleteCalled
static
bool anonymous_namespace{utc-Dali-ScrollView.cpp}::gOnScrollStartCalled
static
bool anonymous_namespace{utc-Dali-ScrollView.cpp}::gOnScrollUpdateCalled
static

Whether the OnScrollUpdate signal was invoked.

Definition at line 149 of file utc-Dali-ScrollView.cpp.

Referenced by PerformGestureDiagonalSwipe(), and UtcDaliToolkitScrollViewSignalsUpdate().

bool anonymous_namespace{utc-Dali-ScrollView.cpp}::gOnSnapStartCalled
static

Whether the OnSnapStart signal was invoked.

Definition at line 151 of file utc-Dali-ScrollView.cpp.

Referenced by PerformGestureDiagonalSwipe(), UtcDaliToolkitScrollViewScrollSensitive(), and UtcDaliToolkitScrollViewSnapStartedSignalP().

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::MAX_FRAMES_TO_TEST_OVERSHOOT = 600

10 seconds (at 60 frames per second).

Definition at line 71 of file utc-Dali-ScrollView.cpp.

Referenced by TestOvershootSnapDuration().

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::MILLISECONDS_PER_SECOND = 1000

Definition at line 48 of file utc-Dali-ScrollView.cpp.

const Vector2 anonymous_namespace{utc-Dali-ScrollView.cpp}::OVERSHOOT_START_SCROLL_POSITION(100.0f, 100.0f)

Scroll start position for the Overshoot tests.

Referenced by UtcDaliToolkitScrollViewOvershoot(), and UtcDaliToolkitScrollViewSetMaxOvershootP().

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::RENDER_ANIMATION_TEST_DURATION_MS = 1000

1000ms to test animation

Definition at line 50 of file utc-Dali-ScrollView.cpp.

const int anonymous_namespace{utc-Dali-ScrollView.cpp}::RENDER_DELAY_SCROLL = 1000
const int anonymous_namespace{utc-Dali-ScrollView.cpp}::RENDER_FRAME_INTERVAL = 16

Duration of each frame in ms. (at approx 60FPS)

Definition at line 49 of file utc-Dali-ScrollView.cpp.

const Vector2 anonymous_namespace{utc-Dali-ScrollView.cpp}::SNAP_POSITION_WITH_DECELERATED_VELOCITY(74.0f, 74.0f)

the snap position for Overshoot tests with the decelerated velocity (i.e. Decelerated from 500 pixels per 100 frames).

Referenced by UtcDaliToolkitScrollViewOvershoot().

const Vector3 anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_ACTOR_POSITION(100.0f, 100.0f, 0.0f)
const Vector3 anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_CONSTRAINT_OFFSET(1.0f, 2.0f, 0.0f)

A Test constraint offset (arbitrary value to test effects)

Referenced by UtcDaliToolkitScrollViewBind(), and UtcDaliToolkitScrollViewConstraints().

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION = 0.05f

a Test duration

Definition at line 75 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewOvershoot().

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION = 1.5f

another Test duration

Definition at line 76 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewOvershoot().

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION = TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * 0.5f

Definition at line 77 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewOvershoot().

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::TEST_RATIO_TOLERANCE = 0.05

+/-5% tolerance for ratio comparisons.

Definition at line 66 of file utc-Dali-ScrollView.cpp.

const float anonymous_namespace{utc-Dali-ScrollView.cpp}::TIME_TOLERANCE = 0.05f

Allow testing tolerance between a 10th of second (+/- 3 frames)

Definition at line 78 of file utc-Dali-ScrollView.cpp.

Referenced by UtcDaliToolkitScrollViewOvershoot().

Dali Docs Home
Read more about Dali