Next: , Previous: ClutterSnapConstraint, Up: Top


62 ClutterStage

Top level visual element to which actors are placed.

62.1 Overview

<clutter-stage> is a top level 'window' on which child actors are placed and manipulated.

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.

62.2 Usage

— Function: clutter-stage-new ⇒  (ret <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-default will always return the same instance, you will have to keep a pointer to any <clutter-stage> returned by clutter-stage-new.

The ability to support multiple stages depends on the current backend. Use clutter-feature-available and ‘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. Use clutter-actor-destroy to programmatically close the returned stage.

Since 0.8

— Function: clutter-stage-set-fullscreen (self <clutter-stage>) (fullscreen bool)
— Method: set-fullscreen

Asks to place the stage window in the fullscreen or unfullscreen states.

( 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.

If you want to receive notification of the fullscreen state you should either use the <"fullscreen"> and <"unfullscreen"> signals, or use the notify signal for the <"fullscreen-set"> property

stage
a <clutter-stage>
fullscreen
#t’ to to set the stage fullscreen

Since 1.0

— Function: clutter-stage-get-fullscreen (self <clutter-stage>) ⇒  (ret bool)
— Method: get-fullscreen

Retrieves whether the stage is full screen or not

stage
a <clutter-stage>
ret
#t’ if the stage is full screen

Since 1.0

— Function: clutter-stage-show-cursor (self <clutter-stage>)
— Method: show-cursor

Shows the cursor on the stage window

stage
a <clutter-stage>
— Function: clutter-stage-hide-cursor (self <clutter-stage>)
— Method: hide-cursor

Makes the cursor invisible on the stage window

stage
a <clutter-stage>

Since 0.4

— Function: clutter-stage-get-actor-at-pos (self <clutter-stage>) (pick_mode <clutter-pick-mode>) (int) (int) ⇒  (ret <clutter-actor>)
— Method: get-actor-at-pos

Checks the scene at the coordinates x and y and returns a pointer to the <clutter-actor> at those coordinates.

By using pick-mode it is possible to control which actors will be painted and thus available.

stage
a <clutter-stage>
pick-mode
how the scene graph should be painted
x
X coordinate to check
y
Y coordinate to check
ret
the actor at the specified coordinates, if any.
— Function: clutter-stage-ensure-current (self <clutter-stage>)
— Method: ensure-current

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

— Function: clutter-stage-ensure-viewport (self <clutter-stage>)
— Method: ensure-viewport

Ensures that the GL viewport is updated with the current stage window size.

This function will queue a redraw of stage.

This function should not be called by applications; it is used when embedding a <clutter-stage> into a toolkit with another windowing system, like GTK+.

stage
a <clutter-stage>

Since 1.0

— Function: clutter-stage-ensure-redraw (self <clutter-stage>)
— Method: ensure-redraw

Ensures that stage is redrawn

This function should not be called by applications: it is used when embedding a <clutter-stage> into a toolkit with another windowing system, like GTK+.

stage
a <clutter-stage>

Since 1.0

— Function: clutter-stage-event (self <clutter-stage>) (event <clutter-event>) ⇒  (ret bool)
— Method: event

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

— Function: clutter-stage-set-key-focus (self <clutter-stage>) (actor <clutter-actor>)
— Method: set-key-focus

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

— Function: clutter-stage-get-key-focus (self <clutter-stage>) ⇒  (ret <clutter-actor>)
— Method: get-key-focus

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

— Function: clutter-stage-set-use-alpha (self <clutter-stage>) (use_alpha bool)
— Method: set-use-alpha

Sets whether the stage should honour the <"opacity"> and the alpha channel of the <"color">

stage
a <clutter-stage>
use-alpha
whether the stage should honour the opacity or the alpha channel of the stage color

Since 1.2

— Function: clutter-stage-get-use-alpha (self <clutter-stage>) ⇒  (ret bool)
— Method: get-use-alpha

Retrieves the value set using clutter-stage-set-use-alpha

stage
a <clutter-stage>
ret
#t’ if the stage should honour the opacity and the alpha channel of the stage color

Since 1.2

— Function: clutter-stage-set-minimum-size (self <clutter-stage>) (width unsigned-int) (height unsigned-int)
— Method: set-minimum-size

Sets the minimum size for a stage window, if the default backend uses <clutter-stage> inside a window

This is a convenience function, and it is equivalent to setting the <"min-width"> and <"min-height"> on stage

If the current size of stage is smaller than the minimum size, the stage will be resized to the new width and height

This function has no effect if stage is fullscreen

stage
a <clutter-stage>
width
width, in pixels
height
height, in pixels

Since 1.2

— Function: clutter-stage-get-minimum-size (self <clutter-stage>) ⇒  (width unsigned-int) (height unsigned-int)
— Method: get-minimum-size

Retrieves the minimum size for a stage window as set using clutter-stage-set-minimum-size.

The returned size may not correspond to the actual minimum size and it is specific to the <clutter-stage> implementation inside the Clutter backend

stage
a <clutter-stage>
width
return location for the minimum width, in pixels, or ‘#f’.
height
return location for the minimum height, in pixels, or ‘#f’.

Since 1.2

— Function: clutter-stage-set-no-clear-hint (self <clutter-stage>) (no_clear bool)
— Method: set-no-clear-hint

Sets whether the stage should clear itself at the beginning of each paint cycle or not.

Clearing the <clutter-stage> can be a costly operation, especially if the stage is always covered - for instance, in a full-screen video player or in a game with a background texture.

This setting is a hint; Clutter might discard this hint depending on its internal state.

If parts of the stage are visible and you disable clearing you might end up with visual artifacts while painting the contents of the stage.

stage
a <clutter-stage>
no-clear
#t’ if the stage should not clear itself on every repaint cycle

Since 1.4

— Function: clutter-stage-get-no-clear-hint (self <clutter-stage>) ⇒  (ret bool)
— Method: get-no-clear-hint

Retrieves the hint set with clutter-stage-set-no-clear-hint

stage
a <clutter-stage>
ret
#t’ if the stage should not clear itself on every paint cycle, and ‘#f’ otherwise

Since 1.4

— Function: clutter-stage-set-accept-focus (self <clutter-stage>) (accept_focus bool)
— Method: set-accept-focus

Sets whether the stage should accept the key focus when shown.

This function should be called before showing stage using clutter-actor-show.

stage
a <clutter-stage>
accept-focus
#t’ to accept focus on show

Since 1.6

— Function: clutter-stage-get-accept-focus (self <clutter-stage>) ⇒  (ret bool)
— Method: get-accept-focus

Retrieves the value set with clutter-stage-set-accept-focus.

stage
a <clutter-stage>
ret
#t’ if the <clutter-stage> should accept focus, and ‘#f’ otherwise

Since 1.6

— Function: clutter-stage-set-perspective (self <clutter-stage>) (perspective <clutter-perspective>)
— Method: set-perspective

Sets the stage perspective. Using this function is not recommended because it will disable Clutter's attempts to generate an appropriate perspective based on the size of the stage.

stage
A <clutter-stage>
perspective
A <clutter-perspective>
— Function: clutter-stage-get-perspective (self <clutter-stage>) ⇒  (ret scm)
— Method: get-perspective

Retrieves the stage perspective.

stage
A <clutter-stage>
perspective
return location for a <clutter-perspective>.
— Function: clutter-stage-set-title (self <clutter-stage>) (title mchars)
— Method: set-title

Sets the stage title.

stage
A <clutter-stage>
title
A utf8 string for the stage windows title.

Since 0.4

— Function: clutter-stage-get-title (self <clutter-stage>) ⇒  (ret mchars)
— Method: get-title

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

— Function: clutter-stage-set-user-resizable (self <clutter-stage>) (resizable bool)
— Method: set-user-resizable

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

— Function: clutter-stage-get-user-resizable (self <clutter-stage>) ⇒  (ret bool)
— Method: get-user-resizable

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