1
0
Fork 0
forked from wry/wry

autocommit 2022-01-04 15:30:21 CET

This commit is contained in:
Julian Orth 2022-01-04 15:30:21 +01:00
parent 30376c595c
commit cbbc41a463
40 changed files with 725 additions and 189 deletions

View file

@ -11,6 +11,8 @@ pub const WL_DISPLAY_ID: ObjectId = ObjectId(1);
pub struct ObjectId(u32);
impl ObjectId {
pub const NONE: Self = ObjectId(0);
pub fn from_raw(raw: u32) -> Self {
Self(raw)
}
@ -38,6 +40,7 @@ pub trait Object: ObjectHandleRequest + 'static {
fn id(&self) -> ObjectId;
fn interface(&self) -> Interface;
fn num_requests(&self) -> u32;
fn break_loops(&self) {}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@ -57,6 +60,7 @@ pub enum Interface {
XdgPopup,
XdgToplevel,
WlRegion,
WlBuffer,
}
impl Interface {
@ -77,6 +81,7 @@ impl Interface {
Interface::XdgPositioner => "xdg_positioner",
Interface::XdgPopup => "xdg_popup",
Interface::XdgToplevel => "xdg_toplevel",
Interface::WlBuffer => "wl_buffer",
}
}
}