1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#[macro_use] extern crate bitflags;
extern crate crossbeam;
#[macro_use] extern crate dlib;
extern crate libc;
extern crate wayland_sys;
mod env;
mod events;
mod sys;
#[cfg(feature = "egl")]
pub mod egl;
#[cfg(feature = "cursor")]
pub mod cursor;
pub mod wayland;
use wayland_sys::client::wl_proxy;
use wayland_sys::common::wl_interface;
pub use events::{Event, EventIterator};
pub trait Proxy {
fn ptr(&self) -> *mut wl_proxy;
fn interface() -> *mut wl_interface;
fn interface_name() -> &'static str;
fn version() -> u32;
fn id(&self) -> ProxyId;
unsafe fn from_ptr(ptr: *mut wl_proxy) -> Self;
unsafe fn from_ptr_no_own(ptr: *mut wl_proxy) -> Self;
fn set_evt_iterator(&mut self, iter: &EventIterator);
}
#[derive(Copy,Clone,PartialEq,Eq,Debug,Hash)]
pub struct ProxyId { id: usize }
fn wrap_proxy(ptr: *mut wl_proxy) -> ProxyId {
ProxyId { id: ptr as usize}
}
pub fn is_available() -> bool {
::wayland_sys::client::is_lib_available()
}