Internal::Control cleanup, remove dead an non-needed methods and adding missing test... 12/40012/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 27 May 2015 14:50:43 +0000 (15:50 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 27 May 2015 14:51:36 +0000 (15:51 +0100)
Change-Id: I0813ca3299910b911cde165892638048b905c86a

31 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
dali-toolkit/devel-api/controls/tool-bar/tool-bar.cpp
dali-toolkit/devel-api/controls/tool-bar/tool-bar.h
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h
dali-toolkit/internal/focus-manager/focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h

index 3fed0a2..24e3209 100644 (file)
@@ -42,22 +42,17 @@ int RunTestCase( struct ::testcase_s& testCase )
 {
   int result = EXIT_STATUS_TESTCASE_FAILED;
 
 {
   int result = EXIT_STATUS_TESTCASE_FAILED;
 
-  try
+// dont want to catch exception as we want to be able to get
+// gdb stack trace from the first error
+// by default tests should all always pass with no exceptions
+  if( testCase.startup )
   {
   {
-    if( testCase.startup )
-    {
-      testCase.startup();
-    }
-    result = testCase.function();
-    if( testCase.cleanup )
-    {
-      testCase.cleanup();
-    }
+    testCase.startup();
   }
   }
-  catch (...)
+  result = testCase.function();
+  if( testCase.cleanup )
   {
   {
-    printf("Caught exception in test case.\n");
-    result = EXIT_STATUS_TESTCASE_ABORTED;
+    testCase.cleanup();
   }
 
   return result;
   }
 
   return result;
index 43e362e..ee92498 100644 (file)
@@ -34,6 +34,8 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 
+#include <dali-toolkit/devel-api/styling/style-manager.h>
+
 #include "dummy-control.h"
 
 using namespace Dali;
 #include "dummy-control.h"
 
 using namespace Dali;
@@ -845,7 +847,6 @@ int UtcDaliControlImplSetStyleName(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
 
   {
     DummyControl dummy = DummyControl::New( true );
-    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -859,3 +860,60 @@ int UtcDaliControlImplSetStyleName(void)
   }
   END_TEST;
 }
   }
   END_TEST;
 }
+
+int UtcDaliControlImplOnStyleChangeP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl dummy = DummyControl::New( true );
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+
+  Dali::Toolkit::StyleManager styleManager;
+  controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
+
+  // unfortunately OnStyleChange does not return anything
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+
+int UtcDaliControlImplOnAccessibilityPanP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl dummy = DummyControl::New( true );
+  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+  PanGesture pan;
+  DALI_TEST_EQUALS( false, dummyImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliControlImplOnAccessibilityTouchP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl dummy = DummyControl::New( true );
+  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+  TouchEvent touch;
+  DALI_TEST_EQUALS( false, dummyImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliControlImplGetNextKeyboardFocusableActorP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl dummy = DummyControl::New( true );
+  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+
+  Actor currentFocusedActor;
+  Actor result = dummyImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::Left, false );
+
+  DALI_TEST_EQUALS( result, currentFocusedActor, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+
+
index 2914311..36e8f8c 100644 (file)
@@ -81,32 +81,6 @@ int UtcDaliToolBarNew(void)
   END_TEST;
 }
 
   END_TEST;
 }
 
-int UtcDaliToolBarSetBackground(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliToolBarSetBackground");
-
-  try
-  {
-    ImageActor toolBarBackground = CreateSolidColorActor( Color::RED );
-
-    ToolBar toolbar = ToolBar::New();
-    toolbar.SetBackground( toolBarBackground );
-
-    Stage::GetCurrent().Add( toolbar );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  tet_result(TET_PASS);
-
-  application.SendNotification(); // VCC To be removed!!
-  application.Render();     // VCC To be removed!!
-  END_TEST;
-}
-
 int UtcDaliToolBarAddControl01(void)
 {
   ToolkitTestApplication application;
 int UtcDaliToolBarAddControl01(void)
 {
   ToolkitTestApplication application;
index 328007b..5618410 100644 (file)
@@ -66,11 +66,6 @@ ToolBar ToolBar::DownCast( BaseHandle handle )
   return Control::DownCast<ToolBar, Internal::ToolBar>(handle);
 }
 
   return Control::DownCast<ToolBar, Internal::ToolBar>(handle);
 }
 
-void ToolBar::SetBackground( Actor background )
-{
-  GetImpl( *this ).SetBackground( background );
-}
-
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   GetImpl( *this ).AddControl( control, relativeSize, alignment, padding );
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   GetImpl( *this ).AddControl( control, relativeSize, alignment, padding );
index 17f9a63..b9f2c19 100644 (file)
@@ -88,12 +88,6 @@ public:
   static ToolBar DownCast( BaseHandle handle );
 
   /**
   static ToolBar DownCast( BaseHandle handle );
 
   /**
-   * Sets a background image.
-   * @param background Actor with the tool bar background.
-   */
-  void SetBackground( Actor background );
-
-  /**
    * Adds an additional control to the tool bar.
    * @pre The tool bar needs to be initialized.
    * @pre The alignment needs to be horizontal.
    * Adds an additional control to the tool bar.
    * @pre The tool bar needs to be initialized.
    * @pre The alignment needs to be horizontal.
index 786bac2..eab906c 100644 (file)
@@ -289,7 +289,7 @@ void BloomView::OnInitialize()
   SetupProperties();
 }
 
   SetupProperties();
 }
 
-void BloomView::OnControlSizeSet(const Vector3& targetSize)
+void BloomView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
 {
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
@@ -429,20 +429,6 @@ void BloomView::RemoveRenderTasks()
   taskList.RemoveTask(mCompositeTask);
 }
 
   taskList.RemoveTask(mCompositeTask);
 }
 
-void BloomView::OnStageDisconnection()
-{
-  // TODO: can't call this here, since SetImage() calls fails similarly to above
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Deactivate();
-}
-
-void BloomView::OnControlStageConnection()
-{
-  // TODO: can't call this here, since SetImage() calls fail to connect images to stage, since parent chain not fully on stage yet
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Activate();
-}
-
 void BloomView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
 void BloomView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
index 4c92b9a..2da9293 100644 (file)
@@ -87,10 +87,7 @@ public:
 private:
 
   virtual void OnInitialize();
 private:
 
   virtual void OnInitialize();
-  virtual void OnControlSizeSet(const Vector3& targetSize);
-  virtual void OnStageDisconnection();
-
-  virtual void OnControlStageConnection();
+  virtual void OnSizeSet(const Vector3& targetSize);
 
   void AllocateResources();
   void CreateRenderTasks();
 
   void AllocateResources();
   void CreateRenderTasks();
index 7632f79..a63b861 100644 (file)
@@ -538,7 +538,7 @@ void PushButton::StopAllAnimations()
   StopTransitionAnimation();
 }
 
   StopTransitionAnimation();
 }
 
-void PushButton::OnControlSizeSet( const Vector3& targetSize )
+void PushButton::OnSizeSet( const Vector3& targetSize )
 {
   if( targetSize != mSize )
   {
 {
   if( targetSize != mSize )
   {
index 6aa58e1..da49f13 100644 (file)
@@ -132,14 +132,14 @@ private: // From Button
 private: // From Control
 
   /**
 private: // From Control
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
    */
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
-  Vector3 GetNaturalSize();
+  virtual Vector3 GetNaturalSize();
 
   /**
    * @copydoc Toolkit::Control::OnSetResizePolicy
 
   /**
    * @copydoc Toolkit::Control::OnSetResizePolicy
index df8a6ea..0999db5 100644 (file)
@@ -315,7 +315,7 @@ void EffectsView::OnInitialize()
   SetupProperties();
 }
 
   SetupProperties();
 }
 
-void EffectsView::OnControlSizeSet(const Vector3& targetSize)
+void EffectsView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
 
 {
   mTargetSize = Vector2(targetSize);
 
index 1ee381b..a39a1f7 100644 (file)
@@ -133,9 +133,9 @@ private: // From Control
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
    */
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  virtual void OnSizeSet( const Vector3& targetSize );
 
 private:
 
 
 private:
 
index e5cd600..5da6110 100644 (file)
@@ -352,7 +352,7 @@ struct ZrelativeToYconstraint
   float mScale;
 };
 
   float mScale;
 };
 
