dbus-server.h

Go to the documentation of this file.
00001 
00007 /* purple
00008  *
00009  * Purple is the legal property of its developers, whose names are too numerous
00010  * to list here.  Please refer to the COPYRIGHT file distributed with this
00011  * source distribution.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00026  */
00027 
00028 #ifndef _PURPLE_DBUS_SERVER_H_
00029 #define _PURPLE_DBUS_SERVER_H_
00030 
00031 #include "value.h"
00032 
00033 
00034 G_BEGIN_DECLS
00035 
00048 typedef struct _PurpleDBusType PurpleDBusType;
00049 
00050 struct _PurpleDBusType {
00051     PurpleDBusType *parent;
00052 };
00053 
00054 /* By convention, the PurpleDBusType variable representing each structure
00055    PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
00056    The following macros facilitate defining such variables
00057 
00058    #PURPLE_DBUS_DECLARE_TYPE declares an extern variable representing a
00059    given type, for use in header files.
00060 
00061    #PURPLE_DBUS_DEFINE_TYPE defines a variable representing a given
00062    type, use in .c files.  It defines a new type without a parent; for
00063    types with a parent use #PURPLE_DBUS_DEFINE_INHERITING_TYPE.
00064   */
00065 
00066 #define PURPLE_DBUS_TYPE(type) (&PURPLE_DBUS_TYPE_##type)
00067 
00068 
00069 #define PURPLE_DBUS_DECLARE_TYPE(type) \
00070     extern PurpleDBusType PURPLE_DBUS_TYPE_##type;
00071 
00072 #define PURPLE_DBUS_DEFINE_TYPE(type) \
00073     PurpleDBusType PURPLE_DBUS_TYPE_##type = { NULL };
00074 
00075 #define PURPLE_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
00076     PurpleDBusType PURPLE_DBUS_TYPE_##type = { PURPLE_DBUS_TYPE(parent) };
00077 
00078 #define PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
00079     if (purple_dbus_get_init_error() != NULL) \
00080     { \
00081         gchar *title; \
00082         title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
00083         purple_notify_error(NULL, title, \
00084                 _("Purple's D-BUS server is not running for the reason listed below"), \
00085                 _(purple_dbus_get_init_error())); \
00086         g_free(title); \
00087         return FALSE; \
00088     }
00089 
00117 void purple_dbus_init_ids(void);
00118 
00125 void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type);
00126 
00133 void purple_dbus_unregister_pointer(gpointer node);
00134 
00135 
00136 
00146 void purple_dbus_signal_emit_purple(const char *name, int num_values,
00147                 PurpleValue **values, va_list vargs);
00148 
00163 const char *purple_dbus_get_init_error(void);
00164 
00170 void *purple_dbus_get_handle(void);
00171 
00177 gboolean purple_dbus_is_owner(void);
00178 
00183 void purple_dbus_init(void);
00184 
00188 void purple_dbus_uninit(void);
00189 
00200 #define DBUS_EXPORT
00201 
00202 /*
00203    Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
00204    all structs defined in purple.  This file has been generated by the
00205    #dbus-analize-types.py script.
00206 */
00207 
00208 #include "dbus-types.h"
00209 
00210 G_END_DECLS
00211 
00212 #endif  /* _PURPLE_DBUS_SERVER_H_ */