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

@ -130,17 +130,13 @@ impl Node for ExtSessionLockSurfaceV1 {
}
object_base! {
ExtSessionLockSurfaceV1;
self = ExtSessionLockSurfaceV1;
DESTROY => destroy,
ACK_CONFIGURE => ack_configure,
}
impl Object for ExtSessionLockSurfaceV1 {
fn num_requests(&self) -> u32 {
ACK_CONFIGURE + 1
}
fn break_loops(&self) {
self.destroy_node();
}

View file

@ -244,7 +244,7 @@ impl WlSubsurface {
}
object_base! {
WlSubsurface;
self = WlSubsurface;
DESTROY => destroy,
SET_POSITION => set_position,
@ -255,10 +255,6 @@ object_base! {
}
impl Object for WlSubsurface {
fn num_requests(&self) -> u32 {
SET_DESYNC + 1
}
fn break_loops(&self) {
*self.pending.node.borrow_mut() = None;
*self.node.borrow_mut() = None;

View file

@ -52,16 +52,12 @@ impl WpFractionalScaleV1 {
}
object_base! {
WpFractionalScaleV1;
self = WpFractionalScaleV1;
DESTROY => destroy,
}
impl Object for WpFractionalScaleV1 {
fn num_requests(&self) -> u32 {
DESTROY + 1
}
}
impl Object for WpFractionalScaleV1 {}
simple_add_obj!(WpFractionalScaleV1);

View file

@ -53,17 +53,13 @@ impl WpTearingControlV1 {
}
object_base! {
WpTearingControlV1;
self = WpTearingControlV1;
SET_PRESENTATION_HINT => set_presentation_hint,
DESTROY => destroy,
}
impl Object for WpTearingControlV1 {
fn num_requests(&self) -> u32 {
DESTROY + 1
}
}
impl Object for WpTearingControlV1 {}
simple_add_obj!(WpTearingControlV1);

View file

@ -75,18 +75,14 @@ impl WpViewport {
}
object_base! {
WpViewport;
self = WpViewport;
DESTROY => destroy,
SET_SOURCE => set_source,
SET_DESTINATION => set_destination,
}
impl Object for WpViewport {
fn num_requests(&self) -> u32 {
SET_DESTINATION + 1
}
}
impl Object for WpViewport {}
simple_add_obj!(WpViewport);

View file

@ -42,17 +42,13 @@ impl XwaylandSurfaceV1 {
}
object_base! {
XwaylandSurfaceV1;
self = XwaylandSurfaceV1;
SET_SERIAL => set_serial,
DESTROY => destroy,
}
impl Object for XwaylandSurfaceV1 {
fn num_requests(&self) -> u32 {
DESTROY + 1
}
fn break_loops(&self) {
self.x.xwayland_surface.set(None);
}

View file

@ -314,7 +314,7 @@ impl XdgSurface {
}
object_base! {
XdgSurface;
self = XdgSurface;
DESTROY => destroy,
GET_TOPLEVEL => get_toplevel,
@ -324,10 +324,6 @@ object_base! {
}
impl Object for XdgSurface {
fn num_requests(&self) -> u32 {
ACK_CONFIGURE + 1
}
fn break_loops(&self) {
self.ext.take();
self.popups.clear();

View file

@ -253,22 +253,14 @@ impl XdgPopup {
}
object_base! {
XdgPopup;
self = XdgPopup;
DESTROY => destroy,
GRAB => grab,
REPOSITION => reposition,
REPOSITION => reposition if self.xdg.base.version >= 3,
}
impl Object for XdgPopup {
fn num_requests(&self) -> u32 {
let last_req = match self.xdg.base.version {
0..=2 => GRAB,
_ => REPOSITION,
};
last_req + 1
}
fn break_loops(&self) {
self.destroy_node();
self.parent.set(None);

View file

@ -360,7 +360,7 @@ impl XdgToplevel {
}
object_base! {
XdgToplevel;
self = XdgToplevel;
DESTROY => destroy,
SET_PARENT => set_parent,
@ -379,10 +379,6 @@ object_base! {
}
impl Object for XdgToplevel {
fn num_requests(&self) -> u32 {
SET_MINIMIZED + 1
}
fn break_loops(&self) {
self.tl_destroy();
self.parent.set(None);

View file

@ -91,17 +91,13 @@ impl Global for XwaylandShellV1Global {
simple_add_global!(XwaylandShellV1Global);
object_base! {
XwaylandShellV1;
self = XwaylandShellV1;
DESTROY => destroy,
GET_XWAYLAND_SURFACE => get_xwayland_surface,
}
impl Object for XwaylandShellV1 {
fn num_requests(&self) -> u32 {
GET_XWAYLAND_SURFACE + 1
}
}
impl Object for XwaylandShellV1 {}
simple_add_obj!(XwaylandShellV1);

View file

@ -407,7 +407,7 @@ impl Node for ZwlrLayerSurfaceV1 {
}
object_base! {
ZwlrLayerSurfaceV1;
self = ZwlrLayerSurfaceV1;
SET_SIZE => set_size,
SET_ANCHOR => set_anchor,
@ -417,18 +417,10 @@ object_base! {
GET_POPUP => get_popup,
ACK_CONFIGURE => ack_configure,
DESTROY => destroy,
SET_LAYER => set_layer,
SET_LAYER => set_layer if self.shell.version >= 2,
}
impl Object for ZwlrLayerSurfaceV1 {
fn num_requests(&self) -> u32 {
let last_req = match self.shell.version {
0..=1 => DESTROY,
_ => SET_LAYER,
};
last_req + 1
}
fn break_loops(&self) {
self.destroy_node();
self.link.set(None);

View file

@ -49,16 +49,12 @@ impl ZwpIdleInhibitorV1 {
}
object_base! {
ZwpIdleInhibitorV1;
self = ZwpIdleInhibitorV1;
DESTROY => destroy,
}
impl Object for ZwpIdleInhibitorV1 {
fn num_requests(&self) -> u32 {
DESTROY + 1
}
fn break_loops(&self) {
self.deactivate();
}