Trait StageExt

Source
pub trait StageExt: 'static {
Show 48 methods // Required 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;
}
Expand description

Trait containing all Stage methods.

§Implementors

Stage

Required Methods§

Source

fn ensure_current(&self)

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

Source

fn ensure_redraw(&self)

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

Source

fn ensure_viewport(&self)

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

Source

fn event(&self, event: &mut Event) -> 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.

§event

a ClutterEvent

§Returns

the return value from the signal emission

Source

fn get_accept_focus(&self) -> bool

Retrieves the value set with StageExt::set_accept_focus.

§Returns

true if the Stage should accept focus, and false otherwise

Source

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

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

Source

fn get_fullscreen(&self) -> bool

Retrieves whether the stage is full screen or not

§Returns

true if the stage is full screen

Source

fn get_key_focus(&self) -> Option<Actor>

Retrieves the actor that is currently under key focus.

§Returns

the actor with key focus, or the stage

Source

fn get_minimum_size(&self) -> (u32, u32)

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

Source

fn get_motion_events_enabled(&self) -> bool

Retrieves the value set using StageExt::set_motion_events_enabled.

§Returns

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

Source

fn get_no_clear_hint(&self) -> bool

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

Source

fn get_perspective(&self) -> Perspective

Retrieves the stage perspective.

§perspective

return location for a Perspective

Source

fn get_redraw_clip_bounds(&self) -> RectangleInt

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

Source

fn get_throttle_motion_events(&self) -> bool

Retrieves the value set with StageExt::set_throttle_motion_events

§Returns

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

Source

fn get_title(&self) -> Option<GString>

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.

Source

fn get_use_alpha(&self) -> bool

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

Source

fn get_user_resizable(&self) -> bool

Retrieves the value set with StageExt::set_user_resizable.

§Returns

true if the stage is resizable by the user.

Source

fn hide_cursor(&self)

Makes the cursor invisible on the stage window

Source

fn set_accept_focus(&self, accept_focus: bool)

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

Source

fn set_fullscreen(&self, fullscreen: bool)

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

Source

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

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

Source

fn set_minimum_size(&self, width: u32, height: u32)

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

Source

fn set_motion_events_enabled(&self, enabled: bool)

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

Source

fn set_no_clear_hint(&self, no_clear: bool)

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

Source

fn set_perspective(&self, perspective: &mut 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.

§perspective

A Perspective

Source

fn set_throttle_motion_events(&self, throttle: bool)

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

Source

fn set_title(&self, title: &str)

Sets the stage title.

§title

A utf8 string for the stage windows title.

Source

fn set_use_alpha(&self, use_alpha: bool)

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

Source

fn set_user_resizable(&self, resizable: bool)

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

§resizable

whether the stage should be user resizable.

Source

fn show_cursor(&self)

Shows the cursor on the stage window

Source

fn get_property_cursor_visible(&self) -> bool

Whether the mouse pointer should be visible

Source

fn set_property_cursor_visible(&self, cursor_visible: bool)

Whether the mouse pointer should be visible

Source

fn get_property_fullscreen_set(&self) -> bool

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<O: IsA<Stage>> StageExt for O