annotate src/dbus-server.h @ 14170:b1ce2e9e494a

[gaim-migrate @ 16820] Fix CID 250 (also change the behavior to be slightly more sane) and 213 (which wouldn't happen unless the sasl library returned some weird values) committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 17 Aug 2006 23:58:58 +0000
parents 8bda65b88e49
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11055
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
1 /**
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
2 * @file dbus-server.h Gaim DBUS Server
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
3 * @ingroup core
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
4 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
5 * gaim
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
6 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
9 * source distribution.
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
10 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
14 * (at your option) any later version.
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
15 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
19 * GNU General Public License for more details.
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
20 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
24 *
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
25 */
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
26
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
27 #ifndef _GAIM_DBUS_SERVER_H_
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
28 #define _GAIM_DBUS_SERVER_H_
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
29
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
30 #include "value.h"
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
31
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
32
11055
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
33 G_BEGIN_DECLS
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
34
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
35 /**
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
36 Types of pointers are identified by the ADDRESS of a GaimDbusType
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
37 object. This way, plugins can easily access types defined in gaim
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
38 proper as well as introduce their own types that will not conflict
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
39 with those introduced by other plugins.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
40
11501
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
41 The structure GaimDbusType has only one element (GaimDBusType::parent), a
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
42 contains a pointer to the parent type, or @c NULL if the type has no
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
43 parent. Parent means the same as the base class in object oriented
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
44 programming.
11501
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
45 */
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
46
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
47 typedef struct _GaimDBusType GaimDBusType;
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
48
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
49 struct _GaimDBusType {
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
50 GaimDBusType *parent;
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
51 };
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
52
13783
a539caf502b0 [gaim-migrate @ 16195]
Richard Laager <rlaager@wiktel.com>
parents: 12627
diff changeset
53 /* By convention, the GaimDBusType variable representing each structure
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
54 GaimSomeStructure has the name GAIM_DBUS_TYPE_GaimSomeStructure.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
55 The following macros facilitate defining such variables
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
56
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
57 #GAIM_DBUS_DECLARE_TYPE declares an extern variable representing a
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
58 given type, for use in header files.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
59
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
60 #GAIM_DBUS_DEFINE_TYPE defines a variable representing a given
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
61 type, use in .c files. It defines a new type without a parent; for
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
62 types with a parent use #GAIM_DBUS_DEFINE_INHERITING_TYPE.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
63 */
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
64
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
65 #define GAIM_DBUS_TYPE(type) (&GAIM_DBUS_TYPE_##type)
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
66
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
67
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
68 #define GAIM_DBUS_DECLARE_TYPE(type) \
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
69 extern GaimDBusType GAIM_DBUS_TYPE_##type;
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
70
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
71 #define GAIM_DBUS_DEFINE_TYPE(type) \
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
72 GaimDBusType GAIM_DBUS_TYPE_##type = { NULL };
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
73
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
74 #define GAIM_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
75 GaimDBusType GAIM_DBUS_TYPE_##type = { GAIM_DBUS_TYPE(parent) };
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
76
13956
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
77 #define GAIM_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
78 if (gaim_dbus_get_init_error() != NULL) \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
79 { \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
80 gchar *title; \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
81 title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
82 gaim_notify_error(NULL, title, \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
83 _("Gaim's D-BUS server is not running for the reason listed below"), \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
84 _(gaim_dbus_get_init_error())); \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
85 g_free(title); \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
86 return FALSE; \
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
87 }
11055
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
88
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
89 /**
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
90 Initializes gaim dbus pointer registration engine.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
91
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
92 Remote dbus applications need a way of addressing objects exposed
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
93 by gaim to the outside world. In gaim itself, these objects (such
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
94 as GaimBuddy and company) are identified by pointers. The gaim
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
95 dbus pointer registration engine converts pointers to handles and
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
96 back.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
97
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
98 In order for an object to participate in the scheme, it must
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
99 register itself and its type with the engine. This registration
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
100 allocates an integer id which can be resolved to the pointer and
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
101 back.
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
102
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
103 Handles are not persistent. They are reissued every time gaim is
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
104 started. This is not good; external applications that use gaim
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
105 should work even whether gaim was restarted in the middle of the
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
106 interaction.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
107
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
108 Pointer registration is only a temporary solution. When GaimBuddy
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
109 and similar structures have been converted into gobjects, this
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
110 registration will be done automatically by objects themselves.
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
111
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
112 By the way, this kind of object-handle translation should be so
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
113 common that there must be a library (maybe even glib) that
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
114 implements it. I feel a bit like reinventing the wheel here.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
115 */
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
116 void gaim_dbus_init_ids(void);
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
117
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
118 /**
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
119 Registers a typed pointer.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
120
11129
0754ce8f1122 [gaim-migrate @ 13185]
Mark Doliner <mark@kingant.net>
parents: 11080
diff changeset
121 @param node The pointer to register.
0754ce8f1122 [gaim-migrate @ 13185]
Mark Doliner <mark@kingant.net>
parents: 11080
diff changeset
122 @param type Type of that pointer.
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
123 */
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
124 void gaim_dbus_register_pointer(gpointer node, GaimDBusType *type);
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
125
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
126 /**
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
127 Unregisters a pointer previously registered with
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
128 gaim_dbus_register_pointer.
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
129
11129
0754ce8f1122 [gaim-migrate @ 13185]
Mark Doliner <mark@kingant.net>
parents: 11080
diff changeset
130 @param node The pointer to register.
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
131 */
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
132 void gaim_dbus_unregister_pointer(gpointer node);
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
133
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
134
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
135
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
136 /**
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
137 Emits a dbus signal.
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
138
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
139 @param name The name of the signal ("bla-bla-blaa")
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
140 @param num_values The number of parameters.
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
141 @param values Array of pointers to #GaimValue objects representing
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
142 the types of the parameters.
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
143 @param vargs A va_list containing the actual parameters.
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
144 */
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
145 void gaim_dbus_signal_emit_gaim(const char *name, int num_values,
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
146 GaimValue **values, va_list vargs);
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
147
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
148 /**
13955
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
149 * Returns whether Gaim's D-BUS subsystem is up and running. If it's
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
150 * NOT running then gaim_dbus_dispatch_init() failed for some reason,
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
151 * and a message should have been gaim_debug_error()'ed.
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
152 *
13956
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
153 * Gaim plugins that use D-BUS should use the
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
154 * GAIM_DBUS_RETURN_FALSE_IF_DISABLED macro to short-circuit
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13955
diff changeset
155 * initialization if Gaim's D-BUS subsystem is not running.
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
156 *
13955
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
157 * @return If the D-BUS subsystem started with no problems then this
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
158 * will return NULL and everything will be hunky dory. If
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
159 * there was an error initializing the D-BUS subsystem then
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
160 * this will return an error message explaining why.
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
161 */
13955
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
162 const char *gaim_dbus_get_init_error(void);
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
163
12627
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
164 /**
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
165 * Returns the dbus subsystem handle.
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
166 *
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
167 * @return The dbus subsystem handle.
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
168 */
2078f65a8e98 [gaim-migrate @ 14963]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11903
diff changeset
169 void *gaim_dbus_get_handle(void);
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11067
diff changeset
170
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
171 /**
13955
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
172 * Starts Gaim's D-BUS server. It is responsible for handling DBUS
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
173 * requests from other applications.
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
174 */
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
175 void gaim_dbus_init(void);
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
176
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
177 /**
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
178 * Uninitializes Gaim's D-BUS server.
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
179 */
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
180 void gaim_dbus_uninit(void);
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
181
2d6f7ac4b6f2 [gaim-migrate @ 16503]
Mark Doliner <mark@kingant.net>
parents: 13783
diff changeset
182 /**
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
183
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
184 Macro #DBUS_EXPORT expands to nothing. It is used to indicate to the
11501
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
185 dbus-analize-functions.py script that the given function should be
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
186 available to other applications through DBUS. If
11501
9563b768e8e2 [gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents: 11171
diff changeset
187 dbus-analize-functions.py is run without the "--export-only" option,
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
188 this prefix is ignored.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
189
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
190 */
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
191
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
192 #define DBUS_EXPORT
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
193
14035
8bda65b88e49 [gaim-migrate @ 16638]
Mark Doliner <mark@kingant.net>
parents: 13956
diff changeset
194 /*
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
195 Here we include the list of #GAIM_DBUS_DECLARE_TYPE statements for
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
196 all structs defined in gaim. This file has been generated by the
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
197 #dbus-analize-types.py script.
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
198 */
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
199
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
200 #include "dbus-types.h"
11067
2eca9ed49469 [gaim-migrate @ 13048]
Piotr Zielinski <zielaj>
parents: 11055
diff changeset
201
11055
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
202 G_END_DECLS
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
203
df0241eb602c [gaim-migrate @ 12996]
Piotr Zielinski <zielaj>
parents:
diff changeset
204 #endif /* _GAIM_DBUS_SERVER_H_ */