X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fdispatch.h;fp=openbox%2Fdispatch.h;h=c8371b990f93f6cbfff411fa522f7ba5e8330572;hb=9b33f7ded69e22ad18169c45b6b340dcb348e072;hp=0000000000000000000000000000000000000000;hpb=055b459cdf8e8f15d17cb3366cfde31406fa6223;p=chaz%2Fopenbox diff --git a/openbox/dispatch.h b/openbox/dispatch.h new file mode 100644 index 00000000..c8371b99 --- /dev/null +++ b/openbox/dispatch.h @@ -0,0 +1,58 @@ +#ifndef __dispatch_h +#define __dispatch_h + +#include "client.h" +#include + +void dispatch_startup(); +void dispatch_shutdown(); + +typedef enum { + Event_X_EnterNotify = 1 << 0, + Event_X_LeaveNotify = 1 << 1, + Event_X_KeyPress = 1 << 2, + Event_X_KeyRelease = 1 << 3, + Event_X_ButtonPress = 1 << 4, + Event_X_ButtonRelease = 1 << 5, + Event_X_MotionNotify = 1 << 6, + + Event_Client_New = 1 << 7, /* new window, before mapping */ + Event_Client_Mapped = 1 << 8, /* new window, after mapping */ + Event_Client_Destroy = 1 << 9, /* unmanaged */ + Event_Client_Focus = 1 << 10, + Event_Client_Unfocus = 1 << 11, + + Event_Ob_Desktop = 1 << 12, /* changed desktops */ + Event_Ob_NumDesktops = 1 << 13, /* changed the number of desktops */ + Event_Ob_ShowDesktop = 1 << 14, /* entered/left show-the-desktop mode */ + Event_Ob_Startup = 1 << 15, /* startup complete */ + Event_Ob_Shutdown = 1 << 16, /* shutdown about to start */ + + Event_Signal = 1 << 17, + + EVENT_RANGE = 1 << 18 +} EventType; + +typedef union { + XEvent *x; /* for Event_X_* event types */ + Client *client; /* for Event_Client_* event types */ + int signal; +} EventData; + +typedef struct { + EventType type; + EventData data; +} ObEvent; + +typedef void (*EventHandler)(const ObEvent *e); + +typedef unsigned int EventMask; + +void dispatch_register(EventHandler h, EventMask mask); + +void dispatch_x(XEvent *e); +void dispatch_client(EventType e, Client *c); +void dispatch_ob(EventType e); +void dispatch_signal(int signal); + +#endif