feat: 实现Apps服务、Launcher服务、Dock服务
*重写Apps服务,新服务分为org.deepin.daemon.DFWatcher1和org.deepin.daemon.ALRecorder1两个服务 *重写Launcher服务, 新服务名为org.deepin.dde.daemon.Launcher1 *重写Dock服务, 新服务名为org.deepin.dde.daemon.Dock1 *重写部分go-lib接口,保存在src/lib目录, 后续从项目中提出统一存放至开发库 *使用XCB库实现与XServer交互,存放在src/lib目录 *放弃依赖dde-qt-dbus-factory包, 将xml文件生成的静态编译代码存放在frameworkdbus目录 Log: 实现Apps服务、Launcher服务、Dock服务 Task: https://pms.uniontech.com/task-view-109315.html Influence: 无 Change-Id: Ia9676060bfe81ce8d02c48972cc3d3cbaf665a31
This commit is contained in:
73
src/frameworkdbus/dbusbamfapplication.cpp
Normal file
73
src/frameworkdbus/dbusbamfapplication.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c BamfApplication -p BamfApplication Application.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbusbamfapplication.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __BamfApplication
|
||||
*/
|
||||
|
||||
class __BamfApplicationPrivate
|
||||
{
|
||||
public:
|
||||
__BamfApplicationPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__BamfApplication::__BamfApplication(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __BamfApplicationPrivate)
|
||||
{
|
||||
if (QMetaType::type("QList<uint>") == QMetaType::UnknownType) {
|
||||
qRegisterMetaType< QList<uint> >("QList<uint>");
|
||||
qDBusRegisterMetaType< QList<uint> >();
|
||||
}
|
||||
}
|
||||
|
||||
__BamfApplication::~__BamfApplication()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __BamfApplication::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__BamfApplication::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __BamfApplication::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
134
src/frameworkdbus/dbusbamfapplication.h
Normal file
134
src/frameworkdbus/dbusbamfapplication.h
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c BamfApplication -p BamfApplication Application.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef BAMFAPPLICATION_H
|
||||
#define BAMFAPPLICATION_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.ayatana.bamf.application
|
||||
*/
|
||||
class __BamfApplicationPrivate;
|
||||
class __BamfApplication : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.ayatana.bamf.application"; }
|
||||
|
||||
public:
|
||||
explicit __BamfApplication(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__BamfApplication();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline Q_DECL_DEPRECATED QDBusPendingReply<QString, QString> ApplicationMenu()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ApplicationMenu"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline Q_DECL_DEPRECATED QDBusReply<QString> ApplicationMenu(QString &objectpath)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("ApplicationMenu"), argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
|
||||
objectpath = qdbus_cast<QString>(reply.arguments().at(1));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString> ApplicationType()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ApplicationType"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> DesktopFile()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("DesktopFile"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> FocusableChild()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("FocusableChild"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> ShowStubs()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowStubs"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> SupportedMimeTypes()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("SupportedMimeTypes"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QList<uint> > Xids()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Xids"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void DesktopFileUpdated(const QString &desktop_file);
|
||||
void SupportedMimeTypesChanged(const QStringList &dnd_mimes);
|
||||
Q_DECL_DEPRECATED void WindowAdded(const QString &path);
|
||||
Q_DECL_DEPRECATED void WindowRemoved(const QString &path);
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__BamfApplicationPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace org {
|
||||
namespace ayatana {
|
||||
namespace bamf {
|
||||
typedef ::__BamfApplication BamfApplication;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
75
src/frameworkdbus/dbusbamfmatcher.cpp
Normal file
75
src/frameworkdbus/dbusbamfmatcher.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c BamfMatcher -p BamfMatcher Matcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbusbamfmatcher.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __BamfMatcher
|
||||
*/
|
||||
|
||||
class __BamfMatcherPrivate
|
||||
{
|
||||
public:
|
||||
__BamfMatcherPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__BamfMatcher::__BamfMatcher(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __BamfMatcherPrivate)
|
||||
{
|
||||
if (QMetaType::type("QList<uint>") == QMetaType::UnknownType) {
|
||||
qRegisterMetaType< QList<uint> >("QList<uint>");
|
||||
qDBusRegisterMetaType< QList<uint> >();
|
||||
}
|
||||
}
|
||||
|
||||
__BamfMatcher::~__BamfMatcher()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __BamfMatcher::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__BamfMatcher::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __BamfMatcher::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
188
src/frameworkdbus/dbusbamfmatcher.h
Normal file
188
src/frameworkdbus/dbusbamfmatcher.h
Normal file
@ -0,0 +1,188 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c BamfMatcher -p BamfMatcher Matcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef BAMFMATCHER_H
|
||||
#define BAMFMATCHER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.ayatana.bamf.matcher
|
||||
*/
|
||||
class __BamfMatcherPrivate;
|
||||
class __BamfMatcher : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.ayatana.bamf.matcher"; }
|
||||
|
||||
public:
|
||||
explicit __BamfMatcher(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__BamfMatcher();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<QString> ActiveApplication()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ActiveApplication"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> ActiveWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> ApplicationForXid(uint xid)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(xid);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ApplicationForXid"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> ApplicationIsRunning(const QString &desktop_file)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(desktop_file);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ApplicationIsRunning"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> ApplicationPaths()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ApplicationPaths"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> PathForApplication(const QString &desktop_file)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(desktop_file);
|
||||
return asyncCallWithArgumentList(QStringLiteral("PathForApplication"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RegisterFavorites(const QStringList &favorites)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(favorites);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RegisterFavorites"), argumentList);
|
||||
}
|
||||
|
||||
inline void RegisterFavoritesQueued(const QStringList &favorites)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(favorites);
|
||||
|
||||
CallQueued(QStringLiteral("RegisterFavorites"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> RunningApplications()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RunningApplications"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> RunningApplicationsDesktopFiles()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RunningApplicationsDesktopFiles"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> TabPaths()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("TabPaths"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> WindowPaths()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("WindowPaths"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> WindowStackForMonitor(int monitor_id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(monitor_id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("WindowStackForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QList<uint> > XidsForApplication(const QString &desktop_file)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(desktop_file);
|
||||
return asyncCallWithArgumentList(QStringLiteral("XidsForApplication"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void ActiveApplicationChanged(const QString &old_app, const QString &new_app);
|
||||
void ActiveWindowChanged(const QString &old_win, const QString &new_win);
|
||||
void RunningApplicationsChanged(const QStringList &opened_desktop_files, const QStringList &closed_desktop_files);
|
||||
void StackingOrderChanged();
|
||||
void ViewClosed(const QString &path, const QString &type);
|
||||
void ViewOpened(const QString &path, const QString &type);
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__BamfMatcherPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace org {
|
||||
namespace ayatana {
|
||||
namespace bamf {
|
||||
typedef ::__BamfMatcher BamfMatcher;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
71
src/frameworkdbus/dbuskwaylandoutput.cpp
Normal file
71
src/frameworkdbus/dbuskwaylandoutput.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c OutputManagement -p generated/outputmanagement ../xml/OutputManagement.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuskwaylandoutput.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __OutputManagement
|
||||
*/
|
||||
|
||||
class __OutputManagementPrivate
|
||||
{
|
||||
public:
|
||||
__OutputManagementPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__OutputManagement::__OutputManagement(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __OutputManagementPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
__OutputManagement::~__OutputManagement()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __OutputManagement::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__OutputManagement::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __OutputManagement::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
119
src/frameworkdbus/dbuskwaylandoutput.h
Normal file
119
src/frameworkdbus/dbuskwaylandoutput.h
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c OutputManagement -p generated/outputmanagement ../xml/OutputManagement.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef OUTPUTMANAGEMENT_H
|
||||
#define OUTPUTMANAGEMENT_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.daemon.KWayland.Output
|
||||
*/
|
||||
class __OutputManagementPrivate;
|
||||
class __OutputManagement : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "com.deepin.daemon.KWayland.Output"; }
|
||||
|
||||
public:
|
||||
explicit __OutputManagement(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__OutputManagement();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> Apply(const QString &outputs)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(outputs);
|
||||
return asyncCallWithArgumentList(QStringLiteral("Apply"), argumentList);
|
||||
}
|
||||
|
||||
inline void ApplyQueued(const QString &outputs)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(outputs);
|
||||
|
||||
CallQueued(QStringLiteral("Apply"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetOutput(const QString &uuid)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uuid);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetOutput"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> ListOutput()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ListOutput"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> WlSimulateKey(int state)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(state);
|
||||
return asyncCallWithArgumentList(QStringLiteral("WlSimulateKey"), argumentList);
|
||||
}
|
||||
|
||||
inline void WlSimulateKeyQueued(int state)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(state);
|
||||
|
||||
CallQueued(QStringLiteral("WlSimulateKey"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void OutputAdded(const QString &output);
|
||||
void OutputChanged(const QString &output);
|
||||
void OutputRemoved(const QString &output);
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__OutputManagementPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
namespace daemon {
|
||||
namespace kwayland {
|
||||
typedef ::__OutputManagement Output;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
71
src/frameworkdbus/dbuskwaylandwindowmanager.cpp
Normal file
71
src/frameworkdbus/dbuskwaylandwindowmanager.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c kwaylandmanager -p kwaylandmanager com.deepin.daemon.KWayland.WindowManager.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuskwaylandwindowmanager.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __kwaylandmanager
|
||||
*/
|
||||
|
||||
class __kwaylandmanagerPrivate
|
||||
{
|
||||
public:
|
||||
__kwaylandmanagerPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__KwaylandManager::__KwaylandManager(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __kwaylandmanagerPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
__KwaylandManager::~__KwaylandManager()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __KwaylandManager::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__KwaylandManager::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __KwaylandManager::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
94
src/frameworkdbus/dbuskwaylandwindowmanager.h
Normal file
94
src/frameworkdbus/dbuskwaylandwindowmanager.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c kwaylandmanager -p kwaylandmanager com.deepin.daemon.KWayland.WindowManager.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef KWAYLANDMANAGER_H
|
||||
#define KWAYLANDMANAGER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.daemon.KWayland.WindowManager
|
||||
*/
|
||||
class __kwaylandmanagerPrivate;
|
||||
class __KwaylandManager : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "com.deepin.daemon.KWayland.WindowManager"; }
|
||||
|
||||
public:
|
||||
explicit __KwaylandManager(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__KwaylandManager();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<uint> ActiveWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsShowingDesktop()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsShowingDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QVariantList> Windows()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Windows"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void ActiveWindowChanged();
|
||||
void WindowCreated(const QString &ObjPath);
|
||||
void WindowRemove(const QString &ObjPath);
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__kwaylandmanagerPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
namespace daemon {
|
||||
namespace kwayland {
|
||||
typedef ::__KwaylandManager WindowManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
129
src/frameworkdbus/dbuslauncher.cpp
Normal file
129
src/frameworkdbus/dbuslauncher.cpp
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Launcherd -p generated/com_deepin_dde_daemon_launcherd ../xml/com.deepin.dde.daemon.Launcherd.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuslauncher.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __Launcherd
|
||||
*/
|
||||
|
||||
class __LauncherdPrivate
|
||||
{
|
||||
public:
|
||||
__LauncherdPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
int DisplayMode;
|
||||
bool Fullscreen;
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
LauncherBackEnd::LauncherBackEnd(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __LauncherdPrivate)
|
||||
{
|
||||
connect(this, &LauncherBackEnd::propertyChanged, this, &LauncherBackEnd::onPropertyChanged);
|
||||
|
||||
if (QMetaType::type("LauncherItemInfo") == QMetaType::UnknownType)
|
||||
registerLauncherItemInfoMetaType();
|
||||
if (QMetaType::type("LauncherItemInfoList") == QMetaType::UnknownType)
|
||||
registerLauncherItemInfoListMetaType();
|
||||
}
|
||||
|
||||
LauncherBackEnd::~LauncherBackEnd()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void LauncherBackEnd::onPropertyChanged(const QString &propName, const QVariant &value)
|
||||
{
|
||||
if (propName == QStringLiteral("DisplayMode"))
|
||||
{
|
||||
const int &DisplayMode = qvariant_cast<int>(value);
|
||||
if (d_ptr->DisplayMode != DisplayMode)
|
||||
{
|
||||
d_ptr->DisplayMode = DisplayMode;
|
||||
Q_EMIT DisplayModeChanged(d_ptr->DisplayMode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("Fullscreen"))
|
||||
{
|
||||
const bool &Fullscreen = qvariant_cast<bool>(value);
|
||||
if (d_ptr->Fullscreen != Fullscreen)
|
||||
{
|
||||
d_ptr->Fullscreen = Fullscreen;
|
||||
Q_EMIT FullscreenChanged(d_ptr->Fullscreen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "property not handle: " << propName;
|
||||
return;
|
||||
}
|
||||
|
||||
int LauncherBackEnd::displayMode()
|
||||
{
|
||||
return qvariant_cast<int>(internalPropGet("DisplayMode", &d_ptr->DisplayMode));
|
||||
}
|
||||
|
||||
void LauncherBackEnd::setDisplayMode(int value)
|
||||
{
|
||||
|
||||
internalPropSet("DisplayMode", QVariant::fromValue(value), &d_ptr->DisplayMode);
|
||||
}
|
||||
|
||||
bool LauncherBackEnd::fullscreen()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("Fullscreen", &d_ptr->Fullscreen));
|
||||
}
|
||||
|
||||
void LauncherBackEnd::setFullscreen(bool value)
|
||||
{
|
||||
|
||||
internalPropSet("Fullscreen", QVariant::fromValue(value), &d_ptr->Fullscreen);
|
||||
}
|
||||
|
||||
void LauncherBackEnd::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &LauncherBackEnd::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherBackEnd::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
235
src/frameworkdbus/dbuslauncher.h
Normal file
235
src/frameworkdbus/dbuslauncher.h
Normal file
@ -0,0 +1,235 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Launcherd -p generated/com_deepin_dde_daemon_launcherd ../xml/com.deepin.dde.daemon.Launcherd.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_DDE_DAEMON_LAUNCHERD_H
|
||||
#define COM_DEEPIN_DDE_DAEMON_LAUNCHERD_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include "types/launcheriteminfo.h"
|
||||
#include "types/launcheriteminfolist.h"
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.deepin.dde.daemon.Launcher1
|
||||
*/
|
||||
class __LauncherdPrivate;
|
||||
class LauncherBackEnd : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.deepin.dde.daemon.Launcher1"; }
|
||||
|
||||
public:
|
||||
explicit LauncherBackEnd(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~LauncherBackEnd();
|
||||
|
||||
Q_PROPERTY(int DisplayMode READ displayMode WRITE setDisplayMode NOTIFY DisplayModeChanged)
|
||||
int displayMode();
|
||||
void setDisplayMode(int value);
|
||||
|
||||
Q_PROPERTY(bool Fullscreen READ fullscreen WRITE setFullscreen NOTIFY FullscreenChanged)
|
||||
bool fullscreen();
|
||||
void setFullscreen(bool value);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<LauncherItemInfoList> GetAllItemInfos()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAllItemInfos"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> GetAllNewInstalledApps()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAllNewInstalledApps"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> GetDisableScaling(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetDisableScaling"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<LauncherItemInfo> GetItemInfo(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetItemInfo"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> GetUseProxy(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetUseProxy"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsItemOnDesktop(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsItemOnDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> MarkLaunched(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("MarkLaunched"), argumentList);
|
||||
}
|
||||
|
||||
inline void MarkLaunchedQueued(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
|
||||
CallQueued(QStringLiteral("MarkLaunched"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> RequestRemoveFromDesktop(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestRemoveFromDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> RequestSendToDesktop(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestSendToDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestUninstall(const QString &id, bool purge)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(purge);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestUninstall"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestUninstallQueued(const QString &id, bool purge)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(purge);
|
||||
|
||||
CallQueued(QStringLiteral("RequestUninstall"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> Search(const QString &key)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(key);
|
||||
return asyncCallWithArgumentList(QStringLiteral("Search"), argumentList);
|
||||
}
|
||||
|
||||
inline void SearchQueued(const QString &key)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(key);
|
||||
|
||||
CallQueued(QStringLiteral("Search"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetDisableScaling(const QString &id, bool value)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(value);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetDisableScaling"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetDisableScalingQueued(const QString &id, bool value)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(value);
|
||||
|
||||
CallQueued(QStringLiteral("SetDisableScaling"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetUseProxy(const QString &id, bool value)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(value);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetUseProxy"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetUseProxyQueued(const QString &id, bool value)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id) << QVariant::fromValue(value);
|
||||
|
||||
CallQueued(QStringLiteral("SetUseProxy"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void ItemChanged(const QString &status, LauncherItemInfo itemInfo, qlonglong categoryID);
|
||||
void NewAppLaunched(const QString &appID);
|
||||
void SearchDone(const QStringList &apps);
|
||||
void UninstallFailed(const QString &appId, const QString &errMsg);
|
||||
void UninstallSuccess(const QString &appID);
|
||||
// begin property changed signals
|
||||
void DisplayModeChanged(int value) const;
|
||||
void FullscreenChanged(bool value) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
void onPropertyChanged(const QString &propName, const QVariant &value);
|
||||
|
||||
private:
|
||||
__LauncherdPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
namespace dde {
|
||||
namespace daemon {
|
||||
typedef ::LauncherBackEnd LauncherBackEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
96
src/frameworkdbus/dbuslauncherfront.cpp
Normal file
96
src/frameworkdbus/dbuslauncherfront.cpp
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Launcher -p generated/com_deepin_dde_launcher ../xml/com.deepin.dde.Launcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuslauncherfront.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __Launcher
|
||||
*/
|
||||
|
||||
class __LauncherPrivate
|
||||
{
|
||||
public:
|
||||
__LauncherPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
bool Visible;
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
LauncherFront::LauncherFront(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __LauncherPrivate)
|
||||
{
|
||||
connect(this, &LauncherFront::propertyChanged, this, &LauncherFront::onPropertyChanged);
|
||||
|
||||
}
|
||||
|
||||
LauncherFront::~LauncherFront()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void LauncherFront::onPropertyChanged(const QString &propName, const QVariant &value)
|
||||
{
|
||||
if (propName == QStringLiteral("Visible"))
|
||||
{
|
||||
const bool &Visible = qvariant_cast<bool>(value);
|
||||
if (d_ptr->Visible != Visible)
|
||||
{
|
||||
d_ptr->Visible = Visible;
|
||||
Q_EMIT VisibleChanged(d_ptr->Visible);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "property not handle: " << propName;
|
||||
return;
|
||||
}
|
||||
|
||||
bool LauncherFront::visible()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("Visible", &d_ptr->Visible));
|
||||
}
|
||||
|
||||
void LauncherFront::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &LauncherFront::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherFront::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
169
src/frameworkdbus/dbuslauncherfront.h
Normal file
169
src/frameworkdbus/dbuslauncherfront.h
Normal file
@ -0,0 +1,169 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Launcher -p generated/com_deepin_dde_launcher ../xml/com.deepin.dde.Launcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_DDE_LAUNCHER_H
|
||||
#define COM_DEEPIN_DDE_LAUNCHER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.deepin.dde.Launcher1
|
||||
*/
|
||||
class __LauncherPrivate;
|
||||
class LauncherFront : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.deepin.dde.Launcher1"; }
|
||||
|
||||
public:
|
||||
explicit LauncherFront(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~LauncherFront();
|
||||
|
||||
Q_PROPERTY(bool Visible READ visible NOTIFY VisibleChanged)
|
||||
bool visible();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> Exit()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Exit"), argumentList);
|
||||
}
|
||||
|
||||
inline void ExitQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("Exit"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> Hide()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Hide"), argumentList);
|
||||
}
|
||||
|
||||
inline void HideQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("Hide"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsVisible()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsVisible"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> Show()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Show"), argumentList);
|
||||
}
|
||||
|
||||
inline void ShowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("Show"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ShowByMode(qlonglong in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowByMode"), argumentList);
|
||||
}
|
||||
|
||||
inline void ShowByModeQueued(qlonglong in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
|
||||
CallQueued(QStringLiteral("ShowByMode"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> Toggle()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Toggle"), argumentList);
|
||||
}
|
||||
|
||||
inline void ToggleQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("Toggle"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> UninstallApp(const QString &appKey)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(appKey);
|
||||
return asyncCallWithArgumentList(QStringLiteral("UninstallApp"), argumentList);
|
||||
}
|
||||
|
||||
inline void UninstallAppQueued(const QString &appKey)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(appKey);
|
||||
|
||||
CallQueued(QStringLiteral("UninstallApp"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void Closed();
|
||||
void Shown();
|
||||
void VisibleChanged(bool visible);
|
||||
// begin property changed signals
|
||||
//void VisibleChanged(bool value) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
void onPropertyChanged(const QString &propName, const QVariant &value);
|
||||
|
||||
private:
|
||||
__LauncherPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
namespace dde {
|
||||
typedef ::LauncherFront LauncherFront;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
73
src/frameworkdbus/dbusplasmawindow.cpp
Normal file
73
src/frameworkdbus/dbusplasmawindow.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Window -p generated/window ../xml/Window.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbusplasmawindow.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __Window
|
||||
*/
|
||||
|
||||
class __WindowPrivate
|
||||
{
|
||||
public:
|
||||
__WindowPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
PlasmaWindow::PlasmaWindow(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __WindowPrivate)
|
||||
{
|
||||
if (QMetaType::type("Rect") == QMetaType::UnknownType)
|
||||
registerRectMetaType();
|
||||
}
|
||||
|
||||
PlasmaWindow::~PlasmaWindow()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void PlasmaWindow::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &PlasmaWindow::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void PlasmaWindow::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
499
src/frameworkdbus/dbusplasmawindow.h
Normal file
499
src/frameworkdbus/dbusplasmawindow.h
Normal file
@ -0,0 +1,499 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c Window -p generated/window ../xml/Window.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#include "types/rect.h"
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.daemon.KWayland.PlasmaWindow
|
||||
*/
|
||||
class __WindowPrivate;
|
||||
class PlasmaWindow : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "com.deepin.daemon.KWayland.PlasmaWindow"; }
|
||||
|
||||
public:
|
||||
explicit PlasmaWindow(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~PlasmaWindow();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<QString> AppId()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("AppId"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<Rect> Geometry()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Geometry"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> Icon()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Icon"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<uint> InternalId()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("InternalId"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsActive()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsActive"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsCloseable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsCloseable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsDemandingAttention()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsDemandingAttention"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsFullscreen()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsFullscreen"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsFullscreenable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsFullscreenable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsKeepAbove()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsKeepAbove"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsMaximizeable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsMaximizeable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsMaximized()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsMaximized"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsMinimizeable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsMinimizeable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsMinimized()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsMinimized"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsMovable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsMovable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsOnAllDesktops()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsOnAllDesktops"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsResizable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsResizable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsShadeable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsShadeable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsShaded()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsShaded"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsValid()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsValid"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> IsVirtualDesktopChangeable()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("IsVirtualDesktopChangeable"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<uint> Pid()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Pid"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestActivate()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestActivate"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestActivateQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestActivate"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestClose()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestClose"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestCloseQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestClose"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestEnterNewVirtualDesktop()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestEnterNewVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestEnterNewVirtualDesktopQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestEnterNewVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestEnterVirtualDesktop(const QString &argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestEnterVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestEnterVirtualDesktopQueued(const QString &argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
|
||||
CallQueued(QStringLiteral("RequestEnterVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestLeaveVirtualDesktop(const QString &argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestLeaveVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestLeaveVirtualDesktopQueued(const QString &argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
|
||||
CallQueued(QStringLiteral("RequestLeaveVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestMove()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestMove"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestMoveQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestMove"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestResize()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestResize"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestResizeQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestResize"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestToggleKeepAbove()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestToggleKeepAbove"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestToggleKeepAboveQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestToggleKeepAbove"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestToggleKeepBelow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestToggleKeepBelow"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestToggleKeepBelowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestToggleKeepBelow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestToggleMaximized()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestToggleMaximized"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestToggleMaximizedQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestToggleMaximized"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestToggleMinimized()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestToggleMinimized"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestToggleMinimizedQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestToggleMinimized"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestToggleShaded()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestToggleShaded"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestToggleShadedQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestToggleShaded"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestVirtualDesktop(uint argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestVirtualDesktopQueued(uint argin0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(argin0);
|
||||
|
||||
CallQueued(QStringLiteral("RequestVirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> SkipSwitcher()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("SkipSwitcher"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> SkipTaskbar()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("SkipTaskbar"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> Title()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Title"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<uint> VirtualDesktop()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("VirtualDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<uint> WindowId()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("WindowId"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void ActiveChanged();
|
||||
void AppIdChanged();
|
||||
void CloseableChanged();
|
||||
void DemandsAttentionChanged();
|
||||
void FullscreenChanged();
|
||||
void FullscreenableChanged();
|
||||
void GeometryChanged();
|
||||
void IconChanged();
|
||||
void KeepAboveChanged();
|
||||
void KeepBelowChanged();
|
||||
void MaximizeableChanged();
|
||||
void MaximizedChanged();
|
||||
void MinimizeableChanged();
|
||||
void MinimizedChanged();
|
||||
void MovableChanged();
|
||||
void OnAllDesktopsChanged();
|
||||
void ParentWindowChanged();
|
||||
void ResizableChanged();
|
||||
void ShadeableChanged();
|
||||
void ShadedChanged();
|
||||
void SkipSwitcherChanged();
|
||||
void SkipTaskbarChanged();
|
||||
void TitleChanged();
|
||||
void Unmapped();
|
||||
void VirtualDesktopChangeableChanged();
|
||||
void VirtualDesktopChanged();
|
||||
void WindowIdChanged();
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__WindowPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
namespace daemon {
|
||||
namespace kwayland {
|
||||
typedef ::PlasmaWindow PlasmaWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
209
src/frameworkdbus/dbuswm.cpp
Normal file
209
src/frameworkdbus/dbuswm.cpp
Normal file
@ -0,0 +1,209 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c wm -p generated/com_deepin_wm ../xml/com.deepin.wm.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuswm.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __wm
|
||||
*/
|
||||
|
||||
class __wmPrivate
|
||||
{
|
||||
public:
|
||||
__wmPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
bool compositingAllowSwitch;
|
||||
bool compositingEnabled;
|
||||
bool compositingPossible;
|
||||
int cursorSize;
|
||||
QString cursorTheme;
|
||||
bool zoneEnabled;
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__wm::__wm(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __wmPrivate)
|
||||
{
|
||||
connect(this, &__wm::propertyChanged, this, &__wm::onPropertyChanged);
|
||||
|
||||
if (QMetaType::type("QList<uint>") == QMetaType::UnknownType) {
|
||||
qRegisterMetaType< QList<uint> >("QList<uint>");
|
||||
qDBusRegisterMetaType< QList<uint> >();
|
||||
}
|
||||
}
|
||||
|
||||
__wm::~__wm()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __wm::onPropertyChanged(const QString &propName, const QVariant &value)
|
||||
{
|
||||
if (propName == QStringLiteral("compositingAllowSwitch"))
|
||||
{
|
||||
const bool &compositingAllowSwitch = qvariant_cast<bool>(value);
|
||||
if (d_ptr->compositingAllowSwitch != compositingAllowSwitch)
|
||||
{
|
||||
d_ptr->compositingAllowSwitch = compositingAllowSwitch;
|
||||
Q_EMIT CompositingAllowSwitchChanged(d_ptr->compositingAllowSwitch);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("compositingEnabled"))
|
||||
{
|
||||
const bool &compositingEnabled = qvariant_cast<bool>(value);
|
||||
if (d_ptr->compositingEnabled != compositingEnabled)
|
||||
{
|
||||
d_ptr->compositingEnabled = compositingEnabled;
|
||||
Q_EMIT CompositingEnabledChanged(d_ptr->compositingEnabled);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("compositingPossible"))
|
||||
{
|
||||
const bool &compositingPossible = qvariant_cast<bool>(value);
|
||||
if (d_ptr->compositingPossible != compositingPossible)
|
||||
{
|
||||
d_ptr->compositingPossible = compositingPossible;
|
||||
Q_EMIT CompositingPossibleChanged(d_ptr->compositingPossible);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("cursorSize"))
|
||||
{
|
||||
const int &cursorSize = qvariant_cast<int>(value);
|
||||
if (d_ptr->cursorSize != cursorSize)
|
||||
{
|
||||
d_ptr->cursorSize = cursorSize;
|
||||
Q_EMIT CursorSizeChanged(d_ptr->cursorSize);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("cursorTheme"))
|
||||
{
|
||||
const QString &cursorTheme = qvariant_cast<QString>(value);
|
||||
if (d_ptr->cursorTheme != cursorTheme)
|
||||
{
|
||||
d_ptr->cursorTheme = cursorTheme;
|
||||
Q_EMIT CursorThemeChanged(d_ptr->cursorTheme);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (propName == QStringLiteral("zoneEnabled"))
|
||||
{
|
||||
const bool &zoneEnabled = qvariant_cast<bool>(value);
|
||||
if (d_ptr->zoneEnabled != zoneEnabled)
|
||||
{
|
||||
d_ptr->zoneEnabled = zoneEnabled;
|
||||
Q_EMIT ZoneEnabledChanged(d_ptr->zoneEnabled);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "property not handle: " << propName;
|
||||
return;
|
||||
}
|
||||
|
||||
bool __wm::compositingAllowSwitch()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("compositingAllowSwitch", &d_ptr->compositingAllowSwitch));
|
||||
}
|
||||
|
||||
bool __wm::compositingEnabled()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("compositingEnabled", &d_ptr->compositingEnabled));
|
||||
}
|
||||
|
||||
void __wm::setCompositingEnabled(bool value)
|
||||
{
|
||||
|
||||
internalPropSet("compositingEnabled", QVariant::fromValue(value), &d_ptr->compositingEnabled);
|
||||
}
|
||||
|
||||
bool __wm::compositingPossible()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("compositingPossible", &d_ptr->compositingPossible));
|
||||
}
|
||||
|
||||
int __wm::cursorSize()
|
||||
{
|
||||
return qvariant_cast<int>(internalPropGet("cursorSize", &d_ptr->cursorSize));
|
||||
}
|
||||
|
||||
void __wm::setCursorSize(int value)
|
||||
{
|
||||
|
||||
internalPropSet("cursorSize", QVariant::fromValue(value), &d_ptr->cursorSize);
|
||||
}
|
||||
|
||||
QString __wm::cursorTheme()
|
||||
{
|
||||
return qvariant_cast<QString>(internalPropGet("cursorTheme", &d_ptr->cursorTheme));
|
||||
}
|
||||
|
||||
void __wm::setCursorTheme(const QString &value)
|
||||
{
|
||||
|
||||
internalPropSet("cursorTheme", QVariant::fromValue(value), &d_ptr->cursorTheme);
|
||||
}
|
||||
|
||||
bool __wm::zoneEnabled()
|
||||
{
|
||||
return qvariant_cast<bool>(internalPropGet("zoneEnabled", &d_ptr->zoneEnabled));
|
||||
}
|
||||
|
||||
void __wm::setZoneEnabled(bool value)
|
||||
{
|
||||
|
||||
internalPropSet("zoneEnabled", QVariant::fromValue(value), &d_ptr->zoneEnabled);
|
||||
}
|
||||
|
||||
void __wm::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__wm::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __wm::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
708
src/frameworkdbus/dbuswm.h
Normal file
708
src/frameworkdbus/dbuswm.h
Normal file
@ -0,0 +1,708 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c wm -p generated/com_deepin_wm ../xml/com.deepin.wm.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_WM_H
|
||||
#define COM_DEEPIN_WM_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.wm
|
||||
*/
|
||||
class __wmPrivate;
|
||||
class __wm : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "com.deepin.wm"; }
|
||||
|
||||
public:
|
||||
explicit __wm(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__wm();
|
||||
|
||||
Q_PROPERTY(bool compositingAllowSwitch READ compositingAllowSwitch NOTIFY CompositingAllowSwitchChanged)
|
||||
bool compositingAllowSwitch();
|
||||
|
||||
Q_PROPERTY(bool compositingEnabled READ compositingEnabled WRITE setCompositingEnabled NOTIFY CompositingEnabledChanged)
|
||||
bool compositingEnabled();
|
||||
void setCompositingEnabled(bool value);
|
||||
|
||||
Q_PROPERTY(bool compositingPossible READ compositingPossible NOTIFY CompositingPossibleChanged)
|
||||
bool compositingPossible();
|
||||
|
||||
Q_PROPERTY(int cursorSize READ cursorSize WRITE setCursorSize NOTIFY CursorSizeChanged)
|
||||
int cursorSize();
|
||||
void setCursorSize(int value);
|
||||
|
||||
Q_PROPERTY(QString cursorTheme READ cursorTheme WRITE setCursorTheme NOTIFY CursorThemeChanged)
|
||||
QString cursorTheme();
|
||||
void setCursorTheme(const QString &value);
|
||||
|
||||
Q_PROPERTY(bool zoneEnabled READ zoneEnabled WRITE setZoneEnabled NOTIFY ZoneEnabledChanged)
|
||||
bool zoneEnabled();
|
||||
void setZoneEnabled(bool value);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> BeginToMoveActiveWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("BeginToMoveActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void BeginToMoveActiveWindowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("BeginToMoveActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> CancelPreviewWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CancelPreviewWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void CancelPreviewWindowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("CancelPreviewWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ChangeCurrentWorkspaceBackground(const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ChangeCurrentWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
inline void ChangeCurrentWorkspaceBackgroundQueued(const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri);
|
||||
|
||||
CallQueued(QStringLiteral("ChangeCurrentWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ClearMoveStatus()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ClearMoveStatus"), argumentList);
|
||||
}
|
||||
|
||||
inline void ClearMoveStatusQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("ClearMoveStatus"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> EnableZoneDetected(bool enabled)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(enabled);
|
||||
return asyncCallWithArgumentList(QStringLiteral("EnableZoneDetected"), argumentList);
|
||||
}
|
||||
|
||||
inline void EnableZoneDetectedQueued(bool enabled)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(enabled);
|
||||
|
||||
CallQueued(QStringLiteral("EnableZoneDetected"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> GetAccel(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAccel"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetAllAccels()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAllAccels"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> GetCurrentDesktopStatus()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetCurrentDesktopStatus"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<int> GetCurrentWorkspace()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetCurrentWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetCurrentWorkspaceBackground()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetCurrentWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetCurrentWorkspaceBackgroundForMonitor(const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(strMonitorName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetCurrentWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QStringList> GetDefaultAccel(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetDefaultAccel"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> GetIsShowDesktop()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetIsShowDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> GetMultiTaskingStatus()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetMultiTaskingStatus"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<double> GetTouchBorderInterval()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetTouchBorderInterval"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetWorkspaceBackground(int index)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> GetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index) << QVariant::fromValue(strMonitorName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> MinimizeActiveWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("MinimizeActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void MinimizeActiveWindowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("MinimizeActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> NextWorkspace()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("NextWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
inline void NextWorkspaceQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("NextWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> PerformAction(int type)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(type);
|
||||
return asyncCallWithArgumentList(QStringLiteral("PerformAction"), argumentList);
|
||||
}
|
||||
|
||||
inline void PerformActionQueued(int type)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(type);
|
||||
|
||||
CallQueued(QStringLiteral("PerformAction"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> PresentWindows(const QList<uint> &xids)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(xids);
|
||||
return asyncCallWithArgumentList(QStringLiteral("PresentWindows"), argumentList);
|
||||
}
|
||||
|
||||
inline void PresentWindowsQueued(const QList<uint> &xids)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(xids);
|
||||
|
||||
CallQueued(QStringLiteral("PresentWindows"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> PreviewWindow(uint xid)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(xid);
|
||||
return asyncCallWithArgumentList(QStringLiteral("PreviewWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void PreviewWindowQueued(uint xid)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(xid);
|
||||
|
||||
CallQueued(QStringLiteral("PreviewWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> PreviousWorkspace()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("PreviousWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
inline void PreviousWorkspaceQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("PreviousWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RemoveAccel(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RemoveAccel"), argumentList);
|
||||
}
|
||||
|
||||
inline void RemoveAccelQueued(const QString &id)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(id);
|
||||
|
||||
CallQueued(QStringLiteral("RemoveAccel"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<bool> SetAccel(const QString &data)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(data);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetAccel"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetCurrentWorkspace(int index)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCurrentWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetCurrentWorkspaceQueued(int index)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
|
||||
CallQueued(QStringLiteral("SetCurrentWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetCurrentWorkspaceBackground(const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCurrentWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetCurrentWorkspaceBackgroundQueued(const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri);
|
||||
|
||||
CallQueued(QStringLiteral("SetCurrentWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetCurrentWorkspaceBackgroundForMonitor(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri) << QVariant::fromValue(strMonitorName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCurrentWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetCurrentWorkspaceBackgroundForMonitorQueued(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri) << QVariant::fromValue(strMonitorName);
|
||||
|
||||
CallQueued(QStringLiteral("SetCurrentWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetDecorationDeepinTheme(const QString &deepinThemeName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(deepinThemeName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetDecorationDeepinTheme"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetDecorationDeepinThemeQueued(const QString &deepinThemeName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(deepinThemeName);
|
||||
|
||||
CallQueued(QStringLiteral("SetDecorationDeepinTheme"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetDecorationTheme(const QString &themeType, const QString &themeName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(themeType) << QVariant::fromValue(themeName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetDecorationTheme"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetDecorationThemeQueued(const QString &themeType, const QString &themeName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(themeType) << QVariant::fromValue(themeName);
|
||||
|
||||
CallQueued(QStringLiteral("SetDecorationTheme"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetMultiTaskingStatus(bool isActive)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(isActive);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetMultiTaskingStatus"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetMultiTaskingStatusQueued(bool isActive)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(isActive);
|
||||
|
||||
CallQueued(QStringLiteral("SetMultiTaskingStatus"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetShowDesktop(bool isShowDesktop)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(isShowDesktop);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetShowDesktop"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetShowDesktopQueued(bool isShowDesktop)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(isShowDesktop);
|
||||
|
||||
CallQueued(QStringLiteral("SetShowDesktop"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetTouchBorderInterval(double interval)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(interval);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetTouchBorderInterval"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetTouchBorderIntervalQueued(double interval)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(interval);
|
||||
|
||||
CallQueued(QStringLiteral("SetTouchBorderInterval"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetTransientBackground(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetTransientBackground"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetTransientBackgroundQueued(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
|
||||
CallQueued(QStringLiteral("SetTransientBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetTransientBackgroundForMonitor(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri) << QVariant::fromValue(strMonitorName);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetTransientBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetTransientBackgroundForMonitorQueued(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(uri) << QVariant::fromValue(strMonitorName);
|
||||
|
||||
CallQueued(QStringLiteral("SetTransientBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetWorkspaceBackground(int index, const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index) << QVariant::fromValue(uri);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetWorkspaceBackgroundQueued(int index, const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index) << QVariant::fromValue(uri);
|
||||
|
||||
CallQueued(QStringLiteral("SetWorkspaceBackground"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName, const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index) << QVariant::fromValue(strMonitorName) << QVariant::fromValue(uri);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
inline void SetWorkspaceBackgroundForMonitorQueued(int index, const QString &strMonitorName, const QString &uri)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index) << QVariant::fromValue(strMonitorName) << QVariant::fromValue(uri);
|
||||
|
||||
CallQueued(QStringLiteral("SetWorkspaceBackgroundForMonitor"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ShowAllWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowAllWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void ShowAllWindowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("ShowAllWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ShowWindow()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void ShowWindowQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("ShowWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ShowWorkspace()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
inline void ShowWorkspaceQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("ShowWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SwitchApplication(bool backward)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(backward);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SwitchApplication"), argumentList);
|
||||
}
|
||||
|
||||
inline void SwitchApplicationQueued(bool backward)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(backward);
|
||||
|
||||
CallQueued(QStringLiteral("SwitchApplication"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> SwitchToWorkspace(bool backward)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(backward);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SwitchToWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
inline void SwitchToWorkspaceQueued(bool backward)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(backward);
|
||||
|
||||
CallQueued(QStringLiteral("SwitchToWorkspace"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> TileActiveWindow(uint side)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(side);
|
||||
return asyncCallWithArgumentList(QStringLiteral("TileActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
inline void TileActiveWindowQueued(uint side)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(side);
|
||||
|
||||
CallQueued(QStringLiteral("TileActiveWindow"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> ToggleActiveWindowMaximize()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ToggleActiveWindowMaximize"), argumentList);
|
||||
}
|
||||
|
||||
inline void ToggleActiveWindowMaximizeQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("ToggleActiveWindowMaximize"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> TouchToMove(int x, int y)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(x) << QVariant::fromValue(y);
|
||||
return asyncCallWithArgumentList(QStringLiteral("TouchToMove"), argumentList);
|
||||
}
|
||||
|
||||
inline void TouchToMoveQueued(int x, int y)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(x) << QVariant::fromValue(y);
|
||||
|
||||
CallQueued(QStringLiteral("TouchToMove"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<int> WorkspaceCount()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("WorkspaceCount"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void WorkspaceBackgroundChanged(int index, const QString &newUri);
|
||||
void WorkspaceBackgroundChangedForMonitor(int index, const QString &strMonitorName, const QString &uri);
|
||||
void WorkspaceSwitched(int from, int to);
|
||||
void compositingEnabledChanged(bool enabled);
|
||||
void wmCompositingEnabledChanged(bool enabled);
|
||||
void workspaceCountChanged(int count);
|
||||
// begin property changed signals
|
||||
void CompositingAllowSwitchChanged(bool value) const;
|
||||
void CompositingEnabledChanged(bool value) const;
|
||||
void CompositingPossibleChanged(bool value) const;
|
||||
void CursorSizeChanged(int value) const;
|
||||
void CursorThemeChanged(const QString & value) const;
|
||||
void ZoneEnabledChanged(bool value) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
void onPropertyChanged(const QString &propName, const QVariant &value);
|
||||
|
||||
private:
|
||||
__wmPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
typedef ::__wm WM;
|
||||
}
|
||||
}
|
||||
#endif
|
71
src/frameworkdbus/dbuswmswitcher.cpp
Normal file
71
src/frameworkdbus/dbuswmswitcher.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c WMSwitcher -p generated/com_deepin_wmswitcher ../xml/com.deepin.WMSwitcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "dbuswmswitcher.h"
|
||||
|
||||
/*
|
||||
* Implementation of interface class __WMSwitcher
|
||||
*/
|
||||
|
||||
class __WMSwitcherPrivate
|
||||
{
|
||||
public:
|
||||
__WMSwitcherPrivate() = default;
|
||||
|
||||
// begin member variables
|
||||
|
||||
public:
|
||||
QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
|
||||
QMap<QString, QList<QVariant>> m_waittingCalls;
|
||||
};
|
||||
|
||||
__WMSwitcher::__WMSwitcher(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
, d_ptr(new __WMSwitcherPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
__WMSwitcher::~__WMSwitcher()
|
||||
{
|
||||
qDeleteAll(d_ptr->m_processingCalls.values());
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
void __WMSwitcher::CallQueued(const QString &callName, const QList<QVariant> &args)
|
||||
{
|
||||
if (d_ptr->m_waittingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls[callName] = args;
|
||||
return;
|
||||
}
|
||||
if (d_ptr->m_processingCalls.contains(callName))
|
||||
{
|
||||
d_ptr->m_waittingCalls.insert(callName, args);
|
||||
} else {
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &__WMSwitcher::onPendingCallFinished);
|
||||
d_ptr->m_processingCalls.insert(callName, watcher);
|
||||
}
|
||||
}
|
||||
|
||||
void __WMSwitcher::onPendingCallFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
w->deleteLater();
|
||||
const auto callName = d_ptr->m_processingCalls.key(w);
|
||||
Q_ASSERT(!callName.isEmpty());
|
||||
if (callName.isEmpty())
|
||||
return;
|
||||
d_ptr->m_processingCalls.remove(callName);
|
||||
if (!d_ptr->m_waittingCalls.contains(callName))
|
||||
return;
|
||||
const auto args = d_ptr->m_waittingCalls.take(callName);
|
||||
CallQueued(callName, args);
|
||||
}
|
122
src/frameworkdbus/dbuswmswitcher.h
Normal file
122
src/frameworkdbus/dbuswmswitcher.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp-fix version 0.8
|
||||
* Command line was: qdbusxml2cpp-fix -c WMSwitcher -p generated/com_deepin_wmswitcher ../xml/com.deepin.WMSwitcher.xml
|
||||
*
|
||||
* qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_WMSWITCHER_H
|
||||
#define COM_DEEPIN_WMSWITCHER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
|
||||
/*
|
||||
* Proxy class for interface com.deepin.WMSwitcher
|
||||
*/
|
||||
class __WMSwitcherPrivate;
|
||||
class __WMSwitcher : public DBusExtendedAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "com.deepin.WMSwitcher"; }
|
||||
|
||||
public:
|
||||
explicit __WMSwitcher(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||
|
||||
~__WMSwitcher();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<bool> AllowSwitch()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("AllowSwitch"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<QString> CurrentWM()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CurrentWM"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RequestSwitchWM()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RequestSwitchWM"), argumentList);
|
||||
}
|
||||
|
||||
inline void RequestSwitchWMQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RequestSwitchWM"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> RestartWM()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RestartWM"), argumentList);
|
||||
}
|
||||
|
||||
inline void RestartWMQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("RestartWM"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
inline QDBusPendingReply<> Start2DWM()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Start2DWM"), argumentList);
|
||||
}
|
||||
|
||||
inline void Start2DWMQueued()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
||||
CallQueued(QStringLiteral("Start2DWM"), argumentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void WMChanged(const QString &in0);
|
||||
// begin property changed signals
|
||||
|
||||
public Q_SLOTS:
|
||||
void CallQueued(const QString &callName, const QList<QVariant> &args);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPendingCallFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
__WMSwitcherPrivate *d_ptr;
|
||||
};
|
||||
|
||||
namespace com {
|
||||
namespace deepin {
|
||||
typedef ::__WMSwitcher WMSwitcher;
|
||||
}
|
||||
}
|
||||
#endif
|
1
src/frameworkdbus/qtdbusextended/DBusExtended
Normal file
1
src/frameworkdbus/qtdbusextended/DBusExtended
Normal file
@ -0,0 +1 @@
|
||||
#include "dbusextended.h"
|
@ -0,0 +1 @@
|
||||
#include "dbusextendedabstractinterface.h"
|
35
src/frameworkdbus/qtdbusextended/dbusextended.h
Normal file
35
src/frameworkdbus/qtdbusextended/dbusextended.h
Normal file
@ -0,0 +1,35 @@
|
||||
// -*- c++ -*-
|
||||
|
||||
/*!
|
||||
*
|
||||
* Copyright (C) 2015 Jolla Ltd.
|
||||
*
|
||||
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QT_DBUS_EXTENDED_H
|
||||
#define QT_DBUS_EXTENDED_H
|
||||
|
||||
#if defined(QT_DBUS_EXTENDED_LIBRARY)
|
||||
# define QT_DBUS_EXTENDED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QT_DBUS_EXTENDED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif /* QT_DBUS_EXTENDED_H */
|
@ -0,0 +1,525 @@
|
||||
// -*- c++ -*-
|
||||
|
||||
/*!
|
||||
*
|
||||
* Copyright (C) 2015 Jolla Ltd.
|
||||
*
|
||||
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "dbusextendedpendingcallwatcher_p.h"
|
||||
|
||||
#include <DBusExtendedAbstractInterface>
|
||||
|
||||
#include <QtDBus/QDBusMetaType>
|
||||
#include <QtDBus/QDBusMessage>
|
||||
#include <QtDBus/QDBusPendingCall>
|
||||
#include <QtDBus/QDBusPendingCallWatcher>
|
||||
#include <QtDBus/QDBusPendingReply>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QMetaProperty>
|
||||
|
||||
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusInterface, ("org.freedesktop.DBus"))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusPropertiesInterface, ("org.freedesktop.DBus.Properties"))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, dBusPropertiesChangedSignal, ("PropertiesChanged"))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, propertyChangedSignature, ("propertyChanged(QString,QVariant)"))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, propertyInvalidatedSignature, ("propertyInvalidated(QString)"))
|
||||
|
||||
|
||||
DBusExtendedAbstractInterface::DBusExtendedAbstractInterface(const QString &service, const QString &path, const char *interface, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, interface, connection, parent)
|
||||
, m_sync(true)
|
||||
, m_useCache(false)
|
||||
, m_getAllPendingCallWatcher(0)
|
||||
, m_propertiesChangedConnected(false)
|
||||
{
|
||||
const_cast<QDBusConnection&>(connection).connect(QString("org.freedesktop.DBus"), QString("/org/freedesktop/DBus"), QString("org.freedesktop.DBus"), QString("NameOwnerChanged"), this, SLOT(onDBusNameOwnerChanged(QString,QString,QString)));
|
||||
}
|
||||
|
||||
DBusExtendedAbstractInterface::~DBusExtendedAbstractInterface()
|
||||
{
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::setSync(bool sync) { setSync(sync, true); }
|
||||
|
||||
/*
|
||||
* Note: After sync is set to false, it will always return a empty value
|
||||
* if you call the property's get function directly. So you can only get it
|
||||
* through the changed signal when you get an property, and it's also a good idea
|
||||
* to save a cache yourself.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 注意: 如果设置 sync 为 false 那么在调用属性的 get 函数获取一个属性时会一直返回空值,
|
||||
* 解决方法是监听属性的 changed 信号并自行保存一份缓存, 让 changed 信号修改这个缓存
|
||||
*/
|
||||
void DBusExtendedAbstractInterface::setSync(bool sync, bool autoStart)
|
||||
{
|
||||
m_sync = sync;
|
||||
|
||||
// init all properties
|
||||
if (autoStart && !m_sync && !isValid())
|
||||
startServiceProcess();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::getAllProperties()
|
||||
{
|
||||
m_lastExtendedError = QDBusError();
|
||||
|
||||
if (!isValid()) {
|
||||
QString errorMessage = QStringLiteral("This Extended DBus interface is not valid yet.");
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_sync && m_getAllPendingCallWatcher) {
|
||||
// Call already in place, not repeating ...
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("GetAll"));
|
||||
msg << interface();
|
||||
|
||||
if (m_sync) {
|
||||
QDBusMessage reply = connection().call(msg);
|
||||
|
||||
if (reply.type() != QDBusMessage::ReplyMessage) {
|
||||
m_lastExtendedError = QDBusError(reply);
|
||||
qWarning() << Q_FUNC_INFO << m_lastExtendedError.message();
|
||||
return;
|
||||
}
|
||||
|
||||
if (reply.signature() != QLatin1String("a{sv}")) {
|
||||
QString errorMessage = QStringLiteral("Invalid signature \"%1\" in return from call to %2")
|
||||
.arg(reply.signature(),
|
||||
QString(*dBusPropertiesInterface()));
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
m_lastExtendedError = QDBusError(QDBusError::InvalidSignature, errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
QVariantMap value = reply.arguments().at(0).toMap();
|
||||
onPropertiesChanged(interface(), value, QStringList());
|
||||
} else {
|
||||
QDBusPendingReply<QVariantMap> async = connection().asyncCall(msg);
|
||||
m_getAllPendingCallWatcher = new QDBusPendingCallWatcher(async, this);
|
||||
|
||||
connect(m_getAllPendingCallWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher*)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::connectNotify(const QMetaMethod &signal)
|
||||
{
|
||||
if (signal.methodType() == QMetaMethod::Signal
|
||||
&& (signal.methodSignature() == *propertyChangedSignature()
|
||||
|| signal.methodSignature() == *propertyInvalidatedSignature())) {
|
||||
if (!m_propertiesChangedConnected) {
|
||||
QStringList argumentMatch;
|
||||
argumentMatch << interface();
|
||||
connection().connect(service(), path(), *dBusPropertiesInterface(), *dBusPropertiesChangedSignal(),
|
||||
argumentMatch, QString(),
|
||||
this, SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
|
||||
|
||||
m_propertiesChangedConnected = true;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
QDBusAbstractInterface::connectNotify(signal);
|
||||
}
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::disconnectNotify(const QMetaMethod &signal)
|
||||
{
|
||||
if (signal.methodType() == QMetaMethod::Signal
|
||||
&& (signal.methodSignature() == *propertyChangedSignature()
|
||||
|| signal.methodSignature() == *propertyInvalidatedSignature())) {
|
||||
if (m_propertiesChangedConnected
|
||||
&& 0 == receivers(propertyChangedSignature()->constData())
|
||||
&& 0 == receivers(propertyInvalidatedSignature()->constData())) {
|
||||
QStringList argumentMatch;
|
||||
argumentMatch << interface();
|
||||
connection().disconnect(service(), path(), *dBusPropertiesInterface(), *dBusPropertiesChangedSignal(),
|
||||
argumentMatch, QString(),
|
||||
this, SLOT(onPropertiesChanged(QString, QVariantMap, QStringList)));
|
||||
|
||||
m_propertiesChangedConnected = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
QDBusAbstractInterface::disconnectNotify(signal);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant DBusExtendedAbstractInterface::internalPropGet(const char *propname, void *propertyPtr)
|
||||
{
|
||||
m_lastExtendedError = QDBusError();
|
||||
|
||||
if (m_useCache) {
|
||||
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||
return QVariant(metaProperty.userType(), propertyPtr);
|
||||
}
|
||||
|
||||
if (m_sync) {
|
||||
QVariant ret = property(propname);
|
||||
|
||||
QMetaType::construct(ret.userType(), propertyPtr, ret.constData());
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
if (!isValid()) {
|
||||
QString errorMessage = QStringLiteral("This Extended DBus interface is not valid yet.");
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||
|
||||
if (-1 == propertyIndex) {
|
||||
QString errorMessage = QStringLiteral("Got unknown property \"%1\" to read")
|
||||
.arg(QString::fromLatin1(propname));
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||
|
||||
if (!metaProperty.isReadable()) {
|
||||
QString errorMessage = QStringLiteral("Property \"%1\" is NOT readable")
|
||||
.arg(QString::fromLatin1(propname));
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// is this metatype registered?
|
||||
const char *expectedSignature = "";
|
||||
if (int(metaProperty.type()) != QMetaType::QVariant) {
|
||||
expectedSignature = QDBusMetaType::typeToSignature(metaProperty.userType());
|
||||
if (0 == expectedSignature) {
|
||||
QString errorMessage =
|
||||
QStringLiteral("Type %1 must be registered with Qt D-Bus "
|
||||
"before it can be used to read property "
|
||||
"%2.%3")
|
||||
.arg(metaProperty.typeName(),
|
||||
interface(),
|
||||
propname);
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
asyncProperty(propname);
|
||||
return QVariant(metaProperty.userType(), propertyPtr);
|
||||
}
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::internalPropSet(const char *propname, const QVariant &value, void *propertyPtr)
|
||||
{
|
||||
m_lastExtendedError = QDBusError();
|
||||
|
||||
if (m_sync) {
|
||||
setProperty(propname, value);
|
||||
} else {
|
||||
if (!isValid()) {
|
||||
QString errorMessage = QStringLiteral("This interface is not yet valid");
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||
return;
|
||||
}
|
||||
|
||||
int propertyIndex = metaObject()->indexOfProperty(propname);
|
||||
|
||||
if (-1 == propertyIndex) {
|
||||
QString errorMessage = QStringLiteral("Got unknown property \"%1\" to write")
|
||||
.arg(QString::fromLatin1(propname));
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaProperty metaProperty = metaObject()->property(propertyIndex);
|
||||
|
||||
if (!metaProperty.isWritable()) {
|
||||
QString errorMessage = QStringLiteral("Property \"%1\" is NOT writable")
|
||||
.arg(QString::fromLatin1(propname));
|
||||
m_lastExtendedError = QDBusMessage::createError(QDBusError::Failed, errorMessage);
|
||||
qWarning() << Q_FUNC_INFO << errorMessage;
|
||||
return;
|
||||
}
|
||||
|
||||
QVariant variant = QVariant(metaProperty.type(), propertyPtr);
|
||||
variant = value;
|
||||
|
||||
asyncSetProperty(propname, variant);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant DBusExtendedAbstractInterface::asyncProperty(const QString &propertyName)
|
||||
{
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("Get"));
|
||||
msg << interface() << propertyName;
|
||||
QDBusPendingReply<QVariant> async = connection().asyncCall(msg);
|
||||
DBusExtendedPendingCallWatcher *watcher = new DBusExtendedPendingCallWatcher(async, propertyName, QVariant(), this);
|
||||
|
||||
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncPropertyFinished(QDBusPendingCallWatcher*)));
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::asyncSetProperty(const QString &propertyName, const QVariant &value)
|
||||
{
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), *dBusPropertiesInterface(), QStringLiteral("Set"));
|
||||
|
||||
msg << interface() << propertyName << QVariant::fromValue(QDBusVariant(value));
|
||||
QDBusPendingReply<> async = connection().asyncCall(msg);
|
||||
DBusExtendedPendingCallWatcher *watcher = new DBusExtendedPendingCallWatcher(async, propertyName, value, this);
|
||||
|
||||
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(onAsyncSetPropertyFinished(QDBusPendingCallWatcher*)));
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::startServiceProcess()
|
||||
{
|
||||
const QString &servName = service();
|
||||
|
||||
if (isValid())
|
||||
{
|
||||
qWarning() << "Service" << servName << "is already started.";
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/", *dBusInterface(), QStringLiteral("StartServiceByName"));
|
||||
msg << servName << quint32(0);
|
||||
QDBusPendingReply<quint32> async = connection().asyncCall(msg);
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
|
||||
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, &DBusExtendedAbstractInterface::onStartServiceProcessFinished);
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onStartServiceProcessFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
if (w->isError())
|
||||
{
|
||||
m_lastExtendedError = w->error();
|
||||
} else {
|
||||
m_lastExtendedError = QDBusError();
|
||||
}
|
||||
|
||||
QDBusPendingReply<quint32> reply = *w;
|
||||
|
||||
Q_EMIT serviceStartFinished(reply.value());
|
||||
|
||||
w->deleteLater();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onAsyncPropertyFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
DBusExtendedPendingCallWatcher *watcher = qobject_cast<DBusExtendedPendingCallWatcher *>(w);
|
||||
Q_ASSERT(watcher);
|
||||
|
||||
QDBusPendingReply<QVariant> reply = *watcher;
|
||||
|
||||
if (reply.isError()) {
|
||||
m_lastExtendedError = reply.error();
|
||||
} else {
|
||||
int propertyIndex = metaObject()->indexOfProperty(watcher->asyncProperty().toLatin1().constData());
|
||||
QVariant value = demarshall(interface(),
|
||||
metaObject()->property(propertyIndex),
|
||||
reply.value(),
|
||||
&m_lastExtendedError);
|
||||
|
||||
if (m_lastExtendedError.isValid()) {
|
||||
Q_EMIT propertyInvalidated(watcher->asyncProperty());
|
||||
} else {
|
||||
Q_EMIT propertyChanged(watcher->asyncProperty(), value);
|
||||
}
|
||||
}
|
||||
|
||||
Q_EMIT asyncPropertyFinished(watcher->asyncProperty());
|
||||
watcher->deleteLater();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onAsyncSetPropertyFinished(QDBusPendingCallWatcher *w)
|
||||
{
|
||||
DBusExtendedPendingCallWatcher *watcher = qobject_cast<DBusExtendedPendingCallWatcher *>(w);
|
||||
Q_ASSERT(watcher);
|
||||
|
||||
QDBusPendingReply<> reply = *watcher;
|
||||
|
||||
if (reply.isError()) {
|
||||
m_lastExtendedError = reply.error();
|
||||
} else {
|
||||
m_lastExtendedError = QDBusError();
|
||||
}
|
||||
|
||||
Q_EMIT asyncSetPropertyFinished(watcher->asyncProperty());
|
||||
|
||||
// Resetting the property to its previous value after sending the
|
||||
// finished signal
|
||||
if (reply.isError()) {
|
||||
m_lastExtendedError = QDBusError();
|
||||
Q_EMIT propertyChanged(watcher->asyncProperty(), watcher->previousValue());
|
||||
}
|
||||
|
||||
watcher->deleteLater();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher *watcher)
|
||||
{
|
||||
m_getAllPendingCallWatcher = 0;
|
||||
|
||||
QDBusPendingReply<QVariantMap> reply = *watcher;
|
||||
|
||||
if (reply.isError()) {
|
||||
m_lastExtendedError = reply.error();
|
||||
} else {
|
||||
m_lastExtendedError = QDBusError();
|
||||
}
|
||||
|
||||
Q_EMIT asyncGetAllPropertiesFinished();
|
||||
|
||||
if (!reply.isError()) {
|
||||
onPropertiesChanged(interface(), reply.value(), QStringList());
|
||||
}
|
||||
|
||||
watcher->deleteLater();
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onPropertiesChanged(const QString& interfaceName,
|
||||
const QVariantMap& changedProperties,
|
||||
const QStringList& invalidatedProperties)
|
||||
{
|
||||
if (interfaceName == interface()) {
|
||||
QVariantMap::const_iterator i = changedProperties.constBegin();
|
||||
while (i != changedProperties.constEnd()) {
|
||||
int propertyIndex = metaObject()->indexOfProperty(i.key().toLatin1().constData());
|
||||
|
||||
if (-1 == propertyIndex) {
|
||||
qDebug() << Q_FUNC_INFO << "Got unknown changed property" << i.key();
|
||||
} else {
|
||||
QVariant value = demarshall(interface(), metaObject()->property(propertyIndex), i.value(), &m_lastExtendedError);
|
||||
|
||||
if (m_lastExtendedError.isValid()) {
|
||||
Q_EMIT propertyInvalidated(i.key());
|
||||
} else {
|
||||
Q_EMIT propertyChanged(i.key(), value);
|
||||
}
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
QStringList::const_iterator j = invalidatedProperties.constBegin();
|
||||
while (j != invalidatedProperties.constEnd()) {
|
||||
if (-1 == metaObject()->indexOfProperty(j->toLatin1().constData())) {
|
||||
qDebug() << Q_FUNC_INFO << "Got unknown invalidated property" << *j;
|
||||
} else {
|
||||
m_lastExtendedError = QDBusError();
|
||||
Q_EMIT propertyInvalidated(*j);
|
||||
}
|
||||
|
||||
++j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DBusExtendedAbstractInterface::onDBusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
|
||||
{
|
||||
if (name == service() && oldOwner.isEmpty())
|
||||
{
|
||||
m_dbusOwner = newOwner;
|
||||
Q_EMIT serviceValidChanged(true);
|
||||
}
|
||||
else if (name == m_dbusOwner && newOwner.isEmpty())
|
||||
{
|
||||
m_dbusOwner.clear();
|
||||
Q_EMIT serviceValidChanged(false);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant DBusExtendedAbstractInterface::demarshall(const QString &interface, const QMetaProperty &metaProperty, const QVariant &value, QDBusError *error)
|
||||
{
|
||||
Q_ASSERT(metaProperty.isValid());
|
||||
Q_ASSERT(error != 0);
|
||||
|
||||
if (value.userType() == metaProperty.userType()) {
|
||||
// No need demarshalling. Passing back straight away ...
|
||||
*error = QDBusError();
|
||||
return value;
|
||||
}
|
||||
|
||||
QVariant result = QVariant(metaProperty.userType(), (void*)0);
|
||||
QString errorMessage;
|
||||
const char *expectedSignature = QDBusMetaType::typeToSignature(metaProperty.userType());
|
||||
|
||||
if (value.userType() == qMetaTypeId<QDBusArgument>()) {
|
||||
// demarshalling a DBus argument ...
|
||||
QDBusArgument dbusArg = value.value<QDBusArgument>();
|
||||
|
||||
if (expectedSignature == dbusArg.currentSignature().toLatin1()) {
|
||||
QDBusMetaType::demarshall(dbusArg, metaProperty.userType(), result.data());
|
||||
if (!result.isValid()) {
|
||||
errorMessage = QStringLiteral("Unexpected failure demarshalling "
|
||||
"upon PropertiesChanged signal arrival "
|
||||
"for property `%3.%4' (expected type `%5' (%6))")
|
||||
.arg(interface,
|
||||
QString::fromLatin1(metaProperty.name()),
|
||||
QString::fromLatin1(metaProperty.typeName()),
|
||||
expectedSignature);
|
||||
}
|
||||
} else {
|
||||
errorMessage = QStringLiteral("Unexpected `user type' (%2) "
|
||||
"upon PropertiesChanged signal arrival "
|
||||
"for property `%3.%4' (expected type `%5' (%6))")
|
||||
.arg(dbusArg.currentSignature(),
|
||||
interface,
|
||||
QString::fromLatin1(metaProperty.name()),
|
||||
QString::fromLatin1(metaProperty.typeName()),
|
||||
QString::fromLatin1(expectedSignature));
|
||||
}
|
||||
} else {
|
||||
const char *actualSignature = QDBusMetaType::typeToSignature(value.userType());
|
||||
|
||||
errorMessage = QStringLiteral("Unexpected `%1' (%2) "
|
||||
"upon PropertiesChanged signal arrival "
|
||||
"for property `%3.%4' (expected type `%5' (%6))")
|
||||
.arg(QString::fromLatin1(value.typeName()),
|
||||
QString::fromLatin1(actualSignature),
|
||||
interface,
|
||||
QString::fromLatin1(metaProperty.name()),
|
||||
QString::fromLatin1(metaProperty.typeName()),
|
||||
QString::fromLatin1(expectedSignature));
|
||||
}
|
||||
|
||||
if (errorMessage.isEmpty()) {
|
||||
*error = QDBusError();
|
||||
} else {
|
||||
*error = QDBusMessage::createError(QDBusError::InvalidSignature, errorMessage);
|
||||
qDebug() << Q_FUNC_INFO << errorMessage;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
103
src/frameworkdbus/qtdbusextended/dbusextendedabstractinterface.h
Normal file
103
src/frameworkdbus/qtdbusextended/dbusextendedabstractinterface.h
Normal file
@ -0,0 +1,103 @@
|
||||
// -*- c++ -*-
|
||||
|
||||
/*!
|
||||
*
|
||||
* Copyright (C) 2015 Jolla Ltd.
|
||||
*
|
||||
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DBUSEXTENDEDABSTRACTINTERFACE_H
|
||||
#define DBUSEXTENDEDABSTRACTINTERFACE_H
|
||||
|
||||
#include <DBusExtended>
|
||||
|
||||
#include <QDBusAbstractInterface>
|
||||
#include <QDBusError>
|
||||
|
||||
class QDBusPendingCallWatcher;
|
||||
class DBusExtendedPendingCallWatcher;
|
||||
|
||||
class QT_DBUS_EXTENDED_EXPORT DBusExtendedAbstractInterface: public QDBusAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~DBusExtendedAbstractInterface();
|
||||
|
||||
Q_PROPERTY(bool sync READ sync WRITE setSync)
|
||||
inline bool sync() const { return m_sync; }
|
||||
void setSync(bool sync);
|
||||
void setSync(bool sync, bool autoStart);
|
||||
|
||||
Q_PROPERTY(bool useCache READ useCache WRITE setUseCache)
|
||||
inline bool useCache() const { return m_useCache; }
|
||||
inline void setUseCache(bool useCache) { m_useCache = useCache; }
|
||||
|
||||
void getAllProperties();
|
||||
inline QDBusError lastExtendedError() const { return m_lastExtendedError; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void startServiceProcess();
|
||||
|
||||
protected:
|
||||
DBusExtendedAbstractInterface(const QString &service,
|
||||
const QString &path,
|
||||
const char *interface,
|
||||
const QDBusConnection &connection,
|
||||
QObject *parent);
|
||||
|
||||
void connectNotify(const QMetaMethod &signal);
|
||||
void disconnectNotify(const QMetaMethod &signal);
|
||||
QVariant internalPropGet(const char *propname, void *propertyPtr);
|
||||
void internalPropSet(const char *propname, const QVariant &value, void *propertyPtr);
|
||||
|
||||
Q_SIGNALS:
|
||||
void serviceValidChanged(const bool valid) const;
|
||||
void serviceStartFinished(const quint32 ret) const;
|
||||
void propertyChanged(const QString &propertyName, const QVariant &value);
|
||||
void propertyInvalidated(const QString &propertyName);
|
||||
void asyncPropertyFinished(const QString &propertyName);
|
||||
void asyncSetPropertyFinished(const QString &propertyName);
|
||||
void asyncGetAllPropertiesFinished();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPropertiesChanged(const QString& interfaceName,
|
||||
const QVariantMap& changedProperties,
|
||||
const QStringList& invalidatedProperties);
|
||||
void onDBusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||
void onAsyncPropertyFinished(QDBusPendingCallWatcher *w);
|
||||
void onAsyncSetPropertyFinished(QDBusPendingCallWatcher *w);
|
||||
void onAsyncGetAllPropertiesFinished(QDBusPendingCallWatcher *watcher);
|
||||
void onStartServiceProcessFinished(QDBusPendingCallWatcher *w);
|
||||
|
||||
private:
|
||||
QVariant asyncProperty(const QString &propertyName);
|
||||
void asyncSetProperty(const QString &propertyName, const QVariant &value);
|
||||
static QVariant demarshall(const QString &interface, const QMetaProperty &metaProperty, const QVariant &value, QDBusError *error);
|
||||
|
||||
bool m_sync;
|
||||
bool m_useCache;
|
||||
QDBusPendingCallWatcher *m_getAllPendingCallWatcher;
|
||||
QDBusError m_lastExtendedError;
|
||||
QString m_dbusOwner;
|
||||
bool m_propertiesChangedConnected;
|
||||
};
|
||||
|
||||
#endif /* DBUSEXTENDEDABSTRACTINTERFACE_H */
|
@ -0,0 +1,38 @@
|
||||
// -*- c++ -*-
|
||||
|
||||
/*!
|
||||
*
|
||||
* Copyright (C) 2015 Jolla Ltd.
|
||||
*
|
||||
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "dbusextendedpendingcallwatcher_p.h"
|
||||
|
||||
|
||||
DBusExtendedPendingCallWatcher::DBusExtendedPendingCallWatcher(const QDBusPendingCall &call, const QString &asyncProperty, const QVariant &previousValue, QObject *parent)
|
||||
: QDBusPendingCallWatcher(call, parent)
|
||||
, m_asyncProperty(asyncProperty)
|
||||
, m_previousValue(previousValue)
|
||||
{
|
||||
}
|
||||
|
||||
DBusExtendedPendingCallWatcher::~DBusExtendedPendingCallWatcher()
|
||||
{
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
// -*- c++ -*-
|
||||
|
||||
/*!
|
||||
*
|
||||
* Copyright (C) 2015 Jolla Ltd.
|
||||
*
|
||||
* Contact: Valerio Valerio <valerio.valerio@jolla.com>
|
||||
* Author: Andres Gomez <andres.gomez@jolla.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// 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 DBUSEXTENDEDPENDINGCALLWATCHER_P_H
|
||||
#define DBUSEXTENDEDPENDINGCALLWATCHER_P_H
|
||||
|
||||
#include <QDBusPendingCallWatcher>
|
||||
#include <QDBusError>
|
||||
|
||||
class DBusExtendedPendingCallWatcher: public QDBusPendingCallWatcher
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DBusExtendedPendingCallWatcher(const QDBusPendingCall &call,
|
||||
const QString &asyncProperty,
|
||||
const QVariant &previousValue,
|
||||
QObject *parent = 0);
|
||||
~DBusExtendedPendingCallWatcher();
|
||||
|
||||
Q_PROPERTY(QString AsyncProperty READ asyncProperty)
|
||||
inline QString asyncProperty() const { return m_asyncProperty; }
|
||||
|
||||
Q_PROPERTY(QVariant PreviousValue READ previousValue)
|
||||
inline QVariant previousValue() const { return m_previousValue; }
|
||||
|
||||
private:
|
||||
QString m_asyncProperty;
|
||||
QVariant m_previousValue;
|
||||
};
|
||||
|
||||
#endif /* DBUSEXTENDEDPENDINGCALLWATCHER_P_H */
|
48
src/frameworkdbus/types/launcheriteminfo.cpp
Normal file
48
src/frameworkdbus/types/launcheriteminfo.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* Maintainer: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "launcheriteminfo.h"
|
||||
|
||||
bool LauncherItemInfo::operator!=(const LauncherItemInfo &itemInfo)
|
||||
{
|
||||
return itemInfo.ID != ID;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument, const LauncherItemInfo &itemInfo)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument << itemInfo.Path << itemInfo.Name << itemInfo.ID << itemInfo.Icon << itemInfo.CategoryID << itemInfo.TimeInstalled;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument, LauncherItemInfo &itemInfo)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument >> itemInfo.Path >> itemInfo.Name >> itemInfo.ID >> itemInfo.Icon >> itemInfo.CategoryID >> itemInfo.TimeInstalled;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
void registerLauncherItemInfoMetaType()
|
||||
{
|
||||
qRegisterMetaType<LauncherItemInfo>("ItemInfo");
|
||||
qDBusRegisterMetaType<LauncherItemInfo>();
|
||||
}
|
42
src/frameworkdbus/types/launcheriteminfo.h
Normal file
42
src/frameworkdbus/types/launcheriteminfo.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* Maintainer: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <QtCore/QList>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
struct LauncherItemInfo {
|
||||
QString Path;
|
||||
QString Name;
|
||||
QString ID;
|
||||
QString Icon;
|
||||
qint64 CategoryID;
|
||||
qint64 TimeInstalled;
|
||||
bool operator!=(const LauncherItemInfo &versionInfo);
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(LauncherItemInfo)
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument, const LauncherItemInfo &versionInfo);
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument, LauncherItemInfo &versionInfo);
|
||||
void registerLauncherItemInfoMetaType();
|
27
src/frameworkdbus/types/launcheriteminfolist.cpp
Normal file
27
src/frameworkdbus/types/launcheriteminfolist.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* Maintainer: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "launcheriteminfolist.h"
|
||||
|
||||
void registerLauncherItemInfoListMetaType()
|
||||
{
|
||||
qRegisterMetaType<LauncherItemInfo>("ItemInfoList");
|
||||
qDBusRegisterMetaType<LauncherItemInfoList>();
|
||||
}
|
32
src/frameworkdbus/types/launcheriteminfolist.h
Normal file
32
src/frameworkdbus/types/launcheriteminfolist.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd.
|
||||
*
|
||||
* Author: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* Maintainer: LiLinling <lilinling_cm@deepin.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "launcheriteminfo.h"
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
typedef QList<LauncherItemInfo> LauncherItemInfoList;
|
||||
|
||||
Q_DECLARE_METATYPE(LauncherItemInfoList)
|
||||
|
||||
void registerLauncherItemInfoListMetaType();
|
50
src/frameworkdbus/types/rect.cpp
Normal file
50
src/frameworkdbus/types/rect.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
#include "rect.h"
|
||||
#include <QDebug>
|
||||
|
||||
Rect::Rect()
|
||||
: X(0)
|
||||
, Y(0)
|
||||
, Width(0)
|
||||
, Height(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const Rect &rect)
|
||||
{
|
||||
debug << QString("Rect(%1, %2, %3, %4)").arg(rect.X)
|
||||
.arg(rect.Y)
|
||||
.arg(rect.Width)
|
||||
.arg(rect.Height);
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
Rect::operator QRect() const
|
||||
{
|
||||
return QRect(X, Y, Width, Height);
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &arg, const Rect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg << rect.X << rect.Y << rect.Width << rect.Height;
|
||||
arg.endStructure();
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &arg, Rect &rect)
|
||||
{
|
||||
arg.beginStructure();
|
||||
arg >> rect.X >> rect.Y >> rect.Width >> rect.Height;
|
||||
arg.endStructure();
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
void registerRectMetaType()
|
||||
{
|
||||
qRegisterMetaType<Rect>("Rect");
|
||||
qDBusRegisterMetaType<Rect>();
|
||||
}
|
25
src/frameworkdbus/types/rect.h
Normal file
25
src/frameworkdbus/types/rect.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef DOCKRECT_H
|
||||
#define DOCKRECT_H
|
||||
|
||||
#include <QRect>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
struct Rect
|
||||
{
|
||||
public:
|
||||
Rect();
|
||||
operator QRect() const;
|
||||
|
||||
friend QDebug operator<<(QDebug debug, const Rect &rect);
|
||||
friend const QDBusArgument &operator>>(const QDBusArgument &arg, Rect &rect);
|
||||
friend QDBusArgument &operator<<(QDBusArgument &arg, const Rect &rect);
|
||||
|
||||
private:
|
||||
qint32 X, Y, Width, Height;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Rect)
|
||||
|
||||
void registerRectMetaType();
|
||||
|
||||
#endif // DOCKRECT_H
|
Reference in New Issue
Block a user