Skip to main content

rdesktop_core/
event.rs

1use serde::{Deserialize, Serialize};
2
3/// Events that can occur in the application lifecycle.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub enum Event {
6    /// Application is about to exit
7    Exit,
8
9    /// Window was closed
10    WindowClosed { window_id: u64 },
11
12    /// Window was resized
13    WindowResized {
14        window_id: u64,
15        width: u32,
16        height: u32,
17    },
18
19    /// Window was moved
20    WindowMoved { window_id: u64, x: i32, y: i32 },
21
22    /// Window gained focus
23    WindowFocused { window_id: u64 },
24
25    /// Window lost focus
26    WindowUnfocused { window_id: u64 },
27
28    /// File was dropped on the window
29    FileDrop { window_id: u64, paths: Vec<String> },
30
31    /// Custom event from the renderer
32    Custom {
33        name: String,
34        data: serde_json::Value,
35    },
36}