Trait clutter::StageExt[][src]

pub trait StageExt: 'static {
Show methods fn ensure_current(&self);
fn ensure_redraw(&self);
fn ensure_viewport(&self);
fn event(&self, event: &mut Event) -> bool;
fn get_accept_focus(&self) -> bool;
fn get_actor_at_pos(
        &self,
        pick_mode: PickMode,
        x: i32,
        y: i32
    ) -> Option<Actor>;
fn get_fullscreen(&self) -> bool;
fn get_key_focus(&self) -> Option<Actor>;
fn get_minimum_size(&self) -> (u32, u32);
fn get_motion_events_enabled(&self) -> bool;
fn get_no_clear_hint(&self) -> bool;
fn get_perspective(&self) -> Perspective;
fn get_redraw_clip_bounds(&self) -> RectangleInt;
fn get_throttle_motion_events(&self) -> bool;
fn get_title(&self) -> Option<GString>;
fn get_use_alpha(&self) -> bool;
fn get_user_resizable(&self) -> bool;
fn hide_cursor(&self);
fn set_accept_focus(&self, accept_focus: bool);
fn set_fullscreen(&self, fullscreen: bool);
fn set_key_focus<P: IsA<Actor>>(&self, actor: Option<&P>);
fn set_minimum_size(&self, width: u32, height: u32);
fn set_motion_events_enabled(&self, enabled: bool);
fn set_no_clear_hint(&self, no_clear: bool);
fn set_perspective(&self, perspective: &mut Perspective);
fn set_throttle_motion_events(&self, throttle: bool);
fn set_title(&self, title: &str);
fn set_use_alpha(&self, use_alpha: bool);
fn set_user_resizable(&self, resizable: bool);
fn show_cursor(&self);
fn get_property_cursor_visible(&self) -> bool;
fn set_property_cursor_visible(&self, cursor_visible: bool);
fn get_property_fullscreen_set(&self) -> bool;
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_after_paint<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_deactivate<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_delete_event<F: Fn(&Self, &Event) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_fullscreen<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_unfullscreen<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_accept_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_fullscreen_set_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_key_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_no_clear_hint_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_perspective_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_title_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_use_alpha_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_user_resizable_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}

Trait containing all Stage methods.

Implementors

Stage

Required methods

fn ensure_current(&self)[src]

This function essentially makes sure the right GL context is current for the passed stage. It is not intended to be used by applications.

fn ensure_redraw(&self)[src]

Ensures that self is redrawn

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

fn ensure_viewport(&self)[src]

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

This function will queue a redraw of self.

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

fn event(&self, event: &mut Event) -> bool[src]

This function is used to emit an event on the main stage.

You should rarely need to use this function, except for synthetised events.

event

a ClutterEvent

Returns

the return value from the signal emission

fn get_accept_focus(&self) -> bool[src]

Retrieves the value set with StageExt::set_accept_focus.

Returns

true if the Stage should accept focus, and false otherwise

fn get_actor_at_pos(&self, pick_mode: PickMode, x: i32, y: i32) -> Option<Actor>[src]

Checks the scene at the coordinates x and y and returns a pointer to the Actor at those coordinates.

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

pick_mode

how the scene graph should be painted

x

X coordinate to check

y

Y coordinate to check

Returns

the actor at the specified coordinates, if any

fn get_fullscreen(&self) -> bool[src]

Retrieves whether the stage is full screen or not

Returns

true if the stage is full screen

fn get_key_focus(&self) -> Option<Actor>[src]

Retrieves the actor that is currently under key focus.

Returns

the actor with key focus, or the stage

fn get_minimum_size(&self) -> (u32, u32)[src]

Retrieves the minimum size for a stage window as set using StageExt::set_minimum_size.

The returned size may not correspond to the actual minimum size and it is specific to the Stage implementation inside the Clutter backend

width

return location for the minimum width, in pixels, or None

height

return location for the minimum height, in pixels, or None

fn get_motion_events_enabled(&self) -> bool[src]

Retrieves the value set using StageExt::set_motion_events_enabled.

Returns

true if the per-actor motion event delivery is enabled and false otherwise

fn get_no_clear_hint(&self) -> bool[src]

Retrieves the hint set with StageExt::set_no_clear_hint

Returns

true if the stage should not clear itself on every paint cycle, and false otherwise

fn get_perspective(&self) -> Perspective[src]

Retrieves the stage perspective.

perspective

return location for a Perspective

fn get_redraw_clip_bounds(&self) -> RectangleInt[src]

Gets the bounds of the current redraw for self in stage pixel coordinates. E.g., if only a single actor has queued a redraw then Clutter may redraw the stage with a clip so that it doesn’t have to paint every pixel in the stage. This function would then return the bounds of that clip. An application can use this information to avoid some extra work if it knows that some regions of the stage aren’t going to be painted. This should only be called while the stage is being painted. If there is no current redraw clip then this function will set clip to the full extents of the stage.

clip

Return location for the clip bounds

