-#ifndef _MAIN_H
-#define _MAIN_H
+#ifndef _BSPWM_H
+#define _BSPWM_H
-#define INPUT_FIFO "/tmp/bspwm-input"
+#include "types.h"
+
+#define ROOT_EVENT_MASK (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY)
+#define CLIENT_EVENT_MASK (XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_ENTER_WINDOW)
xcb_connection_t *dpy;
int default_screen, screen_width, screen_height;
+uint32_t num_clients;
+uint32_t num_desktops;
+unsigned int num_monitors;
+unsigned int monitor_uid;
+unsigned int desktop_uid;
+unsigned int client_uid;
xcb_screen_t *screen;
-bool running;
+uint8_t root_depth;
+FILE *status_fifo;
-static char *WM_ATOM_NAME[] = { "WM_PROTOCOLS", "WM_DELETE_WINDOW" };
-static char *NET_ATOM_NAME[] = { "_NET_SUPPORTED", "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE", "_NET_ACTIVE_WINDOW" };
+split_mode_t split_mode;
+direction_t split_dir;
+monitor_t *mon;
+monitor_t *last_mon;
+monitor_t *mon_head;
+monitor_t *mon_tail;
+rule_t *rule_head;
+pointer_state_t *frozen_pointer;
+xcb_point_t pointer_position;
-enum { WM_PROTOCOLS, WM_DELETE_WINDOW, WM_COUNT };
-enum { NET_SUPPORTED, NET_FULLSCREEN, NET_WM_STATE, NET_ACTIVE, NET_COUNT };
-
-static xcb_atom_t wmatoms[WM_COUNT], netatoms[NET_COUNT];
+bool running;
-int register_events(void);
-xcb_screen_t *screen_of_display(xcb_connection_t *, int);
-void sigchld(int);
-void setup(int);
+void register_events(void);
+void handle_buttons(bool);
+void grab_buttons(void);
+void ungrab_buttons(void);
+void setup(void);
+void quit(void);
#endif