Tizen Native API

The Stage is a top-level object used for displaying a tree of Actors. More...

Inheritance diagram for Dali::Stage:
Dali::BaseHandle

Public Types

typedef Signal< void(const
KeyEvent &)> 
KeyEventSignalType
 Key event signal type.
typedef Signal< void() > EventProcessingFinishedSignalType
 Event Processing finished signal type.
typedef Signal< void(const
TouchEvent &)> 
TouchedSignalType
 Touched signal type.
typedef Signal< void(const
WheelEvent &)> 
WheelEventSignalType
 Touched signal type.
typedef Signal< void() > ContextStatusSignal
 Context status signal type.
typedef Signal< void() > SceneCreatedSignalType
 Scene created signal type.

Public Member Functions

 Stage ()
 Allows the creation of an empty stage handle.
 ~Stage ()
 Destructor.
 Stage (const Stage &handle)
 This copy constructor is required for (smart) pointer semantics.
Stageoperator= (const Stage &rhs)
 This assignment operator is required for (smart) pointer semantics.
void Add (Actor &actor)
 Adds a child Actor to the Stage.
void Remove (Actor &actor)
 Removes a child Actor from the Stage.
Vector2 GetSize () const
 Returns the size of the Stage in pixels as a Vector.
RenderTaskList GetRenderTaskList () const
 Retrieve the list of render-tasks.
unsigned int GetLayerCount () const
 Query the number of on-stage layers.
Layer GetLayer (unsigned int depth) const
 Retrieve the layer at a specified depth.
Layer GetRootLayer () const
 Returns the Stage's Root Layer.
void SetBackgroundColor (Vector4 color)
 Set the background color of the stage.
Vector4 GetBackgroundColor () const
 Retrieve the background color of the stage.
Vector2 GetDpi () const
 Retrieve the DPI of the display device to which the stage is connected.
ObjectRegistry GetObjectRegistry () const
 Get the Object registry.
void KeepRendering (float durationSeconds)
 Keep rendering for at least the given amount of time.
KeyEventSignalTypeKeyEventSignal ()
 This signal is emitted when key event is received.
EventProcessingFinishedSignalTypeEventProcessingFinishedSignal ()
 This signal is emitted just after the event processing is finished.
TouchedSignalTypeTouchedSignal ()
 This signal is emitted when the screen is touched and when the touch ends (i.e. the down & up touch events only).
WheelEventSignalTypeWheelEventSignal ()
 This signal is emitted when wheel event is received.
ContextStatusSignalContextLostSignal ()
 This signal is emitted when the GL context is lost (Platform specific behaviour).
ContextStatusSignalContextRegainedSignal ()
 This signal is emitted when the GL context is regained (Platform specific behaviour).
SceneCreatedSignalTypeSceneCreatedSignal ()
 This signal is emitted after the initial scene is created.

Static Public Member Functions

static Stage GetCurrent ()
 Get the current Stage.
static bool IsInstalled ()
 Query whether the Stage exists; this should only return false during or after destruction of Dali core.

Static Public Attributes

static const Vector4 DEFAULT_BACKGROUND_COLOR
 Default black background.
static const Vector4 DEBUG_BACKGROUND_COLOR
 Green background, useful when debugging.

Detailed Description

The Stage is a top-level object used for displaying a tree of Actors.

Multiple stage/window support is not currently provided.

Since :
2.4

Member Typedef Documentation

Context status signal type.

Since :
2.4

Event Processing finished signal type.

Since :
2.4

Key event signal type.

Since :
2.4

Scene created signal type.

Since :
2.4

Touched signal type.

Since :
2.4

Touched signal type.

Since :
2.4

Constructor & Destructor Documentation

Allows the creation of an empty stage handle.

To retrieve the current stage, this handle can be set using Stage::GetCurrent().

Since :
2.4

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since :
2.4
Dali::Stage::Stage ( const Stage handle)

This copy constructor is required for (smart) pointer semantics.

Since :
2.4
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

void Dali::Stage::Add ( Actor actor)

Adds a child Actor to the Stage.

The child will be referenced.

