${CMAKE_CURRENT_SOURCE_DIR}/qdbusthreaddebug_p.h
${CMAKE_CURRENT_SOURCE_DIR}/qdbusintegrator_p.h
${CMAKE_CURRENT_SOURCE_DIR}/qdbuspendingcall_p.h
- ${CMAKE_CURRENT_SOURCE_DIR}/qdbus_symbols_p.h
${CMAKE_CURRENT_SOURCE_DIR}/qdbusmetaobject_p.h
- ${CMAKE_CURRENT_SOURCE_DIR}//qdbusintrospection_p.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/qdbusintrospection_p.h
${CMAKE_CURRENT_SOURCE_DIR}/qdbusservicewatcher.h
${CMAKE_CURRENT_SOURCE_DIR}/qdbusunixfiledescriptor.h
)
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtDBus module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the public API. This header file may
-// change from version to version without notice, or even be
-// removed.
-//
-// We mean it.
-//
-//
-
-#ifndef QDBUS_SYMBOLS_P_H
-#define QDBUS_SYMBOLS_P_H
-
-#include <QtCore/qglobal.h>
-#include <dbus/dbus.h>
-
-#ifndef QT_NO_DBUS
-
-QT_BEGIN_NAMESPACE
-
-#define DEFINEFUNC(ret, func, args, argcall, funcret) \
- static inline ret q_##func args { funcret func argcall; }
-
-/* dbus-bus.h */
-DEFINEFUNC(void, dbus_bus_add_match, (DBusConnection *connection,
- const char *rule,
- DBusError *error),
- (connection, rule, error), )
-DEFINEFUNC(void, dbus_bus_remove_match, (DBusConnection *connection,
- const char *rule,
- DBusError *error),
- (connection, rule, error), )
-DEFINEFUNC(dbus_bool_t, dbus_bus_register,(DBusConnection *connection,
- DBusError *error),
- (connection, error), return)
-DEFINEFUNC(DBusConnection *, dbus_bus_get_private, (DBusBusType type,
- DBusError *error),
- (type, error), return)
-DEFINEFUNC(const char*, dbus_bus_get_unique_name, (DBusConnection *connection),
- (connection), return)
-
-/* dbus-connection.h */
-DEFINEFUNC(dbus_bool_t , dbus_connection_add_filter, (DBusConnection *connection,
- DBusHandleMessageFunction function,
- void *user_data,
- DBusFreeFunction free_data_function),
- (connection, function, user_data, free_data_function), return)
-DEFINEFUNC(void , dbus_connection_close, (DBusConnection *connection),
- (connection), return)
-DEFINEFUNC(DBusDispatchStatus , dbus_connection_dispatch, (DBusConnection *connection),
- (connection), return)
-DEFINEFUNC(DBusDispatchStatus , dbus_connection_get_dispatch_status, (DBusConnection *connection),
- (connection), return)
-DEFINEFUNC(dbus_bool_t , dbus_connection_get_is_connected, (DBusConnection *connection),
- (connection), return)
-DEFINEFUNC(DBusConnection* , dbus_connection_open_private, (const char *address,
- DBusError *error),
- (address, error), return)
-DEFINEFUNC(DBusConnection* , dbus_connection_ref, (DBusConnection *connection),
- (connection), return)
-DEFINEFUNC(dbus_bool_t , dbus_connection_send, (DBusConnection *connection,
- DBusMessage *message,
- dbus_uint32_t *client_serial),
- (connection, message, client_serial), return)
-DEFINEFUNC(dbus_bool_t , dbus_connection_send_with_reply, (DBusConnection *connection,
- DBusMessage *message,
- DBusPendingCall **pending_return,
- int timeout_milliseconds),
- (connection, message, pending_return, timeout_milliseconds), return)
-DEFINEFUNC(DBusMessage * , dbus_connection_send_with_reply_and_block, (DBusConnection *connection,
- DBusMessage *message,
- int timeout_milliseconds,
- DBusError *error),
- (connection, message, timeout_milliseconds, error), return)
-DEFINEFUNC(void , dbus_connection_set_exit_on_disconnect, (DBusConnection *connection,
- dbus_bool_t exit_on_disconnect),
- (connection, exit_on_disconnect), )
-DEFINEFUNC(dbus_bool_t , dbus_connection_set_timeout_functions, (DBusConnection *connection,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function),
- (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
-DEFINEFUNC(dbus_bool_t , dbus_connection_set_watch_functions, (DBusConnection *connection,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function),
- (connection, add_function, remove_function, toggled_function, data, free_data_function), return)
-DEFINEFUNC(void , dbus_connection_set_wakeup_main_function, (DBusConnection *connection,
- DBusWakeupMainFunction wakeup_main_function,
- void *data,
- DBusFreeFunction free_data_function),
- (connection, wakeup_main_function, data, free_data_function), )
-DEFINEFUNC(void , dbus_connection_set_dispatch_status_function, (DBusConnection *connection,
- DBusDispatchStatusFunction function,
- void *data,
- DBusFreeFunction free_data_function),
- (connection, function, data, free_data_function), )
-
-DEFINEFUNC(void , dbus_connection_unref, (DBusConnection *connection),
- (connection), )
-DEFINEFUNC(dbus_bool_t , dbus_timeout_get_enabled, (DBusTimeout *timeout),
- (timeout), return)
-DEFINEFUNC(int , dbus_timeout_get_interval, (DBusTimeout *timeout),
- (timeout), return)
-DEFINEFUNC(dbus_bool_t , dbus_timeout_handle, (DBusTimeout *timeout),
- (timeout), return)
-
-DEFINEFUNC(dbus_bool_t , dbus_watch_get_enabled, (DBusWatch *watch),
- (watch), return)
-DEFINEFUNC(int , dbus_watch_get_unix_fd, (DBusWatch *watch),
- (watch), return)
-DEFINEFUNC(unsigned int , dbus_watch_get_flags, (DBusWatch *watch),
- (watch), return)
-DEFINEFUNC(dbus_bool_t , dbus_watch_handle, (DBusWatch *watch,
- unsigned int flags),
- (watch, flags), return)
-
-/* dbus-errors.h */
-DEFINEFUNC(void , dbus_error_free, (DBusError *error),
- (error), )
-DEFINEFUNC(void , dbus_error_init, (DBusError *error),
- (error), )
-DEFINEFUNC(dbus_bool_t , dbus_error_is_set, (const DBusError *error),
- (error), return)
-
-/* dbus-memory.h */
-DEFINEFUNC(void , dbus_free, (void *memory), (memory), )
-
-/* dbus-message.h */
-DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
- (message), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_get_auto_start, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_error_name, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_interface, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_member, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_get_no_reply, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_path, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_basic, (DBusMessageIter *iter,
- int type,
- const void *value),
- (iter, type, value), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_append_fixed_array, (DBusMessageIter *iter,
- int element_type,
- const void *value,
- int n_elements),
- (iter, element_type, value, n_elements), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_close_container, (DBusMessageIter *iter,
- DBusMessageIter *sub),
- (iter, sub), return)
-DEFINEFUNC(int , dbus_message_iter_get_arg_type, (DBusMessageIter *iter),
- (iter), return)
-DEFINEFUNC(void , dbus_message_iter_get_basic, (DBusMessageIter *iter,
- void *value),
- (iter, value), )
-DEFINEFUNC(int , dbus_message_iter_get_element_type, (DBusMessageIter *iter),
- (iter), return)
-DEFINEFUNC(void , dbus_message_iter_get_fixed_array, (DBusMessageIter *iter,
- void *value,
- int *n_elements),
- (iter, value, n_elements), return)
-DEFINEFUNC(char* , dbus_message_iter_get_signature, (DBusMessageIter *iter),
- (iter), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_init, (DBusMessage *message,
- DBusMessageIter *iter),
- (message, iter), return)
-DEFINEFUNC(void , dbus_message_iter_init_append, (DBusMessage *message,
- DBusMessageIter *iter),
- (message, iter), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_next, (DBusMessageIter *iter),
- (iter), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_iter_open_container, (DBusMessageIter *iter,
- int type,
- const char *contained_signature,
- DBusMessageIter *sub),
- (iter, type, contained_signature, sub), return)
-DEFINEFUNC(void , dbus_message_iter_recurse, (DBusMessageIter *iter,
- DBusMessageIter *sub),
- (iter, sub), )
-DEFINEFUNC(DBusMessage* , dbus_message_new, (int message_type),
- (message_type), return)
-DEFINEFUNC(DBusMessage* , dbus_message_new_method_call, (const char *bus_name,
- const char *path,
- const char *interface,
- const char *method),
- (bus_name, path, interface, method), return)
-DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char *path,
- const char *interface,
- const char *name),
- (path, interface, name), return)
-DEFINEFUNC(DBusMessage* , dbus_message_ref, (DBusMessage *message),
- (message), return)
-DEFINEFUNC(void , dbus_message_set_auto_start, (DBusMessage *message,
- dbus_bool_t auto_start),
- (message, auto_start), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_set_destination, (DBusMessage *message,
- const char *destination),
- (message, destination), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_set_error_name, (DBusMessage *message,
- const char *name),
- (message, name), return)
-DEFINEFUNC(void , dbus_message_set_no_reply, (DBusMessage *message,
- dbus_bool_t no_reply),
- (message, no_reply), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_set_path, (DBusMessage *message,
- const char *object_path),
- (message, object_path), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_set_reply_serial, (DBusMessage *message,
- dbus_uint32_t reply_serial),
- (message, reply_serial), return)
-DEFINEFUNC(dbus_bool_t , dbus_message_set_sender, (DBusMessage *message,
- const char *sender),
- (message, sender), return)
-DEFINEFUNC(void , dbus_message_unref, (DBusMessage *message),
- (message), )
-
-/* dbus-misc.h */
-DEFINEFUNC(char* , dbus_get_local_machine_id , (void), (), return)
-
-
-/* dbus-pending-call.h */
-DEFINEFUNC(dbus_bool_t , dbus_pending_call_set_notify, (DBusPendingCall *pending,
- DBusPendingCallNotifyFunction function,
- void *user_data,
- DBusFreeFunction free_user_data),
- (pending, function, user_data, free_user_data), return)
-DEFINEFUNC(void , dbus_pending_call_block, (DBusPendingCall *pending),
- (pending), )
-DEFINEFUNC(void , dbus_pending_call_cancel, (DBusPendingCall *pending),
- (pending), )
-DEFINEFUNC(dbus_bool_t , dbus_pending_call_get_completed, (DBusPendingCall *pending),
- (pending), return)
-DEFINEFUNC(DBusMessage* , dbus_pending_call_steal_reply, (DBusPendingCall *pending),
- (pending), return)
-DEFINEFUNC(void , dbus_pending_call_unref, (DBusPendingCall *pending),
- (pending), return)
-
-/* dbus-server.h */
-DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t *slot_p),
- (slot_p), return)
-DEFINEFUNC(void , dbus_server_disconnect, (DBusServer *server),
- (server), )
-DEFINEFUNC(char* , dbus_server_get_address, (DBusServer *server),
- (server), return)
-DEFINEFUNC(dbus_bool_t , dbus_server_get_is_connected, (DBusServer *server),
- (server), return)
-DEFINEFUNC(DBusServer* , dbus_server_listen, (const char *address,
- DBusError *error),
- (address, error), return)
-DEFINEFUNC(dbus_bool_t , dbus_server_set_data, (DBusServer *server,
- int slot,
- void *data,
- DBusFreeFunction free_data_func),
- (server, slot, data, free_data_func), return)
-DEFINEFUNC(void , dbus_server_set_new_connection_function, (DBusServer *server,
- DBusNewConnectionFunction function,
- void *data,
- DBusFreeFunction free_data_function),
- (server, function, data, free_data_function), )
-DEFINEFUNC(dbus_bool_t , dbus_server_set_timeout_functions, (DBusServer *server,
- DBusAddTimeoutFunction add_function,
- DBusRemoveTimeoutFunction remove_function,
- DBusTimeoutToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function),
- (server, add_function, remove_function, toggled_function, data, free_data_function), return)
-DEFINEFUNC(dbus_bool_t , dbus_server_set_watch_functions, (DBusServer *server,
- DBusAddWatchFunction add_function,
- DBusRemoveWatchFunction remove_function,
- DBusWatchToggledFunction toggled_function,
- void *data,
- DBusFreeFunction free_data_function),
- (server, add_function, remove_function, toggled_function, data, free_data_function), return)
-DEFINEFUNC(void , dbus_server_unref, (DBusServer *server),
- (server), )
-
-/* dbus-thread.h */
-DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_DBUS
-#endif // QDBUS_SYMBOLS_P_H
QDBusArgumentPrivate::~QDBusArgumentPrivate()
{
if (message)
- q_dbus_message_unref(message);
+ dbus_message_unref(message);
}
QByteArray QDBusArgumentPrivate::createSignature(int id)
if (d->message && d->ref != 1) {
QDBusMarshaller *dd = new QDBusMarshaller(d->capabilities);
- dd->message = q_dbus_message_copy(d->message);
- q_dbus_message_iter_init_append(dd->message, &dd->iterator);
+ dd->message = dbus_message_copy(d->message);
+ dbus_message_iter_init_append(dd->message, &dd->iterator);
if (!d->ref.deref())
delete d;
return true; // no need to detach
QDBusDemarshaller *dd = new QDBusDemarshaller(d->capabilities);
- dd->message = q_dbus_message_ref(d->message);
+ dd->message = dbus_message_ref(d->message);
dd->iterator = static_cast<QDBusDemarshaller*>(d)->iterator;
if (!d->ref.deref())
d = dd;
// create a new message with any type, we won't sent it anyways
- dd->message = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
- q_dbus_message_iter_init_append(dd->message, &dd->iterator);
+ dd->message = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
+ dbus_message_iter_init_append(dd->message, &dd->iterator);
}
/*!
#include <qdbusargument.h>
#include "qdbusunixfiledescriptor.h"
-#include "qdbus_symbols_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
#ifndef DBUS_TYPE_UNIX_FD
# define DBUS_TYPE_UNIX_FD int('h')
QDBusErrorInternal error;
switch (type) {
case SystemBus:
- c = q_dbus_bus_get_private(DBUS_BUS_SYSTEM, error);
+ c = dbus_bus_get_private(DBUS_BUS_SYSTEM, error);
break;
case SessionBus:
- c = q_dbus_bus_get_private(DBUS_BUS_SESSION, error);
+ c = dbus_bus_get_private(DBUS_BUS_SESSION, error);
break;
case ActivationBus:
- c = q_dbus_bus_get_private(DBUS_BUS_STARTER, error);
+ c = dbus_bus_get_private(DBUS_BUS_STARTER, error);
break;
}
d->setConnection(c, error); //setConnection does the error handling for us
d = new QDBusConnectionPrivate;
// setConnection does the error handling for us
QDBusErrorInternal error;
- DBusConnection *c = q_dbus_connection_open_private(address.toUtf8().constData(), error);
+ DBusConnection *c = dbus_connection_open_private(address.toUtf8().constData(), error);
if (c) {
- if (!q_dbus_bus_register(c, error)) {
- q_dbus_connection_unref(c);
+ if (!dbus_bus_register(c, error)) {
+ dbus_connection_unref(c);
c = 0;
}
}
d = new QDBusConnectionPrivate;
// setPeer does the error handling for us
QDBusErrorInternal error;
- DBusConnection *c = q_dbus_connection_open_private(address.toUtf8().constData(), error);
+ DBusConnection *c = dbus_connection_open_private(address.toUtf8().constData(), error);
d->setPeer(c, error);
_q_manager()->setConnection(name, d);
*/
bool QDBusConnection::isConnected() const
{
- return d && d->connection && q_dbus_connection_get_is_connected(d->connection);
+ return d && d->connection && dbus_connection_get_is_connected(d->connection);
}
/*!
*/
QByteArray QDBusConnection::localMachineId()
{
- char *dbus_machine_id = q_dbus_get_local_machine_id();
+ char *dbus_machine_id = dbus_get_local_machine_id();
QByteArray result = dbus_machine_id;
- q_dbus_free(dbus_machine_id);
+ dbus_free(dbus_machine_id);
return result;
}
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qvector.h>
-#include "qdbus_symbols_p.h"
-
#include <qdbusmessage.h>
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
mutable DBusError error;
Q_DISABLE_COPY(QDBusErrorInternal)
public:
- inline QDBusErrorInternal() { q_dbus_error_init(&error); }
- inline ~QDBusErrorInternal() { q_dbus_error_free(&error); }
- inline bool operator !() const { return !q_dbus_error_is_set(&error); }
- inline operator DBusError *() { q_dbus_error_free(&error); return &error; }
- inline operator QDBusError() const { QDBusError err(&error); q_dbus_error_free(&error); return err; }
+ inline QDBusErrorInternal() { dbus_error_init(&error); }
+ inline ~QDBusErrorInternal() { dbus_error_free(&error); }
+ inline bool operator !() const { return !dbus_error_is_set(&error); }
+ inline operator DBusError *() { dbus_error_free(&error); return &error; }
+ inline operator QDBusError() const { QDBusError err(&error); dbus_error_free(&error); return err; }
};
// QDBusConnectionPrivate holds the DBusConnection and
#include <QtCore/QVariant>
#include <QtCore/QDebug>
-#include "qdbus_symbols_p.h" // for the DBUS_* constants
-
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h> // for the DBUS_* constants
QT_BEGIN_NAMESPACE
template <typename T>
static inline T qIterGet(DBusMessageIter *it)
{
- // Use a union of expected and largest type q_dbus_message_iter_get_basic
+ // Use a union of expected and largest type dbus_message_iter_get_basic
// will return to ensure reading the wrong basic type does not result in
// stack overwrite
union {
// The value to be extracted
T t;
- // Largest type that q_dbus_message_iter_get_basic will return
+ // Largest type that dbus_message_iter_get_basic will return
// according to dbus_message_iter_get_basic API documentation
dbus_uint64_t maxValue;
// A pointer to ensure no stack overwrite in case there is a platform
// one and vice-versa will be platform-dependent.
value.t = T();
- q_dbus_message_iter_get_basic(it, &value);
- q_dbus_message_iter_next(it);
+ dbus_message_iter_get_basic(it, &value);
+ dbus_message_iter_next(it);
return value.t;
}
inline QString QDBusDemarshaller::currentSignature()
{
- char *sig = q_dbus_message_iter_get_signature(&iterator);
+ char *sig = dbus_message_iter_get_signature(&iterator);
QString retval = QString::fromUtf8(sig);
- q_dbus_free(sig);
+ dbus_free(sig);
return retval;
}
inline QDBusVariant QDBusDemarshaller::toVariant()
{
QDBusDemarshaller sub(capabilities);
- sub.message = q_dbus_message_ref(message);
- q_dbus_message_iter_recurse(&iterator, &sub.iterator);
- q_dbus_message_iter_next(&iterator);
+ sub.message = dbus_message_ref(message);
+ dbus_message_iter_recurse(&iterator, &sub.iterator);
+ dbus_message_iter_next(&iterator);
return QDBusVariant( sub.toVariantInternal() );
}
QDBusArgument::ElementType QDBusDemarshaller::currentType()
{
- switch (q_dbus_message_iter_get_arg_type(&iterator)) {
+ switch (dbus_message_iter_get_arg_type(&iterator)) {
case DBUS_TYPE_BYTE:
case DBUS_TYPE_INT16:
case DBUS_TYPE_UINT16:
return QDBusArgument::VariantType;
case DBUS_TYPE_ARRAY:
- switch (q_dbus_message_iter_get_element_type(&iterator)) {
+ switch (dbus_message_iter_get_element_type(&iterator)) {
case DBUS_TYPE_BYTE:
case DBUS_TYPE_STRING:
// QByteArray and QStringList
// default:
// qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
-// q_dbus_message_iter_get_arg_type(&iterator),
-// q_dbus_message_iter_get_arg_type(&iterator));
+// dbus_message_iter_get_arg_type(&iterator),
+// dbus_message_iter_get_arg_type(&iterator));
}
return QDBusArgument::UnknownType;
}
QVariant QDBusDemarshaller::toVariantInternal()
{
- switch (q_dbus_message_iter_get_arg_type(&iterator)) {
+ switch (dbus_message_iter_get_arg_type(&iterator)) {
case DBUS_TYPE_BYTE:
return QVariant::fromValue(toByte());
case DBUS_TYPE_INT16:
return QVariant::fromValue(toVariant());
case DBUS_TYPE_ARRAY:
- switch (q_dbus_message_iter_get_element_type(&iterator)) {
+ switch (dbus_message_iter_get_element_type(&iterator)) {
case DBUS_TYPE_BYTE:
// QByteArray
return toByteArrayUnchecked();
default:
// qWarning("QDBusDemarshaller: Found unknown D-Bus type %d '%c'",
-// q_dbus_message_iter_get_arg_type(&iterator),
-// q_dbus_message_iter_get_arg_type(&iterator));
+// dbus_message_iter_get_arg_type(&iterator),
+// dbus_message_iter_get_arg_type(&iterator));
char *ptr = 0;
- ptr += q_dbus_message_iter_get_arg_type(&iterator);
- q_dbus_message_iter_next(&iterator);
+ ptr += dbus_message_iter_get_arg_type(&iterator);
+ dbus_message_iter_next(&iterator);
// I hope you never dereference this pointer!
return QVariant::fromValue<void *>(ptr);
bool QDBusDemarshaller::isCurrentTypeStringLike()
{
- const int type = q_dbus_message_iter_get_arg_type(&iterator);
+ const int type = dbus_message_iter_get_arg_type(&iterator);
switch (type) {
case DBUS_TYPE_STRING: //FALLTHROUGH
case DBUS_TYPE_OBJECT_PATH: //FALLTHROUGH
QStringList list;
QDBusDemarshaller sub(capabilities);
- q_dbus_message_iter_recurse(&iterator, &sub.iterator);
- q_dbus_message_iter_next(&iterator);
+ dbus_message_iter_recurse(&iterator, &sub.iterator);
+ dbus_message_iter_next(&iterator);
while (!sub.atEnd())
list.append(sub.toStringUnchecked());
QStringList QDBusDemarshaller::toStringList()
{
- if (q_dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_ARRAY
- && q_dbus_message_iter_get_element_type(&iterator) == DBUS_TYPE_STRING)
+ if (dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_ARRAY
+ && dbus_message_iter_get_element_type(&iterator) == DBUS_TYPE_STRING)
return toStringListUnchecked();
else
return QStringList();
QByteArray QDBusDemarshaller::toByteArrayUnchecked()
{
DBusMessageIter sub;
- q_dbus_message_iter_recurse(&iterator, &sub);
- q_dbus_message_iter_next(&iterator);
+ dbus_message_iter_recurse(&iterator, &sub);
+ dbus_message_iter_next(&iterator);
int len;
char* data;
- q_dbus_message_iter_get_fixed_array(&sub,&data,&len);
+ dbus_message_iter_get_fixed_array(&sub,&data,&len);
return QByteArray(data,len);
}
QByteArray QDBusDemarshaller::toByteArray()
{
- if (q_dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_ARRAY
- && q_dbus_message_iter_get_element_type(&iterator) == DBUS_TYPE_BYTE) {
+ if (dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_ARRAY
+ && dbus_message_iter_get_element_type(&iterator) == DBUS_TYPE_BYTE) {
return toByteArrayUnchecked();
}
return QByteArray();
bool QDBusDemarshaller::atEnd()
{
// dbus_message_iter_has_next is broken if the list has one single element
- return q_dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_INVALID;
+ return dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_INVALID;
}
inline QDBusDemarshaller *QDBusDemarshaller::beginStructure()
{
QDBusDemarshaller *d = new QDBusDemarshaller(capabilities);
d->parent = this;
- d->message = q_dbus_message_ref(message);
+ d->message = dbus_message_ref(message);
// recurse
- q_dbus_message_iter_recurse(&iterator, &d->iterator);
- q_dbus_message_iter_next(&iterator);
+ dbus_message_iter_recurse(&iterator, &d->iterator);
+ dbus_message_iter_next(&iterator);
return d;
}
{
QDBusDemarshaller *d = new QDBusDemarshaller(capabilities);
d->iterator = iterator;
- d->message = q_dbus_message_ref(message);
+ d->message = dbus_message_ref(message);
- q_dbus_message_iter_next(&iterator);
+ dbus_message_iter_next(&iterator);
return QDBusArgumentPrivate::create(d);
}
#include <qdebug.h>
#include <qvarlengtharray.h>
-#include "qdbus_symbols_p.h"
#include "qdbusmessage.h"
#include "qdbusmessage_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
QDBusError::QDBusError(const DBusError *error)
: code(NoError)
{
- if (!error || !q_dbus_error_is_set(error))
+ if (!error || !dbus_error_is_set(error))
return;
code = ::get(error->name);
Q_ASSERT(timeout);
Q_ASSERT(data);
- // qDebug("addTimeout %d", q_dbus_timeout_get_interval(timeout));
+ // qDebug("addTimeout %d", dbus_timeout_get_interval(timeout));
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
- if (!q_dbus_timeout_get_enabled(timeout))
+ if (!dbus_timeout_get_enabled(timeout))
return true;
QDBusWatchAndTimeoutLocker locker(AddTimeoutAction, d);
if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
// correct thread
- return qDBusRealAddTimeout(d, timeout, q_dbus_timeout_get_interval(timeout));
+ return qDBusRealAddTimeout(d, timeout, dbus_timeout_get_interval(timeout));
} else {
// wrong thread: sync back
QDBusConnectionCallbackEvent *ev = new QDBusConnectionCallbackEvent;
ev->subtype = QDBusConnectionCallbackEvent::AddTimeout;
- d->timeoutsPendingAdd.append(qMakePair(timeout, q_dbus_timeout_get_interval(timeout)));
+ d->timeoutsPendingAdd.append(qMakePair(timeout, dbus_timeout_get_interval(timeout)));
d->postEventToThread(AddTimeoutAction, d, ev);
return true;
}
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
- int flags = q_dbus_watch_get_flags(watch);
- int fd = q_dbus_watch_get_unix_fd(watch);
+ int flags = dbus_watch_get_flags(watch);
+ int fd = dbus_watch_get_unix_fd(watch);
if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
return qDBusRealAddWatch(d, watch, flags, fd);
watcher.watch = watch;
if (QCoreApplication::instance()) {
watcher.read = new QSocketNotifier(fd, QSocketNotifier::Read, d);
- watcher.read->setEnabled(q_dbus_watch_get_enabled(watch));
+ watcher.read->setEnabled(dbus_watch_get_enabled(watch));
d->connect(watcher.read, SIGNAL(activated(int)), SLOT(socketRead(int)));
}
}
watcher.watch = watch;
if (QCoreApplication::instance()) {
watcher.write = new QSocketNotifier(fd, QSocketNotifier::Write, d);
- watcher.write->setEnabled(q_dbus_watch_get_enabled(watch));
+ watcher.write->setEnabled(dbus_watch_get_enabled(watch));
d->connect(watcher.write, SIGNAL(activated(int)), SLOT(socketWrite(int)));
}
}
//qDebug("remove watch");
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
- int fd = q_dbus_watch_get_unix_fd(watch);
+ int fd = dbus_watch_get_unix_fd(watch);
QDBusWatchAndTimeoutLocker locker(RemoveWatchAction, d);
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
Q_ASSERT(data);
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
- int fd = q_dbus_watch_get_unix_fd(watch);
+ int fd = dbus_watch_get_unix_fd(watch);
if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
qDBusRealToggleWatch(d, watch, fd);
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
while (i != d->watchers.end() && i.key() == fd) {
if (i.value().watch == watch) {
- bool enabled = q_dbus_watch_get_enabled(watch);
- int flags = q_dbus_watch_get_flags(watch);
+ bool enabled = dbus_watch_get_enabled(watch);
+ int flags = dbus_watch_get_flags(watch);
- //qDebug("toggle watch %d to %d (write: %d, read: %d)", q_dbus_watch_get_unix_fd(watch), enabled, flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE);
+ //qDebug("toggle watch %d to %d (write: %d, read: %d)", dbus_watch_get_unix_fd(watch), enabled, flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE);
if (flags & DBUS_WATCH_READABLE && i.value().read)
i.value().read->setEnabled(enabled);
Q_ASSERT(data);
// keep the connection alive
- q_dbus_connection_ref(connection);
+ dbus_connection_ref(connection);
QDBusConnectionPrivate *serverConnection = static_cast<QDBusConnectionPrivate *>(data);
QDBusConnectionPrivate *newConnection = new QDBusConnectionPrivate(serverConnection->parent());
if (p.isEmpty())
p = "/";
qDBusDebug() << QThread::currentThread() << "emitting signal at" << p;
- DBusMessage *msg2 = q_dbus_message_copy(msg);
- q_dbus_message_set_path(msg2, p);
- q_dbus_connection_send(connection, msg2, 0);
- q_dbus_message_unref(msg2);
+ DBusMessage *msg2 = dbus_message_copy(msg);
+ dbus_message_set_path(msg2, p);
+ dbus_connection_send(connection, msg2, 0);
+ dbus_message_unref(msg2);
}
}
watchAndTimeoutLock(QMutex::Recursive),
rootNode(QString(QLatin1Char('/')))
{
- static const bool threads = q_dbus_threads_init_default();
+ static const bool threads = dbus_threads_init_default();
if (::isDebugging == -1)
::isDebugging = qgetenv("QDBUS_DEBUG").toInt();
Q_UNUSED(threads)
qDeleteAll(cachedMetaObjects);
if (server)
- q_dbus_server_unref(server);
+ dbus_server_unref(server);
if (connection)
- q_dbus_connection_unref(connection);
+ dbus_connection_unref(connection);
connection = 0;
server = 0;
baseService.clear();
if (server)
- q_dbus_server_disconnect(server);
+ dbus_server_disconnect(server);
if (oldMode == ClientMode || oldMode == PeerMode) {
if (connection) {
- q_dbus_connection_close(connection);
+ dbus_connection_close(connection);
// send the "close" message
- while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS)
+ while (dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS)
;
}
}
QDBusWatchAndTimeoutLocker locker(TimerEventAction, this);
DBusTimeout *timeout = timeouts.value(e->timerId(), 0);
if (timeout)
- q_dbus_timeout_handle(timeout);
+ dbus_timeout_handle(timeout);
}
doDispatch();
{
QDBusDispatchLocker locker(DoDispatchAction, this);
if (mode == ClientMode || mode == PeerMode)
- while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
+ while (dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
}
void QDBusConnectionPrivate::socketRead(int fd)
}
for (int i = 0; i < pendingWatches.size(); ++i)
- if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_READABLE))
+ if (!dbus_watch_handle(pendingWatches[i], DBUS_WATCH_READABLE))
qDebug("OUT OF MEM");
doDispatch();
}
}
for (int i = 0; i < pendingWatches.size(); ++i)
- if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_WRITABLE))
+ if (!dbus_watch_handle(pendingWatches[i], DBUS_WATCH_WRITABLE))
qDebug("OUT OF MEM");
}
//qDBusDebug() << "Emitting signal" << message;
//qDBusDebug() << "for paths:";
- q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
+ dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
huntAndEmit(connection, msg, obj, rootNode, isScriptable, isAdaptor);
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
}
void QDBusConnectionPrivate::serviceOwnerChangedNoLock(const QString &name,
server = s;
mode = ServerMode;
- dbus_bool_t data_allocated = q_dbus_server_allocate_data_slot(&server_slot);
+ dbus_bool_t data_allocated = dbus_server_allocate_data_slot(&server_slot);
if (data_allocated && server_slot < 0)
return;
- dbus_bool_t watch_functions_set = q_dbus_server_set_watch_functions(server,
+ dbus_bool_t watch_functions_set = dbus_server_set_watch_functions(server,
qDBusAddWatch,
qDBusRemoveWatch,
qDBusToggleWatch,
//qDebug() << "watch_functions_set" << watch_functions_set;
Q_UNUSED(watch_functions_set);
- dbus_bool_t time_functions_set = q_dbus_server_set_timeout_functions(server,
+ dbus_bool_t time_functions_set = dbus_server_set_timeout_functions(server,
qDBusAddTimeout,
qDBusRemoveTimeout,
qDBusToggleTimeout,
//qDebug() << "time_functions_set" << time_functions_set;
Q_UNUSED(time_functions_set);
- q_dbus_server_set_new_connection_function(server, qDBusNewConnection, this, 0);
+ dbus_server_set_new_connection_function(server, qDBusNewConnection, this, 0);
- dbus_bool_t data_set = q_dbus_server_set_data(server, server_slot, this, 0);
+ dbus_bool_t data_set = dbus_server_set_data(server, server_slot, this, 0);
//qDebug() << "data_set" << data_set;
Q_UNUSED(data_set);
}
connection = c;
mode = PeerMode;
- q_dbus_connection_set_exit_on_disconnect(connection, false);
- q_dbus_connection_set_watch_functions(connection,
+ dbus_connection_set_exit_on_disconnect(connection, false);
+ dbus_connection_set_watch_functions(connection,
qDBusAddWatch,
qDBusRemoveWatch,
qDBusToggleWatch,
this, 0);
- q_dbus_connection_set_timeout_functions(connection,
+ dbus_connection_set_timeout_functions(connection,
qDBusAddTimeout,
qDBusRemoveTimeout,
qDBusToggleTimeout,
this, 0);
- q_dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0);
- q_dbus_connection_add_filter(connection,
+ dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0);
+ dbus_connection_add_filter(connection,
qDBusSignalFilter,
this, 0);
connection = dbc;
mode = ClientMode;
- const char *service = q_dbus_bus_get_unique_name(connection);
+ const char *service = dbus_bus_get_unique_name(connection);
Q_ASSERT(service);
baseService = QString::fromUtf8(service);
capabilities = connectionCapabilies(connection);
- q_dbus_connection_set_exit_on_disconnect(connection, false);
- q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch,
- qDBusToggleWatch, this, 0);
- q_dbus_connection_set_timeout_functions(connection, qDBusAddTimeout, qDBusRemoveTimeout,
- qDBusToggleTimeout, this, 0);
- q_dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0);
- q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0);
+ dbus_connection_set_exit_on_disconnect(connection, false);
+ dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch,
+ qDBusToggleWatch, this, 0);
+ dbus_connection_set_timeout_functions(connection, qDBusAddTimeout, qDBusRemoveTimeout,
+ qDBusToggleTimeout, this, 0);
+ dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0);
+ dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0);
// Initialize the hooks for the NameAcquired and NameLost signals
// we don't use connectSignal here because we don't need the rules to be sent to the bus
{
QDBusDispatchLocker locker(PendingCallBlockAction, this);
- q_dbus_pending_call_block(pcall->pending);
+ dbus_pending_call_block(pcall->pending);
// QDBusConnectionPrivate::processFinishedCall() is called automatically
}
pcall->mutex.lock();
if (pcall->pending) {
- q_dbus_pending_call_unref(pcall->pending);
+ dbus_pending_call_unref(pcall->pending);
pcall->pending = 0;
}
QDBusMessage &msg = call->replyMessage;
if (call->pending) {
// decode the message
- DBusMessage *reply = q_dbus_pending_call_steal_reply(call->pending);
+ DBusMessage *reply = dbus_pending_call_steal_reply(call->pending);
msg = QDBusMessagePrivate::fromDBusMessage(reply, connection->capabilities);
- q_dbus_message_unref(reply);
+ dbus_message_unref(reply);
}
qDBusDebug() << connection << "got message reply (async):" << msg;
}
if (call->pending && !call->waitingForFinished) {
- q_dbus_pending_call_unref(call->pending);
+ dbus_pending_call_unref(call->pending);
call->pending = 0;
}
return 0;
}
- q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
+ dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
qDBusDebug() << this << "sending message (no reply):" << message;
checkThread();
- bool isOk = q_dbus_connection_send(connection, msg, 0);
+ bool isOk = dbus_connection_send(connection, msg, 0);
int serial = 0;
if (isOk)
- serial = q_dbus_message_get_serial(msg);
+ serial = dbus_message_get_serial(msg);
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
return serial;
}
qDBusDebug() << this << "sending message (blocking):" << message;
QDBusErrorInternal error;
- DBusMessage *reply = q_dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
+ DBusMessage *reply = dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
if (!!error) {
lastError = err = error;
}
QDBusMessage amsg = QDBusMessagePrivate::fromDBusMessage(reply, capabilities);
- q_dbus_message_unref(reply);
+ dbus_message_unref(reply);
qDBusDebug() << this << "got message reply (blocking):" << amsg;
return amsg;
DBusPendingCall *pending = 0;
QDBusDispatchLocker locker(SendWithReplyAsyncAction, this);
- if (q_dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
+ if (dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
if (pending) {
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
pcall->pending = pending;
- q_dbus_pending_call_set_notify(pending, qDBusResultReceived, pcall, 0);
+ dbus_pending_call_set_notify(pending, qDBusResultReceived, pcall, 0);
return pcall;
} else {
lastError = error = QDBusError(QDBusError::NoMemory, QLatin1String("Out of memory"));
}
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
pcall->replyMessage = QDBusMessage::createError(error);
processFinishedCall(pcall);
return pcall;
if (connection) {
if (mode != QDBusConnectionPrivate::PeerMode) {
qDBusDebug("Adding rule: %s", hook.matchRule.constData());
- q_dbus_bus_add_match(connection, hook.matchRule, NULL);
+ dbus_bus_add_match(connection, hook.matchRule, NULL);
// Successfully connected the signal
// Do we need to watch for this name?
if (connection && erase) {
if (mode != QDBusConnectionPrivate::PeerMode) {
qDBusDebug("Removing rule: %s", hook.matchRule.constData());
- q_dbus_bus_remove_match(connection, hook.matchRule, NULL);
+ dbus_bus_remove_match(connection, hook.matchRule, NULL);
// Successfully disconnected the signal
// Were we watching for this name?
#ifndef QDBUSINTEGRATOR_P_H
#define QDBUSINTEGRATOR_P_H
-#include "qdbus_symbols_p.h"
-
#include "qcoreevent.h"
#include "qeventloop.h"
#include "qhash.h"
#include "qdbusconnection_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
#include "qdbusinterface.h"
-#include "qdbus_symbols_p.h"
#include <QtCore/qpointer.h>
#include <QtCore/qstringlist.h>
#include "qdbusconnection_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
#include "qdbusconnection_p.h"
-#include "qdbus_symbols_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qstringlist.h>
#include "qdbusvirtualobject.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
if (ba)
*ba += char(type);
else
- q_dbus_message_iter_append_basic(it, type, arg);
+ dbus_message_iter_append_basic(it, type, arg);
}
QDBusMarshaller::~QDBusMarshaller()
inline QString QDBusMarshaller::currentSignature()
{
if (message)
- return QString::fromUtf8(q_dbus_message_get_signature(message));
+ return QString::fromUtf8(dbus_message_get_signature(message));
return QString();
}
const char* cdata = arg.constData();
DBusMessageIter subiterator;
- q_dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING,
+ dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING,
&subiterator);
- q_dbus_message_iter_append_fixed_array(&subiterator, DBUS_TYPE_BYTE, &cdata, arg.length());
- q_dbus_message_iter_close_container(&iterator, &subiterator);
+ dbus_message_iter_append_fixed_array(&subiterator, DBUS_TYPE_BYTE, &cdata, arg.length());
+ dbus_message_iter_close_container(&iterator, &subiterator);
}
inline bool QDBusMarshaller::append(const QDBusVariant &arg)
break;
}
else
- q_dbus_message_iter_open_container(&iterator, code, signature, &sub.iterator);
+ dbus_message_iter_open_container(&iterator, code, signature, &sub.iterator);
}
QDBusMarshaller *QDBusMarshaller::beginCommon(int code, const char *signature)
if (closeCode)
*ba += closeCode;
} else if (parent) {
- q_dbus_message_iter_close_container(&parent->iterator, &iterator);
+ dbus_message_iter_close_container(&parent->iterator, &iterator);
}
}
return false; // can't append this one...
QDBusDemarshaller demarshaller(capabilities);
- demarshaller.message = q_dbus_message_ref(d->message);
+ demarshaller.message = dbus_message_ref(d->message);
if (d->direction == Demarshalling) {
// it's demarshalling; just copy
demarshaller.iterator = static_cast<QDBusDemarshaller *>(d)->iterator;
} else {
// it's marshalling; start over
- if (!q_dbus_message_iter_init(demarshaller.message, &demarshaller.iterator))
+ if (!dbus_message_iter_init(demarshaller.message, &demarshaller.iterator))
return false; // error!
}
bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller *demarshaller)
{
- int code = q_dbus_message_iter_get_arg_type(&demarshaller->iterator);
+ int code = dbus_message_iter_get_arg_type(&demarshaller->iterator);
if (QDBusUtil::isValidBasicType(code)) {
// easy: just append
// do exactly like the D-BUS docs suggest
- // (see apidocs for q_dbus_message_iter_get_basic)
+ // (see apidocs for dbus_message_iter_get_basic)
qlonglong value;
- q_dbus_message_iter_get_basic(&demarshaller->iterator, &value);
- q_dbus_message_iter_next(&demarshaller->iterator);
- q_dbus_message_iter_append_basic(&iterator, code, &value);
+ dbus_message_iter_get_basic(&demarshaller->iterator, &value);
+ dbus_message_iter_next(&demarshaller->iterator);
+ dbus_message_iter_append_basic(&iterator, code, &value);
return true;
}
if (code == DBUS_TYPE_ARRAY) {
- int element = q_dbus_message_iter_get_element_type(&demarshaller->iterator);
+ int element = dbus_message_iter_get_element_type(&demarshaller->iterator);
if (QDBusUtil::isValidFixedType(element) && element != DBUS_TYPE_UNIX_FD) {
// another optimization: fixed size arrays
// code is exactly like QDBusDemarshaller::toByteArray
DBusMessageIter sub;
- q_dbus_message_iter_recurse(&demarshaller->iterator, &sub);
- q_dbus_message_iter_next(&demarshaller->iterator);
+ dbus_message_iter_recurse(&demarshaller->iterator, &sub);
+ dbus_message_iter_next(&demarshaller->iterator);
int len;
void* data;
- q_dbus_message_iter_get_fixed_array(&sub,&data,&len);
+ dbus_message_iter_get_fixed_array(&sub,&data,&len);
char signature[2] = { char(element), 0 };
- q_dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, signature, &sub);
- q_dbus_message_iter_append_fixed_array(&sub, element, &data, len);
- q_dbus_message_iter_close_container(&iterator, &sub);
+ dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, signature, &sub);
+ dbus_message_iter_append_fixed_array(&sub, element, &data, len);
+ dbus_message_iter_close_container(&iterator, &sub);
return true;
}
#include <qdebug.h>
#include <qstringlist.h>
-#include "qdbus_symbols_p.h"
-
#include "qdbusargument_p.h"
#include "qdbuserror.h"
#include "qdbusmessage_p.h"
#include "qdbusutil_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
QDBusMessagePrivate::~QDBusMessagePrivate()
{
if (msg)
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
if (reply)
- q_dbus_message_unref(reply);
+ dbus_message_unref(reply);
delete localReply;
}
/*!
\internal
Constructs a DBusMessage object from \a message. The returned value must be de-referenced
- with q_dbus_message_unref. The \a capabilities flags indicates which capabilities to use.
+ with dbus_message_unref. The \a capabilities flags indicates which capabilities to use.
The \a error object is set to indicate the error if anything went wrong with the
marshalling. Usually, this error message will be placed in the reply, as if the call failed.
return 0;
}
- msg = q_dbus_message_new_method_call(data(d_ptr->service.toUtf8()), d_ptr->path.toUtf8(),
- data(d_ptr->interface.toUtf8()), d_ptr->name.toUtf8());
- q_dbus_message_set_auto_start( msg, d_ptr->autoStartService );
+ msg = dbus_message_new_method_call(data(d_ptr->service.toUtf8()), d_ptr->path.toUtf8(),
+ data(d_ptr->interface.toUtf8()), d_ptr->name.toUtf8());
+ dbus_message_set_auto_start( msg, d_ptr->autoStartService );
break;
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
+ msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
if (!d_ptr->localMessage) {
- q_dbus_message_set_destination(msg, q_dbus_message_get_sender(d_ptr->reply));
- q_dbus_message_set_reply_serial(msg, q_dbus_message_get_serial(d_ptr->reply));
+ dbus_message_set_destination(msg, dbus_message_get_sender(d_ptr->reply));
+ dbus_message_set_reply_serial(msg, dbus_message_get_serial(d_ptr->reply));
}
break;
case DBUS_MESSAGE_TYPE_ERROR:
&& !QDBusUtil::checkErrorName(d_ptr->name, QDBusUtil::EmptyNotAllowed, error))
return 0;
- msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_ERROR);
- q_dbus_message_set_error_name(msg, d_ptr->name.toUtf8());
+ msg = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR);
+ dbus_message_set_error_name(msg, d_ptr->name.toUtf8());
if (!d_ptr->localMessage) {
- q_dbus_message_set_destination(msg, q_dbus_message_get_sender(d_ptr->reply));
- q_dbus_message_set_reply_serial(msg, q_dbus_message_get_serial(d_ptr->reply));
+ dbus_message_set_destination(msg, dbus_message_get_sender(d_ptr->reply));
+ dbus_message_set_reply_serial(msg, dbus_message_get_serial(d_ptr->reply));
}
break;
case DBUS_MESSAGE_TYPE_SIGNAL:
return 0;
}
- msg = q_dbus_message_new_signal(d_ptr->path.toUtf8(), d_ptr->interface.toUtf8(),
- d_ptr->name.toUtf8());
+ msg = dbus_message_new_signal(d_ptr->path.toUtf8(), d_ptr->interface.toUtf8(),
+ d_ptr->name.toUtf8());
break;
default:
Q_ASSERT(false);
QDBusMarshaller marshaller(capabilities);
QVariantList::ConstIterator it = d_ptr->arguments.constBegin();
QVariantList::ConstIterator cend = d_ptr->arguments.constEnd();
- q_dbus_message_iter_init_append(msg, &marshaller.iterator);
+ dbus_message_iter_init_append(msg, &marshaller.iterator);
if (!d_ptr->message.isEmpty())
// prepend the error message
marshaller.append(d_ptr->message);
return msg;
// not ok;
- q_dbus_message_unref(msg);
+ dbus_message_unref(msg);
*error = QDBusError(QDBusError::Failed, QLatin1String("Marshalling failed: ") + marshaller.errorString);
return 0;
}
if (!dmsg)
return message;
- message.d_ptr->type = q_dbus_message_get_type(dmsg);
- message.d_ptr->path = QString::fromUtf8(q_dbus_message_get_path(dmsg));
- message.d_ptr->interface = QString::fromUtf8(q_dbus_message_get_interface(dmsg));
+ message.d_ptr->type = dbus_message_get_type(dmsg);
+ message.d_ptr->path = QString::fromUtf8(dbus_message_get_path(dmsg));
+ message.d_ptr->interface = QString::fromUtf8(dbus_message_get_interface(dmsg));
message.d_ptr->name = message.d_ptr->type == DBUS_MESSAGE_TYPE_ERROR ?
- QString::fromUtf8(q_dbus_message_get_error_name(dmsg)) :
- QString::fromUtf8(q_dbus_message_get_member(dmsg));
- message.d_ptr->service = QString::fromUtf8(q_dbus_message_get_sender(dmsg));
- message.d_ptr->signature = QString::fromUtf8(q_dbus_message_get_signature(dmsg));
- message.d_ptr->msg = q_dbus_message_ref(dmsg);
+ QString::fromUtf8(dbus_message_get_error_name(dmsg)) :
+ QString::fromUtf8(dbus_message_get_member(dmsg));
+ message.d_ptr->service = QString::fromUtf8(dbus_message_get_sender(dmsg));
+ message.d_ptr->signature = QString::fromUtf8(dbus_message_get_signature(dmsg));
+ message.d_ptr->msg = dbus_message_ref(dmsg);
QDBusDemarshaller demarshaller(capabilities);
- demarshaller.message = q_dbus_message_ref(dmsg);
- if (q_dbus_message_iter_init(demarshaller.message, &demarshaller.iterator))
+ demarshaller.message = dbus_message_ref(dmsg);
+ if (dbus_message_iter_init(demarshaller.message, &demarshaller.iterator))
while (!demarshaller.atEnd())
message << demarshaller.toVariantInternal();
return message;
return QDBusMessage::createError(error);
}
- q_dbus_message_set_sender(message, conn.baseService.toUtf8());
+ dbus_message_set_sender(message, conn.baseService.toUtf8());
QDBusMessage retval = fromDBusMessage(message, conn.capabilities);
retval.d_ptr->localMessage = true;
- q_dbus_message_unref(message);
+ dbus_message_unref(message);
if (retval.d_ptr->service.isEmpty())
retval.d_ptr->service = conn.baseService;
return retval;
reply.setArguments(arguments);
reply.d_ptr->type = DBUS_MESSAGE_TYPE_METHOD_RETURN;
if (d_ptr->msg)
- reply.d_ptr->reply = q_dbus_message_ref(d_ptr->msg);
+ reply.d_ptr->reply = dbus_message_ref(d_ptr->msg);
if (d_ptr->localMessage) {
reply.d_ptr->localMessage = true;
d_ptr->localReply = new QDBusMessage(reply); // keep an internal copy
{
QDBusMessage reply = QDBusMessage::createError(name, msg);
if (d_ptr->msg)
- reply.d_ptr->reply = q_dbus_message_ref(d_ptr->msg);
+ reply.d_ptr->reply = dbus_message_ref(d_ptr->msg);
if (d_ptr->localMessage) {
reply.d_ptr->localMessage = true;
d_ptr->localReply = new QDBusMessage(reply); // keep an internal copy
{
if (!d_ptr->msg)
return d_ptr->localMessage; // if it's a local message, reply is required
- return !q_dbus_message_get_no_reply(d_ptr->msg);
+ return !dbus_message_get_no_reply(d_ptr->msg);
}
/*!
#include "qdbusmetatype.h"
#include <string.h>
-#include "qdbus_symbols_p.h"
#include <qbytearray.h>
#include <qglobal.h>
#include "qdbusargument_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
#ifndef DBUS_TYPE_UNIX_FD
# define DBUS_TYPE_UNIX_FD int('h')
QDBusPendingCallPrivate::~QDBusPendingCallPrivate()
{
if (pending) {
- q_dbus_pending_call_cancel(pending);
- q_dbus_pending_call_unref(pending);
+ dbus_pending_call_cancel(pending);
+ dbus_pending_call_unref(pending);
}
delete watcherHelper;
}
#include <qwaitcondition.h>
#include "qdbusmessage.h"
-#include "qdbus_symbols_p.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
this, SIGNAL(newConnection(QDBusConnection)));
QDBusErrorInternal error;
- d->setServer(q_dbus_server_listen(address.toUtf8().constData(), error), error);
+ d->setServer(dbus_server_listen(address.toUtf8().constData(), error), error);
}
/*!
*/
bool QDBusServer::isConnected() const
{
- return d && d->server && q_dbus_server_get_is_connected(d->server);
+ return d && d->server && dbus_server_get_is_connected(d->server);
}
/*!
{
QString addr;
if (d && d->server) {
- char *c = q_dbus_server_get_address(d->server);
+ char *c = dbus_server_get_address(d->server);
addr = QString::fromUtf8(c);
- q_dbus_free(c);
+ dbus_free(c);
}
return addr;
#include "qdbusservicewatcher.h"
#include "qdbusconnection.h"
-#include "qdbus_symbols_p.h"
#include <QStringList>
#include <qobject_p.h>
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE
#include "qdbusutil_p.h"
-#include "qdbus_symbols_p.h"
-
#include <QtCore/qstringlist.h>
#include "qdbusargument.h"
#include "qdbusunixfiledescriptor.h"
#ifndef QT_NO_DBUS
+#include <dbus/dbus.h>
QT_BEGIN_NAMESPACE