2 * Copyright (c) 2019 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 "control-data-impl.h"
22 #include <dali-toolkit/public-api/dali-toolkit-common.h>
23 #include <dali/integration-api/debug.h>
24 #include <dali/devel-api/object/handle-devel.h>
25 #include <dali/devel-api/scripting/enum-helper.h>
26 #include <dali/devel-api/scripting/scripting.h>
27 #include <dali/integration-api/debug.h>
28 #include <dali/public-api/object/type-registry-helper.h>
33 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
34 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
35 #include <dali-toolkit/public-api/visuals/visual-properties.h>
36 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
37 #include <dali-toolkit/devel-api/controls/control-devel.h>
38 #include <dali-toolkit/devel-api/controls/control-wrapper-impl.h>
39 #include <dali-toolkit/internal/styling/style-manager-impl.h>
40 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
51 extern const Dali::Scripting::StringEnum ControlStateTable[];
52 extern const unsigned int ControlStateTableCount;
55 // Not static or anonymous - shared with other translation units
56 const Scripting::StringEnum ControlStateTable[] = {
57 { "NORMAL", Toolkit::DevelControl::NORMAL },
58 { "FOCUSED", Toolkit::DevelControl::FOCUSED },
59 { "DISABLED", Toolkit::DevelControl::DISABLED },
61 const unsigned int ControlStateTableCount = sizeof( ControlStateTable ) / sizeof( ControlStateTable[0] );
68 #if defined(DEBUG_ENABLED)
69 Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS");
74 void Remove( Dictionary<T>& keyValues, const std::string& name )
76 keyValues.Remove(name);
79 void Remove( DictionaryKeys& keys, const std::string& name )
81 DictionaryKeys::iterator iter = std::find( keys.begin(), keys.end(), name );
82 if( iter != keys.end())
88 Toolkit::Visual::Type GetVisualTypeFromMap( const Property::Map& map )
90 Property::Value* typeValue = map.Find( Toolkit::Visual::Property::TYPE, VISUAL_TYPE );
91 Toolkit::Visual::Type type = Toolkit::Visual::IMAGE;
94 Scripting::GetEnumerationProperty( *typeValue, VISUAL_TYPE_TABLE, VISUAL_TYPE_TABLE_COUNT, type );
100 * Finds visual in given array, returning true if found along with the iterator for that visual as a out parameter
102 bool FindVisual( Property::Index targetIndex, const RegisteredVisualContainer& visuals, RegisteredVisualContainer::Iterator& iter )
104 for ( iter = visuals.Begin(); iter != visuals.End(); iter++ )
106 if ( (*iter)->index == targetIndex )
114 void FindChangableVisuals( Dictionary<Property::Map>& stateVisualsToAdd,
115 Dictionary<Property::Map>& stateVisualsToChange,
116 DictionaryKeys& stateVisualsToRemove)
118 DictionaryKeys copyOfStateVisualsToRemove = stateVisualsToRemove;
120 for( DictionaryKeys::iterator iter = copyOfStateVisualsToRemove.begin();
121 iter != copyOfStateVisualsToRemove.end(); ++iter )
123 const std::string& visualName = (*iter);
124 Property::Map* toMap = stateVisualsToAdd.Find( visualName );
127 stateVisualsToChange.Add( visualName, *toMap );
128 stateVisualsToAdd.Remove( visualName );
129 Remove( stateVisualsToRemove, visualName );
134 Toolkit::Visual::Base GetVisualByName(
135 const RegisteredVisualContainer& visuals,
136 const std::string& visualName )
138 Toolkit::Visual::Base visualHandle;
140 RegisteredVisualContainer::Iterator iter;
141 for ( iter = visuals.Begin(); iter != visuals.End(); iter++ )
143 Toolkit::Visual::Base visual = (*iter)->visual;
144 if( visual && visual.GetName() == visualName )
146 visualHandle = visual;
154 * Move visual from source to destination container
156 void MoveVisual( RegisteredVisualContainer::Iterator sourceIter, RegisteredVisualContainer& source, RegisteredVisualContainer& destination )
158 Toolkit::Visual::Base visual = (*sourceIter)->visual;
161 RegisteredVisual* rv = source.Release( sourceIter );
162 destination.PushBack( rv );
167 * Performs actions as requested using the action name.
168 * @param[in] object The object on which to perform the action.
169 * @param[in] actionName The action to perform.
170 * @param[in] attributes The attributes with which to perfrom this action.
171 * @return true if action has been accepted by this control
173 const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibilityActivated";
174 static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
178 if( object && ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_ACTIVATED ) ) )
180 Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
183 // if cast succeeds there is an implementation so no need to check
184 ret = Internal::GetImplementation( control ).OnAccessibilityActivated();
192 * Connects a callback function with the object's signals.
193 * @param[in] object The object providing the signal.
194 * @param[in] tracker Used to disconnect the signal.
195 * @param[in] signalName The signal to connect to.
196 * @param[in] functor A newly allocated FunctorDelegate.
197 * @return True if the signal was connected.
198 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
200 const char* SIGNAL_KEY_EVENT = "keyEvent";
201 const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "keyInputFocusGained";
202 const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "keyInputFocusLost";
203 const char* SIGNAL_TAPPED = "tapped";
204 const char* SIGNAL_PANNED = "panned";
205 const char* SIGNAL_PINCHED = "pinched";
206 const char* SIGNAL_LONG_PRESSED = "longPressed";
207 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
209 Dali::BaseHandle handle( object );
211 bool connected( false );
212 Toolkit::Control control = Toolkit::Control::DownCast( handle );
215 Internal::Control& controlImpl( Internal::GetImplementation( control ) );
218 if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
220 controlImpl.KeyEventSignal().Connect( tracker, functor );
222 else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
224 controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
226 else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
228 controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
230 else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
232 controlImpl.EnableGestureDetection( Gesture::Tap );
233 controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
235 else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
237 controlImpl.EnableGestureDetection( Gesture::Pan );
238 controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
240 else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
242 controlImpl.EnableGestureDetection( Gesture::Pinch );
243 controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
245 else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
247 controlImpl.EnableGestureDetection( Gesture::LongPress );
248 controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
255 * Creates control through type registry
259 return Internal::Control::New();
261 // Setup signals and actions using the type-registry.
262 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
264 // Note: Properties are registered separately below.
266 SignalConnectorType registerSignal1( typeRegistration, SIGNAL_KEY_EVENT, &DoConnectSignal );
267 SignalConnectorType registerSignal2( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_GAINED, &DoConnectSignal );
268 SignalConnectorType registerSignal3( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_LOST, &DoConnectSignal );
269 SignalConnectorType registerSignal4( typeRegistration, SIGNAL_TAPPED, &DoConnectSignal );
270 SignalConnectorType registerSignal5( typeRegistration, SIGNAL_PANNED, &DoConnectSignal );
271 SignalConnectorType registerSignal6( typeRegistration, SIGNAL_PINCHED, &DoConnectSignal );
272 SignalConnectorType registerSignal7( typeRegistration, SIGNAL_LONG_PRESSED, &DoConnectSignal );
274 TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &DoAction );
276 DALI_TYPE_REGISTRATION_END()
279 * @brief Iterate through given container and setOffStage any visual found
281 * @param[in] container Container of visuals
282 * @param[in] parent Parent actor to remove visuals from
284 void SetVisualsOffStage( const RegisteredVisualContainer& container, Actor parent )
286 for( auto iter = container.Begin(), end = container.End() ; iter!= end; iter++)
288 if( (*iter)->visual )
290 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::SetOffStage Setting visual(%d) off stage\n", (*iter)->index );
291 Toolkit::GetImplementation((*iter)->visual).SetOffStage( parent );
296 } // unnamed namespace
299 // Properties registered without macro to use specific member variables.
300 const PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName", Toolkit::Control::Property::STYLE_NAME, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
301 const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "backgroundColor", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
302 const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgroundImage", Toolkit::Control::Property::BACKGROUND_IMAGE, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
303 const PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "keyInputFocus", Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
304 const PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "background", Toolkit::Control::Property::BACKGROUND, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
305 const PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "margin", Toolkit::Control::Property::MARGIN, Property::EXTENTS, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
306 const PropertyRegistration Control::Impl::PROPERTY_7( typeRegistration, "padding", Toolkit::Control::Property::PADDING, Property::EXTENTS, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
307 const PropertyRegistration Control::Impl::PROPERTY_8( typeRegistration, "tooltip", Toolkit::DevelControl::Property::TOOLTIP, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
308 const PropertyRegistration Control::Impl::PROPERTY_9( typeRegistration, "state", Toolkit::DevelControl::Property::STATE, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
309 const PropertyRegistration Control::Impl::PROPERTY_10( typeRegistration, "subState", Toolkit::DevelControl::Property::SUB_STATE, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
310 const PropertyRegistration Control::Impl::PROPERTY_11( typeRegistration, "leftFocusableActorId", Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
311 const PropertyRegistration Control::Impl::PROPERTY_12( typeRegistration, "rightFocusableActorId", Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID,Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
312 const PropertyRegistration Control::Impl::PROPERTY_13( typeRegistration, "upFocusableActorId", Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
313 const PropertyRegistration Control::Impl::PROPERTY_14( typeRegistration, "downFocusableActorId", Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
316 Control::Impl::Impl( Control& controlImpl )
317 : mControlImpl( controlImpl ),
318 mState( Toolkit::DevelControl::NORMAL ),
320 mLeftFocusableActorId( -1 ),
321 mRightFocusableActorId( -1 ),
322 mUpFocusableActorId( -1 ),
323 mDownFocusableActorId( -1 ),
325 mBackgroundColor(Color::TRANSPARENT),
326 mStartingPinchScale( NULL ),
327 mMargin( 0, 0, 0, 0 ),
328 mPadding( 0, 0, 0, 0 ),
330 mKeyInputFocusGainedSignal(),
331 mKeyInputFocusLostSignal(),
332 mResourceReadySignal(),
333 mVisualEventSignal(),
334 mPinchGestureDetector(),
335 mPanGestureDetector(),
336 mTapGestureDetector(),
337 mLongPressGestureDetector(),
339 mInputMethodContext(),
340 mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
341 mIsKeyboardNavigationSupported( false ),
342 mIsKeyboardFocusGroup( false )
346 Control::Impl::~Impl()
348 // All gesture detectors will be destroyed so no need to disconnect.
349 delete mStartingPinchScale;
352 Control::Impl& Control::Impl::Get( Internal::Control& internalControl )
354 return *internalControl.mImpl;
357 const Control::Impl& Control::Impl::Get( const Internal::Control& internalControl )
359 return *internalControl.mImpl;
362 // Gesture Detection Methods
363 void Control::Impl::PinchDetected(Actor actor, const PinchGesture& pinch)
365 mControlImpl.OnPinch(pinch);
368 void Control::Impl::PanDetected(Actor actor, const PanGesture& pan)
370 mControlImpl.OnPan(pan);
373 void Control::Impl::TapDetected(Actor actor, const TapGesture& tap)
375 mControlImpl.OnTap(tap);
378 void Control::Impl::LongPressDetected(Actor actor, const LongPressGesture& longPress)
380 mControlImpl.OnLongPress(longPress);
383 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual )
385 RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
388 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
390 RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
393 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
395 RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::NOT_SET );
398 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
400 RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::SET, depthIndex );
403 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
405 DALI_LOG_INFO( gLogFilter, Debug::Concise, "RegisterVisual:%d \n", index );
407 bool visualReplaced ( false );
408 Actor self = mControlImpl.Self();
410 // Set the depth index, if not set by caller this will be either the current visual depth, max depth of all visuals
412 int requiredDepthIndex = visual.GetDepthIndex();
414 if( depthIndexValueSet == DepthIndexValue::SET )
416 requiredDepthIndex = depthIndex;
419 // Visual replacement, existing visual should only be removed from stage when replacement ready.
420 if( !mVisuals.Empty() )
422 RegisteredVisualContainer::Iterator registeredVisualsiter;
423 // Check if visual (index) is already registered, this is the current visual.
424 if( FindVisual( index, mVisuals, registeredVisualsiter ) )
426 Toolkit::Visual::Base& currentRegisteredVisual = (*registeredVisualsiter)->visual;
427 if( currentRegisteredVisual )
429 // Store current visual depth index as may need to set the replacement visual to same depth
430 const int currentDepthIndex = (*registeredVisualsiter)->visual.GetDepthIndex();
432 // No longer required to know if the replaced visual's resources are ready
433 StopObservingVisual( currentRegisteredVisual );
435 // If control staged and visual enabled then visuals will be swapped once ready
436 if( self.OnStage() && enabled )
438 // Check if visual is currently in the process of being replaced ( is in removal container )
439 RegisteredVisualContainer::Iterator visualQueuedForRemoval;
440 if ( FindVisual( index, mRemoveVisuals, visualQueuedForRemoval ) )
442 // Visual with same index is already in removal container so current visual pending
443 // Only the the last requested visual will be displayed so remove current visual which is staged but not ready.
444 Toolkit::GetImplementation( currentRegisteredVisual ).SetOffStage( self );
445 mVisuals.Erase( registeredVisualsiter );
449 // current visual not already in removal container so add now.
450 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RegisterVisual Move current registered visual to removal Queue: %d \n", index );
451 MoveVisual( registeredVisualsiter, mVisuals, mRemoveVisuals );
456 // Control not staged or visual disabled so can just erase from registered visuals and new visual will be added later.
457 mVisuals.Erase( registeredVisualsiter );
460 // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
461 if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
462 ( visual.GetDepthIndex() == 0 ) )
464 requiredDepthIndex = currentDepthIndex;
468 visualReplaced = true;
472 // If not set, set the name of the visual to the same name as the control's property.
473 // ( If the control has been type registered )
474 if( visual.GetName().empty() )
476 // returns empty string if index is not found as long as index is not -1
477 std::string visualName = self.GetPropertyName( index );
478 if( !visualName.empty() )
480 DALI_LOG_INFO( gLogFilter, Debug::Concise, "Setting visual name for property %d to %s\n",
481 index, visualName.c_str() );
482 visual.SetName( visualName );
486 if( !visualReplaced ) // New registration entry
488 // If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
489 if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
490 ( mVisuals.Size() > 0 ) &&
491 ( visual.GetDepthIndex() == 0 ) )
493 int maxDepthIndex = std::numeric_limits< int >::min();
495 RegisteredVisualContainer::ConstIterator iter;
496 const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
497 for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
499 const int visualDepthIndex = (*iter)->visual.GetDepthIndex();
500 if ( visualDepthIndex > maxDepthIndex )
502 maxDepthIndex = visualDepthIndex;
505 ++maxDepthIndex; // Add one to the current maximum depth index so that our added visual appears on top
506 requiredDepthIndex = std::max( 0, maxDepthIndex ); // Start at zero if maxDepth index belongs to a background
512 // Set determined depth index
513 visual.SetDepthIndex( requiredDepthIndex );
515 // Monitor when the visual resources are ready
516 StartObservingVisual( visual );
518 DALI_LOG_INFO( gLogFilter, Debug::Concise, "New Visual registration index[%d] depth[%d]\n", index, requiredDepthIndex );
519 RegisteredVisual* newRegisteredVisual = new RegisteredVisual( index, visual,
520 ( enabled == VisualState::ENABLED ? true : false ),
521 ( visualReplaced && enabled ) ) ;
522 mVisuals.PushBack( newRegisteredVisual );
524 Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
525 // Put on stage if enabled and the control is already on the stage
526 if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
528 visualImpl.SetOnStage( self );
530 else if( visualImpl.IsResourceReady() ) // When not being staged, check if visual already 'ResourceReady' before it was Registered. ( Resource may have been loaded already )
532 ResourceReady( visualImpl );
537 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n", visual.GetName().c_str(), index, enabled?"true":"false" );
540 void Control::Impl::UnregisterVisual( Property::Index index )
542 RegisteredVisualContainer::Iterator iter;
543 if ( FindVisual( index, mVisuals, iter ) )
545 // stop observing visual
546 StopObservingVisual( (*iter)->visual );
548 Actor self( mControlImpl.Self() );
549 Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
550 (*iter)->visual.Reset();
551 mVisuals.Erase( iter );
554 if( FindVisual( index, mRemoveVisuals, iter ) )
556 Actor self( mControlImpl.Self() );
557 Toolkit::GetImplementation( (*iter)->visual ).SetOffStage( self );
558 (*iter)->pending = false;
559 (*iter)->visual.Reset();
560 mRemoveVisuals.Erase( iter );
564 Toolkit::Visual::Base Control::Impl::GetVisual( Property::Index index ) const
566 RegisteredVisualContainer::Iterator iter;
567 if ( FindVisual( index, mVisuals, iter ) )
569 return (*iter)->visual;
572 return Toolkit::Visual::Base();
575 void Control::Impl::EnableVisual( Property::Index index, bool enable )
577 DALI_LOG_INFO( gLogFilter, Debug::General, "Control::EnableVisual(%d, %s)\n", index, enable?"T":"F");
579 RegisteredVisualContainer::Iterator iter;
580 if ( FindVisual( index, mVisuals, iter ) )
582 if ( (*iter)->enabled == enable )
584 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Visual %s(%d) already %s\n", (*iter)->visual.GetName().c_str(), index, enable?"enabled":"disabled");
588 (*iter)->enabled = enable;
589 Actor parentActor = mControlImpl.Self();
590 if ( mControlImpl.Self().OnStage() ) // If control not on Stage then Visual will be added when StageConnection is called.
594 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting %s(%d) on stage \n", (*iter)->visual.GetName().c_str(), index );
595 Toolkit::GetImplementation((*iter)->visual).SetOnStage( parentActor );
599 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::EnableVisual Setting %s(%d) off stage \n", (*iter)->visual.GetName().c_str(), index );
600 Toolkit::GetImplementation((*iter)->visual).SetOffStage( parentActor ); // No need to call if control not staged.
606 DALI_LOG_WARNING( "Control::EnableVisual(%d, %s) FAILED - NO SUCH VISUAL\n", index, enable?"T":"F" );
610 bool Control::Impl::IsVisualEnabled( Property::Index index ) const
612 RegisteredVisualContainer::Iterator iter;
613 if ( FindVisual( index, mVisuals, iter ) )
615 return (*iter)->enabled;
620 void Control::Impl::StopObservingVisual( Toolkit::Visual::Base& visual )
622 Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
624 // Stop observing the visual
625 visualImpl.RemoveEventObserver( *this );
628 void Control::Impl::StartObservingVisual( Toolkit::Visual::Base& visual)
630 Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
632 // start observing the visual for events
633 visualImpl.AddEventObserver( *this );
636 // Called by a Visual when it's resource is ready
637 void Control::Impl::ResourceReady( Visual::Base& object)
639 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::Impl::ResourceReady() replacements pending[%d]\n", mRemoveVisuals.Count() );
641 Actor self = mControlImpl.Self();
643 // A resource is ready, find resource in the registered visuals container and get its index
644 for( auto registeredIter = mVisuals.Begin(), end = mVisuals.End(); registeredIter != end; ++registeredIter )
646 Internal::Visual::Base& registeredVisualImpl = Toolkit::GetImplementation( (*registeredIter)->visual );
648 if( &object == ®isteredVisualImpl )
650 RegisteredVisualContainer::Iterator visualToRemoveIter;
651 // Find visual with the same index in the removal container
652 // Set if off stage as it's replacement is now ready.
653 // Remove if from removal list as now removed from stage.
654 // Set Pending flag on the ready visual to false as now ready.
655 if( FindVisual( (*registeredIter)->index, mRemoveVisuals, visualToRemoveIter ) )
657 (*registeredIter)->pending = false;
658 Toolkit::GetImplementation( (*visualToRemoveIter)->visual ).SetOffStage( self );
659 mRemoveVisuals.Erase( visualToRemoveIter );
665 // A visual is ready so control may need relayouting if staged
666 if ( self.OnStage() )
668 mControlImpl.RelayoutRequest();
671 // Emit signal if all enabled visuals registered by the control are ready.
672 if( IsResourceReady() )
674 Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
675 mResourceReadySignal.Emit( handle );
679 void Control::Impl::NotifyVisualEvent( Visual::Base& object, Property::Index signalId )
681 for( auto registeredIter = mVisuals.Begin(), end = mVisuals.End(); registeredIter != end; ++registeredIter )
683 Internal::Visual::Base& registeredVisualImpl = Toolkit::GetImplementation( (*registeredIter)->visual );
684 if( &object == ®isteredVisualImpl )
686 Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
687 mVisualEventSignal.Emit( handle, (*registeredIter)->index, signalId );
693 bool Control::Impl::IsResourceReady() const
695 // Iterate through and check all the enabled visuals are ready
696 for( auto visualIter = mVisuals.Begin();
697 visualIter != mVisuals.End(); ++visualIter )
699 const Toolkit::Visual::Base visual = (*visualIter)->visual;
700 const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
702 // one of the enabled visuals is not ready
703 if( !visualImpl.IsResourceReady() && (*visualIter)->enabled )
711 Toolkit::Visual::ResourceStatus Control::Impl::GetVisualResourceStatus( Property::Index index ) const
713 RegisteredVisualContainer::Iterator iter;
714 if ( FindVisual( index, mVisuals, iter ) )
716 const Toolkit::Visual::Base visual = (*iter)->visual;
717 const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
718 return visualImpl.GetResourceStatus( );
721 return Toolkit::Visual::ResourceStatus::PREPARING;
726 void Control::Impl::AddTransitions( Dali::Animation& animation,
727 const Toolkit::TransitionData& handle,
728 bool createAnimation )
730 // Setup a Transition from TransitionData.
731 const Internal::TransitionData& transitionData = Toolkit::GetImplementation( handle );
732 TransitionData::Iterator end = transitionData.End();
733 for( TransitionData::Iterator iter = transitionData.Begin() ;
734 iter != end; ++iter )
736 TransitionData::Animator* animator = (*iter);
738 Toolkit::Visual::Base visual = GetVisualByName( mVisuals, animator->objectName );
742 #if defined(DEBUG_ENABLED)
743 Dali::TypeInfo typeInfo;
744 ControlWrapper* controlWrapperImpl = dynamic_cast<ControlWrapper*>(&mControlImpl);
745 if( controlWrapperImpl )
747 typeInfo = controlWrapperImpl->GetTypeInfo();
750 DALI_LOG_INFO( gLogFilter, Debug::Concise, "CreateTransition: Found %s visual for %s\n",
751 visual.GetName().c_str(), typeInfo?typeInfo.GetName().c_str():"Unknown" );
753 Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
754 visualImpl.AnimateProperty( animation, *animator );
758 DALI_LOG_INFO( gLogFilter, Debug::Concise, "CreateTransition: Could not find visual. Trying actors");
759 // Otherwise, try any actor children of control (Including the control)
760 Actor child = mControlImpl.Self().FindChildByName( animator->objectName );
763 Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey );
764 if( propertyIndex != Property::INVALID_INDEX )
766 if( animator->animate == false )
768 if( animator->targetValue.GetType() != Property::NONE )
770 child.SetProperty( propertyIndex, animator->targetValue );
773 else // animate the property
775 if( animator->initialValue.GetType() != Property::NONE )
777 child.SetProperty( propertyIndex, animator->initialValue );
780 if( createAnimation && !animation )
782 animation = Dali::Animation::New( 0.1f );
785 animation.AnimateTo( Property( child, propertyIndex ),
786 animator->targetValue,
787 animator->alphaFunction,
788 TimePeriod( animator->timePeriodDelay,
789 animator->timePeriodDuration ) );
797 Dali::Animation Control::Impl::CreateTransition( const Toolkit::TransitionData& transitionData )
799 Dali::Animation transition;
801 if( transitionData.Count() > 0 )
803 AddTransitions( transition, transitionData, true );
810 void Control::Impl::DoAction( Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes )
812 RegisteredVisualContainer::Iterator iter;
813 if ( FindVisual( visualIndex, mVisuals, iter ) )
815 Toolkit::GetImplementation((*iter)->visual).DoAction( actionId, attributes );
819 void Control::Impl::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
821 Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
825 Control& controlImpl( GetImplementation( control ) );
829 case Toolkit::Control::Property::STYLE_NAME:
831 controlImpl.SetStyleName( value.Get< std::string >() );
835 case Toolkit::DevelControl::Property::STATE:
837 bool withTransitions=true;
838 const Property::Value* valuePtr=&value;
839 Property::Map* map = value.GetMap();
842 Property::Value* value2 = map->Find("withTransitions");
845 withTransitions = value2->Get<bool>();
848 valuePtr = map->Find("state");
853 Toolkit::DevelControl::State state( controlImpl.mImpl->mState );
854 if( Scripting::GetEnumerationProperty< Toolkit::DevelControl::State >( *valuePtr, ControlStateTable, ControlStateTableCount, state ) )
856 controlImpl.mImpl->SetState( state, withTransitions );
862 case Toolkit::DevelControl::Property::SUB_STATE:
864 std::string subState;
865 if( value.Get( subState ) )
867 controlImpl.mImpl->SetSubState( subState );
872 case Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID:
875 if( value.Get( focusId ) )
877 controlImpl.mImpl->mLeftFocusableActorId = focusId;
882 case Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID:
885 if( value.Get( focusId ) )
887 controlImpl.mImpl->mRightFocusableActorId = focusId;
892 case Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID:
895 if( value.Get( focusId ) )
897 controlImpl.mImpl->mUpFocusableActorId = focusId;
902 case Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID:
905 if( value.Get( focusId ) )
907 controlImpl.mImpl->mDownFocusableActorId = focusId;
912 case Toolkit::Control::Property::BACKGROUND_COLOR:
914 DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
915 controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
919 case Toolkit::Control::Property::BACKGROUND_IMAGE:
921 DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
922 Image image = Scripting::NewImage( value );
925 controlImpl.SetBackgroundImage( image );
929 // An empty image means the background is no longer required
930 controlImpl.ClearBackground();
935 case Toolkit::Control::Property::KEY_INPUT_FOCUS:
937 if ( value.Get< bool >() )
939 controlImpl.SetKeyInputFocus();
943 controlImpl.ClearKeyInputFocus();
948 case Toolkit::Control::Property::BACKGROUND:
952 const Property::Map* map = value.GetMap();
953 if( map && !map->Empty() )
955 controlImpl.SetBackground( *map );
957 else if( value.Get( url ) )
959 // don't know the size to load
960 Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
963 controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
966 else if( value.Get( color ) )
968 controlImpl.SetBackgroundColor(color);
972 // The background is an empty property map, so we should clear the background
973 controlImpl.ClearBackground();
978 case Toolkit::Control::Property::MARGIN:
981 if( value.Get( margin ) )
983 controlImpl.mImpl->SetMargin( margin );
988 case Toolkit::Control::Property::PADDING:
991 if( value.Get( padding ) )
993 controlImpl.mImpl->SetPadding( padding );
998 case Toolkit::DevelControl::Property::TOOLTIP:
1000 TooltipPtr& tooltipPtr = controlImpl.mImpl->mTooltip;
1003 tooltipPtr = Tooltip::New( control );
1005 tooltipPtr->SetProperties( value );
1013 Property::Value Control::Impl::GetProperty( BaseObject* object, Property::Index index )
1015 Property::Value value;
1017 Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
1021 Control& controlImpl( GetImplementation( control ) );
1025 case Toolkit::Control::Property::STYLE_NAME:
1027 value = controlImpl.GetStyleName();
1031 case Toolkit::DevelControl::Property::STATE:
1033 value = controlImpl.mImpl->mState;
1037 case Toolkit::DevelControl::Property::SUB_STATE:
1039 value = controlImpl.mImpl->mSubStateName;
1043 case Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID:
1045 value = controlImpl.mImpl->mLeftFocusableActorId;
1049 case Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID:
1051 value = controlImpl.mImpl->mRightFocusableActorId;
1055 case Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID:
1057 value = controlImpl.mImpl->mUpFocusableActorId;
1061 case Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID:
1063 value = controlImpl.mImpl->mDownFocusableActorId;
1067 case Toolkit::Control::Property::BACKGROUND_COLOR:
1069 DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
1070 value = controlImpl.GetBackgroundColor();
1074 case Toolkit::Control::Property::BACKGROUND_IMAGE:
1076 DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
1078 Toolkit::Visual::Base visual = controlImpl.mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
1081 visual.CreatePropertyMap( map );
1087 case Toolkit::Control::Property::KEY_INPUT_FOCUS:
1089 value = controlImpl.HasKeyInputFocus();
1093 case Toolkit::Control::Property::BACKGROUND:
1096 Toolkit::Visual::Base visual = controlImpl.mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
1099 visual.CreatePropertyMap( map );
1106 case Toolkit::Control::Property::MARGIN:
1108 value = controlImpl.mImpl->GetMargin();
1112 case Toolkit::Control::Property::PADDING:
1114 value = controlImpl.mImpl->GetPadding();
1118 case Toolkit::DevelControl::Property::TOOLTIP:
1121 if( controlImpl.mImpl->mTooltip )
1123 controlImpl.mImpl->mTooltip->CreatePropertyMap( map );
1135 void Control::Impl::CopyInstancedProperties( RegisteredVisualContainer& visuals, Dictionary<Property::Map>& instancedProperties )
1137 for(RegisteredVisualContainer::Iterator iter = visuals.Begin(); iter!= visuals.End(); iter++)
1139 if( (*iter)->visual )
1141 Property::Map instanceMap;
1142 Toolkit::GetImplementation((*iter)->visual).CreateInstancePropertyMap(instanceMap);
1143 instancedProperties.Add( (*iter)->visual.GetName(), instanceMap );
1149 void Control::Impl::RemoveVisual( RegisteredVisualContainer& visuals, const std::string& visualName )
1151 Actor self( mControlImpl.Self() );
1153 for ( RegisteredVisualContainer::Iterator visualIter = visuals.Begin();
1154 visualIter != visuals.End(); ++visualIter )
1156 Toolkit::Visual::Base visual = (*visualIter)->visual;
1157 if( visual && visual.GetName() == visualName )
1159 Toolkit::GetImplementation(visual).SetOffStage( self );
1160 (*visualIter)->visual.Reset();
1161 visuals.Erase( visualIter );
1167 void Control::Impl::RemoveVisuals( RegisteredVisualContainer& visuals, DictionaryKeys& removeVisuals )
1169 Actor self( mControlImpl.Self() );
1170 for( DictionaryKeys::iterator iter = removeVisuals.begin(); iter != removeVisuals.end(); ++iter )
1172 const std::string visualName = *iter;
1173 RemoveVisual( visuals, visualName );
1177 void Control::Impl::RecreateChangedVisuals( Dictionary<Property::Map>& stateVisualsToChange,
1178 Dictionary<Property::Map>& instancedProperties )
1180 Dali::CustomActor handle( mControlImpl.GetOwner() );
1181 for( Dictionary<Property::Map>::iterator iter = stateVisualsToChange.Begin();
1182 iter != stateVisualsToChange.End(); ++iter )
1184 const std::string& visualName = (*iter).key;
1185 const Property::Map& toMap = (*iter).entry;
1187 // is it a candidate for re-creation?
1188 bool recreate = false;
1190 Toolkit::Visual::Base visual = GetVisualByName( mVisuals, visualName );
1193 Property::Map fromMap;
1194 visual.CreatePropertyMap( fromMap );
1196 Toolkit::Visual::Type fromType = GetVisualTypeFromMap( fromMap );
1197 Toolkit::Visual::Type toType = GetVisualTypeFromMap( toMap );
1199 if( fromType != toType )
1205 if( fromType == Toolkit::Visual::IMAGE || fromType == Toolkit::Visual::N_PATCH
1206 || fromType == Toolkit::Visual::SVG || fromType == Toolkit::Visual::ANIMATED_IMAGE )
1208 Property::Value* fromUrl = fromMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
1209 Property::Value* toUrl = toMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
1211 if( fromUrl && toUrl )
1213 std::string fromUrlString;
1214 std::string toUrlString;
1215 fromUrl->Get(fromUrlString);
1216 toUrl->Get(toUrlString);
1218 if( fromUrlString != toUrlString )
1226 const Property::Map* instancedMap = instancedProperties.FindConst( visualName );
1227 if( recreate || instancedMap )
1229 RemoveVisual( mVisuals, visualName );
1230 Style::ApplyVisual( handle, visualName, toMap, instancedMap );
1234 // @todo check to see if we can apply toMap without recreating the visual
1235 // e.g. by setting only animatable properties
1236 // For now, recreate all visuals, but merge in instance data.
1237 RemoveVisual( mVisuals, visualName );
1238 Style::ApplyVisual( handle, visualName, toMap, instancedMap );
1244 void Control::Impl::ReplaceStateVisualsAndProperties( const StylePtr oldState, const StylePtr newState, const std::string& subState )
1246 // Collect all old visual names
1247 DictionaryKeys stateVisualsToRemove;
1250 oldState->visuals.GetKeys( stateVisualsToRemove );
1251 if( ! subState.empty() )
1253 const StylePtr* oldSubState = oldState->subStates.FindConst(subState);
1256 DictionaryKeys subStateVisualsToRemove;
1257 (*oldSubState)->visuals.GetKeys( subStateVisualsToRemove );
1258 Merge( stateVisualsToRemove, subStateVisualsToRemove );
1263 // Collect all new visual properties
1264 Dictionary<Property::Map> stateVisualsToAdd;
1267 stateVisualsToAdd = newState->visuals;
1268 if( ! subState.empty() )
1270 const StylePtr* newSubState = newState->subStates.FindConst(subState);
1273 stateVisualsToAdd.Merge( (*newSubState)->visuals );
1278 // If a name is in both add/remove, move it to change list.
1279 Dictionary<Property::Map> stateVisualsToChange;
1280 FindChangableVisuals( stateVisualsToAdd, stateVisualsToChange, stateVisualsToRemove);
1282 // Copy instanced properties (e.g. text label) of current visuals
1283 Dictionary<Property::Map> instancedProperties;
1284 CopyInstancedProperties( mVisuals, instancedProperties );
1286 // For each visual in remove list, remove from mVisuals
1287 RemoveVisuals( mVisuals, stateVisualsToRemove );
1289 // For each visual in add list, create and add to mVisuals
1290 Dali::CustomActor handle( mControlImpl.GetOwner() );
1291 Style::ApplyVisuals( handle, stateVisualsToAdd, instancedProperties );
1293 // For each visual in change list, if it requires a new visual,
1294 // remove old visual, create and add to mVisuals
1295 RecreateChangedVisuals( stateVisualsToChange, instancedProperties );
1298 void Control::Impl::SetState( DevelControl::State newState, bool withTransitions )
1300 DevelControl::State oldState = mState;
1301 Dali::CustomActor handle( mControlImpl.GetOwner() );
1302 DALI_LOG_INFO(gLogFilter, Debug::Concise, "Control::Impl::SetState: %s\n",
1303 (mState == DevelControl::NORMAL ? "NORMAL" :(
1304 mState == DevelControl::FOCUSED ?"FOCUSED" : (
1305 mState == DevelControl::DISABLED?"DISABLED":"NONE" ))));
1307 if( mState != newState )
1309 // If mState was Disabled, and new state is Focused, should probably
1310 // store that fact, e.g. in another property that FocusManager can access.
1313 // Trigger state change and transitions
1314 // Apply new style, if stylemanager is available
1315 Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
1318 const StylePtr stylePtr = GetImpl( styleManager ).GetRecordedStyle( Toolkit::Control( mControlImpl.GetOwner() ) );
1322 std::string oldStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( oldState, ControlStateTable, ControlStateTableCount );
1323 std::string newStateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( newState, ControlStateTable, ControlStateTableCount );
1325 const StylePtr* newStateStyle = stylePtr->subStates.Find( newStateName );
1326 const StylePtr* oldStateStyle = stylePtr->subStates.Find( oldStateName );
1327 if( oldStateStyle && newStateStyle )
1329 // Only change if both state styles exist
1330 ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, mSubStateName );
1337 void Control::Impl::SetSubState( const std::string& subStateName, bool withTransitions )
1339 if( mSubStateName != subStateName )
1341 // Get existing sub-state visuals, and unregister them
1342 Dali::CustomActor handle( mControlImpl.GetOwner() );
1344 Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
1347 const StylePtr stylePtr = GetImpl( styleManager ).GetRecordedStyle( Toolkit::Control( mControlImpl.GetOwner() ) );
1351 std::string stateName = Scripting::GetEnumerationName< Toolkit::DevelControl::State >( mState, ControlStateTable, ControlStateTableCount );
1353 const StylePtr* state = stylePtr->subStates.Find( stateName );
1356 StylePtr stateStyle(*state);
1358 const StylePtr* newStateStyle = stateStyle->subStates.Find( subStateName );
1359 const StylePtr* oldStateStyle = stateStyle->subStates.Find( mSubStateName );
1360 if( oldStateStyle && newStateStyle )
1363 ReplaceStateVisualsAndProperties( *oldStateStyle, *newStateStyle, empty );
1369 mSubStateName = subStateName;
1373 void Control::Impl::OnStageDisconnection()
1375 Actor self = mControlImpl.Self();
1377 // Any visuals set for replacement but not yet ready should still be registered.
1378 // Reason: If a request was made to register a new visual but the control removed from stage before visual was ready
1379 // then when this control appears back on stage it should use that new visual.
1381 // Iterate through all registered visuals and set off stage
1382 SetVisualsOffStage( mVisuals, self );
1384 // Visuals pending replacement can now be taken out of the removal list and set off stage
1385 // Iterate through all replacement visuals and add to a move queue then set off stage
1386 for( auto removalIter = mRemoveVisuals.Begin(), end = mRemoveVisuals.End(); removalIter != end; removalIter++ )
1388 Toolkit::GetImplementation((*removalIter)->visual).SetOffStage( self );
1391 for( auto replacedIter = mVisuals.Begin(), end = mVisuals.End(); replacedIter != end; replacedIter++ )
1393 (*replacedIter)->pending = false;
1396 mRemoveVisuals.Clear();
1399 void Control::Impl::SetMargin( Extents margin )
1401 mControlImpl.mImpl->mMargin = margin;
1403 // Trigger a size negotiation request that may be needed when setting a margin.
1404 mControlImpl.RelayoutRequest();
1407 Extents Control::Impl::GetMargin() const
1409 return mControlImpl.mImpl->mMargin;
1412 void Control::Impl::SetPadding( Extents padding )
1414 mControlImpl.mImpl->mPadding = padding;
1416 // Trigger a size negotiation request that may be needed when setting a padding.
1417 mControlImpl.RelayoutRequest();
1420 Extents Control::Impl::GetPadding() const
1422 return mControlImpl.mImpl->mPadding;
1425 void Control::Impl::SetInputMethodContext( InputMethodContext& inputMethodContext )
1427 mInputMethodContext = inputMethodContext;
1430 bool Control::Impl::FilterKeyEvent( const KeyEvent& event )
1432 bool consumed ( false );
1434 if ( mInputMethodContext )
1436 consumed = mInputMethodContext.FilterEventKey( event );
1441 DevelControl::VisualEventSignalType& Control::Impl::VisualEventSignal()
1443 return mVisualEventSignal;
1446 } // namespace Internal
1448 } // namespace Toolkit