Mercurial > pidgin.yaz
annotate src/dbus-bindings.h @ 11801:81806e9241be
[gaim-migrate @ 14092]
Cleanups, mostly // -> /* */ and moved g_print's to gaim_debug_info, and a few c99ism fixes..
committer: Tailor Script <tailor@pidgin.im>
author | Gary Kramlich <grim@reaperworld.com> |
---|---|
date | Mon, 24 Oct 2005 21:48:21 +0000 |
parents | 9563b768e8e2 |
children | b1099e09eb33 |
rev | line source |
---|---|
11174 | 1 /** |
11501
9563b768e8e2
[gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents:
11187
diff
changeset
|
2 * @file dbus-bindings.h Gaim DBUS Bindings |
11174 | 3 * @ingroup core |
4 * | |
5 * gaim | |
6 * | |
7 * Gaim is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 * | |
25 */ | |
26 | |
27 #ifndef _GAIM_DBUS_BINDINGS_H_ | |
28 #define _GAIM_DBUS_BINDINGS_H_ | |
29 | |
30 #include <dbus/dbus.h> | |
31 #include <dbus/dbus-glib-lowlevel.h> | |
32 #include <glib.h> | |
33 | |
34 gint gaim_dbus_pointer_to_id(gpointer node); | |
35 gpointer gaim_dbus_id_to_pointer(gint id, GaimDBusType *type); | |
36 gint gaim_dbus_pointer_to_id_error(gpointer ptr, DBusError *error); | |
37 gpointer gaim_dbus_id_to_pointer_error(gint id, GaimDBusType *type, | |
38 const char *typename, DBusError *error); | |
39 | |
40 #define NULLIFY(id) id = empty_to_null(id) | |
41 | |
42 #define CHECK_ERROR(error) if (dbus_error_is_set(error)) return NULL; | |
43 | |
44 #define GAIM_DBUS_ID_TO_POINTER(ptr, id, type, error) \ | |
45 G_STMT_START { \ | |
46 ptr = (type*) gaim_dbus_id_to_pointer_error \ | |
47 (id, GAIM_DBUS_TYPE(type), #type, error); \ | |
48 CHECK_ERROR(error); \ | |
49 } G_STMT_END | |
50 | |
51 | |
52 | |
53 #define GAIM_DBUS_POINTER_TO_ID(id, ptr, error) \ | |
54 G_STMT_START { \ | |
55 id = gaim_dbus_pointer_to_id_error(ptr,error); \ | |
56 CHECK_ERROR(error); \ | |
57 } G_STMT_END | |
58 | |
11187 | 59 |
60 dbus_bool_t | |
61 gaim_dbus_message_get_args (DBusMessage *message, | |
62 DBusError *error, | |
63 int first_arg_type, | |
64 ...); | |
65 dbus_bool_t | |
66 gaim_dbus_message_get_args_valist (DBusMessage *message, | |
67 DBusError *error, | |
68 int first_arg_type, | |
69 va_list var_args); | |
70 | |
71 dbus_bool_t | |
72 gaim_dbus_message_iter_get_args (DBusMessageIter *iter, | |
73 DBusError *error, | |
74 int first_arg_type, | |
75 ...); | |
76 | |
77 dbus_bool_t | |
78 gaim_dbus_message_iter_get_args_valist (DBusMessageIter *iter, | |
79 DBusError *error, | |
80 int first_arg_type, | |
81 va_list var_args); | |
82 | |
11174 | 83 dbus_int32_t* gaim_dbusify_GList(GList *list, gboolean free_memory, |
84 dbus_int32_t *len); | |
85 dbus_int32_t* gaim_dbusify_GSList(GSList *list, gboolean free_memory, | |
86 dbus_int32_t *len); | |
11187 | 87 gpointer* gaim_GList_to_array(GList *list, gboolean free_memory, |
88 dbus_int32_t *len); | |
89 gpointer* gaim_GSList_to_array(GSList *list, gboolean free_memory, | |
90 dbus_int32_t *len); | |
91 GHashTable *gaim_dbus_iter_hash_table(DBusMessageIter *iter, DBusError *error); | |
92 | |
11174 | 93 const char* empty_to_null(const char *str); |
94 const char* null_to_empty(const char *s); | |
95 | |
96 typedef struct { | |
97 const char *name; | |
98 const char *parameters; | |
99 DBusMessage* (*handler)(DBusMessage *request, DBusError *error); | |
100 } GaimDBusBinding; | |
101 | |
102 void gaim_dbus_register_bindings(void *handle, GaimDBusBinding *bindings); | |
103 | |
104 DBusConnection *gaim_dbus_get_connection(void); | |
105 | |
106 #endif |