17
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
* Boston, MA 02111-1307, USA.
21
* SECTION: ibusmainloop
22
* @short_description: DBus server and connection setup functions.
25
* This section defines the DBus server and connection setup functions,
26
* and prototypes of their callback functions.
20
29
#ifndef __IBUS_MAINLOOP_H_
21
30
#define __IBUS_MAINLOOP_H_
24
33
#include <dbus/dbus.h>
36
* DBusConnectionSetupFunc:
37
* @connection: A DBusConnection
38
* @user_data: User data to be passed to callback function.
40
* A prototype of callback to DBus connection setup function.
26
42
typedef void (* DBusConnectionSetupFunc) (DBusConnection *connection,
27
43
gpointer user_data);
46
* DBusServerSetupFunc:
47
* @server: A DBusConnection
48
* @user_data: User data to be passed to callback function.
50
* A prototype of DBus server setup function.
28
52
typedef void (* DBusServerSetupFunc) (DBusServer *server,
29
53
gpointer user_data);
56
* ibus_mainloop_setup:
57
* @connection_func: A DBus connection setup function.
58
* @server_func: A prototype of DBus server setup function.
59
* @user_data: User data to be passed to callback function.
61
* Sets the watch and timeout functions of a #DBusConnection
62
* and #DBusServer to integrate the connection with the GLib main loop.
64
* Parameter @user_data should be in type #GMainContext.
65
* It will be passed to both callback functions,
66
* however, normally %NULL is sufficient.
68
* If called twice for the same user_data, does nothing the second
69
* time. If called once with user_data A and once with user_data B,
70
* user_data B replaces user_data A as the context monitoring the
73
* @see_also: ibus_dbus_connection_setup(), ibus_dbus_server_setup().
31
75
void ibus_mainloop_setup (DBusConnectionSetupFunc connection_func,
32
76
DBusServerSetupFunc server_func,
33
77
gpointer user_data);
80
* ibus_dbus_server_setup:
81
* @server: A DBusServer.
83
* Sets the watch and timeout functions of a #DBusServer
84
* to integrate the server with the GLib main loop.
86
* This function uses the parameter @user_data and
87
* server_func set with ibus_mainloop_setup(),
88
* or fall back to NULL and dbus_server_setup() if those are not defined.
90
* @see_also: ibus_mainloop_setup(), dbus_server_setup().
34
92
void ibus_dbus_server_setup (DBusServer *server);
95
* dbus_connection_setup:
96
* @connection: A DBusConnection.
98
* Sets the watch and timeout functions of a #DBusConnection
99
* to integrate the connection with the GLib main loop.
101
* This function uses the parameter @user_data and
102
* connection_func set with ibus_mainloop_setup(),
103
* or fall back to NULL and dbus_connection_setup() if those are not defined.
105
* @see_also: ibus_mainloop_setup(), dbus_connection_setup().
35
107
void ibus_dbus_connection_setup (DBusConnection *connection);