1
0
Fork 0
forked from wry/wry

autocommit 2022-01-28 03:35:35 CET

This commit is contained in:
Julian Orth 2022-01-28 03:35:35 +01:00
parent c340df0d08
commit a5573b8a3a
36 changed files with 3046 additions and 114 deletions

View file

@ -1,6 +1,7 @@
mod types;
use crate::client::Client;
use crate::format::FORMATS;
use crate::globals::{Global, GlobalName};
use crate::ifs::wl_shm_pool::WlShmPool;
use crate::object::{Interface, Object, ObjectId};
@ -41,7 +42,7 @@ impl WlShmGlobal {
client: client.clone(),
});
client.add_client_obj(&obj)?;
for &format in client.state.formats.values() {
for format in FORMATS {
client.event(Box::new(FormatE {
obj: obj.clone(),
format,

View file

@ -65,7 +65,8 @@ pub(super) struct FormatE {
}
impl EventFormatter for FormatE {
fn format(self: Box<Self>, fmt: &mut MsgFormatter<'_>) {
fmt.header(self.obj.id, FORMAT).uint(self.format.id);
fmt.header(self.obj.id, FORMAT)
.uint(self.format.wl_id.unwrap_or(self.format.drm));
}
fn obj(&self) -> &dyn Object {
&*self.obj
@ -76,7 +77,8 @@ impl Debug for FormatE {
write!(
f,
"format(format: \"{}\" (0x{:x}))",
self.format.name, self.format.id
self.format.name,
self.format.wl_id.unwrap_or(self.format.drm),
)
}
}