mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-02-05 20:46:27 +01:00
57 lines
1.6 KiB
Rust
57 lines
1.6 KiB
Rust
|
use smithay::{
|
||
|
desktop::{Space, Window},
|
||
|
input::{pointer::CursorImageStatus, SeatState},
|
||
|
reexports::{
|
||
|
calloop::{LoopHandle, LoopSignal},
|
||
|
wayland_server::{
|
||
|
backend::{ClientData, ClientId, DisconnectReason},
|
||
|
Display,
|
||
|
},
|
||
|
},
|
||
|
utils::{Clock, Logical, Monotonic, Point},
|
||
|
wayland::{
|
||
|
compositor::{CompositorClientState, CompositorState},
|
||
|
data_device::DataDeviceState,
|
||
|
output::OutputManagerState,
|
||
|
shell::xdg::XdgShellState,
|
||
|
shm::ShmState,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
use crate::backend::{winit::WinitData, Backend};
|
||
|
|
||
|
pub struct State<B: Backend> {
|
||
|
pub backend_data: B,
|
||
|
pub loop_signal: LoopSignal,
|
||
|
pub loop_handle: LoopHandle<'static, CalloopData>,
|
||
|
pub clock: Clock<Monotonic>,
|
||
|
pub compositor_state: CompositorState,
|
||
|
pub data_device_state: DataDeviceState,
|
||
|
pub seat_state: SeatState<Self>,
|
||
|
pub shm_state: ShmState,
|
||
|
pub space: Space<Window>,
|
||
|
pub cursor_status: CursorImageStatus,
|
||
|
pub pointer_location: Point<f64, Logical>,
|
||
|
pub output_manager_state: OutputManagerState,
|
||
|
pub xdg_shell_state: XdgShellState,
|
||
|
|
||
|
pub move_mode: bool,
|
||
|
}
|
||
|
|
||
|
pub struct CalloopData {
|
||
|
pub display: Display<State<WinitData>>,
|
||
|
pub state: State<WinitData>,
|
||
|
}
|
||
|
|
||
|
#[derive(Default)]
|
||
|
pub struct ClientState {
|
||
|
pub compositor_state: CompositorClientState,
|
||
|
}
|
||
|
impl ClientData for ClientState {
|
||
|
fn initialized(&self, _client_id: ClientId) {}
|
||
|
|
||
|
fn disconnected(&self, _client_id: ClientId, _reason: DisconnectReason) {}
|
||
|
|
||
|
// fn debug(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {}
|
||
|
}
|