[][src]Crate wayland_sys

FFI bindings to the wayland system libraries.

The names exported by this crate should not be used directly, but through the ffi_dispatch macro, like this:

This example is not tested
ffi_dispatch!(HANDLE_NAME, func_name, arg1, arg2, arg3);

Where HANDLE_NAME is the name of the handle generated if the cargo feature dlopen is on.

For this to work, you must ensure every needed symbol is in scope (aka the static handle if dlopen is on, the extern function if not). The easiest way to do this is to glob import the appropriate module. For example:

This example is not tested
#[macro_use] extern crate wayland_sys;

use wayland_sys::client::*;

let display_ptr = unsafe {
        ffi_dispatch!(WAYLAND_CLIENT_HANDLE, wl_display_connect, ::std::ptr::null())
};

Each module except common corresponds to a system library. They all define a function named is_lib_available() which returns whether the library could be loaded. They always return true if the feature dlopen is absent, as we link against the library directly in that case.

Modules

client

Bindings to the client library libwayland-client.so

common

Various types and functions that are used by both the client and the server libraries.

egl

Bindings to the EGL library libwayland-egl.so

server

Bindings to the client library libwayland-server.so

Macros

ffi_dispatch

Statics

RUST_MANAGED

Magic static for wayland objects managed by wayland-client or wayland-server