From 396ab935859f4eb46b3cf7aa36e7b496b5898b72 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 9 Aug 2023 11:03:38 +0400 Subject: Restructure things and add tty backend --- src/grabs/move_grab.rs | 24 ++++++++++++------------ src/grabs/resize_grab.rs | 26 +++++++++++++------------- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src/grabs') diff --git a/src/grabs/move_grab.rs b/src/grabs/move_grab.rs index 63cdb3bd..699921d1 100644 --- a/src/grabs/move_grab.rs +++ b/src/grabs/move_grab.rs @@ -6,19 +6,19 @@ use smithay::input::pointer::{ use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; use smithay::utils::{Logical, Point}; -use crate::Smallvil; +use crate::Niri; pub struct MoveSurfaceGrab { - pub start_data: PointerGrabStartData, + pub start_data: PointerGrabStartData, pub window: Window, pub initial_window_location: Point, } -impl PointerGrab for MoveSurfaceGrab { +impl PointerGrab for MoveSurfaceGrab { fn motion( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, _focus: Option<(WlSurface, Point)>, event: &MotionEvent, ) { @@ -33,8 +33,8 @@ impl PointerGrab for MoveSurfaceGrab { fn relative_motion( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, focus: Option<(WlSurface, Point)>, event: &RelativeMotionEvent, ) { @@ -43,8 +43,8 @@ impl PointerGrab for MoveSurfaceGrab { fn button( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, event: &ButtonEvent, ) { handle.button(data, event); @@ -61,14 +61,14 @@ impl PointerGrab for MoveSurfaceGrab { fn axis( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, details: AxisFrame, ) { handle.axis(data, details) } - fn start_data(&self) -> &PointerGrabStartData { + fn start_data(&self) -> &PointerGrabStartData { &self.start_data } } diff --git a/src/grabs/resize_grab.rs b/src/grabs/resize_grab.rs index ee8aae5d..2bc2f194 100644 --- a/src/grabs/resize_grab.rs +++ b/src/grabs/resize_grab.rs @@ -11,7 +11,7 @@ use smithay::utils::{Logical, Point, Rectangle, Size}; use smithay::wayland::compositor; use smithay::wayland::shell::xdg::SurfaceCachedState; -use crate::Smallvil; +use crate::Niri; bitflags::bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] @@ -37,7 +37,7 @@ impl From for ResizeEdge { } pub struct ResizeSurfaceGrab { - start_data: PointerGrabStartData, + start_data: PointerGrabStartData, window: Window, edges: ResizeEdge, @@ -48,7 +48,7 @@ pub struct ResizeSurfaceGrab { impl ResizeSurfaceGrab { pub fn start( - start_data: PointerGrabStartData, + start_data: PointerGrabStartData, window: Window, edges: ResizeEdge, initial_window_rect: Rectangle, @@ -72,11 +72,11 @@ impl ResizeSurfaceGrab { } } -impl PointerGrab for ResizeSurfaceGrab { +impl PointerGrab for ResizeSurfaceGrab { fn motion( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, _focus: Option<(WlSurface, Point)>, event: &MotionEvent, ) { @@ -132,8 +132,8 @@ impl PointerGrab for ResizeSurfaceGrab { fn relative_motion( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, focus: Option<(WlSurface, Point)>, event: &RelativeMotionEvent, ) { @@ -142,8 +142,8 @@ impl PointerGrab for ResizeSurfaceGrab { fn button( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, event: &ButtonEvent, ) { handle.button(data, event); @@ -175,14 +175,14 @@ impl PointerGrab for ResizeSurfaceGrab { fn axis( &mut self, - data: &mut Smallvil, - handle: &mut PointerInnerHandle<'_, Smallvil>, + data: &mut Niri, + handle: &mut PointerInnerHandle<'_, Niri>, details: AxisFrame, ) { handle.axis(data, details) } - fn start_data(&self) -> &PointerGrabStartData { + fn start_data(&self) -> &PointerGrabStartData { &self.start_data } } -- cgit