1
0
Fork 0
forked from wry/wry

autocommit 2022-01-25 16:45:44 CET

This commit is contained in:
Julian Orth 2022-01-25 16:45:44 +01:00
parent 0336bf3bde
commit c340df0d08
59 changed files with 3085 additions and 1710 deletions

View file

@ -1,6 +1,6 @@
mod types;
use crate::client::{AddObj, Client};
use crate::client::Client;
use crate::globals::{Global, GlobalName};
use crate::ifs::wl_data_device::WlDataDevice;
use crate::ifs::wl_data_source::WlDataSource;
@ -37,7 +37,7 @@ impl WlDataDeviceManagerGlobal {
Self { name }
}
async fn bind_(
fn bind_(
self: Rc<Self>,
id: WlDataDeviceManagerId,
client: &Rc<Client>,
@ -53,31 +53,28 @@ impl WlDataDeviceManagerGlobal {
}
impl WlDataDeviceManagerObj {
async fn create_data_source(
&self,
parser: MsgParser<'_, '_>,
) -> Result<(), CreateDataSourceError> {
fn create_data_source(&self, parser: MsgParser<'_, '_>) -> Result<(), CreateDataSourceError> {
let req: CreateDataSource = self.client.parse(self, parser)?;
let res = Rc::new(WlDataSource::new(req.id, &self.client));
self.client.add_client_obj(&res)?;
Ok(())
}
async fn get_data_device(&self, parser: MsgParser<'_, '_>) -> Result<(), GetDataDeviceError> {
fn get_data_device(&self, parser: MsgParser<'_, '_>) -> Result<(), GetDataDeviceError> {
let req: GetDataDevice = self.client.parse(self, parser)?;
let res = Rc::new(WlDataDevice::new(req.id, &self.client));
self.client.add_client_obj(&res)?;
Ok(())
}
async fn handle_request_(
fn handle_request_(
self: &Rc<Self>,
request: u32,
parser: MsgParser<'_, '_>,
) -> Result<(), WlDataDeviceManagerError> {
match request {
CREATE_DATA_SOURCE => self.create_data_source(parser).await?,
GET_DATA_DEVICE => self.get_data_device(parser).await?,
CREATE_DATA_SOURCE => self.create_data_source(parser)?,
GET_DATA_DEVICE => self.get_data_device(parser)?,
_ => unreachable!(),
}
Ok(())