| 123456789101112131415161718192021222324252627282930313233343536 |
- /* Window manager: fixed-size draggable terminal windows + a system bar. */
- #ifndef WM_H
- #define WM_H
- #include "terminal.h"
- #define MAX_WINDOWS 8
- /* System bar (banner + "+ New" button + clock + rainbow) at the top. */
- #define WM_BAR_H 25
- #define WM_BTN_X 132
- #define WM_BTN_Y 3
- #define WM_BTN_W 56
- #define WM_BTN_H 14
- /* Window chrome. */
- #define WM_TITLE_H 16
- #define WM_CLOSE_W 14
- struct window {
- int used;
- unsigned int x, y; /* pixel origin (title bar top-left) */
- unsigned int pw, ph; /* pixel size */
- char title[16];
- int focused;
- unsigned int pid; /* owning terminal process pid (0 = none) */
- struct term *term;
- };
- void wm_run(void);
- int wm_spawn_terminal(void);
- struct window *wm_focused_window(void);
- int wm_is_focused(const struct window *w);
- void wm_request_redraw(void);
- #endif
|