Fix tray visibility and message reception issues
- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Automatically generated configuration for PyQt6.QtDBus.
|
||||
|
||||
sip-version = "6.14.0"
|
||||
sip-abi-version = "13.8"
|
||||
module-tags = ["Qt_6_10_0", "Linux"]
|
||||
module-disabled-features = []
|
||||
@@ -0,0 +1,61 @@
|
||||
// QtDBusmod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%Module(name=PyQt6.QtDBus, keyword_arguments="Optional", use_limited_api=True)
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
|
||||
%Copying
|
||||
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
||||
This file is part of PyQt6.
|
||||
|
||||
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 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.
|
||||
|
||||
If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
then you may purchase a commercial license. For more information contact
|
||||
info@riverbankcomputing.com.
|
||||
|
||||
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
%End
|
||||
|
||||
%DefaultSupertype PyQt6.sip.simplewrapper
|
||||
|
||||
%Include qdbusabstractadaptor.sip
|
||||
%Include qdbusabstractinterface.sip
|
||||
%Include qdbusargument.sip
|
||||
%Include qdbusconnection.sip
|
||||
%Include qdbusconnectioninterface.sip
|
||||
%Include qdbuserror.sip
|
||||
%Include qdbusextratypes.sip
|
||||
%Include qdbusinterface.sip
|
||||
%Include qdbusmessage.sip
|
||||
%Include qdbuspendingcall.sip
|
||||
%Include qdbusservicewatcher.sip
|
||||
%Include qdbusunixfiledescriptor.sip
|
||||
%Include qpydbuspendingreply.sip
|
||||
%Include qpydbusreply.sip
|
||||
@@ -0,0 +1,38 @@
|
||||
// qdbusabstractadaptor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusAbstractAdaptor : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusabstractadaptor.h>
|
||||
%End
|
||||
|
||||
protected:
|
||||
explicit QDBusAbstractAdaptor(QObject *parent /TransferThis/);
|
||||
|
||||
public:
|
||||
virtual ~QDBusAbstractAdaptor();
|
||||
|
||||
protected:
|
||||
void setAutoRelaySignals(bool enable);
|
||||
bool autoRelaySignals() const;
|
||||
};
|
||||
@@ -0,0 +1,232 @@
|
||||
// qdbusabstractinterface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusAbstractInterface : QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusabstractinterface.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
// Convert a Python tuple to a list of QVarients.
|
||||
static QList<QVariant> QtDBus_marshal(PyObject *py_args, int *is_err)
|
||||
{
|
||||
QList<QVariant> cpp_args;
|
||||
Py_ssize_t nr_args = PyTuple_Size(py_args);
|
||||
|
||||
for (Py_ssize_t i = 0; i < nr_args; ++i)
|
||||
{
|
||||
int state;
|
||||
void *var;
|
||||
|
||||
var = sipForceConvertToType(PyTuple_GetItem(py_args, i), sipType_QVariant, NULL,
|
||||
0, &state, is_err);
|
||||
|
||||
if (*is_err)
|
||||
break;
|
||||
|
||||
cpp_args.append(*reinterpret_cast<QVariant *>(var));
|
||||
sipReleaseType(var, sipType_QVariant, state);
|
||||
}
|
||||
|
||||
return cpp_args;
|
||||
}
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
static struct class_graph {
|
||||
const char *name;
|
||||
sipTypeDef **type;
|
||||
int yes, no;
|
||||
} graph[] = {
|
||||
{sipName_QDBusPendingCallWatcher, &sipType_QDBusPendingCallWatcher, -1, 1},
|
||||
{sipName_QDBusAbstractAdaptor, &sipType_QDBusAbstractAdaptor, -1, 2},
|
||||
{sipName_QDBusAbstractInterface, &sipType_QDBusAbstractInterface, 4, 3},
|
||||
{sipName_QDBusServiceWatcher, &sipType_QDBusServiceWatcher, -1, -1},
|
||||
{sipName_QDBusConnectionInterface, &sipType_QDBusConnectionInterface, -1, 5},
|
||||
{sipName_QDBusInterface, &sipType_QDBusInterface, -1, -1},
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
|
||||
sipType = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
struct class_graph *cg = &graph[i];
|
||||
|
||||
if (cg->name != NULL && sipCpp->inherits(cg->name))
|
||||
{
|
||||
sipType = *cg->type;
|
||||
i = cg->yes;
|
||||
}
|
||||
else
|
||||
i = cg->no;
|
||||
}
|
||||
while (i >= 0);
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QDBusAbstractInterface();
|
||||
bool isValid() const;
|
||||
QDBusConnection connection() const;
|
||||
QString service() const;
|
||||
QString path() const;
|
||||
QString interface() const;
|
||||
QDBusError lastError() const;
|
||||
void setTimeout(int timeout);
|
||||
int timeout() const;
|
||||
QDBusMessage call(const QString &method, ...);
|
||||
%MethodCode
|
||||
QList<QVariant> args;
|
||||
|
||||
args = QtDBus_marshal(a1, &sipIsErr);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = new QDBusMessage(sipCpp->callWithArgumentList(QDBus::AutoDetect, *a0, args));
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
%End
|
||||
|
||||
QDBusMessage call(QDBus::CallMode mode, const QString &method, ...);
|
||||
%MethodCode
|
||||
QList<QVariant> args;
|
||||
|
||||
args = QtDBus_marshal(a2, &sipIsErr);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = new QDBusMessage(sipCpp->callWithArgumentList(a0, *a1, args));
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
%End
|
||||
|
||||
QDBusMessage callWithArgumentList(QDBus::CallMode mode, const QString &method, const QList<QVariant> &args) /ReleaseGIL/;
|
||||
bool callWithCallback(const QString &method, const QList<QVariant> &args, SIP_PYOBJECT returnMethod /TypeHint="PYQT_SLOT"/, SIP_PYOBJECT errorMethod /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray return_slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a2, &receiver, return_slot)) == sipErrorNone)
|
||||
{
|
||||
QObject *error_receiver;
|
||||
QByteArray error_slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a3, &error_receiver, error_slot)) == sipErrorNone)
|
||||
{
|
||||
if (receiver == error_receiver)
|
||||
{
|
||||
sipRes = sipCpp->callWithCallback(*a0, *a1, receiver, return_slot.constData(), error_slot.constData());
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"the return and error methods must be bound to the same QObject instance");
|
||||
sipError = sipErrorFail;
|
||||
}
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(3, a3);
|
||||
}
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(2, a2);
|
||||
}
|
||||
%End
|
||||
|
||||
bool callWithCallback(const QString &method, QList<QVariant> &args, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a2, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
sipRes = sipCpp->callWithCallback(*a0, *a1, receiver, slot.constData());
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(2, a2);
|
||||
}
|
||||
%End
|
||||
|
||||
QDBusPendingCall asyncCall(const QString &method, ...);
|
||||
%MethodCode
|
||||
QList<QVariant> args;
|
||||
|
||||
args = QtDBus_marshal(a1, &sipIsErr);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = new QDBusPendingCall(sipCpp->asyncCallWithArgumentList(*a0, args));
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
%End
|
||||
|
||||
QDBusPendingCall asyncCallWithArgumentList(const QString &method, const QList<QVariant> &args);
|
||||
|
||||
protected:
|
||||
QDBusAbstractInterface(const QString &service, const QString &path, const char *interface, const QDBusConnection &connection, QObject *parent /TransferThis/);
|
||||
virtual void connectNotify(const QMetaMethod &signal);
|
||||
virtual void disconnectNotify(const QMetaMethod &signal);
|
||||
|
||||
public:
|
||||
%If (Qt_6_7_0 -)
|
||||
void setInteractiveAuthorizationAllowed(bool enable);
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
bool isInteractiveAuthorizationAllowed() const;
|
||||
%End
|
||||
};
|
||||
|
||||
%ModuleHeaderCode
|
||||
#include "qpydbus_api.h"
|
||||
|
||||
// Imports from QtCore.
|
||||
typedef PyObject *(*pyqt6_qtdbus_from_qvariant_by_type_t)(QVariant &, PyObject *);
|
||||
extern pyqt6_qtdbus_from_qvariant_by_type_t pyqt6_qtdbus_from_qvariant_by_type;
|
||||
|
||||
typedef sipErrorState (*pyqt6_qtdbus_get_pyqtslot_parts_t)(PyObject *, QObject **, QByteArray &);
|
||||
extern pyqt6_qtdbus_get_pyqtslot_parts_t pyqt6_qtdbus_get_pyqtslot_parts;
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Imports from QtCore.
|
||||
pyqt6_qtdbus_from_qvariant_by_type_t pyqt6_qtdbus_from_qvariant_by_type;
|
||||
pyqt6_qtdbus_get_pyqtslot_parts_t pyqt6_qtdbus_get_pyqtslot_parts;
|
||||
%End
|
||||
|
||||
%PostInitialisationCode
|
||||
qpydbus_post_init();
|
||||
|
||||
// Imports from QtCore.
|
||||
pyqt6_qtdbus_from_qvariant_by_type = (pyqt6_qtdbus_from_qvariant_by_type_t)sipImportSymbol("pyqt6_from_qvariant_by_type");
|
||||
Q_ASSERT(pyqt6_qtdbus_from_qvariant_by_type);
|
||||
|
||||
pyqt6_qtdbus_get_pyqtslot_parts = (pyqt6_qtdbus_get_pyqtslot_parts_t)sipImportSymbol("pyqt6_get_pyqtslot_parts");
|
||||
Q_ASSERT(pyqt6_qtdbus_get_pyqtslot_parts);
|
||||
%End
|
||||
@@ -0,0 +1,175 @@
|
||||
// qdbusargument.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusArgument
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusargument.h>
|
||||
%End
|
||||
|
||||
%TypeCode
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
static PyObject *qdbusargument_add(QDBusArgument *arg, PyObject *obj, int mtype)
|
||||
{
|
||||
int iserr = 0;
|
||||
|
||||
if (PyLong_CheckExact(obj))
|
||||
{
|
||||
if (mtype == QMetaType::UChar || mtype == QMetaType::UShort || mtype == QMetaType::UInt || mtype == QMetaType::ULongLong)
|
||||
{
|
||||
// Handle the unsigned values.
|
||||
unsigned long long v = PyLong_AsUnsignedLongLongMask(obj);
|
||||
|
||||
switch (mtype)
|
||||
{
|
||||
case QMetaType::UChar:
|
||||
*arg << (uchar)v;
|
||||
break;
|
||||
|
||||
case QMetaType::UShort:
|
||||
*arg << (ushort)v;
|
||||
break;
|
||||
|
||||
case QMetaType::UInt:
|
||||
*arg << (uint)v;
|
||||
break;
|
||||
|
||||
case QMetaType::ULongLong:
|
||||
*arg << (qulonglong)v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (mtype == QMetaType::Short || mtype == QMetaType::Int || mtype == QMetaType::LongLong)
|
||||
{
|
||||
// Handle the signed values.
|
||||
long long v = PyLong_AsLongLong(obj);
|
||||
|
||||
switch (mtype)
|
||||
{
|
||||
case QMetaType::Short:
|
||||
*arg << (short)v;
|
||||
break;
|
||||
|
||||
case QMetaType::Int:
|
||||
*arg << (int)v;
|
||||
break;
|
||||
|
||||
case QMetaType::LongLong:
|
||||
*arg << (qlonglong)v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"%d is an invalid QMetaType::Type for an integer object",
|
||||
mtype);
|
||||
iserr = 1;
|
||||
}
|
||||
}
|
||||
else if (mtype == QMetaType::QStringList)
|
||||
{
|
||||
// A QStringList has to be handled explicitly to prevent it being seen
|
||||
// as a vialiant list.
|
||||
|
||||
int value_state;
|
||||
|
||||
QStringList *qsl = reinterpret_cast<QStringList *>(
|
||||
sipForceConvertToType(obj, sipType_QStringList, 0,
|
||||
SIP_NOT_NONE, &value_state, &iserr));
|
||||
|
||||
if (!iserr)
|
||||
{
|
||||
arg->beginArray(QMetaType::QString);
|
||||
|
||||
for (int i = 0; i < qsl->count(); ++i)
|
||||
*arg << qsl->at(i);
|
||||
|
||||
arg->endArray();
|
||||
|
||||
sipReleaseType(qsl, sipType_QStringList, value_state);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int value_state;
|
||||
|
||||
QVariant *qv = reinterpret_cast<QVariant *>(
|
||||
sipForceConvertToType(obj, sipType_QVariant, 0, SIP_NOT_NONE,
|
||||
&value_state, &iserr));
|
||||
|
||||
if (!iserr)
|
||||
{
|
||||
// This is an internal method. If it proves to be a problem then we
|
||||
// will have to handle each type explicitly.
|
||||
arg->appendVariant(*qv);
|
||||
sipReleaseType(qv, sipType_QVariant, value_state);
|
||||
}
|
||||
}
|
||||
|
||||
if (iserr)
|
||||
return 0;
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusArgument();
|
||||
QDBusArgument(const QDBusArgument &other);
|
||||
QDBusArgument(SIP_PYOBJECT arg, int id = QMetaType::Int);
|
||||
%MethodCode
|
||||
sipCpp = new QDBusArgument();
|
||||
PyObject *res = qdbusargument_add(sipCpp, a0, a1);
|
||||
|
||||
if (res)
|
||||
{
|
||||
Py_DECREF(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete sipCpp;
|
||||
sipCpp = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
~QDBusArgument();
|
||||
SIP_PYOBJECT add(SIP_PYOBJECT arg, int id = QMetaType::Int) /TypeHint=""/;
|
||||
%MethodCode
|
||||
sipRes = qdbusargument_add(sipCpp, a0, a1);
|
||||
%End
|
||||
|
||||
void beginStructure();
|
||||
void endStructure();
|
||||
void beginArray(QMetaType elementMetaType);
|
||||
void beginArray(int id);
|
||||
void endArray();
|
||||
void beginMap(QMetaType keyMetaType, QMetaType valueMetaType);
|
||||
void beginMap(int kid, int vid);
|
||||
void endMap();
|
||||
void beginMapEntry();
|
||||
void endMapEntry();
|
||||
void swap(QDBusArgument &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,251 @@
|
||||
// qdbusconnection.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
namespace QDBus
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusconnection.h>
|
||||
%End
|
||||
|
||||
enum CallMode
|
||||
{
|
||||
NoBlock,
|
||||
Block,
|
||||
BlockWithGui,
|
||||
AutoDetect,
|
||||
};
|
||||
};
|
||||
|
||||
class QDBusConnection
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusconnection.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum BusType
|
||||
{
|
||||
SessionBus,
|
||||
SystemBus,
|
||||
ActivationBus,
|
||||
};
|
||||
|
||||
enum RegisterOption /BaseType=Flag/
|
||||
{
|
||||
ExportAdaptors,
|
||||
ExportScriptableSlots,
|
||||
ExportScriptableSignals,
|
||||
ExportScriptableProperties,
|
||||
ExportScriptableInvokables,
|
||||
ExportScriptableContents,
|
||||
ExportNonScriptableSlots,
|
||||
ExportNonScriptableSignals,
|
||||
ExportNonScriptableProperties,
|
||||
ExportNonScriptableInvokables,
|
||||
ExportNonScriptableContents,
|
||||
ExportAllSlots,
|
||||
ExportAllSignals,
|
||||
ExportAllProperties,
|
||||
ExportAllInvokables,
|
||||
ExportAllContents,
|
||||
ExportAllSignal,
|
||||
ExportChildObjects,
|
||||
};
|
||||
|
||||
typedef QFlags<QDBusConnection::RegisterOption> RegisterOptions;
|
||||
|
||||
enum UnregisterMode
|
||||
{
|
||||
UnregisterNode,
|
||||
UnregisterTree,
|
||||
};
|
||||
|
||||
enum ConnectionCapability /BaseType=Flag/
|
||||
{
|
||||
UnixFileDescriptorPassing,
|
||||
};
|
||||
|
||||
typedef QFlags<QDBusConnection::ConnectionCapability> ConnectionCapabilities;
|
||||
explicit QDBusConnection(const QString &name);
|
||||
QDBusConnection(const QDBusConnection &other);
|
||||
~QDBusConnection();
|
||||
bool isConnected() const;
|
||||
QString baseService() const;
|
||||
QDBusError lastError() const;
|
||||
QString name() const;
|
||||
QDBusConnection::ConnectionCapabilities connectionCapabilities() const;
|
||||
bool send(const QDBusMessage &message) const;
|
||||
bool callWithCallback(const QDBusMessage &message, SIP_PYOBJECT returnMethod /TypeHint="PYQT_SLOT"/, SIP_PYOBJECT errorMethod /TypeHint="PYQT_SLOT"/, int timeout = -1) const;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray return_slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a1, &receiver, return_slot)) == sipErrorNone)
|
||||
{
|
||||
QObject *error_receiver;
|
||||
QByteArray error_slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a2, &error_receiver, error_slot)) == sipErrorNone)
|
||||
{
|
||||
if (receiver == error_receiver)
|
||||
{
|
||||
sipRes = sipCpp->callWithCallback(*a0, receiver, return_slot.constData(), error_slot.constData(), a3);
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"the return and error methods must be bound to the same QObject instance");
|
||||
sipError = sipErrorFail;
|
||||
}
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(2, a2);
|
||||
}
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(1, a1);
|
||||
}
|
||||
%End
|
||||
|
||||
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode = QDBus::Block, int timeout = -1) const /ReleaseGIL/;
|
||||
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout = -1) const;
|
||||
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a4, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->connect(*a0, *a1, *a2, *a3, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(4, a4);
|
||||
}
|
||||
%End
|
||||
|
||||
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a5, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->connect(*a0, *a1, *a2, *a3, *a4, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(5, a5);
|
||||
}
|
||||
%End
|
||||
|
||||
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a6, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->connect(*a0, *a1, *a2, *a3, *a4, *a5, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(6, a6);
|
||||
}
|
||||
%End
|
||||
|
||||
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a4, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->disconnect(*a0, *a1, *a2, *a3, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(4, a4);
|
||||
}
|
||||
%End
|
||||
|
||||
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a5, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->disconnect(*a0, *a1, *a2, *a3, *a4, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(5, a5);
|
||||
}
|
||||
%End
|
||||
|
||||
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt6_qtdbus_get_pyqtslot_parts(a6, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->disconnect(*a0, *a1, *a2, *a3, *a4, *a5, receiver, slot.constData());
|
||||
Py_END_ALLOW_THREADS
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(6, a6);
|
||||
}
|
||||
%End
|
||||
|
||||
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options = QDBusConnection::ExportAdaptors);
|
||||
bool registerObject(const QString &path, const QString &interface, QObject *object, QDBusConnection::RegisterOptions options = QDBusConnection::ExportAdaptors);
|
||||
void unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode = QDBusConnection::UnregisterNode);
|
||||
QObject *objectRegisteredAt(const QString &path) const;
|
||||
bool registerService(const QString &serviceName);
|
||||
bool unregisterService(const QString &serviceName);
|
||||
QDBusConnectionInterface *interface() const;
|
||||
static QDBusConnection connectToBus(QDBusConnection::BusType type, const QString &name) /ReleaseGIL/;
|
||||
static QDBusConnection connectToBus(const QString &address, const QString &name) /ReleaseGIL/;
|
||||
static QDBusConnection connectToPeer(const QString &address, const QString &name) /ReleaseGIL/;
|
||||
static void disconnectFromBus(const QString &name) /ReleaseGIL/;
|
||||
static void disconnectFromPeer(const QString &name) /ReleaseGIL/;
|
||||
static QByteArray localMachineId();
|
||||
static QDBusConnection sessionBus();
|
||||
static QDBusConnection systemBus();
|
||||
void swap(QDBusConnection &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
// qdbusconnectioninterface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusConnectionInterface : public QDBusAbstractInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusconnectioninterface.h>
|
||||
%End
|
||||
|
||||
QDBusConnectionInterface(const QDBusConnection &connection, QObject *parent /TransferThis/);
|
||||
virtual ~QDBusConnectionInterface();
|
||||
|
||||
public:
|
||||
enum ServiceQueueOptions
|
||||
{
|
||||
DontQueueService,
|
||||
QueueService,
|
||||
ReplaceExistingService,
|
||||
};
|
||||
|
||||
enum ServiceReplacementOptions
|
||||
{
|
||||
DontAllowReplacement,
|
||||
AllowReplacement,
|
||||
};
|
||||
|
||||
enum RegisterServiceReply
|
||||
{
|
||||
ServiceNotRegistered,
|
||||
ServiceRegistered,
|
||||
ServiceQueued,
|
||||
};
|
||||
|
||||
QDBusReply<QStringList> registeredServiceNames() const /ReleaseGIL/;
|
||||
QDBusReply<QStringList> activatableServiceNames() const /ReleaseGIL/;
|
||||
QDBusReply<bool> isServiceRegistered(const QString &serviceName) const /ReleaseGIL/;
|
||||
QDBusReply<QString> serviceOwner(const QString &name) const /ReleaseGIL/;
|
||||
QDBusReply<bool> unregisterService(const QString &serviceName) /ReleaseGIL/;
|
||||
QDBusReply<QDBusConnectionInterface::RegisterServiceReply> registerService(const QString &serviceName, QDBusConnectionInterface::ServiceQueueOptions qoption = QDBusConnectionInterface::DontQueueService, QDBusConnectionInterface::ServiceReplacementOptions roption = QDBusConnectionInterface::DontAllowReplacement) /ReleaseGIL/;
|
||||
QDBusReply<unsigned int> servicePid(const QString &serviceName) const /ReleaseGIL/;
|
||||
QDBusReply<unsigned int> serviceUid(const QString &serviceName) const /ReleaseGIL/;
|
||||
QDBusReply<void> startService(const QString &name) /ReleaseGIL/;
|
||||
%If (Qt_6_10_0 -)
|
||||
QDBusReply<QMap<QString, QVariant>> serviceCredentials(const QString &serviceName) const /ReleaseGIL/;
|
||||
%End
|
||||
|
||||
signals:
|
||||
void serviceRegistered(const QString &service);
|
||||
void serviceUnregistered(const QString &service);
|
||||
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &call);
|
||||
|
||||
protected:
|
||||
virtual void connectNotify(const QMetaMethod &);
|
||||
virtual void disconnectNotify(const QMetaMethod &);
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
// qdbuserror.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusError
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbuserror.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ErrorType
|
||||
{
|
||||
NoError,
|
||||
Other,
|
||||
Failed,
|
||||
NoMemory,
|
||||
ServiceUnknown,
|
||||
NoReply,
|
||||
BadAddress,
|
||||
NotSupported,
|
||||
LimitsExceeded,
|
||||
AccessDenied,
|
||||
NoServer,
|
||||
Timeout,
|
||||
NoNetwork,
|
||||
AddressInUse,
|
||||
Disconnected,
|
||||
InvalidArgs,
|
||||
UnknownMethod,
|
||||
TimedOut,
|
||||
InvalidSignature,
|
||||
UnknownInterface,
|
||||
InternalError,
|
||||
UnknownObject,
|
||||
InvalidService,
|
||||
InvalidObjectPath,
|
||||
InvalidInterface,
|
||||
InvalidMember,
|
||||
UnknownProperty,
|
||||
PropertyReadOnly,
|
||||
};
|
||||
|
||||
QDBusError(const QDBusError &other);
|
||||
QDBusError::ErrorType type() const;
|
||||
QString name() const;
|
||||
QString message() const;
|
||||
bool isValid() const;
|
||||
static QString errorString(QDBusError::ErrorType error);
|
||||
void swap(QDBusError &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
// qdbusextratypes.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusObjectPath
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusextratypes.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusObjectPath();
|
||||
explicit QDBusObjectPath(const QString &objectPath);
|
||||
QString path() const;
|
||||
void setPath(const QString &objectPath);
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp, 0);
|
||||
%End
|
||||
|
||||
void swap(QDBusObjectPath &other /Constrained/);
|
||||
};
|
||||
|
||||
bool operator==(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs);
|
||||
bool operator!=(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs);
|
||||
bool operator<(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs);
|
||||
|
||||
class QDBusSignature
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusextratypes.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusSignature();
|
||||
explicit QDBusSignature(const QString &dBusSignature);
|
||||
QString signature() const;
|
||||
void setSignature(const QString &dBusSignature);
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp, 0);
|
||||
%End
|
||||
|
||||
void swap(QDBusSignature &other /Constrained/);
|
||||
};
|
||||
|
||||
bool operator==(const QDBusSignature &lhs, const QDBusSignature &rhs);
|
||||
bool operator!=(const QDBusSignature &lhs, const QDBusSignature &rhs);
|
||||
bool operator<(const QDBusSignature &lhs, const QDBusSignature &rhs);
|
||||
|
||||
class QDBusVariant
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusextratypes.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusVariant();
|
||||
explicit QDBusVariant(const QVariant &dBusVariant);
|
||||
QVariant variant() const;
|
||||
void setVariant(const QVariant &dBusVariant);
|
||||
void swap(QDBusVariant &other /Constrained/);
|
||||
};
|
||||
|
||||
bool operator==(const QDBusVariant &v1, const QDBusVariant &v2);
|
||||
@@ -0,0 +1,32 @@
|
||||
// qdbusinterface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusInterface : public QDBusAbstractInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusinterface.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusInterface(const QString &service, const QString &path, const QString &interface = QString(), const QDBusConnection &connection = QDBusConnection::sessionBus(), QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QDBusInterface();
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
// qdbusmessage.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusMessage
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusmessage.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum MessageType
|
||||
{
|
||||
InvalidMessage,
|
||||
MethodCallMessage,
|
||||
ReplyMessage,
|
||||
ErrorMessage,
|
||||
SignalMessage,
|
||||
};
|
||||
|
||||
QDBusMessage();
|
||||
QDBusMessage(const QDBusMessage &other);
|
||||
~QDBusMessage();
|
||||
static QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name);
|
||||
static QDBusMessage createMethodCall(const QString &service, const QString &path, const QString &interface, const QString &method);
|
||||
static QDBusMessage createError(const QString &name, const QString &msg);
|
||||
static QDBusMessage createError(const QDBusError &error);
|
||||
static QDBusMessage createError(QDBusError::ErrorType type, const QString &msg);
|
||||
QDBusMessage createReply(const QList<QVariant> &arguments = QList<QVariant>()) const;
|
||||
QDBusMessage createReply(const QVariant &argument) const;
|
||||
QDBusMessage createErrorReply(const QString &name, const QString &msg) const;
|
||||
QDBusMessage createErrorReply(const QDBusError &error) const;
|
||||
QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const;
|
||||
QString service() const;
|
||||
QString path() const;
|
||||
QString interface() const;
|
||||
QString member() const;
|
||||
QString errorName() const;
|
||||
QString errorMessage() const;
|
||||
QDBusMessage::MessageType type() const;
|
||||
QString signature() const;
|
||||
bool isReplyRequired() const;
|
||||
void setDelayedReply(bool enable) const;
|
||||
bool isDelayedReply() const;
|
||||
void setAutoStartService(bool enable);
|
||||
bool autoStartService() const;
|
||||
void setArguments(const QList<QVariant> &arguments);
|
||||
QList<QVariant> arguments() const;
|
||||
QDBusMessage &operator<<(const QVariant &arg);
|
||||
void swap(QDBusMessage &other /Constrained/);
|
||||
static QDBusMessage createTargetedSignal(const QString &service, const QString &path, const QString &interface, const QString &name);
|
||||
void setInteractiveAuthorizationAllowed(bool enable);
|
||||
bool isInteractiveAuthorizationAllowed() const;
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
// qdbuspendingcall.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusPendingCall
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbuspendingcall.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusPendingCall(const QDBusPendingCall &other);
|
||||
~QDBusPendingCall();
|
||||
static QDBusPendingCall fromError(const QDBusError &error);
|
||||
static QDBusPendingCall fromCompletedCall(const QDBusMessage &message);
|
||||
void swap(QDBusPendingCall &other /Constrained/);
|
||||
|
||||
private:
|
||||
QDBusPendingCall();
|
||||
};
|
||||
|
||||
class QDBusPendingCallWatcher : public QObject, public QDBusPendingCall
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbuspendingcall.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QDBusPendingCallWatcher();
|
||||
bool isFinished() const;
|
||||
void waitForFinished() /ReleaseGIL/;
|
||||
|
||||
signals:
|
||||
void finished(QDBusPendingCallWatcher *watcher = 0);
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
// qdbusservicewatcher.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusServiceWatcher : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusservicewatcher.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum WatchModeFlag /BaseType=Flag/
|
||||
{
|
||||
WatchForRegistration,
|
||||
WatchForUnregistration,
|
||||
WatchForOwnerChange,
|
||||
};
|
||||
|
||||
typedef QFlags<QDBusServiceWatcher::WatchModeFlag> WatchMode;
|
||||
explicit QDBusServiceWatcher(QObject *parent /TransferThis/ = 0);
|
||||
QDBusServiceWatcher(const QString &service, const QDBusConnection &connection, QDBusServiceWatcher::WatchMode watchMode = QDBusServiceWatcher::WatchForOwnerChange, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QDBusServiceWatcher();
|
||||
QStringList watchedServices() const;
|
||||
void setWatchedServices(const QStringList &services);
|
||||
void addWatchedService(const QString &newService);
|
||||
bool removeWatchedService(const QString &service);
|
||||
QDBusServiceWatcher::WatchMode watchMode() const;
|
||||
void setWatchMode(QDBusServiceWatcher::WatchMode mode);
|
||||
QDBusConnection connection() const;
|
||||
void setConnection(const QDBusConnection &connection);
|
||||
|
||||
signals:
|
||||
void serviceRegistered(const QString &service);
|
||||
void serviceUnregistered(const QString &service);
|
||||
void serviceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner);
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
// qdbusunixfiledescriptor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtDBus Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDBusUnixFileDescriptor
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusunixfiledescriptor.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDBusUnixFileDescriptor();
|
||||
explicit QDBusUnixFileDescriptor(int fileDescriptor);
|
||||
QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other);
|
||||
~QDBusUnixFileDescriptor();
|
||||
bool isValid() const;
|
||||
int fileDescriptor() const;
|
||||
void setFileDescriptor(int fileDescriptor);
|
||||
static bool isSupported();
|
||||
void swap(QDBusUnixFileDescriptor &other /Constrained/);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
// This is the SIP specification of the QPyDBusPendingReply class.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPyDBusPendingReply : QDBusPendingCall /PyName=QDBusPendingReply/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpydbuspendingreply.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPyDBusPendingReply();
|
||||
QPyDBusPendingReply(const QPyDBusPendingReply &other);
|
||||
QPyDBusPendingReply(const QDBusPendingCall &call);
|
||||
QPyDBusPendingReply(const QDBusMessage &reply);
|
||||
|
||||
// The /ReleaseGIL/ annotation is needed because QDBusPendingCall has an
|
||||
// internal mutex.
|
||||
QVariant argumentAt(int index) const /ReleaseGIL/;
|
||||
QDBusError error() const /ReleaseGIL/;
|
||||
bool isError() const /ReleaseGIL/;
|
||||
bool isFinished() const /ReleaseGIL/;
|
||||
bool isValid() const /ReleaseGIL/;
|
||||
QDBusMessage reply() const /ReleaseGIL/;
|
||||
void waitForFinished() /ReleaseGIL/;
|
||||
|
||||
SIP_PYOBJECT value(SIP_PYOBJECT type /TypeHintValue="None"/ = 0) const /HoldGIL/;
|
||||
};
|
||||
@@ -0,0 +1,305 @@
|
||||
// This is the SIP specification of the QPyDBusReply class.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// 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 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.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QPyDBusReply /PyName=QDBusReply/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QPyDBusReply(const QDBusMessage &reply) /HoldGIL/;
|
||||
QPyDBusReply(const QDBusPendingCall &call) /HoldGIL/;
|
||||
QPyDBusReply(const QDBusError &error);
|
||||
QPyDBusReply(const QPyDBusReply &other) /HoldGIL/;
|
||||
~QPyDBusReply() /HoldGIL/;
|
||||
|
||||
const QDBusError &error() const /HoldGIL/;
|
||||
bool isValid() const /HoldGIL/;
|
||||
SIP_PYOBJECT value(SIP_PYOBJECT type /TypeHintValue="None"/ = 0) const /HoldGIL/;
|
||||
};
|
||||
|
||||
|
||||
template<TYPE>
|
||||
%MappedType QDBusReply<TYPE> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *value_obj;
|
||||
|
||||
if (sipCpp->isValid())
|
||||
{
|
||||
// Convert the value to a Python object.
|
||||
TYPE *value = new TYPE(sipCpp->value());
|
||||
|
||||
if ((value_obj = sipConvertFromNewType(value, sipType_TYPE, NULL)) == NULL)
|
||||
{
|
||||
delete value;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value_obj = 0;
|
||||
}
|
||||
|
||||
QPyDBusReply *reply = new QPyDBusReply(value_obj, sipCpp->isValid(),
|
||||
sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%MappedType QDBusReply<void> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
Py_INCREF(Py_None);
|
||||
QPyDBusReply *reply = new QPyDBusReply(Py_None,
|
||||
sipCpp->isValid(), sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%MappedType QDBusReply<bool> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *value_obj;
|
||||
|
||||
if (sipCpp->isValid())
|
||||
{
|
||||
if ((value_obj = PyBool_FromLong(sipCpp->value())) == NULL)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
value_obj = 0;
|
||||
}
|
||||
|
||||
QPyDBusReply *reply = new QPyDBusReply(value_obj, sipCpp->isValid(),
|
||||
sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%MappedType QDBusReply<unsigned> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *value_obj;
|
||||
|
||||
if (sipCpp->isValid())
|
||||
{
|
||||
if ((value_obj = PyLong_FromUnsignedLong(sipCpp->value())) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
value_obj = 0;
|
||||
}
|
||||
|
||||
QPyDBusReply *reply = new QPyDBusReply(value_obj, sipCpp->isValid(),
|
||||
sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%MappedType QDBusReply<QDBusConnectionInterface::RegisterServiceReply> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *value_obj;
|
||||
|
||||
if (sipCpp->isValid())
|
||||
{
|
||||
if ((value_obj = sipConvertFromEnum(sipCpp->value(), sipType_QDBusConnectionInterface_RegisterServiceReply)) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
value_obj = 0;
|
||||
}
|
||||
|
||||
QPyDBusReply *reply = new QPyDBusReply(value_obj, sipCpp->isValid(),
|
||||
sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
%If (Qt_6_10_0 -)
|
||||
|
||||
%MappedType QDBusReply<QMap<QString, QVariant>> /TypeHint="QDBusReply"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdbusreply.h>
|
||||
#include <qpydbusreply.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *value_obj;
|
||||
|
||||
if (sipCpp->isValid())
|
||||
{
|
||||
if ((value_obj = PyDict_New()) == NULL)
|
||||
return 0;
|
||||
|
||||
QMap<QString, QVariant> value = sipCpp->value();
|
||||
QMap<QString, QVariant>::const_iterator it = value.constBegin();
|
||||
QMap<QString, QVariant>::const_iterator end = value.constEnd();
|
||||
|
||||
while (it != end)
|
||||
{
|
||||
QString *k = new QString(it.key());
|
||||
PyObject *kobj = sipConvertFromNewType(k, sipType_QString,
|
||||
sipTransferObj);
|
||||
|
||||
if (!kobj)
|
||||
{
|
||||
delete k;
|
||||
Py_DECREF(value_obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVariant *v = new QVariant(it.value());
|
||||
PyObject *vobj = sipConvertFromNewType(v, sipType_QVariant,
|
||||
sipTransferObj);
|
||||
|
||||
if (!vobj)
|
||||
{
|
||||
delete v;
|
||||
Py_DECREF(kobj);
|
||||
Py_DECREF(value_obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rc = PyDict_SetItem(value_obj, kobj, vobj);
|
||||
|
||||
Py_DECREF(vobj);
|
||||
Py_DECREF(kobj);
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
Py_DECREF(value_obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value_obj = 0;
|
||||
}
|
||||
|
||||
QPyDBusReply *reply = new QPyDBusReply(value_obj, sipCpp->isValid(),
|
||||
sipCpp->error());
|
||||
|
||||
PyObject *reply_obj = sipConvertFromNewType(reply, sipType_QPyDBusReply,
|
||||
sipTransferObj);
|
||||
|
||||
if (!reply_obj)
|
||||
{
|
||||
delete reply;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return reply_obj;
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
Reference in New Issue
Block a user