Changes after PageTurnView moved to Devel API
[platform/core/uifw/dali-demo.git] / examples / text-label-emojis / text-label-emojis.cpp
index 8529904..f5415b2 100644 (file)
@@ -17,7 +17,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/text-abstraction/text-abstraction.h>
 #include <iostream>
 
 // INTERNAL INCLUDES
@@ -56,6 +55,7 @@ public:
   void Create( Application& application )
   {
     Stage stage = Stage::GetCurrent();
+    stage.SetBackgroundColor( Color::WHITE );
     stage.KeyEventSignal().Connect(this, &EmojiExample::OnKeyEvent);
 
     mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 );
@@ -63,7 +63,7 @@ public:
     mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent );
+    mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch );
     stage.Add( mTableView );
 
     for( unsigned int index = 0u; index < NUMBER_OF_EMOJIS; ++index )
@@ -81,25 +81,25 @@ public:
     }
   }
 
-  bool OnTouchEvent( Actor actor, const TouchEvent& event )
+  bool OnTouch( Actor actor, const TouchData& event )
   {
     if( 1u == event.GetPointCount() )
     {
-      const TouchPoint::State state = event.GetPoint(0u).state;
+      const PointState::Type state = event.GetState( 0 );
 
       // Clamp to integer values; this is to reduce flicking due to pixel misalignment
-      const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+      const float localPoint = static_cast<float>( static_cast<int>( event.GetLocalPosition( 0 ).y ) );
 
-      if( TouchPoint::Down == state )
+      if( PointState::DOWN == state )
       {
         mLastPoint = localPoint;
         mAnimation = Animation::New( 0.25f );
       }
-      else if( TouchPoint::Motion == state )
+      else if( PointState::MOTION == state )
       {
         if( mAnimation )
         {
-          mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear );
+          mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
           mAnimation.Play();
           mLastPoint = localPoint;
         }
@@ -140,9 +140,9 @@ void RunTest( Application& application )
 
 // Entry point for Linux & SLP applications
 //
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
-  Application application = Application::New( &argc, &argv );
+  Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
 
   RunTest( application );