autocommit 2022-01-02 15:13:33 CET
This commit is contained in:
commit
d6172b273f
50 changed files with 5807 additions and 0 deletions
80
src/ifs/wl_subcompositor/mod.rs
Normal file
80
src/ifs/wl_subcompositor/mod.rs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
mod types;
|
||||
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::objects::{Interface, Object, ObjectError, ObjectId};
|
||||
use crate::utils::buffd::WlParser;
|
||||
use crate::wl_client::WlClientData;
|
||||
use std::rc::Rc;
|
||||
pub use types::*;
|
||||
|
||||
pub struct WlSubcompositorGlobal {
|
||||
name: GlobalName,
|
||||
}
|
||||
|
||||
pub struct WlSubcompositorObj {
|
||||
global: Rc<WlSubcompositorGlobal>,
|
||||
id: ObjectId,
|
||||
}
|
||||
|
||||
impl WlSubcompositorGlobal {
|
||||
pub fn new(name: GlobalName) -> Self {
|
||||
Self { name }
|
||||
}
|
||||
|
||||
async fn bind_(
|
||||
self: Rc<Self>,
|
||||
id: ObjectId,
|
||||
client: &WlClientData,
|
||||
_version: u32,
|
||||
) -> Result<(), WlSubcompositorError> {
|
||||
let obj = Rc::new(WlSubcompositorObj { global: self, id });
|
||||
client.attach_client_object(obj)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl WlSubcompositorObj {
|
||||
async fn handle_request_(
|
||||
&self,
|
||||
request: u32,
|
||||
parser: WlParser<'_, '_>,
|
||||
) -> Result<(), ObjectError> {
|
||||
unreachable!();
|
||||
}
|
||||
}
|
||||
|
||||
bind!(WlSubcompositorGlobal);
|
||||
|
||||
impl Global for WlSubcompositorGlobal {
|
||||
fn name(&self) -> GlobalName {
|
||||
self.name
|
||||
}
|
||||
|
||||
fn interface(&self) -> Interface {
|
||||
Interface::WlSubcompositor
|
||||
}
|
||||
|
||||
fn version(&self) -> u32 {
|
||||
1
|
||||
}
|
||||
|
||||
fn pre_remove(&self) {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
handle_request!(WlSubcompositorObj);
|
||||
|
||||
impl Object for WlSubcompositorObj {
|
||||
fn id(&self) -> ObjectId {
|
||||
self.id
|
||||
}
|
||||
|
||||
fn interface(&self) -> Interface {
|
||||
Interface::WlSubcompositor
|
||||
}
|
||||
|
||||
fn num_requests(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue