2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/public-api/controls/control-impl.h>
22 #include <cstring> // for strcmp
26 #include <dali/public-api/animation/constraint.h>
27 #include <dali/public-api/object/type-registry-helper.h>
28 #include <dali/public-api/size-negotiation/relayout-container.h>
29 #include <dali/devel-api/scripting/scripting.h>
30 #include <dali/integration-api/debug.h>
33 #include <dali-toolkit/public-api/align-enumerations.h>
34 #include <dali-toolkit/public-api/controls/control.h>
35 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
36 #include <dali-toolkit/public-api/styling/style-manager.h>
37 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
38 #include <dali-toolkit/public-api/visuals/visual-properties.h>
39 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
40 #include <dali-toolkit/devel-api/controls/control-devel.h>
41 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
42 #include <dali-toolkit/devel-api/visuals/color-visual-properties-devel.h>
43 #include <dali-toolkit/internal/styling/style-manager-impl.h>
44 #include <dali-toolkit/internal/visuals/color/color-visual.h>
45 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
46 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
60 #if defined(DEBUG_ENABLED)
61 Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS");
65 * @brief Replace the background visual if it's a color visual with the renderIfTransparent property set as required.
66 * @param[in] controlImpl The control implementation
67 * @param[in] renderIfTransaparent Whether we should render if the color is transparent
69 void ChangeBackgroundColorVisual( Control& controlImpl, bool renderIfTransparent )
71 Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl );
73 Toolkit::Visual::Base backgroundVisual = controlDataImpl.GetVisual( Toolkit::Control::Property::BACKGROUND );
74 if( backgroundVisual )
77 backgroundVisual.CreatePropertyMap( map );
78 Property::Value* typeValue = map.Find( Toolkit::Visual::Property::TYPE );
79 if( typeValue && typeValue->Get< int >() == Toolkit::Visual::COLOR )
81 // Only change it if it's a color visual
82 map[ Toolkit::DevelColorVisual::Property::RENDER_IF_TRANSPARENT ] = renderIfTransparent;
83 controlImpl.SetBackground( map );
89 * @brief Creates a clipping renderer if required.
90 * (EG. If no renders exist and clipping is enabled).
91 * @param[in] controlImpl The control implementation.
93 void CreateClippingRenderer( Control& controlImpl )
95 // We want to add a transparent background if we do not have one for clipping.
96 Actor self( controlImpl.Self() );
97 int clippingMode = ClippingMode::DISABLED;
98 if( self.GetProperty( Actor::Property::CLIPPING_MODE ).Get( clippingMode ) )
100 switch( clippingMode )
102 case ClippingMode::CLIP_CHILDREN:
104 if( self.GetRendererCount() == 0u )
106 Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl );
107 if( controlDataImpl.mVisuals.Empty() )
109 controlImpl.SetBackgroundColor( Color::TRANSPARENT );
113 // We have visuals, check if we've set the background and re-create it to
114 // render even if transparent (only if it's a color visual)
115 ChangeBackgroundColorVisual( controlImpl, true );
121 case ClippingMode::DISABLED:
122 case ClippingMode::CLIP_TO_BOUNDING_BOX:
124 // If we have a background visual, check if it's a color visual and remove the render if transparent flag
125 ChangeBackgroundColorVisual( controlImpl, false );
133 * @brief Sets Control::Property::BACKGROUND visual
134 * @param[in] controlImpl The control implementation
135 * @param[in] visual The control background visual
136 * @param[in] size The current size
138 void SetBackgroundVisual( Control::Impl& controlImpl, Toolkit::Visual::Base& visual, const Vector2& size )
140 Property::Map transformMap = Property::Map();
142 Vector2 newSize( 0.f, 0.f );
143 newSize.width = size.width + ( controlImpl.mPadding.start + controlImpl.mPadding.end );
144 newSize.height = size.height + ( controlImpl.mPadding.top + controlImpl.mPadding.bottom );
146 if( ( controlImpl.mMargin.start != 0 ) ||
147 ( controlImpl.mMargin.end != 0 ) ||
148 ( controlImpl.mMargin.top != 0 ) ||
149 ( controlImpl.mMargin.bottom != 0 ) )
151 transformMap.Add( Toolkit::Visual::Transform::Property::SIZE, newSize )
152 .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
153 .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( controlImpl.mMargin.start, controlImpl.mMargin.top ) )
154 .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
155 .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
156 .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
158 else if( ( controlImpl.mPadding.start != 0 ) ||
159 ( controlImpl.mPadding.end != 0 ) ||
160 ( controlImpl.mPadding.top != 0 ) ||
161 ( controlImpl.mPadding.bottom != 0 ) )
163 transformMap.Add( Toolkit::Visual::Transform::Property::SIZE, newSize )
164 .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
165 .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
166 .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
169 visual.SetTransformAndSize( transformMap, newSize ); // Send an empty map as we do not want to modify the visual's set transform
172 } // unnamed namespace
175 Toolkit::Control Control::New()
177 // Create the implementation, temporarily owned on stack
178 IntrusivePtr<Control> controlImpl = new Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) );
180 // Pass ownership to handle
181 Toolkit::Control handle( *controlImpl );
183 // Second-phase init of the implementation
184 // This can only be done after the CustomActor connection has been made...
185 controlImpl->Initialize();
190 void Control::SetStyleName( const std::string& styleName )
192 if( styleName != mImpl->mStyleName )
194 mImpl->mStyleName = styleName;
196 // Apply new style, if stylemanager is available
197 Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
200 GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
205 const std::string& Control::GetStyleName() const
207 return mImpl->mStyleName;
210 void Control::SetBackgroundColor( const Vector4& color )
212 mImpl->mBackgroundColor = color;
214 map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR;
215 map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color;
217 int clippingMode = ClippingMode::DISABLED;
218 if( ( Self().GetProperty( Actor::Property::CLIPPING_MODE ).Get( clippingMode ) ) &&
219 ( clippingMode == ClippingMode::CLIP_CHILDREN ) )
221 // If clipping-mode is set to CLIP_CHILDREN, then force visual to add the render even if transparent
222 map[ Toolkit::DevelColorVisual::Property::RENDER_IF_TRANSPARENT ] = true;
225 SetBackground( map );
228 Vector4 Control::GetBackgroundColor() const
230 return mImpl->mBackgroundColor;
233 void Control::SetBackground( const Property::Map& map )
235 Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
236 visual.SetName("background");
239 mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
241 // Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
246 void Control::SetBackgroundImage( Image image )
248 Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
251 mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
255 void Control::ClearBackground()
257 mImpl->UnregisterVisual( Toolkit::Control::Property::BACKGROUND );
258 mImpl->mBackgroundColor = Color::TRANSPARENT;
260 // Trigger a size negotiation request that may be needed when unregistering a visual.
264 void Control::EnableGestureDetection(Gesture::Type type)
266 if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
268 mImpl->mPinchGestureDetector = PinchGestureDetector::New();
269 mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
270 mImpl->mPinchGestureDetector.Attach(Self());
273 if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
275 mImpl->mPanGestureDetector = PanGestureDetector::New();
276 mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
277 mImpl->mPanGestureDetector.Attach(Self());
280 if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
282 mImpl->mTapGestureDetector = TapGestureDetector::New();
283 mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
284 mImpl->mTapGestureDetector.Attach(Self());
287 if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
289 mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
290 mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
291 mImpl->mLongPressGestureDetector.Attach(Self());
295 void Control::DisableGestureDetection(Gesture::Type type)
297 if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
299 mImpl->mPinchGestureDetector.Detach(Self());
300 mImpl->mPinchGestureDetector.Reset();
303 if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
305 mImpl->mPanGestureDetector.Detach(Self());
306 mImpl->mPanGestureDetector.Reset();
309 if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
311 mImpl->mTapGestureDetector.Detach(Self());
312 mImpl->mTapGestureDetector.Reset();
315 if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
317 mImpl->mLongPressGestureDetector.Detach(Self());
318 mImpl->mLongPressGestureDetector.Reset();
322 PinchGestureDetector Control::GetPinchGestureDetector() const
324 return mImpl->mPinchGestureDetector;
327 PanGestureDetector Control::GetPanGestureDetector() const
329 return mImpl->mPanGestureDetector;
332 TapGestureDetector Control::GetTapGestureDetector() const
334 return mImpl->mTapGestureDetector;
337 LongPressGestureDetector Control::GetLongPressGestureDetector() const
339 return mImpl->mLongPressGestureDetector;
342 void Control::SetKeyboardNavigationSupport(bool isSupported)
344 mImpl->mIsKeyboardNavigationSupported = isSupported;
347 bool Control::IsKeyboardNavigationSupported()
349 return mImpl->mIsKeyboardNavigationSupported;
352 void Control::SetKeyInputFocus()
354 if( Self().OnStage() )
356 Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
360 bool Control::HasKeyInputFocus()
363 if( Self().OnStage() )
365 Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
366 if( Self() == control )
374 void Control::ClearKeyInputFocus()
376 if( Self().OnStage() )
378 Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
382 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
384 mImpl->mIsKeyboardFocusGroup = isFocusGroup;
386 // The following line will be removed when the deprecated API in KeyboardFocusManager is deleted
387 Toolkit::KeyboardFocusManager::Get().SetAsFocusGroup(Self(), isFocusGroup);
390 bool Control::IsKeyboardFocusGroup()
392 return Toolkit::KeyboardFocusManager::Get().IsFocusGroup(Self());
395 void Control::AccessibilityActivate()
397 // Inform deriving classes
398 OnAccessibilityActivated();
401 void Control::KeyboardEnter()
403 // Inform deriving classes
407 bool Control::OnAccessibilityActivated()
409 return false; // Accessibility activation is not handled by default
412 bool Control::OnKeyboardEnter()
414 return false; // Keyboard enter is not handled by default
417 bool Control::OnAccessibilityPan(PanGesture gesture)
419 return false; // Accessibility pan gesture is not handled by default
422 bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
424 return false; // Accessibility touch event is not handled by default
427 bool Control::OnAccessibilityValueChange(bool isIncrease)
429 return false; // Accessibility value change action is not handled by default
432 bool Control::OnAccessibilityZoom()
434 return false; // Accessibility zoom action is not handled by default
437 Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
442 void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
446 Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
448 return mImpl->mKeyEventSignal;
451 Toolkit::Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
453 return mImpl->mKeyInputFocusGainedSignal;
456 Toolkit::Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
458 return mImpl->mKeyInputFocusLostSignal;
461 bool Control::EmitKeyEventSignal( const KeyEvent& event )
463 // Guard against destruction during signal emission
464 Dali::Toolkit::Control handle( GetOwner() );
466 bool consumed = false;
468 // signals are allocated dynamically when someone connects
469 if ( !mImpl->mKeyEventSignal.Empty() )
471 consumed = mImpl->mKeyEventSignal.Emit( handle, event );
476 // Notification for derived classes
477 consumed = OnKeyEvent(event);
483 Control::Control( ControlBehaviour behaviourFlags )
484 : CustomActorImpl( static_cast< ActorFlags >( behaviourFlags ) ),
485 mImpl(new Impl(*this))
487 mImpl->mFlags = behaviourFlags;
495 void Control::Initialize()
497 // Call deriving classes so initialised before styling is applied to them.
500 if( (mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS) ||
501 !(mImpl->mFlags & DISABLE_STYLE_CHANGE_SIGNALS) )
503 Toolkit::StyleManager styleManager = StyleManager::Get();
505 // if stylemanager is available
508 StyleManager& styleManagerImpl = GetImpl( styleManager );
510 // Register for style changes
511 styleManagerImpl.ControlStyleChangeSignal().Connect( this, &Control::OnStyleChange );
513 // Apply the current style
514 styleManagerImpl.ApplyThemeStyleAtInit( Toolkit::Control( GetOwner() ) );
518 if( mImpl->mFlags & REQUIRES_KEYBOARD_NAVIGATION_SUPPORT )
520 SetKeyboardNavigationSupport( true );
524 void Control::OnInitialize()
528 void Control::OnControlChildAdd( Actor& child )
532 void Control::OnControlChildRemove( Actor& child )
536 void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
538 // By default the control is only interested in theme (not font) changes
539 if( styleManager && change == StyleChange::THEME_CHANGE )
541 GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
546 void Control::OnPinch(const PinchGesture& pinch)
548 if( !( mImpl->mStartingPinchScale ) )
551 mImpl->mStartingPinchScale = new Vector3;
554 if( pinch.state == Gesture::Started )
556 *( mImpl->mStartingPinchScale ) = Self().GetCurrentScale();
559 Self().SetScale( *( mImpl->mStartingPinchScale ) * pinch.scale );
562 void Control::OnPan( const PanGesture& pan )
566 void Control::OnTap(const TapGesture& tap)
570 void Control::OnLongPress( const LongPressGesture& longPress )
574 void Control::EmitKeyInputFocusSignal( bool focusGained )
576 Dali::Toolkit::Control handle( GetOwner() );
580 // signals are allocated dynamically when someone connects
581 if ( !mImpl->mKeyInputFocusGainedSignal.Empty() )
583 mImpl->mKeyInputFocusGainedSignal.Emit( handle );
588 // signals are allocated dynamically when someone connects
589 if ( !mImpl->mKeyInputFocusLostSignal.Empty() )
591 mImpl->mKeyInputFocusLostSignal.Emit( handle );
596 void Control::OnStageConnection( int depth )
598 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::OnStageConnection number of registered visuals(%d)\n", mImpl->mVisuals.Size() );
600 Actor self( Self() );
602 for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter!= mImpl->mVisuals.End(); iter++)
604 // Check whether the visual is empty and enabled
605 if( (*iter)->visual && (*iter)->enabled )
607 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::OnStageConnection Setting visual(%d) on stage\n", (*iter)->index );
608 Toolkit::GetImplementation((*iter)->visual).SetOnStage( self );
612 // The clipping renderer is only created if required.
613 CreateClippingRenderer( *this );
616 void Control::OnStageDisconnection()
618 mImpl->OnStageDisconnection();
621 void Control::OnKeyInputFocusGained()
623 EmitKeyInputFocusSignal( true );
626 void Control::OnKeyInputFocusLost()
628 EmitKeyInputFocusSignal( false );
631 void Control::OnChildAdd(Actor& child)
633 // Notify derived classes.
634 OnControlChildAdd( child );
637 void Control::OnChildRemove(Actor& child)
639 // Notify derived classes.
640 OnControlChildRemove( child );
643 void Control::OnPropertySet( Property::Index index, Property::Value propertyValue )
645 // If the clipping mode has been set, we may need to create a renderer.
646 // Only do this if we are already on-stage as the OnStageConnection will handle the off-stage clipping controls.
647 if( ( index == Actor::Property::CLIPPING_MODE ) && Self().OnStage() )
649 // Note: This method will handle whether creation of the renderer is required.
650 CreateClippingRenderer( *this );
654 void Control::OnSizeSet(const Vector3& targetSize)
656 Toolkit::Visual::Base visual = mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
659 Vector2 size( targetSize );
660 SetBackgroundVisual( *mImpl, visual, size );
665 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
667 // @todo size negotiate background to new size, animate as well?
670 bool Control::OnTouchEvent(const TouchEvent& event)
672 return false; // Do not consume
675 bool Control::OnHoverEvent(const HoverEvent& event)
677 return false; // Do not consume
680 bool Control::OnKeyEvent(const KeyEvent& event)
682 return false; // Do not consume
685 bool Control::OnWheelEvent(const WheelEvent& event)
687 return false; // Do not consume
690 void Control::OnRelayout( const Vector2& size, RelayoutContainer& container )
692 for( unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i )
694 Actor child = Self().GetChildAt( i );
695 Vector2 newChildSize( size );
697 // When set the padding or margin on the control, child should be resized and repositioned.
698 if( ( mImpl->mPadding.start != 0 ) || ( mImpl->mPadding.end != 0 ) || ( mImpl->mPadding.top != 0 ) || ( mImpl->mPadding.bottom != 0 ) ||
699 ( mImpl->mMargin.start != 0 ) || ( mImpl->mMargin.end != 0 ) || ( mImpl->mMargin.top != 0 ) || ( mImpl->mMargin.bottom != 0 ) )
701 Extents padding = mImpl->mPadding;
703 Dali::CustomActor ownerActor(GetOwner());
704 Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( ownerActor.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
706 if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
708 std::swap( padding.start, padding.end );
711 newChildSize.width = size.width - ( padding.start + padding.end );
712 newChildSize.height = size.height - ( padding.top + padding.bottom );
714 // Cannot use childs Position property as it can already have padding and margin applied on it,
715 // so we end up cumulatively applying them over and over again.
716 Vector2 childOffset( 0.f, 0.f );
717 childOffset.x += ( mImpl->mMargin.start + padding.start );
718 childOffset.y += ( mImpl->mMargin.top + padding.top );
720 child.SetPosition( childOffset.x, childOffset.y );
723 container.Add( child, newChildSize );
726 Toolkit::Visual::Base visual = mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
729 SetBackgroundVisual( *mImpl, visual, size );
733 void Control::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
737 Vector3 Control::GetNaturalSize()
739 Toolkit::Visual::Base visual = mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
743 visual.GetNaturalSize( naturalSize );
744 naturalSize.width += ( mImpl->mPadding.start + mImpl->mPadding.end );
745 naturalSize.height += ( mImpl->mPadding.top + mImpl->mPadding.bottom );
746 return Vector3( naturalSize );
748 return Vector3::ZERO;
751 float Control::CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
753 return CalculateChildSizeBase( child, dimension );
756 float Control::GetHeightForWidth( float width )
758 return GetHeightForWidthBase( width );
761 float Control::GetWidthForHeight( float height )
763 return GetWidthForHeightBase( height );
766 bool Control::RelayoutDependentOnChildren( Dimension::Type dimension )
768 return RelayoutDependentOnChildrenBase( dimension );
771 void Control::OnCalculateRelayoutSize( Dimension::Type dimension )
775 void Control::OnLayoutNegotiated( float size, Dimension::Type dimension )
779 void Control::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
781 mImpl->SignalConnected( slotObserver, callback );
784 void Control::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
786 mImpl->SignalDisconnected( slotObserver, callback );
789 Control& GetImplementation( Dali::Toolkit::Control& handle )
791 CustomActorImpl& customInterface = handle.GetImplementation();
792 // downcast to control
793 Control& impl = dynamic_cast< Internal::Control& >( customInterface );
797 const Control& GetImplementation( const Dali::Toolkit::Control& handle )
799 const CustomActorImpl& customInterface = handle.GetImplementation();
800 // downcast to control
801 const Control& impl = dynamic_cast< const Internal::Control& >( customInterface );
805 } // namespace Internal
807 } // namespace Toolkit