Trait ux::StageExt [−][src]
pub trait StageExt: 'static {}Show methods
pub fn ensure_current(&self); pub fn ensure_redraw(&self); pub fn ensure_viewport(&self); pub fn event(&self, event: &mut Event) -> bool; pub fn get_accept_focus(&self) -> bool; pub fn get_actor_at_pos(
&self,
pick_mode: PickMode,
x: i32,
y: i32
) -> Option<Actor>; pub fn get_fullscreen(&self) -> bool; pub fn get_key_focus(&self) -> Option<Actor>; pub fn get_minimum_size(&self) -> (u32, u32); pub fn get_motion_events_enabled(&self) -> bool; pub fn get_no_clear_hint(&self) -> bool; pub fn get_perspective(&self) -> Perspective; pub fn get_redraw_clip_bounds(&self) -> RectangleInt; pub fn get_throttle_motion_events(&self) -> bool; pub fn get_title(&self) -> Option<GString>; pub fn get_use_alpha(&self) -> bool; pub fn get_user_resizable(&self) -> bool; pub fn hide_cursor(&self); pub fn set_accept_focus(&self, accept_focus: bool); pub fn set_fullscreen(&self, fullscreen: bool); pub fn set_key_focus<P>(&self, actor: Option<&P>)
where
P: IsA<Actor>; pub fn set_minimum_size(&self, width: u32, height: u32); pub fn set_motion_events_enabled(&self, enabled: bool); pub fn set_no_clear_hint(&self, no_clear: bool); pub fn set_perspective(&self, perspective: &mut Perspective); pub fn set_throttle_motion_events(&self, throttle: bool); pub fn set_title(&self, title: &str); pub fn set_use_alpha(&self, use_alpha: bool); pub fn set_user_resizable(&self, resizable: bool); pub fn show_cursor(&self); pub fn get_property_cursor_visible(&self) -> bool; pub fn set_property_cursor_visible(&self, cursor_visible: bool); pub fn get_property_fullscreen_set(&self) -> bool; pub fn connect_activate<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_after_paint<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_deactivate<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_delete_event<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self, &Event) -> bool; pub fn connect_fullscreen<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_unfullscreen<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_accept_focus_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_cursor_visible_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_fullscreen_set_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_key_focus_notify<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_no_clear_hint_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_perspective_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_title_notify<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_use_alpha_notify<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Fn(&Self); pub fn connect_property_user_resizable_notify<F>(
&self,
f: F
) -> SignalHandlerId
where
F: 'static + Fn(&Self);
Required methods
pub 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.
pub 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+.
pub 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+.
pub 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 Event
Returns
the return value from the signal emission
pub 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
pub fn get_actor_at_pos(
&self,
pick_mode: PickMode,
x: i32,
y: i32
) -> Option<Actor>
[src]
&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
pub fn get_fullscreen(&self) -> bool
[src]
pub 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
pub 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
backend
width
return location for the minimum width, in pixels,
or None
height
return location for the minimum height, in pixels,
or None
pub 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
pub 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
pub fn get_perspective(&self) -> Perspective
[src]
pub 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
it 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
pub 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
pub 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.
pub 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
pub 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.
pub fn hide_cursor(&self)
[src]
Makes the cursor invisible on the stage window
pub 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
pub 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
pub fn set_key_focus<P>(&self, actor: Option<&P>) where
P: IsA<Actor>,
[src]
P: IsA<Actor>,
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
pub 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
pub 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
pub 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; it 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
pub fn set_perspective(&self, perspective: &mut Perspective)
[src]
Sets the stage perspective. Using this function is not recommended because it will disable it’s attempts to generate an appropriate perspective based on the size of the stage.
perspective
A Perspective
pub 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
pub fn set_title(&self, title: &str)
[src]
pub 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
pub 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.
pub fn show_cursor(&self)
[src]
Shows the cursor on the stage window
pub fn get_property_cursor_visible(&self) -> bool
[src]
Whether the mouse pointer should be visible
pub fn set_property_cursor_visible(&self, cursor_visible: bool)
[src]
Whether the mouse pointer should be visible
pub fn get_property_fullscreen_set(&self) -> bool
[src]
pub fn connect_activate<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
The ::activate signal is emitted when the stage receives key focus from the underlying window system.
pub fn connect_after_paint<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
The ::after-paint signal is emitted after the stage is painted, but before the results are displayed on the screen.
pub fn connect_deactivate<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
The ::deactivate signal is emitted when the stage loses key focus from the underlying window system.
pub fn connect_delete_event<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self, &Event) -> bool,
[src]
F: 'static + Fn(&Self, &Event) -> bool,
The ::delete-event signal is emitted when the user closes a
Stage
window using the window controls.
by default will call 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 backends that
embed Stage
in native windows. It is not emitted for
backends that use a static frame buffer.
event
a Event
of type EventType::Delete
pub fn connect_fullscreen<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
The ::fullscreen signal is emitted when the stage is made fullscreen.
pub fn connect_unfullscreen<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
The ::unfullscreen signal is emitted when the stage leaves a fullscreen state.
pub fn connect_property_accept_focus_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_cursor_visible_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_fullscreen_set_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_key_focus_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_no_clear_hint_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_perspective_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_title_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_use_alpha_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
pub fn connect_property_user_resizable_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&Self),
[src]
F: 'static + Fn(&Self),
Implementors
impl<O> StageExt for O where
O: IsA<Stage>,
[src]
impl<O> StageExt for O where
O: IsA<Stage>,
[src]pub fn ensure_current(&self)
[src]
pub fn ensure_redraw(&self)
[src]
pub fn ensure_viewport(&self)
[src]
pub fn event(&self, event: &mut Event) -> bool
[src]
pub fn get_accept_focus(&self) -> bool
[src]
pub fn get_actor_at_pos(
&self,
pick_mode: PickMode,
x: i32,
y: i32
) -> Option<Actor>
[src]
&self,
pick_mode: PickMode,
x: i32,
y: i32
) -> Option<Actor>
pub fn get_fullscreen(&self) -> bool
[src]
pub fn get_key_focus(&self) -> Option<Actor>
[src]
pub fn get_minimum_size(&self) -> (u32, u32)
[src]
pub fn get_motion_events_enabled(&self) -> bool
[src]
pub fn get_no_clear_hint(&self) -> bool
[src]
pub fn get_perspective(&self) -> Perspective
[src]
pub fn get_redraw_clip_bounds(&self) -> RectangleInt
[src]
pub fn get_throttle_motion_events(&self) -> bool
[src]
pub fn get_title(&self) -> Option<GString>
[src]
pub fn get_use_alpha(&self) -> bool
[src]
pub fn get_user_resizable(&self) -> bool
[src]
pub fn hide_cursor(&self)
[src]
pub fn set_accept_focus(&self, accept_focus: bool)
[src]
pub fn set_fullscreen(&self, fullscreen: bool)
[src]
pub fn set_key_focus<P>(&self, actor: Option<&P>) where
P: IsA<Actor>,
[src]
P: IsA<Actor>,
pub fn set_minimum_size(&self, width: u32, height: u32)
[src]
pub fn set_motion_events_enabled(&self, enabled: bool)
[src]
pub fn set_no_clear_hint(&self, no_clear: bool)
[src]
pub fn set_perspective(&self, perspective: &mut Perspective)
[src]
pub fn set_throttle_motion_events(&self, throttle: bool)
[src]
pub fn set_title(&self, title: &str)
[src]
pub fn set_use_alpha(&self, use_alpha: bool)
[src]
pub fn set_user_resizable(&self, resizable: bool)
[src]
pub fn show_cursor(&self)
[src]
pub fn get_property_cursor_visible(&self) -> bool
[src]
pub fn set_property_cursor_visible(&self, cursor_visible: bool)
[src]
pub fn get_property_fullscreen_set(&self) -> bool
[src]
pub fn connect_activate<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_after_paint<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_deactivate<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_delete_event<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O, &Event) -> bool,
[src]
F: 'static + Fn(&O, &Event) -> bool,
pub fn connect_fullscreen<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_unfullscreen<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_accept_focus_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_cursor_visible_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_fullscreen_set_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_key_focus_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_no_clear_hint_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_perspective_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_title_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_use_alpha_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),
pub fn connect_property_user_resizable_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O),
[src]
F: 'static + Fn(&O),