diff options
| author | Filip Wandzio <contact@philw.dev> | 2025-12-30 02:45:11 +0100 |
|---|---|---|
| committer | Filip Wandzio <contact@philw.dev> | 2025-12-30 02:45:11 +0100 |
| commit | 4c90d1d9e4092f9ee0106d316829144653a276ea (patch) | |
| tree | cba5e7697a1334da068c5fa5e5951e00696fb903 /src/wm | |
| parent | 11b1ff4691ff3e0f8346e7431fa3f90cc846fc5d (diff) | |
| download | dwm-4c90d1d9e4092f9ee0106d316829144653a276ea.tar.gz dwm-4c90d1d9e4092f9ee0106d316829144653a276ea.zip | |
Split monolithic dwm.h into modular headers and group them by it's functionalities
The new plan of refactoring this project is to split entire monolithic codebase into separate, (kind of) independent modules. This will help with understanding the code by turning off modules and deciding which ones require some work.
Signed-off-by: Filip Wandzio <contact@philw.dev>
Diffstat (limited to 'src/wm')
| -rw-r--r-- | src/wm/client.h | 26 | ||||
| -rw-r--r-- | src/wm/layout.h | 12 | ||||
| -rw-r--r-- | src/wm/monitor.h | 15 |
3 files changed, 53 insertions, 0 deletions
diff --git a/src/wm/client.h b/src/wm/client.h new file mode 100644 index 0000000..8a2a05e --- /dev/null +++ b/src/wm/client.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | |||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include "../core/types.h" | ||
| 5 | |||
| 6 | void manage(Window w, XWindowAttributes *wa); | ||
| 7 | void unmanage(Client *c, int destroyed); | ||
| 8 | |||
| 9 | void attach(Client *c); | ||
| 10 | void detach(Client *c); | ||
| 11 | void attachstack(Client *c); | ||
| 12 | void detachstack(Client *c); | ||
| 13 | |||
| 14 | void focus(Client *c); | ||
| 15 | void unfocus(Client *c, int setfocus); | ||
| 16 | |||
| 17 | void resize(Client *c, int x, int y, int w, int h, int interact); | ||
| 18 | void resizeclient(Client *c, int x, int y, int w, int h); | ||
| 19 | |||
| 20 | Client *nexttiled(Client *c); | ||
| 21 | Client *wintoclient(Window w); | ||
| 22 | |||
| 23 | /* swallow (optional) */ | ||
| 24 | Client *swallowingclient(Window w); | ||
| 25 | Client *termforwin(const Client *c); | ||
| 26 | pid_t winpid(Window w); | ||
diff --git a/src/wm/layout.h b/src/wm/layout.h new file mode 100644 index 0000000..5deab64 --- /dev/null +++ b/src/wm/layout.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | |||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include "../core/types.h" | ||
| 5 | |||
| 6 | void arrange(Monitor *m); | ||
| 7 | void arrangemon(Monitor *m); | ||
| 8 | void tile(Monitor *m); | ||
| 9 | void restack(Monitor *m); | ||
| 10 | void showhide(Client *c); | ||
| 11 | void zoom(const Arg *arg); | ||
| 12 | void setlayout(const Arg *arg); | ||
diff --git a/src/wm/monitor.h b/src/wm/monitor.h new file mode 100644 index 0000000..e09935e --- /dev/null +++ b/src/wm/monitor.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | |||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include "../core/types.h" | ||
| 5 | |||
| 6 | Monitor *createmon(void); | ||
| 7 | void cleanupmon(Monitor *mon); | ||
| 8 | |||
| 9 | Monitor *recttomon(int x, int y, int w, int h); | ||
| 10 | Monitor *wintomon(Window w); | ||
| 11 | void sendmon(Client *c, Monitor *m); | ||
| 12 | |||
| 13 | int updategeom(void); | ||
| 14 | void updatebarpos(Monitor *m); | ||
| 15 | void resizebarwin(Monitor *m); | ||
