Crate wlc [] [src]

This crate provides idomatic and safe bindings to wlc

wlc provides basic functionality to write a wayland compositor.

Start your compositor by calling wlc::init with any struct implementing wlc::Callback. Handle wlc::View and wlc::Output references in your Callback struct to customize your compositor.

Example

use wlc::*;

struct Compositor;
impl Callback for Compositor
{
    fn view_created(&mut self, view: &View) -> bool
    {
        view.set_visibility(view.output().visibility());
        view.bring_to_front();
        view.focus();
        true
    }

    fn view_focus(&mut self, view: &View, focus: bool)
    {
        view.set_state(ViewState::Activated, focus);
    }
}

fn main()
{
    let _wlc = wlc::init(Compositor).unwrap();
    //_wlc goes out of scope and stars running until it terminates
}

Modules

Anchor

View Positioner Anchor

ConstraintAdjustment

View Positioner Adjustments when View is constraint

Gravity

View Positioner Gravity

Led

Keyboard LEDs

Modifier

Set of modifiers on a keyboard

ResizeEdge

Edges for interactive resizing

ScrollAxis

Scroll Axes

ViewPropertyUpdate

Updated properties of a view

ViewState

States a View may hold

ViewType

Typical view categories

Visibility

Visibility Flags Useful to implement workspace functionality or simply hiding views

event_loop

Exposed functionality of wlc's underlying run loop

input

Experimental Input API

Structs

Geometry
Modifiers

Combined keyboard Modifiers and LEDs

Output

An Output managed by Wlc

Point
Positioner

A Positioner of a View managed by Wlc

Size
View

A View managed by Wlc

WeakOutput

Weak reference to an output

WeakView

Weak reference to a view

Wlc

Initialized compositor

Enums

BackendType

Backend used by wlc

Button
ButtonState

States of a button

Error

Error representing the failure to start the Compositor

Key
KeyState

States of a key

TouchType

Touch events

Traits

Callback

Entry point for your code

Handle

Assiciated user-provided data

Functions

get_backend_type

Gets the currently active Backend

init

Initialize Wlc. Returns wlc::Error on failure.

terminate

Terminates the currently active wlc Compositor