pidgin  2.14.10
dbus-server.h
Go to the documentation of this file.
1 
7 /* purple
8  *
9  * Purple is the legal property of its developers, whose names are too numerous
10  * to list here. Please refer to the COPYRIGHT file distributed with this
11  * source distribution.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26  */
27 
28 #ifndef _PURPLE_DBUS_SERVER_H_
29 #define _PURPLE_DBUS_SERVER_H_
30 
31 #include "dbus-purple.h"
32 #include "value.h"
33 
34 G_BEGIN_DECLS
35 
48 typedef struct _PurpleDBusType PurpleDBusType;
49 
51  PurpleDBusType *parent;
52 };
53 
54 #include "dbus-bindings.h"
55 
56 /* By convention, the PurpleDBusType variable representing each structure
57  PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
58  The following macros facilitate defining such variables
59 
60  #PURPLE_DBUS_DECLARE_TYPE declares an extern variable representing a
61  given type, for use in header files.
62 
63  #PURPLE_DBUS_DEFINE_TYPE defines a variable representing a given
64  type, use in .c files. It defines a new type without a parent; for
65  types with a parent use #PURPLE_DBUS_DEFINE_INHERITING_TYPE.
66  */
67 
68 #define PURPLE_DBUS_TYPE(type) (&PURPLE_DBUS_TYPE_##type)
69 
70 
71 #define PURPLE_DBUS_DECLARE_TYPE(type) \
72  extern PurpleDBusType PURPLE_DBUS_TYPE_##type;
73 
74 #define PURPLE_DBUS_DEFINE_TYPE(type) \
75  PurpleDBusType PURPLE_DBUS_TYPE_##type = { NULL };
76 
77 #define PURPLE_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
78  PurpleDBusType PURPLE_DBUS_TYPE_##type = { PURPLE_DBUS_TYPE(parent) };
79 
80 #define PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
81  if (purple_dbus_get_init_error() != NULL) \
82  { \
83  gchar *title; \
84  title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
85  purple_notify_error(NULL, title, \
86  _("Purple's D-BUS server is not running for the reason listed below"), \
87  _(purple_dbus_get_init_error())); \
88  g_free(title); \
89  return FALSE; \
90  }
91 
120 
127 void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type);
128 
135 void purple_dbus_unregister_pointer(gpointer node);
136 
137 
138 
148 void purple_dbus_signal_emit_purple(const char *name, int num_values,
149  PurpleValue **values, va_list vargs);
150 
165 const char *purple_dbus_get_init_error(void);
166 
173 
179 gboolean purple_dbus_is_owner(void);
180 
185 void purple_dbus_init(void);
186 
191 
202 #ifndef DBUS_EXPORT
203 #define DBUS_EXPORT
204 #endif
205 
206 /*
207  Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
208  all structs defined in purple. This file has been generated by the
209  #dbus-analyze-types.py script.
210 */
211 
212 #include "dbus-types.h"
213 
214 G_END_DECLS
215 
216 #endif /* _PURPLE_DBUS_SERVER_H_ */
Purple DBUS Bindings.
typedefG_BEGIN_DECLS struct _PurpleDBusType PurpleDBusType
Types of pointers are identified by the ADDRESS of a PurpleDbusType object.
Definition: dbus-server.h:48
void purple_dbus_uninit(void)
Uninitializes Purple's D-BUS server.
void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type)
Registers a typed pointer.
void purple_dbus_unregister_pointer(gpointer node)
Unregisters a pointer previously registered with purple_dbus_register_pointer.
gboolean purple_dbus_is_owner(void)
Determines whether this instance owns the DBus service name.
void purple_dbus_init_ids(void)
Initializes purple dbus pointer registration engine.
void purple_dbus_init(void)
Starts Purple's D-BUS server.
void * purple_dbus_get_handle(void)
Returns the dbus subsystem handle.
void purple_dbus_signal_emit_purple(const char *name, int num_values, PurpleValue **values, va_list vargs)
Emits a dbus signal.
const char * purple_dbus_get_init_error(void)
Returns whether Purple's D-BUS subsystem is up and running.
A wrapper for a type, subtype, and specific type of value.
Definition: value.h:90
Value wrapper API.