X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fdispatch.h;h=93b3e459c9f96486c864299314dfe57694f28cc1;hb=122d55fbadea0409fbc902a1740e1c8ff3aecd88;hp=396558db121e9ae92c202706e6b74d397c374249;hpb=4ed3fb89150d05e6fa134798315269c62de1bed9;p=chaz%2Fopenbox diff --git a/openbox/dispatch.h b/openbox/dispatch.h index 396558db..93b3e459 100644 --- a/openbox/dispatch.h +++ b/openbox/dispatch.h @@ -1,9 +1,12 @@ #ifndef __dispatch_h #define __dispatch_h -#include "client.h" +#include "misc.h" + #include +struct _ObClient; + void dispatch_startup(); void dispatch_shutdown(); @@ -18,32 +21,64 @@ typedef enum { Event_X_Bell = 1 << 7, /* an XKB bell event */ Event_Client_New = 1 << 8, /* new window, before mapping */ - Event_Client_Mapped = 1 << 9, /* new window, after mapping */ + Event_Client_Mapped = 1 << 9, /* new window, after mapping + or uniconified */ Event_Client_Destroy = 1 << 10, /* unmanaged */ - Event_Client_Focus = 1 << 11, /* focused */ - Event_Client_Unfocus = 1 << 12, /* unfocused */ - Event_Client_Urgent = 1 << 13, /* entered/left urgent state */ - Event_Client_Visible = 1 << 14, /* shown/hidden (not on a workspace or - show-the-desktop change though) */ + Event_Client_Unmapped = 1 << 11, /* unmanaged, after unmapping + or iconified */ + Event_Client_Focus = 1 << 12, /* focused */ + Event_Client_Unfocus = 1 << 13, /* unfocused */ + Event_Client_Urgent = 1 << 14, /* entered/left urgent state */ + Event_Client_Desktop = 1 << 15, /* moved to a new desktop */ + Event_Client_Moving = 1 << 16, /* being interactively moved */ + Event_Client_Resizing = 1 << 17, /* being interactively resized */ - Event_Ob_Desktop = 1 << 15, /* changed desktops */ - Event_Ob_NumDesktops = 1 << 16, /* changed the number of desktops */ - Event_Ob_ShowDesktop = 1 << 17, /* entered/left show-the-desktop mode */ + Event_Ob_Desktop = 1 << 18, /* changed desktops */ + Event_Ob_NumDesktops = 1 << 19, /* changed the number of desktops */ + Event_Ob_ShowDesktop = 1 << 20, /* entered/left show-the-desktop mode */ - Event_Signal = 1 << 18, /* a signal from the OS */ + Event_Signal = 1 << 21, /* a signal from the OS */ - EVENT_RANGE = 1 << 19 + EVENT_RANGE = 1 << 22 } EventType; typedef struct { XEvent *e; - Client *client; + struct _ObClient *client; } EventData_X; -typedef union { - EventData_X x; /* for Event_X_* event types */ - Client *client; /* for Event_Client_* event types */ +typedef struct { + struct _ObClient *client; + int num[3]; + /* Event_Client_Desktop: num[0] = new number, num[1] = old number + Event_Client_Urgent: num[0] = urgent state + Event_Client_Moving: num[0] = dest x coord, num[1] = dest y coord -- + change these in the handler to adjust where the + window will be placed + Event_Client_Resizing: num[0] = dest width, num[1] = dest height -- + change these in the handler to adjust where the + window will be placed + num[2] = the anchored corner + */ +} EventData_Client; + +typedef struct { + int num[2]; + /* Event_Ob_Desktop: num[0] = new number, num[1] = old number + Event_Ob_NumDesktops: num[0] = new number, num[1] = old number + Event_Ob_ShowDesktop: num[0] = new show-desktop mode + */ +} EventData_Ob; + +typedef struct { int signal; +} EventData_Signal; + +typedef struct { + EventData_X x; /* for Event_X_* event types */ + EventData_Client c; /* for Event_ObClient_* event types */ + EventData_Ob o; /* for Event_Ob_* event types */ + EventData_Signal s; /* for Event_Signal */ } EventData; typedef struct { @@ -57,9 +92,15 @@ typedef unsigned int EventMask; void dispatch_register(EventMask mask, EventHandler h, void *data); -void dispatch_x(XEvent *e, Client *c); -void dispatch_client(EventType e, Client *c); -void dispatch_ob(EventType e); +void dispatch_x(XEvent *e, struct _ObClient *c); +void dispatch_client(EventType e, struct _ObClient *c, int num0, int num1); +void dispatch_ob(EventType e, int num0, int num1); void dispatch_signal(int signal); +/* *x and *y should be set with the destination of the window, they may be + changed by the event handlers */ +void dispatch_move(struct _ObClient *c, int *x, int *y); +/* *w and *h should be set with the destination of the window, they may be + changed by the event handlers */ +void dispatch_resize(struct _ObClient *c, int *w, int *h, ObCorner corner); #endif