14192
+ ��膩��� 1 /**
+ ��膩��� 2 * @file dbus-bindings.h Gaim DBUS Bindings
+ ��膩��� 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 #ifdef __cplusplus
+ ��膩��� 35 extern "C" {
+ ��膩��� 36 #endif
+ ��膩��� 37
+ ��膩��� 38 gint gaim_dbus_pointer_to_id(gpointer node);
+ ��膩��� 39 gpointer gaim_dbus_id_to_pointer(gint id, GaimDBusType *type);
+ ��膩��� 40 gint gaim_dbus_pointer_to_id_error(gpointer ptr, DBusError *error);
+ ��膩��� 41 gpointer gaim_dbus_id_to_pointer_error(gint id, GaimDBusType *type,
+ ��膩��� 42 const char *typename, DBusError *error);
+ ��膩��� 43
+ ��膩��� 44 #define NULLIFY(id) id = empty_to_null(id)
+ ��膩��� 45
+ ��膩��� 46 #define CHECK_ERROR(error) if (dbus_error_is_set(error)) return NULL;
+ ��膩��� 47
+ ��膩��� 48 #define GAIM_DBUS_ID_TO_POINTER(ptr, id, type, error) \
+ ��膩��� 49 G_STMT_START { \
+ ��膩��� 50 ptr = (type*) gaim_dbus_id_to_pointer_error \
+ ��膩��� 51 (id, GAIM_DBUS_TYPE(type), #type, error); \
+ ��膩��� 52 CHECK_ERROR(error); \
+ ��膩��� 53 } G_STMT_END
+ ��膩��� 54
+ ��膩��� 55
+ ��膩��� 56 #define GAIM_DBUS_POINTER_TO_ID(id, ptr, error) \
+ ��膩��� 57 G_STMT_START { \
+ ��膩��� 58 id = gaim_dbus_pointer_to_id_error(ptr,error); \
+ ��膩��� 59 CHECK_ERROR(error); \
+ ��膩��� 60 } G_STMT_END
+ ��膩��� 61
+ ��膩��� 62
+ ��膩��� 63 dbus_bool_t
+ ��膩��� 64 gaim_dbus_message_get_args (DBusMessage *message,
+ ��膩��� 65 DBusError *error,
+ ��膩��� 66 int first_arg_type,
+ ��膩��� 67 ...);
+ ��膩��� 68 dbus_bool_t
+ ��膩��� 69 gaim_dbus_message_get_args_valist (DBusMessage *message,
+ ��膩��� 70 DBusError *error,
+ ��膩��� 71 int first_arg_type,
+ ��膩��� 72 va_list var_args);
+ ��膩��� 73
+ ��膩��� 74 dbus_bool_t
+ ��膩��� 75 gaim_dbus_message_iter_get_args (DBusMessageIter *iter,
+ ��膩��� 76 DBusError *error,
+ ��膩��� 77 int first_arg_type,
+ ��膩��� 78 ...);
+ ��膩��� 79
+ ��膩��� 80 dbus_bool_t
+ ��膩��� 81 gaim_dbus_message_iter_get_args_valist (DBusMessageIter *iter,
+ ��膩��� 82 DBusError *error,
+ ��膩��� 83 int first_arg_type,
+ ��膩��� 84 va_list var_args);
+ ��膩��� 85
+ ��膩��� 86 dbus_int32_t* gaim_dbusify_GList(GList *list, gboolean free_memory,
+ ��膩��� 87 dbus_int32_t *len);
+ ��膩��� 88 dbus_int32_t* gaim_dbusify_GSList(GSList *list, gboolean free_memory,
+ ��膩��� 89 dbus_int32_t *len);
+ ��膩��� 90 gpointer* gaim_GList_to_array(GList *list, gboolean free_memory,
+ ��膩��� 91 dbus_int32_t *len);
+ ��膩��� 92 gpointer* gaim_GSList_to_array(GSList *list, gboolean free_memory,
+ ��膩��� 93 dbus_int32_t *len);
+ ��膩��� 94 GHashTable *gaim_dbus_iter_hash_table(DBusMessageIter *iter, DBusError *error);
+ ��膩��� 95
+ ��膩��� 96 const char* empty_to_null(const char *str);
+ ��膩��� 97 const char* null_to_empty(const char *s);
+ ��膩��� 98
+ ��膩��� 99 typedef struct {
+ ��膩��� 100 const char *name;
+ ��膩��� 101 const char *parameters;
+ ��膩��� 102 DBusMessage* (*handler)(DBusMessage *request, DBusError *error);
+ ��膩��� 103 } GaimDBusBinding;
+ ��膩��� 104
+ ��膩��� 105 void gaim_dbus_register_bindings(void *handle, GaimDBusBinding *bindings);
+ ��膩��� 106
+ ��膩��� 107 DBusConnection *gaim_dbus_get_connection(void);
+ ��膩��� 108
+ ��膩��� 109 #ifdef __cplusplus
+ ��膩��� 110 }
+ ��膩��� 111 #endif
+ ��膩��� 112
+ ��膩��� 113 #endif