Trait wlc::Callback
[−]
[src]
pub trait Callback { fn output_created(&mut self, output: &Output) -> bool { ... } fn output_destroyed(&mut self, output: &Output) { ... } fn output_focus(&mut self, output: &Output, focus: bool) { ... } fn output_resolution(&mut self, output: &Output, from: Size, to: Size) { ... } fn output_render_pre(&mut self, output: &Output) { ... } fn output_render_post(&mut self, output: &Output) { ... } fn output_context_created(&mut self, output: &Output) { ... } fn output_context_destroyed(&mut self, output: &Output) { ... } fn view_created(&mut self, view: &View) -> bool { ... } fn view_destroyed(&mut self, view: &View) { ... } fn view_focus(&mut self, view: &View, focus: bool) { ... } fn view_move_to_output(&mut self, view: &View, from: &Output, to: &Output) { ... } fn view_request_geometry(&mut self, view: &View, geometry: Geometry) { ... } fn view_request_state(&mut self, view: &View, state: Flags, toggle: bool) { ... } fn view_request_move(&mut self, view: &View, origin: Point) { ... } fn view_request_resize(&mut self, view: &View, edges: Flags, origin: Point) { ... } fn view_render_pre(&mut self, view: &View) { ... } fn view_render_post(&mut self, view: &View) { ... } fn view_properties_updated(&mut self, view: &View, mask: Flags) { ... } fn keyboard_key(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
key: Key,
state: KeyState
) -> bool { ... } fn pointer_button(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
button: Button,
state: ButtonState,
origin: Point
) -> bool { ... } fn pointer_scroll(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
axis: Flags,
amount: [f64; 2]
) -> bool { ... } fn pointer_motion(
&mut self,
view: Option<&View>,
time: u32,
origin: Point
) -> bool { ... } fn touch(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
touch_type: TouchType,
slot: i32,
origin: Point
) -> bool { ... } fn compositor_ready(&mut self) { ... } fn compositor_terminate(&mut self) { ... } }
Entry point for your code
Implementing Callback
and passing it to wlc::init
allows you to interact
with wlc. The compositor will call you, when any events happens with the
appropriate function.
Provided Methods
fn output_created(&mut self, output: &Output) -> bool
Output was created.
Return false
if you want to destroy the output
(e.g. failed to allocate data related to output)
Note
This is not necessarily the first function called on a new output. No order is guaranteed
fn output_destroyed(&mut self, output: &Output)
Output was destroyed
fn output_focus(&mut self, output: &Output, focus: bool)
Output got or lost focus
fn output_resolution(&mut self, output: &Output, from: Size, to: Size)
Output resolution changed
fn output_render_pre(&mut self, output: &Output)
Output pre render hook
fn output_render_post(&mut self, output: &Output)
Output post render hook
fn output_context_created(&mut self, output: &Output)
Output context is created.
This generally happens on startup and when current tty changes
fn output_context_destroyed(&mut self, output: &Output)
Output context was destroyed
fn view_created(&mut self, view: &View) -> bool
View was created.
Return false
if you want to destroy the view
(e.g. failed to allocate data related to view)
Note
This is not necessarily the first function called on a new view. No order is guaranteed
fn view_destroyed(&mut self, view: &View)
View was destroyed
fn view_focus(&mut self, view: &View, focus: bool)
View got or lost focus
fn view_move_to_output(&mut self, view: &View, from: &Output, to: &Output)
View was moved to output
fn view_request_geometry(&mut self, view: &View, geometry: Geometry)
Request to set given geometry for view.
Apply using view.set_geometry
to agree
fn view_request_state(&mut self, view: &View, state: Flags, toggle: bool)
Request to disable or enable the given state for view.
Apply using view.set_state
to agree
fn view_request_move(&mut self, view: &View, origin: Point)
Request to move itself.
Start an interactive move to agree
fn view_request_resize(&mut self, view: &View, edges: Flags, origin: Point)
Request to resize itself with the given edges.
Start a interactive resize to agree
fn view_render_pre(&mut self, view: &View)
View pre render hook
fn view_render_post(&mut self, view: &View)
View post render hook
fn view_properties_updated(&mut self, view: &View, mask: Flags)
View properties (title, class, app_id) were updated
fn keyboard_key(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
key: Key,
state: KeyState
) -> bool
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
key: Key,
state: KeyState
) -> bool
Key event was triggered, view handle will be zero if there was no focus.
Return true to prevent sending the event to clients
Button event was triggered, view handle will be None
if there was no
focus.
Return true to prevent sending the event to clients
fn pointer_scroll(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
axis: Flags,
amount: [f64; 2]
) -> bool
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
axis: Flags,
amount: [f64; 2]
) -> bool
Scroll event was triggered, view handle will be None
if there was no
focus.
Return true to prevent sending the event to clients
fn pointer_motion(
&mut self,
view: Option<&View>,
time: u32,
origin: Point
) -> bool
&mut self,
view: Option<&View>,
time: u32,
origin: Point
) -> bool
Motion event was triggered, view handle will be None
if there was no
focus.
Apply with pointer::set_position()
to agree.
Return true
to prevent sending the event to clients
fn touch(
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
touch_type: TouchType,
slot: i32,
origin: Point
) -> bool
&mut self,
view: Option<&View>,
time: u32,
modifiers: Modifiers,
touch_type: TouchType,
slot: i32,
origin: Point
) -> bool
Touch event was triggered, view handle will be None
if there was no
focus.
Return true
to prevent sending the event to clients
fn compositor_ready(&mut self)
Compositor is ready to accept clients
fn compositor_terminate(&mut self)
Compositor is about to terminate