3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
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 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #ifndef _PURPLE_DBUS_BINDINGS_H_
24 #define _PURPLE_DBUS_BINDINGS_H_
26 * SECTION:dbus-bindings
27 * @section_id: libpurple-dbus-bindings
28 * @short_description: <filename>dbus-bindings.h</filename>
29 * @title: DBUS Bindings
32 #include <dbus/dbus.h>
33 #include <dbus/dbus-glib-lowlevel.h>
38 gint
purple_dbus_pointer_to_id(gconstpointer node
);
39 gpointer
purple_dbus_id_to_pointer(gint id
, PurpleDBusType
*type
);
40 gint
purple_dbus_pointer_to_id_error(gconstpointer ptr
, DBusError
*error
);
41 gpointer
purple_dbus_id_to_pointer_error(gint id
, PurpleDBusType
*type
,
42 const char *typename
, DBusError
*error
);
44 #define NULLIFY(id) id = purple_emptystr_to_null(id)
46 #define CHECK_ERROR(error) if (dbus_error_is_set(error)) return NULL;
48 #define PURPLE_DBUS_ID_TO_POINTER(ptr, id, type, error) \
50 ptr = (type*) purple_dbus_id_to_pointer_error \
51 (id, PURPLE_DBUS_TYPE(type), #type, error); \
56 #define PURPLE_DBUS_POINTER_TO_ID(id, ptr, error) \
58 id = purple_dbus_pointer_to_id_error(ptr,error); \
64 purple_dbus_message_get_args (DBusMessage
*message
,
69 purple_dbus_message_get_args_valist (DBusMessage
*message
,
75 purple_dbus_message_iter_get_args (DBusMessageIter
*iter
,
81 purple_dbus_message_iter_get_args_valist (DBusMessageIter
*iter
,
86 dbus_int32_t
* purple_dbusify_GList(GList
*list
, dbus_int32_t
*len
);
87 dbus_int32_t
* purple_dbusify_GSList(GSList
*list
, dbus_int32_t
*len
);
88 gpointer
* purple_GList_to_array(GList
*list
, dbus_int32_t
*len
);
89 gpointer
* purple_GSList_to_array(GSList
*list
, dbus_int32_t
*len
);
90 GHashTable
*purple_dbus_iter_hash_table(DBusMessageIter
*iter
, DBusError
*error
);
92 const char* purple_emptystr_to_null(const char *str
);
93 const char* purple_null_to_emptystr(const char *s
);
97 const char *parameters
;
98 DBusMessage
* (*handler
)(DBusMessage
*request
, DBusError
*error
);
101 void purple_dbus_register_bindings(void *handle
, PurpleDBusBinding
*bindings
);
103 DBusConnection
*purple_dbus_get_connection(void);