Skip to content

Commit

Permalink
Merge pull request #75 from mahkoh/jorth/shm2
Browse files Browse the repository at this point in the history
wayland: implement wl_shm v2
  • Loading branch information
mahkoh authored Feb 6, 2024
2 parents 8bac01c + 3d51969 commit 19bd17c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ifs/wl_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ impl WlShm {
self.client.add_client_obj(&pool)?;
Ok(())
}

fn release(&self, parser: MsgParser<'_, '_>) -> Result<(), WlShmError> {
let _req: Release = self.client.parse(self, parser)?;
self.client.remove_obj(self)?;
Ok(())
}
}

global_base!(WlShmGlobal, WlShm, WlShmError);
Expand All @@ -81,7 +87,7 @@ impl Global for WlShmGlobal {
}

fn version(&self) -> u32 {
1
2
}
}

Expand All @@ -91,11 +97,12 @@ object_base! {
WlShm;

CREATE_POOL => create_pool,
RELEASE => release,
}

impl Object for WlShm {
fn num_requests(&self) -> u32 {
CREATE_POOL + 1
RELEASE + 1
}
}

Expand Down
3 changes: 3 additions & 0 deletions wire/wl_shm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ msg create_pool = 0 {
size: i32,
}

msg release = 1 {
}

# events

msg format = 0 {
Expand Down

0 comments on commit 19bd17c

Please sign in to comment.