1
0
Fork 0
forked from wry/wry

wayland: remove Object::num_requests

This commit is contained in:
Julian Orth 2024-02-06 12:05:03 +01:00
parent 19bd17c7dc
commit 0ac1bb8507
76 changed files with 168 additions and 486 deletions

View file

@ -30,15 +30,17 @@ const INVALID_SOURCE: u32 = 1;
pub struct WlDataSource {
pub id: WlDataSourceId,
pub data: SourceData<ClipboardIpc>,
pub version: u32,
pub tracker: Tracker<Self>,
}
impl WlDataSource {
pub fn new(id: WlDataSourceId, client: &Rc<Client>, is_xwm: bool) -> Self {
pub fn new(id: WlDataSourceId, client: &Rc<Client>, is_xwm: bool, version: u32) -> Self {
Self {
id,
tracker: Default::default(),
data: SourceData::new(client, is_xwm),
version,
}
}
@ -196,18 +198,14 @@ impl WlDataSource {
}
object_base! {
WlDataSource;
self = WlDataSource;
OFFER => offer,
DESTROY => destroy,
SET_ACTIONS => set_actions,
SET_ACTIONS => set_actions if self.version >= 3,
}
impl Object for WlDataSource {
fn num_requests(&self) -> u32 {
SET_ACTIONS + 1
}
fn break_loops(&self) {
break_source_loops::<ClipboardIpc>(self);
}