tony / oxwm

update readme Browse files
tonybtw committed 2025-09-29 parent b5923a9 commit a6ca2ea2b4501f559201123e75db4d7bfe1840c1
Showing 1 changed file with 40 additions and 47 deletions. UnifiedSplit
+40 −47 readme.org
@@ -11,53 +11,46 @@ an X display and log incoming events.
11 11
12 12 * Project Structure
13 13
14 -** src/
15 -*** main.rs
16 -- main() :: Creates WindowManager and calls .run()
17 -
18 -*** window_manager.rs (CORE)
19 -Handles all X11 events and window management
20 -
21 -**** struct WindowManager
22 -- connection :: X11 connection
23 -- windows :: Vec<Window> (all managed windows)
24 -- focused_window :: Option<Window>
25 -- layout :: Box<dyn Layout>
26 -
27 -**** Methods
28 -- new() :: Initialize WM, grab root window
29 -- run() :: Main event loop
30 -- handle_event() :: Routes X11 events
31 - - MapRequest → add window, apply layout
32 - - UnmapNotify → remove window
33 - - DestroyNotify → remove window
34 - - KeyPress → get action, handle it
35 -- handle_key_action() :: Execute keyboard actions
36 -- remove_window() :: Remove from Vec, reapply layout
37 -- set_focus() :: Focus window, update visuals
38 -- cycle_focus() :: Move focus to next window
39 -- update_focus_visuals() :: Set border colors
40 -- apply_layout() :: Position all windows
41 -
42 -*** keyboard/
43 -**** mod.rs
44 -- Re-exports public interface
45 -
46 -**** keycodes.rs
47 -- Key constants (Q, J, RETURN, etc)
48 -
49 -**** handlers.rs
50 -- enum KeyAction :: SpawnTerminal, CloseWindow, CycleWindow, Quit, None
51 -- setup_keybinds() :: Register keys with X11
52 -- handle_key_press() :: Parse key → return KeyAction
53 -
54 -*** layout/
55 -**** mod.rs
56 -- Layout trait definition
57 -
58 -**** tiling.rs
59 -- TilingLayout :: Implementation
60 - - arrange() :: Calculate window positions
14 +#+begin_src sh
15 +src/
16 +├── main.rs
17 +│ └── main()
18 +│ └── Creates WindowManager and calls .run()
19 +│
20 +├── window_manager.rs [CORE - X11 event handling]
21 +│ ├── struct WindowManager
22 +│ │ ├── connection: RustConnection [X11 connection]
23 +│ │ ├── windows: Vec<Window> [All managed windows]
24 +│ │ ├── focused_window: Option<Window>
25 +│ │ └── layout: Box<dyn Layout>
26 +│ │
27 +│ ├── new() [Initialize WM, grab root]
28 +│ ├── run() [Main event loop]
29 +│ ├── handle_event() [Route X11 events]
30 +│ │ ├── MapRequest → add window, apply layout
31 +│ │ ├── UnmapNotify → remove window
32 +│ │ ├── DestroyNotify → remove window
33 +│ │ └── KeyPress → get action, handle it
34 +│ ├── handle_key_action() [Execute keyboard actions]
35 +│ ├── remove_window() [Remove from Vec, reapply layout]
36 +│ ├── set_focus() [Focus window, update visuals]
37 +│ ├── cycle_focus() [Move focus to next window]
38 +│ ├── update_focus_visuals() [Set border colors]
39 +│ └── apply_layout() [Position all windows]
40 +│
41 +├── keyboard/
42 +│ ├── mod.rs [Re-exports]
43 +│ ├── keycodes.rs [Key constants: Q, J, RETURN, etc]
44 +│ └── handlers.rs
45 +│ ├── enum KeyAction [SpawnTerminal, CloseWindow, CycleWindow, Quit, None]
46 +│ ├── setup_keybinds() [Register keys with X11]
47 +│ └── handle_key_press() [Parse KeyPressEvent → KeyAction]
48 +│
49 +└── layout/
50 +├── mod.rs [Layout trait definition]
51 +└── tiling.rs
52 +└── TilingLayout::arrange() [Calculate window positions]
53 +#+end_src
61 54
62 55 * Event Flow
63 56