X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Ffocus-manager-impl.cpp;h=b832eff6f958db65b7ed26a6db4ce1cdc45ed1c2;hp=1fcc519c09f76b59878fc3afa3c4b9c1c254f001;hb=7c5cd5665d3b4648fed0a8b0a67522cdb48885cf;hpb=49499a0b6e23d98f681f7aefe6b18c5dad55f8b3 diff --git a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp index 1fcc519c..b832eff 100644 --- a/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/focus-manager-impl.cpp @@ -19,18 +19,19 @@ #include "focus-manager-impl.h" // EXTERNAL INCLUDES +#include // for strcmp #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include +#include // INTERNAL INCLUDES #include #include -#include namespace Dali { @@ -44,12 +45,18 @@ namespace Internal namespace // unnamed namespace { +// Signals + +const char* const SIGNAL_FOCUS_CHANGED = "focus-changed"; +const char* const SIGNAL_FOCUS_OVERSHOT = "focus-overshot"; +const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated"; + #if defined(DEBUG_ENABLED) Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOCUS_MANAGER"); #endif -const char * const ACTOR_FOCUSABLE("focusable"); -const char * const IS_FOCUS_GROUP("is-focus-group"); +const char* const ACTOR_FOCUSABLE("focusable"); +const char* const IS_FOCUS_GROUP("is-focus-group"); const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png"; const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f); @@ -460,7 +467,7 @@ void FocusManager::DoActivate(Actor actor) if(control) { // Notify the control that it is activated - control.GetImplementation().Activate(); + GetImplementation( control ).Activate(); } // Send notification for the activation of focused actor @@ -668,7 +675,7 @@ void FocusManager::CreateDefaultFocusIndicatorActor() focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f)); // Apply size constraint to the focus indicator - focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + focusIndicator.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); SetFocusIndicatorActor(focusIndicator); } @@ -808,7 +815,7 @@ bool FocusManager::AccessibilityActionUp() if(control) { // Notify the control that it is activated - ret = control.GetImplementation().OnAccessibilityValueChange(true); + ret = GetImplementation( control ).OnAccessibilityValueChange(true); } } } @@ -829,7 +836,7 @@ bool FocusManager::AccessibilityActionDown() if(control) { // Notify the control that it is activated - ret = control.GetImplementation().OnAccessibilityValueChange(false); + ret = GetImplementation( control ).OnAccessibilityValueChange(false); } } } @@ -866,7 +873,7 @@ bool FocusManager::AccessibilityActionTouch(const TouchEvent& touchEvent) Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(GetCurrentFocusActor()); if(control) { - handled = control.GetImplementation().OnAccessibilityTouch(touchEvent); + handled = GetImplementation( control ).OnAccessibilityTouch(touchEvent); } return handled; @@ -926,7 +933,7 @@ bool FocusManager::HandlePanGesture(const Integration::PanGestureEvent& panEvent pan.velocity.x = pan.displacement.x / panEvent.timeDelta; pan.velocity.y = pan.displacement.y / panEvent.timeDelta; - handled = control.GetImplementation().OnAccessibilityPan(pan); + handled = GetImplementation( control ).OnAccessibilityPan(pan); } // If the gesture is not handled by the control, check its parent @@ -969,17 +976,17 @@ bool FocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterfa Dali::BaseHandle handle( object ); bool connected( true ); - FocusManager* manager = dynamic_cast(object); + FocusManager* manager = dynamic_cast( object ); - if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_CHANGED == signalName ) + if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) ) { manager->FocusChangedSignal().Connect( tracker, functor ); } - else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_OVERSHOT == signalName ) + else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) ) { manager->FocusOvershotSignal().Connect( tracker, functor ); } - else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName ) + else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) ) { manager->FocusedActorActivatedSignal().Connect( tracker, functor ); }