-#ifndef __DALI_ACTOR_H__
-#define __DALI_ACTOR_H__
+#ifndef DALI_ACTOR_H
+#define DALI_ACTOR_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/object/handle.h>
#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/signals/dali-signal.h>
+
namespace Dali
{
/**
class Quaternion;
class Layer;
struct KeyEvent;
+class TouchData;
struct TouchEvent;
struct HoverEvent;
struct WheelEvent;
*
* Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest.
* @endcode
- * - Stencil Actors can be used to influence the result of hits on renderable actors within a layer.
- * If a Stencil Actor exists on a layer and that Actor is marked visible then a successful
- * hit on a renderable actor can only take place in the area that the stencil Actor marks as visible.
- * The hit can be in any Stencil Actor in that layer, but must be in the region of one of them.
- * Stencil Actor inheritance behaves as with rendering in that any child of a Stencil Actor will
- * also be considered a Stencil Actor.
- * Non-renderable actors can be hit regardless of whether a stencil actor is hit or not.
+ * For more information, see SetDrawMode().
*
* <i>Touch or hover Event Delivery:</i>
*
*/
struct Property
{
+ /**
+ * @brief An enumeration of properties belonging to the Actor class.
+ * @SINCE_1_0.0
+ */
enum
{
- PARENT_ORIGIN = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parentOrigin", type Vector3 (constraint-input) @SINCE_1_0.0
- PARENT_ORIGIN_X, ///< name "parentOriginX", type float (constraint-input) @SINCE_1_0.0
- PARENT_ORIGIN_Y, ///< name "parentOriginY", type float (constraint-input) @SINCE_1_0.0
- PARENT_ORIGIN_Z, ///< name "parentOriginZ", type float (constraint-input) @SINCE_1_0.0
- ANCHOR_POINT, ///< name "anchorPoint", type Vector3 (constraint-input) @SINCE_1_0.0
- ANCHOR_POINT_X, ///< name "anchorPointX", type float (constraint-input) @SINCE_1_0.0
- ANCHOR_POINT_Y, ///< name "anchorPointY", type float (constraint-input) @SINCE_1_0.0
- ANCHOR_POINT_Z, ///< name "anchorPointZ", type float (constraint-input) @SINCE_1_0.0
- SIZE, ///< name "size", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
- SIZE_WIDTH, ///< name "sizeWidth", type float (animatable / constraint-input) @SINCE_1_0.0
- SIZE_HEIGHT, ///< name "sizeHeight", type float (animatable / constraint-input) @SINCE_1_0.0
- SIZE_DEPTH, ///< name "sizeDepth", type float (animatable / constraint-input) @SINCE_1_0.0
- POSITION, ///< name "position", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
- POSITION_X, ///< name "positionX", type float (animatable / constraint-input) @SINCE_1_0.0
- POSITION_Y, ///< name "positionY", type float (animatable / constraint-input) @SINCE_1_0.0
- POSITION_Z, ///< name "positionZ", type float (animatable / constraint-input) @SINCE_1_0.0
- WORLD_POSITION, ///< name "worldPosition", type Vector3 (read-only / constraint-input) @SINCE_1_0.0
- WORLD_POSITION_X, ///< name "worldPositionX", type float (read-only / constraint-input) @SINCE_1_0.0
- WORLD_POSITION_Y, ///< name "worldPositionY", type float (read-only / constraint-input) @SINCE_1_0.0
- WORLD_POSITION_Z, ///< name "worldPositionZ", type float (read-only / constraint-input) @SINCE_1_0.0
- ORIENTATION, ///< name "orientation", type Quaternion (animatable / constraint-input) @SINCE_1_0.0
- WORLD_ORIENTATION, ///< name "worldOrientation", type Quaternion (read-only / constraint-input) @SINCE_1_0.0
- SCALE, ///< name "scale", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
- SCALE_X, ///< name "scaleX", type float (animatable / constraint-input) @SINCE_1_0.0
- SCALE_Y, ///< name "scaleY", type float (animatable / constraint-input) @SINCE_1_0.0
- SCALE_Z, ///< name "scaleZ", type float (animatable / constraint-input) @SINCE_1_0.0
- WORLD_SCALE, ///< name "worldScale", type Vector3 (read-only / constraint-input) @SINCE_1_0.0
- VISIBLE, ///< name "visible", type bool (animatable / constraint-input) @SINCE_1_0.0
- COLOR, ///< name "color", type Vector4 (animatable / constraint-input) @SINCE_1_0.0
- COLOR_RED, ///< name "colorRed", type float (animatable / constraint-input) @SINCE_1_0.0
- COLOR_GREEN, ///< name "colorGreen", type float (animatable / constraint-input) @SINCE_1_0.0
- COLOR_BLUE, ///< name "colorBlue", type float (animatable / constraint-input) @SINCE_1_0.0
- COLOR_ALPHA, ///< name "colorAlpha", type float (animatable / constraint-input) @SINCE_1_0.0
- WORLD_COLOR, ///< name "worldColor", type Vector4 (read-only / constraint-input) @SINCE_1_0.0
- WORLD_MATRIX, ///< name "worldMatrix", type Matrix (read-only / constraint-input) @SINCE_1_0.0
+ PARENT_ORIGIN = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parentOrigin", type Vector3 (constraint-input) @SINCE_1_0.0
+ PARENT_ORIGIN_X, ///< name "parentOriginX", type float (constraint-input) @SINCE_1_0.0
+ PARENT_ORIGIN_Y, ///< name "parentOriginY", type float (constraint-input) @SINCE_1_0.0
+ PARENT_ORIGIN_Z, ///< name "parentOriginZ", type float (constraint-input) @SINCE_1_0.0
+ ANCHOR_POINT, ///< name "anchorPoint", type Vector3 (constraint-input) @SINCE_1_0.0
+ ANCHOR_POINT_X, ///< name "anchorPointX", type float (constraint-input) @SINCE_1_0.0
+ ANCHOR_POINT_Y, ///< name "anchorPointY", type float (constraint-input) @SINCE_1_0.0
+ ANCHOR_POINT_Z, ///< name "anchorPointZ", type float (constraint-input) @SINCE_1_0.0
+ SIZE, ///< name "size", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
+ SIZE_WIDTH, ///< name "sizeWidth", type float (animatable / constraint-input) @SINCE_1_0.0
+ SIZE_HEIGHT, ///< name "sizeHeight", type float (animatable / constraint-input) @SINCE_1_0.0
+ SIZE_DEPTH, ///< name "sizeDepth", type float (animatable / constraint-input) @SINCE_1_0.0
+ POSITION, ///< name "position", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
+ POSITION_X, ///< name "positionX", type float (animatable / constraint-input) @SINCE_1_0.0
+ POSITION_Y, ///< name "positionY", type float (animatable / constraint-input) @SINCE_1_0.0
+ POSITION_Z, ///< name "positionZ", type float (animatable / constraint-input) @SINCE_1_0.0
+ WORLD_POSITION, ///< name "worldPosition", type Vector3 (read-only / constraint-input) @SINCE_1_0.0
+ WORLD_POSITION_X, ///< name "worldPositionX", type float (read-only / constraint-input) @SINCE_1_0.0
+ WORLD_POSITION_Y, ///< name "worldPositionY", type float (read-only / constraint-input) @SINCE_1_0.0
+ WORLD_POSITION_Z, ///< name "worldPositionZ", type float (read-only / constraint-input) @SINCE_1_0.0
+ ORIENTATION, ///< name "orientation", type Quaternion (animatable / constraint-input) @SINCE_1_0.0
+ WORLD_ORIENTATION, ///< name "worldOrientation", type Quaternion (read-only / constraint-input) @SINCE_1_0.0
+ SCALE, ///< name "scale", type Vector3 (animatable / constraint-input) @SINCE_1_0.0
+ SCALE_X, ///< name "scaleX", type float (animatable / constraint-input) @SINCE_1_0.0
+ SCALE_Y, ///< name "scaleY", type float (animatable / constraint-input) @SINCE_1_0.0
+ SCALE_Z, ///< name "scaleZ", type float (animatable / constraint-input) @SINCE_1_0.0
+ WORLD_SCALE, ///< name "worldScale", type Vector3 (read-only / constraint-input) @SINCE_1_0.0
+ VISIBLE, ///< name "visible", type bool (animatable / constraint-input) @SINCE_1_0.0
+ COLOR, ///< name "color", type Vector4 (animatable / constraint-input) @SINCE_1_0.0
+ COLOR_RED, ///< name "colorRed", type float (animatable / constraint-input) @SINCE_1_0.0
+ COLOR_GREEN, ///< name "colorGreen", type float (animatable / constraint-input) @SINCE_1_0.0
+ COLOR_BLUE, ///< name "colorBlue", type float (animatable / constraint-input) @SINCE_1_0.0
+ COLOR_ALPHA, ///< name "colorAlpha", type float (animatable / constraint-input) @SINCE_1_0.0
+ WORLD_COLOR, ///< name "worldColor", type Vector4 (read-only / constraint-input) @SINCE_1_0.0
+ WORLD_MATRIX, ///< name "worldMatrix", type Matrix (read-only / constraint-input) @SINCE_1_0.0
NAME, ///< name "name", type std::string @SINCE_1_0.0
- SENSITIVE, ///< name "sensitive", type bool @SINCE_1_0.0
- LEAVE_REQUIRED, ///< name "leaveRequired", type bool @SINCE_1_0.0
- INHERIT_ORIENTATION, ///< name "inheritOrientation", type bool @SINCE_1_0.0
- INHERIT_SCALE, ///< name "inheritScale", type bool @SINCE_1_0.0
+ SENSITIVE, ///< name "sensitive", type bool @SINCE_1_0.0
+ LEAVE_REQUIRED, ///< name "leaveRequired", type bool @SINCE_1_0.0
+ INHERIT_ORIENTATION, ///< name "inheritOrientation", type bool @SINCE_1_0.0
+ INHERIT_SCALE, ///< name "inheritScale", type bool @SINCE_1_0.0
COLOR_MODE, ///< name "colorMode", type std::string @SINCE_1_0.0
- POSITION_INHERITANCE, ///< name "positionInheritance", type std::string @SINCE_1_0.0
+ POSITION_INHERITANCE, ///< name "positionInheritance", type std::string @DEPRECATED_1_1.24 Use INHERIT_POSITION instead
DRAW_MODE, ///< name "drawMode", type std::string @SINCE_1_0.0
- SIZE_MODE_FACTOR, ///< name "sizeModeFactor", type Vector3 @SINCE_1_0.0
- WIDTH_RESIZE_POLICY, ///< name "widthResizePolicy", type String @SINCE_1_0.0
- HEIGHT_RESIZE_POLICY, ///< name "heightResizePolicy", type String @SINCE_1_0.0
- SIZE_SCALE_POLICY, ///< name "sizeScalePolicy", type String @SINCE_1_0.0
- WIDTH_FOR_HEIGHT, ///< name "widthForHeight", type Boolean @SINCE_1_0.0
- HEIGHT_FOR_WIDTH, ///< name "heightForWidth", type Boolean @SINCE_1_0.0
- PADDING, ///< name "padding", type Vector4 @SINCE_1_0.0
- MINIMUM_SIZE, ///< name "minimumSize", type Vector2 @SINCE_1_0.0
- MAXIMUM_SIZE, ///< name "maximumSize", type Vector2 @SINCE_1_0.0
+ SIZE_MODE_FACTOR, ///< name "sizeModeFactor", type Vector3 @SINCE_1_0.0
+ WIDTH_RESIZE_POLICY, ///< name "widthResizePolicy", type String @SINCE_1_0.0
+ HEIGHT_RESIZE_POLICY, ///< name "heightResizePolicy", type String @SINCE_1_0.0
+ SIZE_SCALE_POLICY, ///< name "sizeScalePolicy", type String @SINCE_1_0.0
+ WIDTH_FOR_HEIGHT, ///< name "widthForHeight", type bool @SINCE_1_0.0
+ HEIGHT_FOR_WIDTH, ///< name "heightForWidth", type bool @SINCE_1_0.0
+ PADDING, ///< name "padding", type Vector4 @SINCE_1_0.0
+ MINIMUM_SIZE, ///< name "minimumSize", type Vector2 @SINCE_1_0.0
+ MAXIMUM_SIZE, ///< name "maximumSize", type Vector2 @SINCE_1_0.0
+ INHERIT_POSITION, ///< name "inheritPosition", type bool @SINCE_1_1.24
+ CLIPPING_MODE, ///< name "clippingMode", type String @SINCE_1_2_5
};
};
// Typedefs
- typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType; ///< Touch signal type @SINCE_1_0.0
- typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType; ///< Hover signal type @SINCE_1_0.0
- typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType; ///< Wheel signal type @SINCE_1_0.0
- typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type @SINCE_1_0.0
- typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type @SINCE_1_0.0
- typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out @SINCE_1_0.0
+ typedef Signal< bool (Actor, const TouchEvent&) > TouchSignalType; ///< @DEPRECATED_1_1.37 @brief Touch signal type @SINCE_1_0.0
+ typedef Signal< bool (Actor, const TouchData&) > TouchDataSignalType; ///< Touch signal type @SINCE_1_1.37
+ typedef Signal< bool (Actor, const HoverEvent&) > HoverSignalType; ///< Hover signal type @SINCE_1_0.0
+ typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType; ///< Wheel signal type @SINCE_1_0.0
+ typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type @SINCE_1_0.0
+ typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type @SINCE_1_0.0
+ typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out @SINCE_1_0.0
// Creation
Vector3 GetCurrentWorldPosition() const;
/**
+ * @DEPRECATED_1_1.24 Use SetInheritPosition instead
* @brief Set the actors position inheritance mode.
*
* The default is to inherit.
* @pre The Actor has been initialized.
* @see PositionInheritanceMode
*/
- void SetPositionInheritanceMode( PositionInheritanceMode mode );
+ void SetPositionInheritanceMode( PositionInheritanceMode mode ) DALI_DEPRECATED_API;
/**
+ * @brief Set whether a child actor inherits it's parent's position.
+ *
+ * Default is to inherit.
+ * Switching this off means that using SetPosition() sets the actor's world position3
+ * @SINCE_1_1.24
+ * @param[in] inherit - true if the actor should inherit position, false otherwise.
+ * @pre The Actor has been initialized.
+ */
+ inline void SetInheritPosition( bool inherit )
+ {
+ SetProperty(Property::INHERIT_POSITION, inherit );
+ }
+
+ /**
+ * @DEPRECATED_1_1.24 Use IsPositionInherited
* @brief Returns the actors position inheritance mode.
*
* @SINCE_1_0.0
* @return Return the position inheritance mode.
* @pre The Actor has been initialized.
*/
- PositionInheritanceMode GetPositionInheritanceMode() const;
+ PositionInheritanceMode GetPositionInheritanceMode() const DALI_DEPRECATED_API;
+
+ /**
+ * @brief Returns whether the actor inherits its parent's position.
+ *
+ * @SINCE_1_1.24
+ * @return True if the actor inherits its parent position, false if it uses world position.
+ * @pre The Actor has been initialized.
+ */
+ inline bool IsPositionInherited() const
+ {
+ return GetProperty(Property::INHERIT_POSITION ).Get<bool>();
+ }
/**
* @brief Sets the orientation of the Actor.
* Overlay actors are drawn in a separate pass, after all non-overlay actors within the Layer.
* For overlay actors, the drawing order is with respect to tree levels of Actors,
* and depth-testing will not be used.
- *
- * If DrawMode::STENCIL is used, the actor and its children will be used to stencil-test other actors
- * within the Layer. Stencil actors are therefore drawn into the stencil buffer before any other
- * actors within the Layer.
- *
+
* @SINCE_1_0.0
* @param[in] drawMode The new draw-mode to use.
- * @note Setting STENCIL will override OVERLAY_2D, if that would otherwise have been inherited.
* @note Layers do not inherit the DrawMode from their parents.
*/
void SetDrawMode( DrawMode::Type drawMode );
// Input Handling
/**
- * @brief Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
+ * @brief Sets whether an actor should emit touch or hover signals.
*
* An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
* the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
* size 0 is treated as aspect ratio 1:1.
*
* @SINCE_1_0.0
- * @param width Width to use
+ * @param[in] width Width to use
* @return Return the height based on the width.
*/
float GetHeightForWidth( float width );
* size 0 is treated as aspect ratio 1:1.
*
* @SINCE_1_0.0
- * @param height Height to use
+ * @param[in] height Height to use
* @return Return the width based on the height.
*/
float GetWidthForHeight( float height );
* @brief Return the value of negotiated dimension for the given dimension.
*
* @SINCE_1_0.0
- * @param dimension The dimension to retrieve
+ * @param[in] dimension The dimension to retrieve
* @return Return the value of the negotiated dimension. If more than one dimension is requested, just return the first one found.
*/
float GetRelayoutSize( Dimension::Type dimension ) const;
* @brief Return the value of the padding.
*
* @SINCE_1_0.0
- * @param paddingOut The returned padding data
+ * @param[in] paddingOut The returned padding data
*/
void GetPadding( Padding& paddingOut ) const;
public: // Signals
/**
+ * @DEPRECATED_1_1.37 Use TouchSignal() instead.
* @brief This signal is emitted when touch input is received.
*
* A callback of the following type may be connected:
* @return The signal to connect to.
* @pre The Actor has been initialized.
*/
- TouchSignalType& TouchedSignal();
+ TouchSignalType& TouchedSignal() DALI_DEPRECATED_API;
+
+ /**
+ * @brief This signal is emitted when touch input is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName( Actor actor, TouchData& touch );
+ * @endcode
+ * The return value of True, indicates that the touch event has been consumed.
+ * Otherwise the signal will be emitted on the next sensitive parent of the actor.
+ * @SINCE_1_1.37
+ * @return The signal to connect to.
+ * @pre The Actor has been initialized.
+ */
+ TouchDataSignalType& TouchSignal();
/**
* @brief This signal is emitted when hover input is received.
public: // Not intended for application developers
/**
+ * @internal
* @brief This constructor is used by Actor::New() methods.
*
* @SINCE_1_0.0
};
/**
+ * @internal
* @brief Helper for discarding an actor handle.
*
* If the handle is empty, this method does nothing. Otherwise
*/
} // namespace Dali
-#endif // __DALI_ACTOR_H__
+#endif // DALI_ACTOR_H