Next: ClutterTexture, Previous: ClutterShader, Up: Top
Top level visual element to which actors are placed.
<clutter-stage> is a top level 'window' on which child actors are placed
and manipulated.
Clutter creates a default stage upon initialization, which can be retrieved
using clutter-stage-get-default. Clutter always provides the default
stage, unless the backend is unable to create one. The stage returned by
clutter-stage-get-default is guaranteed to always be the same.
Backends might provide support for multiple stages. The support for this feature
can be checked at run-time using the clutter-feature-available function
and the ‘CLUTTER_FEATURE_STAGE_MULTIPLE’ flag. If the backend used supports
multiple stages, new <clutter-stage> instances can be created using
clutter-stage-new. These stages must be managed by the developer using
clutter-actor-destroy, which will take care of destroying all the actors
contained inside them.
<clutter-stage> is a proxy actor, wrapping the backend-specific
implementation of the windowing system. It is possible to subclass
<clutter-stage>, as long as every overridden virtual function chains up
to the parent class corresponding function.
Derives from
<clutter-group>.This class defines the following slots:
color- The color of the main stage
fullscreen- Whether the main stage is fullscreen
offscreen- Whether the main stage is renderer offscreen
cursor-visible- Whether the mouse pointer is visible on the main stage
title- Stage Title
user-resizable- Whether the stage is able to be resized via user interaction
use-fog- Whether to enable depth cueing
The ::fullscreen signal is emitted when the stage is made fullscreen.
Since 0.6
The ::unfullscreen signal is emitted when the stage leaves a fullscreen state.
Since 0.6
The ::activate signal is emitted when the stage receives key focus from the underlying window system.
Since 0.6
The ::activate signal is emitted when the stage loses key focus from the underlying window system.
Since 0.6
<clutter-actor>)Returns the main stage. The default
<clutter-stage>is a singleton, so the stage will be created the first time this function is called (typically, insideclutter-init); all the subsequent calls toclutter-stage-get-defaultwill return the same instance.Clutter guarantess the existence of the default stage.
- ret
- the main
<clutter-stage>. You should never destroy or unref the returned actor.
<clutter-actor>)Creates a new, non-default stage. A non-default stage is a new top-level actor which can be used as another container. It works exactly like the default stage, but while
clutter-stage-get-defaultwill always return the same instance, you will have to keep a pointer to any<clutter-stage>returned byclutter-stage-create.The ability to support multiple stages depends on the current backend. Use
clutter-feature-availableand ‘CLUTTER_FEATURE_STAGE_MULTIPLE’ to check at runtime whether a backend supports multiple stages.
- ret
- a new stage, or ‘
#f’ if the default backend does not support multiple stages. Useclutter-actor-destroyto programmatically close the returned stage.Since 0.8
<clutter-stage>) (ret bool)Checks if stage is the default stage, or an instance created using
clutter-stage-newbut internally using the same implementation.
- stage
- a
<clutter-stage>- ret
- ‘
#t’ if the passed stage is the default oneSince 0.8
<clutter-stage>) (color <clutter-color>)Set the stage color.
- stage
- A
<clutter-stage>- color
- A
<clutter-color>
<clutter-stage>) (color <clutter-color>)Retrieves the stage color.
- stage
- A
<clutter-stage>- color
- return location for a
<clutter-color>
<clutter-stage>)Asks to place the stage window in the fullscreen state. Note that you shouldn't assume the window is definitely full screen afterward, because other entities (e.g. the user or window manager) could unfullscreen it again, and not all window managers honor requests to fullscreen windows.
- stage
- a
<clutter-stage>
<clutter-stage>)Asks to toggle off the fullscreen state for the stage window. Note that you shouldn't assume the window is definitely not full screen afterward, because other entities (e.g. the user or window manager) could fullscreen it again, and not all window managers honor requests to unfullscreen windows.
- stage
- a
<clutter-stage>
<clutter-stage>)Shows the cursor on the stage window
- stage
- a
<clutter-stage>
<clutter-stage>)Makes the cursor invisible on the stage window
- stage
- a
<clutter-stage>Since 0.4
<clutter-stage>) (x int) (y int) (ret <clutter-actor>)Checks the scene at the coordinates x and y and returns a pointer to the
<clutter-actor>at those coordinates.
- stage
- a
<clutter-stage>- x
- X coordinate to check
- y
- Y coordinate to check
- ret
- the actor at the specified coordinates, if any
<clutter-stage>)This function essentially makes sure the right GL context is current for the passed stage. It is not intended to be used by applications.
- stage
- the
<clutter-stage>Since 0.8
<clutter-stage>)Queues a redraw for the passed stage.
Applications should call clutter-actor-queue-redrawand not this function.
- stage
- the
<clutter-stage>Since 0.8
<clutter-stage>) (event <clutter-event>) (ret bool)This function is used to emit an event on the main stage.
You should rarely need to use this function, except for synthetised events.
- stage
- a
<clutter-stage>- event
- a
<clutter-event>- ret
- the return value from the signal emission
Since 0.4
<clutter-stage>) (actor <clutter-actor>)Sets the key focus on actor. An actor with key focus will receive all the key events. If actor is ‘
#f’, the stage will receive focus.
- stage
- the
<clutter-stage>- actor
- the actor to set key focus to, or ‘
#f’Since 0.6
<clutter-stage>) (ret <clutter-actor>)Retrieves the actor that is currently under key focus.
- stage
- the
<clutter-stage>- ret
- the actor with key focus, or the stage
Since 0.6
<clutter-stage>) (ret double)Retrieves the resolution (in DPI) of the stage from the default backend.
- stage
- the
<clutter-stage>- ret
- the resolution of the stage
Since 0.6
<clutter-stage>) (fovy float) (aspect float) (z_near float) (z_far float)Sets the stage perspective.
- stage
- A
<clutter-stage>- fovy
- the field of view angle, in degrees, in the y direction
- aspect
- the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height)
- z-near
- the distance from the viewer to the near clipping plane (always positive)
- z-far
- the distance from the viewer to the far clipping plane (always positive)
Since 0.4
<clutter-stage>) (fovy float) (aspect float) (z_near float) (z_far float)Retrieves the stage perspective.
- stage
- A
<clutter-stage>- fovy
- return location for the field of view, in degrees, or ‘
#f’- aspect
- return location for the aspect ratio, or ‘
#f’- z-near
- return location for the distance of the viewer from the near clipping plane, or ‘
#f’- z-far
- return location for the distance of the viewer from the far clipping plane, or ‘
#f’Since 0.4
<clutter-stage>) (title mchars)Sets the stage title.
Since 0.4
- stage
- A
<clutter-stage>- title
- A utf8 string for the stage windows title.
<clutter-stage>) (ret mchars)Gets the stage title.
- stage
- A
<clutter-stage>- ret
- pointer to the title string for the stage. The returned string is owned by the actor and should not be modified or freed.
Since 0.4
<clutter-stage>) (resizable bool)Sets if the stage is resizable by user interaction (e.g. via window manager controls)
- stage
- a
<clutter-stage>- resizable
- whether the stage should be user resizable.
Since 0.4
<clutter-stage>) (ret bool)Retrieves the value set with
clutter-stage-set-user-resizable.
- stage
- a
<clutter-stage>- ret
- ‘
#t’ if the stage is resizable by the user.Since 0.4
<clutter-stage>) (fog bool)Sets whether the depth cueing effect on the stage should be enabled or not.
Depth cueing is a 3D effect that makes actors farther away from the viewing point less opaque, by fading them with the stage color.
The parameters of the GL fog used can be changed using the
clutter-stage-set-fogfunction.
- stage
- the
<clutter-stage>- fog
- ‘
#t’ for enabling the depth cueing effectSince 0.6
<clutter-stage>) (ret bool)Gets whether the depth cueing effect is enabled on stage.
- stage
- the
<clutter-stage>- ret
- ‘
#t’ if the the depth cueing effect is enabledSince 0.6
<clutter-stage>) (density double) (z_near double) (z_far double)Sets the GL fog settings used to create the depth cueing effect on the stage.
If the actors are all near the view point you will need a higher density and a smaller interval between z-near and z-far. On the other hand, if actors are placed far away from the view point you will need a lower density but a bigger interval between z-near and z-far.
- stage
- the
<clutter-stage>- density
- density of the intensity dampening
- z-near
- starting point of the depth cueing
- z-far
- ending point of the depth cueing
Since 0.6
<clutter-stage>) (density double) (z_near double) (z_far double)Retrieves the settings used by the GL fog to create the depth cueing effect on the stage.
- stage
- a
<clutter-stage>- density
- return location for the intensity dampening
- z-near
- return location for the starting point of the depth cueing
- z-far
- return location for the ending point of the depth cueing
Since 0.6