mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-18 16:51:29 +03:00
use delegate_noop macro
This commit is contained in:
@@ -20,7 +20,7 @@ use wayland_protocols_misc::zwp_virtual_keyboard_v1::client::{
|
|||||||
use wayland_client::{
|
use wayland_client::{
|
||||||
globals::{registry_queue_init, GlobalListContents},
|
globals::{registry_queue_init, GlobalListContents},
|
||||||
protocol::{wl_keyboard, wl_pointer, wl_registry, wl_seat},
|
protocol::{wl_keyboard, wl_pointer, wl_registry, wl_seat},
|
||||||
Connection, Dispatch, EventQueue, QueueHandle,
|
Connection, Dispatch, EventQueue, QueueHandle, delegate_noop,
|
||||||
};
|
};
|
||||||
|
|
||||||
use tempfile;
|
use tempfile;
|
||||||
@@ -127,65 +127,11 @@ fn receive_event(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<VpManager, ()> for App {
|
delegate_noop!(App: Vp);
|
||||||
fn event(
|
delegate_noop!(App: Vk);
|
||||||
_: &mut Self,
|
delegate_noop!(App: VpManager);
|
||||||
_: &VpManager,
|
delegate_noop!(App: VkManager);
|
||||||
_: <VpManager as wayland_client::Proxy>::Event,
|
delegate_noop!(App: wl_seat::WlSeat);
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<Vp, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &Vp,
|
|
||||||
_: <Vp as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<VkManager, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &VkManager,
|
|
||||||
_: <VkManager as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<Vk, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &Vk,
|
|
||||||
_: <Vk as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_seat::WlSeat, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_seat::WlSeat,
|
|
||||||
_: <wl_seat::WlSeat as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for App {
|
impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for App {
|
||||||
fn event(
|
fn event(
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ use wayland_protocols::wp::{
|
|||||||
use wayland_protocols_wlr::layer_shell::v1::client::{zwlr_layer_shell_v1::{ZwlrLayerShellV1, Layer}, zwlr_layer_surface_v1::{self, ZwlrLayerSurfaceV1, Anchor, KeyboardInteractivity}};
|
use wayland_protocols_wlr::layer_shell::v1::client::{zwlr_layer_shell_v1::{ZwlrLayerShellV1, Layer}, zwlr_layer_surface_v1::{self, ZwlrLayerSurfaceV1, Anchor, KeyboardInteractivity}};
|
||||||
|
|
||||||
use wayland_client::{
|
use wayland_client::{
|
||||||
|
delegate_noop,
|
||||||
globals::{registry_queue_init, GlobalListContents},
|
globals::{registry_queue_init, GlobalListContents},
|
||||||
protocol::{
|
protocol::{
|
||||||
wl_buffer, wl_compositor, wl_keyboard, wl_pointer, wl_region, wl_registry, wl_seat, wl_shm,
|
wl_buffer, wl_compositor, wl_keyboard, wl_pointer, wl_region, wl_registry, wl_seat, wl_shm,
|
||||||
@@ -225,66 +226,6 @@ impl App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<wl_compositor::WlCompositor, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_compositor::WlCompositor,
|
|
||||||
_: <wl_compositor::WlCompositor as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_surface::WlSurface, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_surface::WlSurface,
|
|
||||||
_: <wl_surface::WlSurface as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_shm::WlShm, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_shm::WlShm,
|
|
||||||
_: <wl_shm::WlShm as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_shm_pool::WlShmPool, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_shm_pool::WlShmPool,
|
|
||||||
_: <wl_shm_pool::WlShmPool as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_buffer::WlBuffer, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_buffer::WlBuffer,
|
|
||||||
_: <wl_buffer::WlBuffer as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_seat::WlSeat, ()> for App {
|
impl Dispatch<wl_seat::WlSeat, ()> for App {
|
||||||
fn event(
|
fn event(
|
||||||
@@ -388,42 +329,6 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<ZwpPointerConstraintsV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwpPointerConstraintsV1,
|
|
||||||
_: <ZwpPointerConstraintsV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwpLockedPointerV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwpLockedPointerV1,
|
|
||||||
_: <ZwpLockedPointerV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwpRelativePointerManagerV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwpRelativePointerManagerV1,
|
|
||||||
_: <ZwpRelativePointerManagerV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwpRelativePointerV1, ()> for App {
|
impl Dispatch<ZwpRelativePointerV1, ()> for App {
|
||||||
fn event(
|
fn event(
|
||||||
app: &mut Self,
|
app: &mut Self,
|
||||||
@@ -452,18 +357,6 @@ impl Dispatch<ZwpRelativePointerV1, ()> for App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<ZwlrLayerShellV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwlrLayerShellV1,
|
|
||||||
_: <ZwlrLayerShellV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwlrLayerSurfaceV1, ()> for App {
|
impl Dispatch<ZwlrLayerSurfaceV1, ()> for App {
|
||||||
fn event(
|
fn event(
|
||||||
app: &mut Self,
|
app: &mut Self,
|
||||||
@@ -483,42 +376,6 @@ impl Dispatch<ZwlrLayerSurfaceV1, ()> for App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<wl_region::WlRegion, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &wl_region::WlRegion,
|
|
||||||
_: <wl_region::WlRegion as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwpKeyboardShortcutsInhibitManagerV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwpKeyboardShortcutsInhibitManagerV1,
|
|
||||||
_: <ZwpKeyboardShortcutsInhibitManagerV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZwpKeyboardShortcutsInhibitorV1, ()> for App {
|
|
||||||
fn event(
|
|
||||||
_: &mut Self,
|
|
||||||
_: &ZwpKeyboardShortcutsInhibitorV1,
|
|
||||||
_: <ZwpKeyboardShortcutsInhibitorV1 as wayland_client::Proxy>::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for App {
|
impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for App {
|
||||||
fn event(
|
fn event(
|
||||||
_: &mut App,
|
_: &mut App,
|
||||||
@@ -530,3 +387,19 @@ impl Dispatch<wl_registry::WlRegistry, GlobalListContents> for App {
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't emit any events
|
||||||
|
delegate_noop!(App: wl_region::WlRegion);
|
||||||
|
delegate_noop!(App: wl_shm_pool::WlShmPool);
|
||||||
|
delegate_noop!(App: wl_compositor::WlCompositor);
|
||||||
|
delegate_noop!(App: ZwlrLayerShellV1);
|
||||||
|
delegate_noop!(App: ZwpRelativePointerManagerV1);
|
||||||
|
delegate_noop!(App: ZwpKeyboardShortcutsInhibitManagerV1);
|
||||||
|
delegate_noop!(App: ZwpPointerConstraintsV1);
|
||||||
|
|
||||||
|
// ignore events
|
||||||
|
delegate_noop!(App: ignore wl_shm::WlShm);
|
||||||
|
delegate_noop!(App: ignore wl_buffer::WlBuffer);
|
||||||
|
delegate_noop!(App: ignore wl_surface::WlSurface);
|
||||||
|
delegate_noop!(App: ignore ZwpKeyboardShortcutsInhibitorV1);
|
||||||
|
delegate_noop!(App: ignore ZwpLockedPointerV1);
|
||||||
|
|||||||
Reference in New Issue
Block a user