-void GaussianBlurView::OnControlSizeSet(const Vector3& targetSize)
+void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
 
 {
   mTargetSize = Vector2(targetSize);
 
@@ -522,20 +522,6 @@ void GaussianBlurView::RemoveRenderTasks()
   taskList.RemoveTask(mCompositeTask);
 }
 
   taskList.RemoveTask(mCompositeTask);
 }
 
-void GaussianBlurView::OnStageDisconnection()
-{
-  // TODO: can't call this here, since SetImage() calls fails similarly to above
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Deactivate();
-}
-
-void GaussianBlurView::OnControlStageConnection()
-{
-  // TODO: can't call this here, since SetImage() calls fail to connect images to stage, since parent chain not fully on stage yet
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Activate();
-}
-
 void GaussianBlurView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
 void GaussianBlurView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
index 9420d24..0afa61c 100644 (file)
@@ -95,10 +95,7 @@ public:
 private:
 
   virtual void OnInitialize();
 private:
 
   virtual void OnInitialize();
-  virtual void OnControlSizeSet(const Vector3& targetSize);
-  virtual void OnStageDisconnection();
-
-  virtual void OnControlStageConnection();
+  virtual void OnSizeSet(const Vector3& targetSize);
 
   void SetBlurBellCurveWidth(float blurBellCurveWidth);
   float CalcGaussianWeight(float x);
 
   void SetBlurBellCurveWidth(float blurBellCurveWidth);
   float CalcGaussianWeight(float x);
index 29e5bec..15de6ea 100644 (file)
@@ -268,7 +268,7 @@ void Magnifier::SetFrameVisibility(bool visible)
   }
 }
 
   }
 }
 
-void Magnifier::OnControlSizeSet(const Vector3& targetSize)
+void Magnifier::OnSizeSet(const Vector3& targetSize)
 {
   // TODO: Once Camera/CameraActor properties function as proper animatable properties
   // this code can disappear.
 {
   // TODO: Once Camera/CameraActor properties function as proper animatable properties
   // this code can disappear.
index ff1297e..d4fea4e 100644 (file)
@@ -117,7 +117,7 @@ private:
 
 private:
 
 
 private:
 
-  virtual void OnControlSizeSet(const Vector3& targetSize);
+  virtual void OnSizeSet(const Vector3& targetSize);
 
 private:
 
 
 private:
 
index b55b757..d70065f 100644 (file)
@@ -423,13 +423,13 @@ void PageTurnView::SetupShadowView()
   mShadowView.Activate();
 }
 
   mShadowView.Activate();
 }
 
-void PageTurnView::OnControlStageConnection()
+void PageTurnView::OnStageConnection()
 {
   SetupShadowView();
   mTurningPageLayer.RaiseToTop();
 }
 
 {
   SetupShadowView();
   mTurningPageLayer.RaiseToTop();
 }
 
-void PageTurnView::OnControlStageDisconnection()
+void PageTurnView::OnStageDisconnection()
 {
   if(mShadowView)
   {
 {
   if(mShadowView)
   {
@@ -453,10 +453,6 @@ void PageTurnView::OnControlStageDisconnection()
   }
 }
 
   }
 }
 
-void PageTurnView::OnControlSizeSet( const Vector3& size )
-{
-}
-
 void PageTurnView::SetSpineShadowParameter( const Vector2& spineShadowParameter )
 {
   mSpineShadowParameter = spineShadowParameter;
 void PageTurnView::SetSpineShadowParameter( const Vector2& spineShadowParameter )
 {
   mSpineShadowParameter = spineShadowParameter;
index 7dc3bb7..c09250f 100644 (file)
@@ -199,19 +199,14 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConncection
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
    */
-  virtual void OnControlStageConnection();
+  virtual void OnStageConnection();
 
   /**
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageDisConnection
+   * @copydoc CustomActorImpl::OnStageDisconnection()
    */
    */
-  virtual void OnControlStageDisconnection();
-
-  /**
-   * @copydoc Toolkit::Control::OnControlSizeSet
-   */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnStageDisconnection();
 
 private: // implemented differently by PageTurnLandscapeView and PageTurnPortraitView
 
 
 private: // implemented differently by PageTurnLandscapeView and PageTurnPortraitView
 
index e957d0b..f65e77e 100755 (executable)
@@ -442,7 +442,7 @@ void ScrollBar::OnPan( Actor source, const PanGesture& gesture )
   }
 }
 
   }
 }
 