Since :
2.4
Parameters:
[in]actorThe child.
Precondition:
The actor has been initialized.
The actor does not have a parent.

This signal is emitted when the GL context is lost (Platform specific behaviour).

If the application is responsible for handling context loss, it should listen to this signal and tear down UI components when recieved.

Since :
2.4
Returns:
The context lost signal to connect to.

This signal is emitted when the GL context is regained (Platform specific behaviour).

If the application is responsible for handling context loss, it should listen to this signal and rebuild UI components on receipt.

Since :
2.4
Returns:
The context regained signal to connect to.

This signal is emitted just after the event processing is finished.

Since :
2.4
Returns:
The signal to connect to.

Retrieve the background color of the stage.

Since :
2.4
Returns:
The background color.
static Stage Dali::Stage::GetCurrent ( ) [static]

Get the current Stage.

Since :
2.4
Returns:
The current stage or an empty handle if the internal core has not been created or has been already destroyed.

Retrieve the DPI of the display device to which the stage is connected.

Since :
2.4
Returns:
The horizontal and vertical DPI
Layer Dali::Stage::GetLayer ( unsigned int  depth) const

Retrieve the layer at a specified depth.

Since :
2.4
Parameters:
[in]depthThe depth.
Returns:
The layer found at the given depth.
Precondition:
Depth is less than layer count; see GetLayerCount().
unsigned int Dali::Stage::GetLayerCount ( ) const

Query the number of on-stage layers.

Note that a default layer is always provided (count >= 1).

Since :
2.4
Returns:
The number of layers.

Get the Object registry.

Since :
2.4
Returns:
The object registry.

Retrieve the list of render-tasks.

Since :
2.4
Returns:
A valid handle to a RenderTaskList.

Returns the Stage's Root Layer.

Since :
2.4
Returns:
The root layer.

Returns the size of the Stage in pixels as a Vector.

The x component will be the width of the Stage in pixels The y component will be the height of the Stage in pixels The z component will be the distance between far and near planes

Since :
2.4
Returns:
The size of the Stage as a Vector.
static bool Dali::Stage::IsInstalled ( ) [static]

Query whether the Stage exists; this should only return false during or after destruction of Dali core.

Since :
2.4
Returns:
True when it's safe to call Stage::GetCurrent().
void Dali::Stage::KeepRendering ( float  durationSeconds)

Keep rendering for at least the given amount of time.

By default Dali will stop rendering when no Actor positions are being set, and when no animations are running etc. This method is useful to force screen refreshes e.g. when updating a NativeImage.

Since :
2.4
Parameters:
i]durationSeconds Time to keep rendering, 0 means render at least one more frame

This signal is emitted when key event is received.

A callback of the following type may be connected:

   void YourCallbackName(const KeyEvent& event);
Since :
2.4
Returns:
The signal to connect to.
Stage& Dali::Stage::operator= ( const Stage rhs)

This assignment operator is required for (smart) pointer semantics.

Since :
2.4
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this
void Dali::Stage::Remove ( Actor actor)

Removes a child Actor from the Stage.

The child will be unreferenced.

Since :
2.4
Parameters:
[in]actorThe child.
Precondition:
The actor has been added to the stage.

This signal is emitted after the initial scene is created.

It will be triggered after the application init signal.

A callback of the following type may be connected:

   void YourCallbackName();
Since :
2.4
Returns:
The signal to connect to.

Set the background color of the stage.

Since :
2.4
Parameters:
[in]colorThe new background color.

This signal is emitted when the screen is touched and when the touch ends (i.e. the down & up touch events only).

If there are multiple touch points, then this will be emitted when the first touch occurs and then when the last finger is lifted. An interrupted event will also be emitted. A callback of the following type may be connected:

   void YourCallbackName(const TouchEvent& event);
Since :
2.4
Returns:
The touch signal to connect to.
Note:
Motion events are not emitted.

This signal is emitted when wheel event is received.

A callback of the following type may be connected:

   void YourCallbackName(const WheelEvent& event);
Since :
2.4
Returns:
The signal to connect to.