const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/application-icon-20.png";
const char* TEST_IMAGE_FILE_NAME_9 = TEST_RESOURCE_DIR "/heartsframe.9.png";
-
+const char* TEST_IMAGE_FILE_NAME2_9 = TEST_RESOURCE_DIR "/button-up.9.png";
int CountFunctionCalls( const std::vector<std::string>& callstack, const std::string& function )
{
int counter = 0;
imageView2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
imageView2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ // Load npatch image view
+ auto imageView3 = Dali::Toolkit::ImageView::New( TEST_IMAGE_FILE_NAME2_9 );
+ imageView3.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
+ imageView3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ imageView3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+
application.GetScene().Add( imageView );
application.GetScene().Add( imageView2 );
+ application.GetScene().Add( imageView3 );
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( ::Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( ::Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( CountFunctionCalls( callstack, "GetGeometry" ), 2, TEST_LOCATION);
DALI_TEST_EQUALS( CountFunctionCalls( callstack, "CreateGeometry" ), 1, TEST_LOCATION);
- DALI_TEST_EQUALS( CountFunctionCalls( callstack, "CreateGeometryGrid" ), 1, TEST_LOCATION);
- DALI_TEST_EQUALS( CountFunctionCalls( callstack, "BuildNPatch" ), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "CreateGeometryGrid" ), 2, TEST_LOCATION);
+ DALI_TEST_EQUALS( CountFunctionCalls( callstack, "BuildNPatch" ), 2, TEST_LOCATION);
delete addOnManager;
}
DummyControlImpl::DummyControlImpl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour() ),
mCustomSlot1Called(false)
{
}
void Impl::DummyControl::OnChildRemove(Actor& child) { childRemoveCalled = true; }
void Impl::DummyControl::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; }
void Impl::DummyControl::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; }
-bool Impl::DummyControl::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
-bool Impl::DummyControl::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
bool Impl::DummyControl::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
void Impl::DummyControl::OnKeyInputFocusGained() { keyInputFocusGained = true; }
void Impl::DummyControl::OnKeyInputFocusLost() { keyInputFocusLost = true; }
static DummyControl New();
public:
- inline void EnableGestureDetection(Gesture::Type type) { Internal::Control::EnableGestureDetection(type); }
- inline void DisableGestureDetection(Gesture::Type type) { Internal::Control::DisableGestureDetection(type); }
+ inline void EnableGestureDetection(GestureType::Value type) { Internal::Control::EnableGestureDetection(type); }
+ inline void DisableGestureDetection(GestureType::Value type) { Internal::Control::DisableGestureDetection(type); }
inline PinchGestureDetector GetPinchGestureDetector() const { return Internal::Control::GetPinchGestureDetector(); }
inline PanGestureDetector GetPanGestureDetector() const { return Internal::Control::GetPanGestureDetector(); }
inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
virtual void OnTap(const TapGesture& tap);
virtual void OnLongPress(const LongPressGesture& longPress);
virtual Vector3 GetNaturalSize();
+ virtual bool OnKeyEvent(const KeyEvent& event);
private: // From CustomActorImpl
virtual void OnChildRemove(Actor& child);
virtual void OnSizeSet(const Vector3& targetSize);
virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
- virtual bool OnHoverEvent(const HoverEvent& event);
- virtual bool OnWheelEvent(const WheelEvent& event);
- virtual bool OnKeyEvent(const KeyEvent& event);
virtual void OnKeyInputFocusGained();
virtual void OnKeyInputFocusLost();
virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
}
TestButton::TestButton()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS|REQUIRES_STYLE_CHANGE_SIGNALS ) )
+: Control( ControlBehaviour() )
{
}
Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
- Dali::Integration::SceneHolder::TouchSignalType& TouchSignal();
+ Dali::Integration::SceneHolder::TouchEventSignalType& TouchedSignal();
Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
return mScene.KeyEventGeneratedSignal();
}
-Dali::Integration::SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+Dali::Integration::SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
{
- return mScene.TouchSignal();
+ return mScene.TouchedSignal();
}
Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
return GetImplementation( *this ).KeyEventGeneratedSignal();
}
-SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
{
- return GetImplementation( *this ).TouchSignal();
+ return GetImplementation( *this ).TouchedSignal();
}
SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
return GetImplementation( *this ).KeyEventSignal();
}
-Window::TouchSignalType& Window::TouchSignal()
+Window::TouchEventSignalType& Window::TouchedSignal()
{
- return GetImplementation( *this ).TouchSignal();
+ return GetImplementation( *this ).TouchedSignal();
}
namespace DevelWindow
{
public:
using KeyEventSignalType = Signal< void (const KeyEvent&) >;
- using TouchSignalType = Signal< void (const TouchEvent&) >;
+ using TouchEventSignalType = Signal< void (const TouchEvent&) >;
static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
void Hide();
FocusChangeSignalType& FocusChangeSignal();
KeyEventSignalType& KeyEventSignal();
- TouchSignalType& TouchSignal();
+ TouchEventSignalType& TouchedSignal();
public:
explicit Window( Internal::Adaptor::Window* window );
dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) );
application.GetScene().Add( dummyControl );
- AccessibilityGestureEvent panGestureEvent(AccessibilityGestureEvent::Started);
+ AccessibilityGestureEvent panGestureEvent(AccessibilityGestureEvent::STARTED);
panGestureEvent.previousPosition = Vector2(0.f, 0.f);
panGestureEvent.currentPosition = Vector2(100.f, 0.f);
panGestureEvent.timeDelta = 16;
Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
- panGestureEvent.state = AccessibilityGestureEvent::Continuing;
+ panGestureEvent.state = AccessibilityGestureEvent::CONTINUING;
panGestureEvent.previousPosition = Vector2(100.f, 0.f);
panGestureEvent.currentPosition = Vector2(200.f, 0.f);
Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
- panGestureEvent.state = AccessibilityGestureEvent::Finished;
+ panGestureEvent.state = AccessibilityGestureEvent::FINISHED;
panGestureEvent.previousPosition = Vector2(200.f, 0.f);
panGestureEvent.currentPosition = Vector2(300.f, 0.f);
Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
{
ToolkitTestApplication application;
- // Default, HorizontalCenter, VerticalCenter - Ensure they do not change!
+ // Default, HORIZONTAL_CENTER, VERTICAL_CENTER - Ensure they do not change!
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalCenter | Alignment::VerticalCenter));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalLeft, VerticalCenter
+ // HORIZONTAL_LEFT, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::HorizontalLeft);
+ Alignment::Type type(Alignment::HORIZONTAL_LEFT);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalRight, VerticalCenter
+ // HORIZONTAL_RIGHT, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::HorizontalRight);
+ Alignment::Type type(Alignment::HORIZONTAL_RIGHT);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalLeft, VerticalTop
+ // HORIZONTAL_LEFT, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::VerticalTop));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_TOP));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalCenter, VerticalTop
+ // HORIZONTAL_CENTER, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::VerticalTop);
+ Alignment::Type type(Alignment::VERTICAL_TOP);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalRight, VerticalTop
+ // HORIZONTAL_RIGHT, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalRight | Alignment::VerticalTop));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_TOP));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalLeft, VerticalBottom
+ // HORIZONTAL_LEFT, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::VerticalBottom));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalCenter, VerticalBottom
+ // HORIZONTAL_CENTER, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::VerticalBottom);
+ Alignment::Type type(Alignment::VERTICAL_BOTTOM);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
- // HorizontalRight, VerticalBottom
+ // HORIZONTAL_RIGHT, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalRight | Alignment::VerticalBottom));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
}
{
ToolkitTestApplication application;
- // Default, HorizontalCenter, VerticalCenter - Ensure they do not change!
+ // Default, HORIZONTAL_CENTER, VERTICAL_CENTER - Ensure they do not change!
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalCenter | Alignment::VerticalCenter));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalLeft, VerticalCenter
+ // HORIZONTAL_LEFT, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::HorizontalLeft);
+ Alignment::Type type(Alignment::HORIZONTAL_LEFT);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalRight, VerticalCenter
+ // HORIZONTAL_RIGHT, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::HorizontalRight);
+ Alignment::Type type(Alignment::HORIZONTAL_RIGHT);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalLeft, VerticalTop
+ // HORIZONTAL_LEFT, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::VerticalTop));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_TOP));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalCenter, VerticalTop
+ // HORIZONTAL_CENTER, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::VerticalTop);
+ Alignment::Type type(Alignment::VERTICAL_TOP);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalRight, VerticalTop
+ // HORIZONTAL_RIGHT, VERTICAL_TOP
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalRight | Alignment::VerticalTop));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_TOP));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalLeft, VerticalBottom
+ // HORIZONTAL_LEFT, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::VerticalBottom));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalCenter, VerticalBottom
+ // HORIZONTAL_CENTER, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::VerticalBottom);
+ Alignment::Type type(Alignment::VERTICAL_BOTTOM);
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
application.SendNotification();
}
- // HorizontalRight, VerticalBottom
+ // HORIZONTAL_RIGHT, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.SendNotification();
// Check default values
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
- Alignment::Type type(Alignment::Type(Alignment::HorizontalRight | Alignment::VerticalBottom));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
{
ToolkitTestApplication application;
- // Setting HorizontalLeft, HorizontalCenter
+ // Setting HORIZONTAL_LEFT, HORIZONTAL_CENTER
{
Alignment alignment = Alignment::New();
- Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::HorizontalCenter));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::HORIZONTAL_CENTER));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::HorizontalLeft & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK( Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::HORIZONTAL_LEFT & alignment.GetAlignmentType()) );
}
- // Setting HorizontalCenter, HorizontalRight
+ // Setting HORIZONTAL_CENTER, HORIZONTAL_RIGHT
{
Alignment alignment = Alignment::New();
- Alignment::Type type(Alignment::Type(Alignment::HorizontalCenter | Alignment::HorizontalRight));
+ Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_CENTER | Alignment::HORIZONTAL_RIGHT));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::HorizontalRight & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK( Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::HORIZONTAL_RIGHT & alignment.GetAlignmentType()) );
}
- // Setting VerticalTop, VerticalCenter
+ // Setting VERTICAL_TOP, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
- Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalCenter));
+ Alignment::Type type(Alignment::Type(Alignment::VERTICAL_TOP | Alignment::VERTICAL_CENTER));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::VerticalCenter & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::VerticalTop & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK( Alignment::VERTICAL_CENTER & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::VERTICAL_TOP & alignment.GetAlignmentType()) );
}
- // Setting VerticalCenter, VerticalBottom
+ // Setting VERTICAL_CENTER, VERTICAL_BOTTOM
{
Alignment alignment = Alignment::New();
- Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalBottom));
+ Alignment::Type type(Alignment::Type(Alignment::VERTICAL_TOP | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
// top will prevail in conflict
- DALI_TEST_CHECK( Alignment::VerticalTop & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::VerticalBottom & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK( Alignment::VERTICAL_TOP & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::VERTICAL_BOTTOM & alignment.GetAlignmentType()) );
}
END_TEST;
}
{
ToolkitTestApplication application;
- // Default, HorizonalCenter, VerticalCenter
+ // Default, HorizonalCenter, VERTICAL_CENTER
{
Alignment alignment = Alignment::New();
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalLeft, VerticalCenter
+ // HORIZONTAL_LEFT, VERTICAL_CENTER
{
- Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
- DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_LEFT);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalRight, VerticalCenter
+ // HORIZONTAL_RIGHT, VERTICAL_CENTER
{
- Alignment alignment = Alignment::New(Alignment::HorizontalRight);
- DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_RIGHT);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_CENTER, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalLeft, VerticalTop
+ // HORIZONTAL_LEFT, VERTICAL_TOP
{
- Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
- DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_LEFT, Alignment::VERTICAL_TOP);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_TOP, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalCenter, VerticalTop
+ // HORIZONTAL_CENTER, VERTICAL_TOP
{
- Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_CENTER, Alignment::VERTICAL_TOP);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_TOP, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalRight, VerticalTop
+ // HORIZONTAL_RIGHT, VERTICAL_TOP
{
- Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
- DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_RIGHT, Alignment::VERTICAL_TOP);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_TOP, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalLeft, VerticalBottom
+ // HORIZONTAL_LEFT, VERTICAL_BOTTOM
{
- Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
- DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_LEFT, Alignment::VERTICAL_BOTTOM);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_LEFT | Alignment::VERTICAL_BOTTOM, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalCenter, VerticalBottom
+ // HORIZONTAL_CENTER, VERTICAL_BOTTOM
{
- Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
- DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_CENTER, Alignment::VERTICAL_BOTTOM);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_CENTER | Alignment::VERTICAL_BOTTOM, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
application.SendNotification();
}
- // HorizontalRight, VerticalBottom
+ // HORIZONTAL_RIGHT, VERTICAL_BOTTOM
{
- Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
- DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
+ Alignment alignment = Alignment::New(Alignment::HORIZONTAL_RIGHT, Alignment::VERTICAL_BOTTOM);
+ DALI_TEST_EQUALS(Alignment::HORIZONTAL_RIGHT | Alignment::VERTICAL_BOTTOM, alignment.GetAlignmentType(), TEST_LOCATION);
alignment.Add(Actor::New());
application.GetScene().Add(alignment);
application.Render();
{
ToolkitTestApplication application;
- // ScaleToFill
+ // SCALE_TO_FILL
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(Alignment::ScaleNone, alignment.GetScaling(), TEST_LOCATION);
- alignment.SetScaling(Alignment::ScaleToFill);
- DALI_TEST_EQUALS(Alignment::ScaleToFill, alignment.GetScaling(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::SCALE_NONE, alignment.GetScaling(), TEST_LOCATION);
+ alignment.SetScaling(Alignment::SCALE_TO_FILL);
+ DALI_TEST_EQUALS(Alignment::SCALE_TO_FILL, alignment.GetScaling(), TEST_LOCATION);
application.Render();
application.SendNotification();
// For complete line coverage
- alignment.SetAlignmentType(Alignment::HorizontalLeft);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_LEFT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::HorizontalRight);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_RIGHT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalTop);
+ alignment.SetAlignmentType(Alignment::VERTICAL_TOP);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalBottom);
+ alignment.SetAlignmentType(Alignment::VERTICAL_BOTTOM);
application.Render();
application.SendNotification();
application.SendNotification();
}
- // ScaleToFitKeepAspect
+ // SCALE_TO_FIT_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(Alignment::ScaleNone, alignment.GetScaling(), TEST_LOCATION);
- alignment.SetScaling(Alignment::ScaleToFitKeepAspect);
- DALI_TEST_EQUALS(Alignment::ScaleToFitKeepAspect, alignment.GetScaling(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::SCALE_NONE, alignment.GetScaling(), TEST_LOCATION);
+ alignment.SetScaling(Alignment::SCALE_TO_FIT_KEEP_ASPECT);
+ DALI_TEST_EQUALS(Alignment::SCALE_TO_FIT_KEEP_ASPECT, alignment.GetScaling(), TEST_LOCATION);
application.Render();
application.SendNotification();
// For complete line coverage
- alignment.SetAlignmentType(Alignment::HorizontalLeft);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_LEFT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::HorizontalRight);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_RIGHT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalTop);
+ alignment.SetAlignmentType(Alignment::VERTICAL_TOP);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalBottom);
+ alignment.SetAlignmentType(Alignment::VERTICAL_BOTTOM);
application.Render();
application.SendNotification();
application.SendNotification();
}
- // ScaleToFillKeepAspect
+ // SCALE_TO_FILL_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(Alignment::ScaleNone, alignment.GetScaling(), TEST_LOCATION);
- alignment.SetScaling(Alignment::ScaleToFillKeepAspect);
- DALI_TEST_EQUALS(Alignment::ScaleToFillKeepAspect, alignment.GetScaling(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::SCALE_NONE, alignment.GetScaling(), TEST_LOCATION);
+ alignment.SetScaling(Alignment::SCALE_TO_FILL_KEEP_ASPECT);
+ DALI_TEST_EQUALS(Alignment::SCALE_TO_FILL_KEEP_ASPECT, alignment.GetScaling(), TEST_LOCATION);
application.Render();
application.SendNotification();
// For complete line coverage
- alignment.SetAlignmentType(Alignment::HorizontalLeft);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_LEFT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::HorizontalRight);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_RIGHT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalTop);
+ alignment.SetAlignmentType(Alignment::VERTICAL_TOP);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalBottom);
+ alignment.SetAlignmentType(Alignment::VERTICAL_BOTTOM);
application.Render();
application.SendNotification();
application.SendNotification();
}
- // ShrinkToFit
+ // SHRINK_TO_FIT
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(Alignment::ScaleNone, alignment.GetScaling(), TEST_LOCATION);
- alignment.SetScaling(Alignment::ShrinkToFit);
- DALI_TEST_EQUALS(Alignment::ShrinkToFit, alignment.GetScaling(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::SCALE_NONE, alignment.GetScaling(), TEST_LOCATION);
+ alignment.SetScaling(Alignment::SHRINK_TO_FIT);
+ DALI_TEST_EQUALS(Alignment::SHRINK_TO_FIT, alignment.GetScaling(), TEST_LOCATION);
application.Render();
application.SendNotification();
// For complete line coverage
- alignment.SetAlignmentType(Alignment::HorizontalLeft);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_LEFT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::HorizontalRight);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_RIGHT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalTop);
+ alignment.SetAlignmentType(Alignment::VERTICAL_TOP);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalBottom);
+ alignment.SetAlignmentType(Alignment::VERTICAL_BOTTOM);
application.Render();
application.SendNotification();
application.SendNotification();
}
- // ShrinkToFitKeepAspect
+ // SHRINK_TO_FIT_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
alignment.Add(Actor::New());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(Alignment::ScaleNone, alignment.GetScaling(), TEST_LOCATION);
- alignment.SetScaling(Alignment::ShrinkToFitKeepAspect);
- DALI_TEST_EQUALS(Alignment::ShrinkToFitKeepAspect, alignment.GetScaling(), TEST_LOCATION);
+ DALI_TEST_EQUALS(Alignment::SCALE_NONE, alignment.GetScaling(), TEST_LOCATION);
+ alignment.SetScaling(Alignment::SHRINK_TO_FIT_KEEP_ASPECT);
+ DALI_TEST_EQUALS(Alignment::SHRINK_TO_FIT_KEEP_ASPECT, alignment.GetScaling(), TEST_LOCATION);
application.Render();
application.SendNotification();
// For complete line coverage
- alignment.SetAlignmentType(Alignment::HorizontalLeft);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_LEFT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::HorizontalRight);
+ alignment.SetAlignmentType(Alignment::HORIZONTAL_RIGHT);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalTop);
+ alignment.SetAlignmentType(Alignment::VERTICAL_TOP);
application.Render();
application.SendNotification();
- alignment.SetAlignmentType(Alignment::VerticalBottom);
+ alignment.SetAlignmentType(Alignment::VERTICAL_BOTTOM);
application.Render();
application.SendNotification();
{
ToolkitTestApplication application;
- // ScaleToFill
+ // SCALE_TO_FILL
{
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleNone);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_NONE);
- alignment.SetScaling(Alignment::ScaleToFill);
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleToFill);
+ alignment.SetScaling(Alignment::SCALE_TO_FILL);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_TO_FILL);
}
- // ScaleToFitKeepAspect
+ // SCALE_TO_FIT_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleNone);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_NONE);
- alignment.SetScaling(Alignment::ScaleToFitKeepAspect);
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleToFitKeepAspect);
+ alignment.SetScaling(Alignment::SCALE_TO_FIT_KEEP_ASPECT);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_TO_FIT_KEEP_ASPECT);
}
- // ScaleToFillKeepAspect
+ // SCALE_TO_FILL_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleNone);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_NONE);
- alignment.SetScaling(Alignment::ScaleToFillKeepAspect);
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleToFillKeepAspect);
+ alignment.SetScaling(Alignment::SCALE_TO_FILL_KEEP_ASPECT);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_TO_FILL_KEEP_ASPECT);
}
- // ShrinkToFit
+ // SHRINK_TO_FIT
{
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleNone);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_NONE);
- alignment.SetScaling(Alignment::ShrinkToFit);
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ShrinkToFit);
+ alignment.SetScaling(Alignment::SHRINK_TO_FIT);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SHRINK_TO_FIT);
}
- // ShrinkToFitKeepAspect
+ // SHRINK_TO_FIT_KEEP_ASPECT
{
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ScaleNone);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SCALE_NONE);
- alignment.SetScaling(Alignment::ShrinkToFitKeepAspect);
- DALI_TEST_CHECK(alignment.GetScaling() == Alignment::ShrinkToFitKeepAspect);
+ alignment.SetScaling(Alignment::SHRINK_TO_FIT_KEEP_ASPECT);
+ DALI_TEST_CHECK(alignment.GetScaling() == Alignment::SHRINK_TO_FIT_KEEP_ASPECT);
}
END_TEST;
alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
application.GetScene().Add(alignment);
- alignment.TouchSignal().Connect(&TouchCallback);
+ alignment.TouchedSignal().Connect(&TouchCallback);
application.Render();
application.SendNotification();
"\"orientation\": [10,10,10,10],"
"\"clippingBox\": [10,10,10,10],"
"\"signals\": [{"
- "\"name\": \"touch\","
+ "\"name\": \"touched\","
"\"action\": \"quit\""
"}]"
"}]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"size\": [200, 200, 1],"
" \"orientation\": [0, 0, 30],"
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"play\","
" \"animation\": \"animate\""
" }]"
" \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
" \"sizeWidth\": \"{WIDTH}\","
" \"signals\": [{"
- " \"name\": \"touch\","
+ " \"name\": \"touched\","
" \"action\": \"quit\""
" }]"
"}]"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"actors\": [\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"set\",\n"
" \"actor\": \"subActor\",\n"
" \"property\": \"visible\",\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\"\n"
" }]\n"
" }]\n"
" \"name\": \"subActor\"\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\"\n"
" }],\n"
" \"notifications\": [{\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
" \"properties\": {\n"
"\"parentOrigin\": \"TOP_LEFT\","
"\"anchorPoint\": \"TOP_LEFT\","
"\"signals\": [{"
- "\"name\": \"touch\","
+ "\"name\": \"touched\","
"\"action\": \"quit\""
"}]"
"}]"
" \"visible\": false\n"
" }],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"hide\",\n"
" \"actor\": \"actor\",\n"
" \"childActor\": \"subActor\"\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
- " \"name\": \"touch\",\n"
+ " \"name\": \"touched\",\n"
" \"action\": \"show\",\n"
" \"parameters\": {\n"
" \"property1\" : 10,\n"
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Pinch);
+ dummyImpl.EnableGestureDetection(GestureType::PINCH);
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Pan);
+ dummyImpl.EnableGestureDetection(GestureType::PAN);
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::Tap);
+ dummyImpl.EnableGestureDetection(GestureType::TAP);
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.EnableGestureDetection(Gesture::LongPress);
+ dummyImpl.EnableGestureDetection(GestureType::LONG_PRESS);
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
}
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
// Enable when already enabled
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Pinch);
+ dummyImpl.DisableGestureDetection(GestureType::PINCH);
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Pan);
+ dummyImpl.DisableGestureDetection(GestureType::PAN);
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::Tap);
+ dummyImpl.DisableGestureDetection(GestureType::TAP);
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection(Gesture::LongPress);
+ dummyImpl.DisableGestureDetection(GestureType::LONG_PRESS);
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
}
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
- dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION );
DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION );
application.Render();
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
+ dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
///////////////////////////////////////////////////////////////////////////////////////////////////
-int UtcDaliControlImplHoverEvent(void)
-{
- ToolkitTestApplication application;
-
- {
- DummyControl dummy = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
-
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- application.GetScene().Add(dummy);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, false, TEST_LOCATION );
- Integration::HoverEvent event(1);
- Integration::Point point;
- point.SetDeviceId( 1 );
- point.SetState( PointState::MOTION );
- point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
- event.AddPoint(point);
- application.ProcessEvent( event );
- DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION );
-
- application.GetScene().Remove(dummy);
- }
-
- // Ensure full code coverage
- {
- DummyControl dummy = DummyControl::New();
-
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- application.GetScene().Add(dummy);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- Integration::HoverEvent event(1);
- Integration::Point point;
- point.SetDeviceId( 1 );
- point.SetState( PointState::MOTION );
- point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
- event.AddPoint(point);
- application.ProcessEvent( event );
-
- application.GetScene().Remove(dummy);
- }
- END_TEST;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-
int UtcDaliControlImplKeyEvent(void)
{
ToolkitTestApplication application;
///////////////////////////////////////////////////////////////////////////////////////////////////
-namespace
-{
-static bool WheelEventCallback(Actor actor, const WheelEvent& event)
-{
- return false;
-}
-}
-
-int UtcDaliControlImplWheelEvent(void)
-{
- ToolkitTestApplication application;
-
- {
- DummyControl dummy = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
-
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- application.GetScene().Add(dummy);
-
- dummy.WheelEventSignal().Connect(&WheelEventCallback);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, false, TEST_LOCATION );
-
- // simulate a wheel event
- Vector2 screenCoordinates( 10.0f, 10.0f );
- Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
- application.ProcessEvent( event );
- DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION );
-
- application.GetScene().Remove(dummy);
- }
-
- // Ensure full code coverage
- {
- DummyControl dummy = DummyControl::New();
-
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- application.GetScene().Add(dummy);
-
- dummy.WheelEventSignal().Connect(&WheelEventCallback);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- // simulate a wheel event
- Vector2 screenCoordinates( 20.0f, 20.0f );
- Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
- application.ProcessEvent( event );
-
- application.GetScene().Remove(dummy);
- }
- END_TEST;
-}
int UtcDaliControlImplSetStyleName(void)
{
application.Render();
Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control);
- impl.EnableGestureDetection(Gesture::Pinch);
+ impl.EnableGestureDetection(GestureType::PINCH);
// Scale becomes 0.6666666
TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
{
Control::OnChildRemove(child);
}
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
+ virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue )
{
Control::OnPropertySet(index, propertyValue);
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using ScaleToFill and animated vector image ( image: [600,600], view:[600,600] )" );
+ tet_infoline( "Create an ImageVisual using SCALE_TO_FILL and animated vector image ( image: [600,600], view:[600,600] )" );
ImageView imageView = ImageView::New();
Property::Map imageMap;
DALI_TEST_CHECK( scrollBar );
END_TEST;
- ScrollBar vertical = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar vertical = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( vertical );
- DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::Vertical );
+ DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::VERTICAL );
Property::Value value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
std::string scrollDirection = value.Get<std::string>();
- DALI_TEST_EQUALS( scrollDirection, "Vertical", TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollDirection, "VERTICAL", TEST_LOCATION );
- ScrollBar horizontal = ScrollBar::New(ScrollBar::Horizontal);
+ ScrollBar horizontal = ScrollBar::New(ScrollBar::HORIZONTAL);
DALI_TEST_CHECK( horizontal );
- DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::Horizontal );
+ DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::HORIZONTAL );
value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
scrollDirection = value.Get<std::string>();
- DALI_TEST_EQUALS( scrollDirection, "Horizontal", TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollDirection, "HORIZONTAL", TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::DownCast( handle );
DALI_TEST_CHECK( scrollBar );
- scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Vertical");
- scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Fixed");
+ scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "VERTICAL");
+ scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "FIXED");
- DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Vertical, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::VERTICAL, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
- scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Horizontal");
- scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Variable");
+ scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "HORIZONTAL");
+ scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "VARIABLE");
- DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Horizontal, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::HORIZONTAL, TEST_LOCATION );
+ DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
END_TEST;
}
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+ DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
float scrollBarHeight = 100.0f;
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
// Set the values to get notified when the scroll positions of the source actor goes above or below these values
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+ DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
// Change the direction of scroll bar to horizontal
- scrollBar.SetScrollDirection(ScrollBar::Horizontal);
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Horizontal );
+ scrollBar.SetScrollDirection(ScrollBar::HORIZONTAL);
+ DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::HORIZONTAL );
END_TEST;
}
DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
// Set the indicator height to be fixed to 50.0f
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
Property::Value value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
- DALI_TEST_EQUALS(value.Get<std::string>(), "Fixed", TEST_LOCATION );
+ DALI_TEST_EQUALS(value.Get<std::string>(), "FIXED", TEST_LOCATION );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( indicatorHeight, 50.0f, TEST_LOCATION );
// Set the indicator height to be variable
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
- DALI_TEST_EQUALS(value.Get<std::string>(), "Variable", TEST_LOCATION );
+ DALI_TEST_EQUALS(value.Get<std::string>(), "VARIABLE", TEST_LOCATION );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( scrollBar );
// Set the indicator height to be fixed
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
+ DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
// Set the indicator height to be variable
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
+ DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
END_TEST;
}
DALI_TEST_CHECK( indicator );
// Set the indicator height to be fixed to 50.0f
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
// Render and notify
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
// Set the indicator height to be fixed to 50.0f
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
application.GetScene().Add( scrollBar );
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
// Set the indicator height to be fixed to 50.0f
- scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+ scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
application.GetScene().Add( scrollBar );
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
ToolkitTestApplication application;
// Create a vertical scroll bar
- ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+ ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
DALI_TEST_CHECK( scrollBar );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
+ scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+ scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
+ scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+ scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2, 0.25f, TestAlphaFunction, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+ scrollView.ScrollTo( target2, 0.25f, TestAlphaFunction, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
Wait(application, 125);
// Check that the scroll animation should finish within just half of the specified duration with the above alpha function
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
// Confirm the final X coord has snapped to exactly one page ahead of the start page.
DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ // Change scroll mode during pan, should not crash
+ PerformGestureSwipe( application, startPos, direction, frames - 1, time, false );
+ try
+ {
+ scrollView.SetScrollSensitive(false);
+ DALI_TEST_CHECK(true);
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(false);
+ }
+
END_TEST;
}
scrollView.SetWrapMode(true);
- scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DirectionBiasLeft );
+ scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DIRECTION_BIAS_LEFT );
Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
// Check that the scroll position remains the same
DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
- scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DirectionBiasRight );
+ scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
// Check that it scrolls towards the right
Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
Wait(application);
// apply this constraint to scrollview
Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
Wait(application);
PerformGestureSwipe(application, CLAMP_TOUCH_START, Vector2(0.5f, 0.0f), 60, time, true);
DALI_TEST_CHECK( gOnSnapStartCalled );
- DALI_TEST_CHECK( gLastSnapType == Toolkit::Snap );
+ DALI_TEST_CHECK( gLastSnapType == Toolkit::SNAP );
// Second try a swipe.
PerformGestureSwipe(application, CLAMP_TOUCH_START, Vector2(20.0f, 0.0f), 60, time, true);
DALI_TEST_CHECK( gOnSnapStartCalled );
- DALI_TEST_CHECK( gLastSnapType == Toolkit::Flick );
+ DALI_TEST_CHECK( gLastSnapType == Toolkit::FLICK );
END_TEST;
}
ClampState clamped;
float value = domainX.Clamp(50.0f, 100.0f, 1.0f, clamped);
DALI_TEST_EQUALS( value, 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::NotClamped, TEST_LOCATION);
+ DALI_TEST_EQUALS( clamped, Dali::Toolkit::NOT_CLAMPED, TEST_LOCATION);
value = domainX.Clamp(-100.0f, 200.0f, 1.0f, clamped);
DALI_TEST_EQUALS( value, 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::ClampedToMin, TEST_LOCATION);
+ DALI_TEST_EQUALS( clamped, Dali::Toolkit::CLAMPED_TO_MIN, TEST_LOCATION);
value = domainX.Clamp(300.0f, 20.0f, 1.0f, clamped);
DALI_TEST_EQUALS( value, 180.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::ClampedToMax, TEST_LOCATION);
+ DALI_TEST_EQUALS( clamped, Dali::Toolkit::CLAMPED_TO_MAX, TEST_LOCATION);
END_TEST;
}
RulerPtr defaultRuler = new DefaultRuler();
DALI_TEST_CHECK( defaultRuler );
- DALI_TEST_EQUALS( defaultRuler->GetType(), Dali::Toolkit::Ruler::Free, TEST_LOCATION);
+ DALI_TEST_EQUALS( defaultRuler->GetType(), Dali::Toolkit::Ruler::FREE, TEST_LOCATION);
RulerPtr fixedRuler = new FixedRuler( 100.0f );
DALI_TEST_CHECK( fixedRuler );
- DALI_TEST_EQUALS( fixedRuler->GetType(), Dali::Toolkit::Ruler::Fixed, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetType(), Dali::Toolkit::Ruler::FIXED, TEST_LOCATION);
END_TEST;
}
// clamp state testing.
ClampState clamped;
DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, ClampedToMin, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, CLAMPED_TO_MIN, TEST_LOCATION );
DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, ClampedToMax, TEST_LOCATION );
+ DALI_TEST_EQUALS( clamped, CLAMPED_TO_MAX, TEST_LOCATION );
END_TEST;
}
Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, MoveActorConstraint );
constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
scrollView.ScrollTo( target, 0.0f );
constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::WRAP ) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
scrollView.ScrollTo( target, 0.0f );
application.SendNotification();
application.Render();
+ // Pan Press
+ TestGenerateMiniPan(application);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
END_TEST;
}
application.SendNotification();
application.Render();
+ // Pan the grab handle
+ uint32_t time = 100;
+ TestStartPan( application, Vector2(10.0f, 50.0f), Vector2(10.0f, 50.0f), time );
+ TestMovePan( application, Vector2(10.0f, 30.0f), time );
+ TestEndPan( application, Vector2(10.0f, 50.0f), time);
+ application.SendNotification();
+ application.Render();
+
+
// Release the grab handle.
event = Dali::Integration::TouchEvent();
event.AddPoint( GetPointUpInside( touchPos ) );
application.SendNotification();
toolbar.Add( control1 );
- toolbar.AddControl( control2, 0.1f, Alignment::HorizontalLeft, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control3, 0.1f, Alignment::HorizontalCenter, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control4, 0.1f, Alignment::HorizontalCenter, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control5, 0.1f, Alignment::HorizontalRight, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control2, 0.1f, Alignment::HORIZONTAL_LEFT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control3, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control4, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control5, 0.1f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
Actor control6 = CreateColorActor( Color::RED );
control6.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
application.Render();
application.SendNotification();
- toolbar.AddControl( control6, 0.4f, Alignment::HorizontalLeft, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control7, 0.2f, Alignment::HorizontalCenter, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control8, 0.2f, Alignment::HorizontalRight, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control6, 0.4f, Alignment::HORIZONTAL_LEFT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control7, 0.2f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl( control8, 0.2f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
}
catch( ... )
{
Actor control = CreateColorActor( Color::RED );
ToolBar toolbar = ToolBar::New();
- toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
+ toolbar.AddControl( control, 0.1f, Alignment::HORIZONTAL_LEFT );
toolbar.RemoveControl( control );
}
ToolBar toolbar01 = ToolBar::New();
ToolBar toolbar02 = ToolBar::New();
- toolbar01.AddControl( control01, 0.1f, Alignment::HorizontalLeft );
- toolbar02.AddControl( control02, 0.1f, Alignment::HorizontalLeft );
+ toolbar01.AddControl( control01, 0.1f, Alignment::HORIZONTAL_LEFT );
+ toolbar02.AddControl( control02, 0.1f, Alignment::HORIZONTAL_LEFT );
toolbar02.RemoveControl( control01 );
}
Actor control = CreateColorActor( Color::RED );
ToolBar toolbar = ToolBar::New();
- toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
+ toolbar.AddControl( control, 0.1f, Alignment::HORIZONTAL_LEFT );
toolbar.RemoveControl( control );
toolbar.RemoveControl( control );
application.Render();
view.GetNaturalSize();
- view.TouchSignal().Connect( &OnTouched );
+ view.TouchedSignal().Connect( &OnTouched );
// Touch event
Dali::Integration::TouchEvent event;
* @note The use of scaling property will override all constraints applied to actors.
*
* All actors added to an alignment are going to be set with the same anchor point and parent origin. And if the scaling property is set to a value
- * different than ScaleNone, constraints as well.
+ * different than SCALE_NONE, constraints as well.
*/
class DALI_TOOLKIT_API Alignment : public Control
{
*/
enum Type
{
- HorizontalLeft = 1, ///< Horizontal left alignment @SINCE_1_0.0
- HorizontalCenter = 2, ///< Horizontal center alignment @SINCE_1_0.0
- HorizontalRight = 4, ///< Horizontal right alignment @SINCE_1_0.0
- VerticalTop = 8, ///< Vertical top alignment @SINCE_1_0.0
- VerticalCenter = 16, ///< Vertical center alignment @SINCE_1_0.0
- VerticalBottom = 32 ///< Vertical bottom alignment @SINCE_1_0.0
+ HORIZONTAL_LEFT = 1, ///< HORIZONTAL left alignment @SINCE_1_9.28
+ HORIZONTAL_CENTER = 2, ///< HORIZONTAL center alignment @SINCE_1_9.28
+ HORIZONTAL_RIGHT = 4, ///< HORIZONTAL right alignment @SINCE_1_9.28
+ VERTICAL_TOP = 8, ///< VERTICAL top alignment @SINCE_1_9.28
+ VERTICAL_CENTER = 16, ///< VERTICAL center alignment @SINCE_1_9.28
+ VERTICAL_BOTTOM = 32 ///< VERTICAL bottom alignment @SINCE_1_9.28
};
/**
*/
enum Scaling
{
- ScaleNone, ///< The original size is kept. @SINCE_1_0.0
- ScaleToFill, ///< Scale added actors to fill alignment's boundary. Aspect ratio is not maintained. @SINCE_1_0.0
- ScaleToFitKeepAspect, ///< Scale added actors to fit within the alignment's boundary. Aspect ratio is maintained. @SINCE_1_0.0
- ScaleToFillKeepAspect, ///< Scale added actors to fill the alignment's boundary. Aspect ratio is maintained, and the actor may exceed the alignment's boundary. @SINCE_1_0.0
- ShrinkToFit, ///< If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is not maintained @SINCE_1_0.0
- ShrinkToFitKeepAspect, ///< If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is maintained @SINCE_1_0.0
+ SCALE_NONE, ///< The original size is kept. @SINCE_1_9.28
+ SCALE_TO_FILL, ///< Scale added actors to fill alignment's boundary. Aspect ratio is not maintained. @SINCE_1_9.28
+ SCALE_TO_FIT_KEEP_ASPECT, ///< Scale added actors to fit within the alignment's boundary. Aspect ratio is maintained. @SINCE_1_9.28
+ SCALE_TO_FILL_KEEP_ASPECT, ///< Scale added actors to fill the alignment's boundary. Aspect ratio is maintained, and the actor may exceed the alignment's boundary. @SINCE_1_9.28
+ SHRINK_TO_FIT, ///< If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is not maintained @SINCE_1_9.28
+ SHRINK_TO_FIT_KEEP_ASPECT, ///< If added actors are larger than the alignment's boundary it will be shrunk down to fit. Aspect ratio is maintained @SINCE_1_9.28
};
/**
* @brief Creates an alignment control.
*
* @SINCE_1_0.0
- * @param[in] horizontal Specifies how to align actors horizontally. Could be HorizontalLeft, HorizontalCenter or HorizontalRight. By default, HorizontalCenter
- * @param[in] vertical Specifies how to align actors vertically. Could be VerticalTop, VerticalCenter or VerticalBottom. By default, VerticalCenter
+ * @param[in] horizontal Specifies how to align actors horizontally. Could be HORIZONTAL_LEFT, HORIZONTAL_CENTER or HORIZONTAL_RIGHT. By default, HORIZONTAL_CENTER
+ * @param[in] vertical Specifies how to align actors vertically. Could be VERTICAL_TOP, VERTICAL_CENTER or VERTICAL_BOTTOM. By default, VERTICAL_CENTER
* @return A handle to the Alignment control
*/
- static Alignment New( Type horizontal = HorizontalCenter, Type vertical = VerticalCenter );
+ static Alignment New( Type horizontal = HORIZONTAL_CENTER, Type vertical = VERTICAL_CENTER );
/**
* @brief Copy constructor. Creates another handle that points to the same real object.
static Alignment DownCast( BaseHandle handle );
/**
- * @brief Sets the new alignment. By default, ( HorizontalCenter | VerticalCenter ).
+ * @brief Sets the new alignment. By default, ( HORIZONTAL_CENTER | VERTICAL_CENTER ).
*
* @SINCE_1_0.0
* @param[in] type The new alignment option
/**
* @brief The scrolling direction of the indicator.
* @details Name "scrollDirection", type Property::STRING.
- * Possible values are "Vertical" and "Horizontal".
+ * Possible values are "VERTICAL" and "HORIZONTAL".
* @SINCE_1_0.0
* @see SetScrollDirection()
*/
/**
* @brief The indicator height policy.
* @details Name "indicatorHeightPolicy", type Property::STRING.
- * Possible values are "Variable" and "Fixed".
+ * Possible values are "VARIABLE" and "FIXED".
* @SINCE_1_0.0
* @see SetIndicatorHeightPolicy()
*/
/**
* @brief The padding at the start of the indicator.
* @details Name "indicatorStartPadding", type Property::FLOAT.
- * For example, the padding at the top if scrollDirection is Vertical.
+ * For example, the padding at the top if scrollDirection is VERTICAL.
* @SINCE_1_1.36
*/
INDICATOR_START_PADDING,
/**
* @brief The padding at the end of the indicator.
* @details Name "indicatorEndPadding", type Property::FLOAT.
- * For example, the padding at the bottom if scrollDirection is Vertical.
+ * For example, the padding at the bottom if scrollDirection is VERTICAL.
* @SINCE_1_1.36
*/
INDICATOR_END_PADDING,
*/
enum Direction
{
- Vertical = 0, ///< Scroll in the vertical direction @SINCE_1_0.0
- Horizontal ///< Scroll in the horizontal direction @SINCE_1_0.0
+ VERTICAL = 0, ///< Scroll in the vertical direction @SINCE_1_9.28
+ HORIZONTAL ///< Scroll in the horizontal direction @SINCE_1_9.28
};
/**
*/
enum IndicatorHeightPolicy
{
- Variable = 0, ///< Variable height changed dynamically according to the length of scroll content @SINCE_1_0.0
- Fixed ///< Fixed height regardless of the length of scroll content @SINCE_1_0.0
+ VARIABLE = 0, ///< VARIABLE height changed dynamically according to the length of scroll content @SINCE_1_9.28
+ FIXED ///< FIXED height regardless of the length of scroll content @SINCE_1_9.28
};
/**
* @param[in] direction The direction of scroll bar (either vertically or horizontally)
* @return A pointer to the created ScrollBar
*/
- static ScrollBar New(Direction direction = Vertical);
+ static ScrollBar New(Direction direction = VERTICAL);
/**
* @brief Downcasts a handle to ScrollBar handle.
#include <dali/devel-api/adaptor-framework/sound-player.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/devel-api/events/hit-test-algorithm.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
{
bool handled = false;
- if( panEvent.state == AccessibilityGestureEvent::Started )
+ if( panEvent.state == AccessibilityGestureEvent::STARTED )
{
// Find the focusable actor at the event position
Dali::HitTestAlgorithm::Results results;
}
}
- // Gesture::Finished (Up) events are delivered with previous (Motion) event position
+ // GestureState::FINISHED (Up) events are delivered with previous (Motion) event position
// Use the real previous position; otherwise we may incorrectly get a ZERO velocity
- if ( AccessibilityGestureEvent::Finished != panEvent.state )
+ if ( AccessibilityGestureEvent::FINISHED != panEvent.state )
{
- // Store the previous position for next Gesture::Finished iteration.
+ // Store the previous position for next GestureState::FINISHED iteration.
mPreviousPosition = panEvent.previousPosition;
}
Actor rootActor = Stage::GetCurrent().GetRootLayer();
- Dali::PanGesture pan( static_cast<Dali::Gesture::State>(panEvent.state) );
-
- pan.time = panEvent.time;
- pan.numberOfTouches = panEvent.numberOfTouches;
- pan.screenPosition = panEvent.currentPosition;
- pan.screenDisplacement = mPreviousPosition - panEvent.currentPosition;
- pan.screenVelocity.x = pan.screenDisplacement.x / panEvent.timeDelta;
- pan.screenVelocity.y = pan.screenDisplacement.y / panEvent.timeDelta;
+ Dali::PanGesture pan = DevelPanGesture::New( static_cast<Dali::GestureState>(panEvent.state) );
+ DevelPanGesture::SetTime( pan, panEvent.time );
+ DevelPanGesture::SetNumberOfTouches( pan, panEvent.numberOfTouches );
+ DevelPanGesture::SetScreenPosition( pan, panEvent.currentPosition );
+ DevelPanGesture::SetScreenDisplacement( pan, mPreviousPosition - panEvent.currentPosition );
+ DevelPanGesture::SetScreenVelocity( pan, Vector2( pan.GetScreenDisplacement().x / panEvent.timeDelta, pan.GetScreenDisplacement().y / panEvent.timeDelta ) );
// Only handle the pan gesture when the current focused actor is scrollable or within a scrollable actor
while(mCurrentGesturedActor && mCurrentGesturedActor != rootActor && !handled)
{
Vector2 localCurrent;
control.ScreenToLocal( localCurrent.x, localCurrent.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
- pan.position = localCurrent;
+ DevelPanGesture::SetPosition( pan, localCurrent );
Vector2 localPrevious;
control.ScreenToLocal( localPrevious.x, localPrevious.y, mPreviousPosition.x, mPreviousPosition.y );
- pan.displacement = localCurrent - localPrevious;
- pan.velocity.x = pan.displacement.x / panEvent.timeDelta;
- pan.velocity.y = pan.displacement.y / panEvent.timeDelta;
+ DevelPanGesture::SetDisplacement( pan, localCurrent - localPrevious );
+ DevelPanGesture::SetVelocity( pan, Vector2( pan.GetDisplacement().x / panEvent.timeDelta, pan.GetDisplacement().y / panEvent.timeDelta ));
handled = GetImplementation( control ).OnAccessibilityPan(pan);
}
* @param[in] panEvent The pan event to be handled.
* @return whether the gesture is handled successfully or not.
*/
- virtual bool HandlePanGesture(const AccessibilityGestureEvent& panEvent);
+ bool HandlePanGesture(const AccessibilityGestureEvent& panEvent) override;
/**
* Change the accessibility status when Accessibility feature(screen-reader) turned on or off.
* @return whether the status is changed or not.
*/
- virtual bool ChangeAccessibilityStatus();
+ bool ChangeAccessibilityStatus() override;
/**
* Clear the accessibility focus from the current focused actor.
* @return whether the focus is cleared or not.
*/
- virtual bool ClearAccessibilityFocus();
+ bool ClearAccessibilityFocus() override;
/**
* Perform the accessibility action associated with a scroll event.
* @param touch The touch point (and time) of the event.
* @return whether the focus is cleared or not.
*/
- virtual bool AccessibilityActionScroll( Dali::TouchEvent& touch );
+ bool AccessibilityActionScroll( Dali::TouchEvent& touch ) override;
/**
* Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
* @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionPrevious(bool allowEndFeedback);
+ bool AccessibilityActionPrevious(bool allowEndFeedback) override;
/**
* Perform the accessibility action to move focus to the next focusable actor (by one finger flick down).
* @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionNext(bool allowEndFeedback);
+ bool AccessibilityActionNext(bool allowEndFeedback) override;
/**
* Perform the accessibility action to move focus to the previous focusable actor (by one finger flick left).
* @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionReadPrevious(bool allowEndFeedback);
+ bool AccessibilityActionReadPrevious(bool allowEndFeedback) override;
/**
* Perform the accessibility action to move focus to the next focusable actor (by one finger flick right).
* @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionReadNext(bool allowEndFeedback);
+ bool AccessibilityActionReadNext(bool allowEndFeedback) override;
/**
* Perform the accessibility action to focus and read the actor (by one finger tap or move).
* false if the action just read when the focus object is changed (i.e. over action)
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionRead(bool allowReadAgain);
+ bool AccessibilityActionRead(bool allowReadAgain) override;
/**
* Perform the accessibility action to activate the current focused actor (by one finger double tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionActivate();
+ bool AccessibilityActionActivate() override;
/**
* Perform the accessibility action to change the value when the current focused actor is a slider
* (by double finger down and move up and right).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionUp();
+ bool AccessibilityActionUp() override;
/**
* Perform the accessibility action to change the value when the current focused actor is a slider
* (by double finger down and move down and left).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionDown();
+ bool AccessibilityActionDown() override;
/**
* Perform the accessibility action to navigate back (by two fingers circle draw).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionBack();
+ bool AccessibilityActionBack() override;
/**
* Perform the accessibility action to scroll up the list and focus on the first item on the list
* after the scrolling and read the item (by two finger swipe up).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionScrollUp();
+ bool AccessibilityActionScrollUp() override;
/**
* Perform the accessibility action to scroll down the list and focus on the first item on the list
* after the scrolling and read the item (by two finger swipe down).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionScrollDown();
+ bool AccessibilityActionScrollDown() override;
/**
* Perform the accessibility action to scroll left to the previous page (by two finger swipe left).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionPageLeft();
+ bool AccessibilityActionPageLeft() override;
/**
* Perform the accessibility action to scroll right to the next page (by two finger swipe right).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionPageRight();
+ bool AccessibilityActionPageRight() override;
/**
* Perform the accessibility action to scroll up to the previous page (by one finger swipe left and right).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionPageUp();
+ bool AccessibilityActionPageUp() override;
/**
* Perform the accessibility action to scroll down to the next page (by one finger swipe right and left).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionPageDown();
+ bool AccessibilityActionPageDown() override;
/**
* Perform the accessibility action to move the focus to the first item on the screen
* (by one finger swipe up and down).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionMoveToFirst();
+ bool AccessibilityActionMoveToFirst() override;
/**
* Perform the accessibility action to move the focus to the last item on the screen
* (by one finger swipe down and up).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionMoveToLast();
+ bool AccessibilityActionMoveToLast() override;
/**
* Perform the accessibility action to move the focus to the first item on the top
* and read from the top item continuously (by three fingers single tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionReadFromTop();
+ bool AccessibilityActionReadFromTop() override;
/**
* Perform the accessibility action to move the focus to and read from the next item
* continuously (by three fingers double tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionReadFromNext();
+ bool AccessibilityActionReadFromNext() override;
/**
* Perform the accessibility action to move the focus to do the zooming (by one finger triple tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionZoom();
+ bool AccessibilityActionZoom() override;
/**
* Perform the accessibility action to pause/resume the current read out (by two fingers single tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionReadPauseResume();
+ bool AccessibilityActionReadPauseResume() override;
/**
* Perform the accessibility action to start/stop the current action (by two fingers double tap).
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionStartStop();
+ bool AccessibilityActionStartStop() override;
/**
* This function is connected to the TtsPlayer StateChangeSignal.
FocusIDPair mCurrentFocusActor; ///< The focus order and actor ID of current focused actor
Actor mCurrentGesturedActor; ///< The actor that will handle the gesture
Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the focusable actors for highlight
- Vector2 mPreviousPosition; ///< The previous pan position; useful for calculating velocity for Gesture::Finished events
+ Vector2 mPreviousPosition; ///< The previous pan position; useful for calculating velocity for GestureState::FINISHED events
unsigned int mRecursiveFocusMoveCounter; ///< The counter to count the number of recursive focus movement attempted before the focus movement is successful.
std::string mFocusSoundFilePath; ///< The path of the focus sound file
std::string mFocusChainEndSoundFilePath; ///< The path of the focus chain end sound file
switch( horizontalAlignment )
{
- case Dali::Toolkit::Alignment::HorizontalLeft:
+ case Dali::Toolkit::Alignment::HORIZONTAL_LEFT:
{
position.x += padding.left;
break;
}
- case Dali::Toolkit::Alignment::HorizontalRight:
+ case Dali::Toolkit::Alignment::HORIZONTAL_RIGHT:
{
position.x -= padding.right;
break;
}
- case Dali::Toolkit::Alignment::HorizontalCenter: // FALLTHROUGH
+ case Dali::Toolkit::Alignment::HORIZONTAL_CENTER: // FALLTHROUGH
default: // use center as default
{
if( currentSize.width + padding.left + padding.right >= parentSize.width )
switch( verticalAlignment )
{
- case Dali::Toolkit::Alignment::VerticalTop:
+ case Dali::Toolkit::Alignment::VERTICAL_TOP:
{
position.y += padding.top;
break;
}
- case Dali::Toolkit::Alignment::VerticalBottom:
+ case Dali::Toolkit::Alignment::VERTICAL_BOTTOM:
{
position.y -= padding.bottom;
break;
}
- case Dali::Toolkit::Alignment::VerticalCenter: // FALLTHROUGH
+ case Dali::Toolkit::Alignment::VERTICAL_CENTER: // FALLTHROUGH
default: // use center as default
{
if( currentSize.height + padding.top + padding.bottom >= parentSize.height )
void Alignment::SetAlignmentType( Toolkit::Alignment::Type type )
{
// Horizontal Alignment
- if( type & Toolkit::Alignment::HorizontalRight )
+ if( type & Toolkit::Alignment::HORIZONTAL_RIGHT )
{
- mHorizontal = Toolkit::Alignment::HorizontalRight;
+ mHorizontal = Toolkit::Alignment::HORIZONTAL_RIGHT;
}
- if( type & Toolkit::Alignment::HorizontalLeft )
+ if( type & Toolkit::Alignment::HORIZONTAL_LEFT )
{
- mHorizontal = Toolkit::Alignment::HorizontalLeft;
+ mHorizontal = Toolkit::Alignment::HORIZONTAL_LEFT;
}
- if( type & Toolkit::Alignment::HorizontalCenter )
+ if( type & Toolkit::Alignment::HORIZONTAL_CENTER )
{
- mHorizontal = Toolkit::Alignment::HorizontalCenter;
+ mHorizontal = Toolkit::Alignment::HORIZONTAL_CENTER;
}
// Vertical Alignment
- if( type & Toolkit::Alignment::VerticalBottom )
+ if( type & Toolkit::Alignment::VERTICAL_BOTTOM )
{
- mVertical = Toolkit::Alignment::VerticalBottom;
+ mVertical = Toolkit::Alignment::VERTICAL_BOTTOM;
}
- if( type & Toolkit::Alignment::VerticalTop )
+ if( type & Toolkit::Alignment::VERTICAL_TOP )
{
- mVertical = Toolkit::Alignment::VerticalTop;
+ mVertical = Toolkit::Alignment::VERTICAL_TOP;
}
- if( type & Toolkit::Alignment::VerticalCenter )
+ if( type & Toolkit::Alignment::VERTICAL_CENTER )
{
- mVertical = Toolkit::Alignment::VerticalCenter;
+ mVertical = Toolkit::Alignment::VERTICAL_CENTER;
}
RelayoutRequest();
// lay out the actors
Vector3 anchorPointAndParentOrigin = Vector3::ZERO;
anchorPointAndParentOrigin.z = 0.5f;
- // anchorPoint.x is initialized to 0.0, which is HorizontalLeft
- if( Toolkit::Alignment::HorizontalCenter == mHorizontal )
+ // anchorPoint.x is initialized to 0.0, which is HORIZONTAL_LEFT
+ if( Toolkit::Alignment::HORIZONTAL_CENTER == mHorizontal )
{
anchorPointAndParentOrigin.x = 0.5f;
}
- else if( Toolkit::Alignment::HorizontalRight == mHorizontal )
+ else if( Toolkit::Alignment::HORIZONTAL_RIGHT == mHorizontal )
{
anchorPointAndParentOrigin.x = 1.0f;
}
- // anchorPoint.y is initialized to 0.0, which is VerticalTop
- if( Toolkit::Alignment::VerticalCenter == mVertical )
+ // anchorPoint.y is initialized to 0.0, which is VERTICAL_TOP
+ if( Toolkit::Alignment::VERTICAL_CENTER == mVertical )
{
anchorPointAndParentOrigin.y = 0.5f;
}
- else if( Toolkit::Alignment::VerticalBottom == mVertical )
+ else if( Toolkit::Alignment::VERTICAL_BOTTOM == mVertical )
{
anchorPointAndParentOrigin.y = 1.0f;
}
// no point trying to squeeze actors into too small size
switch( mScaling )
{
- case Toolkit::Alignment::ScaleNone:
+ case Toolkit::Alignment::SCALE_NONE:
{
// Nothing to do
renegotiate = false;
break;
}
- case Toolkit::Alignment::ScaleToFill:
+ case Toolkit::Alignment::SCALE_TO_FILL:
{
// Nothing to do, newChildSize is already full size minus padding
break;
}
- case Toolkit::Alignment::ScaleToFitKeepAspect:
+ case Toolkit::Alignment::SCALE_TO_FIT_KEEP_ASPECT:
{
newChildSize = currentChildSize * std::min( ( newChildSize.width / currentChildSize.width ), ( newChildSize.height / currentChildSize.height ) );
break;
}
- case Toolkit::Alignment::ScaleToFillKeepAspect:
+ case Toolkit::Alignment::SCALE_TO_FILL_KEEP_ASPECT:
{
newChildSize = currentChildSize * std::max( ( newChildSize.width / currentChildSize.width ), ( newChildSize.height / currentChildSize.height ) );
break;
}
- case Toolkit::Alignment::ShrinkToFit:
+ case Toolkit::Alignment::SHRINK_TO_FIT:
{
newChildSize = Vector2( std::min( newChildSize.width, currentChildSize.width ), std::min( newChildSize.height, currentChildSize.height ) );
break;
}
- case Toolkit::Alignment::ShrinkToFitKeepAspect:
+ case Toolkit::Alignment::SHRINK_TO_FIT_KEEP_ASPECT:
{
// check source size vs target size to see if we need to shrink
float widthScale = ( newChildSize.width < currentChildSize.width ) ? (newChildSize.width / currentChildSize.width) : 1.f;
: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
mHorizontal( horizontal ),
mVertical( vertical ),
- mScaling( Toolkit::Alignment::ScaleNone ),
+ mScaling( Toolkit::Alignment::SCALE_NONE ),
mPadding( 0.f, 0.f, 0.f, 0.f )
{
}
/**
* @copydoc Control::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
private:
private:
- virtual void OnInitialize();
- virtual void OnSizeSet(const Vector3& targetSize);
+ void OnInitialize() override;
+ void OnSizeSet(const Vector3& targetSize) override;
/**
* @copydoc Control::OnChildAdd()
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnChildRemove()
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
void AllocateResources();
void CreateRenderTasks();
self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- self.TouchSignal().Connect( this, &Button::OnTouch );
+ self.TouchedSignal().Connect( this, &Button::OnTouch );
}
bool Button::OnAccessibilityActivated()
* @copydoc Toolkit::Control::OnInitialize()
* @note If overridden by deriving button classes, then an up-call to Button::OnInitialize MUST be made at the start.
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Control::OnAccessibilityActivated()
*/
- virtual bool OnAccessibilityActivated();
+ bool OnAccessibilityActivated() override;
/**
* @copydoc Toolkit::Control::OnKeyboardEnter()
*/
- virtual bool OnKeyboardEnter();
+ bool OnKeyboardEnter() override;
/**
* @copydoc Toolkit::Control::OnSceneDisconnection()
* @note If overridden by deriving button classes, then an up-call to Button::OnSceneDisconnection MUST be made at the end.
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
/**
* @copydoc Toolkit::Control::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Toolkit::Control::GetNaturalSize
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Toolkit::Control::OnSetResizePolicy
*/
- virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
+ void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) override;
/**
* @copydoc Toolkit::Control::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
private:
/**
* @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
private:
/**
* @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
private:
/**
* @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Internal::Button::OnStateChange
*/
- virtual void OnStateChange( State newState );
+ void OnStateChange( State newState ) override;
/**
* @copydoc Toolkit::Internal::Button::OnToggleReleased
*/
- virtual bool OnToggleReleased();
+ bool OnToggleReleased() override;
private:
/**
* @copydoc Toolkit::Internal::Button::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Internal::Button::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* This method is called when the button is pressed.
*/
- virtual void OnPressed();
+ void OnPressed() override;
private:
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Tap );
+ controlImpl.EnableGestureDetection( GestureType::TAP );
controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Pan );
+ controlImpl.EnableGestureDetection( GestureType::PAN );
controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
{
- controlImpl.EnableGestureDetection( Gesture::Pinch );
+ controlImpl.EnableGestureDetection( GestureType::PINCH );
controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
}
else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
{
- controlImpl.EnableGestureDetection( Gesture::LongPress );
+ controlImpl.EnableGestureDetection( GestureType::LONG_PRESS );
controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
}
}
* @param[in] object The visual whose resources are ready
* @note Overriding method in Visual::EventObserver.
*/
- virtual void ResourceReady( Visual::Base& object ) override;
+ void ResourceReady( Visual::Base& object ) override;
/**
* @brief Called when an event occurs.
* @param[in] signalId The signal to emit. See Visual to find supported signals
* @note Overriding method in Visual::EventObserver.
*/
- virtual void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) override;
+ void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) override;
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
/**
* @copydoc Toolkit::Internal::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
*/
- virtual void OnSizeSet( const Vector3& targetSize );
+ void OnSizeSet( const Vector3& targetSize ) override;
/**
* @copydoc Toolkit::Internal::Control::OnSceneConnection
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Toolkit::Internal::Control::OnSceneDisconnection
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
/**
* @copydoc Toolkit::Internal::Control::OnChildAdd
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Toolkit::Internal::Control::OnChildRemove
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
private:
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::OnChildAdd(Actor& child)
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnChildRemove(Actor& child)
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
/**
* @copydoc Control::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::RelayoutDependentOnChildren()
*/
- virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
+ bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) override;
/**
* @copydoc Control::GetNextKeyboardFocusableActor
*/
- virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled );
+ Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled ) override;
/**
* @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
*/
- virtual void OnSizeSet( const Vector3& size );
+ void OnSizeSet( const Vector3& size ) override;
/**
* @copydoc OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type )
private:
- virtual void OnInitialize();
- virtual void OnSizeSet(const Vector3& targetSize);
+ void OnInitialize() override;
+ void OnSizeSet(const Vector3& targetSize) override;
/**
* @copydoc Control::OnChildAdd()
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnChildRemove()
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
void SetBlurBellCurveWidth(float blurBellCurveWidth);
float CalcGaussianWeight(float x);
/**
* @copydoc Toolkit::Control::GetNaturalSize
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Toolkit::Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width );
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Toolkit::Control::GetWidthForHeight()
*/
- virtual float GetWidthForHeight( float height );
+ float GetWidthForHeight( float height ) override;
/**
* @copydoc Toolkit::Control::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
private:
private:
- virtual void OnSizeSet(const Vector3& targetSize);
+ void OnSizeSet(const Vector3& targetSize) override;
private:
/**
* @copydoc Control::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @brief Called to load both geometry (.obj) and material (.mtl) files
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
private:
/**
* @copydoc Control::OnSceneConnection( int depth )
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Control::OnRelayout()
/**
* @copydoc PageTurnView::OnPageTurnViewInitialize
*/
- virtual void OnPageTurnViewInitialize();
+ void OnPageTurnViewInitialize() override;
/**
* @copydoc PageTurnView::OnAddPage
*/
- virtual void OnAddPage( Actor newPage, bool isLeftSide );
+ void OnAddPage( Actor newPage, bool isLeftSide ) override;
/**
* @copydoc PageTurnView::SetPanPosition
*/
- virtual Vector2 SetPanPosition( const Vector2& gesturePosition );
+ Vector2 SetPanPosition( const Vector2& gesturePosition ) override;
/**
* @copydoc PageTurnView::SetPanActor
*/
- virtual void SetPanActor( const Vector2& panPosition );
+ void SetPanActor( const Vector2& panPosition ) override;
private:
/**
* @copydoc PageTurnView::OnPageTurnViewInitialize
*/
- virtual void OnPageTurnViewInitialize();
+ void OnPageTurnViewInitialize() override;
/**
* @copydoc PageTurnView::SetPanPosition
*/
- virtual Vector2 SetPanPosition( const Vector2& gesturePosition );
+ Vector2 SetPanPosition( const Vector2& gesturePosition ) override;
/**
* @copydoc PageTurnView::SetPanActor
*/
- virtual void SetPanActor( const Vector2& panPosition );
+ void SetPanActor( const Vector2& panPosition ) override;
/**
* @copydoc PageTurnView::OnPossibleOutwardsFlick
*/
- virtual void OnPossibleOutwardsFlick( const Vector2& panPosition, float gestureSpeed );
+ void OnPossibleOutwardsFlick( const Vector2& panPosition, float gestureSpeed ) override;
/**
* @copydoc PageTurnView::OnTurnedOver
*/
- virtual void OnTurnedOver( Actor actor, bool isLeftSide );
+ void OnTurnedOver( Actor actor, bool isLeftSide ) override;
private:
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mPages[0].actor.SetProperty( Actor::Property::VISIBLE,true);
// enable the pan gesture which is attached to the control
- EnableGestureDetection(Gesture::Type(Gesture::Pan));
+ EnableGestureDetection(GestureType::Value(GestureType::PAN));
}
Shader PageTurnView::CreateShader( const Property::Map& shaderMap )
void PageTurnView::OnPan( const PanGesture& gesture )
{
// the pan gesture is attached to control itself instead of each page
- switch( gesture.state )
+ switch( gesture.GetState() )
{
- case Gesture::Started:
+ case GestureState::STARTED:
{
// check whether the undergoing turning page number already reaches the maximum allowed
if( mPageUpdated && mAnimatingCount< MAXIMUM_TURNING_NUM && mSlidingCount < 1 )
{
- SetPanActor( gesture.position ); // determine which page actor is panned
+ const Vector2& position = gesture.GetPosition();
+ SetPanActor( position ); // determine which page actor is panned
if( mTurningPageIndex != -1 && mPages[mTurningPageIndex % NUMBER_OF_CACHED_PAGES].actor.GetParent() != Self()) // if the page is added to turning layer,it is undergoing an animation currently
{
mTurningPageIndex = -1;
}
- PanStarted( SetPanPosition( gesture.position ) ); // pass in the pan position in the local page coordinate
+ PanStarted( SetPanPosition( position ) ); // pass in the pan position in the local page coordinate
}
else
{
}
break;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
- PanContinuing( SetPanPosition( gesture.position ) ); // pass in the pan position in the local page coordinate
+ PanContinuing( SetPanPosition( gesture.GetPosition() ) ); // pass in the pan position in the local page coordinate
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled:
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED:
{
- PanFinished( SetPanPosition( gesture.position ), gesture.GetSpeed() );
+ PanFinished( SetPanPosition( gesture.GetPosition() ), gesture.GetSpeed() );
break;
}
- case Gesture::Clear:
- case Gesture::Possible:
+ case GestureState::CLEAR:
+ case GestureState::POSSIBLE:
default:
{
break;
/**
* @copydoc Toolkit::Control::OnPan
*/
- virtual void OnPan( const PanGesture& gesture );
+ void OnPan( const PanGesture& gesture ) override;
/**
* @copydoc Toolkit::Control::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc CustomActorImpl::OnSceneDisconnection()
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
private: // implemented differently by PageTurnLandscapeView and PageTurnPortraitView
if( ! mTouchTransparent )
{
// Connect all the signals and set us up to consume all touch events
- mBacking.TouchSignal().Connect( this, &Popup::OnBackingTouched );
- mPopupBackgroundImage.TouchSignal().Connect( this, &Popup::OnDialogTouched );
- mPopupLayout.TouchSignal().Connect( this, &Popup::OnDialogTouched );
+ mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
}
else
{
// We are touch transparent so disconnect all signals and ensure our layer does not consumed all touch events
- mBacking.TouchSignal().Disconnect( this, &Popup::OnBackingTouched );
- mPopupBackgroundImage.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
- mPopupLayout.TouchSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mBacking.TouchedSignal().Disconnect( this, &Popup::OnBackingTouched );
+ mPopupBackgroundImage.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched );
+ mPopupLayout.TouchedSignal().Disconnect( this, &Popup::OnDialogTouched );
mLayer.SetProperty( Layer::Property::CONSUMES_TOUCH, false );
}
}
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* Called whenever the popup layout is re-set up.
/**
* Called when the popup is directly or indirectly parented to the stage.
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* From Control; called after a child has been added to the owning actor.
* @param[in] child The child which has been added.
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnRelayOut()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::OnSetResizePolicy()
*/
- virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
+ void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) override;
/**
* @copydoc Control::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width );
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Control::GetWidthForHeight()
*/
- virtual float GetWidthForHeight( float height );
+ float GetWidthForHeight( float height ) override;
/**
* @copydoc Control::OnKeyEvent()
*/
- virtual bool OnKeyEvent( const KeyEvent& event );
+ bool OnKeyEvent( const KeyEvent& event ) override;
/**
* @copydoc Control::GetNextKeyboardFocusableActor()
/**
* @copydoc CustomActorImpl::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc CustomActorImpl::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
private:
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* Get the range of the valid values the ProgressBar handle can move between
/**
* Check if we should start animating
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
private:
}
else if( node->GetType() == TreeNode::INTEGER )
{
- int32_t tempNum;
+ int32_t tempNum = 0;
ReadInt( node, tempNum );
num = static_cast<float>( tempNum );
returnValue = true;
DALI_TYPE_REGISTRATION_END()
-const char* SCROLL_DIRECTION_NAME[] = {"Vertical", "Horizontal"};
-const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
+const char* SCROLL_DIRECTION_NAME[] = {"VERTICAL", "HORIZONTAL"};
+const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"VARIABLE", "FIXED"};
}
mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
mTransientIndicatorDuration(DEFAULT_INDICATOR_TRANSIENT_DURATION),
mScrollStart(0.0f),
- mGestureDisplacement( Vector3::ZERO ),
+ mGestureDisplacement( Vector2::ZERO ),
mCurrentScrollPosition(0.0f),
- mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
+ mIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE),
mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
mIndicatorMinimumHeight(DEFAULT_INDICATOR_MINIMUM_HEIGHT),
mIndicatorStartPadding(DEFAULT_INDICATOR_START_PADDING),
mIndicatorFirstShow = true;
Self().Add( mIndicator );
- EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
+ EnableGestureDetection( GestureType::Value( GestureType::PAN ) );
PanGestureDetector detector( GetPanGestureDetector() );
detector.DetachAll();
}
// Set indicator height according to the indicator's height policy
- if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
+ if(mIndicatorHeightPolicy == Toolkit::ScrollBar::FIXED)
{
mIndicator.SetProperty( Actor::Property::SIZE, Vector2( Self().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, mIndicatorFixedHeight) );
}
{
Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast(scrollableHandle);
- switch(gesture.state)
+ switch(gesture.GetState())
{
- case Gesture::Started:
+ case Dali::GestureState::STARTED:
{
if( !mPanProcessTimer )
{
ShowIndicator();
mScrollStart = scrollableHandle.GetCurrentProperty< float >( mPropertyScrollPosition );
- mGestureDisplacement = Vector3::ZERO;
+ mGestureDisplacement = Vector2::ZERO;
mIsPanning = true;
break;
}
- case Gesture::Continuing:
+ case Dali::GestureState::CONTINUING:
{
- mGestureDisplacement.x += gesture.displacement.x;
- mGestureDisplacement.y += gesture.displacement.y;
+ mGestureDisplacement += gesture.GetDisplacement();
float minScrollPosition = scrollableHandle.GetCurrentProperty<float>( mPropertyMinScrollPosition );
float maxScrollPosition = scrollableHandle.GetCurrentProperty<float>( mPropertyMaxScrollPosition );
void ScrollBar::OnSizeSet( const Vector3& size )
{
- if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
+ if(mIndicatorHeightPolicy == Toolkit::ScrollBar::FIXED)
{
mIndicator.SetProperty( Actor::Property::SIZE, Vector2( size.width, mIndicatorFixedHeight ) );
}
{
mIndicatorFixedHeight = height;
- if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
+ if(mIndicatorHeightPolicy == Toolkit::ScrollBar::FIXED)
{
mIndicator.SetProperty( Actor::Property::SIZE, Vector2( Self().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, mIndicatorFixedHeight) );
}
void ScrollBar::OnScrollDirectionPropertySet( Property::Value propertyValue )
{
std::string directionName( propertyValue.Get<std::string>() );
- if(directionName == "Vertical")
+ if(directionName == "VERTICAL")
{
- SetScrollDirection(Toolkit::ScrollBar::Vertical);
+ SetScrollDirection(Toolkit::ScrollBar::VERTICAL);
}
- else if(directionName == "Horizontal")
+ else if(directionName == "HORIZONTAL")
{
- SetScrollDirection(Toolkit::ScrollBar::Horizontal);
+ SetScrollDirection(Toolkit::ScrollBar::HORIZONTAL);
}
else
{
void ScrollBar::OnIndicatorHeightPolicyPropertySet( Property::Value propertyValue )
{
std::string policyName( propertyValue.Get<std::string>() );
- if(policyName == "Variable")
+ if(policyName == "VARIABLE")
{
- SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+ SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
}
- else if(policyName == "Fixed")
+ else if(policyName == "FIXED")
{
- SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+ SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
}
else
{
/**
* @copydoc Toolkit::Control::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Control::OnPan
*/
- virtual void OnPan( const PanGesture& gesture );
+ void OnPan( const PanGesture& gesture ) override;
/**
* @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
*/
- virtual void OnSizeSet( const Vector3& size );
+ void OnSizeSet( const Vector3& size ) override;
private:
float mTransientIndicatorDuration; ///< The duration before hiding transient indicator
float mScrollStart; ///< Scroll Start position (start of drag)
- Vector3 mGestureDisplacement; ///< Gesture Displacement.
+ Vector2 mGestureDisplacement; ///< Gesture Displacement.
float mCurrentScrollPosition; ///< The current scroll position updated by the pan gesture
// Color constraint
constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, DepthColorConstraint( itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns ) );
constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
- constraint.SetRemoveAction( Dali::Constraint::Discard );
+ constraint.SetRemoveAction( Dali::Constraint::DISCARD );
constraint.Apply();
// Visibility constraint
constraint = Constraint::New< bool >( actor, Actor::Property::VISIBLE, DepthVisibilityConstraint( itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns ) );
constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
- constraint.SetRemoveAction( Dali::Constraint::Discard );
+ constraint.SetRemoveAction( Dali::Constraint::DISCARD );
constraint.Apply();
}
}
/**
* @copydoc ItemLayout::GetScrollSpeedFactor()
*/
- virtual float GetScrollSpeedFactor() const;
+ float GetScrollSpeedFactor() const override;
/**
* @copydoc ItemLayout::GetMaximumSwipeSpeed()
*/
- virtual float GetMaximumSwipeSpeed() const;
+ float GetMaximumSwipeSpeed() const override;
/**
* @copydoc ItemLayout::GetItemFlickAnimationDuration()
*/
- virtual float GetItemFlickAnimationDuration() const;
+ float GetItemFlickAnimationDuration() const override;
/**
* @copydoc ItemLayout::GetClosestOnScreenLayoutPosition()
*/
- virtual float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize);
+ float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) override;
/**
* @copydoc ItemLayout::GetNextFocusItemID()
*/
- virtual int GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled);
+ int GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) override;
private:
/**
* @copydoc ItemLayout::GetMinimumLayoutPosition()
*/
- virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
+ float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetClosestAnchorPosition()
*/
- virtual float GetClosestAnchorPosition(float layoutPosition) const;
+ float GetClosestAnchorPosition(float layoutPosition) const override;
/**
* @copydoc ItemLayout::GetItemScrollToPosition()
*/
- virtual float GetItemScrollToPosition(unsigned int itemId) const;
+ float GetItemScrollToPosition(unsigned int itemId) const override;
/**
* @copydoc ItemLayout::GetItemsWithinArea()
*/
- virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
+ ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetReserveItemCount()
*/
- virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
+ unsigned int GetReserveItemCount(Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetDefaultItemSize()
*/
- virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
+ void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const override;
/**
* @copydoc ItemLayout::GetScrollDirection()
*/
- virtual Degree GetScrollDirection() const;
+ Degree GetScrollDirection() const override;
/**
* @copydoc ItemLayout::ApplyConstraints()
*/
- virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
+ void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor ) override;
/**
* @copydoc ItemLayout::GetItemPosition()
*/
- virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
+ Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const override;
protected:
// Color constraint
constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, &GridColorConstraint );
- constraint.SetRemoveAction( Dali::Constraint::Discard );
+ constraint.SetRemoveAction( Dali::Constraint::DISCARD );
constraint.Apply();
// Visibility constraint
}
constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
- constraint.SetRemoveAction( Dali::Constraint::Discard );
+ constraint.SetRemoveAction( Dali::Constraint::DISCARD );
constraint.Apply();
}
}
/**
* @copydoc ItemLayout::GetScrollSpeedFactor()
*/
- virtual float GetScrollSpeedFactor() const;
+ float GetScrollSpeedFactor() const override;
/**
* @copydoc ItemLayout::GetMaximumSwipeSpeed()
*/
- virtual float GetMaximumSwipeSpeed() const;
+ float GetMaximumSwipeSpeed() const override;
/**
* @copydoc ItemLayout::GetItemFlickAnimationDuration()
*/
- virtual float GetItemFlickAnimationDuration() const;
+ float GetItemFlickAnimationDuration() const override;
/**
* @copydoc ItemLayout::GetClosestOnScreenLayoutPosition()
*/
- virtual float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize);
+ float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) override;
/**
* @copydoc ItemLayout::GetNextFocusItemID()
*/
- virtual int GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled);
+ int GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) override;
private:
/**
* @copydoc ItemLayout::GetMinimumLayoutPosition()
*/
- virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
+ float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetClosestAnchorPosition()
*/
- virtual float GetClosestAnchorPosition(float layoutPosition) const;
+ float GetClosestAnchorPosition(float layoutPosition) const override;
/**
* @copydoc ItemLayout::GetItemScrollToPosition()
*/
- virtual float GetItemScrollToPosition(unsigned int itemId) const;
+ float GetItemScrollToPosition(unsigned int itemId) const override;
/**
* @copydoc ItemLayout::GetItemsWithinArea()
*/
- virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
+ ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetReserveItemCount()
*/
- virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
+ unsigned int GetReserveItemCount(Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetDefaultItemSize()
*/
- virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
+ void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const override;
/**
* @copydoc ItemLayout::GetScrollDirection()
*/
- virtual Degree GetScrollDirection() const;
+ Degree GetScrollDirection() const override;
/**
* @copydoc ItemLayout::ApplyConstraints()
*/
- virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
+ void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor ) override;
/**
* @copydoc ItemLayout::GetItemPosition()
*/
- virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
+ Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const override;
protected:
}
ItemView::ItemView(ItemFactory& factory)
-: Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS | REQUIRES_WHEEL_EVENTS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
+: Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
mItemFactory(factory),
mItemsParentOrigin(ParentOrigin::CENTER),
mItemsAnchorPoint(AnchorPoint::CENTER),
mScrollDistance(0.0f),
mScrollSpeed(0.0f),
mScrollOvershoot(0.0f),
- mGestureState(Gesture::Clear),
+ mGestureState(GestureState::CLEAR),
mAnimatingOvershootOn(false),
mAnimateOvershootOff(false),
mAnchoringEnabled(false),
Vector2 stageSize = Stage::GetCurrent().GetSize();
mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
- self.TouchSignal().Connect( this, &ItemView::OnTouch );
- EnableGestureDetection(Gesture::Type(Gesture::Pan));
+ self.TouchedSignal().Connect( this, &ItemView::OnTouch );
+ EnableGestureDetection(GestureType::Value(GestureType::PAN));
mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
mWheelEventFinishedTimer.TickSignal().Connect( this, &ItemView::OnWheelEventFinished );
SetRefreshInterval(DEFAULT_REFRESH_INTERVAL_LAYOUT_POSITIONS);
+
+ // Connect wheel event
+ self.WheelEventSignal().Connect( this, &ItemView::OnWheelEvent );
}
ItemView::~ItemView()
Scrollable::OnChildAdd( child );
}
-bool ItemView::OnWheelEvent(const WheelEvent& event)
+bool ItemView::OnWheelEvent(Actor actor, const WheelEvent& event)
{
// Respond the wheel event to scroll
if (mActiveLayout)
if ( touch.GetState( 0 ) == PointState::DOWN )
{
// Cancel ongoing scrolling etc.
- mGestureState = Gesture::Clear;
+ mGestureState = GestureState::CLEAR;
mScrollDistance = 0.0f;
mScrollSpeed = 0.0f;
// Short-circuit if there is no active layout
if (!mActiveLayout)
{
- mGestureState = Gesture::Clear;
+ mGestureState = GestureState::CLEAR;
return;
}
- mGestureState = gesture.state;
+ mGestureState = gesture.GetState();
switch (mGestureState)
{
- case Gesture::Finished:
+ case GestureState::FINISHED:
{
// Swipe Detection
if (fabsf(mScrollDistance) > mMinimumSwipeDistance &&
}
break;
- case Gesture::Started: // Fall through
+ case GestureState::STARTED: // Fall through
{
mTotalPanDisplacement = Vector2::ZERO;
mScrollStartedSignal.Emit(GetCurrentScrollPosition());
mRefreshEnabled = true;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
- mScrollDistance = CalculateScrollDistance(gesture.displacement, *mActiveLayout);
+ const Vector2& displacement = gesture.GetDisplacement();
+ mScrollDistance = CalculateScrollDistance(displacement, *mActiveLayout);
mScrollSpeed = Clamp((gesture.GetSpeed() * gesture.GetSpeed() * mActiveLayout->GetFlickSpeedFactor() * MILLISECONDS_PER_SECONDS), 0.0f, mActiveLayout->GetMaximumSwipeSpeed());
// Refresh order depends on the direction of the scroll; negative is towards the last item.
( firstItemScrollPosition <= mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), layoutSize) &&
currentOvershoot > -1.0f ) )
{
- mTotalPanDisplacement += gesture.displacement;
+ mTotalPanDisplacement += displacement;
}
mScrollOvershoot = CalculateScrollOvershoot();
}
break;
- case Gesture::Cancelled:
+ case GestureState::CANCELLED:
{
mScrollAnimation = DoAnchoring();
}
* From CustomActorImpl; called after a child has been added to the owning actor.
* @param[in] child The child which has been added.
*/
- virtual void OnChildAdd(Actor& child);
+ void OnChildAdd(Actor& child) override;
/**
- * From CustomActorImpl; called after a wheel-event is received by the owning actor.
+ * Called after a wheel-event is received by the owning actor.
+ * @param[in] actor Actor associated with the wheel event.
* @param[in] event The wheel event.
* @return True if the event should be consumed.
*/
- virtual bool OnWheelEvent(const WheelEvent& event);
+ bool OnWheelEvent(Actor actor, const WheelEvent& event);
private: // From Control
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Control::OnAccessibilityPan()
*/
- virtual bool OnAccessibilityPan(PanGesture gesture);
+ bool OnAccessibilityPan(PanGesture gesture) override;
/**
* @copydoc Toolkit::Control::GetNextKeyboardFocusableActor()
*/
- virtual Actor GetNextKeyboardFocusableActor(Actor actor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled);
+ Actor GetNextKeyboardFocusableActor(Actor actor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) override;
/**
* @copydoc Toolkit::Control::OnKeyboardFocusChangeCommitted()
*/
- virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor);
+ void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor) override;
protected:
/**
* @copydoc Toolkit::Internal::Scrollable::EnableScrollOvershoot
*/
- virtual void EnableScrollOvershoot( bool enable );
+ void EnableScrollOvershoot( bool enable ) override;
/**
* Helper to calculate the scroll overshoot according to the pan gesture displacement.
float mScrollSpeed;
float mScrollOvershoot;
- Dali::Gesture::State mGestureState : 4;
+ GestureState mGestureState : 8;
bool mAnimatingOvershootOn : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnimateOvershootOff : 1; ///< Whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
bool mAnchoringEnabled : 1;
// Color constraint
constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SpiralColorConstraint( itemId, mImpl->mItemSpacingRadians ) );
constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
- constraint.SetRemoveAction(Dali::Constraint::Discard);
+ constraint.SetRemoveAction(Dali::Constraint::DISCARD);
constraint.Apply();
// Visibility constraint
}
constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
- constraint.SetRemoveAction(Dali::Constraint::Discard);
+ constraint.SetRemoveAction(Dali::Constraint::DISCARD);
constraint.Apply();
}
}
/**
* @copydoc ItemLayout::GetScrollSpeedFactor()
*/
- virtual float GetScrollSpeedFactor() const;
+ float GetScrollSpeedFactor() const override;
/**
* @copydoc ItemLayout::GetMaximumSwipeSpeed()
*/
- virtual float GetMaximumSwipeSpeed() const;
+ float GetMaximumSwipeSpeed() const override;
/**
* @copydoc ItemLayout::GetItemFlickAnimationDuration()
*/
- virtual float GetItemFlickAnimationDuration() const;
+ float GetItemFlickAnimationDuration() const override;
/**
* @copydoc ItemLayout::GetClosestOnScreenLayoutPosition()
*/
- virtual float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize);
+ float GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) override;
private:
/**
* @copydoc ItemLayout::GetMinimumLayoutPosition()
*/
- virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
+ float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetClosestAnchorPosition()
*/
- virtual float GetClosestAnchorPosition(float layoutPosition) const;
+ float GetClosestAnchorPosition(float layoutPosition) const override;
/**
* @copydoc ItemLayout::GetItemScrollToPosition()
*/
- virtual float GetItemScrollToPosition(unsigned int itemId) const;
+ float GetItemScrollToPosition(unsigned int itemId) const override;
/**
* @copydoc ItemLayout::GetItemsWithinArea()
*/
- virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
+ ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetReserveItemCount()
*/
- virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
+ unsigned int GetReserveItemCount(Vector3 layoutSize) const override;
/**
* @copydoc ItemLayout::GetDefaultItemSize()
*/
- virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
+ void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const override;
/**
* @copydoc ItemLayout::GetScrollDirection()
*/
- virtual Degree GetScrollDirection() const;
+ Degree GetScrollDirection() const override;
/**
* @copydoc ItemLayout::ApplyConstraints()
*/
- virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
+ void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor ) override;
/**
* @copydoc ItemLayout::GetItemPosition()
*/
- virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
+ Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const override;
protected:
increaseStep = MAX_OVERSHOOT_NOTIFY_AMOUNT;
}
mOvershootIncreaseNotification = self.AddPropertyNotification( mOvershootProperty, OutsideCondition(-increaseStep, increaseStep) );
- mOvershootIncreaseNotification.SetNotifyMode(PropertyNotification::NotifyOnTrue);
+ mOvershootIncreaseNotification.SetNotifyMode(PropertyNotification::NOTIFY_ON_TRUE);
mOvershootIncreaseNotification.NotifySignal().Connect(this, &ScrollOvershootEffectRipple::OnOvershootNotification);
}
reduceStep = MIN_OVERSHOOT_NOTIFY_AMOUNT;
}
mOvershootDecreaseNotification = self.AddPropertyNotification( mOvershootProperty, InsideCondition(-reduceStep, reduceStep) );
- mOvershootDecreaseNotification.SetNotifyMode(PropertyNotification::NotifyOnTrue);
+ mOvershootDecreaseNotification.SetNotifyMode(PropertyNotification::NOTIFY_ON_TRUE);
mOvershootDecreaseNotification.NotifySignal().Connect(this, &ScrollOvershootEffectRipple::OnOvershootNotification);
}
}
/**
* @copydoc ScrollOvershootEffect::Apply
*/
- virtual void Apply();
+ void Apply() override;
/**
* @copydoc ScrollOvershootEffect::Remove
*/
- virtual void Remove( Scrollable& scrollable );
+ void Remove( Scrollable& scrollable ) override;
/**
* @copydoc ScrollOvershootEffect::Reset
*/
- virtual void Reset();
+ void Reset() override;
/**
* @copydoc ScrollOvershootEffect::UpdatePropertyNotifications
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/object/property-map.h>
#include <dali/devel-api/object/property-helper-devel.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
*/
float VectorInDomain(float a, float b, float start, float end, Dali::Toolkit::DirectionBias bias)
{
- if(bias == Dali::Toolkit::DirectionBiasNone)
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_NONE)
{
return ShortestDistanceInDomain( a, b, start, end );
}
if(vect > 0)
{
// +ve vector
- if(bias == Dali::Toolkit::DirectionBiasRight) // going right, take the vector.
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_RIGHT) // going right, take the vector.
{
return vect;
}
else
{
// -ve vector
- if(bias == Dali::Toolkit::DirectionBiasLeft) // going left, take the vector.
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_LEFT) // going left, take the vector.
{
return vect;
}
mDomainMax = Vector2( -rulerDomainX.max, -rulerDomainY.max );
mClampX = rulerDomainX.enabled;
mClampY = rulerDomainY.enabled;
- mFixedRulerX = rulerX->GetType() == Ruler::Fixed;
- mFixedRulerY = rulerY->GetType() == Ruler::Fixed;
+ mFixedRulerX = rulerX->GetType() == Ruler::FIXED;
+ mFixedRulerY = rulerY->GetType() == Ruler::FIXED;
}
void operator()( Vector2& scrollPostPosition, const PropertyInputContainer& inputs )
}
ScrollView::ScrollView()
-: ScrollBase( ControlBehaviour( REQUIRES_WHEEL_EVENTS | DISABLE_STYLE_CHANGE_SIGNALS ) ), // Enable size negotiation
+: ScrollBase( ControlBehaviour( DISABLE_STYLE_CHANGE_SIGNALS ) ), // Enable size negotiation
mTouchDownTime(0u),
mGestureStackDepth(0),
mScrollStateFlags(0),
mGestureStackDepth = 0;
- self.TouchSignal().Connect( this, &ScrollView::OnTouch );
- EnableGestureDetection( Gesture::Type( Gesture::Pan ) );
+ self.TouchedSignal().Connect( this, &ScrollView::OnTouch );
+ EnableGestureDetection( GestureType::Value( GestureType::PAN ) );
// By default we'll allow the user to freely drag the scroll view,
// while disabling the other rulers.
UpdatePropertyDomain();
SetInternalConstraints();
+
+ // Connect wheel event
+ self.WheelEventSignal().Connect( this, &ScrollView::OnWheelEvent );
}
void ScrollView::OnSceneConnection( int depth )
// while the scroll view is panning, the state needs to be reset.
if ( mPanning )
{
- PanGesture cancelGesture( Gesture::Cancelled );
+ PanGesture cancelGesture = DevelPanGesture::New( GestureState::CANCELLED );
OnPan( cancelGesture );
}
true,
horizontalBias,
verticalBias,
- Snap);
+ SNAP);
if(!animating)
{
void ScrollView::ScrollTo(const Vector2& position, float duration)
{
- ScrollTo(position, duration, DirectionBiasNone, DirectionBiasNone);
+ ScrollTo(position, duration, DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE);
}
void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
{
- ScrollTo(position, duration, alpha, DirectionBiasNone, DirectionBiasNone);
+ ScrollTo(position, duration, alpha, DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE);
}
void ScrollView::ScrollTo(const Vector2& position, float duration,
Vector2 clampDelta(Vector2::ZERO);
ClampPosition(positionSnap);
- if( (mRulerX->GetType() == Ruler::Free || mRulerY->GetType() == Ruler::Free)
+ if( (mRulerX->GetType() == Ruler::FREE || mRulerY->GetType() == Ruler::FREE)
&& isFreeFlick && !mActorAutoSnapEnabled)
{
// Calculate target position based on velocity of flick.
float t = speed / a;
- if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::FREE)
{
positionSnap.x += t*u.x*0.5f;
}
- if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::FREE)
{
positionSnap.y += t*u.y*0.5f;
}
// If Axis is Free and has velocity, then calculate time taken
// to reach target based on velocity in axis.
- if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::FREE)
{
float deltaX = fabsf(startPosition.x - positionSnap.x);
}
}
- if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::FREE)
{
float deltaY = fabsf(startPosition.y - positionSnap.y);
bool animating = AnimateTo(positionSnap, positionDuration,
alphaFunction, false,
- DirectionBiasNone, DirectionBiasNone,
- isFlick || isFreeFlick ? Flick : Snap);
+ DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE,
+ isFlick || isFreeFlick ? FLICK : SNAP);
return animating;
}
scrollBar.SetProperty( Dali::Actor::Property::NAME,"ScrollBar");
mInternalActor.Add( scrollBar );
- if( scrollBar.GetScrollDirection() == Toolkit::ScrollBar::Horizontal )
+ if( scrollBar.GetScrollDirection() == Toolkit::ScrollBar::HORIZONTAL )
{
scrollBar.SetScrollPropertySource( Self(),
Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_X,
return false;
}
-bool ScrollView::OnWheelEvent(const WheelEvent& event)
+bool ScrollView::OnWheelEvent( Actor actor, const WheelEvent& event)
{
if(!mSensitive)
{
if(mRulerX->IsEnabled() && !mRulerY->IsEnabled())
{
// If only the ruler in the X axis is enabled, scroll in the X axis.
- if(mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->GetType() == Ruler::FREE)
{
// Free panning mode
targetScrollPosition.x += event.GetDelta() * mWheelScrollDistanceStep.x;
else
{
// If the ruler in the Y axis is enabled, scroll in the Y axis.
- if(mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->GetType() == Ruler::FREE)
{
// Free panning mode
targetScrollPosition.y += event.GetDelta() * mWheelScrollDistanceStep.y;
mPanDelta.y+= panDelta.y;
// Save the velocity, there is a bug in PanGesture
- // Whereby the Gesture::Finished's velocity is either:
+ // Whereby the GestureState::FINISHED's velocity is either:
// NaN (due to time delta of zero between the last two events)
// or 0 (due to position being the same between the last two events)
}
// TODO: Upgrade to use a more powerful gesture detector (one that supports multiple touches on pan - so works as pan and flick gesture)
-// BUG: Gesture::Finished doesn't always return velocity on release (due to
+// BUG: GestureState::FINISHED doesn't always return velocity on release (due to
// timeDelta between last two events being 0 sometimes, or posiiton being the same)
void ScrollView::OnPan( const PanGesture& gesture )
{
}
// translate Gesture input to get useful data...
- switch(gesture.state)
+ switch(gesture.GetState())
{
- case Gesture::Started:
+ case GestureState::STARTED:
{
DALI_LOG_SCROLL_STATE("[0x%X] Pan Started", this);
- mPanStartPosition = gesture.position - gesture.displacement;
+ const Vector2& position = gesture.GetPosition();
+ mPanStartPosition = position - gesture.GetDisplacement();
UpdateLocalScrollProperties();
GestureStarted();
mPanning = true;
self.SetProperty( Toolkit::ScrollView::Property::PANNING, true );
- self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
+ self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(position.x, position.y, 0.0f) );
UpdateMainInternalConstraint();
Toolkit::ScrollBar scrollBar = mScrollBar.GetHandle();
break;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
if ( mPanning )
{
DALI_LOG_SCROLL_STATE("[0x%X] Pan Continuing", this);
- GestureContinuing(gesture.screenDisplacement);
+ GestureContinuing(gesture.GetScreenDisplacement());
}
else
{
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled:
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED:
{
if ( mPanning )
{
- DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.state == Gesture::Finished ) ? "Finished" : "Cancelled" ) );
+ DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.GetState() == GestureState::FINISHED ) ? "Finished" : "Cancelled" ) );
UpdateLocalScrollProperties();
- mLastVelocity = gesture.velocity;
+ mLastVelocity = gesture.GetVelocity();
mPanning = false;
self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
break;
}
- case Gesture::Possible:
- case Gesture::Clear:
+ case GestureState::POSSIBLE:
+ case GestureState::CLEAR:
{
// Nothing to do, not needed.
break;
} // end switch(gesture.state)
- OnGestureEx(gesture.state);
+ OnGestureEx(gesture.GetState());
}
-void ScrollView::OnGestureEx(Gesture::State state)
+void ScrollView::OnGestureEx(GestureState state)
{
// call necessary signals for application developer
- if(state == Gesture::Started)
+ if(state == GestureState::STARTED)
{
Vector2 currentScrollPosition = GetCurrentScrollPosition();
Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollStartedSignal.Emit( currentScrollPosition );
}
- else if( (state == Gesture::Finished) ||
- (state == Gesture::Cancelled) ) // Finished/default
+ else if( (state == GestureState::FINISHED) ||
+ (state == GestureState::CANCELLED) ) // Finished/default
{
// when all the gestures have finished, we finish the transform.
// so if a user decides to pan (1 gesture), and then pan+zoom (2 gestures)
// MoveActor (scrolling)
constraint = Constraint::New<Vector3>( self, Actor::Property::POSITION, MoveActorConstraint );
constraint.AddSource( Source( self, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
ApplyConstraintToBoundActors(constraint);
// WrapActor (wrap functionality)
constraint.AddSource( Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
constraint.AddSource( Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
constraint.AddSource( Source( self, Toolkit::ScrollView::Property::WRAP ) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
ApplyConstraintToBoundActors(constraint);
}
* @copydoc ScrollTo(const Vector2&)
*/
void TransformTo(const Vector2& position,
- DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
+ DirectionBias horizontalBias = DIRECTION_BIAS_NONE, DirectionBias verticalBias = DIRECTION_BIAS_NONE);
/**
* @copydoc ScrollTo(const Vector2&, float, AlhpaFunction, DirectionBias, DirectionBias)
*/
void TransformTo(const Vector2& position, float duration, AlphaFunction alpha,
- DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
+ DirectionBias horizontalBias = DIRECTION_BIAS_NONE, DirectionBias verticalBias = DIRECTION_BIAS_NONE);
/**
* @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position)
/**
* @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page, float duration, DirectionBias bias)
*/
- void ScrollTo(unsigned int page, float duration, DirectionBias bias = DirectionBiasNone);
+ void ScrollTo(unsigned int page, float duration, DirectionBias bias = DIRECTION_BIAS_NONE);
/**
* @copydoc Toolkit::ScrollView::ScrollTo(Actor& actor)
*/
bool AnimateTo(const Vector2& position, const Vector2& positionDuration,
AlphaFunction alpha, bool findShortcuts = true,
- DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
- SnapType snapType = Snap);
+ DirectionBias horizontalBias = DIRECTION_BIAS_NONE, DirectionBias verticalBias = DIRECTION_BIAS_NONE,
+ SnapType snapType = SNAP);
/**
* @copydoc Toolkit::Scrollable::AddOverlay()
/**
* @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
*/
- virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
+ void OnSizeAnimation(Animation& animation, const Vector3& targetSize) override;
/**
* @copydoc CustomActorImpl::OnSizeSet(const Vector3&)
*/
- virtual void OnSizeSet( const Vector3& size );
+ void OnSizeSet( const Vector3& size ) override;
/**
* From CustomActorImpl; called after a child has been added to the owning actor.
* @param[in] child The child which has been added.
*/
- virtual void OnChildAdd(Actor& child);
+ void OnChildAdd(Actor& child) override;
/**
* From CustomActorImpl; called shortly before a child is removed from the owning actor.
* @param[in] child The child being removed.
*/
- virtual void OnChildRemove(Actor& child);
+ void OnChildRemove(Actor& child) override;
/**
- * From CustomActorImpl; called after a wheelEvent is received by the owning actor.
+ * Called after a wheelEvent is received by the owning actor.
+ * @param[in] actor Actor associated with the event.
* @param[in] event The wheel event.
* @return True if the event should be consumed.
*/
- virtual bool OnWheelEvent(const WheelEvent& event);
+ bool OnWheelEvent(Actor actor, const WheelEvent& event);
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc CustomActorImpl::OnSceneDisconnection()
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
/**
* @copydoc Toolkit::Control::OnAccessibilityPan()
*/
- virtual bool OnAccessibilityPan(PanGesture gesture);
+ bool OnAccessibilityPan(PanGesture gesture) override;
/**
* @copydoc Toolkit::Scrollable::EnableScrollOvershoot()
*/
- virtual void EnableScrollOvershoot(bool enable);
+ void EnableScrollOvershoot(bool enable) override;
private:
*
* @param[in] gesture The gesture event.
*/
- void OnGestureEx(Gesture::State state);
+ void OnGestureEx(GestureState state);
/**
* Performs snapping while taking into account Velocity of gesture
*
* @param[in] child The actor to be unbound.
*/
- virtual void FindAndUnbindActor(Actor child);
+ void FindAndUnbindActor(Actor child) override;
/**
* Gets position property.
/**
* @copydoc ScrollViewEffect::OnAttach
*/
- virtual void OnAttach( Toolkit::ScrollView& scrollView );
+ void OnAttach( Toolkit::ScrollView& scrollView ) override;
/**
* @copydoc ScrollViewEffect::OnDetach
*/
- virtual void OnDetach( Toolkit::ScrollView& scrollView );
+ void OnDetach( Toolkit::ScrollView& scrollView ) override;
protected:
private:
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::OnChildAdd()
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnChildRemove()
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
/**
* Constrain the camera actor to the position of the point light, pointing
self.SetProperty( Actor::Property::SIZE, Vector2( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y ) );
// Connect to the touch signal
- self.TouchSignal().Connect( this, &Slider::OnTouch );
+ self.TouchedSignal().Connect( this, &Slider::OnTouch );
}
void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
// gesture.position is in local actor coordinates
if( mState != DISABLED )
{
- switch( gesture.state )
+ switch( gesture.GetState() )
{
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
if( mState == PRESSED )
{
- float value = MapBounds( MarkFilter ( MapPercentage( gesture.position ) ), GetLowerBound(), GetUpperBound() );
+ float value = MapBounds( MarkFilter ( MapPercentage( gesture.GetPosition() ) ), GetLowerBound(), GetUpperBound() );
SetValue( value );
DisplayPopup( value );
}
break;
}
- case Gesture::Finished:
+ case GestureState::FINISHED:
{
if( mState == PRESSED )
{
if( GetSnapToMarks() )
{
- float value = MapBounds( SnapToMark( MapPercentage( gesture.position ) ), GetLowerBound(), GetUpperBound() );
+ float value = MapBounds( SnapToMark( MapPercentage( gesture.GetPosition() ) ), GetLowerBound(), GetUpperBound() );
SetValue( value );
DisplayPopup( value );
}
Actor hitRegion = Actor::New();
hitRegion.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
hitRegion.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- hitRegion.TouchSignal().Connect( this, &Slider::OnTouch );
+ hitRegion.TouchedSignal().Connect( this, &Slider::OnTouch );
return hitRegion;
}
/**
* @copydoc CustomActorImpl::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
private:
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* Hit region touch
/**
* @copydoc Toolkit::Control::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc CustomActorImpl::OnSizeSet()
*/
- virtual void OnSizeSet(const Vector3& targetSize);
+ void OnSizeSet(const Vector3& targetSize) override;
/**
* @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc CustomActorImpl::OnSceneDisconnection()
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
/**
* @copydoc CustomActorImpl::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
private:
/**
* @copydoc Control::OnChildAdd(Actor& child)
*/
- virtual void OnChildAdd( Actor& child );
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc Control::OnChildRemove(Actor& child)
*/
- virtual void OnChildRemove( Actor& child );
+ void OnChildRemove( Actor& child ) override;
/**
* @copydoc Control::OnRelayout
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::CalculateChildSize
*/
- virtual float CalculateChildSize( const Actor& child, Dimension::Type dimension );
+ float CalculateChildSize( const Actor& child, Dimension::Type dimension ) override;
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::GetNextKeyboardFocusableActor
*/
- virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled );
+ Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled ) override;
/**
* @copydoc Control::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Control::RelayoutDependentOnChildren()
*/
- virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
+ bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) override;
/**
* @copydoc Control::OnCalculateRelayoutSize
*/
- virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
+ void OnCalculateRelayoutSize( Dimension::Type dimension ) override;
/**
* @copydoc Control::OnLayoutNegotiated
*/
- virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
+ void OnLayoutNegotiated( float size, Dimension::Type dimension ) override;
/**
* @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
*/
- virtual void OnSizeSet( const Vector3& size );
+ void OnSizeSet( const Vector3& size ) override;
private: // Implementation
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
- EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
+ EnableGestureDetection( static_cast<GestureType::Value>( GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- self.TouchSignal().Connect( this, &TextEditor::OnTouched );
+ self.TouchedSignal().Connect( this, &TextEditor::OnTouched );
// Set BoundingBox to stage size if not already set.
Rect<int> boundingBox;
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
- mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+ const Vector2& localPoint = gesture.GetLocalPoint();
+ mController->TapEvent( gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top );
SetKeyInputFocus();
}
void TextEditor::OnPan( const PanGesture& gesture )
{
- mController->PanEvent( gesture.state, gesture.displacement );
+ mController->PanEvent( gesture.GetState(), gesture.GetDisplacement() );
}
void TextEditor::OnLongPress( const LongPressGesture& gesture )
}
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
- mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+ const Vector2& localPoint = gesture.GetLocalPoint();
+ mController->LongPressEvent( gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top );
SetKeyInputFocus();
}
CustomActor self = Self();
if( !mScrollBar )
{
- mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::Vertical );
- mScrollBar.SetIndicatorHeightPolicy( Toolkit::ScrollBar::Variable );
+ mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::VERTICAL );
+ mScrollBar.SetIndicatorHeightPolicy( Toolkit::ScrollBar::VARIABLE );
mScrollBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
mScrollBar.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
mScrollBar.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::OnStyleChange()
*/
- virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
+ void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) override;
/**
* @copydoc Control::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width );
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::OnKeyInputFocusGained()
*/
- virtual void OnKeyInputFocusGained();
+ void OnKeyInputFocusGained() override;
/**
* @copydoc Control::OnKeyInputFocusLost()
*/
- virtual void OnKeyInputFocusLost();
+ void OnKeyInputFocusLost() override;
/**
* @copydoc Control::OnTap()
*/
- virtual void OnTap( const TapGesture& tap );
+ void OnTap( const TapGesture& tap ) override;
/**
* @copydoc Control::OnPan()
*/
- virtual void OnPan( const PanGesture& gesture );
+ void OnPan( const PanGesture& gesture ) override;
/**
* @copydoc Control::OnLongPress()
*/
- virtual void OnLongPress( const LongPressGesture& gesture );
+ void OnLongPress( const LongPressGesture& gesture ) override;
/**
* @copydoc Control::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
*/
- virtual bool OnKeyEvent(const KeyEvent& event);
+ bool OnKeyEvent(const KeyEvent& event) override;
// From ControlInterface
/**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
- virtual void RequestTextRelayout();
+ void RequestTextRelayout() override;
// From EditableControlInterface
/**
* @copydoc Text::ControlInterface::TextChanged()
*/
- virtual void TextChanged();
+ void TextChanged() override;
/**
* @copydoc Text::ControlInterface::MaxLengthReached()
*/
- virtual void MaxLengthReached();
+ void MaxLengthReached() override;
/**
* @copydoc Text::ControlInterface::InputStyleChanged()
*/
- virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+ void InputStyleChanged( Text::InputStyle::Mask inputStyleMask ) override;
/**
* @copydoc Text::ControlInterface::AddDecoration()
*/
- virtual void AddDecoration( Actor& actor, bool needsClipping );
+ void AddDecoration( Actor& actor, bool needsClipping ) override;
private: // Implementation
mController->SetLayoutDirection( layoutDirection );
// Forward input events to controller
- EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
+ EnableGestureDetection( static_cast<GestureType::Value>( GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- self.TouchSignal().Connect( this, &TextField::OnTouched );
+ self.TouchedSignal().Connect( this, &TextField::OnTouched );
// Set BoundingBox to stage size if not already set.
Rect<int> boundingBox;
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
- mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+ const Vector2& localPoint = gesture.GetLocalPoint();
+ mController->TapEvent( gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top );
SetKeyInputFocus();
}
void TextField::OnPan( const PanGesture& gesture )
{
- mController->PanEvent( gesture.state, gesture.displacement );
+ mController->PanEvent( gesture.GetState(), gesture.GetDisplacement() );
}
void TextField::OnLongPress( const LongPressGesture& gesture )
}
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
- mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+ const Vector2& localPoint = gesture.GetLocalPoint();
+ mController->LongPressEvent( gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top );
SetKeyInputFocus();
}
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::OnStyleChange()
*/
- virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
+ void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) override;
/**
* @copydoc Control::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width );
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::OnKeyInputFocusGained()
*/
- virtual void OnKeyInputFocusGained();
+ void OnKeyInputFocusGained() override;
/**
* @copydoc Control::OnKeyInputFocusLost()
*/
- virtual void OnKeyInputFocusLost();
+ void OnKeyInputFocusLost() override;
/**
* @copydoc Control::OnTap()
*/
- virtual void OnTap( const TapGesture& tap );
+ void OnTap( const TapGesture& tap ) override;
/**
* @copydoc Control::OnPan()
*/
- virtual void OnPan( const PanGesture& gesture );
+ void OnPan( const PanGesture& gesture ) override;
/**
* @copydoc Control::OnLongPress()
*/
- virtual void OnLongPress( const LongPressGesture& gesture );
+ void OnLongPress( const LongPressGesture& gesture ) override;
/**
* @copydoc Control::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
*/
- virtual bool OnKeyEvent(const KeyEvent& event);
+ bool OnKeyEvent(const KeyEvent& event) override;
// From ControlInterface
/**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
- virtual void RequestTextRelayout();
+ void RequestTextRelayout() override;
// From EditableControlInterface
/**
* @copydoc Text::ControlInterface::TextChanged()
*/
- virtual void TextChanged();
+ void TextChanged() override;
/**
* @copydoc Text::ControlInterface::MaxLengthReached()
*/
- virtual void MaxLengthReached();
+ void MaxLengthReached() override;
/**
* @copydoc Text::ControlInterface::InputStyleChanged()
*/
- virtual void InputStyleChanged( Text::InputStyle::Mask inputStyleMask );
+ void InputStyleChanged( Text::InputStyle::Mask inputStyleMask ) override;
/**
* @copydoc Text::ControlInterface::AddDecoration()
*/
- virtual void AddDecoration( Actor& actor, bool needsClipping );
+ void AddDecoration( Actor& actor, bool needsClipping ) override;
private: // Implementation
return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
}
-void TextLabel::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void TextLabel::OnPropertySet( Property::Index index, const Property::Value& propertyValue )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnPropertySet index[%d]\n", index );
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize() override ;
+ void OnInitialize() override;
/**
* @copydoc Control::OnStyleChange()
*/
- virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) override ;
+ void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) override;
/**
* @copydoc Control::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ) override ;
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc Control::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize() override ;
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width ) override ;
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Control::OnPropertySet()
*/
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) override ;
+ void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) override ;
// From ControlInterface
/**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
- virtual void RequestTextRelayout() override ;
+ void RequestTextRelayout() override;
private: // from TextScroller
/**
* @copydoc Text::ScrollerInterface::ScrollingFinished()
*/
- virtual void ScrollingFinished();
+ void ScrollingFinished() override;
private: // Implementation
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
private: // Implementation
indicator.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
indicator.SetStyleName( "TextSelectionScrollIndicator" );
- mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::Horizontal );
+ mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::HORIZONTAL );
mScrollBar.SetProperty( Dali::Actor::Property::NAME, "Text popup scroll bar" );
mScrollBar.SetStyleName( "TextSelectionScrollBar" );
mScrollBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
/**
* @copydoc Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Control::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @brief Set max size of Popup
DALI_TYPE_REGISTRATION_END()
const float DEFAULT_RELATIVE_SIZE( 0.1f );
-const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::HorizontalLeft );
+const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::HORIZONTAL_LEFT );
} // namespace
Toolkit::ToolBar ToolBar::New()
unsigned int index = 0;
switch( alignment )
{
- case Toolkit::Alignment::HorizontalLeft:
+ case Toolkit::Alignment::HORIZONTAL_LEFT:
{
index = mLeftOffset;
++mLeftOffset;
++mRightBase;
break;
}
- case Toolkit::Alignment::HorizontalCenter:
+ case Toolkit::Alignment::HORIZONTAL_CENTER:
{
index = mCenterBase + mCenterOffset;
++mCenterOffset;
++mRightBase;
break;
}
- case Toolkit::Alignment::HorizontalRight:
+ case Toolkit::Alignment::HORIZONTAL_RIGHT:
{
index = mRightBase - mRightOffset;
++mRightBase;
// Update spaces between left, center and right groups of controls.
switch( alignment )
{
- case Toolkit::Alignment::HorizontalLeft:
+ case Toolkit::Alignment::HORIZONTAL_LEFT:
{
mLeftRelativeSpace -= relativeSize;
if ( mLeftRelativeSpace < 0.f )
}
break;
}
- case Toolkit::Alignment::HorizontalCenter:
+ case Toolkit::Alignment::HORIZONTAL_CENTER:
{
mLeftRelativeSpace -= 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
}
break;
}
- case Toolkit::Alignment::HorizontalRight:
+ case Toolkit::Alignment::HORIZONTAL_RIGHT:
{
mRightRelativeSpace -= relativeSize;
if ( mRightRelativeSpace < 0.f )
// Update spaces between left, center and right groups of controls.
if( 1.0 > mAccumulatedRelativeSpace )
{
- Toolkit::Alignment::Type alignment = Toolkit::Alignment::HorizontalLeft;
+ Toolkit::Alignment::Type alignment = Toolkit::Alignment::HORIZONTAL_LEFT;
if( position.columnIndex < mLeftOffset )
{
- alignment = Toolkit::Alignment::HorizontalLeft;
+ alignment = Toolkit::Alignment::HORIZONTAL_LEFT;
}
else if( ( position.columnIndex > mLeftOffset ) && ( position.columnIndex < mCenterBase + mCenterOffset ) )
{
- alignment = Toolkit::Alignment::HorizontalCenter;
+ alignment = Toolkit::Alignment::HORIZONTAL_CENTER;
}
else if( position.columnIndex > mCenterBase + mCenterOffset )
{
- alignment = Toolkit::Alignment::HorizontalRight;
+ alignment = Toolkit::Alignment::HORIZONTAL_RIGHT;
}
else
{
switch( alignment )
{
- case Toolkit::Alignment::HorizontalLeft:
+ case Toolkit::Alignment::HORIZONTAL_LEFT:
{
mLeftRelativeSpace += relativeSize;
if ( mLeftRelativeSpace < 0.f )
}
break;
}
- case Toolkit::Alignment::HorizontalCenter:
+ case Toolkit::Alignment::HORIZONTAL_CENTER:
{
mLeftRelativeSpace += 0.5f * relativeSize;
if ( mLeftRelativeSpace < 0.f )
}
break;
}
- case Toolkit::Alignment::HorizontalRight:
+ case Toolkit::Alignment::HORIZONTAL_RIGHT:
{
mRightRelativeSpace += relativeSize;
if ( mRightRelativeSpace < 0.f )
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* Adds a control using some default values (the control uses 10% of the tool bar space and is placed on the left group).
*
* @see Control::OnChildAdd()
*/
- virtual void OnChildAdd(Actor& child);
+ void OnChildAdd(Actor& child) override;
private:
/**
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Control::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc Toolkit::Control::OnSceneDisconnection()
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
/**
* @copydoc Toolkit::Control::OnSizeSet()
*/
- virtual void OnSizeSet( const Vector3& targetSize );
+ void OnSizeSet( const Vector3& targetSize ) override;
/**
* @copydoc Toolkit::Control::GetNaturalSize
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Toolkit::Control::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width );
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc Toolkit::Control::GetWidthForHeight()
*/
- virtual float GetWidthForHeight( float height );
+ float GetWidthForHeight( float height ) override;
private:
void WebView::OnInitialize()
{
Self().SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- Self().TouchSignal().Connect( this, &WebView::OnTouchEvent );
+ Self().TouchedSignal().Connect( this, &WebView::OnTouchEvent );
if( mWebEngine )
{
/**
* @copydoc Toolkit::Control::OnInitialize()
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Control::GetNaturalSize
*/
- virtual Vector3 GetNaturalSize();
+ Vector3 GetNaturalSize() override;
/**
* @copydoc Toolkit::Control::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* Signal occurs when the Web View has been touched.
/**
* @copydoc Toolkit::Control::OnKeyEvent()
*/
- virtual bool OnKeyEvent( const Dali::KeyEvent& event );
+ bool OnKeyEvent( const Dali::KeyEvent& event ) override;
private:
}
}
mControls.push_back(control);
- control.TouchSignal().Connect(this, &DragAndDropDetector::OnDrag);
+ control.TouchedSignal().Connect(this, &DragAndDropDetector::OnDrag);
mFirstEnter.push_back(control.GetProperty< int >( Actor::Property::ID ));
mPanGestureDetector.Attach(control);
mPanGestureDetector.DetectedSignal().Connect(this, &DragAndDropDetector::OnPan);
if(match != mControls.end())
{
- match->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
+ match->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
mPanGestureDetector.Detach(*match);
mFirstEnter.erase(std::find(mFirstEnter.begin(), mFirstEnter.end(), control.GetProperty< int >( Actor::Property::ID )));
mControls.erase(match);
auto iter = mControls.begin();
for(;iter != mControls.end();)
{
- iter->TouchSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
+ iter->TouchedSignal().Disconnect(this, &DragAndDropDetector::OnDrag);
mPanGestureDetector.Detach(*iter);
iter = mControls.erase(iter);
}
{
Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
- if(gesture.state == Gesture::Started)
+ GestureState state = gesture.GetState();
+
+ if(state == GestureState::STARTED)
{
- mDragLocalPosition = gesture.position;
+ mDragLocalPosition = gesture.GetPosition();
mPointDown = true;
mDragControl = control;
mFirstEnter.clear();
mShadowControl.SetProperty( Actor::Property::PARENT_ORIGIN, control.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) );
mShadowControl.SetProperty( Actor::Property::ANCHOR_POINT,control.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ));
control.GetParent().Add(mShadowControl);
- SetPosition(gesture.screenPosition);
+ SetPosition(gesture.GetScreenPosition());
EmitStartedSignal(control);
}
- if(gesture.state == Gesture::Continuing)
+ if(state == GestureState::CONTINUING)
{
- Vector2 screenPosition = gesture.screenPosition;
+ Vector2 screenPosition = gesture.GetScreenPosition();
control.GetParent().ScreenToLocal(mLocalPosition.x, mLocalPosition.y, screenPosition.x, screenPosition.y);
mShadowControl.SetProperty( Actor::Property::POSITION, Vector2(mLocalPosition.x - mDragLocalPosition.x, mLocalPosition.y - mDragLocalPosition.y));
}
- if(gesture.state == Gesture::Finished)
+ if(state == GestureState::FINISHED)
{
mDragControl.GetParent().Remove(mShadowControl);
EmitEndedSignal(control);
public: // From ImageFilter
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
- virtual void Enable();
+ void Enable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
- virtual void Disable();
+ void Disable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
- virtual void Refresh();
+ void Refresh() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
- virtual void SetSize( const Vector2& size );
+ void SetSize( const Vector2& size ) override;
/**
* Get the property index that controls the strength of the blur applied to the image. Useful for animating this property.
public: // From ImageFilter
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
- virtual void Enable();
+ void Enable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
- virtual void Disable();
+ void Disable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
- virtual void Refresh();
+ void Refresh() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
- virtual void SetSize( const Vector2& size );
+ void SetSize( const Vector2& size ) override;
private:
/**
public: // From ImageFilter
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
- virtual void Enable();
+ void Enable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
- virtual void Disable();
+ void Disable() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
- virtual void Refresh();
+ void Refresh() override;
/// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
- virtual void SetSize( const Vector2& size );
+ void SetSize( const Vector2& size ) override;
private:
for( auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter )
{
( *iter ).KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- ( *iter ).TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
+ ( *iter ).TouchedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
Dali::Window window = DevelWindow::DownCast( *iter );
if( window )
{
void KeyboardFocusManager::OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder )
{
sceneHolder.KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- sceneHolder.TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
+ sceneHolder.TouchedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
Dali::Window window = DevelWindow::DownCast( sceneHolder );
if( window )
{
* The entry function of the worker thread.
* It fetches loading task from the loadQueue, loads the image and adds to the completeQueue.
*/
- virtual void Run();
+ void Run() override;
private:
grabHandle.actor.Add( grabHandle.grabArea );
grabHandle.actor.SetProperty( Actor::Property::COLOR, mHandleColor );
- grabHandle.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
+ grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
// The grab handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
primary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
primary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- primary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
+ primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
// The handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
secondary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
secondary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
- secondary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
+ secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
// The handle's actor is attached to the tap and long press detectors in order to consume these events.
// Note that no callbacks are connected to any signal emitted by the tap and long press detectors.
void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
{
- if( Gesture::Started == gesture.state )
+ GestureState state = gesture.GetState();
+ if( GestureState::STARTED == state )
{
handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
handle.globalPosition.y = handle.position.y;
}
- handle.grabDisplacementX += gesture.displacement.x;
- handle.grabDisplacementY += ( handle.verticallyFlipped ? -gesture.displacement.y : gesture.displacement.y );
+ const Vector2& displacement = gesture.GetDisplacement();
+ handle.grabDisplacementX += displacement.x;
+ handle.grabDisplacementY += ( handle.verticallyFlipped ? -displacement.y : displacement.y );
const float x = handle.globalPosition.x + handle.grabDisplacementX;
const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlippedOnTouch ? handle.lineHeight : 0.f );
- if( ( Gesture::Started == gesture.state ) ||
- ( Gesture::Continuing == gesture.state ) )
+ if( ( GestureState::STARTED == state ) ||
+ ( GestureState::CONTINUING == state ) )
{
Vector2 targetSize;
mController.GetTargetSize( targetSize );
mIsHandlePanning = true;
}
- else if( ( Gesture::Finished == gesture.state ) ||
- ( Gesture::Cancelled == gesture.state ) )
+ else if( ( GestureState::FINISHED == state ) ||
+ ( GestureState::CANCELLED == state ) )
{
if( mScrollTimer &&
( mScrollTimer.IsRunning() || mNotifyEndOfScroll ) )
LessThanCondition( mBoundingBox.y + topHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
LessThanCondition( mBoundingBox.y + topHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
LessThanCondition( mBoundingBox.y + topHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalLessThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
GreaterThanCondition( mBoundingBox.w - bottomHeight ) );
// Notifies the change from false to true and from true to false.
- mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleVerticalGreaterThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleVerticalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
LessThanCondition( mBoundingBox.x + leftWidth ) );
// Notifies the change from false to true and from true to false.
- mHandleHorizontalLessThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleHorizontalLessThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleHorizontalLessThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
GreaterThanCondition( mBoundingBox.z - rightWidth ) );
// Notifies the change from false to true and from true to false.
- mHandleHorizontalGreaterThanNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mHandleHorizontalGreaterThanNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connects the signals with the callbacks.
mHandleHorizontalGreaterThanNotification.NotifySignal().Connect( this, &Decorator::Impl::HandleResetPosition );
GreaterThanCondition( mBoundingBox.w - popupHalfSize.height ) );
// Notifies the change from false to true and from true to false.
- mPopupTopExceedNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
- mPopupBottomExceedNotification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ mPopupTopExceedNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
+ mPopupBottomExceedNotification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
mPopupTopExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesTopBoundary );
mPopupBottomExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesBottomBoundary );
return false;
}
- // Set the line position. Discard if ellipsis is enabled and the position exceeds the boundaries
+ // Set the line position. DISCARD if ellipsis is enabled and the position exceeds the boundaries
// of the box.
penY += layout.ascender;
/**
* @copydoc ModelInterface::GetControlSize()
*/
- virtual const Size& GetControlSize() const;
+ const Size& GetControlSize() const override;
/**
* @copydoc ModelInterface::GetLayoutSize()
*/
- virtual const Size& GetLayoutSize() const;
+ const Size& GetLayoutSize() const override;
/**
* @copydoc ModelInterface::GetScrollPosition()
*/
- virtual const Vector2& GetScrollPosition() const;
+ const Vector2& GetScrollPosition() const override;
/**
* @copydoc ModelInterface::GetHorizontalAlignment()
*/
- virtual Text::HorizontalAlignment::Type GetHorizontalAlignment() const;
+ Text::HorizontalAlignment::Type GetHorizontalAlignment() const override;
/**
* @copydoc ModelInterface::GetVerticalAlignment()
*/
- virtual Text::VerticalAlignment::Type GetVerticalAlignment() const;
+ Text::VerticalAlignment::Type GetVerticalAlignment() const override;
/**
* @copydoc ModelInterface::GetVerticalLineAlignment()
*/
- virtual DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const;
+ DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const override;
/**
* @copydoc ModelInterface::IsTextElideEnabled()
*/
- virtual bool IsTextElideEnabled() const;
+ bool IsTextElideEnabled() const override;
/**
* @copydoc ModelInterface::GetNumberOfLines()
*/
- virtual Length GetNumberOfLines() const;
+ Length GetNumberOfLines() const override;
/**
* @copydoc ModelInterface::GetLines()
*/
- virtual const LineRun* const GetLines() const;
+ const LineRun* const GetLines() const override;
/**
* @copydoc ModelInterface::GetNumberOfScripts()
*/
- virtual Length GetNumberOfScripts() const;
+ Length GetNumberOfScripts() const override;
/**
* @copydoc ModelInterface::GetScriptRuns()
*/
- virtual const ScriptRun* const GetScriptRuns() const;
+ const ScriptRun* const GetScriptRuns() const override;
/**
* @copydoc ModelInterface::GetNumberOfGlyphs()
*/
- virtual Length GetNumberOfGlyphs() const;
+ Length GetNumberOfGlyphs() const override;
/**
* @copydoc ModelInterface::GetGlyphs()
*/
- virtual const GlyphInfo* const GetGlyphs() const;
+ const GlyphInfo* const GetGlyphs() const override;
/**
* @copydoc ModelInterface::GetLayout()
*/
- virtual const Vector2* const GetLayout() const;
+ const Vector2* const GetLayout() const override;
/**
* @copydoc ModelInterface::GetColors()
*/
- virtual const Vector4* const GetColors() const;
+ const Vector4* const GetColors() const override;
/**
* @copydoc ModelInterface::GetColorIndices()
*/
- virtual const ColorIndex* const GetColorIndices() const;
+ const ColorIndex* const GetColorIndices() const override;
/**
* @copydoc ModelInterface::GetBackgroundColors()
*/
- virtual const Vector4* const GetBackgroundColors() const;
+ const Vector4* const GetBackgroundColors() const override;
/**
* @copydoc ModelInterface::GetBackgroundColorIndices()
*/
- virtual const ColorIndex* const GetBackgroundColorIndices() const;
+ const ColorIndex* const GetBackgroundColorIndices() const override;
/**
* @copydoc ModelInterface::GetDefaultColor()
*/
- virtual const Vector4& GetDefaultColor() const;
+ const Vector4& GetDefaultColor() const override;
/**
* @copydoc ModelInterface::GetShadowOffset()
*/
- virtual const Vector2& GetShadowOffset() const;
+ const Vector2& GetShadowOffset() const override;
/**
* @copydoc ModelInterface::GetShadowColor()
*/
- virtual const Vector4& GetShadowColor() const;
+ const Vector4& GetShadowColor() const override;
/**
* @copydoc ModelInterface::GetShadowBlurRadius()
*/
- virtual const float& GetShadowBlurRadius() const;
+ const float& GetShadowBlurRadius() const override;
/**
* @copydoc ModelInterface::GetUnderlineColor()
*/
- virtual const Vector4& GetUnderlineColor() const;
+ const Vector4& GetUnderlineColor() const override;
/**
* @copydoc ModelInterface::IsUnderlineEnabled()
*/
- virtual bool IsUnderlineEnabled() const;
+ bool IsUnderlineEnabled() const override;
/**
* @copydoc ModelInterface::GetUnderlineHeight()
*/
- virtual float GetUnderlineHeight() const;
+ float GetUnderlineHeight() const override;
/**
* @copydoc ModelInterface::GetNumberOfUnderlineRuns()
*/
- virtual Length GetNumberOfUnderlineRuns() const;
+ Length GetNumberOfUnderlineRuns() const override;
/**
* @copydoc ModelInterface::GetUnderlineRuns()
*/
- virtual void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const;
+ void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const override;
/**
* @copydoc ModelInterface::GetOutlineColor()
*/
- virtual const Vector4& GetOutlineColor() const;
+ const Vector4& GetOutlineColor() const override;
/**
* @copydoc ModelInterface::GetOutlineWidth()
*/
- virtual uint16_t GetOutlineWidth() const;
+ uint16_t GetOutlineWidth() const override;
/**
* @copydoc ModelInterface::GetBackgroundColor()
*/
- virtual const Vector4& GetBackgroundColor() const;
+ const Vector4& GetBackgroundColor() const override;
/**
* @copydoc ModelInterface::IsBackgroundEnabled()
*/
- virtual bool IsBackgroundEnabled() const;
+ bool IsBackgroundEnabled() const override;
/**
* @brief Does the text elide.
return;
}
- const int state = event.p1.mInt;
-
+ const GestureState state = static_cast<GestureState>( event.p1.mInt );
switch( state )
{
- case Gesture::Started:
+ case GestureState::STARTED:
{
// Will remove the cursor, handles or text's popup, ...
ChangeState( EventData::TEXT_PANNING );
break;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
const Vector2& layoutSize = mModel->mVisualModel->GetLayoutSize();
const Vector2 currentScroll = mModel->mScrollPosition;
mEventData->mDecorator->UpdatePositions( mModel->mScrollPosition - currentScroll );
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled: // FALLTHROUGH
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED: // FALLTHROUGH
{
// Will go back to the previous state to show the cursor, handles, the text's popup, ...
ChangeState( mEventData->mPreviousState );
mImpl->ResetInputMethodContext();
}
-void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
+void Controller::PanEvent( GestureState state, const Vector2& displacement )
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected PanEvent" );
if( NULL != mImpl->mEventData )
{
Event event( Event::PAN_EVENT );
- event.p1.mInt = state;
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = displacement.x;
event.p3.mFloat = displacement.y;
mImpl->mEventData->mEventQueue.push_back( event );
}
}
-void Controller::LongPressEvent( Gesture::State state, float x, float y )
+void Controller::LongPressEvent( GestureState state, float x, float y )
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected LongPressEvent" );
- if( ( state == Gesture::Started ) &&
+ if( ( state == GestureState::STARTED ) &&
( NULL != mImpl->mEventData ) )
{
// The 1st long-press on inactive text-field is treated as tap
else if( !mImpl->IsShowingRealText() )
{
Event event( Event::LONG_PRESS_EVENT );
- event.p1.mInt = state;
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
mImpl->ResetInputMethodContext();
Event event( Event::LONG_PRESS_EVENT );
- event.p1.mInt = state;
+ event.p1.mInt = static_cast<int>( state );
event.p2.mFloat = x;
event.p3.mFloat = y;
mImpl->mEventData->mEventQueue.push_back( event );
mImpl->mEventData->mRightSelectionPosition = mImpl->mEventData->mPrimaryCursorPosition;
}
- // Discard temporary text
+ // DISCARD temporary text
events.Clear();
}
* @param[in] state The state of the gesture.
* @param[in] displacement This distance panned since the last pan gesture.
*/
- void PanEvent( Gesture::State state, const Vector2& displacement );
+ void PanEvent( GestureState state, const Vector2& displacement );
/**
* @brief Called by editable UI controls when a long press gesture occurs.
* @param[in] x The x position relative to the top-left of the parent control.
* @param[in] y The y position relative to the top-left of the parent control.
*/
- void LongPressEvent( Gesture::State state, float x, float y );
+ void LongPressEvent( GestureState state, float x, float y );
/**
* @brief Creates a selection event.
/**
* @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize()
*/
- virtual void GetTargetSize( Vector2& targetSize );
+ void GetTargetSize( Vector2& targetSize ) override;
/**
* @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration()
*/
- virtual void AddDecoration( Actor& actor, bool needsClipping );
+ void AddDecoration( Actor& actor, bool needsClipping ) override;
/**
* @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent()
*/
- virtual void DecorationEvent( HandleType handle, HandleState state, float x, float y );
+ void DecorationEvent( HandleType handle, HandleState state, float x, float y ) override;
protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
/**
* @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched()
*/
- virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
+ void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button ) override;
protected: // Inherit from HiddenText.
/**
* @brief Invoked from HiddenText when showing time of the last character was expired
*/
- virtual void DisplayTimeExpired();
+ void DisplayTimeExpired() override;
private: // Update.
/**
* @brief Get the alignment string from the provided alignment string.
- * @param[in] alignment the Text::Horizontal enum source
+ * @param[in] alignment the Text::HORIZONTAL enum source
* @return the string equivalent
*/
const char* GetHorizontalAlignmentString( const Toolkit::Text::HorizontalAlignment::Type& alignment );
/**
* @copydoc ModelInterface::GetControlSize()
*/
- virtual const Size& GetControlSize() const override;
+ const Size& GetControlSize() const override;
/**
* @copydoc ModelInterface::GetLayoutSize()
*/
- virtual const Size& GetLayoutSize() const override;
+ const Size& GetLayoutSize() const override;
/**
* @copydoc ModelInterface::GetScrollPosition()
*/
- virtual const Vector2& GetScrollPosition() const override;
+ const Vector2& GetScrollPosition() const override;
/**
* @copydoc ModelInterface::GetHorizontalAlignment()
*/
- virtual HorizontalAlignment::Type GetHorizontalAlignment() const override;
+ HorizontalAlignment::Type GetHorizontalAlignment() const override;
/**
* @copydoc ModelInterface::GetVerticalAlignment()
*/
- virtual VerticalAlignment::Type GetVerticalAlignment() const override;
+ VerticalAlignment::Type GetVerticalAlignment() const override;
/**
* @copydoc ModelInterface::GetVerticalLineAlignment()
*/
- virtual DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const override;
+ DevelText::VerticalLineAlignment::Type GetVerticalLineAlignment() const override;
/**
* @copydoc ModelInterface::IsTextElideEnabled()
*/
- virtual bool IsTextElideEnabled() const override;
+ bool IsTextElideEnabled() const override;
/**
* @copydoc ModelInterface::GetNumberOfLines()
*/
- virtual Length GetNumberOfLines() const override;
+ Length GetNumberOfLines() const override;
/**
* @copydoc ModelInterface::GetLines()
*/
- virtual const LineRun* const GetLines() const override;
+ const LineRun* const GetLines() const override;
/**
* @copydoc ModelInterface::GetNumberOfScripts()
*/
- virtual Length GetNumberOfScripts() const override;
+ Length GetNumberOfScripts() const override;
/**
* @copydoc ModelInterface::GetScriptRuns()
*/
- virtual const ScriptRun* const GetScriptRuns() const override;
+ const ScriptRun* const GetScriptRuns() const override;
/**
* @copydoc ModelInterface::GetNumberOfGlyphs()
*/
- virtual Length GetNumberOfGlyphs() const override;
+ Length GetNumberOfGlyphs() const override;
/**
* @copydoc ModelInterface::GetGlyphs()
*/
- virtual const GlyphInfo* const GetGlyphs() const override;
+ const GlyphInfo* const GetGlyphs() const override;
/**
* @copydoc ModelInterface::GetLayout()
*/
- virtual const Vector2* const GetLayout() const override;
+ const Vector2* const GetLayout() const override;
/**
* @copydoc ModelInterface::GetColors()
*/
- virtual const Vector4* const GetColors() const override;
+ const Vector4* const GetColors() const override;
/**
* @copydoc ModelInterface::GetColorIndices()
*/
- virtual const ColorIndex* const GetColorIndices() const override;
+ const ColorIndex* const GetColorIndices() const override;
/**
* @copydoc ModelInterface::GetBackgroundColors()
*/
- virtual const Vector4* const GetBackgroundColors() const override;
+ const Vector4* const GetBackgroundColors() const override;
/**
* @copydoc ModelInterface::GetBackgroundColorIndices()
*/
- virtual const ColorIndex* const GetBackgroundColorIndices() const override;
+ const ColorIndex* const GetBackgroundColorIndices() const override;
/**
* @copydoc ModelInterface::GetDefaultColor()
*/
- virtual const Vector4& GetDefaultColor() const override;
+ const Vector4& GetDefaultColor() const override;
/**
* @copydoc ModelInterface::GetShadowOffset()
*/
- virtual const Vector2& GetShadowOffset() const override;
+ const Vector2& GetShadowOffset() const override;
/**
* @copydoc ModelInterface::GetShadowColor()
*/
- virtual const Vector4& GetShadowColor() const override;
+ const Vector4& GetShadowColor() const override;
/**
* @copydoc ModelInterface::GetShadowBlurRadius()
*/
- virtual const float& GetShadowBlurRadius() const override;
+ const float& GetShadowBlurRadius() const override;
/**
* @copydoc ModelInterface::GetUnderlineColor()
*/
- virtual const Vector4& GetUnderlineColor() const override;
+ const Vector4& GetUnderlineColor() const override;
/**
* @copydoc ModelInterface::IsUnderlineEnabled()
*/
- virtual bool IsUnderlineEnabled() const override;
+ bool IsUnderlineEnabled() const override;
/**
* @copydoc ModelInterface::GetUnderlineHeight()
*/
- virtual float GetUnderlineHeight() const override;
+ float GetUnderlineHeight() const override;
/**
* @copydoc ModelInterface::GetNumberOfUnderlineRuns()
*/
- virtual Length GetNumberOfUnderlineRuns() const override;
+ Length GetNumberOfUnderlineRuns() const override;
/**
* @copydoc ModelInterface::GetUnderlineRuns()
*/
- virtual void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const override;
+ void GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const override;
/**
* @copydoc ModelInterface::GetOutlineColor()
*/
- virtual const Vector4& GetOutlineColor() const override;
+ const Vector4& GetOutlineColor() const override;
/**
* @copydoc ModelInterface::GetOutlineWidth()
*/
- virtual uint16_t GetOutlineWidth() const override;
+ uint16_t GetOutlineWidth() const override;
/**
* @copydoc ModelInterface::GetBackgroundColor()
*/
- virtual const Vector4& GetBackgroundColor() const override;
+ const Vector4& GetBackgroundColor() const override;
/**
* @copydoc ModelInterface::IsBackgroundEnabled()
*/
- virtual bool IsBackgroundEnabled() const override;
+ bool IsBackgroundEnabled() const override;
private: // Private contructors & copy operator.
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetControlSize()
*/
- virtual const Vector2& GetControlSize() const;
+ const Vector2& GetControlSize() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetLayoutSize()
*/
- virtual const Vector2& GetLayoutSize() const;
+ const Vector2& GetLayoutSize() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfGlyphs()
*/
- virtual Length GetNumberOfGlyphs() const;
+ Length GetNumberOfGlyphs() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetColors()
*/
- virtual const Vector4* const GetColors() const;
+ const Vector4* const GetColors() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetColorIndices()
*/
- virtual const ColorIndex* const GetColorIndices() const;
+ const ColorIndex* const GetColorIndices() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColors()
*/
- virtual const Vector4* const GetBackgroundColors() const;
+ const Vector4* const GetBackgroundColors() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColorIndices()
*/
- virtual const ColorIndex* const GetBackgroundColorIndices() const;
+ const ColorIndex* const GetBackgroundColorIndices() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
*/
- virtual const Vector4& GetTextColor() const;
+ const Vector4& GetTextColor() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowOffset()
*/
- virtual const Vector2& GetShadowOffset() const;
+ const Vector2& GetShadowOffset() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetShadowColor()
*/
- virtual const Vector4& GetShadowColor() const;
+ const Vector4& GetShadowColor() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineColor()
*/
- virtual const Vector4& GetUnderlineColor() const;
+ const Vector4& GetUnderlineColor() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::IsUnderlineEnabled()
*/
- virtual bool IsUnderlineEnabled() const;
+ bool IsUnderlineEnabled() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineHeight()
*/
- virtual float GetUnderlineHeight() const;
+ float GetUnderlineHeight() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetNumberOfUnderlineRuns()
*/
- virtual Length GetNumberOfUnderlineRuns() const;
+ Length GetNumberOfUnderlineRuns() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetUnderlineRuns()
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineColor()
*/
- virtual const Vector4& GetOutlineColor() const;
+ const Vector4& GetOutlineColor() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetOutlineWidth()
*/
- virtual uint16_t GetOutlineWidth() const;
+ uint16_t GetOutlineWidth() const override;
private:
/**
* @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
*/
- virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
+ void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ) override;
private:
/**
* @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnSceneConnection( int depth );
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc CustomActorImpl::OnSceneDisconnection()
*/
- virtual void OnSceneDisconnection();
+ void OnSceneDisconnection() override;
protected:
*/
virtual void OnStopTransition() {}
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
void ResetToInitialState();
/**
* @copydoc Toolkit::CubeTransitionEffect::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::CubeTransitionEffect::OnStartTransition
*/
- virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
+ void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ) override;
private:
/**
* @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
*/
- virtual void OnInitialize();
+ void OnInitialize() override;
/**
* @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
*/
- virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
+ void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ) override;
private:
{
TextureManager& textureManager = mFactoryCache.GetTextureManager();
- uint32_t opaqueElementsCount {0u};
- uint32_t transparentElementsCount {0u};
- geometry = textureManager.GetRenderGeometry(mTextureId, opaqueElementsCount, transparentElementsCount);
- if(!opaqueElementsCount && !transparentElementsCount)
+ uint32_t firstElementCount {0u};
+ uint32_t secondElementCount {0u};
+ geometry = textureManager.GetRenderGeometry(mTextureId, firstElementCount, secondElementCount);
+ if(!firstElementCount && !secondElementCount)
{
geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
}
// use geometry if needed
if( loadingSuccess )
{
- uint32_t opaqueElements{0u};
- uint32_t transparentElements{0u};
- auto geometry = mFactoryCache.GetTextureManager().GetRenderGeometry(mTextureId, opaqueElements, transparentElements);
+ uint32_t firstElementCount{0u};
+ uint32_t secondElementCount{0u};
+ auto geometry = mFactoryCache.GetTextureManager().GetRenderGeometry(mTextureId, firstElementCount, secondElementCount);
if (mImpl->mRenderer && geometry)
{
mImpl->mRenderer.SetGeometry(geometry);
Dali::DevelRenderer::DrawCommand drawCommand{};
drawCommand.drawType = DevelRenderer::DrawType::INDEXED;
- if (opaqueElements)
+ if (firstElementCount)
{
drawCommand.firstIndex = 0;
- drawCommand.elementCount = opaqueElements;
- drawCommand.queue = 0;
+ drawCommand.elementCount = firstElementCount;
+ drawCommand.queue = DevelRenderer::RENDER_QUEUE_OPAQUE;
DevelRenderer::AddDrawCommand(mImpl->mRenderer, drawCommand);
}
- if (transparentElements)
+ if (secondElementCount)
{
- drawCommand.firstIndex = opaqueElements;
- drawCommand.elementCount = transparentElements;
- drawCommand.queue = 1;
+ drawCommand.firstIndex = firstElementCount;
+ drawCommand.elementCount = secondElementCount;
+ drawCommand.queue = DevelRenderer::RENDER_QUEUE_TRANSPARENT;
DevelRenderer::AddDrawCommand(mImpl->mRenderer, drawCommand);
}
}
{
uint32_t elementCount[2];
geometry = RenderingAddOn::Get().CreateGeometryGrid(data->renderingMap, Uint16Pair(3, 3), elementCount );
+ if( mImpl->mRenderer )
+ {
+ RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->renderingMap);
+ }
}
else
{
uint32_t elementCount[2];
geometry = !mBorderOnly ?
RenderingAddOn::Get().CreateGeometryGrid(data->renderingMap, gridSize, elementCount ) : CreateBorderGeometry(gridSize );
+ if( mImpl->mRenderer )
+ {
+ RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->renderingMap);
+ }
}
}
}
-#ifndef DALI_CMAKE_RENDERING_ADDON_H
-#define DALI_CMAKE_RENDERING_ADDON_H
+#ifndef DALI_RENDERING_ADDON_H
+#define DALI_RENDERING_ADDON_H
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd.
RelayoutRequest();
}
-void Control::EnableGestureDetection(Gesture::Type type)
+void Control::EnableGestureDetection(GestureType::Value type)
{
- if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
+ if ( (type & GestureType::PINCH) && !mImpl->mPinchGestureDetector )
{
mImpl->mPinchGestureDetector = PinchGestureDetector::New();
mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
mImpl->mPinchGestureDetector.Attach(Self());
}
- if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
+ if ( (type & GestureType::PAN) && !mImpl->mPanGestureDetector )
{
mImpl->mPanGestureDetector = PanGestureDetector::New();
mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
mImpl->mPanGestureDetector.Attach(Self());
}
- if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
+ if ( (type & GestureType::TAP) && !mImpl->mTapGestureDetector )
{
mImpl->mTapGestureDetector = TapGestureDetector::New();
mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
mImpl->mTapGestureDetector.Attach(Self());
}
- if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
+ if ( (type & GestureType::LONG_PRESS) && !mImpl->mLongPressGestureDetector )
{
mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
}
}
-void Control::DisableGestureDetection(Gesture::Type type)
+void Control::DisableGestureDetection(GestureType::Value type)
{
- if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
+ if ( (type & GestureType::PINCH) && mImpl->mPinchGestureDetector )
{
mImpl->mPinchGestureDetector.Detach(Self());
mImpl->mPinchGestureDetector.Reset();
}
- if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
+ if ( (type & GestureType::PAN) && mImpl->mPanGestureDetector )
{
mImpl->mPanGestureDetector.Detach(Self());
mImpl->mPanGestureDetector.Reset();
}
- if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
+ if ( (type & GestureType::TAP) && mImpl->mTapGestureDetector )
{
mImpl->mTapGestureDetector.Detach(Self());
mImpl->mTapGestureDetector.Reset();
}
- if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
+ if ( (type & GestureType::LONG_PRESS) && mImpl->mLongPressGestureDetector)
{
mImpl->mLongPressGestureDetector.Detach(Self());
mImpl->mLongPressGestureDetector.Reset();
// Call deriving classes so initialised before styling is applied to them.
OnInitialize();
- if( (mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS) ||
- !(mImpl->mFlags & DISABLE_STYLE_CHANGE_SIGNALS) )
+ if( !(mImpl->mFlags & DISABLE_STYLE_CHANGE_SIGNALS) )
{
Toolkit::StyleManager styleManager = StyleManager::Get();
mImpl->mStartingPinchScale = new Vector3;
}
- if( pinch.state == Gesture::Started )
+ if( pinch.GetState() == GestureState::STARTED )
{
*( mImpl->mStartingPinchScale ) = Self().GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
}
- Self().SetProperty( Actor::Property::SCALE, *( mImpl->mStartingPinchScale ) * pinch.scale );
+ Self().SetProperty( Actor::Property::SCALE, *( mImpl->mStartingPinchScale ) * pinch.GetScale() );
}
void Control::OnPan( const PanGesture& pan )
{
}
-void Control::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void Control::OnPropertySet( Property::Index index, const Property::Value& propertyValue )
{
// If the clipping mode has been set, we may need to create a renderer.
// Only do this if we are already on-stage as the OnSceneConnection will handle the off-stage clipping controls.
// @todo size negotiate background to new size, animate as well?
}
-bool Control::OnHoverEvent(const HoverEvent& event)
-{
- return false; // Do not consume
-}
-
bool Control::OnKeyEvent(const KeyEvent& event)
{
return false; // Do not consume
}
-bool Control::OnWheelEvent(const WheelEvent& event)
-{
- return false; // Do not consume
-}
-
void Control::OnRelayout( const Vector2& size, RelayoutContainer& container )
{
for( unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i )
*
* Gesture detection can be enabled one at a time or in bitwise format as shown:
* @code
- * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
+ * EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::TAP | GestureType::PAN));
* @endcode
* @SINCE_1_0.0
* @param[in] type The gesture type(s) to enable
*/
- void EnableGestureDetection( Gesture::Type type );
+ void EnableGestureDetection( GestureType::Value type );
/**
* @brief Allows deriving classes to disable any of the gesture detectors.
* @param[in] type The gesture type(s) to disable
* @see EnableGetureDetection
*/
- void DisableGestureDetection( Gesture::Type type );
+ void DisableGestureDetection( GestureType::Value type );
/**
* @brief If deriving classes wish to fine tune pinch gesture
* @copydoc CustomActorImpl::OnSceneConnection()
* @note If overridden, then an up-call to Control::OnSceneConnection MUST be made at the end.
*/
- virtual void OnSceneConnection( int depth ) override;
+ void OnSceneConnection( int depth ) override;
/**
* @copydoc CustomActorImpl::OnSceneDisconnection()
* @note If overridden, then an up-call to Control::OnSceneDisconnection MUST be made at the end.
*/
- virtual void OnSceneDisconnection() override;
+ void OnSceneDisconnection() override;
/**
* @copydoc CustomActorImpl::OnChildAdd()
* @note If overridden, then an up-call to Control::OnChildAdd MUST be made at the end.
*/
- virtual void OnChildAdd( Actor& child ) override;
+ void OnChildAdd( Actor& child ) override;
/**
* @copydoc CustomActorImpl::OnChildRemove()
* @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
*/
- virtual void OnChildRemove( Actor& child ) override;
+ void OnChildRemove( Actor& child ) override;
/**
* @copydoc CustomActorImpl::OnPropertySet()
* @note If overridden, then an up-call to Control::OnChildRemove MUST be made at the end.
*/
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) override;
+ void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) override;
/**
* @copydoc CustomActorImpl::OnSizeSet()
* @note If overridden, then an up-call to Control::OnSizeSet MUST be made at the end.
*/
- virtual void OnSizeSet( const Vector3& targetSize ) override;
+ void OnSizeSet( const Vector3& targetSize ) override;
/**
* @copydoc CustomActorImpl::OnSizeAnimation()
* @note If overridden, then an up-call to Control::OnSizeAnimation MUST be made at the end.
*/
- virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize ) override;
-
- /**
- * @copydoc CustomActorImpl::OnHoverEvent()
- */
- virtual bool OnHoverEvent( const HoverEvent& event ) override;
-
- /**
- * @copydoc CustomActorImpl::OnKeyEvent()
- */
- virtual bool OnKeyEvent( const KeyEvent& event ) override;
-
- /**
- * @copydoc CustomActorImpl::OnWheelEvent()
- */
- virtual bool OnWheelEvent( const WheelEvent& event ) override;
+ void OnSizeAnimation( Animation& animation, const Vector3& targetSize ) override;
/**
* @copydoc CustomActorImpl::OnRelayout()
*/
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
+ void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
/**
* @copydoc CustomActorImpl::OnSetResizePolicy()
*/
- virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) override;
+ void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) override;
/**
* @copydoc CustomActorImpl::GetNaturalSize()
*/
- virtual Vector3 GetNaturalSize() override;
+ Vector3 GetNaturalSize() override;
/**
* @copydoc CustomActorImpl::CalculateChildSize()
*/
- virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension ) override;
+ float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension ) override;
/**
* @copydoc CustomActorImpl::GetHeightForWidth()
*/
- virtual float GetHeightForWidth( float width ) override;
+ float GetHeightForWidth( float width ) override;
/**
* @copydoc CustomActorImpl::GetWidthForHeight()
*/
- virtual float GetWidthForHeight( float height ) override;
+ float GetWidthForHeight( float height ) override;
/**
* @copydoc CustomActorImpl::RelayoutDependentOnChildren()
*/
- virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) override;
+ bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) override;
/**
* @copydoc CustomActorImpl::OnCalculateRelayoutSize()
*/
- virtual void OnCalculateRelayoutSize( Dimension::Type dimension ) override;
+ void OnCalculateRelayoutSize( Dimension::Type dimension ) override;
/**
* @copydoc CustomActorImpl::OnLayoutNegotiated()
*/
- virtual void OnLayoutNegotiated( float size, Dimension::Type dimension ) override;
+ void OnLayoutNegotiated( float size, Dimension::Type dimension ) override;
protected: // Helpers for deriving classes
enum ControlBehaviour
{
CONTROL_BEHAVIOUR_DEFAULT = 0, ///< Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks. @SINCE_1_2_10
- REQUIRES_STYLE_CHANGE_SIGNALS = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ), ///< True if needs to monitor style change signals such as theme/font change @SINCE_1_0.0 @DEPRECATED_1_2_10
- REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ), ///< True if needs to support keyboard navigation @SINCE_1_0.0
- DISABLE_STYLE_CHANGE_SIGNALS = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 2 ), ///< True if control should not monitor style change signals @SINCE_1_2_10
+ REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ), ///< True if needs to support keyboard navigation @SINCE_1_0.0
+
+ DISABLE_STYLE_CHANGE_SIGNALS = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ), ///< True if control should not monitor style change signals @SINCE_1_2_10
LAST_CONTROL_BEHAVIOUR_FLAG
};
*/
virtual bool OnKeyboardEnter();
+ /**
+ * @brief Called after a key-event is received by the actor that has had its focus set.
+ *
+ * @SINCE_1_0.0
+ * @param[in] event The Key Event
+ * @return True if the event should be consumed
+ */
+ virtual bool OnKeyEvent( const KeyEvent& event );
+
// Gestures
/**
/**
* @copydoc ConnectionTrackerInterface::SignalConnected
*/
- virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
+ void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback ) override;
/**
* @copydoc ConnectionTrackerInterface::SignalDisconnected
*/
- virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
+ void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback ) override;
/**
* @brief Retrieves the extension for this control.
private:
/// @cond internal
- // Undefined
- DALI_INTERNAL Control( const Control& );
- DALI_INTERNAL Control& operator=( const Control& );
+
+ // Not copyable or movable
+ DALI_INTERNAL Control( const Control& ) = delete; ///< Deleted copy constructor.
+ DALI_INTERNAL Control( Control&& ) = delete; ///< Deleted move constructor.
+ DALI_INTERNAL Control& operator=( const Control& ) = delete; ///< Deleted copy assignment operator.
+ DALI_INTERNAL Control& operator=( Control&& ) = delete; ///< Deleted move assignment operator.
public:
class DALI_INTERNAL Impl; // Class declaration is public so we can internally add devel API's to the Controls Impl
{
if(!enabled)
{
- clamped = NotClamped;
+ clamped = NOT_CLAMPED;
return x;
}
const float maxExtent = max * scale - length;
if(x < minExtent)
{
- clamped = ClampedToMin;
+ clamped = CLAMPED_TO_MIN;
return minExtent;
}
else if(x > maxExtent)
{
- clamped = ClampedToMax;
+ clamped = CLAMPED_TO_MAX;
return maxExtent;
}
- clamped = NotClamped;
+ clamped = NOT_CLAMPED;
return x;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
Ruler::Ruler()
-: mType(Free),
+: mType(FREE),
mEnabled(true),
mDomain(RulerDomain(0.0f,1.0f,false))
{
DefaultRuler::DefaultRuler()
{
- mType = Free;
+ mType = FREE;
}
float DefaultRuler::Snap(float x, float bias) const
DALI_LOG_ERROR( "Page spacing too small (%f).\n", double(spacing) );
mSpacing = spacing >= 0.0f ? Math::MACHINE_EPSILON_1 : -Math::MACHINE_EPSILON_1;
}
- mType = Fixed;
+ mType = FIXED;
}
float FixedRuler::Snap(float x, float bias) const
*/
enum ClampState
{
- NotClamped, ///< The quantity isn't clamped @SINCE_1_0.0
- ClampedToMin, ///< The quantity is clamped to the min value @SINCE_1_0.0
- ClampedToMax ///< The quantity is clamped to the max value @SINCE_1_0.0
+ NOT_CLAMPED, ///< The quantity isn't clamped @SINCE_1_9.28
+ CLAMPED_TO_MIN, ///< The quantity is clamped to the min value @SINCE_1_9.28
+ CLAMPED_TO_MAX ///< The quantity is clamped to the max value @SINCE_1_9.28
};
/**
*/
enum SnapType
{
- Snap, ///< Snap @SINCE_1_0.0
- Flick ///< Flick @SINCE_1_0.0
+ SNAP, ///< SNAP @SINCE_1_9.28
+ FLICK ///< FLICK @SINCE_1_9.28
};
/**
*/
enum DirectionBias
{
- DirectionBiasLeft = -1, ///< Bias scroll snap to Left @SINCE_1_0.0
- DirectionBiasNone = 0, ///< Don't bias scroll snap @SINCE_1_0.0
- DirectionBiasRight = 1 ///< Bias scroll snap to Right @SINCE_1_0.0
+ DIRECTION_BIAS_LEFT = -1, ///< Bias scroll snap to Left @SINCE_1_9.28
+ DIRECTION_BIAS_NONE = 0, ///< Don't bias scroll snap @SINCE_1_9.28
+ DIRECTION_BIAS_RIGHT = 1 ///< Bias scroll snap to Right @SINCE_1_9.28
};
/**
* @SINCE_1_0.0
*/
enum RulerType {
- Fixed, ///< A fixed ruler @SINCE_1_0.0
- Free ///< A free ruler @SINCE_1_0.0
+ FIXED, ///< A fixed ruler @SINCE_1_9.28
+ FREE ///< A free ruler @SINCE_1_9.28
};
public:
protected:
- RulerType mType; ///< Type of Ruler (Fixed or Free).
+ RulerType mType; ///< Type of Ruler (FIXED or FREE).
bool mEnabled; ///< If the ruler is enabled.
RulerDomain mDomain; ///< The domain of the ruler.
/**
* @copydoc Toolkit::Ruler::Snap
*/
- virtual float Snap(float x, float bias) const;
+ float Snap(float x, float bias) const override;
/**
* @copydoc Toolkit::Ruler::GetPositionFromPage
*/
- virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const;
+ float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const override;
/**
* @copydoc Toolkit::Ruler::GetPageFromPosition
*/
- virtual unsigned int GetPageFromPosition(float position, bool wrap) const;
+ unsigned int GetPageFromPosition(float position, bool wrap) const override;
/**
* @copydoc Toolkit::Ruler::GetTotalPages
*/
- virtual unsigned int GetTotalPages() const;
+ unsigned int GetTotalPages() const override;
};
/**
/**
* @copydoc Toolkit::Ruler::Snap
*/
- virtual float Snap(float x, float bias) const;
+ float Snap(float x, float bias) const override;
/**
* @copydoc Toolkit::Ruler::GetPositionFromPage
*/
- virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const;
+ float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const override;
/**
* @copydoc Toolkit::Ruler::GetPageFromPosition
*/
- virtual unsigned int GetPageFromPosition(float position, bool wrap) const;
+ unsigned int GetPageFromPosition(float position, bool wrap) const override;
/**
* @copydoc Toolkit::Ruler::GetTotalPages
*/
- virtual unsigned int GetTotalPages() const;
+ unsigned int GetTotalPages() const override;
private:
float mSpacing; ///< The spacing between each interval
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 27;
+const unsigned int TOOLKIT_MICRO_VERSION = 28;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ );
// Connect to the touch-event
- mImageView.TouchSignal().Connect( this, &PropertyController::OnTouched );
+ mImageView.TouchedSignal().Connect( this, &PropertyController::OnTouched );
// Create text label
mTagText = Toolkit::TextLabel::New( "0" );
### Touch, Hover & Wheel Events {#creating-controls-events}
-+ A **touch** is when any touch occurs within the bounds of the custom actor. Connect to Dali::Actor::TouchSignal().
++ A **touch event** is when any touch occurs within the bounds of the custom actor. Connect to Dali::Actor::TouchedSignal().
+ A **hover event** is when a pointer moves within the bounds of a custom actor (e.g. mouse pointer or hover pointer).
+ A **wheel event** is when the mouse wheel (or similar) is moved while hovering over an actor (via a mouse pointer or hover pointer).
// Elsewhere
Dali::Actor actor = Actor::New();
-actor.TouchSignal().Connect( &OnTouch );
+actor.TouchedSignal().Connect( &OnTouch );
@endcode
The primary touch point is the first point that the user touches.
If this hit actor does not handle (consume) the event, then the event is offered to the hit actor's parent.
Again, if the parent does not handle this event, it is then offered to its parent and so on until the stage is reached or the event is consumed.
-If the TouchSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
+If the TouchedSignal of both a parent and child are connected to, then the touch event is first offered to the child's listener.
If it is consumed by the child's listener, then the parent will not be informed.
<h2 class="pg">Gestures</h2>
stage.Add( mTextLabel );
// Respond to a click anywhere on the stage
- stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
+ stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
}
bool OnTouch( Actor actor, const TouchEvent& touch )
Touch events are received via signals.
-For C++ API see Dali::Actor::TouchSignal() and Dali::Actor::HoveredSignal() for more details.
+For C++ API see Dali::Actor::TouchedSignal() and Dali::Actor::HoveredSignal() for more details.
### Hit Testing Rules Summary:
return true; // consume the touch event
}
...
-actor.TouchSignal().Connect( &OnPressed );
+actor.TouchedSignal().Connect( &OnPressed );
~~~
## JSON {#json-support}
"parentOrigin": "CENTER",
"signals" :
[
- { "name" : "touch", "action": "play", "animation": "move" }
+ { "name" : "touched", "action": "play", "animation": "move" }
]
}
]
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.9.27
+Version: 1.9.28
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT