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 {
21        window_id: u64,
22        x: i32,
23        y: i32,
24    },
25
26    /// Window gained focus
27    WindowFocused { window_id: u64 },
28
29    /// Window lost focus
30    WindowUnfocused { window_id: u64 },
31
32    /// File was dropped on the window
33    FileDrop {
34        window_id: u64,
35        paths: Vec<String>,
36    },
37
38    /// Custom event from the renderer
39    Custom { name: String, data: serde_json::Value },
40}