diff options
| author | verdant <im@verdant.ee> | 2026-07-21 18:56:26 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-21 18:56:26 +0800 |
| commit | d78746fd69ee53d083cbcc89648a5edd78c23df4 (patch) | |
| tree | dbc675b83b652164ea0611d43c75defc2d49ff24 /wm.h | |
| parent | 2d51db8bc8ee0a4e81db373a2462e6c83e1cc299 (diff) | |
| download | sf-d78746fd69ee53d083cbcc89648a5edd78c23df4.tar.gz sf-d78746fd69ee53d083cbcc89648a5edd78c23df4.zip | |
Add windows manager for creating windows
Diffstat (limited to 'wm.h')
| -rw-r--r-- | wm.h | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#ifndef SF_WM_H +#define SF_WM_H + +#include <ncurses.h> + +#define WINDOWS_MAX 15 + +typedef struct { + WINDOW *win; + char name[32]; + int height; + int width; + int start_x; + int start_y; +} window; + +typedef struct { + window **windows; /* windows[0] is root_win */ + int w_count; /* index of windows */ + int maxy; + int maxx; +} terminal; + +terminal *wm_init(void); +window *wm_create_new_w(terminal *t, const char *name, int width, int height, + int start_y, int start_x); +int wm_fd_w_by_name(terminal *t, const char *name); +void wm_refresh_all(terminal *t); + +#endif /* SF_WM_H */ |
