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

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

Output was destroyed

Output got or lost focus

Output resolution changed

Output pre render hook

Output post render hook

Output context is created.

This generally happens on startup and when current tty changes

Output context was destroyed

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

View was destroyed

View got or lost focus

View was moved to output

Request to set given geometry for view.

Apply using view.set_geometry to agree

Request to disable or enable the given state for view.

Apply using view.set_state to agree

Request to move itself.

Start an interactive move to agree

Request to resize itself with the given edges.

Start a interactive resize to agree

View pre render hook

View post render hook

View properties (title, class, app_id) were updated

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

Scroll event was triggered, view handle will be None if there was no focus.

Return true to prevent sending the event to clients

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

Touch event was triggered, view handle will be None if there was no focus.

Return true to prevent sending the event to clients

Compositor is ready to accept clients

Compositor is about to terminate

Implementors