Merge branch 'devel/master(1.1.39)' into tizen 19/75419/1 accepted/tizen/common/20160620.163535 accepted/tizen/common/20160624.134211 accepted/tizen/ivi/20160620.082235 accepted/tizen/ivi/20160624.103115 accepted/tizen/mobile/20160620.082058 accepted/tizen/mobile/20160624.102956 accepted/tizen/tv/20160620.082133 accepted/tizen/tv/20160624.103022 accepted/tizen/wearable/20160620.082203 accepted/tizen/wearable/20160624.103049 submit/tizen/20160618.115218 submit/tizen/20160624.043400
authortaeyoon <taeyoon0.lee@samsung.com>
Sat, 18 Jun 2016 05:08:48 +0000 (14:08 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Sat, 18 Jun 2016 05:09:14 +0000 (14:09 +0900)
Change-Id: I7076a16a94447bccc18042662f1f92812a22a515

43 files changed:
build/tizen/CMakeLists.txt
com.samsung.dali-demo.xml
demo/dali-demo.cpp
demo/dali-table-view.cpp
demo/dali-table-view.h
examples/atlas/atlas-example.cpp
examples/benchmark/benchmark.cpp
examples/blocks/blocks-example.cpp
examples/bubble-effect/bubble-effect-example.cpp
examples/buttons/buttons-example.cpp
examples/compressed-texture-formats/compressed-texture-formats-example.cpp
examples/hello-world/hello-world-example.cpp
examples/homescreen-benchmark/homescreen-benchmark.cpp
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
examples/image-view-pixel-area/image-view-pixel-area-example.cpp
examples/image-view/image-view-example.cpp
examples/logging/logging-example.cpp
examples/magnifier/magnifier-example.cpp
examples/mesh-sorting/mesh-sorting-example.cpp
examples/metaball-explosion/metaball-explosion-example.cpp
examples/metaball-refrac/metaball-refrac-example.cpp
examples/perf-scroll/perf-scroll.cpp
examples/refraction-effect/refraction-effect-example.cpp
examples/scroll-view/scroll-view-example.cpp
examples/super-blur-bloom/super-blur-bloom-example.cpp
examples/text-editor/text-editor-example.cpp [new file with mode: 0644]
examples/text-field/text-field-example.cpp
examples/text-label-emojis/text-label-emojis.cpp
examples/text-label-multi-language/text-label-multi-language-example.cpp
examples/tilt/tilt-example.cpp
examples/video-view/video-view-example.cpp [new file with mode: 0644]
packaging/com.samsung.dali-demo.spec
resources/images/Backward.png [new file with mode: 0755]
resources/images/Forward.png [new file with mode: 0755]
resources/images/Pause.png [new file with mode: 0755]
resources/scripts/animation.json
resources/scripts/slider-test-style.json
resources/scripts/slider.json
resources/scripts/table-view.json
resources/videos/big_buck_bunny.mp4 [new file with mode: 0644]
shared/dali-demo-strings.h
shared/view.h

index 5d3d28f..8a05b1f 100644 (file)
@@ -24,6 +24,7 @@ ENDIF()
 
 SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources)
 SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images)
+SET(LOCAL_VIDEOS_DIR ${RESOURCE_DIR}/videos)
 SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models)
 SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts)
 IF(NOT DEFINED LOCAL_STYLE_DIR)
@@ -31,6 +32,7 @@ IF(NOT DEFINED LOCAL_STYLE_DIR)
 ENDIF()
 
 SET(IMAGES_DIR ${APP_DATA_DIR}/images/)
+SET(VIDEOS_DIR ${APP_DATA_DIR}/videos/)
 SET(MODELS_DIR ${APP_DATA_DIR}/models/)
 SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/)
 SET(STYLE_DIR ${APP_DATA_DIR}/style/)
@@ -40,6 +42,7 @@ IF(NOT DEFINED LOCALE_DIR)
 ENDIF()
 
 SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\")
+SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\")
 SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\")
 SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\")
 SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\")
@@ -63,6 +66,11 @@ FOREACH(flag ${LOCAL_IMAGES_LIST})
         INSTALL(FILES ${LOCAL_IMAGES_DIR}/${flag} DESTINATION ${IMAGES_DIR})
 ENDFOREACH(flag)
 
+FILE(GLOB LOCAL_VIDEOS_LIST RELATIVE "${LOCAL_VIDEOS_DIR}" "${LOCAL_VIDEOS_DIR}/*")
+FOREACH(flag ${LOCAL_VIDEOS_LIST})
+        INSTALL(FILES ${LOCAL_VIDEOS_DIR}/${flag} DESTINATION ${VIDEOS_DIR})
+ENDFOREACH(flag)
+
 FILE(GLOB LOCAL_MODELS_LIST RELATIVE "${LOCAL_MODELS_DIR}" "${LOCAL_MODELS_DIR}/*")
 FOREACH(flag ${LOCAL_MODELS_LIST})
         INSTALL(FILES ${LOCAL_MODELS_DIR}/${flag} DESTINATION ${MODELS_DIR})
@@ -80,7 +88,7 @@ INSTALL(FILES ${LOCAL_STYLE_DIR}/demo-theme.json DESTINATION ${STYLE_DIR})
 
 SET(PKG_LIST dali-core
              dali-adaptor
-             dali-toolkit)
+             dali-toolkit )
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(REQUIRED_PKGS REQUIRED ${PKG_LIST})
@@ -89,7 +97,7 @@ FOREACH(flag ${REQUIRED_PKGS_CFLAGS})
         SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(DALI_DEMO_CFLAGS "-DDEMO_IMAGE_DIR=${DEMO_IMAGE_DIR} -DDEMO_MODEL_DIR=${DEMO_MODEL_DIR} -DDEMO_SCRIPT_DIR=${DEMO_SCRIPT_DIR} -DDEMO_THEME_PATH=${DEMO_THEME_PATH} -DDEMO_EXAMPLE_BIN=${DEMO_EXAMPLE_BIN} -DDEMO_LOCALE_DIR=${DEMO_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDEMO_LANG=${DEMO_LANG}")
+SET(DALI_DEMO_CFLAGS "-DDEMO_IMAGE_DIR=${DEMO_IMAGE_DIR} -DDEMO_VIDEO_DIR=${DEMO_VIDEO_DIR} -DDEMO_MODEL_DIR=${DEMO_MODEL_DIR} -DDEMO_SCRIPT_DIR=${DEMO_SCRIPT_DIR} -DDEMO_THEME_PATH=${DEMO_THEME_PATH} -DDEMO_EXAMPLE_BIN=${DEMO_EXAMPLE_BIN} -DDEMO_LOCALE_DIR=${DEMO_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDEMO_LANG=${DEMO_LANG}")
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE")
 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
index 84e0678..ca70a35 100644 (file)
        <ui-application appid="flex-container.example" exec="/usr/apps/com.samsung.dali-demo/bin/flex-container.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Flex Container</label>
        </ui-application>
+       <ui-application appid="text-editor.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-editor.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+               <label>Text Editor</label>
+       </ui-application>
+       <ui-application appid="video-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/video-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+               <label>Video View</label>
+       </ui-application>
 </manifest>
index c3b628b..3f693a7 100644 (file)
@@ -58,6 +58,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
   demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE));
   demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT));
   demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING));
+  demo.AddExample(Example("text-editor.example", DALI_DEMO_STR_TITLE_TEXT_EDITOR));
   demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE));
   demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
   demo.AddExample(Example("buttons.example", DALI_DEMO_STR_TITLE_BUTTONS));
index 00e1c7f..04cfaa3 100644 (file)
@@ -241,7 +241,7 @@ void DaliTableView::Initialize( Application& application )
   mScrollView.SetAxisAutoLock( true );
   mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete );
   mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart );
-  mScrollView.TouchedSignal().Connect( this, &DaliTableView::OnScrollTouched );
+  mScrollView.TouchSignal().Connect( this, &DaliTableView::OnScrollTouched );
 
   mScrollViewLayer = Layer::New();
 
@@ -476,7 +476,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
   content.SetKeyboardFocusable(true);
 
   // connect to the touch events
-  content.TouchedSignal().Connect( this, &DaliTableView::OnTilePressed );
+  content.TouchSignal().Connect( this, &DaliTableView::OnTilePressed );
   content.HoveredSignal().Connect( this, &DaliTableView::OnTileHovered );
 
   return content;
@@ -496,12 +496,16 @@ Toolkit::ImageView DaliTableView::NewStencilImage()
   return stencil;
 }
 
-bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event )
+{
+  return DoTilePress( actor, event.GetState( 0 ) );
+}
+
+bool DaliTableView::DoTilePress( Actor actor, PointState::Type pointState )
 {
   bool consumed = false;
 
-  const TouchPoint& point = event.GetPoint( 0 );
-  if( TouchPoint::Down == point.state )
+  if( PointState::DOWN == pointState )
   {
     mPressedActor = actor;
     consumed = true;
@@ -509,7 +513,7 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
 
   // A button press is only valid if the Down & Up events
   // both occurred within the button.
-  if( ( TouchPoint::Up == point.state ) &&
+  if( ( PointState::UP == pointState ) &&
       ( mPressedActor == actor ) )
   {
     // ignore Example button presses when scrolling or button animating.
@@ -581,10 +585,9 @@ void DaliTableView::OnScrollComplete( const Dali::Vector2& position )
   accessibilityManager.SetCurrentFocusActor(mPages[mScrollView.GetCurrentPage()].GetChildAt(0) );
 }
 
-bool DaliTableView::OnScrollTouched( Actor actor, const TouchEvent& event )
+bool DaliTableView::OnScrollTouched( Actor actor, const TouchData& event )
 {
-  const TouchPoint& point = event.GetPoint( 0 );
-  if( TouchPoint::Down == point.state )
+  if( PointState::DOWN == event.GetState( 0 ) )
   {
     mPressedActor = actor;
   }
@@ -901,9 +904,7 @@ void DaliTableView::OnFocusedActorActivated( Dali::Actor activatedActor )
     mPressedActor = activatedActor;
 
     // Activate the current focused actor;
-    TouchEvent touchEventUp;
-    touchEventUp.points.push_back( TouchPoint ( 0, TouchPoint::Up, 0.0f, 0.0f ) );
-    OnTilePressed(mPressedActor, touchEventUp);
+    DoTilePress( mPressedActor, PointState::UP );
   }
 }
 
index aa2a469..d4b0946 100644 (file)
@@ -163,7 +163,17 @@ private: // Application callbacks & implementation
    *
    * @return Consume flag
    */
-  bool OnTilePressed( Dali::Actor actor, const Dali::TouchEvent& event );
+  bool OnTilePressed( Dali::Actor actor, const Dali::TouchData& event );
+
+  /**
+   * Called by OnTilePressed & Accessibility to do the appropriate action.
+   *
+   * @param[in] actor The Actor representing this tile.
+   * @param[in] state The Touch state
+   *
+   * @return Consume flag
+   */
+  bool DoTilePress( Dali::Actor actor, Dali::PointState::Type state );
 
   /**
    * Signal emitted when any tile has been hovered
@@ -214,7 +224,7 @@ private: // Application callbacks & implementation
    *
    * @return Consume flag
    */
-  bool OnScrollTouched( Dali::Actor actor, const Dali::TouchEvent& event );
+  bool OnScrollTouched( Dali::Actor actor, const Dali::TouchData& event );
 
   /**
    * Setup the effect on the scroll view
index 3ba64ea..1d0f089 100644 (file)
@@ -200,7 +200,7 @@ private:
     return imageData;
   }
 
-  PixelDataPtr CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
+  PixelData CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height )
   {
     unsigned int size = width*height;
     unsigned char* pixels = new unsigned char [size*3u];
index 3824de8..e9fed0e 100644 (file)
@@ -285,7 +285,7 @@ public:
     mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &Benchmark::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &Benchmark::OnTouch );
 
     if( gUseMesh )
     {
@@ -303,7 +303,7 @@ public:
     ShowAnimation();
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index 61aed74..a308be3 100644 (file)
@@ -289,8 +289,8 @@ private:
 
     mPaddle.SetPosition( stageSize * Vector3( PADDLE_START_POSITION ) );
     mContentLayer.Add(mPaddle);
-    mPaddle.TouchedSignal().Connect(this, &ExampleController::OnTouchPaddle);
-    mContentLayer.TouchedSignal().Connect(this, &ExampleController::OnTouchLayer);
+    mPaddle.TouchSignal().Connect(this, &ExampleController::OnTouchPaddle);
+    mContentLayer.TouchSignal().Connect(this, &ExampleController::OnTouchLayer);
 
     const float margin(BALL_SIZE.width * stageSize.width * 0.5f);
 
@@ -579,15 +579,15 @@ private:
    * @param[in] actor The actor touched
    * @param[in] event The touch event
    */
-  bool OnTouchPaddle(Actor actor, const TouchEvent& event)
+  bool OnTouchPaddle(Actor actor, const TouchData& event)
   {
     if(event.GetPointCount()>0)
     {
-      const TouchPoint& point = event.GetPoint(0);
-      if(point.state==TouchPoint::Down) // Commence dragging
+      if( event.GetState( 0 ) == PointState::DOWN ) // Commence dragging
       {
         // Get point where user touched paddle (relative to paddle's center)
-        mRelativeDragPoint = Vector3(point.screen.x, point.screen.y, 0.0f);
+        Vector2 screenPoint = event.GetScreenPosition( 0 );
+        mRelativeDragPoint = screenPoint;
         mRelativeDragPoint -= actor.GetCurrentPosition();
 
         mDragActor = actor;
@@ -605,17 +605,16 @@ private:
    * @param[in] actor The actor touched
    * @param[in] event The touch event
    */
-  bool OnTouchLayer(Actor actor, const TouchEvent& event)
+  bool OnTouchLayer(Actor actor, const TouchData& event)
   {
     if(event.GetPointCount()>0)
     {
-      const TouchPoint& point = event.GetPoint(0);
       if(mDragActor)
       {
-        Vector3 position(point.screen.x, point.screen.y, 0.0f);
+        Vector3 position( event.GetScreenPosition( 0 ) );
         mPaddle.SetPosition( position - mRelativeDragPoint );
 
-        if(point.state==TouchPoint::Up) // Stop dragging
+        if( event.GetState( 0 ) == PointState::UP ) // Stop dragging
         {
           mDragAnimation = Animation::New(0.25f);
           mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunction::EASE_IN);
index 7127ba4..fbd83db 100644 (file)
@@ -150,7 +150,7 @@ private:
     mTimerForBubbleEmission.TickSignal().Connect(this, &BubbleEffectExample::OnTimerTick);
 
     // Connect the callback to the touch signal on the background
-    mBackground.TouchedSignal().Connect( this, &BubbleEffectExample::OnTouch );
+    mBackground.TouchSignal().Connect( this, &BubbleEffectExample::OnTouch );
   }
 
 
@@ -205,24 +205,22 @@ private:
   }
 
   // Callback function of the touch signal on the background
-  bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+  bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
   {
-    const TouchPoint &point = event.GetPoint(0);
-    switch(point.state)
+    switch( event.GetState( 0 ) )
     {
-      case TouchPoint::Down:
+      case PointState::DOWN:
       {
-        mCurrentTouchPosition = point.screen;
-        mEmitPosition = point.screen;
+        mCurrentTouchPosition = mEmitPosition = event.GetScreenPosition( 0 );
         mTimerForBubbleEmission.Start();
         mNonMovementCount = 0;
 
         break;
       }
-      case TouchPoint::Motion:
+      case PointState::MOTION:
       {
-        Vector2 displacement = point.screen - mCurrentTouchPosition;
-        mCurrentTouchPosition = point.screen;
+        Vector2 displacement = event.GetScreenPosition( 0 ) - mCurrentTouchPosition;
+        mCurrentTouchPosition = event.GetScreenPosition( 0 );
         //emit multiple bubbles along the moving direction when the finger moves quickly
         float step = std::min(5.f, displacement.Length());
         for( float i=0.25f; i<step; i=i+1.f)
@@ -231,9 +229,9 @@ private:
         }
         break;
       }
-      case TouchPoint::Up:
-      case TouchPoint::Leave:
-      case TouchPoint::Interrupted:
+      case PointState::UP:
+      case PointState::LEAVE:
+      case PointState::INTERRUPTED:
       {
         mTimerForBubbleEmission.Stop();
         mEmitAnimation.Play();
@@ -241,8 +239,7 @@ private:
         mAnimateComponentCount = 0;
         break;
       }
-      case TouchPoint::Stationary:
-      case TouchPoint::Last:
+      case PointState::STATIONARY:
       default:
       {
         break;
index 8f993fc..14d532c 100644 (file)
@@ -108,7 +108,6 @@ class ButtonsController: public ConnectionTracker
     contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
     contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-//    contentTable.TouchedSignal().Connect( this, &ButtonsController::OnTouchEvent );
 
     for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
     {
@@ -480,35 +479,7 @@ class ButtonsController: public ConnectionTracker
     return true;
   }
 
-  bool OnTouchEvent( Actor actor, const TouchEvent& event )
-  {
-    if( 1u == event.GetPointCount() )
-    {
-      const TouchPoint::State state = event.GetPoint(0u).state;
-
-      // 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 ) );
-
-      if( TouchPoint::Down == state )
-      {
-        mLastPoint = localPoint;
-        mAnimation = Animation::New( 0.25f );
-      }
-      else if( TouchPoint::Motion == state )
-      {
-        if( mAnimation )
-        {
-          mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
-          mAnimation.Play();
-          mLastPoint = localPoint;
-        }
-      }
-    }
-
-    return true;
-  }
-
- private:
+private:
 
   Application&      mApplication;
   Toolkit::Control  mView;                              ///< The View instance.
index 7fed128..a55f69a 100644 (file)
@@ -108,10 +108,10 @@ public:
     stage.Add( table );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &CompressedTextureFormatsController::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index 2c5763a..89670a1 100644 (file)
@@ -51,10 +51,10 @@ public:
     stage.Add( textLabel );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index a35919a..da33200 100644 (file)
@@ -438,10 +438,10 @@ public:
     stage.Add(mScrollParent);
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &HomescreenBenchmark::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &HomescreenBenchmark::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index a5782ef..042ce7a 100644 (file)
@@ -295,7 +295,7 @@ public:
     imagePrevious.SetOpacity( 0.6f );
     controlsLayer.Add( imagePrevious );
     imagePrevious.SetName( PREVIOUS_BUTTON_ID );
-    imagePrevious.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+    imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
 
     // Next image button:
     Toolkit::ImageView imageNext = Toolkit::ImageView::New( playImage );
@@ -305,7 +305,7 @@ public:
     imageNext.SetOpacity( 0.6f );
     controlsLayer.Add( imageNext );
     imageNext.SetName( NEXT_BUTTON_ID );
-    imageNext.TouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
+    imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
 
     // Buttons to popup selectors for fitting and sampling modes:
 
@@ -535,14 +535,13 @@ public:
     }
   }
 
-  bool OnControlTouched( Actor actor, const TouchEvent& event )
+  bool OnControlTouched( Actor actor, const TouchData& event )
   {
     if(event.GetPointCount() > 0)
     {
-      const TouchPoint& point = event.GetPoint(0);
-      switch(point.state)
+      switch( event.GetState( 0 ) )
       {
-        case TouchPoint::Up:
+        case PointState::UP:
         {
           const std::string & name = actor.GetName();
           if( name == NEXT_BUTTON_ID )
index dc982f8..51482d4 100644 (file)
@@ -461,7 +461,7 @@ public:
       ImageView image = CreateImageView( imageSource.configuration.path, imageSize.x, imageSize.y, fittingMode );
       image.SetPosition( Vector3( imagePosition.x, imagePosition.y, 0 ) );
       image.SetSize( imageSize );
-      image.TouchedSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
+      image.TouchSignal().Connect( this, &ImageScalingIrregularGridController::OnTouchImage );
       mFittingModes[image.GetId()] = fittingMode;
       mResourceUrls[image.GetId()] = imageSource.configuration.path;
       mSizes[image.GetId()] = imageSize;
@@ -477,12 +477,11 @@ public:
   * @param[in] actor The actor touched
   * @param[in] event The TouchEvent.
   */
-  bool OnTouchImage( Actor actor, const TouchEvent& event )
+  bool OnTouchImage( Actor actor, const TouchData& event )
   {
-    if( (event.points.size() > 0) && (!mScrolling) )
+    if( ( event.GetPointCount() > 0 ) && ( !mScrolling ) )
     {
-      TouchPoint point = event.points[0];
-      if(point.state == TouchPoint::Up)
+      if( event.GetState( 0 ) == PointState::UP )
       {
         // Spin the image a few times:
         Animation animation = Animation::New(SPIN_DURATION);
index 69a8c54..55ac6b6 100644 (file)
@@ -74,13 +74,12 @@ private:
     animation.Play();
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &ImageViewPixelAreaApp::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
-    const TouchPoint &point = touch.GetPoint(0);
-    if(point.state == TouchPoint::Down)
+    if( touch.GetState( 0 ) == PointState::DOWN )
     {
       mIndex++;
       for( int i=0; i<3;i++ )
index af3f16c..89bd8d6 100644 (file)
@@ -18,7 +18,6 @@
 #include "shared/view.h"
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/slider/slider.h>
 
 using namespace Dali;
 
index 9abef21..31af882 100644 (file)
@@ -174,7 +174,6 @@ class LoggingController: public ConnectionTracker
     contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
     contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
     contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
-//    contentTable.TouchedSignal().Connect( this, &LoggingController::OnTouchEvent );
 
     for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
     {
@@ -639,35 +638,7 @@ class LoggingController: public ConnectionTracker
     return true;
   }
 
-  bool OnTouchEvent( Actor actor, const TouchEvent& event )
-  {
-    if( 1u == event.GetPointCount() )
-    {
-      const TouchPoint::State state = event.GetPoint(0u).state;
-
-      // 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 ) );
-
-      if( TouchPoint::Down == state )
-      {
-        mLastPoint = localPoint;
-        mAnimation = Animation::New( 0.25f );
-      }
-      else if( TouchPoint::Motion == state )
-      {
-        if( mAnimation )
-        {
-          mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
-          mAnimation.Play();
-          mLastPoint = localPoint;
-        }
-      }
-    }
-
-    return true;
-  }
-
- private:
+private:
 
   struct LoggerState
   {
index 279713d..fb461b5 100644 (file)
@@ -213,7 +213,7 @@ public:
                                        APPLICATION_TITLE );
 
     mContent.SetLeaveRequired(true);
-    mContent.TouchedSignal().Connect( this, &ExampleController::OnTouched );
+    mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
 
     // Create magnifier (controlled by human touch)
     Layer overlay = Layer::New();
@@ -300,33 +300,32 @@ public:
    * @param[in] actor The actor that received the touch
    * @param[in] event The touch-event information
    */
-  bool OnTouched( Actor actor, const TouchEvent& event )
+  bool OnTouched( Actor actor, const TouchData& event )
   {
     if(event.GetPointCount() > 0)
     {
-      const TouchPoint& point = event.GetPoint(0);
-      switch(point.state)
+      switch( event.GetState( 0 ) )
       {
-        case TouchPoint::Down:
-        case TouchPoint::Motion:
+        case PointState::DOWN:
+        case PointState::MOTION:
         {
           ShowMagnifier();
           break;
         }
-        case TouchPoint::Up:
-        case TouchPoint::Leave:
-        case TouchPoint::Interrupted:
+        case PointState::UP:
+        case PointState::LEAVE:
+        case PointState::INTERRUPTED:
         {
           HideMagnifier();
           break;
         }
-        default:
+        case PointState::STATIONARY:
         {
           break;
         }
       } // end switch
 
-      Vector3 touchPoint(point.screen);
+      Vector3 touchPoint( event.GetScreenPosition( 0 ) );
 
       SetMagnifierPosition(touchPoint - mStageSize * 0.5f);
     }
index 28d7f9f..b521708 100644 (file)
@@ -187,7 +187,7 @@ public:
 
       meshActor.RegisterProperty("uHue", i/(float)NUMBER_OF_SAMPLES);
 
-      meshActor.TouchedSignal().Connect(this, &ExampleController::OnTouched);
+      meshActor.TouchSignal().Connect(this, &ExampleController::OnTouched);
       std::ostringstream oss;
       oss << "Mesh Actor " << i;
       meshActor.SetName(oss.str());
@@ -196,7 +196,7 @@ public:
 
     mActors[NUMBER_OF_SAMPLES-2].GetRendererAt(0).SetTextures( firstTextureSet );
 
-    stage.GetRootLayer().TouchedSignal().Connect(this, &ExampleController::OnStageTouched);
+    stage.GetRootLayer().TouchSignal().Connect(this, &ExampleController::OnStageTouched);
   }
 
   void PrintDepths()
@@ -227,9 +227,9 @@ public:
     printf("\n");
   }
 
-  bool OnTouched( Actor actor, const TouchEvent& event )
+  bool OnTouched( Actor actor, const TouchData& event )
   {
-    if( event.GetPoint(0).state == TouchPoint::Finished )
+    if( event.GetState( 0 ) == PointState::UP )
     {
       int index = actor.GetProperty<int>(actor.GetPropertyIndex("index"));
 
@@ -244,9 +244,9 @@ public:
     return true;
   }
 
-  bool OnStageTouched( Actor rootLayer, const TouchEvent& event )
+  bool OnStageTouched( Actor rootLayer, const TouchData& event )
   {
-    if( event.GetPoint(0).state == TouchPoint::Finished )
+    if( event.GetState( 0 ) == PointState::UP )
     {
       switch( mZMode )
       {
index 231d778..166f8e2 100644 (file)
@@ -192,7 +192,7 @@ public:
   /**
    * Touch event function
    */
-  bool OnTouch( Actor actor, const TouchEvent& touch );
+  bool OnTouch( Actor actor, const TouchData& touch );
 
   /**
    * Key event function
@@ -344,7 +344,7 @@ void MetaballExplosionController::Create( Application& app )
   mTimerDispersion.TickSignal().Connect(this, &MetaballExplosionController::OnTimerDispersionTick);
 
   // Connect the callback to the touch signal on the mesh actor
-  stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballExplosionController::OnTouch );
+  stage.GetRootLayer().TouchSignal().Connect( this, &MetaballExplosionController::OnTouch );
 }
 
 Geometry MetaballExplosionController::CreateGeometry()
@@ -681,31 +681,32 @@ void MetaballExplosionController::SetPositionToMetaballs(Vector2 & metaballCente
   mCompositionActor.SetProperty( mPositionIndex, metaballCenter );
 }
 
-bool MetaballExplosionController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballExplosionController::OnTouch( Actor actor, const TouchData& touch )
 {
-  const TouchPoint &point = touch.GetPoint(0);
   float aspectR = mScreenSize.y / mScreenSize.x;
 
-  switch( point.state )
+  switch( touch.GetState( 0 ) )
   {
-    case TouchPoint::Down:
+    case PointState::DOWN:
     {
       ResetMetaballs(true);
 
-      Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+      const Vector2 screen = touch.GetScreenPosition( 0 );
+      Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
       SetPositionToMetaballs(metaballCenter);
 
       break;
     }
-    case TouchPoint::Motion:
+    case PointState::MOTION:
     {
-      Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+      const Vector2 screen = touch.GetScreenPosition( 0 );
+      Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
       SetPositionToMetaballs(metaballCenter);
       break;
     }
-    case TouchPoint::Up:
-    case TouchPoint::Leave:
-    case TouchPoint::Interrupted:
+    case PointState::UP:
+    case PointState::LEAVE:
+    case PointState::INTERRUPTED:
     {
       mTimerDispersion.Start();
       break;
index a1382b3..b55515a 100644 (file)
@@ -164,7 +164,7 @@ public:
   ~MetaballRefracController();
 
   void Create( Application& app );
-  bool OnTouch( Actor actor, const TouchEvent& touch );
+  bool OnTouch( Actor actor, const TouchData& touch );
   void OnKeyEvent(const KeyEvent& event);
 
   void SetGravity(const Vector2 & gravity);
@@ -283,7 +283,7 @@ void MetaballRefracController::Create( Application& app )
   CreateAnimations();
 
   // Connect the callback to the touch signal on the mesh actor
-  stage.GetRootLayer().TouchedSignal().Connect( this, &MetaballRefracController::OnTouch );
+  stage.GetRootLayer().TouchSignal().Connect( this, &MetaballRefracController::OnTouch );
 }
 
 /**
@@ -759,13 +759,12 @@ void MetaballRefracController::SetPositionToMetaballs(Vector2 & metaballCenter)
   }
 }
 
-bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
+bool MetaballRefracController::OnTouch( Actor actor, const TouchData& touch )
 {
-  const TouchPoint &point = touch.GetPoint(0);
   float aspectR = mScreenSize.y / mScreenSize.x;
-  switch(point.state)
+  switch( touch.GetState( 0 ) )
   {
-    case TouchPoint::Down:
+    case PointState::DOWN:
     {
       StopAfterClickAnimations();
       for (int i = 0 ; i < METABALL_NUMBER ; i++)
@@ -776,17 +775,18 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
       //We draw with the refraction-composition shader
       mRendererRefraction.SetTextures(mTextureSetRefraction);
       mRendererRefraction.SetShader( mShaderRefraction );
-      mCurrentTouchPosition = point.screen;
+      mCurrentTouchPosition = touch.GetScreenPosition( 0 );
 
       //we use the click position for the metaballs
-      Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+      Vector2 metaballCenter = Vector2((mCurrentTouchPosition.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - mCurrentTouchPosition.y) / mScreenSize.y) - 0.5) * 2.0;
       SetPositionToMetaballs(metaballCenter);
       break;
     }
-    case TouchPoint::Motion:
+    case PointState::MOTION:
     {
-      Vector2 displacement = point.screen - mCurrentTouchPosition;
-      mCurrentTouchPosition = point.screen;
+      Vector2 screen = touch.GetScreenPosition( 0 );
+      Vector2 displacement = screen - mCurrentTouchPosition;
+      mCurrentTouchPosition = screen;
 
       mMetaballPosVariationTo.x += (displacement.x / mScreenSize.x) * 2.2;
       mMetaballPosVariationTo.y += (- displacement.y / mScreenSize.y) * 2.2;
@@ -803,13 +803,13 @@ bool MetaballRefracController::OnTouch( Actor actor, const TouchEvent& touch )
       mPositionVarAnimation[1].Play();
 
       //we use the click position for the metaballs
-      Vector2 metaballCenter = Vector2((point.screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - point.screen.y) / mScreenSize.y) - 0.5) * 2.0;
+      Vector2 metaballCenter = Vector2((screen.x / mScreenSize.x) - 0.5, (aspectR * (mScreenSize.y - screen.y) / mScreenSize.y) - 0.5) * 2.0;
       SetPositionToMetaballs(metaballCenter);
       break;
     }
-    case TouchPoint::Up:
-    case TouchPoint::Leave:
-    case TouchPoint::Interrupted:
+    case PointState::UP:
+    case PointState::LEAVE:
+    case PointState::INTERRUPTED:
     {
       //Stop click animations
       StopClickAnimations();
index 78ca137..bdf2195 100644 (file)
@@ -284,7 +284,7 @@ public:
     mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &PerfScroll::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch );
 
     mParent = Actor::New();
     mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
@@ -302,7 +302,7 @@ public:
     ShowAnimation();
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
index ea8bb6b..189a7c7 100644 (file)
@@ -294,7 +294,7 @@ private:
     mContent.Add( mMeshActor );
 
     // Connect the callback to the touch signal on the mesh actor
-    mContent.TouchedSignal().Connect( this, &RefractionEffectExample::OnTouch );
+    mContent.TouchSignal().Connect( this, &RefractionEffectExample::OnTouch );
 
     // shader used when the finger is touching the screen. render refraction effect
     mShaderRefraction = Shader::New( VERTEX_SHADER_REFRACTION, FRAGMENT_SHADER_REFRACTION );
@@ -348,16 +348,15 @@ private:
     return true;
   }
 
-  bool OnTouch( Actor actor , const TouchEvent& event )
+  bool OnTouch( Actor actor, const TouchData& event )
   {
-    const TouchPoint &point = event.GetPoint(0);
-    switch(point.state)
+    switch( event.GetState( 0 ) )
     {
-      case TouchPoint::Down:
+      case PointState::DOWN:
       {
         mRenderer.SetShader( mShaderRefraction );
 
-        SetLightXYOffset( point.screen );
+        SetLightXYOffset( event.GetScreenPosition( 0 ) );
 
         mLightAnimation.Play();
 
@@ -372,15 +371,15 @@ private:
 
         break;
       }
-      case TouchPoint::Motion:
+      case PointState::MOTION:
       {
         // make the light position following the finger movement
-        SetLightXYOffset( point.screen );
+        SetLightXYOffset( event.GetScreenPosition( 0 ) );
         break;
       }
-      case TouchPoint::Up:
-      case TouchPoint::Leave:
-      case TouchPoint::Interrupted:
+      case PointState::UP:
+      case PointState::LEAVE:
+      case PointState::INTERRUPTED:
       {
         mLightAnimation.Pause();
 
@@ -394,9 +393,7 @@ private:
         mStrenghAnimation.Play();
         break;
       }
-      case TouchPoint::Stationary:
-      case TouchPoint::Last:
-      default:
+      case PointState::STATIONARY:
       {
         break;
       }
index 259024b..1a8d12a 100644 (file)
@@ -459,7 +459,7 @@ private:
     actor.SetParentOrigin(ParentOrigin::CENTER);
     actor.SetAnchorPoint(AnchorPoint::CENTER);
 
-    actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage );
+    actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage );
     return actor;
   }
 
@@ -489,12 +489,11 @@ private:
    * @param[in] actor The actor touched
    * @param[in] event The TouchEvent.
    */
-  bool OnTouchImage( Actor actor, const TouchEvent& event )
+  bool OnTouchImage( Actor actor, const TouchData& event )
   {
-    if( (event.points.size() > 0) && (!mScrolling) )
+    if( (event.GetPointCount() > 0) && (!mScrolling) )
     {
-      TouchPoint point = event.points[0];
-      if(point.state == TouchPoint::Up)
+      if( event.GetState( 0 ) == PointState::UP )
       {
         // Spin the Image a few times.
         Animation animation = Animation::New(SPIN_DURATION);
index 7c4ed43..3196a3b 100644 (file)
@@ -130,17 +130,16 @@ private:
     mBloomView.Add( mBloomActor );
 
     // Connect the callback to the touch signal on the background
-    mSuperBlurView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
-    mBloomView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
+    mSuperBlurView.TouchSignal().Connect( this, &BlurExample::OnTouch );
+    mBloomView.TouchSignal().Connect( this, &BlurExample::OnTouch );
   }
 
   // Callback function of the touch signal on the background
-  bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
+  bool OnTouch(Dali::Actor actor, const Dali::TouchData& event)
   {
-    const TouchPoint &point = event.GetPoint(0);
-    switch(point.state)
+    switch( event.GetState( 0 ) )
     {
-      case TouchPoint::Down:
+      case PointState::DOWN:
       {
         if( mAnimation )
         {
@@ -159,9 +158,9 @@ private:
         mAnimation.Play();
         break;
       }
-      case TouchPoint::Up:
-      case TouchPoint::Leave:
-      case TouchPoint::Interrupted:
+      case PointState::UP:
+      case PointState::LEAVE:
+      case PointState::INTERRUPTED:
       {
         if( mAnimation )
         {
@@ -180,10 +179,8 @@ private:
         mAnimation.Play();
         break;
       }
-      case TouchPoint::Motion:
-      case TouchPoint::Stationary:
-      case TouchPoint::Last:
-      default:
+      case PointState::MOTION:
+      case PointState::STATIONARY:
       {
         break;
       }
diff --git a/examples/text-editor/text-editor-example.cpp b/examples/text-editor/text-editor-example.cpp
new file mode 100644 (file)
index 0000000..5ec61b7
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file simple-text-editor-example.cpp
+ * @brief Very basic usage of TextEditor control
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <iostream>
+#include <sstream>
+
+// INTERNAL INCLUDES
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+const Vector4 BACKGROUND_COLOR( 0.04f, 0.345f, 0.392f, 1.0f );      ///< The background color.
+const char*   TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";         ///< The tool-bar image.
+const float   TOOLBAR_BUTTON_PERCENTAGE = 0.1f;                     ///< The button's space width as a percentage of the toolbar's width.
+const float   TOOLBAR_TITLE_PERCENTAGE = 0.7f;                      ///< The title's width as a percentage of the toolbar's width.
+const float   TOOLBAR_HEIGHT_PERCENTAGE = 0.05f;                    ///< The toolbar's height as a percentage of the stage's height.
+const float   TOOLBAR_PADDING = 4.f;                                ///< The padding in pixels.
+const Vector3 BUTTON_PERCENTAGE( 0.8f, 0.8f, 1.f );                 ///< The button's width as a percentage of the space for the buttons in the toolbar.
+const Vector3 TEXT_EDITOR_RELATIVE_SIZE( 1.f, 0.45f, 1.0f );        ///< The size of the text editor as a percentage of the stage's size.
+const Vector4 TEXT_EDITOR_BACKGROUND_COLOR( 1.f, 1.f, 1.f, 0.15f ); ///< The background color of the text editor.
+
+const Vector4 COLORS[] = { Color::RED,
+                           Color::GREEN,
+                           Color::BLUE,
+                           Color::YELLOW,
+                           Color::CYAN,
+                           Color::MAGENTA,
+                           Color::WHITE,
+                           Color::BLACK };
+const unsigned int NUMBER_OF_COLORS = sizeof( COLORS ) / sizeof( Vector4 );
+
+} // Unnamed namespace
+
+/**
+ * @brief The main class of the demo.
+ */
+class TextEditorExample : public ConnectionTracker
+{
+public:
+
+  TextEditorExample( Application& application )
+  : mApplication( application )
+  {
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect( this, &TextEditorExample::Create );
+  }
+
+  ~TextEditorExample()
+  {
+    // Nothing to do here.
+  }
+
+  /**
+   * One-time setup in response to Application InitSignal.
+   */
+  void Create( Application& application )
+  {
+    Stage stage = Stage::GetCurrent();
+
+    // Respond to key events
+    stage.KeyEventSignal().Connect(this, &TextEditorExample::OnKeyEvent);
+
+    // Set a background color.
+    stage.SetBackgroundColor( BACKGROUND_COLOR );
+
+    // The stage size.
+    const Vector2 stageSize = stage.GetSize();
+
+    // Creates a default view with a default tool bar.
+    // The view is added to the stage.
+
+    // Set the toolbar style
+    const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+    const DemoHelper::ViewStyle viewStyle( TOOLBAR_BUTTON_PERCENTAGE,
+                                           TOOLBAR_TITLE_PERCENTAGE,
+                                           toolBarHeight,
+                                           TOOLBAR_PADDING );
+
+    Layer contents = DemoHelper::CreateView( mApplication,
+                                             mView,
+                                             mToolBar,
+                                             "",
+                                             TOOLBAR_IMAGE,
+                                             "",
+                                             viewStyle );
+
+    // Create a 'select color' button.
+    mColorButtonOption = Toolkit::PushButton::New();
+    mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    mColorButtonOption.SetSizeModeFactor( BUTTON_PERCENTAGE );
+
+    mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK );
+    mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK );
+
+    mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked );
+
+    mToolBar.AddControl( mColorButtonOption, viewStyle.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
+
+    // Create the text editor.
+    mEditor = TextEditor::New();
+    mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER );
+    mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+    mEditor.SetPosition( 0.f, toolBarHeight, 0.f );
+    mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE );
+
+    mEditor.SetBackgroundColor( TEXT_EDITOR_BACKGROUND_COLOR );
+
+    mEditor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK );
+    mEditor.SetProperty( TextEditor::Property::TEXT,
+                         "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"
+                         "Usu ne nisl maiorum iudicabit, veniam epicurei oporteat eos an.\n"
+                         "Ne nec nulla regione albucius, mea doctus delenit ad!\n"
+                         "Et everti blandit adversarium mei, eam porro neglegentur suscipiantur an.\n"
+                         "Quidam corpora at duo. An eos possim scripserit?\n\n"
+                         "Aťqui dicant sěnťenťíae aň vel!\n"
+                         "Vis viris médiocrem elaboraret ét, verear civibus moderatius ex duo!\n"
+                         "Án veri laborě iňtěgré quó, mei aď poššit lobortis, mei prompťa čonsťitůťó eů.\n"
+                         "Aliquip sanctůs delicáta quí ěá, et natum aliquam est?\n"
+                         "Asšúm sapěret usu ůť.\n"
+                         "Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n" );
+
+    contents.Add( mEditor );
+  }
+
+  void CreateButtonContainer()
+  {
+    mButtonContainer = Toolkit::TableView::New( NUMBER_OF_COLORS, 1u );
+    mButtonContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+    Stage stage = Stage::GetCurrent();
+    const Vector2 stageSize = stage.GetSize();
+    const float toolBarHeight = TOOLBAR_HEIGHT_PERCENTAGE * stageSize.height;
+    mButtonContainer.SetPosition( TOOLBAR_PADDING, 2.f * TOOLBAR_PADDING + toolBarHeight, 0.f );
+
+    mButtonContainer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
+    const Vector3 containerPercentage( 0.8f * TOOLBAR_BUTTON_PERCENTAGE, NUMBER_OF_COLORS, 1.f );
+    mButtonContainer.SetSizeModeFactor( containerPercentage );
+
+    Layer toolbarLayer = mToolBar.GetLayer();
+    toolbarLayer.Add( mButtonContainer );
+
+    const Vector3 buttonPercentage( 1.f, 0.8f / static_cast<float>( NUMBER_OF_COLORS ), 1.f );
+    for( unsigned int index = 0u; index < NUMBER_OF_COLORS; ++index )
+    {
+      Toolkit::PushButton button = Toolkit::PushButton::New();
+      button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+      button.SetSizeModeFactor( buttonPercentage );
+
+      std::ostringstream s;
+      s << "color" << index;
+      button.SetName( s.str() );
+
+      button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] );
+      button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] );
+
+      button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked );
+
+      mButtonContainer.Add( button );
+    }
+  }
+
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      {
+        // Exit application when click back or escape.
+        mApplication.Quit();
+      }
+    }
+  }
+
+  bool OnChangeColorButtonClicked( Button button )
+  {
+    if( !mButtonContainer )
+    {
+      CreateButtonContainer();
+    }
+
+    mButtonContainer.SetVisible( true );
+    mButtonContainer.SetSensitive( true );
+    return true;
+  }
+
+  bool OnColorButtonClicked( Button button )
+  {
+    const std::string& name = button.GetName();
+
+    if( "color" == name.substr( 0u, 5u ) )
+    {
+      const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u );
+      mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, COLORS[index] );
+    }
+
+    mButtonContainer.SetVisible( false );
+    mButtonContainer.SetSensitive( false );
+
+    return true;
+  }
+
+private:
+
+  Application& mApplication;
+
+  Toolkit::Control    mView;
+  Toolkit::ToolBar    mToolBar;
+  Toolkit::TextEditor mEditor;
+  Toolkit::PushButton mColorButtonOption;
+  Toolkit::TableView  mButtonContainer;
+};
+
+void RunTest( Application& application )
+{
+  TextEditorExample test( application );
+
+  application.MainLoop();
+}
+
+/** Entry point for Linux & Tizen applications */
+int main( int argc, char **argv )
+{
+  // DALI_DEMO_THEME_PATH not passed to Application so TextEditor example uses default Toolkit style sheet.
+  Application application = Application::New( &argc, &argv );
+
+  RunTest( application );
+
+  return 0;
+}
index 8b611b2..2a60569 100644 (file)
@@ -136,7 +136,7 @@ public:
     popup.SetSize( width, 0.0f );
     popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
     popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT );
-    popup.TouchedSignal().Connect( this, &TextFieldExample::OnPopupTouched );
+    popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
 
     return popup;
   }
@@ -159,15 +159,14 @@ public:
     mField.Reset();
   }
 
-  bool OnPopupTouched( Actor actor, const TouchEvent& event )
+  bool OnPopupTouched( Actor actor, const TouchData& event )
   {
     // End edit mode for TextField if parent Popup touched.
     if(event.GetPointCount() > 0)
     {
-      const TouchPoint& point = event.GetPoint(0);
-      switch(point.state)
+      switch( event.GetState( 0 ) )
       {
-        case TouchPoint::Down:
+        case PointState::DOWN:
         {
           // Update the folder text and lose focus for Key events
           if( mButton && mField )
index f2af26d..f5415b2 100644 (file)
@@ -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,21 +81,21 @@ 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 )
         {
index 95ebacf..8005b58 100644 (file)
@@ -66,7 +66,7 @@ public:
     mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
     mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent );
+    mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch );
     stage.Add( mTableView );
 
     for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index )
@@ -84,21 +84,21 @@ 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 )
         {
index 08d6fd6..0adc72e 100644 (file)
@@ -56,7 +56,7 @@ public:
     stage.Add( mTextLabel );
 
     // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchedSignal().Connect( this, &TiltController::OnTouch );
+    stage.GetRootLayer().TouchSignal().Connect( this, &TiltController::OnTouch );
 
     CreateSensor();
   }
@@ -71,7 +71,7 @@ public:
     }
   }
 
-  bool OnTouch( Actor actor, const TouchEvent& touch )
+  bool OnTouch( Actor actor, const TouchData& touch )
   {
     // quit the application
     mApplication.Quit();
diff --git a/examples/video-view/video-view-example.cpp b/examples/video-view/video-view-example.cpp
new file mode 100644 (file)
index 0000000..5621a80
--- /dev/null
@@ -0,0 +1,430 @@
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+  const int SEEK_POS( 5000 );
+  const int INIT_WIDTH( 600 );
+  const int INIT_HEIGHT( 400 );
+  const int BUTTON_SIZE( 80 );
+
+  const char* const PLAY_FILE = DEMO_VIDEO_DIR "big_buck_bunny.mp4";
+  const char* const PLAY_IMAGE = DEMO_IMAGE_DIR "icon-play.png";
+  const char* const PAUSE_IMAGE = DEMO_IMAGE_DIR "Pause.png";
+  const char* const STOP_IMAGE = DEMO_IMAGE_DIR "icon-stop.png";
+  const char* const RESET_IMAGE = DEMO_IMAGE_DIR "icon-reset.png";
+  const char* const FORWARD_IMAGE = DEMO_IMAGE_DIR "Forward.png";
+  const char* const BACKWARD_IMAGE = DEMO_IMAGE_DIR "Backward.png";
+
+const char* DEFAULT_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform lowp vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  precision mediump float;
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform lowp vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    vec2 st = vTexCoord.st;\n
+    vec3 irgb = texture2D( sTexture, st ).rgb;\n
+    vec3 negative = vec3( 1., 1., 1. ) - irgb;\n
+    gl_FragColor = vec4( mix( irgb, negative, 1.0), 1. ) * uColor;\n
+  }\n
+);
+
+}  // namespace
+
+class VideoViewController: public ConnectionTracker
+{
+ public:
+
+  VideoViewController( Application& application )
+    : mApplication( application ),
+      mIsPlay( false ),
+      mIsStop( false ),
+      mIsFullScreen( false ),
+      mSetCustomShader( false ),
+      mScale( 1.f )
+  {
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect( this, &VideoViewController::Create );
+  }
+
+  ~VideoViewController()
+  {
+    mVideoView.Stop();
+  }
+
+  void Create( Application& application )
+  {
+    mStageSize = Stage::GetCurrent().GetSize();
+
+    mVideoView = Toolkit::VideoView::New();
+    Stage::GetCurrent().Add( mVideoView );
+    mVideoView.SetParentOrigin( ParentOrigin::CENTER );
+    mVideoView.SetAnchorPoint( AnchorPoint::CENTER );
+    mVideoView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    mVideoView.SetSize( INIT_WIDTH, INIT_HEIGHT );
+    mVideoView.SetProperty( VideoView::Property::LOOPING, true );
+    mVideoView.SetProperty( VideoView::Property::MUTED, false );
+    mVideoView.SetProperty( VideoView::Property::VIDEO, PLAY_FILE );
+
+    mMenu = Layer::New();
+    mMenu.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+    mMenu.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+    mMenu.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mMenu.SetSize( INIT_WIDTH, 120 );
+    mVideoView.Add( mMenu );
+
+    mPlayButton = PushButton::New();
+    mPlayButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mPlayButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mPlayButton.SetName( "Play" );
+    mPlayButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mPlayButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mPlayButton.SetPosition( 40, 10 );
+    mPlayButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mPauseButton = PushButton::New();
+    mPauseButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mPauseButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mPauseButton.SetName( "Pause" );
+    mPauseButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mPauseButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mPauseButton.SetPosition( 40, 10 );
+    mPauseButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mStopButton = PushButton::New();
+    mStopButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mStopButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mStopButton.SetName( "Stop" );
+    mStopButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mStopButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mStopButton.SetPosition( 140, 10 );
+    mStopButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mResetButton = PushButton::New();
+    mResetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mResetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mResetButton.SetName( "Reset" );
+    mResetButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mResetButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mResetButton.SetPosition( 140, 10 );
+    mResetButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mBackwardButton = PushButton::New();
+    mBackwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mBackwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mBackwardButton.SetName( "Backward" );
+    mBackwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mBackwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mBackwardButton.SetPosition( 240, 10 );
+    mBackwardButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mForwardButton = PushButton::New();
+    mForwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mForwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mForwardButton.SetName( "Forward" );
+    mForwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+    mForwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
+    mForwardButton.SetPosition( 340, 10 );
+    mForwardButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
+
+    mMenu.Add( mPlayButton );
+    mMenu.Add( mPauseButton );
+    mMenu.Add( mStopButton );
+    mMenu.Add( mResetButton );
+    mMenu.Add( mBackwardButton );
+    mMenu.Add( mForwardButton );
+
+    mPauseButton.SetVisible( false );
+    mPauseButton.SetDisabled( true );
+    mPlayButton.SetVisible( true );
+    mPlayButton.SetDisabled( false );
+    mStopButton.SetVisible( true );
+    mStopButton.SetDisabled( false );
+    mResetButton.SetVisible( false );
+    mResetButton.SetDisabled( true );
+
+    mPlayButton.SetUnselectedImage( PLAY_IMAGE );
+    mPlayButton.SetSelectedImage( PLAY_IMAGE );
+    mPauseButton.SetUnselectedImage( PAUSE_IMAGE );
+    mPauseButton.SetSelectedImage( PAUSE_IMAGE );
+
+    mStopButton.SetUnselectedImage( STOP_IMAGE );
+    mStopButton.SetSelectedImage( STOP_IMAGE );
+    mResetButton.SetUnselectedImage( RESET_IMAGE );
+    mResetButton.SetSelectedImage( RESET_IMAGE );
+
+    mBackwardButton.SetUnselectedImage( BACKWARD_IMAGE );
+    mBackwardButton.SetSelectedImage( BACKWARD_IMAGE );
+    mForwardButton.SetUnselectedImage( FORWARD_IMAGE );
+    mForwardButton.SetSelectedImage( FORWARD_IMAGE );
+
+    mPanGestureDetector = PanGestureDetector::New();
+    mPanGestureDetector.Attach( mVideoView );
+    mPanGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnPan );
+
+    mPinchGestureDetector = PinchGestureDetector::New();
+    mPinchGestureDetector.Attach( mVideoView );
+    mPinchGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnPinch );
+
+    mTapGestureDetector = TapGestureDetector::New();
+    mTapGestureDetector.Attach( mVideoView );
+    mTapGestureDetector.DetectedSignal().Connect( this, &VideoViewController::OnTap );
+
+    mRotationAnimation = Animation::New(2.f);
+    mRotationAnimation.AnimateBy( Property(mVideoView, Actor::Property::ORIENTATION), Quaternion(Degree(0.f), Degree(360.f), Degree(0.f)) );
+    mRotationAnimation.SetLooping(false);
+
+    Stage::GetCurrent().KeyEventSignal().Connect( this, &VideoViewController::OnKeyEvent );
+
+    Property::Map customShader;
+    customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+    mCustomShader.Insert( "rendererType", "image" );
+    mCustomShader.Insert( "shader", customShader );
+
+    Property::Map defaultShader;
+    customShader.Insert( "fragmentShader", DEFAULT_FRAGMENT_SHADER );
+    mDefaultShader.Insert( "rendererType", "image" );
+    mDefaultShader.Insert( "shader", defaultShader );
+
+    mWindowSurfaceTarget.Insert( "RENDERING_TARGET", "windowSurfaceTarget" );
+    mNativeImageTarget.Insert( "RENDERING_TARGET", "nativeImageTarget" );
+
+    mVideoView.FinishedSignal().Connect( this, &VideoViewController::OnFinished );
+  }
+
+  bool OnButtonClicked( Button button )
+  {
+
+    if( mPauseButton.GetId() == button.GetId())
+    {
+       if( mIsPlay )
+      {
+        mPauseButton.SetVisible( false );
+        mPauseButton.SetDisabled( true );
+        mPlayButton.SetVisible( true );
+        mPlayButton.SetDisabled( false );
+
+        mIsPlay = false;
+        mVideoView.Pause();
+      }
+    }
+    else if( mPlayButton.GetId() == button.GetId())
+    {
+      if( mIsStop )
+      {
+        return false;
+      }
+
+      mPauseButton.SetVisible( true );
+      mPauseButton.SetDisabled( false );
+      mPlayButton.SetVisible( false );
+      mPlayButton.SetDisabled( true );
+
+      mIsPlay = true;
+      mVideoView.Play();
+    }
+    else if( mResetButton.GetId() == button.GetId())
+    {
+      if( mIsStop )
+      {
+        mPauseButton.SetVisible( true );
+        mPauseButton.SetDisabled( false );
+        mPlayButton.SetVisible( false );
+        mPlayButton.SetDisabled( true );
+        mResetButton.SetVisible( false );
+        mResetButton.SetDisabled( true );
+        mStopButton.SetVisible( true );
+        mStopButton.SetDisabled( false );
+
+        mIsStop = false;
+        mIsPlay = true;
+        mVideoView.SetProperty( VideoView::Property::VIDEO, PLAY_FILE );
+        mVideoView.Play();
+      }
+    }
+    else if( mStopButton.GetId() == button.GetId())
+    {
+      mPauseButton.SetVisible( false );
+      mPauseButton.SetDisabled( true );
+      mPlayButton.SetVisible( true );
+      mPlayButton.SetDisabled( false );
+      mResetButton.SetVisible( true );
+      mResetButton.SetDisabled( false );
+      mStopButton.SetVisible( false );
+      mStopButton.SetDisabled( true );
+
+      mIsStop = true;
+      mVideoView.Stop();
+    }
+    else if( mBackwardButton.GetId() == button.GetId())
+    {
+      mVideoView.Backward( SEEK_POS );
+    }
+    else if( mForwardButton.GetId() == button.GetId())
+    {
+      mVideoView.Forward( SEEK_POS );
+    }
+
+    return true;
+  }
+
+  void OnFinished( VideoView& view )
+  {
+    if( !mIsFullScreen )
+    {
+      mRotationAnimation.Play();
+      mIsStop = true;
+    }
+  }
+
+  void OnPan( Actor actor, const PanGesture& gesture )
+  {
+    if( !mIsFullScreen && gesture.state == Gesture::Continuing )
+    {
+      mVideoView.TranslateBy( Vector3( gesture.displacement ) );
+    }
+  }
+
+  void OnPinch( Actor actor, const PinchGesture& gesture )
+  {
+    if( gesture.state == Gesture::Started )
+    {
+      mPinchStartScale = mScale;
+    }
+
+    if( gesture.state == Gesture::Finished )
+    {
+      mScale = mPinchStartScale * gesture.scale;
+      if( mScale > 1.f )
+      {
+        mVideoView.SetSize( mStageSize.x, mStageSize.y );
+        mVideoView.SetProperty( VideoView::Property::VIDEO, mWindowSurfaceTarget );
+        mMenu.SetSize( mStageSize.x, 120 );
+        mIsFullScreen = true;
+      }
+      else
+      {
+        mVideoView.SetSize( INIT_WIDTH, INIT_HEIGHT );
+        mVideoView.SetProperty( VideoView::Property::VIDEO, mNativeImageTarget );
+        mMenu.SetSize( INIT_WIDTH, 120 );
+        mIsFullScreen = false;
+      }
+    }
+  }
+
+  void OnTap( Actor actor, const TapGesture& tapGesture )
+  {
+    if( !mIsFullScreen )
+    {
+      mRotationAnimation.Play();
+
+      if( mSetCustomShader )
+      {
+        mSetCustomShader = false;
+        mVideoView.SetProperty( VideoView::Property::VIDEO, mDefaultShader );
+      }
+      else
+      {
+        mSetCustomShader = true;
+        mVideoView.SetProperty( VideoView::Property::VIDEO, mCustomShader );
+      }
+    }
+  }
+
+private:
+
+  /**
+   * Main key event handler
+   */
+  void OnKeyEvent(const KeyEvent& event)
+  {
+    if(event.state == KeyEvent::Down)
+    {
+      if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+private:
+  Application&  mApplication;
+  VideoView mVideoView;
+  Layer mMenu;
+  Vector2 mStageSize;
+
+  bool mIsPlay;
+  bool mIsStop;
+  bool mIsFullScreen;
+  bool mSetCustomShader;
+
+  PushButton mPlayButton;
+  PushButton mPauseButton;
+  PushButton mStopButton;
+  PushButton mResetButton;
+  PushButton mBackwardButton;
+  PushButton mForwardButton;
+
+  PanGestureDetector mPanGestureDetector;
+  PinchGestureDetector mPinchGestureDetector;
+  TapGestureDetector mTapGestureDetector;
+  float mScale;
+  float mPinchStartScale;
+
+  Animation mRotationAnimation;
+  Property::Map mCustomShader;
+  Property::Map mDefaultShader;
+  Property::Map mWindowSurfaceTarget;
+  Property::Map mNativeImageTarget;
+};
+
+void RunTest( Application& application )
+{
+  VideoViewController test( application );
+
+  application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+  Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
+
+  RunTest( application );
+
+  return 0;
+}
index d9c89f4..d80b742 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    1.1.36
+Version:    1.1.39
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
@@ -133,6 +133,7 @@ exit 0
 %{dali_app_exe_dir}/*.example
 %{dali_app_exe_dir}/dali-builder
 %{dali_app_ro_dir}/images/*
+%{dali_app_ro_dir}/videos/*
 %{dali_app_ro_dir}/models/*
 %{dali_app_ro_dir}/scripts/*
 %{dali_app_ro_dir}/style/*
diff --git a/resources/images/Backward.png b/resources/images/Backward.png
new file mode 100755 (executable)
index 0000000..5950716
Binary files /dev/null and b/resources/images/Backward.png differ
diff --git a/resources/images/Forward.png b/resources/images/Forward.png
new file mode 100755 (executable)
index 0000000..dc3b200
Binary files /dev/null and b/resources/images/Forward.png differ
diff --git a/resources/images/Pause.png b/resources/images/Pause.png
new file mode 100755 (executable)
index 0000000..179bca5
Binary files /dev/null and b/resources/images/Pause.png differ
index f2bb9a3..bff6d83 100644 (file)
@@ -92,7 +92,7 @@
     "size": [200, 200, 1],
     "orientation": [0, 0, 30],
     "signals": [{
-      "name": "touched",
+      "name": "touch",
       "action": "play",
       "animation": "animate"
     }]
     "position": [-150, -50, 0],
     "text": "or me",
     "signals": [{
-      "name": "touched",
+      "name": "touch",
       "action": "play",
       "animation": "pathAnimation"
     }]
   }, {
     "name": "image",
     "type": "ImageView",
-    "image": {
-      "url": "{DEMO_IMAGE_DIR}gallery-large-21.jpg"
-    },
+    "image": "{DEMO_IMAGE_DIR}gallery-large-21.jpg",
     "relayoutEnabled": false,
     "position": [0, 200, 0],
     "size": [200, 200, 1],
     "signals": [{
-      "name": "touched",
+      "name": "touch",
       "action": "play",
       "animation": "rotate"
     }],
index 84bc1c5..c906566 100644 (file)
@@ -32,8 +32,7 @@
       "showPopup": true,
       "showValue": true,
       "valuePrecision": 2,
-      "value": 0.0,
-      "popupTextColor": [0.0, 1.0, 1.0, 1.0]
+      "value": 0.0
     }
   }
 }
index 28ef9d5..d02bcae 100644 (file)
     "showValue": true,
     "valuePrecision": 0,
     "value": 50.0,
-    "popupTextColor": [1, 0, 0, 1],
-    "hitRegion": [0, 48],
-    "backingRegion": [0, 10],
-    "handleRegion": [48, 48]
+    "trackVisual": {
+      "size": [0, 10]
+    },
+    "handleVisual": {
+      "size": [48, 48]
+    }
   }, {
     "type": "Slider",
     "parentOrigin": "TOP_CENTER",
     "showValue": true,
     "valuePrescision": 0,
     "value": 100.0,
-    "hitRegion": [0, 48],
-    "backingRegion": [0, 30],
-    "handleRegion": [48, 48],
-    "backingImageName": "{DEMO_IMAGE_DIR}button-up-14.9.png",
-    "handleImageName": "{DEMO_IMAGE_DIR}blocks-ball.png",
-    "progressImageName": "{DEMO_IMAGE_DIR}button-down.9.png"
+    "trackVisual": {
+      "url": "{DEMO_IMAGE_DIR}button-up-14.9.png",
+      "size": [0, 30]
+    },
+    "handleVisual": {
+      "url": "{DEMO_IMAGE_DIR}blocks-ball.png",
+      "size": [48, 48]
+    },
+    "progressVisual": {
+      "url": "{DEMO_IMAGE_DIR}button-down.9.png"
+    }
   }, {
     "type": "Slider",
     "parentOrigin": "TOP_CENTER",
     "showValue": true,
     "valuePrecision": 0,
     "value": 50.0,
-    "hitRegion": [0, 48],
-    "backingRegion": [0, 10],
-    "handleRegion": [48, 48],
-    "enabled": false
+    "trackVisual": {
+      "size": [0, 10]
+    },
+    "handleVisual": {
+      "size": [48, 48]
+    }
   }, {
     "type": "Slider",
     "parentOrigin": "TOP_CENTER",
     "showValue": true,
     "valuePrecision": 0,
     "value": 50.0,
-    "hitRegion": [0, 48],
-    "backingRegion": [0, 10],
-    "handleRegion": [48, 48],
-    "enabled": false,
-    "disableColor": [1, 0, 0, 1]
+    "trackVisual": {
+      "size": [0, 10]
+    },
+    "handleVisual": {
+      "size": [48, 48]
+    },
+    "disabledColor": [1, 0, 0, 1]
   }]
 }
index 482719c..1fe03a7 100644 (file)
@@ -65,9 +65,7 @@
           "name":"gallery1",
           "type":"ImageView",
           "heightResizePolicy":"FILL_TO_PARENT",
-          "image": {
-            "url": "{DEMO_IMAGE_DIR}gallery-small-1.jpg"
-          },
+          "image": "{DEMO_IMAGE_DIR}gallery-small-1.jpg",
           "properties": { // properties registered dynamically
             "cellIndex": [0,0], // property to specify the top-left cell this child occupies
             "rowSpan":4, // property to specify how many rows this child occupies, if not set, default value is 1
@@ -77,9 +75,7 @@
           "name":"gallery2",
           "type":"ImageView",
           "heightResizePolicy":"FILL_TO_PARENT",
-          "image": {
-            "url": "{DEMO_IMAGE_DIR}gallery-small-2.jpg"
-          },
+          "image": "{DEMO_IMAGE_DIR}gallery-small-2.jpg",
           "properties": { // properties registered dynamically
             "cellIndex": [0,1],
             "cellHorizontalAlignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left'
@@ -87,9 +83,7 @@
         },{
           "name":"gallery3",
           "type":"ImageView",
-          "image": {
-            "url": "{DEMO_IMAGE_DIR}gallery-small-3.jpg"
-          },
+          "image": "{DEMO_IMAGE_DIR}gallery-small-3.jpg",
           "properties": {
             "cellIndex":[1,1],
             "rowSpan":3,
           "name":"gallery4",
           "type":"ImageView",
           "widthResizePolicy":"FILL_TO_PARENT",
-          "image": {
-            "url": "{DEMO_IMAGE_DIR}gallery-small-4.jpg"
-          },
+          "image": "{DEMO_IMAGE_DIR}gallery-small-4.jpg",
           "properties": {
             "cellIndex":[2,2]
           }
           "type":"ImageView",
           "widthResizePolicy":"FILL_TO_PARENT",
           "heightResizePolicy":"FILL_TO_PARENT",
-          "image": {
-            "url": "{DEMO_IMAGE_DIR}gallery-small-5.jpg"
-          },
+          "image": "{DEMO_IMAGE_DIR}gallery-small-5.jpg",
           "properties": {
             "cellIndex":[3,2],
             "columnSpan": 2
diff --git a/resources/videos/big_buck_bunny.mp4 b/resources/videos/big_buck_bunny.mp4
new file mode 100644 (file)
index 0000000..a7c4228
Binary files /dev/null and b/resources/videos/big_buck_bunny.mp4 differ
index 0a62147..0262c7c 100644 (file)
@@ -88,6 +88,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE "Text Scripts"
 #define DALI_DEMO_STR_TITLE_EMOJI_TEXT                "Emoji Text"
 #define DALI_DEMO_STR_TITLE_TEXT_SCROLLING            "Text Scrolling"
+#define DALI_DEMO_STR_TITLE_TEXT_EDITOR               "Text Editor"
 #define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE            "Negotiate Size"
 #define DALI_DEMO_STR_TITLE_POPUP                     "Popup"
 #define DALI_DEMO_STR_TITLE_BUTTONS                   "Buttons"
index 6af3324..5d7f8be 100644 (file)
@@ -85,7 +85,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar,
   toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
   toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
 
-  // Add the tool bar to the too bar layer.
+  // Add the tool bar to the tool bar layer.
   toolBarLayer.Add( toolBar );
 
   // Tool bar text.