dbus-server.h

Go to the documentation of this file.
00001 
00027 #ifndef _PURPLE_DBUS_SERVER_H_
00028 #define _PURPLE_DBUS_SERVER_H_
00029 
00030 #include "value.h"
00031 
00032 
00033 G_BEGIN_DECLS
00034 
00047 typedef struct _PurpleDBusType PurpleDBusType;
00048 
00049 struct _PurpleDBusType {
00050     PurpleDBusType *parent;
00051 };
00052 
00053 /* By convention, the PurpleDBusType variable representing each structure
00054    PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
00055    The following macros facilitate defining such variables
00056 
00057    #PURPLE_DBUS_DECLARE_TYPE declares an extern variable representing a
00058    given type, for use in header files.
00059 
00060    #PURPLE_DBUS_DEFINE_TYPE defines a variable representing a given
00061    type, use in .c files.  It defines a new type without a parent; for
00062    types with a parent use #PURPLE_DBUS_DEFINE_INHERITING_TYPE.
00063   */
00064 
00065 #define PURPLE_DBUS_TYPE(type) (&PURPLE_DBUS_TYPE_##type)
00066 
00067 
00068 #define PURPLE_DBUS_DECLARE_TYPE(type) \
00069     extern PurpleDBusType PURPLE_DBUS_TYPE_##type;
00070 
00071 #define PURPLE_DBUS_DEFINE_TYPE(type) \
00072     PurpleDBusType PURPLE_DBUS_TYPE_##type = { NULL };
00073 
00074 #define PURPLE_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
00075     PurpleDBusType PURPLE_DBUS_TYPE_##type = { PURPLE_DBUS_TYPE(parent) };
00076 
00077 #define PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
00078     if (purple_dbus_get_init_error() != NULL) \
00079     { \
00080         gchar *title; \
00081         title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
00082         purple_notify_error(NULL, title, \
00083                 _("Purple's D-BUS server is not running for the reason listed below"), \
00084                 _(purple_dbus_get_init_error())); \
00085         g_free(title); \
00086         return FALSE; \
00087     }
00088 
00116 void purple_dbus_init_ids(void);
00117 
00124 void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type);
00125 
00132 void purple_dbus_unregister_pointer(gpointer node);
00133 
00134 
00135 
00145 void purple_dbus_signal_emit_purple(const char *name, int num_values,
00146                 PurpleValue **values, va_list vargs);
00147 
00162 const char *purple_dbus_get_init_error(void);
00163 
00169 void *purple_dbus_get_handle(void);
00170 
00175 void purple_dbus_init(void);
00176 
00180 void purple_dbus_uninit(void);
00181 
00192 #define DBUS_EXPORT
00193 
00194 /*
00195    Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
00196    all structs defined in purple.  This file has been generated by the
00197    #dbus-analize-types.py script.
00198 */
00199 
00200 #include "dbus-types.h"
00201 
00202 G_END_DECLS
00203 
00204 #endif  /* _PURPLE_DBUS_SERVER_H_ */