-void ScrollBar::OnControlSizeSet( const Vector3& size )
+void ScrollBar::OnSizeSet( const Vector3& size )
 {
   if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
   {
 {
   if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
   {
index 8c90758..f5321a4 100755 (executable)
@@ -201,9 +201,9 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& size )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
    */
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnSizeSet( const Vector3& size );
 
 private:
 
 
 private:
 
index 4c503ff..57e7e75 100644 (file)
@@ -658,7 +658,7 @@ void ScrollView::OnInitialize()
   SetInternalConstraints();
 }
 
   SetInternalConstraints();
 }
 
-void ScrollView::OnControlStageConnection()
+void ScrollView::OnStageConnection()
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
@@ -674,7 +674,7 @@ void ScrollView::OnControlStageConnection()
   }
 }
 
   }
 }
 
-void ScrollView::OnControlStageDisconnection()
+void ScrollView::OnStageDisconnection()
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
@@ -1868,7 +1868,7 @@ void ScrollView::OnSizeAnimation(Animation& animation, const Vector3& targetSize
   UpdatePropertyDomain();
 }
 
   UpdatePropertyDomain();
 }
 
-void ScrollView::OnControlSizeSet( const Vector3& size )
+void ScrollView::OnSizeSet( const Vector3& size )
 {
   // need to update domain properties for new size
   if( mDefaultMaxOvershoot )
 {
   // need to update domain properties for new size
   if( mDefaultMaxOvershoot )
index a90c335..be978a7 100644 (file)
@@ -508,9 +508,9 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
 
   /**
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
 
   /**
-   * @copydoc Dali::Control::OnControlSizeSet(const Vector3&)
+   * @copydoc CustomActorImpl::OnSizeSet(const Vector3&)
    */
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnSizeSet( const Vector3& size );
 
   /**
    * From CustomActorImpl; called after a child has been added to the owning actor.
 
   /**
    * From CustomActorImpl; called after a child has been added to the owning actor.
@@ -547,14 +547,14 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConnection()
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
    */
-  virtual void OnControlStageConnection();
+  virtual void OnStageConnection();
 
   /**
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConnection()
+   * @copydoc CustomActorImpl::OnStageDisconnection()
    */
    */
-  virtual void OnControlStageDisconnection();
+  virtual void OnStageDisconnection();
 
   /**
    * @copydoc Toolkit::Control::OnAccessibilityPan()
 
   /**
    * @copydoc Toolkit::Control::OnAccessibilityPan()
index 489e204..8ff89c3 100755 (executable)
@@ -209,7 +209,7 @@ void Slider::OnInitialize()
   self.SetSize( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y );
 }
 
   self.SetSize( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y );
 }
 
-void Slider::OnControlSizeSet( const Vector3& size )
+void Slider::OnSizeSet( const Vector3& size )
 {
   // Factor in handle overshoot into size of backing
   SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
 {
   // Factor in handle overshoot into size of backing
   SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
index 7020164..ea652fd 100755 (executable)
@@ -288,9 +288,9 @@ protected:
   virtual ~Slider();
 
   /**
   virtual ~Slider();
 
   /**
-   * @copydoc Control::OnControlSizeSet( const Vector3& size )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
    */
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnSizeSet( const Vector3& size );
 
 private:
 
 
 private:
 
index 6e6dc1b..2c93d41 100644 (file)
@@ -252,7 +252,7 @@ void SuperBlurView::ClearBlurResource()
   }
 }
 
   }
 }
 
-void SuperBlurView::OnControlSizeSet( const Vector3& targetSize )
+void SuperBlurView::OnSizeSet( const Vector3& targetSize )
 {
   if( mTargetSize != Vector2(targetSize) )
   {
 {
   if( mTargetSize != Vector2(targetSize) )
   {
index 923cb8f..3488c2c 100644 (file)
@@ -115,9 +115,9 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet
+   * @copydoc CustomActorImpl::OnSizeSet()
    */
    */
-  virtual void OnControlSizeSet(const Vector3& targetSize);
+  virtual void OnSizeSet(const Vector3& targetSize);
 
 private:
 
 
 private:
 
index 4d7a077..381cac6 100644 (file)
@@ -66,25 +66,6 @@ Toolkit::ToolBar ToolBar::New()
   return toolBar;
 }
 
   return toolBar;
 }
 
-void ToolBar::SetBackground( Actor background )
-{
-  Lock lock( mInitializing );
-
-  // ToolBar image
-  background.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
-  background.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
-  background.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
-
-  RenderableActor renderableActor = RenderableActor::DownCast( background );
-  if ( renderableActor )
-  {
-    renderableActor.SetSortModifier( 1.f );
-  }
-
-  Self().Add( background );
-  mBackground = background;
-}
-
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   // Work out index and update bases and offsets for further insertions.
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   // Work out index and update bases and offsets for further insertions.
@@ -355,12 +336,6 @@ void ToolBar::OnControlChildAdd(Actor& child)
   // actor is in mLayout not in Self().
 }
 
   // actor is in mLayout not in Self().
 }
 
-void ToolBar::OnControlSizeSet( const Vector3& targetSize )
-{
-  mToolBarSize = targetSize;
-  mBackground.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
 } // namespace Internal
 
 } // namespace Toolkit
index 27f09eb..7caaed5 100644 (file)
@@ -52,11 +52,6 @@ public:
   static Toolkit::ToolBar New();
 
   /**
   static Toolkit::ToolBar New();
 
   /**
-   * @copydoc Dali::Toolkit::ToolBar::SetBackground()
-   */
-  void SetBackground( Actor background );
-
-  /**
    * @copydoc Dali::Toolkit::ToolBar::AddControl()
    */
   void AddControl( Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding );
    * @copydoc Dali::Toolkit::ToolBar::AddControl()
    */
   void AddControl( Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding );
@@ -81,12 +76,6 @@ private: // From Control
    */
   virtual void OnControlChildAdd(Actor& child);
 
    */
   virtual void OnControlChildAdd(Actor& child);
 
-  /**
-   *
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
-   */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
-
 private:
   /**
    */
 private:
   /**
    */
