From 391bb0ea2fe6c852f10a77c1c5037042adc4fb2a Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Feb 2023 01:37:28 +0000 Subject: [PATCH] fixed types for tree --- src/types.rs | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/src/types.rs b/src/types.rs index da51a11..6b86a07 100644 --- a/src/types.rs +++ b/src/types.rs @@ -23,7 +23,6 @@ pub struct Workspace { pub window_rect: Rect, pub geometry: Rect, pub name: String, - //pub nodes: Box>, pub floating_nodes: Vec, pub focus: Vec, pub fullscreen_mode: i32, @@ -203,14 +202,52 @@ pub struct Tree { pub window_rect: Rect, pub geometry: Rect, pub name: String, - //window: - pub nodes: Vec, - pub floating: Vec, + pub nodes: Vec, + pub floating: Option>, pub focus: Vec, pub fullscreen_mode: i32, pub sticky: bool } +#[derive(Serialize, Deserialize)] +pub struct Nodes { + pub id: i32, + #[serde(rename = "type")] + pub _type: String, + pub orientation: String, + pub percent: Option, + pub urgent: bool, + pub layout: String, + pub border: String, + pub current_border_width: i32, + pub rect: Rect, + pub deco_rect: Rect, + pub window_rect: Rect, + pub geometry: Rect, + pub name: String, + pub nodes: Option>, + pub floating_nodes: Vec, + pub focus: Vec, + pub fullscreen_mode: i32, + pub sticky: bool, + pub active: Option, + pub dpms: Option, + pub primary: Option, + pub make: Option, + pub model: Option, + pub serial: Option, + pub scale: Option, + pub scale_filter: Option, + pub transform: Option, + pub adaptive_sync_status: Option, + pub current_workspace: Option, + pub modes: Option>, + pub current_mode: Option, + pub max_render_time: Option, + pub focused: Option, + pub subpixel_hinting: Option +} + #[derive(Serialize, Deserialize)] pub struct Seat { pub name: String,