DALI_PROPERTY("siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER)
DALI_PROPERTY("updateSizeHint", VECTOR2, true, false, false, Dali::DevelActor::Property::UPDATE_SIZE_HINT)
DALI_PROPERTY("captureAllTouchAfterStart", BOOLEAN, true, false, false, Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START)
-DALI_PROPERTY("touchArea", VECTOR2, true, false, false, Dali::DevelActor::Property::TOUCH_AREA)
+DALI_PROPERTY("touchAreaOffset", RECTANGLE, true, false, false, Dali::DevelActor::Property::TOUCH_AREA_OFFSET)
DALI_PROPERTY("blendEquation", INTEGER, true, false, false, Dali::DevelActor::Property::BLEND_EQUATION)
+DALI_PROPERTY("touchFocusable", BOOLEAN, true, false, false, Dali::DevelActor::Property::TOUCH_FOCUSABLE)
+DALI_PROPERTY("keyboardFocusableChildren", BOOLEAN, true, false, false, Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN)
DALI_PROPERTY_TABLE_END(DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties)
// Signals
return node;
}
-void Actor::SetName(const std::string& name)
+void Actor::SetName(std::string_view name)
{
- mName = name;
+ mName = ConstString(name);
// ATTENTION: string for debug purposes is not thread safe.
- DALI_LOG_SET_OBJECT_STRING(const_cast<SceneGraph::Node*>(&GetNode()), name);
+ DALI_LOG_SET_OBJECT_STRING(const_cast<SceneGraph::Node*>(&GetNode()), mName.GetCString());
}
uint32_t Actor::GetId() const
uint32_t index = static_cast<uint32_t>(mRenderers->size()); // 4,294,967,295 renderers per actor
RendererPtr rendererPtr = RendererPtr(&renderer);
mRenderers->push_back(rendererPtr);
- AttachRendererMessage(GetEventThreadServices(), GetNode(), renderer.GetRendererSceneObject());
+ AttachRendererMessage(GetEventThreadServices().GetUpdateManager(), GetNode(), renderer.GetRendererSceneObject());
return index;
}
return mBlendEquation;
}
+void Actor::SetTransparent(bool transparent)
+{
+ SetTransparentMessage(GetEventThreadServices(), GetNode(), transparent);
+}
+
+bool Actor::IsTransparent() const
+{
+ return GetNode().IsTransparent();
+}
+
void Actor::SetDrawMode(DrawMode::Type drawMode)
{
// this flag is not animatable so keep the value
mTargetPosition(Vector3::ZERO),
mTargetScale(Vector3::ONE),
mAnimatedSize(Vector3::ZERO),
- mTouchArea(Vector2::ZERO),
+ mTouchAreaOffset(0, 0, 0, 0),
mName(),
mSortedDepth(0u),
mDepth(0u),
mSensitive(true),
mLeaveRequired(false),
mKeyboardFocusable(false),
+ mKeyboardFocusableChildren(true),
+ mTouchFocusable(false),
mOnSceneSignalled(false),
mInsideOnSizeSet(false),
mInheritPosition(true),
mVisible(true),
mInheritLayoutDirection(true),
mCaptureAllTouchAfterStart(false),
+ mIsBlendEquationSet(false),
+ mNeedGesturePropagation(false),
mLayoutDirection(LayoutDirection::LEFT_TO_RIGHT),
mDrawMode(DrawMode::NORMAL),
mColorMode(Node::DEFAULT_COLOR_MODE),
mClippingMode(ClippingMode::DISABLED),
- mBlendEquation(DevelBlendEquation::ADD),
- mIsBlendEquationSet(false)
+ mBlendEquation(DevelBlendEquation::ADD)
{
}
delete mRelayoutData;
}
-void Actor::Add(Actor& child)
+void Actor::Add(Actor& child, bool notify)
{
- mParentImpl.Add(child);
+ mParentImpl.Add(child, notify);
}
-void Actor::Remove(Actor& child)
+void Actor::Remove(Actor& child, bool notify)
{
- mParentImpl.Remove(child);
+ mParentImpl.Remove(child, notify);
+}
+
+void Actor::SwitchParent(Actor& newParent)
+{
+ if(this == &newParent)
+ {
+ DALI_LOG_ERROR("Cannot add actor to itself");
+ return;
+ }
+
+ if(!this->OnScene() || !newParent.OnScene())
+ {
+ DALI_LOG_ERROR("Both of current parent and new parent must be on Scene");
+ return;
+ }
+
+ newParent.Add(*this, false);
}
uint32_t Actor::GetChildCount() const
return mParentImpl.GetChildrenInternal();
}
-ActorPtr Actor::FindChildByName(const std::string& actorName)
+ActorPtr Actor::FindChildByName(ConstString actorName)
{
return mParentImpl.FindChildByName(actorName);
}
mParentImpl.UnparentChildren();
}
-void Actor::ConnectToScene(uint32_t parentDepth)
+void Actor::ConnectToScene(uint32_t parentDepth, bool notify)
{
// This container is used instead of walking the Actor hierarchy.
// It protects us when the Actor hierarchy is modified during OnSceneConnectionExternal callbacks.
// Notify applications about the newly connected actors.
for(const auto& actor : connectionList)
{
- actor->NotifyStageConnection();
+ actor->NotifyStageConnection(notify);
}
RelayoutRequest();
OnSceneObjectAdd();
}
-void Actor::NotifyStageConnection()
+void Actor::NotifyStageConnection(bool notify)
{
// Actors can be removed (in a callback), before the on-stage stage is reported.
// The actor may also have been reparented, in which case mOnSceneSignalled will be true.
if(OnScene() && !mOnSceneSignalled)
{
- // Notification for external (CustomActor) derived classes
- OnSceneConnectionExternal(mDepth);
-
- if(!mOnSceneSignal.Empty())
+ if(notify)
{
- Dali::Actor handle(this);
- mOnSceneSignal.Emit(handle);
+ // Notification for external (CustomActor) derived classes
+ OnSceneConnectionExternal(mDepth);
+
+ if(!mOnSceneSignal.Empty())
+ {
+ Dali::Actor handle(this);
+ mOnSceneSignal.Emit(handle);
+ }
}
// Guard against Remove during callbacks
}
}
-void Actor::DisconnectFromStage()
+void Actor::DisconnectFromStage(bool notify)
{
// This container is used instead of walking the Actor hierachy.
// It protects us when the Actor hierachy is modified during OnSceneDisconnectionExternal callbacks.
// Notify applications about the newly disconnected actors.
for(const auto& actor : disconnectionList)
{
- actor->NotifyStageDisconnection();
+ actor->NotifyStageDisconnection(notify);
}
}
OnSceneObjectRemove();
}
-void Actor::NotifyStageDisconnection()
+void Actor::NotifyStageDisconnection(bool notify)
{
// Actors can be added (in a callback), before the off-stage state is reported.
// Also if the actor was added & removed before mOnSceneSignalled was set, then we don't notify here.
// only do this step if there is a stage, i.e. Core is not being shut down
if(EventThreadServices::IsCoreRunning() && !OnScene() && mOnSceneSignalled)
{
- // Notification for external (CustomeActor) derived classes
- OnSceneDisconnectionExternal();
-
- if(!mOffSceneSignal.Empty())
+ if(notify)
{
- Dali::Actor handle(this);
- mOffSceneSignal.Emit(handle);
+ // Notification for external (CustomeActor) derived classes
+ OnSceneDisconnectionExternal();
+
+ if(!mOffSceneSignal.Empty())
+ {
+ Dali::Actor handle(this);
+ mOffSceneSignal.Emit(handle);
+ }
}
// Guard against Add during callbacks
}
}
-void Actor::SetParent(ActorParent* parent)
+void Actor::SetParent(ActorParent* parent, bool notify)
{
if(parent)
{
parentActor->OnScene())
{
// Instruct each actor to create a corresponding node in the scene graph
- ConnectToScene(parentActor->GetHierarchyDepth());
+ ConnectToScene(parentActor->GetHierarchyDepth(), notify);
}
// Resolve the name and index for the child properties if any
DisconnectNodeMessage(GetEventThreadServices().GetUpdateManager(), GetNode());
// Instruct each actor to discard pointers to the scene-graph
- DisconnectFromStage();
+ DisconnectFromStage(notify);
}
mScene = nullptr;
return {position.x, position.y, size.x, size.y};
}
+void Actor::SetNeedGesturePropagation(bool propagation)
+{
+ mNeedGesturePropagation = propagation;
+}
+
+bool Actor::NeedGesturePropagation()
+{
+ return mNeedGesturePropagation;
+}
+
bool Actor::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
{
return PropertyHandler::GetCachedPropertyValue(*this, index, value);