@@ -135,8 +124,6 @@ private:
   float              mRightRelativeSpace;       ///< Relative space between center and right groups of controls.
   float              mAccumulatedRelativeSpace; ///< Stores the total percentage space used by controls.
   bool               mInitializing;             ///< Allows the use of Actor's API to add controls.
   float              mRightRelativeSpace;       ///< Relative space between center and right groups of controls.
   float              mAccumulatedRelativeSpace; ///< Stores the total percentage space used by controls.
   bool               mInitializing;             ///< Allows the use of Actor's API to add controls.
-  Vector3            mToolBarSize;              ///< The size of tool bar
-  Actor              mBackground;               ///< The background of the tool bar
 
   std::map<Actor/*control*/,Toolkit::Alignment> mControls; ///< Stores a relationship between controls and their alignments used to place them inside the table view.
 };
 
   std::map<Actor/*control*/,Toolkit::Alignment> mControls; ///< Stores a relationship between controls and their alignments used to place them inside the table view.
 };
index b832eff..a96cf79 100644 (file)
@@ -467,7 +467,7 @@ void FocusManager::DoActivate(Actor actor)
     if(control)
     {
       // Notify the control that it is activated
     if(control)
     {
       // Notify the control that it is activated
-      GetImplementation( control ).Activate();
+      GetImplementation( control ).AccessibilityActivate();
     }
 
     // Send notification for the activation of focused actor
     }
 
     // Send notification for the activation of focused actor
index cfe7287..4f4bf57 100644 (file)
@@ -351,7 +351,7 @@ void KeyboardFocusManager::DoActivate(Actor actor)
     if(control)
     {
       // Notify the control that it is activated
     if(control)
     {
       // Notify the control that it is activated
-      GetImplementation( control ).Activate();
+      GetImplementation( control ).AccessibilityActivate();
     }
 
     // Send notification for the activation of focused actor
     }
 
     // Send notification for the activation of focused actor
index d655a3b..de6e4f0 100644 (file)
@@ -51,25 +51,121 @@ namespace
 
 const float BACKGROUND_ACTOR_Z_POSITION( -0.1f );
 
 
 const float BACKGROUND_ACTOR_Z_POSITION( -0.1f );
 
+/**
+ * Creates control through type registry
+ */
 BaseHandle Create()
 {
   return Internal::Control::New();
 }
 
 BaseHandle Create()
 {
   return Internal::Control::New();
 }
 
