~ubuntu-branches/ubuntu/karmic/ibus/karmic-updates

« back to all changes in this revision

Viewing changes to src/ibusmainloop.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-07-23 20:22:09 UTC
  • mfrom: (1.1.4 upstream) (6.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090723202209-bmgqa80g1umg8l2p
Tags: 1.2.0.20090723-1
new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
 * Boston, MA 02111-1307, USA.
19
19
 */
 
20
/**
 
21
 * SECTION: ibusmainloop
 
22
 * @short_description: DBus server and connection setup functions.
 
23
 * @stability: Stable
 
24
 *
 
25
 * This section defines the DBus server and connection setup functions,
 
26
 * and prototypes of their callback functions.
 
27
 */
 
28
 
20
29
#ifndef __IBUS_MAINLOOP_H_
21
30
#define __IBUS_MAINLOOP_H_
22
31
 
23
32
#include <glib.h>
24
33
#include <dbus/dbus.h>
25
34
 
 
35
/**
 
36
 * DBusConnectionSetupFunc:
 
37
 * @connection: A DBusConnection
 
38
 * @user_data: User data to be passed to callback function.
 
39
 *
 
40
 * A prototype of callback to DBus connection setup function.
 
41
 */
26
42
typedef void (* DBusConnectionSetupFunc)    (DBusConnection *connection,
27
43
                                             gpointer        user_data);
 
44
 
 
45
/**
 
46
 * DBusServerSetupFunc:
 
47
 * @server: A DBusConnection
 
48
 * @user_data: User data to be passed to callback function.
 
49
 *
 
50
 * A prototype of DBus server setup function.
 
51
 */
28
52
typedef void (* DBusServerSetupFunc)        (DBusServer     *server,
29
53
                                             gpointer        user_data);
30
54
 
 
55
/**
 
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.
 
60
 *
 
61
 * Sets the watch and timeout functions of a #DBusConnection
 
62
 * and #DBusServer to integrate the connection with the GLib main loop.
 
63
 *
 
64
 * Parameter @user_data should be in type #GMainContext.
 
65
 * It will be passed to both callback functions,
 
66
 * however, normally %NULL is sufficient.
 
67
 *
 
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
 
71
 * connection.
 
72
 *
 
73
 * @see_also: ibus_dbus_connection_setup(), ibus_dbus_server_setup().
 
74
 */
31
75
void    ibus_mainloop_setup         (DBusConnectionSetupFunc      connection_func,
32
76
                                     DBusServerSetupFunc          server_func,
33
77
                                     gpointer                     user_data);
 
78
 
 
79
/**
 
80
 * ibus_dbus_server_setup:
 
81
 * @server: A DBusServer.
 
82
 *
 
83
 * Sets the watch and timeout functions of a #DBusServer
 
84
 * to integrate the server with the GLib main loop.
 
85
 *
 
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.
 
89
 *
 
90
 * @see_also: ibus_mainloop_setup(), dbus_server_setup().
 
91
 */
34
92
void    ibus_dbus_server_setup      (DBusServer                  *server);
 
93
 
 
94
/**
 
95
 * dbus_connection_setup:
 
96
 * @connection: A DBusConnection.
 
97
 *
 
98
 * Sets the watch and timeout functions of a #DBusConnection
 
99
 * to integrate the connection with the GLib main loop.
 
100
 *
 
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.
 
104
 *
 
105
 * @see_also: ibus_mainloop_setup(), dbus_connection_setup().
 
106
 */
35
107
void    ibus_dbus_connection_setup  (DBusConnection              *connection);
36
108
 
37
109
#endif