1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 obt/mainloop.h for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003-2007 Dana Jansens
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 See the COPYING file for a copy of the GNU General Public License.
20 #ifndef __obt_mainloop_h
21 #define __obt_mainloop_h
28 typedef struct _ObtMainLoop ObtMainLoop;
30 ObtMainLoop *obt_main_loop_new();
31 void obt_main_loop_ref(ObtMainLoop *loop);
32 void obt_main_loop_unref(ObtMainLoop *loop);
34 typedef void (*ObtMainLoopXHandler) (const XEvent *e, gpointer data);
36 void obt_main_loop_x_add(ObtMainLoop *loop,
37 ObtMainLoopXHandler handler,
39 GDestroyNotify notify);
40 void obt_main_loop_x_remove(ObtMainLoop *loop,
41 ObtMainLoopXHandler handler);
43 typedef void (*ObtMainLoopFdHandler) (gint fd, gpointer data);
45 void obt_main_loop_fd_add(ObtMainLoop *loop,
47 ObtMainLoopFdHandler handler,
49 GDestroyNotify notify);
50 void obt_main_loop_fd_remove(ObtMainLoop *loop,
53 typedef void (*ObtMainLoopSignalHandler) (gint signal, gpointer data);
55 void obt_main_loop_signal_add(ObtMainLoop *loop,
57 ObtMainLoopSignalHandler handler,
59 GDestroyNotify notify);
60 void obt_main_loop_signal_remove(ObtMainLoop *loop,
61 ObtMainLoopSignalHandler handler);
63 void obt_main_loop_timeout_add(ObtMainLoop *loop,
68 GDestroyNotify notify);
69 void obt_main_loop_timeout_remove(ObtMainLoop *loop,
71 void obt_main_loop_timeout_remove_data(ObtMainLoop *loop,
74 gboolean cancel_dest);
76 void obt_main_loop_run(ObtMainLoop *loop);
77 void obt_main_loop_exit(ObtMainLoop *loop);