+/**
+ * Performs actions as requested using the action name.
+ * @param[in] object The object on which to perform the action.
+ * @param[in] actionName The action to perform.
+ * @param[in] attributes The attributes with which to perfrom this action.
+ * @return true if action has been accepted by this control
+ */
+const char* ACTION_CONTROL_ACTIVATED = "control-activated";
+static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
+{
+  bool ret = false;
+
+  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
+  {
+    Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
+    if( control )
+    {
+      // if cast succeeds there is an implementation so no need to check
+      Internal::GetImplementation( control ).OnAccessibilityActivated();
+    }
+  }
+
+  return ret;
+}
+
+/**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+const char* SIGNAL_KEY_EVENT = "key-event";
+const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "key-input-focus-gained";
+const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "key-input-focus-lost";
+const char* SIGNAL_TAPPED = "tapped";
+const char* SIGNAL_PANNED = "panned";
+const char* SIGNAL_PINCHED = "pinched";
+const char* SIGNAL_LONG_PRESSED = "long-pressed";
+static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+  Dali::BaseHandle handle( object );
+
+  bool connected( false );
+  Toolkit::Control control = Toolkit::Control::DownCast( handle );
+  if ( control )
+  {
+    Internal::Control& controlImpl( Internal::GetImplementation( control ) );
+    connected = true;
+
+    if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
+    {
+      controlImpl.KeyEventSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
+    {
+      controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
+    {
+      controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Tap );
+      controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Pan );
+      controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Pinch );
+      controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::LongPress );
+      controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else
+    {
+      // signalName does not match any signal
+      connected = false;
+    }
+  }
+  return connected;
+}
+
 // Setup signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
 // Note: Properties are registered separately below.
 
 // Setup signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
 // Note: Properties are registered separately below.
 
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-event",              SIGNAL_KEY_EVENT              )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-gained", SIGNAL_KEY_INPUT_FOCUS_GAINED )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-lost",   SIGNAL_KEY_INPUT_FOCUS_LOST   )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "tapped",                 SIGNAL_TAPPED                 )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "panned",                 SIGNAL_PANNED                 )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "pinched",                SIGNAL_PINCHED                )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "long-pressed",           SIGNAL_LONG_PRESSED           )
+SignalConnectorType registerSignal1( typeRegistration, SIGNAL_KEY_EVENT, &DoConnectSignal );
+SignalConnectorType registerSignal2( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_GAINED, &DoConnectSignal );
+SignalConnectorType registerSignal3( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_LOST, &DoConnectSignal );
+SignalConnectorType registerSignal4( typeRegistration, SIGNAL_TAPPED, &DoConnectSignal );
+SignalConnectorType registerSignal5( typeRegistration, SIGNAL_PANNED, &DoConnectSignal );
+SignalConnectorType registerSignal6( typeRegistration, SIGNAL_PINCHED, &DoConnectSignal );
+SignalConnectorType registerSignal7( typeRegistration, SIGNAL_LONG_PRESSED, &DoConnectSignal );
 
 
-DALI_ACTION_REGISTRATION( Toolkit, Control, "control-activated",      ACTION_CONTROL_ACTIVATED      )
+TypeAction registerAction( typeRegistration, ACTION_CONTROL_ACTIVATED, &DoAction );
 
 DALI_TYPE_REGISTRATION_END()
 
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -409,52 +505,6 @@ Control::~Control()
   delete mImpl;
 }
 
   delete mImpl;
 }
 
-void Control::SetKeyInputFocus()
-{
-  if( Self().OnStage() )
-  {
-    Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
-  }
-}
-
-bool Control::HasKeyInputFocus()
-{
-  bool result = false;
-  if( Self().OnStage() )
-  {
-    result = Toolkit::KeyInputFocusManager::Get().IsKeyboardListener(Toolkit::Control::DownCast(Self()));
-  }
-  return result;
-}
-
-void Control::ClearKeyInputFocus()
-{
-  if( Self().OnStage() )
-  {
-    Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
-  }
-}
-
-PinchGestureDetector Control::GetPinchGestureDetector() const
-{
-  return mImpl->mPinchGestureDetector;
-}
-
-PanGestureDetector Control::GetPanGestureDetector() const
-{
-  return mImpl->mPanGestureDetector;
-}
-
-TapGestureDetector Control::GetTapGestureDetector() const
-{
-  return mImpl->mTapGestureDetector;
-}
-
-LongPressGestureDetector Control::GetLongPressGestureDetector() const
-{
-  return mImpl->mLongPressGestureDetector;
-}
-
 void Control::SetStyleName( const std::string& styleName )
 {
   if( styleName != mImpl->mStyleName )
 void Control::SetStyleName( const std::string& styleName )
 {
   if( styleName != mImpl->mStyleName )
@@ -536,39 +586,118 @@ void Control::ClearBackground()
   }
 }
 
   }
 }
 
-void Control::SetKeyboardNavigationSupport(bool isSupported)
+void Control::EnableGestureDetection(Gesture::Type type)
 {
 {
-  mImpl->mIsKeyboardNavigationSupported = isSupported;
+  if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
+  {
+    mImpl->mPinchGestureDetector = PinchGestureDetector::New();
+    mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
+    mImpl->mPinchGestureDetector.Attach(Self());
+  }
+
+  if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
+  {
+    mImpl->mPanGestureDetector = PanGestureDetector::New();
+    mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
+    mImpl->mPanGestureDetector.Attach(Self());
+  }
+
+  if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
+  {
+    mImpl->mTapGestureDetector = TapGestureDetector::New();
+    mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
+    mImpl->mTapGestureDetector.Attach(Self());
+  }
+
+  if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
+  {
+    mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
+    mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
+    mImpl->mLongPressGestureDetector.Attach(Self());
+  }
 }
 
 }
 
-bool Control::IsKeyboardNavigationSupported()
+void Control::DisableGestureDetection(Gesture::Type type)
 {
 {
-  return mImpl->mIsKeyboardNavigationSupported;
+  if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
+  {
+    mImpl->mPinchGestureDetector.Detach(Self());
+    mImpl->mPinchGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
+  {
+    mImpl->mPanGestureDetector.Detach(Self());
+    mImpl->mPanGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
+  {
+    mImpl->mTapGestureDetector.Detach(Self());
+    mImpl->mTapGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
+  {
+    mImpl->mLongPressGestureDetector.Detach(Self());
+    mImpl->mLongPressGestureDetector.Reset();
+  }
 }
 
 }
 
-void Control::Activate()
+PinchGestureDetector Control::GetPinchGestureDetector() const
 {
 {
-  // Inform deriving classes
-  OnAccessibilityActivated();
+  return mImpl->mPinchGestureDetector;
 }
 
 }
 
-void Control::OnAccessibilityActivated()
+PanGestureDetector Control::GetPanGestureDetector() const
 {
 {
+  return mImpl->mPanGestureDetector;
 }
 
 }
 
-bool Control::OnAccessibilityPan(PanGesture gesture)
+TapGestureDetector Control::GetTapGestureDetector() const
 {
 {
-  return false; // Accessibility pan gesture is not handled by default
+  return mImpl->mTapGestureDetector;
 }
 
 }
 
-bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+LongPressGestureDetector Control::GetLongPressGestureDetector() const
 {
 {
-  return false; // Accessibility touch event is not handled by default
+  return mImpl->mLongPressGestureDetector;
 }
 
 }
 
-bool Control::OnAccessibilityValueChange(bool isIncrease)
+void Control::SetKeyboardNavigationSupport(bool isSupported)
 {
 {
-  return false; // Accessibility value change action is not handled by default
+  mImpl->mIsKeyboardNavigationSupported = isSupported;
+}
+
+bool Control::IsKeyboardNavigationSupported()
+{
+  return mImpl->mIsKeyboardNavigationSupported;
+}
+
+void Control::SetKeyInputFocus()
+{
+  if( Self().OnStage() )
+  {
+    Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
+  }
+}
+
+bool Control::HasKeyInputFocus()
+{
+  bool result = false;
+  if( Self().OnStage() )
+  {
+    result = Toolkit::KeyInputFocusManager::Get().IsKeyboardListener(Toolkit::Control::DownCast(Self()));
+  }
+  return result;
+}
+
+void Control::ClearKeyInputFocus()
+{
+  if( Self().OnStage() )
+  {
+    Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
+  }
 }
 
 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
 }
 
 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
@@ -584,82 +713,38 @@ bool Control::IsKeyboardFocusGroup()
   return Toolkit::KeyboardFocusManager::Get().IsFocusGroup(Self());
 }
 
   return Toolkit::KeyboardFocusManager::Get().IsFocusGroup(Self());
 }
 
-Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+void Control::AccessibilityActivate()
 {
 {
-  return Actor();
+  // Inform deriving classes
+  OnAccessibilityActivated();
 }
 
 }
 
-void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
+void Control::OnAccessibilityActivated()
 {
 }
 
 {
 }
 
-bool Control::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes)
+bool Control::OnAccessibilityPan(PanGesture gesture)
 {
 {
-  bool ret = false;
-
-  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
-  {
-    Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
-    if( control )
-    {
-      // if cast succeeds there is an implementation so no need to check
-      GetImplementation( control ).OnAccessibilityActivated();
-    }
-  }
+  return false; // Accessibility pan gesture is not handled by default
+}
 
 
-  return ret;
+bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+{
+  return false; // Accessibility touch event is not handled by default
 }
 
 }
 
-bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+bool Control::OnAccessibilityValueChange(bool isIncrease)
 {
 {
-  Dali::BaseHandle handle( object );
+  return false; // Accessibility value change action is not handled by default
+}
 
 
-  bool connected( false );
-  Toolkit::Control control = Toolkit::Control::DownCast( handle );
-  if ( control )
-  {
-    Control& controlImpl( GetImplementation( control ) );
-    connected = true;
+Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+{
+  return Actor();
+}
 
 
-    if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
-    {
-      controlImpl.KeyEventSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
-    {
-      controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
-    {
-      controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Tap );
-      controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Pan );
-      controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Pinch );
-      controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::LongPress );
-      controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else
-    {
-      // signalName does not match any signal
-      connected = false;
-    }
-  }
-  return connected;
+void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
+{
 }
 
 Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
 }
 
 Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
@@ -728,76 +813,10 @@ void Control::Initialize()
   OnInitialize();
 }
 
   OnInitialize();
 }
 
-void Control::EnableGestureDetection(Gesture::Type type)
-{
-  if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
-  {
-    mImpl->mPinchGestureDetector = PinchGestureDetector::New();
-    mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
-    mImpl->mPinchGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
-  {
-    mImpl->mPanGestureDetector = PanGestureDetector::New();
-    mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
-    mImpl->mPanGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
-  {
-    mImpl->mTapGestureDetector = TapGestureDetector::New();
-    mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
-    mImpl->mTapGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
-  {
-    mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
-    mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
-    mImpl->mLongPressGestureDetector.Attach(Self());
-  }
-}
-
-void Control::DisableGestureDetection(Gesture::Type type)
-{
-  if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
-  {
-    mImpl->mPinchGestureDetector.Detach(Self());
-    mImpl->mPinchGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
-  {
-    mImpl->mPanGestureDetector.Detach(Self());
-    mImpl->mPanGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
-  {
-    mImpl->mTapGestureDetector.Detach(Self());
-    mImpl->mTapGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
-  {
-    mImpl->mLongPressGestureDetector.Detach(Self());
-    mImpl->mLongPressGestureDetector.Reset();
-  }
-}
-
 void Control::OnInitialize()
 {
 }
 
 void Control::OnInitialize()
 {
 }
 
-void Control::OnControlStageConnection()
-{
-}
-
-void Control::OnControlStageDisconnection()
-{
-}
-
 void Control::OnControlChildAdd( Actor& child )
 {
 }
 void Control::OnControlChildAdd( Actor& child )
 {
 }
@@ -843,10 +862,6 @@ void Control::OnLongPress( const LongPressGesture& longPress )
 {
 }
 
 {
 }
 
-void Control::OnControlSizeSet( const Vector3& size )
-{
-}
-
 void Control::EmitKeyInputFocusSignal( bool focusGained )
 {
   Dali::Toolkit::Control handle( GetOwner() );
 void Control::EmitKeyInputFocusSignal( bool focusGained )
 {
   Dali::Toolkit::Control handle( GetOwner() );
@@ -869,26 +884,22 @@ void Control::EmitKeyInputFocusSignal( bool focusGained )
   }
 }
 
   }
 }
 
-void Control::OnKeyInputFocusGained()
+void Control::OnStageConnection()
 {
 {
-  EmitKeyInputFocusSignal( true );
 }
 
 }
 
-void Control::OnKeyInputFocusLost()
+void Control::OnStageDisconnection()
 {
 {
-  EmitKeyInputFocusSignal( false );
 }
 
 }
 
-void Control::OnStageConnection()
+void Control::OnKeyInputFocusGained()
 {
 {
-  // Notify derived classes.
-  OnControlStageConnection();
+  EmitKeyInputFocusSignal( true );
 }
 
 }
 
-void Control::OnStageDisconnection()
+void Control::OnKeyInputFocusLost()
 {
 {
-  // Notify derived classes
-  OnControlStageDisconnection();
+  EmitKeyInputFocusSignal( false );
 }
 
 void Control::OnChildAdd(Actor& child)
 }
 
 void Control::OnChildAdd(Actor& child)
@@ -918,9 +929,6 @@ void Control::OnChildRemove(Actor& child)
 void Control::OnSizeSet(const Vector3& targetSize)
 {
   // Background is resized through size negotiation
 void Control::OnSizeSet(const Vector3& targetSize)
 {
   // Background is resized through size negotiation
-
-  // Notify derived classes.
-  OnControlSizeSet( targetSize );
 }
 
 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
 }
 
 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
index a7e2c91..951a6b5 100644 (file)
@@ -71,26 +71,63 @@ public:
    */
   virtual ~Control();
 
    */
   virtual ~Control();
 
