From de4f92ccc66c1dad1a2820a07d1f0161bd61a855 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 30 Aug 2003 07:20:16 +0000 Subject: using the ObMainLoop, which rulz the planet --- openbox/mainloop.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 openbox/mainloop.h (limited to 'openbox/mainloop.h') 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 +#include + +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 -- cgit v1.2.3