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 "dbus-purple.h"
00032 #include "value.h"
00033 
00034 G_BEGIN_DECLS
00035 
00048 typedef struct _PurpleDBusType PurpleDBusType;
00049 
00050 struct _PurpleDBusType {
00051     PurpleDBusType *parent;
00052 };
00053 
00054 #include "dbus-bindings.h"
00055 
00056 /* By convention, the PurpleDBusType variable representing each structure
00057    PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
00058    The following macros facilitate defining such variables
00059 
00060    #PURPLE_DBUS_DECLARE_TYPE declares an extern variable representing a
00061    given type, for use in header files.
00062 
00063    #PURPLE_DBUS_DEFINE_TYPE defines a variable representing a given
00064    type, use in .c files.  It defines a new type without a parent; for
00065    types with a parent use #PURPLE_DBUS_DEFINE_INHERITING_TYPE.
00066   */
00067 
00068 #define PURPLE_DBUS_TYPE(type) (&PURPLE_DBUS_TYPE_##type)
00069 
00070 
00071 #define PURPLE_DBUS_DECLARE_TYPE(type) \
00072     extern PurpleDBusType PURPLE_DBUS_TYPE_##type;
00073 
00074 #define PURPLE_DBUS_DEFINE_TYPE(type) \
00075     PurpleDBusType PURPLE_DBUS_TYPE_##type = { NULL };
00076 
00077 #define PURPLE_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
00078     PurpleDBusType PURPLE_DBUS_TYPE_##type = { PURPLE_DBUS_TYPE(parent) };
00079 
00080 #define PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
00081     if (purple_dbus_get_init_error() != NULL) \
00082     { \
00083         gchar *title; \
00084         title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
00085         purple_notify_error(NULL, title, \
00086                 _("Purple's D-BUS server is not running for the reason listed below"), \
00087                 _(purple_dbus_get_init_error())); \
00088         g_free(title); \
00089         return FALSE; \
00090     }
00091 
00119 void purple_dbus_init_ids(void);
00120 
00127 void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type);
00128 
00135 void purple_dbus_unregister_pointer(gpointer node);
00136 
00137 
00138 
00148 void purple_dbus_signal_emit_purple(const char *name, int num_values,
00149                 PurpleValue **values, va_list vargs);
00150 
00165 const char *purple_dbus_get_init_error(void);
00166 
00172 void *purple_dbus_get_handle(void);
00173 
00179 gboolean purple_dbus_is_owner(void);
00180 
00185 void purple_dbus_init(void);
00186 
00190 void purple_dbus_uninit(void);
00191 
00202 #define DBUS_EXPORT
00203 
00204 /*
00205    Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
00206    all structs defined in purple.  This file has been generated by the
00207    #dbus-analize-types.py script.
00208 */
00209 
00210 #include "dbus-types.h"
00211 
00212 G_END_DECLS
00213 
00214 #endif  /* _PURPLE_DBUS_SERVER_H_ */