ret=$?
if [ $ret -ne 6 ] ; then
if [ $opt_debug -ne 0 ] ; then
- gdb --args build/src/$mod/tct-$mod-core $1
+ if [ $ret -eq 0 ] ; then
+ gdb --args build/src/$mod/tct-$mod-core $1
+ fi
else
echo $output
if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
- Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
- button.SetSize(480, 800);
- Stage::GetCurrent().Add(button);
- manager.SetFocusOrder( button, 1 );
- manager.SetCurrentFocusActor( button );
-
manager.ActionActivateSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
manager.ActionDownSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
- Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
- button.SetSize(480, 800);
- Stage::GetCurrent().Add(button);
- manager.SetFocusOrder( button, 1 );
- manager.SetCurrentFocusActor( button );
+ DummyControl dummyControl = DummyControl::New(true);
+ dummyControl.SetSize(480, 800);
+ manager.SetFocusOrder( dummyControl, 1 );
+ Stage::GetCurrent().Add( dummyControl );
+ manager.SetCurrentFocusActor( dummyControl );
accessibilityAdaptor.HandleActionDownEvent();
AccessibilityManagerSignalHandler callback;
- AccessibilityManager manager = AccessibilityManager::Get();
- DALI_TEST_CHECK( manager );
-
- Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New();
- button.SetSize(480, 800);
- Stage::GetCurrent().Add(button);
- manager.SetFocusOrder( button, 1 );
- manager.SetCurrentFocusActor( button );
-
Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
accAdaptor.HandleActionEnableEvent();
+ AccessibilityManager manager = AccessibilityManager::Get();
+ DALI_TEST_CHECK( manager );
+
manager.ActionZoomSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali-toolkit/dali-toolkit.h>
using namespace Dali;
using namespace Toolkit;
gOnLayoutActivatedCalled = true;
}
-// Generate a PanGestureEvent to send to Core
-Integration::PanGestureEvent GeneratePan(
- Gesture::State state,
- const Vector2& previousPosition,
- const Vector2& currentPosition,
- unsigned long timeDelta,
- unsigned int numberOfTouches = 1)
-{
- Integration::PanGestureEvent pan(state);
-
- pan.previousPosition = previousPosition;
- pan.currentPosition = currentPosition;
- pan.timeDelta = timeDelta;
- pan.numberOfTouches = numberOfTouches;
-
- return pan;
-}
-
-/**
- * Helper to generate PanGestureEvent
- *
- * @param[in] application Application instance
- * @param[in] state The Gesture State
- * @param[in] pos The current position of touch.
- */
-static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
-{
- static Vector2 last;
-
- if( (state == Gesture::Started) ||
- (state == Gesture::Possible) )
- {
- last.x = pos.x;
- last.y = pos.y;
- }
-
- application.ProcessEvent(GeneratePan(state, last, pos, RENDER_FRAME_INTERVAL));
-
- last.x = pos.x;
- last.y = pos.y;
-}
-
/*
* Simulate time passed by.
*
END_TEST;
}
-
-int UtcDaliItemViewOvershootVertical(void)
-{
- ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
-
- // Create the ItemView actor
- TestItemFactory factory;
- ItemView view = ItemView::New(factory);
-
- // Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
- view.AddLayout(*gridLayout);
- stage.Add(view);
-
- // Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(stage.GetSize());
- view.ActivateLayout(0, stageSize, 0.5f);
-
- view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
- DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
-
- view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
-
- Wait(application);
-
- // Do a pan starting from 100,100 and moving down
- Vector2 pos(100.0f, 100.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.y += 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<200;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.y += 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, 100);
-
- // Do a pan starting from 100,100 and moving up
- pos = Vector2(100.0f, 300.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.y -= 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<200;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.y -= 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, 100);
- END_TEST;
-}
-
-int UtcDaliItemViewOvershootHorizontal(void)
-{
- ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
-
- // Create the ItemView actor
- TestItemFactory factory;
- ItemView view = ItemView::New(factory);
-
- // Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
- view.AddLayout(*gridLayout);
- stage.Add(view);
-
- // Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(stage.GetSize());
- view.ActivateLayout(0, stageSize, 0.5f);
-
- view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
- DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
-
- view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
-
- Wait(application);
-
- // Do a pan starting from 100,100 and moving left
- Vector2 pos(100.0f, 100.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.x -= 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<200;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.x -= 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, 100);
-
- // Do a pan starting from 100,100 and moving right
- pos = Vector2(100.0f, 100.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.x += 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<200;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.x += 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, 100);
-
- END_TEST;
-}
gObjectCreatedCallBackCalled = true;
}
-struct CallbackFunctor
-{
- CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
- {
- }
-
- void operator()()
- {
- *mCallbackFlag = true;
- }
- bool* mCallbackFlag;
-};
const int MILLISECONDS_PER_SECOND = 1000;
const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
const int RENDER_ANIMATION_TEST_DURATION_MS = 1000; ///< 1000ms to test animation
-
const int RENDER_DELAY_SCROLL = 1000; ///< duration to wait for any scroll to complete.
// For Clamp Signal testing...
END_TEST;
}
-int UtcDaliToolkitScrollViewNewP1(void)
+int UtcDaliToolkitScrollViewNewP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliToolkitScrollViewNewP1");
+ tet_infoline(" UtcDaliToolkitScrollViewNewP");
ScrollView scrollView;
END_TEST;
}
-int UtcDaliToolkitScrollViewNewP2(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliToolkitScrollViewNewP2 - create thru type registry");
-
- ScrollView scrollView;
- DALI_TEST_CHECK( !scrollView );
-
- TypeRegistry typeRegistry = TypeRegistry::Get();
- TypeInfo scrollViewType = typeRegistry.GetTypeInfo("ScrollView");
- BaseHandle handle = scrollViewType.CreateInstance();
- DALI_TEST_CHECK( handle );
-
- scrollView = ScrollView::DownCast(handle);
- DALI_TEST_CHECK( scrollView );
-
- END_TEST;
-}
-
int UtcDaliToolkitScrollViewDownCastP(void)
{
ToolkitTestApplication application;
scrollView.SetWrapMode(true);
- Property::Value wrapMode = scrollView.GetProperty( Toolkit::ScrollView::Property::WRAP_ENABLED );
- DALI_TEST_EQUALS( wrapMode.Get<bool>(), true, TEST_LOCATION );
-
const Vector2 target = Vector2(50.0f, 50.0f);
const Vector2 target2 = Vector2(150.0f, 150.0f);
END_TEST;
}
-int UtcDaliToolkitScrollViewSignalsUpdate01(void)
+int UtcDaliToolkitScrollViewSignalsUpdate(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
END_TEST;
}
-int UtcDaliToolkitScrollViewSignalsUpdate02(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
-
- gOnScrollStartCalled = false;
- gOnScrollUpdateCalled = false;
- gOnScrollCompleteCalled = false;
-
- ScrollView scrollView = ScrollView::New();
- Stage::GetCurrent().Add( scrollView );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
- scrollView.SetSize(stageSize);
- scrollView.SetParentOrigin(ParentOrigin::TOP_LEFT);
- scrollView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-
- // Position rulers.
- RulerPtr rulerX = new DefaultRuler();
- RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- scrollView.SetRulerX(rulerX);
- scrollView.SetRulerY(rulerY);
- Dali::ConnectionTracker tracker;
- bool scrollStarted=false;
- bool scrollUpdated=false;
- bool scrollCompleted=false;
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollStarted", CallbackFunctor(&scrollStarted) ));
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollUpdated", CallbackFunctor(&scrollUpdated) ));
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollCompleted", CallbackFunctor(&scrollCompleted) ));
-
- Actor image = Actor::New();
- image.SetSize(stageSize);
- image.SetParentOrigin(ParentOrigin::TOP_LEFT);
- image.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- scrollView.Add(image);
-
- Wait(application);
-
- // Do a pan starting from 100,100 and moving down diagonally.
- Vector2 pos(100.0f, 100.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.x += 5.0f;
- pos.y += 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<20;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.x += 5.0f;
- pos.y += 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, RENDER_DELAY_SCROLL);
-
- DALI_TEST_CHECK(scrollStarted);
- DALI_TEST_CHECK(scrollUpdated);
- DALI_TEST_CHECK(scrollCompleted);
-
- Stage::GetCurrent().Remove( scrollView );
-
- END_TEST;
-}
-
static Vector2 PerformGestureDiagonalSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames, bool finish = true)
{
gOnScrollStartCalled = false;
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
- scrollView.Remove(a);
- Wait(application);
-
END_TEST;
}
CleanupTest();
END_TEST;
}
+
END_TEST;
}
-static bool gSliderValueChangedCallBackCalled=false;
+static bool gSliderValueChangedCallBackCalled;
static bool OnSliderValueChanged( Slider slider, float value )
{
gSliderValueChangedCallBackCalled = true;
return true;
}
-static bool gSliderMarkCallBackCalled=false;
+static bool gSliderMarkCallBackCalled;
static bool OnSliderMark( Slider slider, int value )
{
gSliderMarkCallBackCalled = true;
return true;
}
-static bool gSliderSlidingFinishedCallBackCalled=false;
-static bool OnSlidingFinished( Slider slider, float value )
-{
- gSliderSlidingFinishedCallBackCalled = true;
- return true;
-}
-
-int UtcDaliSliderSignals1(void)
+int UtcDaliSliderSignals(void)
{
ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliSliderSignals");
slider.ValueChangedSignal().Connect( &OnSliderValueChanged );
slider.MarkReachedSignal().Connect( &OnSliderMark );
- slider.SlidingFinishedSignal().Connect( &OnSlidingFinished );
application.SendNotification();
application.Render();
gSliderValueChangedCallBackCalled = false;
gSliderMarkCallBackCalled = false;
- gSliderSlidingFinishedCallBackCalled = false;
- {
- Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
- Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointDown );
-
- application.ProcessEvent( event );
- application.SendNotification();
- application.Render();
- }
+ Dali::Integration::TouchEvent event;
+
+ event = Dali::Integration::TouchEvent();
+
+ Integration::Point pointDown;
+ pointDown.SetState( PointState::DOWN );
+ pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ event.AddPoint( pointDown );
for( int i = 0; i < 5; ++i )
{
- Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
Integration::Point pointMotion;
pointMotion.SetState( PointState::MOTION );
pointMotion.SetScreenPosition( Vector2( 10.0f + i * 10.0f, 10.0f ) );
event.AddPoint( pointMotion );
-
- application.ProcessEvent( event );
- application.SendNotification();
- application.Render();
}
- {
- Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
- Integration::Point pointUp;
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointUp );
-
- application.ProcessEvent( event );
- application.SendNotification();
- application.Render();
- }
+ Integration::Point pointUp;
+ pointUp.SetState( PointState::UP );
+ pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ event.AddPoint( pointUp );
+
+ application.ProcessEvent( event );
+
+ application.SendNotification();
+ application.Render();
DALI_TEST_CHECK(gSliderValueChangedCallBackCalled);
DALI_TEST_CHECK(gSliderMarkCallBackCalled);
- DALI_TEST_CHECK(gSliderSlidingFinishedCallBackCalled);
END_TEST;
}
#include <dali/devel-api/rendering/renderer.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/tap-gesture-event.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
-const float RENDER_FRAME_INTERVAL = 16.66f;
-
const float TO_MILLISECONDS = 1000.f;
const float TO_SECONDS = 1.f / TO_MILLISECONDS;
static bool gTextChangedCallBackCalled;
static bool gMaxCharactersCallBackCalled;
-static void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
-{
- Integration::ResourceRequest* request = platform.GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
- Integration::ResourcePointer resource(bitmap);
- bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
- if(request)
- {
- platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
- }
-}
-
-static void LoadMarkerImages(ToolkitTestApplication& app, TextField textField)
-{
- int width(40);
- int height(40);
- LoadBitmapResource( app.GetPlatform(), width, height );
-
- Property::Map propertyMap;
- propertyMap["filename"] = "image.png";
- propertyMap["width"] = width;
- propertyMap["height"] = height;
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::GRAB_HANDLE_IMAGE, propertyMap );
- textField.SetProperty( Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE, propertyMap );
-}
-
-// Generate a PanGestureEvent to send to Core
-static Integration::PanGestureEvent GeneratePan(
- Gesture::State state,
- const Vector2& previousPosition,
- const Vector2& currentPosition,
- unsigned long timeDelta,
- unsigned int numberOfTouches = 1)
-{
- Integration::PanGestureEvent pan(state);
-
- pan.previousPosition = previousPosition;
- pan.currentPosition = currentPosition;
- pan.timeDelta = timeDelta;
- pan.numberOfTouches = numberOfTouches;
-
- return pan;
-}
-
-/**
- * Helper to generate PanGestureEvent
- *
- * @param[in] application Application instance
- * @param[in] state The Gesture State
- * @param[in] pos The current position of touch.
- */
-static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
-{
- static Vector2 last;
-
- if( (state == Gesture::Started) ||
- (state == Gesture::Possible) )
- {
- last.x = pos.x;
- last.y = pos.y;
- }
-
- application.ProcessEvent(GeneratePan(state, last, pos, 16));
-
- last.x = pos.x;
- last.y = pos.y;
-}
-
-/*
- * Simulate time passed by.
- *
- * @note this will always process at least 1 frame (1/60 sec)
- *
- * @param application Test application instance
- * @param duration Time to pass in milliseconds.
- * @return The actual time passed in milliseconds
- */
-static int Wait(ToolkitTestApplication& application, int duration = 0)
-{
- int time = 0;
-
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
- {
- application.SendNotification();
- application.Render(RENDER_FRAME_INTERVAL);
- time += RENDER_FRAME_INTERVAL;
- }
-
- return time;
-}
-
-
static void TestTextChangedCallback( TextField control )
{
tet_infoline(" TestTextChangedCallback");
TextField field = TextField::New();
field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
DALI_TEST_CHECK( field );
- LoadMarkerImages(application, field);
Stage::GetCurrent().Add( field );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- LoadMarkerImages(application, field);
// Render and notify
application.SendNotification();
END_TEST;
}
-
-int utcDaliTextFieldEvent04(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" utcDaliTextFieldEvent04");
-
- // Checks if the highlight actor is created.
-
- TextField field = TextField::New();
- DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
- LoadMarkerImages(application, field);
- // Render and notify
- application.SendNotification();
- application.Render();
-
- field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
- field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
- field.SetSize( 300.f, 50.f );
- field.SetParentOrigin( ParentOrigin::TOP_LEFT );
- field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-
- // Avoid a crash when core load gl resources.
- application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Create a tap event to touch the text field.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
- // Render and notify
- application.SendNotification();
- application.Render();
-
-
- // Tap first to get the focus.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Double tap to select a word.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Tap grab handle
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 0.f, 40.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 0.f, 40.0f ) ) );
- END_TEST;
-}
-
-int utcDaliTextFieldEvent05(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" utcDaliTextFieldEvent05");
-
- // Checks if the highlight actor is created.
-
- TextField field = TextField::New();
- DALI_TEST_CHECK( field );
- Stage::GetCurrent().Add( field );
- LoadMarkerImages(application, field);
- // Render and notify
- application.SendNotification();
- application.Render();
-
- field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
- field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
- field.SetSize( 300.f, 50.f );
- field.SetParentOrigin( ParentOrigin::TOP_LEFT );
- field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-
- // Avoid a crash when core load gl resources.
- application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Create a tap event to touch the text field.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
- // Render and notify
- application.SendNotification();
- application.Render();
-
-
- // Tap first to get the focus.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Double tap to select a word.
- application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
- application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 1.f, 25.0f ) ) );
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // drag grab handle right
- Vector2 pos(0.0f, 40.0f);
- SendPan(application, Gesture::Possible, pos);
- SendPan(application, Gesture::Started, pos);
- pos.x += 5.0f;
- Wait(application, 100);
-
- for(int i = 0;i<20;i++)
- {
- SendPan(application, Gesture::Continuing, pos);
- pos.x += 5.0f;
- Wait(application);
- }
-
- SendPan(application, Gesture::Finished, pos);
- Wait(application, RENDER_FRAME_INTERVAL);
-
- Actor offscreenRoot = field.GetChildAt( 1u );
- END_TEST;
-}
using namespace Dali;
+void LookAt(Matrix& result, const Vector3& eye, const Vector3& target, const Vector3& up)
+{
+ Vector3 vZ = target - eye;
+ vZ.Normalize();
+
+ Vector3 vX = up.Cross(vZ);
+ vX.Normalize();
+
+ Vector3 vY = vZ.Cross(vX);
+ vY.Normalize();
+
+ result.SetInverseTransformComponents(vX, vY, vZ, eye);
+}
+
+
Model3dView::Model3dView()
: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
{
}
}
+Vector2 ItemView::GetDomainSize() const
+{
+ Actor self = Self();
+
+ float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y);
+ float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX_Y);
+
+ return Vector2(0.0f, fabs(GetScrollPosition(minScrollPosition, self.GetCurrentSize()) - GetScrollPosition(-maxScrollPosition, self.GetCurrentSize())));
+}
+
bool ItemView::IsLayoutScrollable(const Vector3& layoutSize)
{
Actor self = Self();
void ReplaceItems(const ItemContainer& replacementItems, float durationSeconds);
/**
+ * @copydoc Toolkit::Scrollable::GetDomainSize
+ */
+ Vector2 GetDomainSize() const;
+
+ /**
* @copydoc Toolkit::Scrollable::GetCurrentScrollPosition
*/
Vector2 GetCurrentScrollPosition() const;
return -GetPropertyPosition();
}
+Vector2 ScrollView::GetDomainSize() const
+{
+ Vector3 size = Self().GetCurrentSize();
+
+ const RulerDomain& xDomain = GetRulerX()->GetDomain();
+ const RulerDomain& yDomain = GetRulerY()->GetDomain();
+
+ Vector2 domainSize;
+ domainSize.x = xDomain.max - xDomain.min - size.x;
+ domainSize.y = yDomain.max - yDomain.min - size.y;
+ return domainSize;
+}
+
void ScrollView::TransformTo(const Vector2& position,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
Vector2 GetCurrentScrollPosition() const;
/**
+ * @copydoc Toolkit::Scrollable::GetDomainSize
+ */
+ Vector2 GetDomainSize() const;
+
+ /**
* @copydoc ScrollTo(const Vector2&)
*/
void TransformTo(const Vector2& position,
void SetOvershootEnabled(bool enable);
/**
+ * Gets the size of the domain (minimum/maximum extents for each axis to scroll to)
+ * @return the domain size
+ */
+ virtual Vector2 GetDomainSize() const = 0;
+
+ /**
* Adds actor as an Overlay to Scrollable
* This method is called by Add-on UI components
* such as scroll bars, page indicators.
CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
-%if 0%{?enable_coverage}
-CXXFLAGS+=" --coverage "
-LDFLAGS+=" --coverage "
-%endif
-
libtoolize --force
cd %{_builddir}/dali-toolkit-%{version}/build/tizen
autoreconf --install