-  // Key Input
+  // Styling
 
   /**
 
   /**
-   * @copydoc Toolkit::Control::SetKeyInputFocus()
+   * @copydoc Dali::Toolkit::Control::SetStyleName
    */
    */
-  void SetKeyInputFocus();
+  void SetStyleName( const std::string& styleName );
 
   /**
 
   /**
-   * @copydoc Toolkit::Control::HasKeyInputFocus()
+   * @copydoc Dali::Toolkit::Control::GetStyleName
    */
    */
-  bool HasKeyInputFocus();
+  const std::string& GetStyleName() const;
+
+  // Background
 
   /**
 
   /**
-   * @copydoc Toolkit::Control::ClearKeyInputFocus()
+   * @copydoc Dali::Toolkit::Control::SetBackgroundColor
    */
    */
-  void ClearKeyInputFocus();
+  void SetBackgroundColor( const Vector4& color );
+
+  /**
+   * @copydoc Dali::Toolkit::Control::GetBackgroundColor
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
+   * @copydoc Dali::Toolkit::Control::SetBackgroundImage
+   */
+  void SetBackgroundImage( Image image );
+
+  /**
+   * @copydoc Dali::Toolkit::Control::ClearBackground
+   */
+  void ClearBackground();
 
   // Gesture Detection
 
   /**
 
   // Gesture Detection
 
   /**
+   * @brief Allows deriving classes to enable any of the gesture detectors that are available.
+   *
+   * 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));
+   * @endcode
+   * @param[in]  type  The gesture type(s) to enable.
+   */
+  void EnableGestureDetection( Gesture::Type type );
+
+  /**
+   * @brief Allows deriving classes to disable any of the gesture detectors.
+   *
+   * Like EnableGestureDetection, this can also be called using bitwise or.
+   * @param[in]  type  The gesture type(s) to disable.
+   * @see EnableGetureDetection
+   */
+  void DisableGestureDetection( Gesture::Type type );
+
+  /**
    * @brief If deriving classes wish to fine tune pinch gesture
    * detection then they can access the gesture detector through this
    * API and modify the detection.
    * @brief If deriving classes wish to fine tune pinch gesture
    * detection then they can access the gesture detector through this
    * API and modify the detection.
@@ -134,40 +171,6 @@ public:
    */
   LongPressGestureDetector GetLongPressGestureDetector() const;
 
    */
   LongPressGestureDetector GetLongPressGestureDetector() const;
 
