From f8b1ed2ef16f7cc1d67b7f6b31858eac8dddc643 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Wed, 31 Jan 2024 17:52:51 -0800 Subject: [PATCH] more structure notes --- src/main.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main.rs b/src/main.rs index 14e86b2..bd24daa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,12 +52,48 @@ fn main() -> anyhow::Result<()> { become_wm(&conn, screen)?; // TODO: setup + // Whole bunch to do here + // - setting up application state + // - in dwm, this is done by assigning pointers + // - we'll likely use a top level struct to do the same + // - this includes: + // - the default screen along with its size + // - the root window + // - the drawable context (or our equivalent) + // - fonts + // - bar height and padding derived from fonts + // - Xinerama information + // - atoms? whatever those are? + // - color schemes + // - initial bar rendering + // - fetch bar status + // - creating the dummy window for propriety and specification compliance + // - Have to assign a bunch of special properties here + // - set the full extent of your event_mask + // - We set SUBSTRUCTURE_REDIRECT in become_wm mostly to check for another wm + // - we have a bunch more we want, like pointer movement, button press, etc etc + // - setup key listeners + // - end by focusing the root window + // - basically all of dwm's drw.c needs to be accounted for including: + // - some utf8 management (we get that for free in Rust) + // - an abstraction for drawing over pixel maps + // - graphics context management + // - font loading and rendering + // - we *could* fall back to X core fonts, but I'd prefer not to + // // TODO: pledge if on openBSD // TODO: dwm scan + // Check for X windows to manage and manage them if needed + // TODO: dwm run + // event loop moment + // TODO: dwm cleanup + // if we structure the program well, this will be done + // automatically by the borrow checker, and we don't even + // need to think about it Ok(()) }