2 * Copyright (c) 2021 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 <dali/devel-api/actors/actor-devel.h>
23 #include <dali/devel-api/common/stage.h>
24 #include <dali/devel-api/scripting/scripting.h>
25 #include <dali/integration-api/debug.h>
26 #include <dali/public-api/animation/constraint.h>
27 #include <dali/public-api/object/type-info.h>
28 #include <dali/public-api/object/type-registry-helper.h>
29 #include <dali/public-api/size-negotiation/relayout-container.h>
30 #include <cstring> // for strcmp
36 #include <dali-toolkit/dali-toolkit.h>
37 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
38 #include <dali-toolkit/devel-api/controls/control-devel.h>
39 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
40 #include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
41 #include <dali-toolkit/devel-api/visuals/color-visual-properties-devel.h>
42 #include <dali-toolkit/internal/controls/control/control-data-impl.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/public-api/align-enumerations.h>
47 #include <dali-toolkit/public-api/controls/control.h>
48 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
49 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
50 #include <dali-toolkit/public-api/styling/style-manager.h>
51 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
52 #include <dali-toolkit/public-api/visuals/visual-properties.h>
62 #if defined(DEBUG_ENABLED)
63 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_CONTROL_VISUALS");
67 * @brief Creates a clipping renderer if required.
68 * (EG. If no renders exist and clipping is enabled).
69 * @param[in] controlImpl The control implementation.
71 void CreateClippingRenderer(Control& controlImpl)
73 // We want to add a transparent background if we do not have one for clipping.
74 Actor self(controlImpl.Self());
75 int clippingMode = ClippingMode::DISABLED;
76 if(self.GetProperty(Actor::Property::CLIPPING_MODE).Get(clippingMode))
78 Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get(controlImpl);
80 if(clippingMode == ClippingMode::CLIP_CHILDREN && controlDataImpl.mVisuals.Empty() && self.GetRendererCount() == 0u)
82 controlImpl.SetBackgroundColor(Color::TRANSPARENT);
87 } // unnamed namespace
89 Toolkit::Control Control::New()
91 // Create the implementation, temporarily owned on stack
92 IntrusivePtr<Control> controlImpl = new Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT));
94 // Pass ownership to handle
95 Toolkit::Control handle(*controlImpl);
97 // Second-phase init of the implementation
98 // This can only be done after the CustomActor connection has been made...
99 controlImpl->Initialize();
104 void Control::SetStyleName(const std::string& styleName)
106 if(styleName != mImpl->mStyleName)
108 mImpl->mStyleName = styleName;
110 // Apply new style, if stylemanager is available
111 Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
114 GetImpl(styleManager).ApplyThemeStyle(Toolkit::Control(GetOwner()));
119 const std::string& Control::GetStyleName() const
121 return mImpl->mStyleName;
124 void Control::SetBackgroundColor(const Vector4& color)
126 mImpl->mBackgroundColor = color;
129 map[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::COLOR;
130 map[Toolkit::ColorVisual::Property::MIX_COLOR] = color;
132 Toolkit::Visual::Base visual = mImpl->GetVisual(Toolkit::Control::Property::BACKGROUND);
133 if(visual && visual.GetType() == Toolkit::Visual::COLOR)
135 // Update background color only
136 mImpl->DoAction(Toolkit::Control::Property::BACKGROUND, DevelVisual::Action::UPDATE_PROPERTY, map);
143 void Control::SetBackground(const Property::Map& map)
145 Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual(map);
146 visual.SetName("background");
149 mImpl->RegisterVisual(Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND);
151 // Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
156 void Control::ClearBackground()
158 mImpl->UnregisterVisual(Toolkit::Control::Property::BACKGROUND);
159 mImpl->mBackgroundColor = Color::TRANSPARENT;
161 // Trigger a size negotiation request that may be needed when unregistering a visual.
165 void Control::EnableGestureDetection(GestureType::Value type)
167 if((type & GestureType::PINCH) && !mImpl->mPinchGestureDetector)
169 mImpl->mPinchGestureDetector = PinchGestureDetector::New();
170 mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
171 mImpl->mPinchGestureDetector.Attach(Self());
174 if((type & GestureType::PAN) && !mImpl->mPanGestureDetector)
176 mImpl->mPanGestureDetector = PanGestureDetector::New();
177 mImpl->mPanGestureDetector.SetMaximumTouchesRequired(2);
178 mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
179 mImpl->mPanGestureDetector.Attach(Self());
182 if((type & GestureType::TAP) && !mImpl->mTapGestureDetector)
184 mImpl->mTapGestureDetector = TapGestureDetector::New();
185 mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
186 mImpl->mTapGestureDetector.Attach(Self());
189 if((type & GestureType::LONG_PRESS) && !mImpl->mLongPressGestureDetector)
191 mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
192 mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
193 mImpl->mLongPressGestureDetector.Attach(Self());
197 void Control::DisableGestureDetection(GestureType::Value type)
199 if((type & GestureType::PINCH) && mImpl->mPinchGestureDetector)
201 mImpl->mPinchGestureDetector.Detach(Self());
202 mImpl->mPinchGestureDetector.Reset();
205 if((type & GestureType::PAN) && mImpl->mPanGestureDetector)
207 mImpl->mPanGestureDetector.Detach(Self());
208 mImpl->mPanGestureDetector.Reset();
211 if((type & GestureType::TAP) && mImpl->mTapGestureDetector)
213 mImpl->mTapGestureDetector.Detach(Self());
214 mImpl->mTapGestureDetector.Reset();
217 if((type & GestureType::LONG_PRESS) && mImpl->mLongPressGestureDetector)
219 mImpl->mLongPressGestureDetector.Detach(Self());
220 mImpl->mLongPressGestureDetector.Reset();
224 PinchGestureDetector Control::GetPinchGestureDetector() const
226 return mImpl->mPinchGestureDetector;
229 PanGestureDetector Control::GetPanGestureDetector() const
231 return mImpl->mPanGestureDetector;
234 TapGestureDetector Control::GetTapGestureDetector() const
236 return mImpl->mTapGestureDetector;
239 LongPressGestureDetector Control::GetLongPressGestureDetector() const
241 return mImpl->mLongPressGestureDetector;
244 void Control::SetKeyboardNavigationSupport(bool isSupported)
246 mImpl->mIsKeyboardNavigationSupported = isSupported;
249 bool Control::IsKeyboardNavigationSupported()
251 return mImpl->mIsKeyboardNavigationSupported;
254 void Control::SetKeyInputFocus()
256 if(Self().GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
258 Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
262 bool Control::HasKeyInputFocus()
265 if(Self().GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
267 Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
268 if(Self() == control)
276 void Control::ClearKeyInputFocus()
278 if(Self().GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
280 Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
284 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
286 mImpl->mIsKeyboardFocusGroup = isFocusGroup;
288 // The following line will be removed when the deprecated API in KeyboardFocusManager is deleted
289 Toolkit::KeyboardFocusManager::Get().SetAsFocusGroup(Self(), isFocusGroup);
292 bool Control::IsKeyboardFocusGroup()
294 return Toolkit::KeyboardFocusManager::Get().IsFocusGroup(Self());
297 void Control::AccessibilityActivate()
299 // Inform deriving classes
300 OnAccessibilityActivated();
303 void Control::KeyboardEnter()
305 // Inform deriving classes
309 bool Control::OnAccessibilityActivated()
311 if(Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
313 return OnKeyboardEnter();
318 bool Control::OnKeyboardEnter()
320 return false; // Keyboard enter is not handled by default
323 bool Control::OnAccessibilityPan(PanGesture gesture)
325 return false; // Accessibility pan gesture is not handled by default
328 bool Control::OnAccessibilityValueChange(bool isIncrease)
330 return false; // Accessibility value change action is not handled by default
333 bool Control::OnAccessibilityZoom()
335 return false; // Accessibility zoom action is not handled by default
338 Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
343 void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
347 Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
349 return mImpl->mKeyEventSignal;
352 Toolkit::Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
354 return mImpl->mKeyInputFocusGainedSignal;
357 Toolkit::Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
359 return mImpl->mKeyInputFocusLostSignal;
362 bool Control::EmitKeyEventSignal(const KeyEvent& event)
364 // Guard against destruction during signal emission
365 Dali::Toolkit::Control handle(GetOwner());
367 bool consumed = false;
369 consumed = mImpl->FilterKeyEvent(event);
371 // signals are allocated dynamically when someone connects
372 if(!consumed && !mImpl->mKeyEventSignal.Empty())
374 consumed = mImpl->mKeyEventSignal.Emit(handle, event);
379 // Notification for derived classes
380 consumed = OnKeyEvent(event);
386 Control::Control(ControlBehaviour behaviourFlags)
387 : CustomActorImpl(static_cast<ActorFlags>(behaviourFlags)),
388 mImpl(new Impl(*this))
390 mImpl->mFlags = behaviourFlags;
398 void Control::Initialize()
400 // Call deriving classes so initialised before styling is applied to them.
403 if(!(mImpl->mFlags & DISABLE_STYLE_CHANGE_SIGNALS))
405 Toolkit::StyleManager styleManager = StyleManager::Get();
407 // if stylemanager is available
410 StyleManager& styleManagerImpl = GetImpl(styleManager);
412 // Register for style changes
413 styleManagerImpl.ControlStyleChangeSignal().Connect(this, &Control::OnStyleChange);
415 // Apply the current style
416 styleManagerImpl.ApplyThemeStyleAtInit(Toolkit::Control(GetOwner()));
420 if(mImpl->mFlags & REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)
422 SetKeyboardNavigationSupport(true);
426 Self().GetTypeInfo(type);
429 auto typeName = type.GetName();
430 DevelControl::AppendAccessibilityAttribute(Self(), "class", typeName);
434 void Control::OnInitialize()
438 void Control::OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::Type change)
440 // By default the control is only interested in theme (not font) changes
441 if(styleManager && change == StyleChange::THEME_CHANGE)
443 GetImpl(styleManager).ApplyThemeStyle(Toolkit::Control(GetOwner()));
448 void Control::OnPinch(const PinchGesture& pinch)
450 if(!(mImpl->mStartingPinchScale))
453 mImpl->mStartingPinchScale = new Vector3;
456 if(pinch.GetState() == GestureState::STARTED)
458 *(mImpl->mStartingPinchScale) = Self().GetCurrentProperty<Vector3>(Actor::Property::SCALE);
461 Self().SetProperty(Actor::Property::SCALE, *(mImpl->mStartingPinchScale) * pinch.GetScale());
464 void Control::OnPan(const PanGesture& pan)
468 void Control::OnTap(const TapGesture& tap)
472 void Control::OnLongPress(const LongPressGesture& longPress)
476 void Control::EmitKeyInputFocusSignal(bool focusGained)
478 Dali::Toolkit::Control handle(GetOwner());
480 if(Accessibility::IsUp())
482 auto self = mImpl->GetAccessibilityObject(Self());
483 self->EmitFocused(focusGained);
484 auto parent = self->GetParent();
485 if(parent && !self->GetStates()[Dali::Accessibility::State::MANAGES_DESCENDANTS])
487 parent->EmitActiveDescendantChanged(self);
493 // signals are allocated dynamically when someone connects
494 if(!mImpl->mKeyInputFocusGainedSignal.Empty())
496 mImpl->mKeyInputFocusGainedSignal.Emit(handle);
501 // signals are allocated dynamically when someone connects
502 if(!mImpl->mKeyInputFocusLostSignal.Empty())
504 mImpl->mKeyInputFocusLostSignal.Emit(handle);
509 void Control::OnSceneConnection(int depth)
511 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Control::OnSceneConnection number of registered visuals(%d)\n", mImpl->mVisuals.Size());
515 for(RegisteredVisualContainer::Iterator iter = mImpl->mVisuals.Begin(); iter != mImpl->mVisuals.End(); iter++)
517 // Check whether the visual is empty and enabled
518 if((*iter)->visual && (*iter)->enabled)
520 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Control::OnSceneConnection Setting visual(%d) on scene\n", (*iter)->index);
521 Toolkit::GetImplementation((*iter)->visual).SetOnScene(self);
525 // The clipping renderer is only created if required.
526 CreateClippingRenderer(*this);
529 void Control::OnSceneDisconnection()
531 mImpl->OnSceneDisconnection();
534 void Control::OnKeyInputFocusGained()
536 EmitKeyInputFocusSignal(true);
539 void Control::OnKeyInputFocusLost()
541 EmitKeyInputFocusSignal(false);
544 void Control::OnChildAdd(Actor& child)
548 void Control::OnChildRemove(Actor& child)
552 void Control::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
554 // If the clipping mode has been set, we may need to create a renderer.
555 // Only do this if we are already on-stage as the OnSceneConnection will handle the off-stage clipping controls.
558 case Actor::Property::CLIPPING_MODE:
560 if(Self().GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
562 // Note: This method will handle whether creation of the renderer is required.
563 CreateClippingRenderer(*this);
567 case Actor::Property::VISIBLE:
569 if(Dali::Accessibility::IsUp() && !Self().GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN))
571 Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get<bool>());
578 void Control::OnSizeSet(const Vector3& targetSize)
580 Toolkit::Visual::Base visual = mImpl->GetVisual(Toolkit::Control::Property::BACKGROUND);
583 Vector2 size(targetSize);
584 visual.SetTransformAndSize(Property::Map(), size); // Send an empty map as we do not want to modify the visual's set transform
588 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
590 // @todo size negotiate background to new size, animate as well?
593 bool Control::OnKeyEvent(const KeyEvent& event)
595 return false; // Do not consume
598 void Control::OnRelayout(const Vector2& size, RelayoutContainer& container)
600 for(unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i)
602 Actor child = Self().GetChildAt(i);
603 Vector2 newChildSize(size);
605 // When set the padding or margin on the control, child should be resized and repositioned.
606 if((mImpl->mPadding.start != 0) || (mImpl->mPadding.end != 0) || (mImpl->mPadding.top != 0) || (mImpl->mPadding.bottom != 0) ||
607 (mImpl->mMargin.start != 0) || (mImpl->mMargin.end != 0) || (mImpl->mMargin.top != 0) || (mImpl->mMargin.bottom != 0))
609 Extents padding = mImpl->mPadding;
611 Dali::CustomActor ownerActor(GetOwner());
612 Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(ownerActor.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
614 if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection)
616 std::swap(padding.start, padding.end);
619 newChildSize.width = size.width - (padding.start + padding.end);
620 newChildSize.height = size.height - (padding.top + padding.bottom);
622 // Cannot use childs Position property as it can already have padding and margin applied on it,
623 // so we end up cumulatively applying them over and over again.
624 Vector2 childOffset(0.f, 0.f);
625 childOffset.x += (mImpl->mMargin.start + padding.start);
626 childOffset.y += (mImpl->mMargin.top + padding.top);
628 child.SetProperty(Actor::Property::POSITION, Vector2(childOffset.x, childOffset.y));
630 container.Add(child, newChildSize);
633 Toolkit::Visual::Base visual = mImpl->GetVisual(Toolkit::Control::Property::BACKGROUND);
636 visual.SetTransformAndSize(Property::Map(), size); // Send an empty map as we do not want to modify the visual's set transform
640 void Control::OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
644 Vector3 Control::GetNaturalSize()
646 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Control::GetNaturalSize for %s\n", Self().GetProperty<std::string>(Dali::Actor::Property::NAME).c_str());
647 Toolkit::Visual::Base visual = mImpl->GetVisual(Toolkit::Control::Property::BACKGROUND);
651 visual.GetNaturalSize(naturalSize);
652 naturalSize.width += (mImpl->mPadding.start + mImpl->mPadding.end);
653 naturalSize.height += (mImpl->mPadding.top + mImpl->mPadding.bottom);
654 return Vector3(naturalSize);
656 return Vector3::ZERO;
659 float Control::CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension)
661 return CalculateChildSizeBase(child, dimension);
664 float Control::GetHeightForWidth(float width)
666 return GetHeightForWidthBase(width);
669 float Control::GetWidthForHeight(float height)
671 return GetWidthForHeightBase(height);
674 bool Control::RelayoutDependentOnChildren(Dimension::Type dimension)
676 return RelayoutDependentOnChildrenBase(dimension);
679 void Control::OnCalculateRelayoutSize(Dimension::Type dimension)
683 void Control::OnLayoutNegotiated(float size, Dimension::Type dimension)
687 void Control::SignalConnected(SlotObserver* slotObserver, CallbackBase* callback)
689 mImpl->SignalConnected(slotObserver, callback);
692 void Control::SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callback)
694 mImpl->SignalDisconnected(slotObserver, callback);
697 void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali::Property::Map& destinationPropertyMap,
698 Dali::Toolkit::Control source, Dali::Toolkit::Control destination, Dali::Property::Index visualIndex)
700 sourcePropertyMap.Clear();
701 destinationPropertyMap.Clear();
703 Toolkit::Visual::Base sourceVisual = DevelControl::GetVisual(GetImplementation(source), visualIndex);
704 Toolkit::Visual::Base destinationVisual = DevelControl::GetVisual(GetImplementation(destination), visualIndex);
706 // If source or destination doesn't have the visual, do not create transition for the visual.
707 if(!sourceVisual || !destinationVisual)
712 Property::Map sourceMap;
713 Property::Map destinationMap;
714 sourceVisual.CreatePropertyMap(sourceMap);
715 destinationVisual.CreatePropertyMap(destinationMap);
717 static auto findValueVector4 = [](const Property::Map& map, Property::Index index, const Vector4& defaultValue = Vector4()) -> Vector4
719 Property::Value* propertyValue = map.Find(index);
722 return propertyValue->Get<Vector4>();
727 static auto findValueFloat = [](const Property::Map& map, Property::Index index, const float& defaultValue = 0.0f) -> float
729 Property::Value* propertyValue = map.Find(index);
732 return propertyValue->Get<float>();
737 Vector4 defaultMixColor(Color::TRANSPARENT);
738 Vector4 defaultCornerRadius(0.0f, 0.0f, 0.0f, 0.0f);
739 float defaultBorderlineWidth(0.0f);
740 Vector4 defaultBorderlineColor(0.0f, 0.0f, 0.0f, 1.0f);
741 float defaultBorderlineOffset(0.0f);
743 Vector4 sourceMixColor = findValueVector4(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR, defaultMixColor);
744 Vector4 sourceCornerRadius = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, defaultCornerRadius);
745 float sourceBorderlineWidth = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, defaultBorderlineWidth);
746 Vector4 sourceBorderlineColor = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, defaultBorderlineColor);
747 float sourceBorderlineOffset = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, defaultBorderlineOffset);
749 Vector4 destinationMixColor = findValueVector4(destinationMap, Dali::Toolkit::Visual::Property::MIX_COLOR, defaultMixColor);
750 Vector4 destinationCornerRadius = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, defaultCornerRadius);
751 float destinationBorderlineWidth = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, defaultBorderlineWidth);
752 Vector4 destinationBorderlineColor = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, defaultBorderlineColor);
753 float destinationBorderlineOffset = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, defaultBorderlineOffset);
755 // If the value of the source Control and that of destination Control is different, the property should be transitioned.
756 if(Vector3(sourceMixColor) != Vector3(destinationMixColor))
758 sourcePropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, Vector3(sourceMixColor));
759 destinationPropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, Vector3(destinationMixColor));
762 if(std::abs(sourceMixColor.a - destinationMixColor.a) > Math::MACHINE_EPSILON_1)
764 sourcePropertyMap.Add(Dali::Toolkit::Visual::Property::OPACITY, sourceMixColor.a);
765 destinationPropertyMap.Add(Dali::Toolkit::Visual::Property::OPACITY, destinationMixColor.a);
768 if(sourceCornerRadius != destinationCornerRadius)
770 sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS, sourceCornerRadius);
771 destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationCornerRadius);
774 if(sourceBorderlineWidth != destinationBorderlineWidth)
776 sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, sourceBorderlineWidth);
777 destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
780 if(sourceBorderlineColor != destinationBorderlineColor)
782 sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR, sourceBorderlineColor);
783 destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
786 if(sourceBorderlineOffset != destinationBorderlineOffset)
788 sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, sourceBorderlineOffset);
789 destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
793 Control& GetImplementation(Dali::Toolkit::Control& handle)
795 CustomActorImpl& customInterface = handle.GetImplementation();
796 // downcast to control
797 Control& impl = dynamic_cast<Internal::Control&>(customInterface);
801 const Control& GetImplementation(const Dali::Toolkit::Control& handle)
803 const CustomActorImpl& customInterface = handle.GetImplementation();
804 // downcast to control
805 const Control& impl = dynamic_cast<const Internal::Control&>(customInterface);
809 } // namespace Internal
811 } // namespace Toolkit