-  // Styling
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetStyleName
-   */
-  void SetStyleName( const std::string& styleName );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::GetStyleName
-   */
-  const std::string& GetStyleName() const;
-
-  // Background
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetBackgroundColor
-   */
-  void SetBackgroundColor( const Vector4& color );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::GetBackgroundColor
-   */
-  Vector4 GetBackgroundColor() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetBackgroundImage
-   */
-  void SetBackgroundImage( Image image );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::ClearBackground
-   */
-  void ClearBackground();
-
   // Keyboard Navigation
 
   /**
   // Keyboard Navigation
 
   /**
@@ -178,7 +181,7 @@ public:
    * The control doesn't support it by default.
    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
    */
    * The control doesn't support it by default.
    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
    */
-  void SetKeyboardNavigationSupport(bool isSupported);
+  void SetKeyboardNavigationSupport( bool isSupported );
 
   /**
    * @brief Gets whether this control supports two dimensional keyboard navigation.
 
   /**
    * @brief Gets whether this control supports two dimensional keyboard navigation.
@@ -187,12 +190,22 @@ public:
    */
   bool IsKeyboardNavigationSupported();
 
    */
   bool IsKeyboardNavigationSupported();
 
-  // Called by Focus Managers
+  // Key Input
 
   /**
 
   /**
-   * @brief Called by the focus manager and keyboard focus manager to Activate the Control
+   * @copydoc Toolkit::Control::SetKeyInputFocus()
+   */
+  void SetKeyInputFocus();
+
+  /**
+   * @copydoc Toolkit::Control::HasKeyInputFocus()
+   */
+  bool HasKeyInputFocus();
+
+  /**
+   * @copydoc Toolkit::Control::ClearKeyInputFocus()
    */
    */
-  DALI_INTERNAL void Activate();
+  void ClearKeyInputFocus();
 
   // Keyboard Focus
 
 
   // Keyboard Focus
 
@@ -203,7 +216,7 @@ public:
    * can be limitied to its child actors). The control is not a focus group by default.
    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
    */
    * can be limitied to its child actors). The control is not a focus group by default.
    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
    */
-  void SetAsKeyboardFocusGroup(bool isFocusGroup);
+  void SetAsKeyboardFocusGroup( bool isFocusGroup );
 
   /**
    * @brief Gets whether this control is a focus group for keyboard navigation.
 
   /**
    * @brief Gets whether this control is a focus group for keyboard navigation.
@@ -212,37 +225,14 @@ public:
    */
   bool IsKeyboardFocusGroup();
 
    */
   bool IsKeyboardFocusGroup();
 
-  /**
-   * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
-   *
-   * Should be called last by the control after it acts on the Input Focus change.
-   *
-   * @param[in] focusGained True if gained, False if lost
-   */
-  void EmitKeyInputFocusSignal( bool focusGained );
-
-  // Actions & Signals
+  // Called by Focus Manager
 
   /**
 
   /**
-   * @brief Performs actions as requested using the action name.
-   *
-   * @param[in] object The object on which to perform the action.
-   * @param[in] actionName The action to perform.
-   * @param[in] attributes The attributes with which to perfrom this action.
-   * @return true if action has been accepted by this control
+   * @brief Called by the focus manager and keyboard focus manager to Activate the Control
    */
    */
-  static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes);
+  DALI_INTERNAL void AccessibilityActivate();
 
 
-  /**
-   * Connects a callback function with the object's signals.
-   * @param[in] object The object providing the signal.
-   * @param[in] tracker Used to disconnect the signal.
-   * @param[in] signalName The signal to connect to.
-   * @param[in] functor A newly allocated FunctorDelegate.
-   * @return True if the signal was connected.
-   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
-   */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+  // Signals
 
   /**
    * @copydoc Dali::Toolkit::Control::KeyEventSignal()
 
   /**
    * @copydoc Dali::Toolkit::Control::KeyEventSignal()
@@ -265,7 +255,18 @@ public:
    * @param[in] event The key event.
    * @return True if the event was consumed.
    */
    * @param[in] event The key event.
    * @return True if the event was consumed.
    */
-  DALI_INTERNAL bool EmitKeyEventSignal(const KeyEvent& event);
+  DALI_INTERNAL bool EmitKeyEventSignal( const KeyEvent& event );
+
+protected: // For derived classes to call
+
+  /**
+   * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
+   *
+   * Should be called last by the control after it acts on the Input Focus change.
+   *
+   * @param[in] focusGained True if gained, False if lost
+   */
+  void EmitKeyInputFocusSignal( bool focusGained );
 
 protected: // From CustomActorImpl, not to be used by application developers
 
 
 protected: // From CustomActorImpl, not to be used by application developers
 
@@ -282,42 +283,42 @@ protected: // From CustomActorImpl, not to be used by application developers
   /**
    * @copydoc CustomActorImpl::OnChildAdd()
    */
   /**
    * @copydoc CustomActorImpl::OnChildAdd()
    */
-  virtual void OnChildAdd(Actor& child);
+  virtual void OnChildAdd( Actor& child );
 
   /**
    * @copydoc CustomActorImpl::OnChildRemove()
    */
 
   /**
    * @copydoc CustomActorImpl::OnChildRemove()
    */
-  virtual void OnChildRemove(Actor& child);
+  virtual void OnChildRemove( Actor& child );
 
   /**
    * @copydoc CustomActorImpl::OnSizeSet()
    */
 
   /**
    * @copydoc CustomActorImpl::OnSizeSet()
    */
-  virtual void OnSizeSet(const Vector3& targetSize);
+  virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
    * @copydoc CustomActorImpl::OnSizeAnimation()
    */
 
   /**
    * @copydoc CustomActorImpl::OnSizeAnimation()
    */
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
+  virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
 
   /**
    * @copydoc CustomActorImpl::OnTouchEvent()
    */
 
   /**
    * @copydoc CustomActorImpl::OnTouchEvent()
    */
-  virtual bool OnTouchEvent(const TouchEvent& event);
+  virtual bool OnTouchEvent( const TouchEvent& event );
 
   /**
    * @copydoc CustomActorImpl::OnHoverEvent()
    */
 
   /**
    * @copydoc CustomActorImpl::OnHoverEvent()
    */
