sowm: Shuffle declarations around

This commit is contained in:
Dylan Araps 2020-07-11 11:50:54 +03:00
parent 5c998e05f4
commit a743d166fe
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
3 changed files with 24 additions and 23 deletions

View File

@ -1,27 +1,7 @@
#define _POSIX_C_SOURCE 200809L
#include <xcb/xcb.h> #include <xcb/xcb.h>
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)) #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_press(xcb_generic_event_t *ev);
void event_button_release(xcb_generic_event_t *ev); void event_button_release(xcb_generic_event_t *ev);
void event_configure_request(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_ENTER_NOTIFY] = event_notify_enter,
[XCB_MOTION_NOTIFY] = event_notify_motion [XCB_MOTION_NOTIFY] = event_notify_motion
}; };
void win_add(xcb_window_t win);

15
sowm.c
View File

@ -5,7 +5,20 @@
#include <xcb/xcb.h> #include <xcb/xcb.h>
#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) { void event_button_press(xcb_generic_event_t *ev) {
xcb_button_press_event_t *e = (xcb_button_press_event_t *)ev; xcb_button_press_event_t *e = (xcb_button_press_event_t *)ev;

10
types.h Normal file
View File

@ -0,0 +1,10 @@
#include <xcb/xcb.h>
struct wconf {
int16_t x;
int16_t y;
uint16_t width;
uint16_t height;
xcb_window_t sibling;
uint8_t stack_mode;
};