From a743d166fee91d324f444149ff5cda5f98072513 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 11 Jul 2020 11:50:54 +0300 Subject: [PATCH] sowm: Shuffle declarations around --- sowm.h => event.h | 22 ---------------------- sowm.c | 15 ++++++++++++++- types.h | 10 ++++++++++ 3 files changed, 24 insertions(+), 23 deletions(-) rename sowm.h => event.h (72%) create mode 100644 types.h diff --git a/sowm.h b/event.h similarity index 72% rename from sowm.h rename to event.h index d70c9eb..83e36c1 100644 --- a/sowm.h +++ b/event.h @@ -1,27 +1,7 @@ -#define _POSIX_C_SOURCE 200809L #include -struct wconf { - int16_t x; - int16_t y; - uint16_t width; - uint16_t height; - uint8_t stack_mode; - xcb_window_t sibling; -}; - -xcb_connection_t *dpy; -xcb_screen_t *scr; -xcb_drawable_t root; - -uint32_t ev_vals[3]; - #define EVENT_MASK(e) (((e) & ~0x80)) -void init_wm(void); -void init_input(void); -void run_loop(void); - void event_button_press(xcb_generic_event_t *ev); void event_button_release(xcb_generic_event_t *ev); void event_configure_request(xcb_generic_event_t *ev); @@ -41,5 +21,3 @@ void (*events[XCB_NO_OPERATION])(xcb_generic_event_t *) = { [XCB_ENTER_NOTIFY] = event_notify_enter, [XCB_MOTION_NOTIFY] = event_notify_motion }; - -void win_add(xcb_window_t win); diff --git a/sowm.c b/sowm.c index 9983f00..63b4eb1 100644 --- a/sowm.c +++ b/sowm.c @@ -5,7 +5,20 @@ #include -#include "sowm.h" +#include "event.h" +#include "types.h" + +static xcb_connection_t *dpy; +static xcb_screen_t *scr; +static xcb_drawable_t root; + +/* required for button press, motion and release */ +static uint32_t ev_vals[3]; + +static void init_wm(void); +static void init_input(void); +static void run_loop(void); +static void win_add(xcb_window_t win); void event_button_press(xcb_generic_event_t *ev) { xcb_button_press_event_t *e = (xcb_button_press_event_t *)ev; diff --git a/types.h b/types.h new file mode 100644 index 0000000..38a9d4e --- /dev/null +++ b/types.h @@ -0,0 +1,10 @@ +#include + +struct wconf { + int16_t x; + int16_t y; + uint16_t width; + uint16_t height; + xcb_window_t sibling; + uint8_t stack_mode; +};