-  virtual bool OnHoverEvent(const HoverEvent& event);
+  virtual bool OnHoverEvent( const HoverEvent& event );
 
   /**
    * @copydoc CustomActorImpl::OnKeyEvent()
    */
 
   /**
    * @copydoc CustomActorImpl::OnKeyEvent()
    */
-  virtual bool OnKeyEvent(const KeyEvent& event);
+  virtual bool OnKeyEvent( const KeyEvent& event );
 
   /**
    * @copydoc CustomActorImpl::OnMouseWheelEvent()
    */
 
   /**
    * @copydoc CustomActorImpl::OnMouseWheelEvent()
    */
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+  virtual bool OnMouseWheelEvent( const MouseWheelEvent& event );
 
   /**
    * @copydoc CustomActorImpl::OnRelayout()
 
   /**
    * @copydoc CustomActorImpl::OnRelayout()
@@ -391,28 +392,6 @@ protected: // Helpers for deriving classes
    */
   void Initialize();
 
    */
   void Initialize();
 
-  // Gesture Detection
-
-  /**
-   * @brief Allows deriving classes to enable any of the gesture detectors that are available.
-   *
-   * 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));
-   * @endcode
-   * @param[in]  type  The gesture type(s) to enable.
-   */
-  void EnableGestureDetection( Gesture::Type type );
-
-  /**
-   * @brief Allows deriving classes to disable any of the gesture detectors.
-   *
-   * Like EnableGestureDetection, this can also be called using bitwise or.
-   * @param[in]  type  The gesture type(s) to disable.
-   * @see EnableGetureDetection
-   */
-  void DisableGestureDetection( Gesture::Type type );
-
 public: // API for derived classes to override
 
   // Lifecycle
 public: // API for derived classes to override
 
   // Lifecycle
@@ -425,20 +404,6 @@ public: // API for derived classes to override
   virtual void OnInitialize();
 
   /**
   virtual void OnInitialize();
 
   /**
-   * @brief Called whenever the control is added to the stage.
-   *
-   * Could be overridden by derived classes.
-   */
-  virtual void OnControlStageConnection();
-
-  /**
-   * @brief Called whenever the control is removed from the stage.
-   *
-   * Could be overridden by derived classes.
-   */
-  virtual void OnControlStageDisconnection();
-
-  /**
    * @brief Called whenever an Actor is added to the control.
    *
    * Could be overridden by derived classes.
    * @brief Called whenever an Actor is added to the control.
    *
    * Could be overridden by derived classes.
@@ -466,15 +431,6 @@ public: // API for derived classes to override
    */
   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
 
    */
   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
 
-  // Size negotiation
-
-  /**
-   * @brief Called whenever the Control's size is set.
-   *
-   * @param[in] size The new size.
-   */
-  virtual void OnControlSizeSet( const Vector3& size );
-
   // Accessibility
 
   /**
   // Accessibility
 
   /**
@@ -491,7 +447,7 @@ public: // API for derived classes to override
    * @param[in] gesture The pan gesture.
    * @return true if the pan gesture has been consumed by this control
    */
    * @param[in] gesture The pan gesture.
    * @return true if the pan gesture has been consumed by this control
    */
-  virtual bool OnAccessibilityPan(PanGesture gesture);
+  virtual bool OnAccessibilityPan( PanGesture gesture );
 
   /**
    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
 
   /**
    * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
@@ -500,7 +456,7 @@ public: // API for derived classes to override
    * @param[in] touchEvent The touch event.
    * @return true if the touch event has been consumed by this control
    */
    * @param[in] touchEvent The touch event.
    * @return true if the touch event has been consumed by this control
    */
-  virtual bool OnAccessibilityTouch(const TouchEvent& touchEvent);
+  virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
 
   /**
    * @brief This method should be overridden by deriving classes when they wish to respond
 
   /**
    * @brief This method should be overridden by deriving classes when they wish to respond
@@ -509,7 +465,7 @@ public: // API for derived classes to override
    * @param[in] isIncrease Whether the value should be increased or decreased
    * @return true if the value changed action has been consumed by this control
    */
    * @param[in] isIncrease Whether the value should be increased or decreased
    * @return true if the value changed action has been consumed by this control
    */
-  virtual bool OnAccessibilityValueChange(bool isIncrease);
+  virtual bool OnAccessibilityValueChange( bool isIncrease );
 
   // Keyboard focus
 
 
   // Keyboard focus
 
@@ -536,7 +492,7 @@ public: // API for derived classes to override
    * @param[in] loopEnabled Whether the focus movement should be looped within the control.
    * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
    */
    * @param[in] loopEnabled Whether the focus movement should be looped within the control.
    * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
    */
-  virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
+  virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled );
 
   /**
    * @brief Informs this control that its chosen focusable actor will be focused.
 
   /**
    * @brief Informs this control that its chosen focusable actor will be focused.
@@ -546,7 +502,7 @@ public: // API for derived classes to override
    *
    * @param[in] commitedFocusableActor The commited focusable actor.
    */
    *
    * @param[in] commitedFocusableActor The commited focusable actor.
    */
-  virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor);
+  virtual void OnKeyboardFocusChangeCommitted( Actor commitedFocusableActor );
 
   // Gestures
 
 
   // Gestures
 
@@ -562,7 +518,7 @@ public: // API for derived classes to override
    * @param[in]  pinch  The pinch gesture.
    * @see EnableGestureDetection
    */
    * @param[in]  pinch  The pinch gesture.
    * @see EnableGestureDetection
    */
-  virtual void OnPinch(const PinchGesture& pinch);
+  virtual void OnPinch( const PinchGesture& pinch );
 
   /**
    * @brief Called whenever a pan gesture is detected on this control.
 
   /**
    * @brief Called whenever a pan gesture is detected on this control.
@@ -628,8 +584,8 @@ public: // API for derived classes to override
 private:
 
   // Undefined
 private:
 
   // Undefined
-  DALI_INTERNAL Control(const Control&);
-  DALI_INTERNAL Control& operator=(const Control&);
+  DALI_INTERNAL Control( const Control& );
+  DALI_INTERNAL Control& operator=( const Control& );
 
   class Impl;
   Impl* mImpl;
 
   class Impl;
   Impl* mImpl;