diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-08-30 07:20:16 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-08-30 07:20:16 +0000 |
| commit | de4f92ccc66c1dad1a2820a07d1f0161bd61a855 (patch) | |
| tree | 6e782bca4561b33808d7b96c5df77895093ee3b3 /openbox/mainloop.h | |
| parent | 952ca245714e334090ea6baced5eb75d06f99e18 (diff) | |
using the ObMainLoop, which rulz the planet
Diffstat (limited to 'openbox/mainloop.h')
| -rw-r--r-- | openbox/mainloop.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/openbox/mainloop.h b/openbox/mainloop.h new file mode 100644 index 00000000..ecbcc389 --- /dev/null +++ b/openbox/mainloop.h @@ -0,0 +1,52 @@ +#ifndef __ob__mainloop_h +#define __ob__mainloop_h + +#include <X11/Xlib.h> +#include <glib.h> + +typedef struct _ObMainLoop ObMainLoop; + +ObMainLoop *ob_main_loop_new(Display *display); +void ob_main_loop_destroy(ObMainLoop *loop); + +typedef void (*ObMainLoopXHandler) (const XEvent *e, gpointer data); + +void ob_main_loop_x_add(ObMainLoop *loop, + ObMainLoopXHandler handler, + gpointer data, + GDestroyNotify notify); +void ob_main_loop_x_remove(ObMainLoop *loop, + ObMainLoopXHandler handler); + +typedef void (*ObMainLoopFdHandler) (gint fd, gpointer data); + +void ob_main_loop_fd_add(ObMainLoop *loop, + gint fd, + ObMainLoopFdHandler handler, + gpointer data, + GDestroyNotify notify); +void ob_main_loop_fd_remove(ObMainLoop *loop, + gint fd); + +typedef void (*ObMainLoopSignalHandler) (gint signal, gpointer data); + +void ob_main_loop_signal_add(ObMainLoop *loop, + gint signal, + ObMainLoopSignalHandler handler, + gpointer data, + GDestroyNotify notify); +void ob_main_loop_signal_remove(ObMainLoop *loop, + ObMainLoopSignalHandler handler); + +void ob_main_loop_timeout_add(ObMainLoop *loop, + gulong microseconds, + GSourceFunc handler, + gpointer data, + GDestroyNotify notify); +void ob_main_loop_timeout_remove(ObMainLoop *loop, + GSourceFunc handler); + +void ob_main_loop_run(ObMainLoop *loop); +void ob_main_loop_exit(ObMainLoop *loop); + +#endif |
