diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index c9cb3231..a71cdeda 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -439,10 +439,6 @@ typedef struct { /* All indentation and tab markers are _relative_ to the left margin marker */ -typedef void *WMHandlerID; - -typedef void WMInputProc(int fd, int mask, void *clientData); - typedef void WMEventProc(XEvent *event, void *clientData); typedef void WMEventHook(XEvent *event); @@ -455,8 +451,6 @@ typedef void WMAction(WMWidget *self, void *clientData); typedef void WMAction2(void *self, void *clientData); -typedef void WMCallback(void *data); - typedef void WMDropDataCallback(WMView *view, WMData *data); /* delegate method like stuff */ @@ -655,26 +649,6 @@ void WMNextEvent(Display *dpy, XEvent *event); void WMMaskEvent(Display *dpy, long mask, XEvent *event); -WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback, - void *cdata); - -WMHandlerID WMAddPersistentTimerHandler(int milliseconds, WMCallback *callback, - void *cdata); - -void WMDeleteTimerWithClientData(void *cdata); - -void WMDeleteTimerHandler(WMHandlerID handlerID); - -WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata); - -void WMDeleteIdleHandler(WMHandlerID handlerID); - -WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc, - void *clientData); - -void WMDeleteInputHandler(WMHandlerID handlerID); - - Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp, WMSelectionProcs *procs, void *cdata); diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index 10338a8f..ac747832 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -130,6 +130,16 @@ typedef struct W_Host WMHost; typedef struct W_Connection WMConnection; + +/* Some typedefs for the handler stuff */ +typedef void *WMHandlerID; + +typedef void WMCallback(void *data); + +typedef void WMInputProc(int fd, int mask, void *clientData); + + + typedef int WMCompareDataProc(const void *item1, const void *item2); typedef void WMFreeDataProc(void *data); @@ -279,6 +289,28 @@ int wsprintesc(char *buffer, int length, char *format, WMSEscapes **escapes, /*......................................................................*/ +/* Event handlers: timer, idle, input */ + +WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback, + void *cdata); + +WMHandlerID WMAddPersistentTimerHandler(int milliseconds, WMCallback *callback, + void *cdata); + +void WMDeleteTimerWithClientData(void *cdata); + +void WMDeleteTimerHandler(WMHandlerID handlerID); + +WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata); + +void WMDeleteIdleHandler(WMHandlerID handlerID); + +WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc, + void *clientData); + +void WMDeleteInputHandler(WMHandlerID handlerID); + + /* This function is used _only_ if you create a non-GUI program. * For GUI based programs use WMNextEvent()/WMHandleEvent() instead. * This function will handle all input/timer/idle events, then return.