fn get_throttle_motion_events(&self) -> bool[src]

Retrieves the value set with StageExt::set_throttle_motion_events

Returns

true if the motion events are being throttled, and false otherwise

fn get_title(&self) -> Option<GString>[src]

Gets the stage title.

Returns

pointer to the title string for the stage. The returned string is owned by the actor and should not be modified or freed.

fn get_use_alpha(&self) -> bool[src]

Retrieves the value set using StageExt::set_use_alpha

Returns

true if the stage should honour the opacity and the alpha channel of the stage color

fn get_user_resizable(&self) -> bool[src]

Retrieves the value set with StageExt::set_user_resizable.

Returns

true if the stage is resizable by the user.

fn hide_cursor(&self)[src]

Makes the cursor invisible on the stage window

fn set_accept_focus(&self, accept_focus: bool)[src]

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

This function should be called before showing self using ActorExt::show.

accept_focus

true to accept focus on show

fn set_fullscreen(&self, fullscreen: bool)[src]

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 Stage::fullscreen and Stage::unfullscreen signals, or use the notify signal for the Stage:fullscreen-set property

fullscreen

true to to set the stage fullscreen

fn set_key_focus<P: IsA<Actor>>(&self, actor: Option<&P>)[src]

Sets the key focus on actor. An actor with key focus will receive all the key events. If actor is None, the stage will receive focus.

actor

the actor to set key focus to, or None

fn set_minimum_size(&self, width: u32, height: u32)[src]

Sets the minimum size for a stage window, if the default backend uses Stage inside a window

This is a convenience function, and it is equivalent to setting the Actor:min-width and Actor:min-height on self

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

This function has no effect if self is fullscreen

width

width, in pixels

height

height, in pixels

fn set_motion_events_enabled(&self, enabled: bool)[src]

Sets whether per-actor motion events (and relative crossing events) should be disabled or not.

The default is true.

If enable is false the following signals will not be emitted by the actors children of self:

  • Actor::motion-event
  • Actor::enter-event
  • Actor::leave-event

The events will still be delivered to the Stage.

The main side effect of this function is that disabling the motion events will disable picking to detect the Actor underneath the pointer for each motion event. This is useful, for instance, when dragging a Actor across the self: the actor underneath the pointer is not going to change, so it’s meaningless to perform a pick.

enabled

true to enable the motion events delivery, and false otherwise

fn set_no_clear_hint(&self, no_clear: bool)[src]

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

Clearing the 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.

no_clear

true if the self should not clear itself on every repaint cycle

fn set_perspective(&self, perspective: &mut Perspective)[src]

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.

perspective

A Perspective

fn set_throttle_motion_events(&self, throttle: bool)[src]

Sets whether motion events received between redraws should be throttled or not. If motion events are throttled, those events received by the windowing system between redraws will be compressed so that only the last event will be propagated to the self and its actors.

This function should only be used if you want to have all the motion events delivered to your application code.

throttle

true to throttle motion events

fn set_title(&self, title: &str)[src]

Sets the stage title.

title

A utf8 string for the stage windows title.

fn set_use_alpha(&self, use_alpha: bool)[src]

Sets whether the self should honour the Actor:opacity and the alpha channel of the Stage:color

use_alpha

whether the stage should honour the opacity or the alpha channel of the stage color

fn set_user_resizable(&self, resizable: bool)[src]

Sets if the stage is resizable by user interaction (e.g. via window manager controls)

resizable

whether the stage should be user resizable.

fn show_cursor(&self)[src]

Shows the cursor on the stage window

fn get_property_cursor_visible(&self) -> bool[src]

Whether the mouse pointer should be visible

fn set_property_cursor_visible(&self, cursor_visible: bool)[src]

Whether the mouse pointer should be visible

fn get_property_fullscreen_set(&self) -> bool[src]

fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::activate signal is emitted when the stage receives key focus from the underlying window system.

fn connect_after_paint<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::after-paint signal is emitted after the stage is painted, but before the results are displayed on the screen.

fn connect_deactivate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::deactivate signal is emitted when the stage loses key focus from the underlying window system.

fn connect_delete_event<F: Fn(&Self, &Event) -> bool + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::delete-event signal is emitted when the user closes a Stage window using the window controls.

Clutter by default will call clutter_main_quit if stage is the default stage, and ActorExt::destroy for any other stage.

It is possible to override the default behaviour by connecting a new handler and returning true there.

This signal is emitted only on Clutter backends that embed Stage in native windows. It is not emitted for backends that use a static frame buffer.

event

a ClutterEvent of type EventType::Delete

fn connect_fullscreen<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::fullscreen signal is emitted when the stage is made fullscreen.

fn connect_unfullscreen<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]

The ::unfullscreen signal is emitted when the stage leaves a fullscreen state.

fn connect_property_accept_focus_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_cursor_visible_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_fullscreen_set_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_key_focus_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_no_clear_hint_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_perspective_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_title_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_use_alpha_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_user_resizable_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<Stage>> StageExt for O[src]

Loading content...