]> icculus.org git repositories - mikachu/openbox.git/blob - openbox/mainloop.h
add copyright headers, adjust --version output to include copyright, and --help outpu...
[mikachu/openbox.git] / openbox / mainloop.h
1 /* -*- indent-tabs-mode: t; tab-width: 4; c-basic-offset: 4; -*-
2
3    mainloop.h for the Openbox window manager
4    Copyright (c) 2003        Ben Jansens
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #ifndef __ob__mainloop_h
20 #define __ob__mainloop_h
21
22 #include <X11/Xlib.h>
23 #include <glib.h>
24
25 typedef struct _ObMainLoop ObMainLoop;
26
27 ObMainLoop *ob_main_loop_new(Display *display);
28 void        ob_main_loop_destroy(ObMainLoop *loop);
29
30 typedef void (*ObMainLoopXHandler) (const XEvent *e, gpointer data);
31
32 void ob_main_loop_x_add(ObMainLoop *loop,
33                         ObMainLoopXHandler handler,
34                         gpointer data,
35                         GDestroyNotify notify);
36 void ob_main_loop_x_remove(ObMainLoop *loop,
37                            ObMainLoopXHandler handler);
38
39 typedef void (*ObMainLoopFdHandler) (gint fd, gpointer data);
40
41 void ob_main_loop_fd_add(ObMainLoop *loop,
42                          gint fd,
43                          ObMainLoopFdHandler handler,
44                          gpointer data,
45                          GDestroyNotify notify);
46 void ob_main_loop_fd_remove(ObMainLoop *loop,
47                             gint fd);
48
49 typedef void (*ObMainLoopSignalHandler) (gint signal, gpointer data);
50
51 void ob_main_loop_signal_add(ObMainLoop *loop,
52                              gint signal,
53                              ObMainLoopSignalHandler handler,
54                              gpointer data,
55                              GDestroyNotify notify);
56 void ob_main_loop_signal_remove(ObMainLoop *loop,
57                                 ObMainLoopSignalHandler handler);
58
59 void ob_main_loop_timeout_add(ObMainLoop *loop,
60                               gulong microseconds,
61                               GSourceFunc handler,
62                               gpointer data,
63                               GDestroyNotify notify);
64 void ob_main_loop_timeout_remove(ObMainLoop *loop,
65                                  GSourceFunc handler);
66 void ob_main_loop_timeout_remove_data(ObMainLoop *loop,
67                                       GSourceFunc handler,
68                                       gpointer data);
69
70 void ob_main_loop_run(ObMainLoop *loop);
71 void ob_main_loop_exit(ObMainLoop *loop);
72
73 #endif