0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtDBus module of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
//
|
|
43 |
// W A R N I N G
|
|
44 |
// -------------
|
|
45 |
//
|
|
46 |
// This file is not part of the public API. This header file may
|
|
47 |
// change from version to version without notice, or even be
|
|
48 |
// removed.
|
|
49 |
//
|
|
50 |
// We mean it.
|
|
51 |
//
|
|
52 |
//
|
|
53 |
|
|
54 |
#ifndef QDBUS_SYMBOLS_P_H
|
|
55 |
#define QDBUS_SYMBOLS_P_H
|
|
56 |
|
|
57 |
#include <QtCore/qglobal.h>
|
|
58 |
#include <dbus/dbus.h>
|
|
59 |
|
|
60 |
QT_BEGIN_NAMESPACE
|
|
61 |
|
|
62 |
#if !defined QT_LINKED_LIBDBUS
|
|
63 |
|
|
64 |
void *qdbus_resolve_conditionally(const char *name); // doesn't print a warning
|
|
65 |
void *qdbus_resolve_me(const char *name); // prints a warning
|
|
66 |
bool qdbus_loadLibDBus();
|
|
67 |
|
|
68 |
# define DEFINEFUNC(ret, func, args, argcall, funcret) \
|
|
69 |
typedef ret (* _q_PTR_##func) args; \
|
|
70 |
static inline ret q_##func args \
|
|
71 |
{ \
|
|
72 |
static _q_PTR_##func ptr; \
|
|
73 |
if (!ptr) \
|
|
74 |
ptr = (_q_PTR_##func) qdbus_resolve_me(#func); \
|
|
75 |
funcret ptr argcall; \
|
|
76 |
}
|
|
77 |
|
|
78 |
#else // defined QT_LINKED_LIBDBUS
|
|
79 |
|
|
80 |
inline bool qdbus_loadLibDBus() { return true; }
|
|
81 |
|
|
82 |
# define DEFINEFUNC(ret, func, args, argcall, funcret) \
|
|
83 |
static inline ret q_##func args { funcret func argcall; }
|
|
84 |
|
|
85 |
#endif // defined QT_LINKED_LIBDBUS
|
|
86 |
|
|
87 |
/* dbus-bus.h */
|
|
88 |
DEFINEFUNC(void, dbus_bus_add_match, (DBusConnection *connection,
|
|
89 |
const char *rule,
|
|
90 |
DBusError *error),
|
|
91 |
(connection, rule, error), )
|
|
92 |
DEFINEFUNC(void, dbus_bus_remove_match, (DBusConnection *connection,
|
|
93 |
const char *rule,
|
|
94 |
DBusError *error),
|
|
95 |
(connection, rule, error), )
|
|
96 |
DEFINEFUNC(dbus_bool_t, dbus_bus_register,(DBusConnection *connection,
|
|
97 |
DBusError *error),
|
|
98 |
(connection, error), return)
|
|
99 |
DEFINEFUNC(DBusConnection *, dbus_bus_get_private, (DBusBusType type,
|
|
100 |
DBusError *error),
|
|
101 |
(type, error), return)
|
|
102 |
DEFINEFUNC(const char*, dbus_bus_get_unique_name, (DBusConnection *connection),
|
|
103 |
(connection), return)
|
|
104 |
|
|
105 |
/* dbus-connection.h */
|
|
106 |
DEFINEFUNC(dbus_bool_t , dbus_connection_add_filter, (DBusConnection *connection,
|
|
107 |
DBusHandleMessageFunction function,
|
|
108 |
void *user_data,
|
|
109 |
DBusFreeFunction free_data_function),
|
|
110 |
(connection, function, user_data, free_data_function), return)
|
|
111 |
DEFINEFUNC(void , dbus_connection_close, (DBusConnection *connection),
|
|
112 |
(connection), return)
|
|
113 |
DEFINEFUNC(DBusDispatchStatus , dbus_connection_dispatch, (DBusConnection *connection),
|
|
114 |
(connection), return)
|
|
115 |
DEFINEFUNC(DBusDispatchStatus , dbus_connection_get_dispatch_status, (DBusConnection *connection),
|
|
116 |
(connection), return)
|
|
117 |
DEFINEFUNC(dbus_bool_t , dbus_connection_get_is_connected, (DBusConnection *connection),
|
|
118 |
(connection), return)
|
|
119 |
DEFINEFUNC(DBusConnection* , dbus_connection_open_private, (const char *address,
|
|
120 |
DBusError *error),
|
|
121 |
(address, error), return)
|
|
122 |
DEFINEFUNC(DBusConnection* , dbus_connection_ref, (DBusConnection *connection),
|
|
123 |
(connection), return)
|
|
124 |
DEFINEFUNC(dbus_bool_t , dbus_connection_send, (DBusConnection *connection,
|
|
125 |
DBusMessage *message,
|
|
126 |
dbus_uint32_t *client_serial),
|
|
127 |
(connection, message, client_serial), return)
|
|
128 |
DEFINEFUNC(dbus_bool_t , dbus_connection_send_with_reply, (DBusConnection *connection,
|
|
129 |
DBusMessage *message,
|
|
130 |
DBusPendingCall **pending_return,
|
|
131 |
int timeout_milliseconds),
|
|
132 |
(connection, message, pending_return, timeout_milliseconds), return)
|
|
133 |
DEFINEFUNC(DBusMessage * , dbus_connection_send_with_reply_and_block, (DBusConnection *connection,
|
|
134 |
DBusMessage *message,
|
|
135 |
int timeout_milliseconds,
|
|
136 |
DBusError *error),
|
|
137 |
(connection, message, timeout_milliseconds, error), return)
|
|
138 |
DEFINEFUNC(void , dbus_connection_set_exit_on_disconnect, (DBusConnection *connection,
|
|
139 |
dbus_bool_t exit_on_disconnect),
|
|
140 |
(connection, exit_on_disconnect), )
|
|
141 |
DEFINEFUNC(dbus_bool_t , dbus_connection_set_timeout_functions, (DBusConnection *connection,
|
|
142 |
DBusAddTimeoutFunction add_function,
|
|
143 |
DBusRemoveTimeoutFunction remove_function,
|
|
144 |
DBusTimeoutToggledFunction toggled_function,
|
|
145 |
void *data,
|
|
146 |
DBusFreeFunction free_data_function),
|
|
147 |
(connection, add_function, remove_function, toggled_function, data, free_data_function), return)
|
|
148 |
DEFINEFUNC(dbus_bool_t , dbus_connection_set_watch_functions, (DBusConnection *connection,
|
|
149 |
DBusAddWatchFunction add_function,
|
|
150 |
DBusRemoveWatchFunction remove_function,
|
|
151 |
DBusWatchToggledFunction toggled_function,
|
|
152 |
void *data,
|
|
153 |
DBusFreeFunction free_data_function),
|
|
154 |
(connection, add_function, remove_function, toggled_function, data, free_data_function), return)
|
|
155 |
DEFINEFUNC(void , dbus_connection_set_wakeup_main_function, (DBusConnection *connection,
|
|
156 |
DBusWakeupMainFunction wakeup_main_function,
|
|
157 |
void *data,
|
|
158 |
DBusFreeFunction free_data_function),
|
|
159 |
(connection, wakeup_main_function, data, free_data_function), )
|
|
160 |
DEFINEFUNC(void , dbus_connection_set_dispatch_status_function, (DBusConnection *connection,
|
|
161 |
DBusDispatchStatusFunction function,
|
|
162 |
void *data,
|
|
163 |
DBusFreeFunction free_data_function),
|
|
164 |
(connection, function, data, free_data_function), )
|
|
165 |
|
|
166 |
DEFINEFUNC(void , dbus_connection_unref, (DBusConnection *connection),
|
|
167 |
(connection), )
|
|
168 |
DEFINEFUNC(dbus_bool_t , dbus_timeout_get_enabled, (DBusTimeout *timeout),
|
|
169 |
(timeout), return)
|
|
170 |
DEFINEFUNC(int , dbus_timeout_get_interval, (DBusTimeout *timeout),
|
|
171 |
(timeout), return)
|
|
172 |
DEFINEFUNC(dbus_bool_t , dbus_timeout_handle, (DBusTimeout *timeout),
|
|
173 |
(timeout), return)
|
|
174 |
|
|
175 |
DEFINEFUNC(dbus_bool_t , dbus_watch_get_enabled, (DBusWatch *watch),
|
|
176 |
(watch), return)
|
|
177 |
DEFINEFUNC(int , dbus_watch_get_fd, (DBusWatch *watch),
|
|
178 |
(watch), return)
|
|
179 |
DEFINEFUNC(unsigned int , dbus_watch_get_flags, (DBusWatch *watch),
|
|
180 |
(watch), return)
|
|
181 |
DEFINEFUNC(dbus_bool_t , dbus_watch_handle, (DBusWatch *watch,
|
|
182 |
unsigned int flags),
|
|
183 |
(watch, flags), return)
|
|
184 |
|
|
185 |
/* dbus-errors.h */
|
|
186 |
DEFINEFUNC(void , dbus_error_free, (DBusError *error),
|
|
187 |
(error), )
|
|
188 |
DEFINEFUNC(void , dbus_error_init, (DBusError *error),
|
|
189 |
(error), )
|
|
190 |
DEFINEFUNC(dbus_bool_t , dbus_error_is_set, (const DBusError *error),
|
|
191 |
(error), return)
|
|
192 |
|
|
193 |
/* dbus-memory.h */
|
|
194 |
DEFINEFUNC(void , dbus_free, (void *memory), (memory), )
|
|
195 |
|
|
196 |
/* dbus-message.h */
|
|
197 |
DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
|
|
198 |
(message), return)
|
|
199 |
DEFINEFUNC(const char* , dbus_message_get_error_name, (DBusMessage *message),
|
|
200 |
(message), return)
|
|
201 |
DEFINEFUNC(const char* , dbus_message_get_interface, (DBusMessage *message),
|
|
202 |
(message), return)
|
|
203 |
DEFINEFUNC(const char* , dbus_message_get_member, (DBusMessage *message),
|
|
204 |
(message), return)
|
|
205 |
DEFINEFUNC(dbus_bool_t , dbus_message_get_no_reply, (DBusMessage *message),
|
|
206 |
(message), return)
|
|
207 |
DEFINEFUNC(const char* , dbus_message_get_path, (DBusMessage *message),
|
|
208 |
(message), return)
|
|
209 |
DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message),
|
|
210 |
(message), return)
|
|
211 |
DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message),
|
|
212 |
(message), return)
|
|
213 |
DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message),
|
|
214 |
(message), return)
|
|
215 |
DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message),
|
|
216 |
(message), return)
|
|
217 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_basic, (DBusMessageIter *iter,
|
|
218 |
int type,
|
|
219 |
const void *value),
|
|
220 |
(iter, type, value), return)
|
|
221 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_fixed_array, (DBusMessageIter *iter,
|
|
222 |
int element_type,
|
|
223 |
const void *value,
|
|
224 |
int n_elements),
|
|
225 |
(iter, element_type, value, n_elements), return)
|
|
226 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_close_container, (DBusMessageIter *iter,
|
|
227 |
DBusMessageIter *sub),
|
|
228 |
(iter, sub), return)
|
|
229 |
DEFINEFUNC(int , dbus_message_iter_get_arg_type, (DBusMessageIter *iter),
|
|
230 |
(iter), return)
|
|
231 |
DEFINEFUNC(void , dbus_message_iter_get_basic, (DBusMessageIter *iter,
|
|
232 |
void *value),
|
|
233 |
(iter, value), )
|
|
234 |
DEFINEFUNC(int , dbus_message_iter_get_element_type, (DBusMessageIter *iter),
|
|
235 |
(iter), return)
|
|
236 |
DEFINEFUNC(void , dbus_message_iter_get_fixed_array, (DBusMessageIter *iter,
|
|
237 |
void *value,
|
|
238 |
int *n_elements),
|
|
239 |
(iter, value, n_elements), return)
|
|
240 |
DEFINEFUNC(char* , dbus_message_iter_get_signature, (DBusMessageIter *iter),
|
|
241 |
(iter), return)
|
|
242 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_init, (DBusMessage *message,
|
|
243 |
DBusMessageIter *iter),
|
|
244 |
(message, iter), return)
|
|
245 |
DEFINEFUNC(void , dbus_message_iter_init_append, (DBusMessage *message,
|
|
246 |
DBusMessageIter *iter),
|
|
247 |
(message, iter), return)
|
|
248 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_next, (DBusMessageIter *iter),
|
|
249 |
(iter), return)
|
|
250 |
DEFINEFUNC(dbus_bool_t , dbus_message_iter_open_container, (DBusMessageIter *iter,
|
|
251 |
int type,
|
|
252 |
const char *contained_signature,
|
|
253 |
DBusMessageIter *sub),
|
|
254 |
(iter, type, contained_signature, sub), return)
|
|
255 |
DEFINEFUNC(void , dbus_message_iter_recurse, (DBusMessageIter *iter,
|
|
256 |
DBusMessageIter *sub),
|
|
257 |
(iter, sub), )
|
|
258 |
DEFINEFUNC(DBusMessage* , dbus_message_new, (int message_type),
|
|
259 |
(message_type), return)
|
|
260 |
DEFINEFUNC(DBusMessage* , dbus_message_new_method_call, (const char *bus_name,
|
|
261 |
const char *path,
|
|
262 |
const char *interface,
|
|
263 |
const char *method),
|
|
264 |
(bus_name, path, interface, method), return)
|
|
265 |
DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char *path,
|
|
266 |
const char *interface,
|
|
267 |
const char *name),
|
|
268 |
(path, interface, name), return)
|
|
269 |
DEFINEFUNC(DBusMessage* , dbus_message_ref, (DBusMessage *message),
|
|
270 |
(message), return)
|
|
271 |
DEFINEFUNC(dbus_bool_t , dbus_message_set_destination, (DBusMessage *message,
|
|
272 |
const char *destination),
|
|
273 |
(message, destination), return)
|
|
274 |
DEFINEFUNC(dbus_bool_t , dbus_message_set_error_name, (DBusMessage *message,
|
|
275 |
const char *name),
|
|
276 |
(message, name), return)
|
|
277 |
DEFINEFUNC(void , dbus_message_set_no_reply, (DBusMessage *message,
|
|
278 |
dbus_bool_t no_reply),
|
|
279 |
(message, no_reply), return)
|
|
280 |
DEFINEFUNC(dbus_bool_t , dbus_message_set_path, (DBusMessage *message,
|
|
281 |
const char *object_path),
|
|
282 |
(message, object_path), return)
|
|
283 |
DEFINEFUNC(dbus_bool_t , dbus_message_set_reply_serial, (DBusMessage *message,
|
|
284 |
dbus_uint32_t reply_serial),
|
|
285 |
(message, reply_serial), return)
|
|
286 |
DEFINEFUNC(dbus_bool_t , dbus_message_set_sender, (DBusMessage *message,
|
|
287 |
const char *sender),
|
|
288 |
(message, sender), return)
|
|
289 |
DEFINEFUNC(void , dbus_message_unref, (DBusMessage *message),
|
|
290 |
(message), )
|
|
291 |
|
|
292 |
/* dbus-pending-call.h */
|
|
293 |
DEFINEFUNC(dbus_bool_t , dbus_pending_call_set_notify, (DBusPendingCall *pending,
|
|
294 |
DBusPendingCallNotifyFunction function,
|
|
295 |
void *user_data,
|
|
296 |
DBusFreeFunction free_user_data),
|
|
297 |
(pending, function, user_data, free_user_data), return)
|
|
298 |
DEFINEFUNC(void , dbus_pending_call_block, (DBusPendingCall *pending),
|
|
299 |
(pending), )
|
|
300 |
DEFINEFUNC(void , dbus_pending_call_cancel, (DBusPendingCall *pending),
|
|
301 |
(pending), )
|
|
302 |
DEFINEFUNC(dbus_bool_t , dbus_pending_call_get_completed, (DBusPendingCall *pending),
|
|
303 |
(pending), return)
|
|
304 |
DEFINEFUNC(DBusMessage* , dbus_pending_call_steal_reply, (DBusPendingCall *pending),
|
|
305 |
(pending), return)
|
|
306 |
DEFINEFUNC(void , dbus_pending_call_unref, (DBusPendingCall *pending),
|
|
307 |
(pending), return)
|
|
308 |
|
|
309 |
/* dbus-server.h */
|
|
310 |
DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t *slot_p),
|
|
311 |
(slot_p), return)
|
|
312 |
DEFINEFUNC(void , dbus_server_disconnect, (DBusServer *server),
|
|
313 |
(server), )
|
|
314 |
DEFINEFUNC(char* , dbus_server_get_address, (DBusServer *server),
|
|
315 |
(server), return)
|
|
316 |
DEFINEFUNC(dbus_bool_t , dbus_server_get_is_connected, (DBusServer *server),
|
|
317 |
(server), return)
|
|
318 |
DEFINEFUNC(DBusServer* , dbus_server_listen, (const char *address,
|
|
319 |
DBusError *error),
|
|
320 |
(address, error), return)
|
|
321 |
DEFINEFUNC(dbus_bool_t , dbus_server_set_data, (DBusServer *server,
|
|
322 |
int slot,
|
|
323 |
void *data,
|
|
324 |
DBusFreeFunction free_data_func),
|
|
325 |
(server, slot, data, free_data_func), return)
|
|
326 |
DEFINEFUNC(void , dbus_server_set_new_connection_function, (DBusServer *server,
|
|
327 |
DBusNewConnectionFunction function,
|
|
328 |
void *data,
|
|
329 |
DBusFreeFunction free_data_function),
|
|
330 |
(server, function, data, free_data_function), )
|
|
331 |
DEFINEFUNC(dbus_bool_t , dbus_server_set_timeout_functions, (DBusServer *server,
|
|
332 |
DBusAddTimeoutFunction add_function,
|
|
333 |
DBusRemoveTimeoutFunction remove_function,
|
|
334 |
DBusTimeoutToggledFunction toggled_function,
|
|
335 |
void *data,
|
|
336 |
DBusFreeFunction free_data_function),
|
|
337 |
(server, add_function, remove_function, toggled_function, data, free_data_function), return)
|
|
338 |
DEFINEFUNC(dbus_bool_t , dbus_server_set_watch_functions, (DBusServer *server,
|
|
339 |
DBusAddWatchFunction add_function,
|
|
340 |
DBusRemoveWatchFunction remove_function,
|
|
341 |
DBusWatchToggledFunction toggled_function,
|
|
342 |
void *data,
|
|
343 |
DBusFreeFunction free_data_function),
|
|
344 |
(server, add_function, remove_function, toggled_function, data, free_data_function), return)
|
|
345 |
DEFINEFUNC(void , dbus_server_unref, (DBusServer *server),
|
|
346 |
(server), )
|
|
347 |
|
|
348 |
/* dbus-signature.h */
|
|
349 |
DEFINEFUNC(dbus_bool_t , dbus_signature_validate, (const char *signature,
|
|
350 |
DBusError *error),
|
|
351 |
(signature, error), return)
|
|
352 |
DEFINEFUNC(dbus_bool_t , dbus_signature_validate_single, (const char *signature,
|
|
353 |
DBusError *error),
|
|
354 |
(signature, error), return)
|
|
355 |
DEFINEFUNC(dbus_bool_t , dbus_type_is_basic, (int typecode),
|
|
356 |
(typecode), return)
|
|
357 |
DEFINEFUNC(dbus_bool_t , dbus_type_is_fixed, (int typecode),
|
|
358 |
(typecode), return)
|
|
359 |
|
|
360 |
/* dbus-thread.h */
|
|
361 |
DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
|
|
362 |
|
|
363 |
QT_END_NAMESPACE
|
|
364 |
|
|
365 |
#endif
|