mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
Compare commits
61 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a90f386ddc | ||
![]() |
13c4162b5e | ||
![]() |
32140ccf26 | ||
![]() |
697e678587 | ||
![]() |
b2da5add21 | ||
![]() |
a15d92c7eb | ||
![]() |
00d0f13c1a | ||
![]() |
32bd005492 | ||
![]() |
3eb95284a0 | ||
![]() |
1653473ecc | ||
![]() |
0f940b6579 | ||
![]() |
72f4286f49 | ||
![]() |
e8e0f3c96f | ||
![]() |
48cced00a9 | ||
![]() |
edea9b860d | ||
![]() |
710a9f562b | ||
![]() |
478f564631 | ||
![]() |
241e668ea2 | ||
![]() |
e6e8995e51 | ||
![]() |
2b81011b7e | ||
![]() |
2bb5e49cac | ||
![]() |
b4ec458dd5 | ||
![]() |
572c0c8aad | ||
![]() |
c0c909f9e8 | ||
![]() |
8b04a51b51 | ||
![]() |
d1f61330f3 | ||
![]() |
7097ae7f3c | ||
![]() |
3939ca9c12 | ||
![]() |
0300e28332 | ||
![]() |
13b1e661ea | ||
![]() |
b5399bd0ec | ||
![]() |
945bb03a27 | ||
![]() |
0f93647736 | ||
![]() |
ca4408c660 | ||
![]() |
ee030a6505 | ||
![]() |
326f510e4e | ||
![]() |
27e1493982 | ||
![]() |
3a5438b399 | ||
![]() |
e47a6dfb80 | ||
![]() |
b74544aa23 | ||
![]() |
3b567d096e | ||
![]() |
6b0fec0426 | ||
![]() |
f4a40f36b8 | ||
![]() |
556ea5acf8 | ||
![]() |
31e149d3d2 | ||
![]() |
a222173da6 | ||
![]() |
01e2377d86 | ||
![]() |
263e5a4358 | ||
![]() |
12d346a2c9 | ||
![]() |
bce2a49971 | ||
![]() |
2a5a1e0efb | ||
![]() |
4eecd92395 | ||
![]() |
cf909cd4d7 | ||
![]() |
107e7427d6 | ||
![]() |
79efd518a9 | ||
![]() |
6c492486a5 | ||
![]() |
a3499fcf34 | ||
![]() |
e0ac1f9562 | ||
![]() |
e02ff1ac53 | ||
![]() |
d765d60b22 | ||
![]() |
dab0083dcd |
12
.github/workflows/call-api-check.yml
vendored
Normal file
12
.github/workflows/call-api-check.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: apiCheck
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
api-check:
|
||||
uses: linuxdeepin/.github/.github/workflows/api-check.yml@master
|
20
.github/workflows/call-debian-check.yml
vendored
Normal file
20
.github/workflows/call-debian-check.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: debianCheck
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
checks: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
debian-check:
|
||||
uses: linuxdeepin/.github/.github/workflows/debian-check.yml@master
|
||||
with:
|
||||
job_name: "debian-check"
|
||||
|
17
.github/workflows/call-static-check.yml
vendored
Normal file
17
.github/workflows/call-static-check.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: staticCheck
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
checks: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
static-check:
|
||||
uses: linuxdeepin/.github/.github/workflows/static-check.yml@master
|
@ -63,3 +63,8 @@ License: CC0-1.0
|
||||
Files: plugins/overlay-warning/org.deepin.dde.dock.overlay.policy
|
||||
Copyright: UnionTech Software Technology Co., Ltd.
|
||||
License: LGPL-3.0-or-later
|
||||
|
||||
Files: toolGenerate/**/*
|
||||
Copyright: None
|
||||
License: CC0-1.0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if (NOT DEFINED VERSION)
|
||||
set(VERSION 6.0.22)
|
||||
set(VERSION 6.0.37)
|
||||
endif()
|
||||
|
||||
project(dde-dock)
|
||||
|
@ -174,7 +174,7 @@
|
||||
"visibility":"public"
|
||||
},
|
||||
"Dock_Quick_Plugins": {
|
||||
"value": ["power", "network", "shutdown", "show-desktop", "multitasking"],
|
||||
"value": ["power", "network", "shutdown", "show-desktop", "multitasking", "notification", "uosai"],
|
||||
"serial": 0,
|
||||
"flags": [],
|
||||
"name": "Quick Plugins show on dock",
|
||||
|
95
debian/changelog
vendored
95
debian/changelog
vendored
@ -1,3 +1,98 @@
|
||||
dde-dock (6.0.37) unstable; urgency=medium
|
||||
|
||||
* release 6.0.37
|
||||
* fix linuxdeepin/developer-center#7612
|
||||
|
||||
-- Mike Chen <chenke@deepin.org> Wed, 03 Apr 2024 10:22:29 +0800
|
||||
|
||||
dde-dock (6.0.36) unstable; urgency=medium
|
||||
|
||||
* release 6.0.36
|
||||
* fix linuxdeepin/developer-center#7222
|
||||
* fix linuxdeepin/developer-center#7207
|
||||
* fix linuxdeepin/developer-center#6454
|
||||
|
||||
-- Mike Chen <chenke@deepin.org> Wed, 06 Mar 2024 16:50:36 +0800
|
||||
|
||||
dde-dock (6.0.35) unstable; urgency=medium
|
||||
|
||||
* feat: adjust dock ui
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Thu, 01 Feb 2024 10:58:27 +0800
|
||||
|
||||
dde-dock (6.0.34) unstable; urgency=medium
|
||||
|
||||
* fix: dock animation broken (https://github.com/linuxdeepin/developer-center/issues/7143)
|
||||
* fix: dock plugin calculated to an incorrect size (https://github.com/linuxdeepin/developer-center/issues/7127)
|
||||
* fix: dock will not auto hide after set size (https://github.com/linuxdeepin/developer-center/issues/7129)
|
||||
* fix: dock plugin unable to click when in keep hide (https://github.com/linuxdeepin/developer-center/issues/7132)
|
||||
* fix: dock item indicator not update (https://github.com/linuxdeepin/developer-center/issues/7097)
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Tue, 30 Jan 2024 16:17:59 +0800
|
||||
|
||||
dde-dock (6.0.33) unstable; urgency=medium
|
||||
|
||||
* fix: tmp block uosai in quickpanel
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Fri, 26 Jan 2024 14:38:06 +0800
|
||||
|
||||
dde-dock (6.0.32) unstable; urgency=medium
|
||||
|
||||
* fix: dock get max size when positionChanged and KeepHide mode (https://github.com/linuxdeepin/developer-center/issues/7040)
|
||||
* fix: dock not remove plugin when fcitx exit (https://github.com/linuxdeepin/developer-center/issues/7080)
|
||||
* fix: dock theme not follow system (https://github.com/linuxdeepin/developer-center/issues/7090)
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Thu, 25 Jan 2024 14:30:26 +0800
|
||||
|
||||
dde-dock (6.0.31) unstable; urgency=medium
|
||||
|
||||
* fix: error datetime tooltip (https://github.com/linuxdeepin/developer-center/issues/7056)
|
||||
* fix: unable get docked entriy by soft link path (https://github.com/linuxdeepin/developer-center/issues/7033)
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Tue, 23 Jan 2024 17:43:44 +0800
|
||||
|
||||
dde-dock (6.0.30) unstable; urgency=medium
|
||||
|
||||
* chore: remove Cooperation in display plugin (https://github.com/linuxdeepin/developer-center/issues/7023)
|
||||
|
||||
-- chenhongtao <chenhongtao@deepin.org> Mon, 22 Jan 2024 17:27:34 +0800
|
||||
|
||||
dde-dock (6.0.29) unstable; urgency=medium
|
||||
|
||||
* fix: when no timeformat, tooltip is empty
|
||||
|
||||
-- chenhongtao <chenhongtao@deepin.org> Mon, 22 Jan 2024 09:47:21 +0800
|
||||
|
||||
dde-dock (6.0.28) unstable; urgency=medium
|
||||
|
||||
* fix: the item that removed is exist yet (https://github.com/linuxdeepin/developer-center/issues/4631)
|
||||
* fix: dock wakeup area not changed (https://github.com/linuxdeepin/developer-center/issues/5831)
|
||||
* fix: onboard not to show on first click (https://github.com/linuxdeepin/developer-center/issues/6675)
|
||||
* fix: timedate tips show error (https://github.com/linuxdeepin/developer-center/issues/6674)
|
||||
* fix: quickpanel icon not follow theme (https://github.com/linuxdeepin/developer-center/issues/6263)
|
||||
* fix: disable resize of dock popup window (https://github.com/linuxdeepin/developer-center/issues/6264)
|
||||
* feat: add dbus property window margin
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Thu, 18 Jan 2024 09:57:27 +0800
|
||||
|
||||
dde-dock (6.0.27) unstable; urgency=medium
|
||||
|
||||
* fix: dock get stucked when launching (https://github.com/linuxdeepin/developer-center/issues/6657)
|
||||
* chore: make uosai default on dock (https://github.com/linuxdeepin/developer-center/issues/6486)
|
||||
* chore: open deepin-calendar instead of dde-widgets when click timedate (https://github.com/linuxdeepin/developer-center/issues/6696)
|
||||
* fix: item context menu not updated
|
||||
* feat: add plugin notification (https://github.com/linuxdeepin/developer-center/issues/6695)
|
||||
* fix: mainwindow hide when popup opens (https://github.com/linuxdeepin/developer-center/issues/4970)
|
||||
|
||||
-- tsic404 <liuheng@deepin.org> Tue, 09 Jan 2024 13:33:18 +0800
|
||||
|
||||
dde-dock (6.0.26) unstable; urgency=medium
|
||||
|
||||
* release 6.0.26
|
||||
* fix #6033 #5719 #5786 #4331
|
||||
|
||||
-- mike <chenke@deepin.org> Fri, 29 Dec 2023 11:27:59 +0800
|
||||
|
||||
dde-dock (6.0.25) unstable; urgency=medium
|
||||
|
||||
* chore: turn on bluetooth loading animation when not start
|
||||
|
79
debian/control
vendored
79
debian/control
vendored
@ -2,73 +2,80 @@ Source: dde-dock
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: Deepin Packages Builder <packages@deepin.com>
|
||||
Build-Depends: debhelper-compat (= 10),
|
||||
pkg-config,
|
||||
Build-Depends:
|
||||
cmake,
|
||||
qt5-qmake,
|
||||
libxcb-image0-dev,
|
||||
libxcb-composite0-dev,
|
||||
libxcb-ewmh-dev,
|
||||
libxtst-dev,
|
||||
qttools5-dev-tools,
|
||||
qtbase5-private-dev,
|
||||
libxcb-icccm4-dev,
|
||||
libqt5x11extras5-dev,
|
||||
libxcb-damage0-dev,
|
||||
libqt5svg5-dev,
|
||||
libdtkwidget-dev (>=5.4.19),
|
||||
debhelper-compat (= 10),
|
||||
extra-cmake-modules,
|
||||
libdbusmenu-qt5-dev,
|
||||
libdtkcore-dev (>=5.4.14),
|
||||
libdtkcore5-bin (>=5.4.14),
|
||||
libdtkgui-dev (>=5.4.13),
|
||||
libgsettings-qt-dev,
|
||||
libdbusmenu-qt5-dev,
|
||||
libgtest-dev,
|
||||
libgmock-dev,
|
||||
qttools5-dev,
|
||||
libxcursor-dev,
|
||||
libxres-dev,
|
||||
libqt5waylandclient5-dev,
|
||||
qtwayland5-private-dev,
|
||||
libxdamage-dev,
|
||||
libdtkwidget-dev (>=5.4.19),
|
||||
libdwayland-dev,
|
||||
extra-cmake-modules
|
||||
libgmock-dev,
|
||||
libgsettings-qt-dev,
|
||||
libgtest-dev,
|
||||
libqt5svg5-dev,
|
||||
libqt5waylandclient5-dev,
|
||||
libqt5x11extras5-dev,
|
||||
libxcb-composite0-dev,
|
||||
libxcb-damage0-dev,
|
||||
libxcb-ewmh-dev,
|
||||
libxcb-icccm4-dev,
|
||||
libxcb-image0-dev,
|
||||
libxcursor-dev,
|
||||
libxdamage-dev,
|
||||
libxres-dev,
|
||||
libxtst-dev,
|
||||
pkg-config,
|
||||
qt5-qmake,
|
||||
qtbase5-private-dev,
|
||||
qttools5-dev,
|
||||
qttools5-dev-tools,
|
||||
qtwayland5-private-dev,
|
||||
Standards-Version: 3.9.8
|
||||
Homepage: http://www.deepin.org/
|
||||
|
||||
Package: dde-dock
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends},
|
||||
deepin-desktop-schemas (>=5.9.14),
|
||||
dde-qt5xcb-plugin (>=5.0.25),
|
||||
Depends:
|
||||
dbus-bin,
|
||||
dde-daemon (>=5.13.12),
|
||||
startdde (>=5.8.9),
|
||||
dde-qt5xcb-plugin (>=5.0.25),
|
||||
deepin-desktop-schemas (>=5.9.14),
|
||||
lastore-daemon (>=5.2.9),
|
||||
qtxdg-dev-tools,
|
||||
dbus-bin
|
||||
startdde (>=5.8.9),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
Recommends:
|
||||
dde-disk-mount-plugin,
|
||||
dde-dock-onboard-plugin,
|
||||
dde-network-dialog,
|
||||
dock-network-plugin,
|
||||
dde-network-dialog
|
||||
Conflicts:
|
||||
dde-workspace (<< 2.90.5),
|
||||
dde-dock-applets,
|
||||
dde-trash-plugin,
|
||||
dock-hotspot-plugin
|
||||
dde-workspace (<< 2.90.5),
|
||||
dock-hotspot-plugin,
|
||||
Replaces:
|
||||
dde-dock-applets,
|
||||
dde-trash-plugin
|
||||
dde-trash-plugin,
|
||||
Description: deepin desktop-environment - dock module
|
||||
Dock module of deepin desktop-environment
|
||||
|
||||
Package: dde-dock-dev
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Depends:
|
||||
${misc:Depends},
|
||||
Description: deepin desktop-environment - dock module development files
|
||||
Dock module development files of deepin desktop-environment
|
||||
|
||||
Package: dde-dock-onboard-plugin
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, onboard
|
||||
Depends:
|
||||
onboard,
|
||||
${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
Description: deepin desktop-environment - dock plugin for onboard
|
||||
Dock plugin for onboard of deepin desktop-environment
|
||||
|
1
debian/dde-dock.install
vendored
1
debian/dde-dock.install
vendored
@ -9,4 +9,5 @@ usr/lib/dde-dock/plugins/quick-trays
|
||||
usr/lib/dde-dock/plugins/libmultitasking.so
|
||||
usr/lib/dde-dock/plugins/libshow-desktop.so
|
||||
usr/lib/dde-dock/plugins/libkeyboard-layout.so
|
||||
usr/lib/dde-dock/plugins/libnotification.so
|
||||
usr/share/dsg/configs/dde-dock/
|
||||
|
@ -84,7 +84,7 @@ DockItemManager::DockItemManager(QObject *parent)
|
||||
}
|
||||
|
||||
// 刷新图标
|
||||
QMetaObject::invokeMethod(this, "refreshItemsIcon", Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(this, &DockItemManager::refreshItemsIcon, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
DockItemManager *DockItemManager::instance(QObject *parent)
|
||||
|
@ -36,9 +36,9 @@ bool QuickSettingController::eventFilter(QObject *watched, QEvent *event)
|
||||
void QuickSettingController::startLoader()
|
||||
{
|
||||
#ifdef QT_DEBUG
|
||||
AbstractPluginsController::startLoader(new PluginLoader(QString("%1/..%2").arg(qApp->applicationDirPath()).arg("/plugins/loader"), this));
|
||||
AbstractPluginsController::startLoader(new PluginLoader(QString("%1/..%2").arg(qApp->applicationDirPath()).arg("/plugins/loader"), this));
|
||||
#else
|
||||
AbstractPluginsController::startLoader(new PluginLoader("/usr/lib/dde-dock/plugins/loader", this));
|
||||
AbstractPluginsController::startLoader(new PluginLoader("/usr/lib/dde-dock/plugins/loader", this));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,14 @@ QIcon DBusDockAdaptors::getSettingIcon(PluginsItemInterface *plugin, QSize &pixm
|
||||
QIcon icon = plugin->icon(DockPart::DCCSetting, colorType);
|
||||
if (!icon.isNull()) {
|
||||
pixmapSize = iconSize(icon);
|
||||
return icon;
|
||||
|
||||
QColor c = colorType == DGuiApplicationHelper::LightType ? Qt::black :Qt::white;
|
||||
QPixmap pixmap = icon.pixmap(pixmapSize);
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), c);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
// 如果插件中没有设置图标,则根据插件的类型,获取其他的图标
|
||||
|
@ -17,6 +17,7 @@ DockDaemonDBusAdaptor::DockDaemonDBusAdaptor(QObject *parent)
|
||||
connect(TaskManager::instance(), &TaskManager::frontendWindowRectChanged, this, &DockDaemonDBusAdaptor::FrontendWindowRectChanged);
|
||||
connect(TaskManager::instance(), &TaskManager::showRecentChanged, this, &DockDaemonDBusAdaptor::showRecentChanged);
|
||||
connect(TaskManager::instance(), &TaskManager::showMultiWindowChanged, this, &DockDaemonDBusAdaptor::ShowMultiWindowChanged);
|
||||
connect(TaskManager::instance(), &TaskManager::windowMarginChanged, this, &DockDaemonDBusAdaptor::WindowMarginChanged);
|
||||
connect(DockSettings::instance(), &DockSettings::positionModeChanged, this, &DockDaemonDBusAdaptor::PositionChanged);
|
||||
connect(DockSettings::instance(), &DockSettings::hideModeChanged, this, &DockDaemonDBusAdaptor::HideModeChanged);
|
||||
connect(DockSettings::instance(), &DockSettings::displayModeChanged, this, &DockDaemonDBusAdaptor::DisplayModeChanged);
|
||||
@ -104,6 +105,11 @@ void DockDaemonDBusAdaptor::setWindowSizeFashion(uint value)
|
||||
}
|
||||
}
|
||||
|
||||
uint DockDaemonDBusAdaptor::windowMargin() const
|
||||
{
|
||||
return TaskManager::instance()->windowMargin();
|
||||
}
|
||||
|
||||
QRect DockDaemonDBusAdaptor::frontendWindowRect() const
|
||||
{
|
||||
return TaskManager::instance()->getFrontendWindowRect();
|
||||
|
@ -100,6 +100,7 @@ class DockDaemonDBusAdaptor: public QDBusAbstractAdaptor
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"HideTimeout\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"WindowSizeEfficient\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"WindowSizeFashion\"/>\n"
|
||||
" <property access=\"read\" type=\"u\" name=\"WindowMargin\"/>\n"
|
||||
" <property access=\"read\" type=\"(iiii)\" name=\"FrontendWindowRect\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"HideMode\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"DisplayMode\"/>\n"
|
||||
@ -142,6 +143,9 @@ public: // PROPERTIES
|
||||
uint windowSizeFashion() const;
|
||||
void setWindowSizeFashion(uint value);
|
||||
|
||||
Q_PROPERTY(uint WindowMargin READ windowMargin NOTIFY WindowMarginChanged)
|
||||
uint windowMargin() const;
|
||||
|
||||
Q_PROPERTY(QRect FrontendWindowRect READ frontendWindowRect NOTIFY FrontendWindowRectChanged)
|
||||
QRect frontendWindowRect() const;
|
||||
|
||||
@ -198,6 +202,7 @@ Q_SIGNALS: // SIGNALS
|
||||
void ShowTimeoutChanged(uint value) const;
|
||||
void WindowSizeEfficientChanged(uint value) const;
|
||||
void WindowSizeFashionChanged(uint value) const;
|
||||
void WindowMarginChanged(uint value) const;
|
||||
void showRecentChanged(bool) const;
|
||||
void ShowMultiWindowChanged(bool) const;
|
||||
};
|
||||
};
|
||||
|
@ -159,6 +159,10 @@ int main(int argc, char *argv[])
|
||||
DockApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
DockApplication app(argc, argv);
|
||||
|
||||
// NOTE: dde-shell load dde-dock plugins and mark loader program DS_APP_ID as dde-dock
|
||||
// so need reset DGuiApplication pallette to follow system
|
||||
DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::ColorType::UnknownType);
|
||||
|
||||
//崩溃信号
|
||||
signal(SIGSEGV, sig_crash);
|
||||
signal(SIGILL, sig_crash);
|
||||
|
@ -22,6 +22,13 @@ DBusHandler::DBusHandler(TaskManager *taskmanager, QObject *parent)
|
||||
, m_xEventMonitor(nullptr)
|
||||
, m_launcher(new org::deepin::dde::Launcher1(launcherService, launcherPath, QDBusConnection::sessionBus(), this))
|
||||
{
|
||||
QDBusInterface *interAM = new QDBusInterface(ApplicationManager1DBusName, "/org/desktopspec/ApplicationManager1", "org.desktopspec.DBus.ObjectManager", QDBusConnection::sessionBus(), this);
|
||||
if (interAM->isValid()) {
|
||||
connect(interAM, SIGNAL(InterfacesRemoved(const QDBusObjectPath &, const QStringList &)), this, SIGNAL(appUninstalled(const QDBusObjectPath &, const QStringList &)));
|
||||
} else {
|
||||
qWarning() << "The interface of AM is invalid:" << interAM->lastError();
|
||||
}
|
||||
|
||||
connect(m_wmSwitcher, &org::deepin::dde::WMSwitcher1::WMChanged, this, [&](QString name) {m_taskmanager->setWMName(name);});
|
||||
if (!isWaylandSession()) {
|
||||
m_xEventMonitor = new org::deepin::dde::XEventMonitor1("org.deepin.dde.XEventMonitor1", "/org/deepin/dde/XEventMonitor1", QDBusConnection::sessionBus(), this);
|
||||
@ -33,6 +40,16 @@ DBusHandler::DBusHandler(TaskManager *taskmanager, QObject *parent)
|
||||
m_taskmanager->setDdeLauncherVisible(visible);
|
||||
m_taskmanager->updateHideState(true);
|
||||
});
|
||||
|
||||
// try to active bamf in another thread
|
||||
QtConcurrent::run([ = ] {
|
||||
QDBusInterface bamfInterface(
|
||||
QStringLiteral("org.ayatana.bamf"),
|
||||
QStringLiteral("/org/ayatana/bamf/matcher"),
|
||||
QStringLiteral("org.ayatana.bamf.matcher"),
|
||||
QDBusConnection::sessionBus()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void DBusHandler::listenWaylandWMSignals()
|
||||
|
@ -66,6 +66,9 @@ public:
|
||||
bool newStartManagerAvaliable();
|
||||
void sendFailedDockNotification(const QString &appName);
|
||||
|
||||
Q_SIGNALS:
|
||||
void appUninstalled(const QDBusObjectPath &objectPath, const QStringList &interfaces);
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleWlActiveWindowChange();
|
||||
void onActiveWindowButtonRelease(int type, int x, int y, const QString &key);
|
||||
|
@ -40,7 +40,7 @@ DesktopInfo::DesktopInfo(const QString &desktopfile)
|
||||
}
|
||||
}
|
||||
|
||||
m_desktopFilePath = desktopFileInfo.absoluteFilePath();
|
||||
m_desktopFilePath = desktopFileInfo.canonicalFilePath();
|
||||
m_isValid = desktopFileInfo.isAbsolute() && QFile::exists(desktopFileInfo.absoluteFilePath());
|
||||
m_desktopFile.reset(new QSettings(m_desktopFilePath, QSettings::IniFormat));
|
||||
m_desktopFile->setIniCodec("utf-8");
|
||||
|
@ -162,9 +162,11 @@ QList<Entry*> Entries::getEntries()
|
||||
|
||||
Entry *Entries::getDockedEntryByDesktopFile(const QString &desktopFile)
|
||||
{
|
||||
QFileInfo desktopFileInfo(desktopFile);
|
||||
|
||||
Entry *ret = nullptr;
|
||||
for (auto entry : filterDockedEntries()) {
|
||||
if ((entry->isValid()) && desktopFile == entry->getFileName()) {
|
||||
if ((entry->isValid()) && desktopFileInfo.canonicalFilePath() == entry->getFileName()) {
|
||||
ret = entry;
|
||||
break;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "waylandmanager.h"
|
||||
#include "windowinfobase.h"
|
||||
#include "dbusutil.h"
|
||||
|
||||
#include "org_deepin_dde_kwayland_plasmawindow.h"
|
||||
|
||||
#include <QDir>
|
||||
@ -27,10 +26,16 @@
|
||||
#include <QPixmap>
|
||||
|
||||
#include <cstdint>
|
||||
#include <dtkcore_global.h>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
|
||||
#include <dutil.h>
|
||||
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
#define SETTING DockSettings::instance()
|
||||
#define XCB XCBUtils::instance()
|
||||
bool shouldShowEntry(Entry *entry)
|
||||
@ -50,6 +55,7 @@ TaskManager::TaskManager(QObject *parent)
|
||||
, m_hideState(HideState::Unknown)
|
||||
, m_ddeLauncherVisible(false)
|
||||
, m_trayGridWidgetVisible(false)
|
||||
, m_popupVisible(false)
|
||||
, m_entries(new Entries(this))
|
||||
, m_windowIdentify(new WindowIdentify(this))
|
||||
, m_dbusHandler(new DBusHandler(this))
|
||||
@ -90,6 +96,20 @@ TaskManager::TaskManager(QObject *parent)
|
||||
connect(m_x11Manager, &X11Manager::requestHandleActiveWindowChange, this, &TaskManager::handleActiveWindowChanged);
|
||||
connect(m_x11Manager, &X11Manager::requestAttachOrDetachWindow, this, &TaskManager::attachOrDetachWindow);
|
||||
}
|
||||
connect(m_dbusHandler, &DBusHandler::appUninstalled, this, [this] (const QDBusObjectPath &objectPath, const QStringList &interfaces) {
|
||||
Q_UNUSED(interfaces)
|
||||
QString desktopFile = DUtil::unescapeFromObjectPath(objectPath.path());
|
||||
QString desktopName = desktopFile.split('/').last();
|
||||
QList<Entry *> entries = m_entries->getEntries();
|
||||
auto desktopEntryIter = std::find_if(entries.begin(), entries.end(), [desktopName] (Entry *entry) {
|
||||
return entry->getDesktopFile().contains(desktopName);
|
||||
});
|
||||
if (desktopEntryIter != entries.end()) {
|
||||
undockEntry(*desktopEntryIter);
|
||||
} else {
|
||||
qWarning() << "The entry which is to be removed is not found!";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
TaskManager::~TaskManager()
|
||||
@ -248,7 +268,7 @@ bool TaskManager::shouldShowOnDock(WindowInfoBase *info)
|
||||
*/
|
||||
void TaskManager::setDdeLauncherVisible(bool visible)
|
||||
{
|
||||
m_trayGridWidgetVisible = visible;
|
||||
m_ddeLauncherVisible = visible;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,7 +277,12 @@ void TaskManager::setDdeLauncherVisible(bool visible)
|
||||
*/
|
||||
void TaskManager::setTrayGridWidgetVisible(bool visible)
|
||||
{
|
||||
m_ddeLauncherVisible = visible;
|
||||
m_trayGridWidgetVisible = visible;
|
||||
}
|
||||
|
||||
void TaskManager::setPopupVisible(bool visible)
|
||||
{
|
||||
m_popupVisible = visible;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -629,6 +654,9 @@ void TaskManager::initSettings()
|
||||
connect(SETTING, &DockSettings::showRecentChanged, this, &TaskManager::onShowRecentChanged);
|
||||
connect(SETTING, &DockSettings::showMultiWindowChanged, this, &TaskManager::onShowMultiWindowChanged);
|
||||
connect(SETTING, &DockSettings::displayModeChanged, this, &TaskManager::setDisplayMode);
|
||||
connect(SETTING, &DockSettings::displayModeChanged, this, [this]() {
|
||||
Q_EMIT windowMarginChanged(windowMargin());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -849,7 +877,7 @@ Entry *TaskManager::getDockedEntryByDesktopFile(const QString &desktopFile)
|
||||
*/
|
||||
bool TaskManager::shouldHideOnSmartHideMode()
|
||||
{
|
||||
if (!m_activeWindow || m_ddeLauncherVisible || m_trayGridWidgetVisible)
|
||||
if (!m_activeWindow || m_ddeLauncherVisible || m_trayGridWidgetVisible || m_popupVisible)
|
||||
return false;
|
||||
|
||||
if (!m_isWayland) {
|
||||
@ -949,7 +977,7 @@ QVector<XWindow> TaskManager::getActiveWinGroup(XWindow xid)
|
||||
*/
|
||||
void TaskManager::updateHideState(bool delay)
|
||||
{
|
||||
if (m_ddeLauncherVisible || m_trayGridWidgetVisible) {
|
||||
if (preventDockAutoHide()) {
|
||||
setPropHideState(HideState::Show);
|
||||
return;
|
||||
}
|
||||
@ -1138,7 +1166,7 @@ void TaskManager::handleActiveWindowChanged(WindowInfoBase *info)
|
||||
m_activeWindow = info;
|
||||
XWindow winId = m_activeWindow->getXid();
|
||||
m_entries->handleActiveWindowChanged(winId);
|
||||
updateHideState(true);
|
||||
QTimer::singleShot(200, std::bind(&TaskManager::updateHideState, this, true));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1505,6 +1533,11 @@ void TaskManager::setPosition(int position)
|
||||
SETTING->setPositionMode(Position(position));
|
||||
}
|
||||
|
||||
uint TaskManager::windowMargin() const
|
||||
{
|
||||
return SETTING->getDisplayMode() == Dock::Efficient ? 0 : 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TaskManager::getShowTimeout 获取显示超时接口
|
||||
* @return
|
||||
@ -1573,3 +1606,8 @@ bool TaskManager::showMultiWindow() const
|
||||
{
|
||||
return m_showMultiWindow;
|
||||
}
|
||||
|
||||
bool TaskManager::preventDockAutoHide() const
|
||||
{
|
||||
return m_ddeLauncherVisible || m_popupVisible || m_trayGridWidgetVisible;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
bool shouldShowOnDock(WindowInfoBase *info);
|
||||
void setDdeLauncherVisible(bool visible);
|
||||
void setTrayGridWidgetVisible(bool visible);
|
||||
void setPopupVisible(bool visible);
|
||||
QString getWMName();
|
||||
void setWMName(QString name);
|
||||
void setPropHideState(HideState state);
|
||||
@ -86,6 +87,7 @@ public:
|
||||
void setIconSize(uint size);
|
||||
int getPosition();
|
||||
void setPosition(int position);
|
||||
uint windowMargin() const;
|
||||
uint getShowTimeout();
|
||||
void setShowTimeout(uint timeout);
|
||||
uint getWindowSizeEfficient();
|
||||
@ -127,6 +129,7 @@ public:
|
||||
|
||||
void previewWindow(uint xid);
|
||||
void cancelPreviewWindow();
|
||||
bool preventDockAutoHide() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void serviceRestarted();
|
||||
@ -136,6 +139,7 @@ Q_SIGNALS:
|
||||
void frontendWindowRectChanged(const QRect &dockRect);
|
||||
void showRecentChanged(bool);
|
||||
void showMultiWindowChanged(bool);
|
||||
void windowMarginChanged(uint);
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateHideState(bool delay);
|
||||
@ -177,6 +181,7 @@ private:
|
||||
ForceQuitAppMode m_forceQuitAppStatus; // 强制退出应用状态
|
||||
bool m_ddeLauncherVisible;
|
||||
bool m_trayGridWidgetVisible;
|
||||
bool m_popupVisible;
|
||||
|
||||
Entries *m_entries; // 所有应用实例
|
||||
X11Manager *m_x11Manager; // X11窗口管理
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
#include <qstandardpaths.h>
|
||||
#include <QDBusConnection>
|
||||
|
||||
#define XCB XCBUtils::instance()
|
||||
|
||||
@ -74,11 +74,28 @@ WindowIdentify::WindowIdentify(TaskManager *_taskmanager, QObject *parent)
|
||||
m_identifyWindowFuns << qMakePair(QString("FlatpakAppID"), &identifyWindowByFlatpakAppID);
|
||||
m_identifyWindowFuns << qMakePair(QString("CrxId"), &identifyWindowByCrxId);
|
||||
m_identifyWindowFuns << qMakePair(QString("Rule"), &identifyWindowByRule);
|
||||
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
||||
m_identifyWindowFuns << qMakePair(QString("Pid"), &identifyWindowByPid);
|
||||
m_identifyWindowFuns << qMakePair(QString("Scratch"), &identifyWindowByScratch);
|
||||
m_identifyWindowFuns << qMakePair(QString("GtkAppId"), &identifyWindowByGtkAppId);
|
||||
m_identifyWindowFuns << qMakePair(QString("WmClass"), &identifyWindowByWmClass);
|
||||
|
||||
// should remove bamf identify and turn to new AM
|
||||
auto *dbusWatcher = new QDBusServiceWatcher(QStringLiteral("org.ayatana.bamf"), QDBusConnection::sessionBus(),
|
||||
QDBusServiceWatcher::WatchForOwnerChange, this);
|
||||
|
||||
auto ifc = QDBusConnection::sessionBus().interface();
|
||||
|
||||
if (ifc->isServiceRegistered(QStringLiteral("org.ayatana.bamf"))) {
|
||||
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
||||
}
|
||||
|
||||
connect(dbusWatcher, &QDBusServiceWatcher::serviceRegistered, this, [this](){
|
||||
m_identifyWindowFuns << qMakePair(QString("Bamf"), &identifyWindowByBamf);
|
||||
});
|
||||
|
||||
connect(dbusWatcher, &QDBusServiceWatcher::serviceUnregistered, this, [this](){
|
||||
m_identifyWindowFuns.removeAll(qMakePair(QString("Bamf"), &identifyWindowByBamf));
|
||||
});
|
||||
}
|
||||
|
||||
AppInfo *WindowIdentify::identifyWindow(WindowInfoBase *winInfo, QString &innerId)
|
||||
|
@ -44,13 +44,13 @@ AbstractPluginsController::~AbstractPluginsController()
|
||||
void AbstractPluginsController::startLoader(PluginLoader *loader)
|
||||
{
|
||||
connect(loader, &PluginLoader::finished, loader, &PluginLoader::deleteLater, Qt::QueuedConnection);
|
||||
connect(loader, &PluginLoader::pluginFounded, this, [ = ](const QString &pluginFile) {
|
||||
connect(loader, &PluginLoader::pluginFound, this, [ = ](const QString &pluginFile) {
|
||||
QPair<QString, PluginsItemInterface *> pair;
|
||||
pair.first = pluginFile;
|
||||
pair.second = nullptr;
|
||||
m_pluginLoadMap.insert(pair, false);
|
||||
});
|
||||
connect(loader, &PluginLoader::pluginFounded, this, &AbstractPluginsController::loadPlugin, Qt::QueuedConnection);
|
||||
connect(loader, &PluginLoader::pluginFound, this, &AbstractPluginsController::loadPlugin, Qt::QueuedConnection);
|
||||
|
||||
int delay = Utils::SettingValue("com.deepin.dde.dock", "/com/deepin/dde/dock/", "delay-plugins-time", 0).toInt();
|
||||
QTimer::singleShot(delay, loader, [ = ] { loader->start(QThread::LowestPriority); });
|
||||
@ -137,9 +137,7 @@ void AbstractPluginsController::loadPlugin(const QString &pluginFile)
|
||||
// NOTE(justforlxz): 插件的所有初始化工作都在init函数中进行,
|
||||
// loadPlugin函数是按队列执行的,initPlugin函数会有可能导致
|
||||
// 函数执行被阻塞。
|
||||
QTimer::singleShot(1, this, [ = ] {
|
||||
initPlugin(interface);
|
||||
});
|
||||
QMetaObject::invokeMethod(this, std::bind(&AbstractPluginsController::initPlugin, this, interface), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void AbstractPluginsController::initPlugin(PluginsItemInterface *interface)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "dbusutil.h"
|
||||
#include "dockscreen.h"
|
||||
#include "displaymanager.h"
|
||||
#include "taskmanager/taskmanager.h"
|
||||
|
||||
#include <QScreen>
|
||||
#include <QApplication>
|
||||
@ -77,7 +78,7 @@ void DockPopupWindow::setContent(QWidget *content)
|
||||
m_lastWidget = content;
|
||||
content->setParent(this);
|
||||
content->show();
|
||||
resize(content->sizeHint());
|
||||
setFixedSize(content->sizeHint());
|
||||
}
|
||||
|
||||
void DockPopupWindow::setExtendWidget(QWidget *widget)
|
||||
@ -141,7 +142,7 @@ void DockPopupWindow::show(const int x, const int y)
|
||||
displayPoint.setX(qMin(screenRect.x() + screenRect.width() - getContent()->width(), displayPoint.x()));
|
||||
}
|
||||
move(displayPoint);
|
||||
resize(m_lastWidget->size());
|
||||
setFixedSize(m_lastWidget->size());
|
||||
DBlurEffectWidget::show();
|
||||
activateWindow();
|
||||
}
|
||||
@ -172,12 +173,14 @@ void DockPopupWindow::showEvent(QShowEvent *e)
|
||||
Utils::updateCursor(this);
|
||||
}
|
||||
|
||||
TaskManager::instance()->setPopupVisible(true);
|
||||
QTimer::singleShot(1, this, &DockPopupWindow::ensureRaised);
|
||||
}
|
||||
|
||||
void DockPopupWindow::hideEvent(QHideEvent *event)
|
||||
{
|
||||
m_extendWidget = nullptr;
|
||||
TaskManager::instance()->setPopupVisible(false);
|
||||
Dtk::Widget::DBlurEffectWidget::hideEvent(event);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,9 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "multiscreenworker.h"
|
||||
#include "constants.h"
|
||||
#include "mainwindow.h"
|
||||
#include "taskmanager/taskmanager.h"
|
||||
#include "utils.h"
|
||||
#include "displaymanager.h"
|
||||
#include "traymainwindow.h"
|
||||
@ -102,6 +104,10 @@ void MultiScreenWorker::onRegionMonitorChanged(int x, int y, const QString &key)
|
||||
if (m_registerKey != key || testState(MousePress))
|
||||
return;
|
||||
|
||||
if (m_hideMode == HideMode::KeepHidden) {
|
||||
TaskManager::instance()->setPropHideState(HideState::Show);
|
||||
}
|
||||
|
||||
tryToShowDock(x, y);
|
||||
}
|
||||
|
||||
@ -122,6 +128,10 @@ void MultiScreenWorker::onExtralRegionMonitorChanged(int x, int y, const QString
|
||||
// 鼠标移动到任务栏界面之外,停止计时器(延时2秒改变任务栏所在屏幕)
|
||||
m_delayWakeTimer->stop();
|
||||
|
||||
if (m_hideMode == HideMode::KeepHidden && !TaskManager::instance()->preventDockAutoHide()) {
|
||||
TaskManager::instance()->setPropHideState(HideState::Hide);
|
||||
}
|
||||
|
||||
if (m_hideMode == HideMode::KeepShowing
|
||||
|| ((m_hideMode == HideMode::KeepHidden || m_hideMode == HideMode::SmartHide) && m_hideState == HideState::Show)) {
|
||||
Q_EMIT requestPlayAnimation(DOCK_SCREEN->current(), m_position, Dock::AniAction::Show);
|
||||
@ -132,6 +142,7 @@ void MultiScreenWorker::onExtralRegionMonitorChanged(int x, int y, const QString
|
||||
|
||||
void MultiScreenWorker::updateDisplay()
|
||||
{
|
||||
tryToHideDock();
|
||||
//1、屏幕停靠信息,
|
||||
//2、任务栏当前显示在哪个屏幕也需要更新
|
||||
//3、任务栏高度或宽度调整的拖拽区域,
|
||||
@ -181,6 +192,7 @@ void MultiScreenWorker::onPositionChanged(int position)
|
||||
qDebug() << "position change from: " << lastPos << " to: " << position;
|
||||
#endif
|
||||
m_position = static_cast<Position>(position);
|
||||
DockItem::setDockPosition(m_position);
|
||||
|
||||
if (m_hideMode == HideMode::KeepHidden || (m_hideMode == HideMode::SmartHide && m_hideState == HideState::Hide)) {
|
||||
// 这种情况切换位置,任务栏不需要显示
|
||||
@ -192,10 +204,11 @@ void MultiScreenWorker::onPositionChanged(int position)
|
||||
// 更新当前屏幕信息,下次显示从目标屏幕显示
|
||||
DOCK_SCREEN->updateDockedScreen(getValidScreen(m_position));
|
||||
// 需要更新frontendWindowRect接口数据,否则会造成HideState属性值不变
|
||||
emit requestUpdateFrontendGeometry();
|
||||
Q_EMIT requestUpdateFrontendGeometry();
|
||||
Q_EMIT positionChanged(m_position);
|
||||
} else {
|
||||
// 一直显示的模式才需要显示
|
||||
emit requestUpdatePosition(lastPos, m_position);
|
||||
Q_EMIT requestUpdatePosition(lastPos, m_position);
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,7 +422,7 @@ void MultiScreenWorker::onRequestUpdateRegionMonitor()
|
||||
}
|
||||
|
||||
// 触屏监控高度固定调整为最大任务栏高度100+任务栏与屏幕边缘间距
|
||||
const int monitHeight = 100 + WINDOWMARGIN;
|
||||
const int monitHeight = 100 + WINDOWMARGIN * qApp->devicePixelRatio();
|
||||
|
||||
// 任务栏触屏唤起区域
|
||||
m_touchRectList.clear();
|
||||
@ -537,7 +550,7 @@ void MultiScreenWorker::onRequestDelayShowDock()
|
||||
|
||||
void MultiScreenWorker::initMembers()
|
||||
{
|
||||
m_monitorUpdateTimer->setInterval(100);
|
||||
m_monitorUpdateTimer->setInterval(1000);
|
||||
m_monitorUpdateTimer->setSingleShot(true);
|
||||
|
||||
m_delayWakeTimer->setSingleShot(true);
|
||||
@ -891,7 +904,6 @@ void MultiScreenWorker::onDelayAutoHideChanged()
|
||||
*/
|
||||
void MultiScreenWorker::tryToShowDock(int eventX, int eventY)
|
||||
{
|
||||
DockItem::setDockPosition(m_position);
|
||||
if (qApp->property("DRAG_STATE").toBool() || testState(ChangePositionAnimationStart)) {
|
||||
qWarning() << "dock is draging or animation is running";
|
||||
return;
|
||||
@ -946,3 +958,16 @@ void MultiScreenWorker::tryToShowDock(int eventX, int eventY)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MultiScreenWorker::tryToHideDock()
|
||||
{
|
||||
if (hideMode() == HideMode::KeepShowing) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto mousePos = QCursor::pos();
|
||||
const QString ¤tScreen = DOCK_SCREEN->current();
|
||||
if (isCursorOut(mousePos.x(), mousePos.y())) {
|
||||
Q_EMIT requestPlayAnimation(currentScreen, m_position, Dock::AniAction::Hide);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <QObject>
|
||||
#include <QFlag>
|
||||
|
||||
#define WINDOWMARGIN ((m_displayMode == Dock::Efficient) ? 0 : 10)
|
||||
#define WINDOWMARGIN ((m_displayMode == Dock::Efficient) ? 0 : 5)
|
||||
#define ANIMATIONTIME 300
|
||||
#define FREE_POINT(p) if (p) {\
|
||||
delete p;\
|
||||
@ -153,6 +153,7 @@ private:
|
||||
void reInitDisplayData();
|
||||
|
||||
void tryToShowDock(int eventX, int eventY);
|
||||
void tryToHideDock();
|
||||
void changeDockPosition(QString fromScreen, QString toScreen, const Position &fromPos, const Position &toPos);
|
||||
|
||||
void resetDockScreen();
|
||||
|
@ -59,7 +59,7 @@ void PluginLoader::run()
|
||||
}
|
||||
|
||||
for (auto plugin : plugins) {
|
||||
emit pluginFounded(pluginsDir.absoluteFilePath(plugin));
|
||||
emit pluginFound(pluginsDir.absoluteFilePath(plugin));
|
||||
}
|
||||
|
||||
emit finished();
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
|
||||
signals:
|
||||
void finished() const;
|
||||
void pluginFounded(const QString &pluginFile) const;
|
||||
void pluginFound(const QString &pluginFile) const;
|
||||
|
||||
protected:
|
||||
void run();
|
||||
|
@ -35,6 +35,8 @@ static QMap<int, QString> timeFormat{{0, "h:mm"}, {1, "hh:mm"}};
|
||||
const QString localeName_key = "localeName";
|
||||
const QString shortDateFormat_key = "shortDateFormat";
|
||||
const QString shortTimeFormat_key = "shortTimeFormat";
|
||||
const QString longDateFormat_key = "longDateFormat";
|
||||
const QString longTimeFormat_key = "longTimeFormat";
|
||||
|
||||
DateTimeDisplayer::DateTimeDisplayer(bool showMultiRow, QWidget *parent)
|
||||
: QWidget (parent)
|
||||
@ -71,17 +73,45 @@ DateTimeDisplayer::DateTimeDisplayer(bool showMultiRow, QWidget *parent)
|
||||
m_tipPopupWindow->hide();
|
||||
|
||||
m_locale = QLocale::system();
|
||||
initDConfig();
|
||||
}
|
||||
|
||||
void DateTimeDisplayer::initDConfig()
|
||||
{
|
||||
QLocale currentLocale = QLocale::system();
|
||||
if (!m_config->isValid())
|
||||
return;
|
||||
|
||||
if (!m_config->isDefaultValue(localeName_key)) {
|
||||
m_locale = QLocale(m_config->value(localeName_key).toString());
|
||||
} else {
|
||||
m_locale = currentLocale;
|
||||
}
|
||||
|
||||
if (!m_config->isDefaultValue(shortDateFormat_key)) {
|
||||
m_shortDateFormatStr = m_config->value(shortDateFormat_key).toString();
|
||||
} else {
|
||||
m_shortDateFormatStr = currentLocale.dateFormat(QLocale::ShortFormat);
|
||||
}
|
||||
|
||||
if (!m_config->isDefaultValue(shortDateFormat_key)) {
|
||||
m_longDateFormatStr = m_config->value(longDateFormat_key).toString();
|
||||
} else {
|
||||
m_longDateFormatStr = currentLocale.dateFormat(QLocale::LongFormat);
|
||||
}
|
||||
|
||||
if (!m_config->isDefaultValue(shortTimeFormat_key)) {
|
||||
m_shortTimeFormatStr = m_config->value(shortTimeFormat_key).toString();
|
||||
} else {
|
||||
m_shortTimeFormatStr = currentLocale.timeFormat(QLocale::ShortFormat);
|
||||
}
|
||||
|
||||
if (!m_config->isDefaultValue(longTimeFormat_key)) {
|
||||
m_longTimeFormatStr = m_config->value(longTimeFormat_key).toString();
|
||||
} else {
|
||||
m_longTimeFormatStr = currentLocale.timeFormat(QLocale::LongFormat);
|
||||
}
|
||||
|
||||
connect(m_config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this] (const QString &key) {
|
||||
if (key == shortDateFormat_key) {
|
||||
m_shortDateFormatStr = m_config->value(key).toString();
|
||||
@ -89,7 +119,12 @@ DateTimeDisplayer::DateTimeDisplayer(bool showMultiRow, QWidget *parent)
|
||||
m_shortTimeFormatStr = m_config->value(key).toString();
|
||||
} else if (key == localeName_key) {
|
||||
m_locale = QLocale(m_config->value(key).toString());
|
||||
} else if (key == longDateFormat_key) {
|
||||
m_longDateFormatStr = m_config->value(key).toString();
|
||||
} else if (key == longTimeFormat_key) {
|
||||
m_longTimeFormatStr = m_config->value(key).toString();
|
||||
}
|
||||
|
||||
update();
|
||||
});
|
||||
}
|
||||
@ -163,10 +198,10 @@ void DateTimeDisplayer::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
DDBusSender().service("org.deepin.dde.Widgets1")
|
||||
.path("/org/deepin/dde/Widgets1")
|
||||
.interface("org.deepin.dde.Widgets1")
|
||||
.method("Toggle").call();
|
||||
DDBusSender().service("com.deepin.Calendar")
|
||||
.path("/com/deepin/Calendar")
|
||||
.interface("com.deepin.Calendar")
|
||||
.method("RaiseWindow").call();
|
||||
}
|
||||
|
||||
QString DateTimeDisplayer::getTimeString(const Dock::Position &position) const
|
||||
@ -176,12 +211,6 @@ QString DateTimeDisplayer::getTimeString(const Dock::Position &position) const
|
||||
tFormat = timeFormat[m_shortDateFormat];
|
||||
if (!m_shortTimeFormatStr.isEmpty())
|
||||
tFormat = m_shortTimeFormatStr;
|
||||
if (!m_use24HourFormat) {
|
||||
if (position == Dock::Top || position == Dock::Bottom)
|
||||
tFormat = tFormat.append(" AP");
|
||||
else
|
||||
tFormat = tFormat.append("\nAP");
|
||||
}
|
||||
|
||||
return m_locale.toString(QDateTime::currentDateTime(), tFormat);
|
||||
}
|
||||
@ -266,12 +295,7 @@ DateTimeDisplayer::DateTimeInfo DateTimeDisplayer::dateTimeInfo(const Dock::Posi
|
||||
|
||||
void DateTimeDisplayer::onTimeChanged()
|
||||
{
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
|
||||
if (m_use24HourFormat)
|
||||
m_tipsWidget->setText(QLocale().toString(currentDateTime.date()) + currentDateTime.toString(" HH:mm:ss"));
|
||||
else
|
||||
m_tipsWidget->setText(QLocale().toString(currentDateTime.date()) + currentDateTime.toString(" hh:mm:ss AP"));
|
||||
m_tipsWidget->setText(m_locale.toString(QDate::currentDate(), m_longDateFormatStr) + QString(" ") + m_locale.toString(QTime::currentTime(), m_longTimeFormatStr));
|
||||
|
||||
// 如果时间和日期有一个不等,则实时刷新界面
|
||||
if (m_lastDateString != getDateString() || m_lastTimeString != getTimeString())
|
||||
@ -281,7 +305,6 @@ void DateTimeDisplayer::onTimeChanged()
|
||||
void DateTimeDisplayer::onDateTimeFormatChanged()
|
||||
{
|
||||
m_shortDateFormat = m_timedateInter->shortDateFormat();
|
||||
m_use24HourFormat = m_timedateInter->use24HourFormat();
|
||||
// 此处需要强制重绘,因为在重绘过程中才会改变m_currentSize信息,方便在后面判断是否需要调整尺寸
|
||||
repaint();
|
||||
}
|
||||
@ -294,7 +317,6 @@ void DateTimeDisplayer::paintEvent(QPaintEvent *e)
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
|
||||
int timeAlignFlag = Qt::AlignCenter;
|
||||
int dateAlignFlag = Qt::AlignCenter;
|
||||
@ -377,17 +399,6 @@ void DateTimeDisplayer::updateFont() const
|
||||
|
||||
void DateTimeDisplayer::createMenuItem()
|
||||
{
|
||||
QAction *timeFormatAction = new QAction(this);
|
||||
timeFormatAction->setText(m_use24HourFormat ? tr("12-hour time"): tr("24-hour time"));
|
||||
|
||||
connect(timeFormatAction, &QAction::triggered, this, [ = ] {
|
||||
bool use24hourformat = !m_use24HourFormat;
|
||||
// 此时调用 dbus 更新时间格式但是本地 m_use24HourFormat 未更新,所以需要使用新变量,设置新格式
|
||||
m_timedateInter->setUse24HourFormat(use24hourformat);
|
||||
timeFormatAction->setText(use24hourformat ? tr("12-hour time") : tr("24-hour time"));
|
||||
});
|
||||
m_menu->addAction(timeFormatAction);
|
||||
|
||||
if (!QFile::exists(ICBC_CONF_FILE)) {
|
||||
QAction *timeSettingAction = new QAction(tr("Time settings"), this);
|
||||
connect(timeSettingAction, &QAction::triggered, this, [ = ] {
|
||||
|
@ -72,6 +72,7 @@ private:
|
||||
|
||||
void createMenuItem();
|
||||
QRect textRect(const QRect &sourceRect) const;
|
||||
void initDConfig();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onTimeChanged();
|
||||
@ -92,10 +93,11 @@ private:
|
||||
bool m_oneRow;
|
||||
bool m_showMultiRow;
|
||||
int m_shortDateFormat;
|
||||
bool m_use24HourFormat;
|
||||
DTK_CORE_NAMESPACE::DConfig *m_config;
|
||||
QString m_shortDateFormatStr;
|
||||
QString m_shortTimeFormatStr;
|
||||
QString m_longDateFormatStr;
|
||||
QString m_longTimeFormatStr;
|
||||
QLocale m_locale;
|
||||
};
|
||||
|
||||
|
@ -1097,7 +1097,7 @@ int MainPanelControl::trayAreaSize(qreal ratio) const
|
||||
length += (m_position == Dock::Position::Top || m_position == Dock::Position::Bottom ? topWindow->width() * ratio : topWindow->height() * ratio);
|
||||
}
|
||||
|
||||
length += topWindow->dockSpace() * ratio;
|
||||
length += topWindow->dockSpace();
|
||||
}
|
||||
|
||||
return length;
|
||||
|
@ -4,6 +4,7 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "mainwindowbase.h"
|
||||
#include "constants.h"
|
||||
#include "dragwidget.h"
|
||||
#include "multiscreenworker.h"
|
||||
#include "dockscreen.h"
|
||||
@ -270,27 +271,30 @@ void MainWindowBase::resetDragWindow()
|
||||
if (!screen)
|
||||
return;
|
||||
|
||||
QRect currentRect = getDockGeometry(screen, position(), displayMode(), Dock::HideState::Show);
|
||||
if (m_multiScreenWorker->hideState() == Dock::HideState::Show) {
|
||||
QRect currentRect = getDockGeometry(screen, position(), displayMode(), Dock::HideState::Show);
|
||||
|
||||
// 这个时候屏幕有可能是隐藏的,不能直接使用this->width()这种去设置任务栏的高度,而应该保证原值
|
||||
int dockSize = 0;
|
||||
if (m_multiScreenWorker->position() == Position::Left
|
||||
|| m_multiScreenWorker->position() == Position::Right) {
|
||||
dockSize = this->width() == 0 ? currentRect.width() : this->width();
|
||||
} else {
|
||||
dockSize = this->height() == 0 ? currentRect.height() : this->height();
|
||||
// 这个时候屏幕有可能是隐藏的,不能直接使用this->width()这种去设置任务栏的高度,而应该保证原值
|
||||
int dockSize = 0;
|
||||
if (m_multiScreenWorker->position() == Position::Left
|
||||
|| m_multiScreenWorker->position() == Position::Right) {
|
||||
dockSize = this->width() == 0 ? currentRect.width() : this->width();
|
||||
} else {
|
||||
dockSize = this->height() == 0 ? currentRect.height() : this->height();
|
||||
}
|
||||
|
||||
/** FIX ME
|
||||
* 作用:限制dockSize的值在40~100之间。
|
||||
* 问题1:如果dockSize为39,会导致dock的mainwindow高度变成99,显示的内容高度却是39。
|
||||
* 问题2:dockSize的值在这里不应该为39,但在高分屏上开启缩放后,拉高任务栏操作会概率出现。
|
||||
* 暂时未分析出原因,后面再修改。
|
||||
*/
|
||||
dockSize = qBound(DOCK_MIN_SIZE, dockSize, DOCK_MAX_SIZE);
|
||||
|
||||
// 通知窗管和后端更新数据
|
||||
m_multiScreenWorker->updateDaemonDockSize(dockSize); // 1.先更新任务栏高度
|
||||
}
|
||||
|
||||
/** FIX ME
|
||||
* 作用:限制dockSize的值在40~100之间。
|
||||
* 问题1:如果dockSize为39,会导致dock的mainwindow高度变成99,显示的内容高度却是39。
|
||||
* 问题2:dockSize的值在这里不应该为39,但在高分屏上开启缩放后,拉高任务栏操作会概率出现。
|
||||
* 暂时未分析出原因,后面再修改。
|
||||
*/
|
||||
dockSize = qBound(DOCK_MIN_SIZE, dockSize, DOCK_MAX_SIZE);
|
||||
|
||||
// 通知窗管和后端更新数据
|
||||
m_multiScreenWorker->updateDaemonDockSize(dockSize); // 1.先更新任务栏高度
|
||||
m_multiScreenWorker->requestUpdateFrontendGeometry(); // 2.再更新任务栏位置,保证先1再2
|
||||
m_multiScreenWorker->requestNotifyWindowManager();
|
||||
m_multiScreenWorker->requestUpdateRegionMonitor(); // 界面发生变化,应更新监控区域
|
||||
@ -427,9 +431,9 @@ QRect MainWindowBase::getDockGeometry(QScreen *screen, const Dock::Position &pos
|
||||
}
|
||||
int y = 0;
|
||||
if (pos == Dock::Position::Top)
|
||||
y = (screenRect.y() + static_cast<int>(margin / ratio));
|
||||
y = (screenRect.y() + static_cast<int>(margin));
|
||||
else
|
||||
y = (screenRect.y() + static_cast<int>(screenRect.height() / ratio - margin / ratio)) - dockSize;
|
||||
y = (screenRect.y() + static_cast<int>(screenRect.height() / ratio - margin)) - dockSize;
|
||||
rect.setX(x);
|
||||
rect.setY(y);
|
||||
rect.setWidth(width);
|
||||
@ -447,9 +451,9 @@ QRect MainWindowBase::getDockGeometry(QScreen *screen, const Dock::Position &pos
|
||||
}
|
||||
int x = 0;
|
||||
if (pos == Dock::Position::Left)
|
||||
x = screenRect.x() + static_cast<int>(margin / ratio);
|
||||
x = screenRect.x() + static_cast<int>(margin);
|
||||
else
|
||||
x = screenRect.x() + static_cast<int>(screenRect.width() /ratio - margin / ratio) - dockSize;
|
||||
x = screenRect.x() + static_cast<int>(screenRect.width() /ratio - margin) - dockSize;
|
||||
|
||||
int y = screenRect.y() + static_cast<int>(((screenRect.height() / ratio) - totalSize) / 2);
|
||||
// 计算y坐标
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QMenu>
|
||||
#include <QDragLeaveEvent>
|
||||
#include <algorithm>
|
||||
#include <QSize>
|
||||
|
||||
#define ITEMSIZE 22
|
||||
#define STARTSPACE 6
|
||||
@ -434,6 +436,7 @@ void QuickPluginWindow::onUpdatePlugin(PluginsItemInterface *itemInter, const Do
|
||||
|
||||
QuickDockItem *quickDockItem = getDockItemByPlugin(itemInter);
|
||||
if (quickDockItem) {
|
||||
quickDockItem->updateContextMenu();
|
||||
updateDockItemSize(quickDockItem);
|
||||
quickDockItem->update();
|
||||
}
|
||||
@ -706,7 +709,12 @@ void QuickDockItem::setPosition(Dock::Position position)
|
||||
if (m_mainLayout) {
|
||||
QWidget *itemWidget = m_pluginItem->itemWidget(m_itemKey);
|
||||
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
|
||||
itemWidget->setFixedSize(suitableSize());
|
||||
auto size= suitableSize();
|
||||
if (pluginItem()->pluginName() == QStringLiteral("uosai")) {
|
||||
auto minSize = std::min(size.height(), size.width());
|
||||
size = QSize(minSize, minSize);
|
||||
}
|
||||
itemWidget->setFixedSize(size);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -829,29 +837,12 @@ void QuickDockItem::mousePressEvent(QMouseEvent *event)
|
||||
return QWidget::mousePressEvent(event);
|
||||
|
||||
if (m_contextMenu->actions().isEmpty()) {
|
||||
const QString menuJson = m_pluginItem->itemContextMenu(m_itemKey);
|
||||
if (menuJson.isEmpty())
|
||||
return;
|
||||
|
||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(menuJson.toLocal8Bit().data());
|
||||
if (jsonDocument.isNull())
|
||||
return;
|
||||
|
||||
QJsonObject jsonMenu = jsonDocument.object();
|
||||
|
||||
QJsonArray jsonMenuItems = jsonMenu.value("items").toArray();
|
||||
for (auto item : jsonMenuItems) {
|
||||
QJsonObject itemObj = item.toObject();
|
||||
QAction *action = new QAction(itemObj.value("itemText").toString());
|
||||
action->setCheckable(itemObj.value("isCheckable").toBool());
|
||||
action->setChecked(itemObj.value("checked").toBool());
|
||||
action->setData(itemObj.value("itemId").toString());
|
||||
action->setEnabled(itemObj.value("isActive").toBool());
|
||||
m_contextMenu->addAction(action);
|
||||
}
|
||||
updateContextMenu();
|
||||
}
|
||||
|
||||
m_contextMenu->exec(QCursor::pos());
|
||||
if (!m_contextMenu->actions().isEmpty()) {
|
||||
m_contextMenu->exec(QCursor::pos());
|
||||
}
|
||||
}
|
||||
|
||||
void QuickDockItem::enterEvent(QEvent *event)
|
||||
@ -893,7 +884,13 @@ void QuickDockItem::showEvent(QShowEvent *event)
|
||||
QWidget *itemWidget = m_pluginItem->itemWidget(m_itemKey);
|
||||
if (itemWidget && m_mainLayout->indexOf(itemWidget) < 0) {
|
||||
itemWidget->show();
|
||||
itemWidget->setFixedSize(suitableSize());
|
||||
auto size= suitableSize();
|
||||
if (pluginItem()->pluginName() == QStringLiteral("uosai")) {
|
||||
auto minSize = std::min(size.height(), size.width());
|
||||
size = QSize(minSize, minSize);
|
||||
}
|
||||
itemWidget->setFixedSize(size);
|
||||
itemWidget->setFixedSize(size);
|
||||
m_mainLayout->addWidget(itemWidget);
|
||||
}
|
||||
}
|
||||
@ -1017,6 +1014,31 @@ int QuickDockItem::iconSize() const
|
||||
return 30;
|
||||
}
|
||||
|
||||
void QuickDockItem::updateContextMenu()
|
||||
{
|
||||
m_contextMenu->clear();
|
||||
const QString menuJson = m_pluginItem->itemContextMenu(m_itemKey);
|
||||
if (menuJson.isEmpty())
|
||||
return;
|
||||
|
||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(menuJson.toLocal8Bit().data());
|
||||
if (jsonDocument.isNull())
|
||||
return;
|
||||
|
||||
QJsonObject jsonMenu = jsonDocument.object();
|
||||
|
||||
QJsonArray jsonMenuItems = jsonMenu.value("items").toArray();
|
||||
for (auto item : jsonMenuItems) {
|
||||
QJsonObject itemObj = item.toObject();
|
||||
QAction *action = new QAction(itemObj.value("itemText").toString());
|
||||
action->setCheckable(itemObj.value("isCheckable").toBool());
|
||||
action->setChecked(itemObj.value("checked").toBool());
|
||||
action->setData(itemObj.value("itemId").toString());
|
||||
action->setEnabled(itemObj.value("isActive").toBool());
|
||||
m_contextMenu->addAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
QPoint QuickDockItem::topleftPoint() const
|
||||
{
|
||||
QPoint p = this->pos();
|
||||
@ -1068,5 +1090,5 @@ QPoint QuickDockItem::popupMarkPoint() const
|
||||
|
||||
void QuickDockItem::onMenuActionClicked(QAction *action)
|
||||
{
|
||||
m_pluginItem->invokedMenuItem(m_itemKey, action->data().toString(), true);
|
||||
m_pluginItem->invokedMenuItem(m_itemKey, action->data().toString(), action->isCheckable() ? action->isChecked() : true);
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ public:
|
||||
bool canInsert() const;
|
||||
bool canMove() const;
|
||||
void hideToolTip();
|
||||
void updateContextMenu();
|
||||
|
||||
QSize suitableSize() const;
|
||||
|
||||
|
@ -575,15 +575,13 @@ void TrayModel::onSniTrayRemoved(const QString &servicePath)
|
||||
|
||||
// 如果为输入法,则无需立刻删除,等100毫秒后再观察是否会删除输入法(因为在100毫秒内如果是切换输入法,就会很快发送add信号)
|
||||
if (info.isTypeWriting) {
|
||||
QTimer::singleShot(100, this, [ servicePath, this ] {
|
||||
for (WinInfo info : m_winInfos) {
|
||||
if (info.servicePath == servicePath) {
|
||||
int index = m_winInfos.indexOf(info);
|
||||
beginRemoveRows(QModelIndex(), index, index);
|
||||
m_winInfos.removeOne(info);
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
QTimer::singleShot(100, this, [ info, this ] {
|
||||
int index = m_winInfos.indexOf(info);
|
||||
beginRemoveRows(QModelIndex(), index, index);
|
||||
m_winInfos.removeOne(info);
|
||||
endRemoveRows();
|
||||
|
||||
Q_EMIT rowCountChanged();
|
||||
});
|
||||
} else {
|
||||
beginRemoveRows(QModelIndex(), index, index);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "tray_monitor.h"
|
||||
#include "quicksettingcontroller.h"
|
||||
#include "pluginsiteminterface.h"
|
||||
#include "utils.h"
|
||||
|
||||
TrayMonitor::TrayMonitor(QObject *parent)
|
||||
: QObject(parent)
|
||||
@ -110,6 +111,12 @@ void TrayMonitor::onSniItemsChanged()
|
||||
qWarning() << __FUNCTION__ << "invalid sni service" << s;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Utils::IS_WAYLAND_DISPLAY && s.contains("/org/ayatana/NotificationItem/")) {
|
||||
qDebug() << "SNI service path created by libayatana-appindicator, duplicate tray with legacy tray";
|
||||
continue;
|
||||
}
|
||||
|
||||
Q_EMIT sniTrayAdded(s);
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
BaseTrayWidget::BaseTrayWidget(QWidget *parent, Qt::WindowFlags f)
|
||||
: QWidget(parent, f)
|
||||
, m_handleMouseReleaseTimer(new QTimer(this))
|
||||
, m_ownerPID(0)
|
||||
, m_needShow(true)
|
||||
{
|
||||
m_handleMouseReleaseTimer->setSingleShot(true);
|
||||
@ -116,11 +115,6 @@ void BaseTrayWidget::resizeEvent(QResizeEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
uint BaseTrayWidget::getOwnerPID()
|
||||
{
|
||||
return this->m_ownerPID;
|
||||
}
|
||||
|
||||
bool BaseTrayWidget::needShow()
|
||||
{
|
||||
return m_needShow;
|
||||
@ -139,8 +133,3 @@ void BaseTrayWidget::setNeedShow(bool needShow)
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void BaseTrayWidget::setOwnerPID(uint PID)
|
||||
{
|
||||
this->m_ownerPID = PID;
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
virtual void sendClick(uint8_t mouseButton, int x, int y) = 0;
|
||||
virtual inline TrayType trayType() const { return TrayType::ApplicationTray; } // default is ApplicationTray
|
||||
virtual bool isValid() {return true;}
|
||||
uint getOwnerPID();
|
||||
virtual bool needShow();
|
||||
virtual void setNeedShow(bool needShow);
|
||||
virtual QPixmap icon() = 0;
|
||||
@ -48,14 +47,12 @@ protected:
|
||||
void handleMouseRelease();
|
||||
const QRect perfectIconRect() const;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void setOwnerPID(uint PID);
|
||||
|
||||
private:
|
||||
QTimer *m_handleMouseReleaseTimer;
|
||||
|
||||
QPair<QPoint, Qt::MouseButton> m_lastMouseReleaseData;
|
||||
|
||||
uint m_ownerPID;
|
||||
bool m_needShow;
|
||||
};
|
||||
|
||||
|
@ -135,7 +135,7 @@ TrayGridWidget *ExpandIconWidget::popupTrayView()
|
||||
TrayModel *trayModel = TrayModel::getIconModel();
|
||||
gridParentView->setTrayGridView(trayView);
|
||||
|
||||
gridParentView->setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus);
|
||||
gridParentView->setWindowFlags(Qt::WindowDoesNotAcceptFocus);
|
||||
trayView->setModel(trayModel);
|
||||
trayView->setItemDelegate(trayDelegate);
|
||||
trayView->setSpacing(ITEM_SPACING);
|
||||
|
@ -73,7 +73,6 @@ SNITrayItemWidget::SNITrayItemWidget(const QString &sniServicePath, QWidget *par
|
||||
m_dbusPath = pair.second;
|
||||
|
||||
QDBusConnection conn = QDBusConnection::sessionBus();
|
||||
setOwnerPID(conn.interface()->servicePid(m_dbusService));
|
||||
|
||||
m_sniInter = new StatusNotifierItem(m_dbusService, m_dbusPath, QDBusConnection::sessionBus(), this);
|
||||
m_sniInter->setSync(false);
|
||||
|
@ -76,7 +76,6 @@ XEmbedTrayItemWidget::XEmbedTrayItemWidget(quint32 winId, xcb_connection_t *cnn,
|
||||
, m_display(disp)
|
||||
{
|
||||
wrapWindow();
|
||||
setOwnerPID(getWindowPID(winId));
|
||||
|
||||
m_updateTimer = new QTimer(this);
|
||||
m_updateTimer->setInterval(100);
|
||||
@ -521,32 +520,3 @@ bool XEmbedTrayItemWidget::isBadWindow()
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
uint XEmbedTrayItemWidget::getWindowPID(uint winId)
|
||||
{
|
||||
const auto display = IS_WAYLAND_DISPLAY ? XOpenDisplay(nullptr) : QX11Info::display();
|
||||
if (!display) {
|
||||
qWarning() << "QX11Info::connection() is " << display;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Atom nameAtom = XInternAtom(display, "_NET_WM_PID", 1);
|
||||
Atom type;
|
||||
int format, status;
|
||||
|
||||
unsigned long nitems, after;
|
||||
unsigned char *data;
|
||||
unsigned int pid = 0;
|
||||
|
||||
status = XGetWindowProperty(display, winId, nameAtom, 0, 1024, 0,
|
||||
XInternAtom(display, "CARDINAL", 0), &type, &format, &nitems, &after, &data);
|
||||
if (status == Success && data) {
|
||||
pid = *((uint*)data);
|
||||
XFree(data);
|
||||
}
|
||||
|
||||
if (IS_WAYLAND_DISPLAY)
|
||||
XCloseDisplay(display);
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
void sendClick(uint8_t mouseButton, int x, int y) override;
|
||||
|
||||
static QString toXEmbedKey(quint32 winId);
|
||||
static uint getWindowPID(quint32 winId);
|
||||
static bool isXEmbedKey(const QString &itemKey);
|
||||
virtual bool isValid() override {return m_valid;}
|
||||
QPixmap icon() override;
|
||||
|
@ -393,9 +393,8 @@ void TrayManagerWindow::resetChildWidgetSize()
|
||||
int dateTimeHeight = m_appPluginDatetimeWidget->height() - - m.top() - m.bottom() - trayHeight;
|
||||
m_dateTimeWidget->setFixedSize(dateTimeWidth, dateTimeHeight);
|
||||
m_systemPluginWidget->setFixedSize(m_systemPluginWidget->suitableSize());
|
||||
int contentSpace = qMin(MAXDIFF, qMax(((Utils::isDraging() ? height() : (int)m_windowFashionSize) - MINHIGHT), 0)) + MINSPACE;
|
||||
m_mainLayout->setContentsMargins(contentSpace, contentSpace, contentSpace, contentSpace);
|
||||
m_mainLayout->setSpacing(contentSpace);
|
||||
m_mainLayout->setContentsMargins(SINGLEROWSPACE, SINGLEROWSPACE, SINGLEROWSPACE, SINGLEROWSPACE);
|
||||
m_mainLayout->setSpacing(SINGLEROWSPACE);
|
||||
|
||||
// 调整插件和日期窗体的位置显示,这里没有用到布局,是因为在调整任务栏位置的时候,
|
||||
// 随着布局方向的改变,显示有很大的问题
|
||||
@ -537,8 +536,8 @@ void TrayManagerWindow::paintEvent(QPaintEvent *event)
|
||||
painter.save();
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setClipPath(path);
|
||||
painter.fillRect(rect().adjusted(1, 1, -1, -1), maskColor(102));
|
||||
painter.setPen(maskColor(110));
|
||||
painter.fillRect(rect().adjusted(1, 1, -1, -1), maskColor(255 * 0.1));
|
||||
painter.setPen(maskColor(255 * 0.15));
|
||||
painter.drawPath(path);
|
||||
painter.restore();
|
||||
|
||||
|
@ -816,7 +816,7 @@ void WindowManager::onRequestNotifyWindowManager()
|
||||
}
|
||||
|
||||
XcbMisc::instance()->set_strut_partial(static_cast<xcb_window_t>(mainWindow->winId()), orientation,
|
||||
static_cast<uint>(strut + WINDOWMARGIN * ratio), // 设置窗口与屏幕边缘距离,需要乘缩放
|
||||
static_cast<uint>(strut), // 设置窗口与屏幕边缘距离,需要乘缩放
|
||||
static_cast<uint>(strutStart), // 设置任务栏起点坐标(上下为x,左右为y)
|
||||
static_cast<uint>(strutEnd)); // 设置任务栏终点坐标(上下为x,左右为y)
|
||||
}
|
||||
|
@ -12,3 +12,4 @@ add_subdirectory("show-desktop")
|
||||
add_subdirectory("multitasking")
|
||||
add_subdirectory("bluetooth")
|
||||
add_subdirectory("airplane-mode")
|
||||
add_subdirectory("notification")
|
||||
|
@ -24,7 +24,7 @@ DWIDGET_USE_NAMESPACE
|
||||
BluetoothMainWidget::BluetoothMainWidget(AdaptersManager *adapterManager, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_adapterManager(adapterManager)
|
||||
, m_iconWidget(new QWidget(this))
|
||||
, m_iconButton(new DIconButton(this))
|
||||
, m_nameLabel(new QLabel(this))
|
||||
, m_stateLabel(new QLabel(this))
|
||||
, m_expandLabel(new QLabel(this))
|
||||
@ -40,63 +40,7 @@ BluetoothMainWidget::~BluetoothMainWidget()
|
||||
|
||||
bool BluetoothMainWidget::eventFilter(QObject *watcher, QEvent *event)
|
||||
{
|
||||
if (watcher == m_iconWidget) {
|
||||
switch (event->type()) {
|
||||
case QEvent::Paint: {
|
||||
QPainter painter(m_iconWidget);
|
||||
// 在区域最中间绘制
|
||||
QRect iconRect = m_iconWidget->rect();
|
||||
int size = qMin(iconRect.height(), iconRect.width());
|
||||
QPoint ptCenter(iconRect.center());
|
||||
painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
||||
// 填充原型路径
|
||||
QPainterPath path;
|
||||
path.addEllipse(ptCenter, size / 2 - 1, size / 2 - 1);
|
||||
// 设置黑色背景色
|
||||
QColor backColor = (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::ColorType::LightType ? Qt::black : Qt::white);
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::ColorType::LightType)
|
||||
backColor.setAlphaF(m_mouseEnter ? 0.2 : 0.1);
|
||||
else
|
||||
backColor.setAlphaF(m_mouseEnter ? 0.1 : 0.2);
|
||||
painter.setBrush(backColor);
|
||||
painter.fillPath(path, backColor);
|
||||
// 添加图标
|
||||
bool blueStatus = isOpen();
|
||||
QPixmap pixmap(bluetoothIcon(blueStatus));
|
||||
if (blueStatus) {
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), qApp->palette().highlight());
|
||||
}
|
||||
painter.drawPixmap(QPoint(ptCenter.x() - pixmap.size().width() / 2, ptCenter.y() - pixmap.size().height() / 2), pixmap);
|
||||
return true;
|
||||
}
|
||||
case QEvent::Enter: {
|
||||
m_mouseEnter = true;
|
||||
m_iconWidget->update();
|
||||
break;
|
||||
}
|
||||
case QEvent::Leave: {
|
||||
m_mouseEnter = false;
|
||||
m_iconWidget->update();
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseButtonRelease: {
|
||||
QMouseEvent *mouseevent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseevent->button() != Qt::LeftButton) {
|
||||
return QWidget::eventFilter(watcher, event);
|
||||
}
|
||||
bool status = !(isOpen());
|
||||
for (const Adapter *adapter : m_adapterManager->adapters())
|
||||
m_adapterManager->setAdapterPowered(adapter, status);
|
||||
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (watcher == m_expandLabel && event->type() == QEvent::MouseButtonRelease) {
|
||||
if (watcher != m_iconButton && event->type() == QEvent::MouseButtonRelease) {
|
||||
Q_EMIT requestExpand();
|
||||
return true;
|
||||
}
|
||||
@ -106,6 +50,9 @@ bool BluetoothMainWidget::eventFilter(QObject *watcher, QEvent *event)
|
||||
if (watcher == m_stateLabel && event->type() == QEvent::Resize) {
|
||||
m_stateLabel->setText(QFontMetrics(m_stateLabel->font()).elidedText(m_stateLabel->text(), Qt::TextElideMode::ElideRight, m_stateLabel->width()));
|
||||
}
|
||||
if (watcher == m_iconButton && event->type() == QEvent::PaletteChange) {
|
||||
onPaletteChanged();
|
||||
}
|
||||
return QWidget::eventFilter(watcher, event);
|
||||
}
|
||||
|
||||
@ -113,7 +60,15 @@ void BluetoothMainWidget::initUi()
|
||||
{
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout(this);
|
||||
// 添加左侧的图标
|
||||
m_iconWidget->setFixedWidth(36);
|
||||
m_iconButton->setEnabledCircle(true);
|
||||
m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_iconButton->setFocusPolicy(Qt::FocusPolicy::TabFocus);
|
||||
m_iconButton->setIconSize({24, 24});
|
||||
m_iconButton->setIcon(QIcon::fromTheme("bluetooth"));
|
||||
m_iconButton->setCheckable(true);
|
||||
m_iconButton->setChecked(isOpen());
|
||||
onPaletteChanged();
|
||||
|
||||
// 添加中间的文本
|
||||
QWidget *textWidget = new QWidget(this);
|
||||
QVBoxLayout *textLayout = new QVBoxLayout(textWidget);
|
||||
@ -146,15 +101,15 @@ void BluetoothMainWidget::initUi()
|
||||
// 将所有的窗体都添加到主布局中
|
||||
mainLayout->setContentsMargins(10, 0, 10, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->addWidget(m_iconWidget);
|
||||
mainLayout->addWidget(m_iconButton);
|
||||
mainLayout->addSpacing(10);
|
||||
mainLayout->addWidget(textWidget);
|
||||
mainLayout->addStretch();
|
||||
mainLayout->addWidget(expandWidget);
|
||||
|
||||
m_iconWidget->installEventFilter(this);
|
||||
m_expandLabel->installEventFilter(this);
|
||||
m_nameLabel->installEventFilter(this);
|
||||
m_iconButton->installEventFilter(this);
|
||||
}
|
||||
|
||||
void BluetoothMainWidget::initConnection()
|
||||
@ -168,6 +123,12 @@ void BluetoothMainWidget::initConnection()
|
||||
for (const Adapter *adapter : m_adapterManager->adapters())
|
||||
connect(adapter, &Adapter::poweredChanged, this, &BluetoothMainWidget::onAdapterChanged);
|
||||
|
||||
connect(m_iconButton, &DIconButton::clicked, this, [this](){
|
||||
bool status = !(isOpen());
|
||||
for (const Adapter *adapter : m_adapterManager->adapters())
|
||||
m_adapterManager->setAdapterPowered(adapter, status);
|
||||
});
|
||||
|
||||
onAdapterChanged();
|
||||
}
|
||||
|
||||
@ -202,5 +163,16 @@ void BluetoothMainWidget::onAdapterChanged()
|
||||
const QString& text = bluetoothIsOpen ? tr("Turn on") : tr("Turn off");
|
||||
QFontMetrics fmt{m_stateLabel->font()};
|
||||
m_stateLabel->setText(fmt.elidedText(text, Qt::TextElideMode::ElideRight,m_stateLabel->width()));
|
||||
m_iconWidget->update();
|
||||
m_iconButton->setChecked(bluetoothIsOpen);
|
||||
}
|
||||
|
||||
void BluetoothMainWidget::onPaletteChanged()
|
||||
{
|
||||
if (!m_iconButton)
|
||||
return;
|
||||
|
||||
auto pa = m_iconButton->palette();
|
||||
pa.setColor(QPalette::HighlightedText, pa.color(QPalette::Highlight));
|
||||
m_iconButton->setPalette(pa);
|
||||
m_iconButton->update();
|
||||
}
|
||||
|
@ -6,12 +6,16 @@
|
||||
#ifndef BLUETOOTHMAINWIDGET_H
|
||||
#define BLUETOOTHMAINWIDGET_H
|
||||
|
||||
#include <DIconButton>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class AdaptersManager;
|
||||
class QLabel;
|
||||
class Adapter;
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class BluetoothMainWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -37,10 +41,11 @@ private:
|
||||
|
||||
private Q_SLOTS:
|
||||
void onAdapterChanged();
|
||||
void onPaletteChanged();
|
||||
|
||||
private:
|
||||
AdaptersManager *m_adapterManager;
|
||||
QWidget *m_iconWidget;
|
||||
DIconButton *m_iconButton;
|
||||
QLabel *m_nameLabel;
|
||||
QLabel *m_stateLabel;
|
||||
QLabel *m_expandLabel;
|
||||
|
@ -237,6 +237,10 @@ void BluetoothAdapterItem::updateIconTheme(DGuiApplicationHelper::ColorType type
|
||||
|
||||
QSize BluetoothAdapterItem::sizeHint() const
|
||||
{
|
||||
// 没有 item 就不去做一些无效的计算了,包括分割线的高度
|
||||
if (m_deviceListview->count() < 1)
|
||||
return QSize(ItemWidth, m_adapterLabel->height());
|
||||
|
||||
int visualHeight = 0;
|
||||
for (int i = 0; i < m_deviceListview->count(); i++)
|
||||
visualHeight += m_deviceListview->visualRect(m_deviceModel->index(i, 0)).height();
|
||||
@ -276,6 +280,10 @@ void BluetoothAdapterItem::initData()
|
||||
|
||||
void BluetoothAdapterItem::onDeviceAdded(const Device *device)
|
||||
{
|
||||
// 关闭蓝牙设备时,不再响应上一个扫描操作的新增的 device
|
||||
if (!m_adapterStateBtn->isChecked())
|
||||
return;
|
||||
|
||||
int insertRow = 0;
|
||||
foreach (const auto item, m_deviceItems) {
|
||||
if (item->device()->connectState()) {
|
||||
|
@ -46,5 +46,7 @@
|
||||
<file>light/icons/battery-090-symbolic_20px.svg</file>
|
||||
<file>light/icons/battery-100-symbolic_20px.svg</file>
|
||||
<file>light/icons/battery-unknow-symbolic_20px.svg</file>
|
||||
<file alias="light/texts/bluetooth_16px.svg">light/buletooth_other_light.svg</file>
|
||||
<file alias="dark/texts/bluetooth_16px.svg">dark/buletooth_other_dark.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -1,267 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "collaborationdevmodel.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
#include <QDBusArgument>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusPendingCall>
|
||||
#include <QDBusServiceWatcher>
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
static const QString CollaborationService = "org.deepin.dde.Cooperation1";
|
||||
static const QString CollaborationPath = "/org/deepin/dde/Cooperation1";
|
||||
static const QString CollaborationInterface = "org.deepin.dde.Cooperation1";
|
||||
static const QString ColPropertiesInterface = "org.freedesktop.DBus.Properties";
|
||||
|
||||
CollaborationDevModel::CollaborationDevModel(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_colDbusInter(new QDBusInterface(CollaborationService, CollaborationPath, CollaborationInterface, QDBusConnection::sessionBus(), this))
|
||||
{
|
||||
if (m_colDbusInter->isValid()) {
|
||||
QList<QDBusObjectPath> paths = m_colDbusInter->property("Machines").value<QList<QDBusObjectPath>>();
|
||||
for (const QDBusObjectPath& path : paths) {
|
||||
CollaborationDevice *device = new CollaborationDevice(path.path(), this);
|
||||
if (device->isValid())
|
||||
m_devices[path.path()] = device;
|
||||
else
|
||||
device->deleteLater();
|
||||
}
|
||||
} else {
|
||||
qWarning() << CollaborationService << " is invalid";
|
||||
}
|
||||
|
||||
m_colDbusInter->connection().connect(CollaborationService, CollaborationPath, ColPropertiesInterface,
|
||||
"PropertiesChanged", "sa{sv}as", this, SLOT(onPropertyChanged(QDBusMessage)));
|
||||
|
||||
auto *dbusWatcher = new QDBusServiceWatcher(CollaborationService, m_colDbusInter->connection(),
|
||||
QDBusServiceWatcher::WatchForUnregistration, this);
|
||||
connect(dbusWatcher, &QDBusServiceWatcher::serviceUnregistered, this, [this](){
|
||||
qWarning() << CollaborationService << "unregistered";
|
||||
clear();
|
||||
});
|
||||
}
|
||||
|
||||
void CollaborationDevModel::checkServiceValid()
|
||||
{
|
||||
if (!m_colDbusInter->isValid()) {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
QList<CollaborationDevice *> CollaborationDevModel::devices() const
|
||||
{
|
||||
return m_devices.values();
|
||||
}
|
||||
|
||||
void CollaborationDevModel::onPropertyChanged(const QDBusMessage &msg)
|
||||
{
|
||||
QList<QVariant> arguments = msg.arguments();
|
||||
if (3 != arguments.count())
|
||||
return;
|
||||
|
||||
QString interfaceName = msg.arguments().at(0).toString();
|
||||
if (interfaceName != CollaborationInterface)
|
||||
return;
|
||||
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
if (changedProps.contains("Machines")) {
|
||||
QList<QDBusObjectPath> paths = m_colDbusInter->property("Machines").value<QList<QDBusObjectPath>>();
|
||||
QStringList devPaths;
|
||||
for (const QDBusObjectPath& path : paths) {
|
||||
devPaths << path.path();
|
||||
}
|
||||
updateDevice(devPaths);
|
||||
}
|
||||
}
|
||||
|
||||
void CollaborationDevModel::updateDevice(const QStringList &devPaths)
|
||||
{
|
||||
if (devPaths.isEmpty()) {
|
||||
qDeleteAll(m_devices);
|
||||
m_devices.clear();
|
||||
} else {
|
||||
// 清除已不存在的设备
|
||||
QMapIterator<QString, CollaborationDevice *> it(m_devices);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (!devPaths.contains(it.key())) {
|
||||
it.value()->deleteLater();
|
||||
m_devices.remove(it.key());
|
||||
}
|
||||
}
|
||||
|
||||
// 添加新增设备
|
||||
for (const QString &path : devPaths) {
|
||||
if (!m_devices.contains(path)) {
|
||||
CollaborationDevice *device = new CollaborationDevice(path, this);
|
||||
if (device->isValid())
|
||||
m_devices[path] = device;
|
||||
else
|
||||
device->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit devicesChanged();
|
||||
}
|
||||
|
||||
void CollaborationDevModel::clear()
|
||||
{
|
||||
for (CollaborationDevice *device : m_devices) {
|
||||
device->deleteLater();
|
||||
}
|
||||
m_devices.clear();
|
||||
|
||||
Q_EMIT devicesChanged();
|
||||
}
|
||||
|
||||
CollaborationDevice *CollaborationDevModel::getDevice(const QString &machinePath)
|
||||
{
|
||||
return m_devices.value(machinePath, nullptr);
|
||||
}
|
||||
|
||||
CollaborationDevice::CollaborationDevice(const QString &devPath, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_path(devPath)
|
||||
, m_OS(-1)
|
||||
, m_isConnected(false)
|
||||
, m_isCooperated(false)
|
||||
, m_isValid(false)
|
||||
, m_isCooperating(false)
|
||||
, m_devDbusInter(new QDBusInterface(CollaborationService, devPath, CollaborationInterface + QString(".Machine"),
|
||||
QDBusConnection::sessionBus(), this))
|
||||
{
|
||||
if (m_devDbusInter->isValid()) {
|
||||
m_name = m_devDbusInter->property("Name").toString();
|
||||
m_OS = m_devDbusInter->property("OS").toInt();
|
||||
m_isConnected = m_devDbusInter->property("Connected").toBool();
|
||||
m_isCooperated = m_devDbusInter->property("DeviceSharing").toBool();
|
||||
m_uuid = m_devDbusInter->property("UUID").toString();
|
||||
m_isValid = true;
|
||||
} else {
|
||||
qWarning() << "CollaborationDevice devPath:" << devPath << " is invalid and get properties failed";
|
||||
}
|
||||
|
||||
m_devDbusInter->connection().connect(CollaborationService, m_path, ColPropertiesInterface, "PropertiesChanged",
|
||||
this, SLOT(onPropertyChanged(QDBusMessage)));
|
||||
}
|
||||
|
||||
bool CollaborationDevice::isValid() const
|
||||
{
|
||||
// not show android device
|
||||
return m_isValid && m_OS != Android;
|
||||
}
|
||||
|
||||
QString CollaborationDevice::name() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
QString CollaborationDevice::uuid() const
|
||||
{
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
QString CollaborationDevice::machinePath() const
|
||||
{
|
||||
return m_path;
|
||||
}
|
||||
|
||||
QString CollaborationDevice::deviceIcon() const
|
||||
{
|
||||
switch (m_OS) {
|
||||
case DeviceType::Android: {
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
return QString(":/ICON_Device_Headphone_dark.svg");
|
||||
|
||||
return QString(":/ICON_Device_Headphone.svg");
|
||||
}
|
||||
default: {
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType)
|
||||
return QString(":/ICON_Device_Laptop_dark.svg");
|
||||
|
||||
return QString(":/ICON_Device_Laptop.svg");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CollaborationDevice::isConnected() const
|
||||
{
|
||||
return m_isConnected;
|
||||
}
|
||||
|
||||
bool CollaborationDevice::isCooperated() const
|
||||
{
|
||||
return m_isCooperated;
|
||||
}
|
||||
|
||||
void CollaborationDevice::setDeviceIsCooperating(bool isCooperating)
|
||||
{
|
||||
m_isCooperating = isCooperating;
|
||||
}
|
||||
|
||||
void CollaborationDevice::onPropertyChanged(const QDBusMessage &msg)
|
||||
{
|
||||
QList<QVariant> arguments = msg.arguments();
|
||||
if (3 != arguments.count())
|
||||
return;
|
||||
|
||||
QString interfaceName = msg.arguments().at(0).toString();
|
||||
if (interfaceName != QString("%1.Machine").arg(CollaborationInterface))
|
||||
return;
|
||||
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
if (changedProps.contains("Connected")) {
|
||||
bool isConnected = changedProps.value("Connected").value<bool>();
|
||||
m_isConnected = isConnected;
|
||||
if (isConnected && m_isCooperating) {
|
||||
// paired 成功之后再去请求cooperate
|
||||
requestCooperate();
|
||||
}
|
||||
|
||||
if (!isConnected){
|
||||
Q_EMIT pairedStateChanged(false);
|
||||
}
|
||||
} else if (changedProps.contains("DeviceSharing")) {
|
||||
m_isCooperated = changedProps.value("DeviceSharing").value<bool>();
|
||||
|
||||
Q_EMIT pairedStateChanged(m_isCooperated);
|
||||
}
|
||||
}
|
||||
|
||||
void CollaborationDevice::requestCooperate() const
|
||||
{
|
||||
callMethod("RequestDeviceSharing");
|
||||
}
|
||||
|
||||
void CollaborationDevice::disconnectDevice() const
|
||||
{
|
||||
callMethod("Disconnect");
|
||||
}
|
||||
|
||||
void CollaborationDevice::connect() const
|
||||
{
|
||||
callMethod("Connect");
|
||||
}
|
||||
|
||||
QDBusMessage CollaborationDevice::callMethod(const QString &methodName) const
|
||||
{
|
||||
if (m_devDbusInter->isValid()) {
|
||||
QDBusMessage msg = m_devDbusInter->call(methodName);
|
||||
qInfo() << "CollaborationDevice callMethod:" << methodName << " " << msg.errorMessage();
|
||||
return msg;
|
||||
}
|
||||
|
||||
qWarning() << "CollaborationDevice callMethod: " << methodName << " failed";
|
||||
return QDBusMessage();
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#ifndef COLLABORATION_DEV_MODEL_H
|
||||
#define COLLABORATION_DEV_MODEL_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
|
||||
class QTimer;
|
||||
class QDBusInterface;
|
||||
class QDBusMessage;
|
||||
class CollaborationDevice;
|
||||
|
||||
/*!
|
||||
* \brief The CollaborationDevModel class
|
||||
* 协同设备model
|
||||
*/
|
||||
class CollaborationDevModel : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CollaborationDevModel(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void devicesChanged();
|
||||
|
||||
public:
|
||||
void checkServiceValid();
|
||||
|
||||
QList<CollaborationDevice *> devices() const;
|
||||
CollaborationDevice *getDevice(const QString &machinePath);
|
||||
|
||||
private slots:
|
||||
void onPropertyChanged(const QDBusMessage &msg);
|
||||
|
||||
private:
|
||||
void updateDevice(const QStringList &devPaths);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
QDBusInterface *m_colDbusInter;
|
||||
// machine path : device object
|
||||
QMap<QString, CollaborationDevice *> m_devices;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief The CollaborationDevice class
|
||||
* 协同设备类
|
||||
*/
|
||||
class CollaborationDevice : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CollaborationDevice(const QString &devPath, QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void pairedStateChanged(bool);
|
||||
|
||||
public:
|
||||
bool isValid() const;
|
||||
void connect() const;
|
||||
void requestCooperate() const;
|
||||
void disconnectDevice() const;
|
||||
|
||||
QString name() const;
|
||||
QString uuid() const;
|
||||
QString machinePath() const;
|
||||
QString deviceIcon() const;
|
||||
bool isConnected() const;
|
||||
bool isCooperated() const;
|
||||
void setDeviceIsCooperating(bool isCooperating);
|
||||
|
||||
private slots:
|
||||
void onPropertyChanged(const QDBusMessage &msg);
|
||||
|
||||
private:
|
||||
QDBusMessage callMethod(const QString &methodName) const;
|
||||
|
||||
private:
|
||||
enum DeviceType {
|
||||
Other = 0,
|
||||
UOS,
|
||||
Linux,
|
||||
Windows,
|
||||
MacOS,
|
||||
Android
|
||||
};
|
||||
|
||||
QString m_path;
|
||||
QString m_name;
|
||||
QString m_uuid;
|
||||
int m_OS;
|
||||
|
||||
bool m_isConnected;
|
||||
bool m_isCooperated;
|
||||
bool m_isValid;
|
||||
|
||||
// 标记任务栏点击触发协同连接
|
||||
bool m_isCooperating;
|
||||
|
||||
QDBusInterface *m_devDbusInter;
|
||||
};
|
||||
|
||||
#endif // COLLABORATION_DEV_MODEL_H
|
@ -1,241 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "devcollaborationwidget.h"
|
||||
#include "collaborationdevmodel.h"
|
||||
#include "devitemdelegate.h"
|
||||
|
||||
#include <DStyle>
|
||||
|
||||
#include <QMap>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#define TITLE_HEIGHT 30
|
||||
#define ITEM_WIDTH 310
|
||||
#define ITEM_HEIGHT 36
|
||||
#define LISTVIEW_ITEM_SPACE 5
|
||||
#define PER_DEGREE 14
|
||||
|
||||
DevCollaborationWidget::DevCollaborationWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_deviceModel(new CollaborationDevModel(this))
|
||||
, m_deviceListView(new DListView(this))
|
||||
, m_viewItemModel(new QStandardItemModel(m_deviceListView))
|
||||
, m_refreshTimer(new QTimer(this))
|
||||
{
|
||||
initUI();
|
||||
loadDevice();
|
||||
|
||||
connect(m_deviceModel, &CollaborationDevModel::devicesChanged, this, &DevCollaborationWidget::loadDevice);
|
||||
connect(m_deviceListView, &DListView::clicked, this, &DevCollaborationWidget::itemClicked);
|
||||
connect(m_refreshTimer, &QTimer::timeout, this, &DevCollaborationWidget::refreshViewItem);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
m_deviceModel->checkServiceValid();
|
||||
|
||||
QWidget::showEvent(event);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
Q_EMIT sizeChanged();
|
||||
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::initUI()
|
||||
{
|
||||
m_deviceListView->setModel(m_viewItemModel);
|
||||
|
||||
QLabel *title = new QLabel(tr("PC collaboration"), this);
|
||||
title->setFixedHeight(TITLE_HEIGHT);
|
||||
|
||||
QHBoxLayout *hLayout = new QHBoxLayout();
|
||||
hLayout->setContentsMargins(10, 0, 0, 0);
|
||||
hLayout->addWidget(title);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout();
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->addLayout(hLayout);
|
||||
mainLayout->addWidget(m_deviceListView);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
m_deviceListView->setContentsMargins(0, 0, 0, 0);
|
||||
m_deviceListView->setFrameShape(QFrame::NoFrame);
|
||||
m_deviceListView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
m_deviceListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_deviceListView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
m_deviceListView->setResizeMode(QListView::Adjust);
|
||||
m_deviceListView->setViewportMargins(0, 0, 0, 0);
|
||||
m_deviceListView->setSpacing(LISTVIEW_ITEM_SPACE);
|
||||
m_deviceListView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
m_deviceListView->setItemDelegate(new DevItemDelegate(this));
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::loadDevice()
|
||||
{
|
||||
if (!m_deviceListView->count()) {
|
||||
for (CollaborationDevice *device : m_deviceModel->devices()) {
|
||||
addItem(device);
|
||||
}
|
||||
} else {
|
||||
updateDeviceListView();
|
||||
}
|
||||
|
||||
if(!m_deviceListView->count()) {
|
||||
m_deviceListView->hide();
|
||||
} else {
|
||||
if (!m_deviceListView->isVisible())
|
||||
m_deviceListView->setVisible(true);
|
||||
|
||||
m_deviceListView->setFixedSize(ITEM_WIDTH, m_deviceListView->count() * ITEM_HEIGHT + LISTVIEW_ITEM_SPACE * (m_deviceListView->count() * 2));
|
||||
}
|
||||
|
||||
resetWidgetSize();
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::addItem(const CollaborationDevice *device)
|
||||
{
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
QStandardItem *item = new QStandardItem();
|
||||
DevItemDelegate::DevItemData data;
|
||||
data.checkedIconPath = device->deviceIcon(); // TODO
|
||||
data.text = device->name();
|
||||
data.iconPath = device->deviceIcon();
|
||||
int resultState = device->isCooperated() ? DevItemDelegate::Connected : DevItemDelegate::None;
|
||||
|
||||
item->setData(QVariant::fromValue(data), DevItemDelegate::StaticDataRole);
|
||||
item->setData(device->machinePath(), DevItemDelegate::MachinePathDataRole);
|
||||
item->setData(0, DevItemDelegate::DegreeDataRole);
|
||||
item->setData(resultState, DevItemDelegate::ResultDataRole);
|
||||
|
||||
m_viewItemModel->appendRow(item);
|
||||
m_deviceItemMap[device->machinePath()] = item;
|
||||
|
||||
connect(device, &CollaborationDevice::pairedStateChanged, this, &DevCollaborationWidget::itemStatusChanged);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::updateDeviceListView()
|
||||
{
|
||||
QList<CollaborationDevice *> devices = m_deviceModel->devices();
|
||||
if (devices.isEmpty()) {
|
||||
m_deviceListView->removeItems(0, m_deviceListView->count());
|
||||
m_deviceItemMap.clear();
|
||||
m_connectingDevices.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
// 删除不存在设备
|
||||
for (int row = 0; row < m_deviceListView->count(); row++) {
|
||||
QStandardItem *item = m_viewItemModel->item(row);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
QString machinePath = item->data(DevItemDelegate::MachinePathDataRole).toString();
|
||||
if (m_deviceModel->getDevice(machinePath))
|
||||
continue;
|
||||
|
||||
m_deviceListView->removeItem(row);
|
||||
|
||||
if (m_deviceItemMap.contains(machinePath)) {
|
||||
m_deviceItemMap.remove(machinePath);
|
||||
}
|
||||
|
||||
if (m_connectingDevices.contains(machinePath)) {
|
||||
m_connectingDevices.removeAll(machinePath);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理新增
|
||||
for (CollaborationDevice *device : devices) {
|
||||
if (!m_deviceItemMap.contains(device->machinePath())) {
|
||||
addItem(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::resetWidgetSize()
|
||||
{
|
||||
int height = TITLE_HEIGHT + (m_deviceListView->count() ? m_deviceListView->height() : 0);
|
||||
|
||||
setFixedSize(ITEM_WIDTH, height);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::itemClicked(const QModelIndex &index)
|
||||
{
|
||||
QString machinePath = index.data(DevItemDelegate::MachinePathDataRole).toString();
|
||||
CollaborationDevice *device = m_deviceModel->getDevice(machinePath);
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
if (!device->isConnected()) {
|
||||
device->setDeviceIsCooperating(true);
|
||||
device->connect();
|
||||
if (!m_connectingDevices.contains(machinePath))
|
||||
m_connectingDevices.append(machinePath);
|
||||
} else if (!device->isCooperated()) {
|
||||
device->requestCooperate();
|
||||
if (!m_connectingDevices.contains(machinePath))
|
||||
m_connectingDevices.append(machinePath);
|
||||
} else if (device->isCooperated()) {
|
||||
device->disconnectDevice();
|
||||
if (m_connectingDevices.contains(machinePath))
|
||||
m_connectingDevices.removeOne(machinePath);
|
||||
}
|
||||
|
||||
if (!m_connectingDevices.isEmpty() && !m_refreshTimer->isActive())
|
||||
m_refreshTimer->start(80);
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::itemStatusChanged()
|
||||
{
|
||||
CollaborationDevice *device = qobject_cast<CollaborationDevice *>(sender());
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
device->setDeviceIsCooperating(false);
|
||||
QString machinePath = device->machinePath();
|
||||
if (m_deviceItemMap.contains(machinePath) && m_deviceItemMap[machinePath]) {
|
||||
// 更新item的连接状态
|
||||
int resultState = device->isCooperated() ? DevItemDelegate::Connected : DevItemDelegate::None;
|
||||
m_deviceItemMap[machinePath]->setData(resultState, DevItemDelegate::ResultDataRole);
|
||||
if (device->isCooperated() || !device->isConnected())
|
||||
m_deviceItemMap[machinePath]->setData(0, DevItemDelegate::DegreeDataRole);
|
||||
|
||||
m_deviceListView->update(m_deviceItemMap[machinePath]->index());
|
||||
|
||||
if ((resultState == DevItemDelegate::Connected || !device->isConnected()) && m_connectingDevices.contains(machinePath)) {
|
||||
m_connectingDevices.removeAll(machinePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DevCollaborationWidget::refreshViewItem()
|
||||
{
|
||||
if (m_connectingDevices.isEmpty()) {
|
||||
m_refreshTimer->stop();
|
||||
return;
|
||||
}
|
||||
|
||||
for (const QString &machinePath : m_connectingDevices) {
|
||||
if (m_deviceItemMap.contains(machinePath) && m_deviceItemMap[machinePath]) {
|
||||
int degree = m_deviceItemMap[machinePath]->data(DevItemDelegate::DegreeDataRole).toInt();
|
||||
degree += PER_DEGREE; // 递进值
|
||||
m_deviceItemMap[machinePath]->setData(DevItemDelegate::Connecting, DevItemDelegate::ResultDataRole);
|
||||
m_deviceItemMap[machinePath]->setData(degree, DevItemDelegate::DegreeDataRole);
|
||||
m_deviceListView->update(m_deviceItemMap[machinePath]->index());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#ifndef DEVICE_COLLABORATION_WIDGET_H
|
||||
#define DEVICE_COLLABORATION_WIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <DListView>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class CollaborationDevice;
|
||||
class CollaborationDevModel;
|
||||
|
||||
/*!
|
||||
* \brief The DevCollaborationWidget class
|
||||
* 设备跨端协同子页面
|
||||
*/
|
||||
class DevCollaborationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DevCollaborationWidget(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void sizeChanged();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void loadDevice();
|
||||
void itemClicked(const QModelIndex &index);
|
||||
void itemStatusChanged();
|
||||
void refreshViewItem();
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
void updateDeviceListView();
|
||||
|
||||
void addItem(const CollaborationDevice *device);
|
||||
void resetWidgetSize();
|
||||
|
||||
private:
|
||||
CollaborationDevModel *m_deviceModel;
|
||||
DListView *m_deviceListView;
|
||||
QStandardItemModel *m_viewItemModel;
|
||||
QMap<QString, QStandardItem *> m_deviceItemMap;
|
||||
QStringList m_connectingDevices;
|
||||
|
||||
QTimer *m_refreshTimer;
|
||||
};
|
||||
|
||||
#endif // DEVICE_COLLABORATION_WIDGET_H
|
@ -1,164 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "devitemdelegate.h"
|
||||
|
||||
#include <QtMath>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
|
||||
#include <DFontSizeManager>
|
||||
|
||||
#define RADIUS_VALUE 10
|
||||
#define ITEM_SPACE 20
|
||||
#define ICON_WIDTH 16
|
||||
#define ICON_HEIGHT 16
|
||||
#define TEXT_RECT_HEIGHT 20
|
||||
#define ITEM_HEIGHT 36
|
||||
#define INDICATOR_SHADOW_OFFSET 10
|
||||
|
||||
DevItemDelegate::DevItemDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DevItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return;
|
||||
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
QVariant var = index.data(StaticDataRole);
|
||||
DevItemData itemData = var.value<DevItemData>();
|
||||
QRect rect = option.rect;
|
||||
QPen pen;
|
||||
pen.setWidth(2);
|
||||
|
||||
// 鼠标悬停
|
||||
if (option.state.testFlag(QStyle::State_MouseOver)) {
|
||||
pen.setColor(QColor("#EBECED"));
|
||||
painter->setPen(pen);
|
||||
painter->setBrush(QColor("#EBECED"));
|
||||
painter->drawRoundedRect(rect, RADIUS_VALUE, RADIUS_VALUE);
|
||||
}
|
||||
|
||||
// 选中背景(连接上和选中)
|
||||
int result = index.data(ResultDataRole).toInt();
|
||||
if (option.state.testFlag(QStyle::State_Selected) && result == Connected) {
|
||||
pen.setColor(QColor("#0081FF"));
|
||||
painter->setPen(pen);
|
||||
painter->setBrush(QColor("#0081FF"));
|
||||
painter->drawRoundedRect(rect, RADIUS_VALUE, RADIUS_VALUE);
|
||||
} else {
|
||||
// 绘制默认背景
|
||||
pen.setColor(QColor("#EBECED"));
|
||||
painter->setPen(pen);
|
||||
painter->setBrush(QColor("#EBECED"));
|
||||
painter->drawRoundedRect(rect, RADIUS_VALUE, RADIUS_VALUE);
|
||||
}
|
||||
|
||||
bool selected = (option.state.testFlag(QStyle::State_Selected) && result == Connected);
|
||||
|
||||
// 绘制Icon
|
||||
QString imagePath = selected ? itemData.checkedIconPath : itemData.iconPath;
|
||||
QRect iconRect = QRect(rect.left() + ITEM_SPACE, rect.top() + rect.height() / 2 - ICON_HEIGHT / 2,
|
||||
ICON_WIDTH, ICON_HEIGHT);
|
||||
painter->drawImage(iconRect, QImage(imagePath));
|
||||
|
||||
// 绘制text
|
||||
QFont font = Dtk::Widget::DFontSizeManager::instance()->t4();
|
||||
painter->setFont(font);
|
||||
pen.setColor(selected ? Qt::white : Qt::black);
|
||||
painter->setPen(pen);
|
||||
|
||||
int textRectWidth = rect.width() - ITEM_SPACE - iconRect.width() - iconRect.width() - ITEM_SPACE;
|
||||
QRect textRect = QRect(iconRect.right() + ITEM_SPACE, rect.top() + 2,
|
||||
textRectWidth, rect.height());
|
||||
|
||||
QFontMetrics fm(font);
|
||||
QString itemText = fm.elidedText(itemData.text, Qt::ElideRight, textRectWidth);
|
||||
painter->drawText(textRect, itemText);
|
||||
|
||||
switch (result) {
|
||||
case ResultState::Connected:
|
||||
drawResultState(painter, rect);
|
||||
break;
|
||||
case ResultState::Connecting:
|
||||
drawWaitingState(painter, rect, index.data(DegreeDataRole).toInt());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QSize DevItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
return QSize(option.rect.width(), ITEM_HEIGHT);
|
||||
}
|
||||
|
||||
void DevItemDelegate::drawWaitingState(QPainter *painter, const QRect &rect, int degree) const
|
||||
{
|
||||
int left = rect.width() - ITEM_SPACE;
|
||||
int top = rect.top() + rect.height() / 2 - ICON_HEIGHT / 2;
|
||||
QRect newRect(left, top, ICON_WIDTH, ICON_HEIGHT);
|
||||
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
QList<QList<QColor>> indicatorColors;
|
||||
for (int i = 0; i < 3; i++)
|
||||
indicatorColors << createDefaultIndicatorColorList(QColor("#0081FF"));
|
||||
|
||||
double radius = 16 * 0.66;
|
||||
auto center = QRectF(newRect).center();
|
||||
auto indicatorRadius = radius / 2 / 2 * 1.1;
|
||||
auto indicatorDegreeDelta = 360 / indicatorColors.count();
|
||||
|
||||
for (int i = 0; i < indicatorColors.count(); ++i) {
|
||||
QList<QColor> colors = indicatorColors.value(i);
|
||||
for (int j = 0; j < colors.count(); ++j) {
|
||||
double degreeCurrent = degree - j * INDICATOR_SHADOW_OFFSET + indicatorDegreeDelta * i;
|
||||
auto x = (radius - indicatorRadius) * qCos(qDegreesToRadians(degreeCurrent));
|
||||
auto y = (radius - indicatorRadius) * qSin(qDegreesToRadians(degreeCurrent));
|
||||
|
||||
x = center.x() + x;
|
||||
y = center.y() + y;
|
||||
auto tl = QPointF(x - 1 * indicatorRadius, y - 1 * indicatorRadius);
|
||||
QRectF rf(tl.x(), tl.y(), indicatorRadius * 2, indicatorRadius * 2);
|
||||
|
||||
QPainterPath path;
|
||||
path.addEllipse(rf);
|
||||
|
||||
painter->fillPath(path, colors.value(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DevItemDelegate::drawResultState(QPainter *painter, const QRect &rect) const
|
||||
{
|
||||
// 绘制对勾,14x12
|
||||
int left = rect.width() - ITEM_SPACE;
|
||||
int top = rect.top() + rect.height() / 2 - 6;
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(left, top + 6);
|
||||
path.lineTo(left + 4, top + 11);
|
||||
path.lineTo(left + 12, top + 1);
|
||||
|
||||
painter->drawPath(path);
|
||||
}
|
||||
|
||||
QList<QColor> DevItemDelegate::createDefaultIndicatorColorList(QColor color) const
|
||||
{
|
||||
QList<QColor> colors;
|
||||
QList<int> opacitys;
|
||||
opacitys << 100 << 30 << 15 << 10 << 5 << 4 << 3 << 2 << 1;
|
||||
for (int i = 0; i < opacitys.count(); ++i) {
|
||||
color.setAlpha(255 * opacitys.value(i) / 100);
|
||||
colors << color;
|
||||
}
|
||||
|
||||
return colors;
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
// Copyright (C) 2021 ~ 2022 Uniontech Software Technology Co.,Ltd.
|
||||
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#ifndef DEVITEMDELEGATE_H
|
||||
#define DEVITEMDELEGATE_H
|
||||
|
||||
#include <DStyledItemDelegate>
|
||||
|
||||
/*!
|
||||
* \brief The DevItemDelegate class
|
||||
*/
|
||||
class DevItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum DevItemDataRole {
|
||||
StaticDataRole = Qt::UserRole + 1, // 静态信息
|
||||
MachinePathDataRole = Qt::UserRole + 2, // machinePath, 可唯一代表一个设备
|
||||
DegreeDataRole = Qt::UserRole + 3, // degree 绘制waiting使用的参数
|
||||
ResultDataRole = Qt::UserRole + 4 // 连接结果
|
||||
};
|
||||
|
||||
enum ResultState {
|
||||
None,
|
||||
Connecting,
|
||||
Connected
|
||||
};
|
||||
|
||||
struct DevItemData {
|
||||
QString checkedIconPath;
|
||||
QString iconPath;
|
||||
QString text;
|
||||
};
|
||||
|
||||
public:
|
||||
explicit DevItemDelegate(QObject *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
void drawWaitingState(QPainter *painter, const QRect &rect, int degree) const;
|
||||
void drawResultState(QPainter *painter, const QRect &rect) const;
|
||||
QList<QColor> createDefaultIndicatorColorList(QColor color) const;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(DevItemDelegate::DevItemData)
|
||||
|
||||
#endif // DEVITEMDELEGATE_H
|
@ -4,7 +4,6 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include "displaysettingwidget.h"
|
||||
#include "devcollaborationwidget.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
@ -16,12 +15,10 @@ const int ItemSpacing = 10;
|
||||
DisplaySettingWidget::DisplaySettingWidget(BrightnessModel *model, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_brightnessAdjWidget(new BrightnessAdjWidget(model, this))
|
||||
, m_collaborationWidget(new DevCollaborationWidget(this))
|
||||
, m_settingBtn(new QPushButton(tr("Multi-Screen Collaboration"), this))
|
||||
, m_settingBtn(new QPushButton(tr("Display Settings"), this))
|
||||
{
|
||||
initUI();
|
||||
|
||||
connect(m_settingBtn, &QPushButton::clicked, this, [ this ](){
|
||||
connect(m_settingBtn, &QPushButton::clicked, this, [ this ](){
|
||||
DDBusSender().service("org.deepin.dde.ControlCenter1")
|
||||
.path("/org/deepin/dde/ControlCenter1")
|
||||
.interface("org.deepin.dde.ControlCenter1")
|
||||
@ -38,15 +35,12 @@ void DisplaySettingWidget::initUI()
|
||||
mainLayout->setSpacing(ItemSpacing);
|
||||
|
||||
mainLayout->addWidget(m_brightnessAdjWidget);
|
||||
mainLayout->addWidget(m_collaborationWidget);
|
||||
mainLayout->addWidget(m_settingBtn);
|
||||
mainLayout->addStretch();
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
resizeWidgetHeight();
|
||||
connect(m_collaborationWidget, &DevCollaborationWidget::sizeChanged,
|
||||
this, &DisplaySettingWidget::resizeWidgetHeight);
|
||||
connect(m_brightnessAdjWidget, &BrightnessAdjWidget::sizeChanged,
|
||||
this, &DisplaySettingWidget::resizeWidgetHeight);
|
||||
}
|
||||
@ -55,5 +49,5 @@ void DisplaySettingWidget::resizeWidgetHeight()
|
||||
{
|
||||
QMargins margins = this->contentsMargins();
|
||||
setFixedHeight(margins.top() + margins.bottom() + m_brightnessAdjWidget->height() +
|
||||
m_collaborationWidget->height() + m_settingBtn->height() + ItemSpacing * 2);
|
||||
m_settingBtn->height() + ItemSpacing);
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
class QPushButton;
|
||||
class BrightnessAdjWidget;
|
||||
class DevCollaborationWidget;
|
||||
|
||||
/*!
|
||||
* \brief The DisplaySettingWidget class
|
||||
@ -34,7 +33,6 @@ private:
|
||||
|
||||
private:
|
||||
BrightnessAdjWidget *m_brightnessAdjWidget; // 亮度调整
|
||||
DevCollaborationWidget *m_collaborationWidget; // 跨端协同
|
||||
QPushButton *m_settingBtn; // 设置按钮
|
||||
};
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <QJsonObject>
|
||||
#include <QMetaMethod>
|
||||
#include <QDBusAbstractInterface>
|
||||
#include <QMetaObject>
|
||||
#include <QUrl>
|
||||
|
||||
MediaPlayerModel::MediaPlayerModel(QObject *parent)
|
||||
: QObject(parent)
|
||||
@ -56,42 +58,22 @@ MediaPlayerModel::PlayStatus MediaPlayerModel::status()
|
||||
|
||||
const QString MediaPlayerModel::name()
|
||||
{
|
||||
if (m_mediaInter) {
|
||||
Dict data = m_mediaInter->metadata();
|
||||
return data["xesam:title"].toString();
|
||||
}
|
||||
|
||||
return QString();
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const QString MediaPlayerModel::iconUrl()
|
||||
{
|
||||
if (m_mediaInter) {
|
||||
Dict data = m_mediaInter->metadata();
|
||||
return data["mpris:artUrl"].toString();
|
||||
}
|
||||
|
||||
return QString();
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
const QString MediaPlayerModel::album()
|
||||
{
|
||||
if (m_mediaInter) {
|
||||
Dict data = m_mediaInter->metadata();
|
||||
return data["xesam:album"].toString();
|
||||
}
|
||||
|
||||
return QString();
|
||||
return m_album;
|
||||
}
|
||||
|
||||
const QString MediaPlayerModel::artist()
|
||||
{
|
||||
if (m_mediaInter) {
|
||||
Dict data = m_mediaInter->metadata();
|
||||
return data["xesam:artist"].toString();
|
||||
}
|
||||
|
||||
return QString();
|
||||
return m_artist;
|
||||
}
|
||||
|
||||
void MediaPlayerModel::setStatus(const MediaPlayerModel::PlayStatus &stat)
|
||||
@ -122,87 +104,149 @@ void MediaPlayerModel::playNext()
|
||||
m_mediaInter->Next();
|
||||
}
|
||||
|
||||
void MediaPlayerModel::updateMetadata()
|
||||
{
|
||||
if (!m_mediaInter)
|
||||
return;
|
||||
|
||||
Dict v = m_mediaInter->metadata();
|
||||
m_name = v.value("xesam:title").toString();
|
||||
m_icon = v.value("mpris:artUrl").toString();
|
||||
m_album = v.value("xesam:album").toString();
|
||||
m_artist = v.value("xesam:artist").toString();
|
||||
|
||||
auto getName = [&v](const QString &service){
|
||||
if (service.contains("vlc", Qt::CaseInsensitive)) {
|
||||
const QString &url = v.value("xesam:url").toString();
|
||||
if (!url.isEmpty())
|
||||
return QUrl(url).fileName();
|
||||
}
|
||||
|
||||
return tr("Unknown");
|
||||
};
|
||||
auto getIcon = [](const QString &service){
|
||||
QMap<QString, QString> serv2Icon = {
|
||||
{"vlc", "vlc"},
|
||||
{"chromium", "chrome"},
|
||||
{"firefox", "firefox"},
|
||||
{"movie", "video"},
|
||||
{"music", "music"}
|
||||
};
|
||||
|
||||
for(auto k : serv2Icon.keys())
|
||||
if (service.contains(k, Qt::CaseInsensitive))
|
||||
return serv2Icon.value(k);
|
||||
|
||||
return QString("music");
|
||||
};
|
||||
|
||||
const QString &service = m_mediaInter->service();
|
||||
if (m_name.isEmpty())
|
||||
m_name = getName(service);
|
||||
|
||||
if (m_icon.isEmpty())
|
||||
m_icon = getIcon(service);
|
||||
|
||||
if (m_album.isEmpty())
|
||||
m_album = tr("Unknown");
|
||||
if (m_artist.isEmpty())
|
||||
m_artist = tr("Unknown");
|
||||
|
||||
Q_EMIT MediaPlayerModel::metadataChanged();
|
||||
}
|
||||
|
||||
void MediaPlayerModel::onServiceDiscovered(const QString &service)
|
||||
{
|
||||
auto mediaInter = new MediaPlayerInterface(service, "/org/mpris/MediaPlayer2",
|
||||
QDBusConnection::sessionBus(), this);
|
||||
// 影院不太希望被控制。。canShowInUI:false
|
||||
if (!mediaInter->canControl() || !mediaInter->canShowInUI()) {
|
||||
delete mediaInter;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_mprisServices.contains(service))
|
||||
m_mprisServices << service;
|
||||
|
||||
m_isActived = !m_mprisServices.isEmpty();
|
||||
|
||||
if (m_mediaInter && m_mediaInter->service() == service) {
|
||||
Q_EMIT startStop(m_isActived);
|
||||
delete mediaInter;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mediaInter)
|
||||
delete m_mediaInter;
|
||||
|
||||
m_mediaInter = mediaInter;
|
||||
|
||||
updateMetadata();
|
||||
|
||||
connect(m_mediaInter, &MediaPlayerInterface::PlaybackStatusChanged, this, [ this ] {
|
||||
Q_EMIT statusChanged(convertStatus(m_mediaInter->playbackStatus()));
|
||||
});
|
||||
connect(m_mediaInter, &MediaPlayerInterface::MetadataChanged, this, &MediaPlayerModel::updateMetadata);
|
||||
|
||||
Q_EMIT startStop(m_isActived);
|
||||
}
|
||||
|
||||
void MediaPlayerModel::onServiceDisappears(const QString &service)
|
||||
{
|
||||
if (!m_mprisServices.contains(service))
|
||||
return;
|
||||
|
||||
m_mprisServices.removeAll(service);
|
||||
m_isActived = !m_mprisServices.isEmpty();
|
||||
|
||||
if (m_mediaInter && m_mediaInter->service() == service) {
|
||||
delete m_mediaInter;
|
||||
m_mediaInter = nullptr;
|
||||
}
|
||||
|
||||
// 退出当前播放器后,继续控制上一个播放器
|
||||
if (m_isActived)
|
||||
return onServiceDiscovered(m_mprisServices.last());
|
||||
|
||||
Q_EMIT startStop(m_isActived);
|
||||
}
|
||||
|
||||
void MediaPlayerModel::initMediaPlayer()
|
||||
{
|
||||
QDBusInterface dbusInter("org.freedesktop.DBus", "/", "org.freedesktop.DBus", QDBusConnection::sessionBus(), this);
|
||||
QDBusPendingCall call = dbusInter.asyncCall("ListNames");
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, [ = ] {
|
||||
m_serviceName.clear();
|
||||
m_mprisServices.clear();
|
||||
if (call.isError())
|
||||
return;
|
||||
|
||||
QDBusReply<QStringList> reply = call.reply();
|
||||
const QStringList &serviceList = reply.value();
|
||||
|
||||
for (const QString &serv : serviceList) {
|
||||
if (!serv.startsWith("org.mpris.MediaPlayer2"))
|
||||
continue;
|
||||
|
||||
QDBusInterface serviceInterface(serv, "/org/mpris/MediaPlayer2",
|
||||
"org.mpris.MediaPlayer2.Player", QDBusConnection::sessionBus(), this);
|
||||
// 如果开启了谷歌浏览器的后台服务(org.mpris.MediaPlayer2.chromium.instance17352)
|
||||
// 也符合名称要求,但是它不是音乐服务,此时需要判断是否存在这个属性
|
||||
QVariant v = serviceInterface.property("CanPlay");
|
||||
if (!v.isValid() || !v.value<bool>())
|
||||
continue;
|
||||
|
||||
m_serviceName = serv;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!m_serviceName.isEmpty()) {
|
||||
m_isActived = true;
|
||||
|
||||
m_mediaInter = new MediaPlayerInterface(m_serviceName, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this);
|
||||
connect(m_mediaInter, &MediaPlayerInterface::PlaybackStatusChanged, this, [ this ] {
|
||||
Q_EMIT statusChanged(convertStatus(m_mediaInter->playbackStatus()));
|
||||
});
|
||||
connect(m_mediaInter, &MediaPlayerInterface::MetadataChanged, this, &MediaPlayerModel::metadataChanged);
|
||||
Dict v = m_mediaInter->metadata();
|
||||
m_name = v.value("xesam:title").toString();
|
||||
m_icon = v.value("mpris:artUrl").toString();
|
||||
m_album = v.value("xesam:album").toString();
|
||||
m_artist = v.value("xesam:artist").toString();
|
||||
Q_EMIT startStop(m_isActived);
|
||||
return;
|
||||
onServiceDiscovered(serv);
|
||||
// break;
|
||||
}
|
||||
|
||||
QDBusConnectionInterface *dbusInterface = QDBusConnection::sessionBus().interface();
|
||||
connect(dbusInterface, &QDBusConnectionInterface::serviceOwnerChanged, this,
|
||||
[ = ](const QString &name, const QString &, const QString &newOwner) {
|
||||
if (name.startsWith("org.mpris.MediaPlayer2")) {
|
||||
// 启动了音乐播放
|
||||
m_isActived = !newOwner.isEmpty();
|
||||
if (m_isActived) {
|
||||
m_serviceName = name;
|
||||
m_mediaInter = new MediaPlayerInterface(m_serviceName, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this);
|
||||
connect(m_mediaInter, &MediaPlayerInterface::PlaybackStatusChanged, this, [ this ] {
|
||||
Q_EMIT statusChanged(convertStatus(m_mediaInter->playbackStatus()));
|
||||
});
|
||||
connect(m_mediaInter, &MediaPlayerInterface::MetadataChanged, this, &MediaPlayerModel::metadataChanged);
|
||||
Dict v = m_mediaInter->metadata();
|
||||
m_name = v.value("xesam:title").toString();
|
||||
m_icon = v.value("mpris:artUrl").toString();
|
||||
m_album = v.value("xesam:album").toString();
|
||||
m_artist = v.value("xesam:artist").toString();
|
||||
} else {
|
||||
if (!m_serviceName.isEmpty()) {
|
||||
delete m_mediaInter;
|
||||
m_mediaInter = nullptr;
|
||||
}
|
||||
m_serviceName.clear();
|
||||
}
|
||||
Q_EMIT startStop(m_isActived);
|
||||
if (!name.startsWith("org.mpris.MediaPlayer2"))
|
||||
return;
|
||||
|
||||
if (newOwner.isEmpty()) {
|
||||
onServiceDisappears(name);
|
||||
} else {
|
||||
onServiceDiscovered(name);
|
||||
}
|
||||
});
|
||||
connect(dbusInterface, &QDBusConnectionInterface::serviceUnregistered, this,
|
||||
[ = ](const QString &service) {
|
||||
if (service.startsWith("org.mpris.MediaPlayer2")) {
|
||||
// 启动了音乐播放
|
||||
m_serviceName.clear();
|
||||
m_isActived = false;
|
||||
Q_EMIT startStop(m_isActived);
|
||||
onServiceDiscovered(service);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -248,8 +292,13 @@ void MediaPlayerInterface::onPropertyChanged(const QDBusMessage &msg)
|
||||
const QMetaObject* self = metaObject();
|
||||
for (int i = self->propertyOffset(); i < self->propertyCount(); ++i) {
|
||||
QMetaProperty p = self->property(i);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QGenericArgument value(QMetaType::typeName(p.type()), const_cast<void*>(changedProps[prop].constData()));
|
||||
#else
|
||||
QGenericArgument value{p.metaType().name(), const_cast<void*>(changedProps[prop].constData())};
|
||||
#endif
|
||||
if (p.name() == prop) {
|
||||
Q_EMIT p.notifySignal().invoke(this);
|
||||
Q_EMIT p.notifySignal().invoke(this, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +54,13 @@ Q_SIGNALS:
|
||||
private:
|
||||
void initMediaPlayer();
|
||||
PlayStatus convertStatus(const QString &stat);
|
||||
void onServiceDiscovered(const QString &service);
|
||||
void onServiceDisappears(const QString &service);
|
||||
void updateMetadata();
|
||||
|
||||
private:
|
||||
bool m_isActived;
|
||||
QString m_serviceName;
|
||||
QStringList m_mprisServices;
|
||||
QString m_name;
|
||||
QString m_icon;
|
||||
QString m_album;
|
||||
@ -98,6 +101,18 @@ public:
|
||||
inline Dict metadata() const
|
||||
{ return qvariant_cast<Dict>(property("Metadata")); }
|
||||
|
||||
Q_PROPERTY(bool CanControl READ canControl NOTIFY CanControlChanged)
|
||||
inline bool canControl() const
|
||||
{ return qvariant_cast< bool >(property("CanControl")); }
|
||||
|
||||
// from dtkwidget dbusmpris.h
|
||||
Q_PROPERTY(bool CanShowInUI READ canShowInUI NOTIFY CanShowInUIChanged)
|
||||
inline bool canShowInUI() const
|
||||
{
|
||||
QVariant showInUI = property("CanShowInUI");
|
||||
// 属性有效且为假表示不能控制 无效或为真表示可以控制
|
||||
return showInUI.isValid() ? showInUI.toBool() : true;
|
||||
}
|
||||
Q_PROPERTY(bool CanGoNext READ canGoNext NOTIFY CanGoNextChanged)
|
||||
inline bool canGoNext() const
|
||||
{ return qvariant_cast< bool >(property("CanGoNext")); }
|
||||
@ -116,6 +131,8 @@ public:
|
||||
|
||||
Q_SIGNALS:
|
||||
void MetadataChanged();
|
||||
void CanControlChanged(bool value);
|
||||
void CanShowInUIChanged(bool value);
|
||||
void CanGoNextChanged();
|
||||
void CanGoPreviousChanged();
|
||||
void CanPauseChanged();
|
||||
|
@ -115,9 +115,18 @@ void MediaWidget::onUpdateMediaInfo()
|
||||
{
|
||||
m_musicName->setText(m_model->name());
|
||||
QString file = m_model->iconUrl();
|
||||
if (file.startsWith("file:///"))
|
||||
QPixmap pixmap;
|
||||
if (file.startsWith("file:///")) {
|
||||
file.replace("file:///", "/");
|
||||
m_musicIcon->setPixmap(QPixmap(file).scaled(m_musicIcon->size()));
|
||||
pixmap = QPixmap(file).scaled(m_musicIcon->size());
|
||||
}
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
// 就算给的文件不存在(e.g. deepin-music..),也至少 fallback 到 music 图标
|
||||
pixmap = QIcon::fromTheme(file, QIcon::fromTheme("music")).pixmap(m_musicIcon->size());
|
||||
}
|
||||
|
||||
m_musicIcon->setPixmap(pixmap);
|
||||
m_musicSinger->setText(m_model->artist());
|
||||
}
|
||||
|
||||
|
@ -145,12 +145,6 @@ QIcon MultitaskingPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::
|
||||
if (dockPart == DockPart::DCCSetting) {
|
||||
auto icon = QIcon::fromTheme("dcc-multitasking-view", QIcon(":/icons/dcc-multitasking-view.svg"));
|
||||
QPixmap pixmap = icon.pixmap(QSize(18, 18));
|
||||
if (themeType == DGuiApplicationHelper::ColorType::LightType)
|
||||
return pixmap;
|
||||
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), Qt::white);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
28
plugins/notification/CMakeLists.txt
Normal file
28
plugins/notification/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
||||
set(PLUGIN_NAME "notification")
|
||||
find_package(Qt5 REQUIRED COMPONENTS DBus)
|
||||
find_package(Dtk REQUIRED COMPONENTS Widget)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED
|
||||
notification.h
|
||||
notification.cpp
|
||||
notificationplugin.h
|
||||
notificationplugin.cpp
|
||||
${CMAKE_SOURCE_DIR}/widgets/tipswidget.h
|
||||
${CMAKE_SOURCE_DIR}/widgets/tipswidget.cpp
|
||||
notification.qrc
|
||||
)
|
||||
target_compile_definitions(${PLUGIN_NAME} PRIVATE QT_PLUGIN)
|
||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
|
||||
|
||||
target_include_directories(${PLUGIN_NAME} PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/interfaces>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/widgets>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/frame/qtdbusextended>
|
||||
)
|
||||
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||
Dtk::Widget
|
||||
Qt5::DBus
|
||||
)
|
||||
|
||||
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)
|
BIN
plugins/notification/icons/notification-off.dci
Normal file
BIN
plugins/notification/icons/notification-off.dci
Normal file
Binary file not shown.
BIN
plugins/notification/icons/notification.dci
Normal file
BIN
plugins/notification/icons/notification.dci
Normal file
Binary file not shown.
118
plugins/notification/notification.cpp
Normal file
118
plugins/notification/notification.cpp
Normal file
@ -0,0 +1,118 @@
|
||||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
#include "notification.h"
|
||||
#include "constants.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QMouseEvent>
|
||||
#include <QApplication>
|
||||
#include <QIcon>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusReply>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
#include <DStyle>
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(qLcPluginNotification)
|
||||
|
||||
DWIDGET_USE_NAMESPACE;
|
||||
DCORE_USE_NAMESPACE;
|
||||
Notification::Notification(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_icon(QIcon::fromTheme("notification"))
|
||||
, m_notificationCount(0)
|
||||
, m_dbus(nullptr)
|
||||
, m_dndMode(false)
|
||||
{
|
||||
setMinimumSize(PLUGIN_BACKGROUND_MIN_SIZE, PLUGIN_BACKGROUND_MIN_SIZE);
|
||||
connect(this, &Notification::dndModeChanged, this, &Notification::refreshIcon);
|
||||
QtConcurrent::run([this](){
|
||||
m_dbus.reset(new QDBusInterface("org.deepin.dde.Notification1", "/org/deepin/dde/Notification1", "org.deepin.dde.Notification1"));
|
||||
// Refresh icon for the first time, cause org.deepin.dde.Notification1 might depend on dock's DBus,
|
||||
// we should not call org.deepin.dde.Notification1 in the main thread before dock's dbus is initialized.
|
||||
// Just refresh icon in the other thread.
|
||||
QDBusReply<QDBusVariant> dnd = m_dbus->call(QLatin1String("GetSystemInfo"), QVariant::fromValue(0u));
|
||||
if (!dnd.isValid()) {
|
||||
qCWarning(qLcPluginNotification) << dnd.error();
|
||||
} else {
|
||||
m_dndMode = dnd.value().variant().toBool();
|
||||
refreshIcon();
|
||||
}
|
||||
QDBusConnection::sessionBus().connect("org.deepin.dde.Notification1",
|
||||
"/org/deepin/dde/Notification1",
|
||||
"org.deepin.dde.Notification1",
|
||||
"SystemInfoChanged",
|
||||
this,
|
||||
SLOT(onSystemInfoChanged(quint32,QDBusVariant))
|
||||
);
|
||||
auto recordCountVariant = m_dbus->property("recordCount");
|
||||
if (!recordCountVariant.isValid()) {
|
||||
qCWarning(qLcPluginNotification) << dnd.error();
|
||||
} else {
|
||||
setNotificationCount(recordCountVariant.toUInt());
|
||||
}
|
||||
QDBusConnection::sessionBus().connect("org.deepin.dde.Notification1",
|
||||
"/org/deepin/dde/Notification1",
|
||||
"org.deepin.dde.Notification1",
|
||||
"recordCountChanged",
|
||||
this,
|
||||
SLOT(setNotificationCount(uint))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
QIcon Notification::icon() const
|
||||
{
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
void Notification::refreshIcon()
|
||||
{
|
||||
m_icon = QIcon::fromTheme(dndMode() ? "notification-off" : "notification");
|
||||
Q_EMIT iconRefreshed();
|
||||
}
|
||||
|
||||
bool Notification::dndMode() const
|
||||
{
|
||||
return m_dndMode;
|
||||
}
|
||||
|
||||
void Notification::setDndMode(bool dnd)
|
||||
{
|
||||
if (m_dbus) {
|
||||
m_dbus->call(QLatin1String("SetSystemInfo"), QVariant::fromValue(0u), QVariant::fromValue(QDBusVariant(dnd)));
|
||||
}
|
||||
}
|
||||
|
||||
uint Notification::notificationCount() const
|
||||
{
|
||||
return m_notificationCount;
|
||||
}
|
||||
|
||||
void Notification::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
QPainter p(this);
|
||||
m_icon.paint(&p, rect());
|
||||
}
|
||||
|
||||
void Notification::onSystemInfoChanged(quint32 info, QDBusVariant value)
|
||||
{
|
||||
if (info == 0) {
|
||||
// DND mode
|
||||
m_dndMode = value.variant().toBool();
|
||||
Q_EMIT dndModeChanged(m_dndMode);
|
||||
}
|
||||
}
|
||||
|
||||
void Notification::setNotificationCount(uint count)
|
||||
{
|
||||
if (m_notificationCount == count) {
|
||||
return;
|
||||
}
|
||||
m_notificationCount = count;
|
||||
Q_EMIT this->notificationCountChanged(count);
|
||||
}
|
51
plugins/notification/notification.h
Normal file
51
plugins/notification/notification.h
Normal file
@ -0,0 +1,51 @@
|
||||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
#ifndef NOTIFICATION_H
|
||||
#define NOTIFICATION_H
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
#include <QDBusVariant>
|
||||
#include <QDBusInterface>
|
||||
|
||||
class Notification : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool dndMode READ dndMode WRITE setDndMode NOTIFY dndModeChanged)
|
||||
Q_PROPERTY(uint notificationCount READ notificationCount NOTIFY notificationCountChanged)
|
||||
|
||||
public:
|
||||
explicit Notification(QWidget *parent = nullptr);
|
||||
QIcon icon() const;
|
||||
|
||||
bool dndMode() const;
|
||||
void setDndMode(bool dnd);
|
||||
uint notificationCount() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void iconRefreshed();
|
||||
void dndModeChanged(bool dnd);
|
||||
void notificationCountChanged(uint count);
|
||||
|
||||
public Q_SLOTS:
|
||||
void refreshIcon();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onSystemInfoChanged(quint32 info, QDBusVariant value);
|
||||
void setNotificationCount(uint count);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
private:
|
||||
QIcon m_icon;
|
||||
uint m_notificationCount;
|
||||
QScopedPointer<QDBusInterface> m_dbus;
|
||||
bool m_dndMode;
|
||||
};
|
||||
|
||||
#endif // NOTIFICATION_H
|
4
plugins/notification/notification.json
Normal file
4
plugins/notification/notification.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"api": "2.0.0",
|
||||
"depends-daemon-dbus-service": "org.deepin.dde.Notification1"
|
||||
}
|
6
plugins/notification/notification.qrc
Normal file
6
plugins/notification/notification.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/dsg/built-in-icons">
|
||||
<file alias="notification.dci">icons/notification.dci</file>
|
||||
<file alias="notification-off.dci">icons/notification-off.dci</file>
|
||||
</qresource>
|
||||
</RCC>
|
182
plugins/notification/notificationplugin.cpp
Normal file
182
plugins/notification/notificationplugin.cpp
Normal file
@ -0,0 +1,182 @@
|
||||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
#include "notificationplugin.h"
|
||||
|
||||
#include <DGuiApplicationHelper>
|
||||
#include <DDBusSender>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QSettings>
|
||||
#include <QPainter>
|
||||
|
||||
Q_LOGGING_CATEGORY(qLcPluginNotification, "dock.plugin.notification")
|
||||
|
||||
#define PLUGIN_STATE_KEY "enable"
|
||||
#define TOGGLE_DND "toggle-dnd"
|
||||
#define NOTIFICATION_SETTINGS "notification-settings"
|
||||
|
||||
DGUI_USE_NAMESPACE
|
||||
using namespace Dock;
|
||||
|
||||
NotificationPlugin::NotificationPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_pluginLoaded(false)
|
||||
, m_notification(nullptr)
|
||||
, m_tipsLabel(new TipsWidget)
|
||||
{
|
||||
m_tipsLabel->setText(tr("No messages"));
|
||||
m_tipsLabel->setVisible(false);
|
||||
m_tipsLabel->setAccessibleName("Notification");
|
||||
m_tipsLabel->setObjectName("NotificationTipsLabel");
|
||||
}
|
||||
|
||||
QWidget *NotificationPlugin::itemWidget(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey)
|
||||
return m_notification.data();
|
||||
}
|
||||
|
||||
QWidget *NotificationPlugin::itemTipsWidget(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
return m_tipsLabel.data();
|
||||
}
|
||||
|
||||
void NotificationPlugin::init(PluginProxyInterface *proxyInter)
|
||||
{
|
||||
m_proxyInter = proxyInter;
|
||||
|
||||
if (!pluginIsDisable()) {
|
||||
loadPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
void NotificationPlugin::pluginStateSwitched()
|
||||
{
|
||||
m_proxyInter->saveValue(this, PLUGIN_STATE_KEY, pluginIsDisable());
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
bool NotificationPlugin::pluginIsDisable()
|
||||
{
|
||||
return !(m_proxyInter->getValue(this, PLUGIN_STATE_KEY, true).toBool());
|
||||
}
|
||||
|
||||
const QString NotificationPlugin::itemCommand(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
return QString("dbus-send --session --print-reply --dest=org.deepin.dde.Widgets1 /org/deepin/dde/Widgets1 org.deepin.dde.Widgets1.Toggle");
|
||||
}
|
||||
|
||||
const QString NotificationPlugin::itemContextMenu(const QString &itemKey)
|
||||
{
|
||||
QList<QVariant> items;
|
||||
QMap<QString, QVariant> toggleDnd;
|
||||
toggleDnd["itemId"] = TOGGLE_DND;
|
||||
toggleDnd["itemText"] = toggleDndText();
|
||||
toggleDnd["isCheckable"] = false;
|
||||
toggleDnd["isActive"] = true;
|
||||
items.push_back(toggleDnd);
|
||||
QMap<QString, QVariant> notificationSettings;
|
||||
notificationSettings["itemId"] = NOTIFICATION_SETTINGS;
|
||||
notificationSettings["itemText"] = tr("Notification settings");
|
||||
notificationSettings["isCheckable"] = false;
|
||||
notificationSettings["isActive"] = true;
|
||||
items.push_back(notificationSettings);
|
||||
QMap<QString, QVariant> menu;
|
||||
menu["items"] = items;
|
||||
menu["checkableMenu"] = false;
|
||||
menu["singleCheck"] = false;
|
||||
return QJsonDocument::fromVariant(menu).toJson();
|
||||
}
|
||||
|
||||
void NotificationPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked)
|
||||
{
|
||||
Q_UNUSED(itemKey)
|
||||
Q_UNUSED(checked)
|
||||
if (menuId == TOGGLE_DND) {
|
||||
m_notification->setDndMode(!m_notification->dndMode());
|
||||
} else if (menuId == NOTIFICATION_SETTINGS) {
|
||||
DDBusSender().service("org.deepin.dde.ControlCenter1")
|
||||
.path("/org/deepin/dde/ControlCenter1")
|
||||
.interface("org.deepin.dde.ControlCenter1")
|
||||
.method("ShowPage")
|
||||
.arg(QString("notification")).call();
|
||||
}
|
||||
}
|
||||
|
||||
int NotificationPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient);
|
||||
return m_proxyInter->getValue(this, key, 3).toInt();
|
||||
}
|
||||
|
||||
void NotificationPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(Dock::Efficient);
|
||||
m_proxyInter->saveValue(this, key, order);
|
||||
}
|
||||
|
||||
void NotificationPlugin::pluginSettingsChanged()
|
||||
{
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
QIcon NotificationPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
Q_UNUSED(themeType)
|
||||
if (dockPart == DockPart::DCCSetting)
|
||||
return QIcon::fromTheme("notification");
|
||||
return m_notification->icon();
|
||||
}
|
||||
|
||||
void NotificationPlugin::loadPlugin()
|
||||
{
|
||||
if (m_pluginLoaded) {
|
||||
return;
|
||||
}
|
||||
m_pluginLoaded = true;
|
||||
m_notification.reset(new Notification);
|
||||
connect(m_notification.data(), &Notification::iconRefreshed, this, [this]() { m_proxyInter->itemUpdate(this, pluginName()); });
|
||||
connect(m_notification.data(), &Notification::notificationCountChanged, this, &NotificationPlugin::updateTipsText);
|
||||
m_proxyInter->itemAdded(this, pluginName());
|
||||
}
|
||||
|
||||
void NotificationPlugin::refreshPluginItemsVisible()
|
||||
{
|
||||
if (pluginIsDisable())
|
||||
{
|
||||
m_proxyInter->itemRemoved(this, pluginName());
|
||||
} else {
|
||||
if (!m_pluginLoaded) {
|
||||
loadPlugin();
|
||||
return;
|
||||
}
|
||||
m_proxyInter->itemAdded(this, pluginName());
|
||||
}
|
||||
}
|
||||
|
||||
void NotificationPlugin::updateTipsText(uint notificationCount)
|
||||
{
|
||||
if (notificationCount == 0) {
|
||||
m_tipsLabel->setText(tr("No messages"));
|
||||
} else {
|
||||
m_tipsLabel->setText(QString("%1 %2").arg(notificationCount).arg(tr("Notifications")));
|
||||
}
|
||||
}
|
||||
|
||||
QString NotificationPlugin::toggleDndText() const
|
||||
{
|
||||
if (m_notification->dndMode()) {
|
||||
return tr("Turn off DND mode");
|
||||
} else {
|
||||
return tr("Turn on DND mode");
|
||||
}
|
||||
}
|
||||
|
||||
void NotificationPlugin::refreshIcon(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey)
|
||||
m_notification->refreshIcon();
|
||||
}
|
55
plugins/notification/notificationplugin.h
Normal file
55
plugins/notification/notificationplugin.h
Normal file
@ -0,0 +1,55 @@
|
||||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
#ifndef NOTIFICATIONPLUGIN_H
|
||||
#define NOTIFICATIONPLUGIN_H
|
||||
#include "pluginsiteminterface.h"
|
||||
#include "notification.h"
|
||||
#include "tipswidget.h"
|
||||
|
||||
class NotificationPlugin : public QObject, public PluginsItemInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginsItemInterface)
|
||||
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "notification.json")
|
||||
|
||||
public:
|
||||
explicit NotificationPlugin(QObject *parent = nullptr);
|
||||
const QString pluginName() const override { return "notification"; }
|
||||
const QString pluginDisplayName() const override { return tr("Notification"); }
|
||||
PluginMode status() const override { return PluginMode::Active; }
|
||||
PluginType type() override { return PluginType::Normal; }
|
||||
PluginFlags flags() const override { return PluginFlag::Type_Common | PluginFlag::Attribute_CanSetting; }
|
||||
QString description() const override { return pluginDisplayName(); }
|
||||
bool pluginIsAllowDisable() override { return true; }
|
||||
|
||||
void init(PluginProxyInterface *proxyInter) override;
|
||||
void pluginStateSwitched() override;
|
||||
bool pluginIsDisable() override;
|
||||
|
||||
QWidget *itemWidget(const QString &itemKey) override;
|
||||
QWidget *itemTipsWidget(const QString &itemKey) override;
|
||||
const QString itemCommand(const QString &itemKey) override;
|
||||
const QString itemContextMenu(const QString &itemKey) override;
|
||||
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
|
||||
|
||||
int itemSortKey(const QString &itemKey) override;
|
||||
void setSortKey(const QString &itemKey, const int order) override;
|
||||
|
||||
void pluginSettingsChanged() override;
|
||||
QIcon icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType) override;
|
||||
void refreshIcon(const QString &itemKey) override;
|
||||
|
||||
private:
|
||||
void loadPlugin();
|
||||
void refreshPluginItemsVisible();
|
||||
void updateTipsText(uint notificationCount);
|
||||
QString toggleDndText() const;
|
||||
|
||||
private:
|
||||
bool m_pluginLoaded;
|
||||
QScopedPointer<Notification> m_notification;
|
||||
QScopedPointer<Dock::TipsWidget> m_tipsLabel;
|
||||
};
|
||||
|
||||
#endif // NOTIFICATIONPLUGIN_H
|
@ -11,6 +11,8 @@
|
||||
#include <QIcon>
|
||||
#include <QSettings>
|
||||
#include <QPainter>
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusConnectionInterface>
|
||||
|
||||
#define PLUGIN_STATE_KEY "enable"
|
||||
|
||||
@ -78,8 +80,14 @@ bool OnboardPlugin::pluginIsDisable()
|
||||
const QString OnboardPlugin::itemCommand(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
|
||||
return QString("dbus-send --print-reply --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.ToggleVisible");
|
||||
auto ifc = QDBusConnection::sessionBus().interface();
|
||||
|
||||
return QStringLiteral(
|
||||
"dbus-send --print-reply --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.%1"
|
||||
).arg(
|
||||
ifc->isServiceRegistered(QStringLiteral("org.onboard.Onboard"))
|
||||
? QStringLiteral("ToggleVisible") : QStringLiteral("Show")
|
||||
);
|
||||
}
|
||||
|
||||
void OnboardPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked)
|
||||
@ -138,16 +146,8 @@ void OnboardPlugin::pluginSettingsChanged()
|
||||
|
||||
QIcon OnboardPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType)
|
||||
{
|
||||
if (dockPart == DockPart::DCCSetting) {
|
||||
if (themeType == DGuiApplicationHelper::ColorType::LightType)
|
||||
return QIcon(":/icons/icon/dcc_keyboard.svg");
|
||||
|
||||
QPixmap pixmap(":/icons/icon/dcc_keyboard.svg");
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), Qt::white);
|
||||
return pixmap;
|
||||
}
|
||||
if (dockPart == DockPart::DCCSetting)
|
||||
return QIcon(":/icons/icon/dcc_keyboard.svg");
|
||||
|
||||
if (dockPart == DockPart::QuickPanel)
|
||||
return m_onboardItem->iconPixmap(QSize(24, 24), themeType);
|
||||
|
@ -417,13 +417,13 @@ PluginsItemInterface *DockPluginController::pluginInterAt(QObject *destItem)
|
||||
void DockPluginController::startLoader(PluginLoader *loader)
|
||||
{
|
||||
connect(loader, &PluginLoader::finished, loader, &PluginLoader::deleteLater, Qt::QueuedConnection);
|
||||
connect(loader, &PluginLoader::pluginFounded, this, [ = ](const QString &pluginFile) {
|
||||
connect(loader, &PluginLoader::pluginFound, this, [ = ](const QString &pluginFile) {
|
||||
QPair<QString, PluginsItemInterface *> pair;
|
||||
pair.first = pluginFile;
|
||||
pair.second = nullptr;
|
||||
m_pluginLoadMap.insert(pair, false);
|
||||
});
|
||||
connect(loader, &PluginLoader::pluginFounded, this, &DockPluginController::loadPlugin, Qt::QueuedConnection);
|
||||
connect(loader, &PluginLoader::pluginFound, this, &DockPluginController::loadPlugin, Qt::QueuedConnection);
|
||||
|
||||
int delay = Utils::SettingValue("com.deepin.dde.dock", "/com/deepin/dde/dock/", "delay-plugins-time", 0).toInt();
|
||||
QTimer::singleShot(delay, loader, [ = ] { loader->start(QThread::LowestPriority); });
|
||||
@ -541,9 +541,7 @@ void DockPluginController::loadPlugin(const QString &pluginFile)
|
||||
// NOTE(justforlxz): 插件的所有初始化工作都在init函数中进行,
|
||||
// loadPlugin函数是按队列执行的,initPlugin函数会有可能导致
|
||||
// 函数执行被阻塞。
|
||||
QTimer::singleShot(1, this, [ = ] {
|
||||
initPlugin(interface);
|
||||
});
|
||||
QMetaObject::invokeMethod(this, std::bind(&DockPluginController::initPlugin, this, interface), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void DockPluginController::initPlugin(PluginsItemInterface *interface)
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QFontMetrics>
|
||||
#include <QPainter>
|
||||
#include <QStringLiteral>
|
||||
|
||||
#define ICONWIDTH 24
|
||||
#define ICONHEIGHT 24
|
||||
@ -92,12 +93,22 @@ void QuickSettingItem::paintEvent(QPaintEvent *e)
|
||||
painter.setClipPath(path);
|
||||
// 绘制背景色
|
||||
QColor backColor(Qt::white);
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::ColorType::DarkType) {
|
||||
backColor = Qt::black;
|
||||
}
|
||||
backColor.setAlphaF(0.5);
|
||||
backColor.setAlphaF(0.1);
|
||||
|
||||
DPalette dpa = DPaletteHelper::instance()->palette(this);
|
||||
painter.fillRect(rect(), backColor);
|
||||
|
||||
QColor borderColor(Qt::black);
|
||||
borderColor.setAlphaF(0.2);
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) {
|
||||
borderColor = QColor(Qt::white);
|
||||
borderColor.setAlphaF(0.15);
|
||||
}
|
||||
|
||||
painter.save();
|
||||
painter.setPen(borderColor);
|
||||
painter.drawRoundedRect(rect(), RADIUS, RADIUS);
|
||||
painter.restore();
|
||||
}
|
||||
|
||||
QColor QuickSettingItem::foregroundColor() const
|
||||
@ -115,6 +126,7 @@ QColor QuickSettingItem::foregroundColor() const
|
||||
|
||||
QuickSettingItem *QuickSettingFactory::createQuickWidget(PluginsItemInterface * const pluginInter, const QString &itemKey)
|
||||
{
|
||||
if (pluginInter->pluginName() == QStringLiteral("uosai")) return nullptr;
|
||||
// 如果显示在面板的图标或者Widget为空,则不让显示(例如电池插件)
|
||||
if (!(pluginInter->flags() & PluginFlag::Type_Common))
|
||||
return nullptr;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <DApplication>
|
||||
|
||||
static constexpr int ICONHEIGHT = 24;
|
||||
static constexpr int ICONWIDTH = 24;
|
||||
@ -26,6 +27,14 @@ StandardQuickItem::StandardQuickItem(PluginsItemInterface *const pluginInter, co
|
||||
, m_needPaint(true)
|
||||
{
|
||||
initUi();
|
||||
auto app = static_cast<DApplication* >(qApp);
|
||||
if (!app) {
|
||||
return;
|
||||
}
|
||||
connect(app, &DApplication::iconThemeChanged, this, [this] {
|
||||
m_needPaint = true;
|
||||
doUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
StandardQuickItem::~StandardQuickItem()
|
||||
@ -91,6 +100,7 @@ QWidget *StandardQuickItem::iconWidget(QWidget *parent)
|
||||
layout->setAlignment(Qt::AlignVCenter);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
layout->addSpacing(6);
|
||||
QLabel *imageLabel = new QLabel(widget);
|
||||
imageLabel->setObjectName("imageLabel");
|
||||
imageLabel->setFixedHeight(ICONHEIGHT);
|
||||
@ -104,7 +114,7 @@ QWidget *StandardQuickItem::iconWidget(QWidget *parent)
|
||||
labelText->setFixedWidth(70);
|
||||
updatePluginName(labelText);
|
||||
layout->addWidget(imageLabel);
|
||||
layout->addSpacing(7);
|
||||
layout->addSpacing(4);
|
||||
layout->addWidget(labelText);
|
||||
}
|
||||
|
||||
|
@ -127,12 +127,6 @@ QIcon ShowDesktopPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::C
|
||||
auto loadsvg = []{ return ImageUtil::loadSvg(":/icons/dcc-show-desktop.svg", QSize(18, 18));};
|
||||
auto icon = QIcon::fromTheme("dcc-show-desktop", loadsvg());
|
||||
QPixmap pixmap = icon.pixmap(QSize(18, 18));
|
||||
if (themeType == DGuiApplicationHelper::ColorType::LightType)
|
||||
return pixmap;
|
||||
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), Qt::white);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ find_package(DtkWidget REQUIRED)
|
||||
# add_definitions("-DDISABLE_POWER_OPTIONS")
|
||||
#endif()
|
||||
pkg_check_modules(QGSettings REQUIRED IMPORTED_TARGET gsettings-qt)
|
||||
pkg_check_modules(Xcursor REQUIRED IMPORTED_TARGET xcursor)
|
||||
|
||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} shutdown.qrc)
|
||||
@ -30,6 +31,7 @@ target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||
${DtkWidget_LIBRARIES}
|
||||
PkgConfig::QGSettings
|
||||
PkgConfig::Xcursor
|
||||
Qt5::Widgets
|
||||
Qt5::DBus
|
||||
Qt5::Svg)
|
||||
|
@ -277,13 +277,6 @@ QIcon ShutdownPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::Colo
|
||||
if (dockPart == DockPart::DCCSetting) {
|
||||
QString iconFile(":/icons/resources/icons/dcc_shutdown.svg");
|
||||
auto pixmap = ImageUtil::loadSvg(iconFile, QSize(18, 18));
|
||||
if (themeType == DGuiApplicationHelper::ColorType::LightType)
|
||||
return pixmap;
|
||||
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), Qt::white);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
@ -172,16 +172,10 @@ void TrashPlugin::pluginSettingsChanged()
|
||||
refreshPluginItemsVisible();
|
||||
}
|
||||
|
||||
QIcon TrashPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType)
|
||||
QIcon TrashPlugin::icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType )
|
||||
{
|
||||
if (dockPart == DockPart::DCCSetting) {
|
||||
auto pixmap = ImageUtil::loadSvg(":/icons/dcc_trash.svg", QSize(18, 18));
|
||||
if (themeType == DGuiApplicationHelper::ColorType::LightType)
|
||||
return pixmap;
|
||||
|
||||
QPainter pa(&pixmap);
|
||||
pa.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||
pa.fillRect(pixmap.rect(), Qt::white);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
792
toolGenerate/dconfig2cpp/com_deepin_dde_dock.hpp
Normal file
792
toolGenerate/dconfig2cpp/com_deepin_dde_dock.hpp
Normal file
@ -0,0 +1,792 @@
|
||||
/**
|
||||
* This file is generated by dconfig2cpp.
|
||||
* Command line arguments: ./dconfig2cpp -p ./dde-dock/toolGenerate/dconfig2cpp ./dde-dock/configs/com.deepin.dde.dock.json
|
||||
* Generation time: 2025-01-14T10:55:02
|
||||
* JSON file version: 1.0
|
||||
*
|
||||
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
|
||||
* If you need to change the content, please modify the dconfig2cpp tool.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_DDE_DOCK_H
|
||||
#define COM_DEEPIN_DDE_DOCK_H
|
||||
|
||||
#include <QThread>
|
||||
#include <QVariant>
|
||||
#include <QDebug>
|
||||
#include <QAtomicPointer>
|
||||
#include <QAtomicInteger>
|
||||
#include <DConfig>
|
||||
|
||||
class com_deepin_dde_dock : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(double Delay_Plugins_Time READ Delay_Plugins_Time WRITE setDelay_Plugins_Time NOTIFY Delay_Plugins_TimeChanged)
|
||||
Q_PROPERTY(QString Display_Mode READ Display_Mode WRITE setDisplay_Mode NOTIFY Display_ModeChanged)
|
||||
Q_PROPERTY(QList<QVariant> Dock_Quick_Plugins READ Dock_Quick_Plugins WRITE setDock_Quick_Plugins NOTIFY Dock_Quick_PluginsChanged)
|
||||
Q_PROPERTY(QList<QVariant> Dock_Quick_Tray_Name READ Dock_Quick_Tray_Name WRITE setDock_Quick_Tray_Name NOTIFY Dock_Quick_Tray_NameChanged)
|
||||
Q_PROPERTY(double Dock_Show_Window_name READ Dock_Show_Window_name WRITE setDock_Show_Window_name NOTIFY Dock_Show_Window_nameChanged)
|
||||
Q_PROPERTY(QList<QVariant> Docked_Apps READ Docked_Apps WRITE setDocked_Apps NOTIFY Docked_AppsChanged)
|
||||
Q_PROPERTY(QString Force_Quit_App READ Force_Quit_App WRITE setForce_Quit_App NOTIFY Force_Quit_AppChanged)
|
||||
Q_PROPERTY(QString Hide_Mode READ Hide_Mode WRITE setHide_Mode NOTIFY Hide_ModeChanged)
|
||||
Q_PROPERTY(double Hide_Timeout READ Hide_Timeout WRITE setHide_Timeout NOTIFY Hide_TimeoutChanged)
|
||||
Q_PROPERTY(double Icon_Size READ Icon_Size WRITE setIcon_Size NOTIFY Icon_SizeChanged)
|
||||
Q_PROPERTY(QString Plugin_Settings READ Plugin_Settings WRITE setPlugin_Settings NOTIFY Plugin_SettingsChanged)
|
||||
Q_PROPERTY(QString Position READ Position WRITE setPosition NOTIFY PositionChanged)
|
||||
Q_PROPERTY(QList<QVariant> Recent_App READ Recent_App WRITE setRecent_App NOTIFY Recent_AppChanged)
|
||||
Q_PROPERTY(bool Show_MultiWindow READ Show_MultiWindow WRITE setShow_MultiWindow NOTIFY Show_MultiWindowChanged)
|
||||
Q_PROPERTY(bool Show_Recent READ Show_Recent WRITE setShow_Recent NOTIFY Show_RecentChanged)
|
||||
Q_PROPERTY(double Show_Timeout READ Show_Timeout WRITE setShow_Timeout NOTIFY Show_TimeoutChanged)
|
||||
Q_PROPERTY(QList<QVariant> Win_Icon_Preferred_Apps READ Win_Icon_Preferred_Apps WRITE setWin_Icon_Preferred_Apps NOTIFY Win_Icon_Preferred_AppsChanged)
|
||||
Q_PROPERTY(double Window_Size_Efficient READ Window_Size_Efficient WRITE setWindow_Size_Efficient NOTIFY Window_Size_EfficientChanged)
|
||||
Q_PROPERTY(double Window_Size_Fashion READ Window_Size_Fashion WRITE setWindow_Size_Fashion NOTIFY Window_Size_FashionChanged)
|
||||
public:
|
||||
explicit com_deepin_dde_dock(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit com_deepin_dde_dock(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit com_deepin_dde_dock(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit com_deepin_dde_dock(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
~com_deepin_dde_dock() {
|
||||
if (m_config.loadRelaxed()) {
|
||||
m_config.loadRelaxed()->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
double Delay_Plugins_Time() const {
|
||||
return p_Delay_Plugins_Time;
|
||||
}
|
||||
void setDelay_Plugins_Time(const double &value) {
|
||||
auto oldValue = p_Delay_Plugins_Time;
|
||||
p_Delay_Plugins_Time = value;
|
||||
markPropertySet(0);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Delay_Plugins_Time"), value);
|
||||
});
|
||||
}
|
||||
if (p_Delay_Plugins_Time != oldValue) {
|
||||
Q_EMIT Delay_Plugins_TimeChanged();
|
||||
}
|
||||
}
|
||||
QString Display_Mode() const {
|
||||
return p_Display_Mode;
|
||||
}
|
||||
void setDisplay_Mode(const QString &value) {
|
||||
auto oldValue = p_Display_Mode;
|
||||
p_Display_Mode = value;
|
||||
markPropertySet(1);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Display_Mode"), value);
|
||||
});
|
||||
}
|
||||
if (p_Display_Mode != oldValue) {
|
||||
Q_EMIT Display_ModeChanged();
|
||||
}
|
||||
}
|
||||
QList<QVariant> Dock_Quick_Plugins() const {
|
||||
return p_Dock_Quick_Plugins;
|
||||
}
|
||||
void setDock_Quick_Plugins(const QList<QVariant> &value) {
|
||||
auto oldValue = p_Dock_Quick_Plugins;
|
||||
p_Dock_Quick_Plugins = value;
|
||||
markPropertySet(2);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Dock_Quick_Plugins"), value);
|
||||
});
|
||||
}
|
||||
if (p_Dock_Quick_Plugins != oldValue) {
|
||||
Q_EMIT Dock_Quick_PluginsChanged();
|
||||
}
|
||||
}
|
||||
QList<QVariant> Dock_Quick_Tray_Name() const {
|
||||
return p_Dock_Quick_Tray_Name;
|
||||
}
|
||||
void setDock_Quick_Tray_Name(const QList<QVariant> &value) {
|
||||
auto oldValue = p_Dock_Quick_Tray_Name;
|
||||
p_Dock_Quick_Tray_Name = value;
|
||||
markPropertySet(3);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Dock_Quick_Tray_Name"), value);
|
||||
});
|
||||
}
|
||||
if (p_Dock_Quick_Tray_Name != oldValue) {
|
||||
Q_EMIT Dock_Quick_Tray_NameChanged();
|
||||
}
|
||||
}
|
||||
double Dock_Show_Window_name() const {
|
||||
return p_Dock_Show_Window_name;
|
||||
}
|
||||
void setDock_Show_Window_name(const double &value) {
|
||||
auto oldValue = p_Dock_Show_Window_name;
|
||||
p_Dock_Show_Window_name = value;
|
||||
markPropertySet(4);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Dock_Show_Window_name"), value);
|
||||
});
|
||||
}
|
||||
if (p_Dock_Show_Window_name != oldValue) {
|
||||
Q_EMIT Dock_Show_Window_nameChanged();
|
||||
}
|
||||
}
|
||||
QList<QVariant> Docked_Apps() const {
|
||||
return p_Docked_Apps;
|
||||
}
|
||||
void setDocked_Apps(const QList<QVariant> &value) {
|
||||
auto oldValue = p_Docked_Apps;
|
||||
p_Docked_Apps = value;
|
||||
markPropertySet(5);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Docked_Apps"), value);
|
||||
});
|
||||
}
|
||||
if (p_Docked_Apps != oldValue) {
|
||||
Q_EMIT Docked_AppsChanged();
|
||||
}
|
||||
}
|
||||
QString Force_Quit_App() const {
|
||||
return p_Force_Quit_App;
|
||||
}
|
||||
void setForce_Quit_App(const QString &value) {
|
||||
auto oldValue = p_Force_Quit_App;
|
||||
p_Force_Quit_App = value;
|
||||
markPropertySet(6);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Force_Quit_App"), value);
|
||||
});
|
||||
}
|
||||
if (p_Force_Quit_App != oldValue) {
|
||||
Q_EMIT Force_Quit_AppChanged();
|
||||
}
|
||||
}
|
||||
QString Hide_Mode() const {
|
||||
return p_Hide_Mode;
|
||||
}
|
||||
void setHide_Mode(const QString &value) {
|
||||
auto oldValue = p_Hide_Mode;
|
||||
p_Hide_Mode = value;
|
||||
markPropertySet(7);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Hide_Mode"), value);
|
||||
});
|
||||
}
|
||||
if (p_Hide_Mode != oldValue) {
|
||||
Q_EMIT Hide_ModeChanged();
|
||||
}
|
||||
}
|
||||
double Hide_Timeout() const {
|
||||
return p_Hide_Timeout;
|
||||
}
|
||||
void setHide_Timeout(const double &value) {
|
||||
auto oldValue = p_Hide_Timeout;
|
||||
p_Hide_Timeout = value;
|
||||
markPropertySet(8);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Hide_Timeout"), value);
|
||||
});
|
||||
}
|
||||
if (p_Hide_Timeout != oldValue) {
|
||||
Q_EMIT Hide_TimeoutChanged();
|
||||
}
|
||||
}
|
||||
double Icon_Size() const {
|
||||
return p_Icon_Size;
|
||||
}
|
||||
void setIcon_Size(const double &value) {
|
||||
auto oldValue = p_Icon_Size;
|
||||
p_Icon_Size = value;
|
||||
markPropertySet(9);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Icon_Size"), value);
|
||||
});
|
||||
}
|
||||
if (p_Icon_Size != oldValue) {
|
||||
Q_EMIT Icon_SizeChanged();
|
||||
}
|
||||
}
|
||||
QString Plugin_Settings() const {
|
||||
return p_Plugin_Settings;
|
||||
}
|
||||
void setPlugin_Settings(const QString &value) {
|
||||
auto oldValue = p_Plugin_Settings;
|
||||
p_Plugin_Settings = value;
|
||||
markPropertySet(10);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Plugin_Settings"), value);
|
||||
});
|
||||
}
|
||||
if (p_Plugin_Settings != oldValue) {
|
||||
Q_EMIT Plugin_SettingsChanged();
|
||||
}
|
||||
}
|
||||
QString Position() const {
|
||||
return p_Position;
|
||||
}
|
||||
void setPosition(const QString &value) {
|
||||
auto oldValue = p_Position;
|
||||
p_Position = value;
|
||||
markPropertySet(11);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Position"), value);
|
||||
});
|
||||
}
|
||||
if (p_Position != oldValue) {
|
||||
Q_EMIT PositionChanged();
|
||||
}
|
||||
}
|
||||
QList<QVariant> Recent_App() const {
|
||||
return p_Recent_App;
|
||||
}
|
||||
void setRecent_App(const QList<QVariant> &value) {
|
||||
auto oldValue = p_Recent_App;
|
||||
p_Recent_App = value;
|
||||
markPropertySet(12);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Recent_App"), value);
|
||||
});
|
||||
}
|
||||
if (p_Recent_App != oldValue) {
|
||||
Q_EMIT Recent_AppChanged();
|
||||
}
|
||||
}
|
||||
bool Show_MultiWindow() const {
|
||||
return p_Show_MultiWindow;
|
||||
}
|
||||
void setShow_MultiWindow(const bool &value) {
|
||||
auto oldValue = p_Show_MultiWindow;
|
||||
p_Show_MultiWindow = value;
|
||||
markPropertySet(13);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Show_MultiWindow"), value);
|
||||
});
|
||||
}
|
||||
if (p_Show_MultiWindow != oldValue) {
|
||||
Q_EMIT Show_MultiWindowChanged();
|
||||
}
|
||||
}
|
||||
bool Show_Recent() const {
|
||||
return p_Show_Recent;
|
||||
}
|
||||
void setShow_Recent(const bool &value) {
|
||||
auto oldValue = p_Show_Recent;
|
||||
p_Show_Recent = value;
|
||||
markPropertySet(14);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Show_Recent"), value);
|
||||
});
|
||||
}
|
||||
if (p_Show_Recent != oldValue) {
|
||||
Q_EMIT Show_RecentChanged();
|
||||
}
|
||||
}
|
||||
double Show_Timeout() const {
|
||||
return p_Show_Timeout;
|
||||
}
|
||||
void setShow_Timeout(const double &value) {
|
||||
auto oldValue = p_Show_Timeout;
|
||||
p_Show_Timeout = value;
|
||||
markPropertySet(15);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Show_Timeout"), value);
|
||||
});
|
||||
}
|
||||
if (p_Show_Timeout != oldValue) {
|
||||
Q_EMIT Show_TimeoutChanged();
|
||||
}
|
||||
}
|
||||
QList<QVariant> Win_Icon_Preferred_Apps() const {
|
||||
return p_Win_Icon_Preferred_Apps;
|
||||
}
|
||||
void setWin_Icon_Preferred_Apps(const QList<QVariant> &value) {
|
||||
auto oldValue = p_Win_Icon_Preferred_Apps;
|
||||
p_Win_Icon_Preferred_Apps = value;
|
||||
markPropertySet(16);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Win_Icon_Preferred_Apps"), value);
|
||||
});
|
||||
}
|
||||
if (p_Win_Icon_Preferred_Apps != oldValue) {
|
||||
Q_EMIT Win_Icon_Preferred_AppsChanged();
|
||||
}
|
||||
}
|
||||
double Window_Size_Efficient() const {
|
||||
return p_Window_Size_Efficient;
|
||||
}
|
||||
void setWindow_Size_Efficient(const double &value) {
|
||||
auto oldValue = p_Window_Size_Efficient;
|
||||
p_Window_Size_Efficient = value;
|
||||
markPropertySet(17);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Window_Size_Efficient"), value);
|
||||
});
|
||||
}
|
||||
if (p_Window_Size_Efficient != oldValue) {
|
||||
Q_EMIT Window_Size_EfficientChanged();
|
||||
}
|
||||
}
|
||||
double Window_Size_Fashion() const {
|
||||
return p_Window_Size_Fashion;
|
||||
}
|
||||
void setWindow_Size_Fashion(const double &value) {
|
||||
auto oldValue = p_Window_Size_Fashion;
|
||||
p_Window_Size_Fashion = value;
|
||||
markPropertySet(18);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("Window_Size_Fashion"), value);
|
||||
});
|
||||
}
|
||||
if (p_Window_Size_Fashion != oldValue) {
|
||||
Q_EMIT Window_Size_FashionChanged();
|
||||
}
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void Delay_Plugins_TimeChanged();
|
||||
void Display_ModeChanged();
|
||||
void Dock_Quick_PluginsChanged();
|
||||
void Dock_Quick_Tray_NameChanged();
|
||||
void Dock_Show_Window_nameChanged();
|
||||
void Docked_AppsChanged();
|
||||
void Force_Quit_AppChanged();
|
||||
void Hide_ModeChanged();
|
||||
void Hide_TimeoutChanged();
|
||||
void Icon_SizeChanged();
|
||||
void Plugin_SettingsChanged();
|
||||
void PositionChanged();
|
||||
void Recent_AppChanged();
|
||||
void Show_MultiWindowChanged();
|
||||
void Show_RecentChanged();
|
||||
void Show_TimeoutChanged();
|
||||
void Win_Icon_Preferred_AppsChanged();
|
||||
void Window_Size_EfficientChanged();
|
||||
void Window_Size_FashionChanged();
|
||||
private:
|
||||
void initialize(DTK_CORE_NAMESPACE::DConfig *config) {
|
||||
Q_ASSERT(!m_config.loadRelaxed());
|
||||
m_config.storeRelaxed(config);
|
||||
if (testPropertySet(0)) {
|
||||
config->setValue(QStringLiteral("Delay_Plugins_Time"), QVariant::fromValue(p_Delay_Plugins_Time));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Delay_Plugins_Time"), QVariant::fromValue(p_Delay_Plugins_Time));
|
||||
}
|
||||
if (testPropertySet(1)) {
|
||||
config->setValue(QStringLiteral("Display_Mode"), QVariant::fromValue(p_Display_Mode));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Display_Mode"), QVariant::fromValue(p_Display_Mode));
|
||||
}
|
||||
if (testPropertySet(2)) {
|
||||
config->setValue(QStringLiteral("Dock_Quick_Plugins"), QVariant::fromValue(p_Dock_Quick_Plugins));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Dock_Quick_Plugins"), QVariant::fromValue(p_Dock_Quick_Plugins));
|
||||
}
|
||||
if (testPropertySet(3)) {
|
||||
config->setValue(QStringLiteral("Dock_Quick_Tray_Name"), QVariant::fromValue(p_Dock_Quick_Tray_Name));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Dock_Quick_Tray_Name"), QVariant::fromValue(p_Dock_Quick_Tray_Name));
|
||||
}
|
||||
if (testPropertySet(4)) {
|
||||
config->setValue(QStringLiteral("Dock_Show_Window_name"), QVariant::fromValue(p_Dock_Show_Window_name));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Dock_Show_Window_name"), QVariant::fromValue(p_Dock_Show_Window_name));
|
||||
}
|
||||
if (testPropertySet(5)) {
|
||||
config->setValue(QStringLiteral("Docked_Apps"), QVariant::fromValue(p_Docked_Apps));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Docked_Apps"), QVariant::fromValue(p_Docked_Apps));
|
||||
}
|
||||
if (testPropertySet(6)) {
|
||||
config->setValue(QStringLiteral("Force_Quit_App"), QVariant::fromValue(p_Force_Quit_App));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Force_Quit_App"), QVariant::fromValue(p_Force_Quit_App));
|
||||
}
|
||||
if (testPropertySet(7)) {
|
||||
config->setValue(QStringLiteral("Hide_Mode"), QVariant::fromValue(p_Hide_Mode));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Hide_Mode"), QVariant::fromValue(p_Hide_Mode));
|
||||
}
|
||||
if (testPropertySet(8)) {
|
||||
config->setValue(QStringLiteral("Hide_Timeout"), QVariant::fromValue(p_Hide_Timeout));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Hide_Timeout"), QVariant::fromValue(p_Hide_Timeout));
|
||||
}
|
||||
if (testPropertySet(9)) {
|
||||
config->setValue(QStringLiteral("Icon_Size"), QVariant::fromValue(p_Icon_Size));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Icon_Size"), QVariant::fromValue(p_Icon_Size));
|
||||
}
|
||||
if (testPropertySet(10)) {
|
||||
config->setValue(QStringLiteral("Plugin_Settings"), QVariant::fromValue(p_Plugin_Settings));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Plugin_Settings"), QVariant::fromValue(p_Plugin_Settings));
|
||||
}
|
||||
if (testPropertySet(11)) {
|
||||
config->setValue(QStringLiteral("Position"), QVariant::fromValue(p_Position));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Position"), QVariant::fromValue(p_Position));
|
||||
}
|
||||
if (testPropertySet(12)) {
|
||||
config->setValue(QStringLiteral("Recent_App"), QVariant::fromValue(p_Recent_App));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Recent_App"), QVariant::fromValue(p_Recent_App));
|
||||
}
|
||||
if (testPropertySet(13)) {
|
||||
config->setValue(QStringLiteral("Show_MultiWindow"), QVariant::fromValue(p_Show_MultiWindow));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Show_MultiWindow"), QVariant::fromValue(p_Show_MultiWindow));
|
||||
}
|
||||
if (testPropertySet(14)) {
|
||||
config->setValue(QStringLiteral("Show_Recent"), QVariant::fromValue(p_Show_Recent));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Show_Recent"), QVariant::fromValue(p_Show_Recent));
|
||||
}
|
||||
if (testPropertySet(15)) {
|
||||
config->setValue(QStringLiteral("Show_Timeout"), QVariant::fromValue(p_Show_Timeout));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Show_Timeout"), QVariant::fromValue(p_Show_Timeout));
|
||||
}
|
||||
if (testPropertySet(16)) {
|
||||
config->setValue(QStringLiteral("Win_Icon_Preferred_Apps"), QVariant::fromValue(p_Win_Icon_Preferred_Apps));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Win_Icon_Preferred_Apps"), QVariant::fromValue(p_Win_Icon_Preferred_Apps));
|
||||
}
|
||||
if (testPropertySet(17)) {
|
||||
config->setValue(QStringLiteral("Window_Size_Efficient"), QVariant::fromValue(p_Window_Size_Efficient));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Window_Size_Efficient"), QVariant::fromValue(p_Window_Size_Efficient));
|
||||
}
|
||||
if (testPropertySet(18)) {
|
||||
config->setValue(QStringLiteral("Window_Size_Fashion"), QVariant::fromValue(p_Window_Size_Fashion));
|
||||
} else {
|
||||
updateValue(QStringLiteral("Window_Size_Fashion"), QVariant::fromValue(p_Window_Size_Fashion));
|
||||
}
|
||||
|
||||
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
||||
updateValue(key);
|
||||
}, Qt::DirectConnection);
|
||||
}
|
||||
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
||||
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
||||
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
||||
if (key == QStringLiteral("Delay_Plugins_Time")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Delay_Plugins_Time != newValue) {
|
||||
p_Delay_Plugins_Time = newValue;
|
||||
Q_EMIT Delay_Plugins_TimeChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Display_Mode")) {
|
||||
auto newValue = qvariant_cast<QString>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Display_Mode != newValue) {
|
||||
p_Display_Mode = newValue;
|
||||
Q_EMIT Display_ModeChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Dock_Quick_Plugins")) {
|
||||
auto newValue = qvariant_cast<QList<QVariant>>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Dock_Quick_Plugins != newValue) {
|
||||
p_Dock_Quick_Plugins = newValue;
|
||||
Q_EMIT Dock_Quick_PluginsChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Dock_Quick_Tray_Name")) {
|
||||
auto newValue = qvariant_cast<QList<QVariant>>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Dock_Quick_Tray_Name != newValue) {
|
||||
p_Dock_Quick_Tray_Name = newValue;
|
||||
Q_EMIT Dock_Quick_Tray_NameChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Dock_Show_Window_name")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Dock_Show_Window_name != newValue) {
|
||||
p_Dock_Show_Window_name = newValue;
|
||||
Q_EMIT Dock_Show_Window_nameChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Docked_Apps")) {
|
||||
auto newValue = qvariant_cast<QList<QVariant>>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Docked_Apps != newValue) {
|
||||
p_Docked_Apps = newValue;
|
||||
Q_EMIT Docked_AppsChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Force_Quit_App")) {
|
||||
auto newValue = qvariant_cast<QString>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Force_Quit_App != newValue) {
|
||||
p_Force_Quit_App = newValue;
|
||||
Q_EMIT Force_Quit_AppChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Hide_Mode")) {
|
||||
auto newValue = qvariant_cast<QString>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Hide_Mode != newValue) {
|
||||
p_Hide_Mode = newValue;
|
||||
Q_EMIT Hide_ModeChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Hide_Timeout")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Hide_Timeout != newValue) {
|
||||
p_Hide_Timeout = newValue;
|
||||
Q_EMIT Hide_TimeoutChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Icon_Size")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Icon_Size != newValue) {
|
||||
p_Icon_Size = newValue;
|
||||
Q_EMIT Icon_SizeChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Plugin_Settings")) {
|
||||
auto newValue = qvariant_cast<QString>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Plugin_Settings != newValue) {
|
||||
p_Plugin_Settings = newValue;
|
||||
Q_EMIT Plugin_SettingsChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Position")) {
|
||||
auto newValue = qvariant_cast<QString>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Position != newValue) {
|
||||
p_Position = newValue;
|
||||
Q_EMIT PositionChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Recent_App")) {
|
||||
auto newValue = qvariant_cast<QList<QVariant>>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Recent_App != newValue) {
|
||||
p_Recent_App = newValue;
|
||||
Q_EMIT Recent_AppChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Show_MultiWindow")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Show_MultiWindow != newValue) {
|
||||
p_Show_MultiWindow = newValue;
|
||||
Q_EMIT Show_MultiWindowChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Show_Recent")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Show_Recent != newValue) {
|
||||
p_Show_Recent = newValue;
|
||||
Q_EMIT Show_RecentChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Show_Timeout")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Show_Timeout != newValue) {
|
||||
p_Show_Timeout = newValue;
|
||||
Q_EMIT Show_TimeoutChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Win_Icon_Preferred_Apps")) {
|
||||
auto newValue = qvariant_cast<QList<QVariant>>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Win_Icon_Preferred_Apps != newValue) {
|
||||
p_Win_Icon_Preferred_Apps = newValue;
|
||||
Q_EMIT Win_Icon_Preferred_AppsChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Window_Size_Efficient")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Window_Size_Efficient != newValue) {
|
||||
p_Window_Size_Efficient = newValue;
|
||||
Q_EMIT Window_Size_EfficientChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("Window_Size_Fashion")) {
|
||||
auto newValue = qvariant_cast<double>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_Window_Size_Fashion != newValue) {
|
||||
p_Window_Size_Fashion = newValue;
|
||||
Q_EMIT Window_Size_FashionChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
inline void markPropertySet(const int index) {
|
||||
if (index < 32) {
|
||||
m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0));
|
||||
return;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
inline bool testPropertySet(const int index) const {
|
||||
if (index < 32) {
|
||||
return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0)));
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
QAtomicPointer<DTK_CORE_NAMESPACE::DConfig> m_config = nullptr;
|
||||
double p_Delay_Plugins_Time { 0 };
|
||||
QString p_Display_Mode { QStringLiteral("fashion") };
|
||||
QList<QVariant> p_Dock_Quick_Plugins { QList<QVariant>{QVariant(QStringLiteral("power")), QVariant(QStringLiteral("network")), QVariant(QStringLiteral("shutdown")), QVariant(QStringLiteral("show-desktop")), QVariant(QStringLiteral("multitasking")), QVariant(QStringLiteral("notification")), QVariant(QStringLiteral("uosai"))} };
|
||||
QList<QVariant> p_Dock_Quick_Tray_Name { QList<QVariant>{QVariant(QStringLiteral("fcitx")), QVariant(QStringLiteral("indicator:keybord_layout"))} };
|
||||
double p_Dock_Show_Window_name { 0 };
|
||||
QList<QVariant> p_Docked_Apps { QList<QVariant>{QVariant(QStringLiteral("/usr/share/applications/dde-file-manager")), QVariant(QStringLiteral("/usr/share/applications/uos-browser")), QVariant(QStringLiteral("/usr/share/applications/org.deepin.browser")), QVariant(QStringLiteral("/usr/share/applications/deepin-appstore")), QVariant(QStringLiteral("/usr/share/applications/deepin-app-store")), QVariant(QStringLiteral("/usr/share/applications/com.deepin.store.intranet")), QVariant(QStringLiteral("/usr/share/applications/deepin-album")), QVariant(QStringLiteral("/usr/share/applications/deepin-music")), QVariant(QStringLiteral("/usr/share/applications/deepin-contacts")), QVariant(QStringLiteral("/usr/share/applications/dde-calendar")), QVariant(QStringLiteral("/usr/share/applications/dde-control-center"))} };
|
||||
QString p_Force_Quit_App { QStringLiteral("enabled") };
|
||||
QString p_Hide_Mode { QStringLiteral("keep-showing") };
|
||||
double p_Hide_Timeout { 0 };
|
||||
double p_Icon_Size { 36 };
|
||||
QString p_Plugin_Settings { QStringLiteral("{}") };
|
||||
QString p_Position { QStringLiteral("bottom") };
|
||||
QList<QVariant> p_Recent_App { QList<QVariant>{} };
|
||||
bool p_Show_MultiWindow { false };
|
||||
bool p_Show_Recent { false };
|
||||
double p_Show_Timeout { 100 };
|
||||
QList<QVariant> p_Win_Icon_Preferred_Apps { QList<QVariant>{QVariant(QStringLiteral("apps.com.qq.im")), QVariant(QStringLiteral("deepin.com.qq.im")), QVariant(QStringLiteral("apps.com.qq.im.light")), QVariant(QStringLiteral("apps.com.qq.b.eim")), QVariant(QStringLiteral("apps.com.qq.rtxclient"))} };
|
||||
double p_Window_Size_Efficient { 40 };
|
||||
double p_Window_Size_Fashion { 48 };
|
||||
QAtomicInteger<quint32> m_propertySetStatus0 = 0;
|
||||
};
|
||||
|
||||
#endif // COM_DEEPIN_DDE_DOCK_H
|
282
toolGenerate/dconfig2cpp/org_deepin_dde_dock_power.hpp
Normal file
282
toolGenerate/dconfig2cpp/org_deepin_dde_dock_power.hpp
Normal file
@ -0,0 +1,282 @@
|
||||
/**
|
||||
* This file is generated by dconfig2cpp.
|
||||
* Command line arguments: ./dconfig2cpp -p ./dde-dock/toolGenerate/dconfig2cpp ./dde-dock/configs/org.deepin.dde.dock.power.json
|
||||
* Generation time: 2025-01-14T10:55:02
|
||||
* JSON file version: 1.0
|
||||
*
|
||||
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
|
||||
* If you need to change the content, please modify the dconfig2cpp tool.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_DOCK_POWER_H
|
||||
#define ORG_DEEPIN_DDE_DOCK_POWER_H
|
||||
|
||||
#include <QThread>
|
||||
#include <QVariant>
|
||||
#include <QDebug>
|
||||
#include <QAtomicPointer>
|
||||
#include <QAtomicInteger>
|
||||
#include <DConfig>
|
||||
|
||||
class org_deepin_dde_dock_power : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool control READ control WRITE setControl NOTIFY controlChanged)
|
||||
Q_PROPERTY(bool enable READ enable WRITE setEnable NOTIFY enableChanged)
|
||||
Q_PROPERTY(bool menu-enable READ menu-enable WRITE setMenu-enable NOTIFY menu-enableChanged)
|
||||
Q_PROPERTY(bool showtimetofull READ showtimetofull WRITE setShowtimetofull NOTIFY showtimetofullChanged)
|
||||
public:
|
||||
explicit org_deepin_dde_dock_power(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit org_deepin_dde_dock_power(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit org_deepin_dde_dock_power(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
explicit org_deepin_dde_dock_power(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr)
|
||||
: QObject(parent) {
|
||||
|
||||
if (!thread->isRunning()) {
|
||||
qWarning() << QStringLiteral("Warning: The provided thread is not running.");
|
||||
}
|
||||
Q_ASSERT(QThread::currentThread() != thread);
|
||||
auto worker = new QObject();
|
||||
worker->moveToThread(thread);
|
||||
QMetaObject::invokeMethod(worker, [=]() {
|
||||
auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr);
|
||||
if (!config) {
|
||||
qWarning() << QStringLiteral("Failed to create DConfig instance.");
|
||||
worker->deleteLater();
|
||||
return;
|
||||
}
|
||||
config->moveToThread(QThread::currentThread());
|
||||
initialize(config);
|
||||
worker->deleteLater();
|
||||
});
|
||||
}
|
||||
~org_deepin_dde_dock_power() {
|
||||
if (m_config.loadRelaxed()) {
|
||||
m_config.loadRelaxed()->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
bool control() const {
|
||||
return p_control;
|
||||
}
|
||||
void setControl(const bool &value) {
|
||||
auto oldValue = p_control;
|
||||
p_control = value;
|
||||
markPropertySet(0);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("control"), value);
|
||||
});
|
||||
}
|
||||
if (p_control != oldValue) {
|
||||
Q_EMIT controlChanged();
|
||||
}
|
||||
}
|
||||
bool enable() const {
|
||||
return p_enable;
|
||||
}
|
||||
void setEnable(const bool &value) {
|
||||
auto oldValue = p_enable;
|
||||
p_enable = value;
|
||||
markPropertySet(1);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("enable"), value);
|
||||
});
|
||||
}
|
||||
if (p_enable != oldValue) {
|
||||
Q_EMIT enableChanged();
|
||||
}
|
||||
}
|
||||
bool menu-enable() const {
|
||||
return p_menu-enable;
|
||||
}
|
||||
void setMenu-enable(const bool &value) {
|
||||
auto oldValue = p_menu-enable;
|
||||
p_menu-enable = value;
|
||||
markPropertySet(2);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("menu-enable"), value);
|
||||
});
|
||||
}
|
||||
if (p_menu-enable != oldValue) {
|
||||
Q_EMIT menu-enableChanged();
|
||||
}
|
||||
}
|
||||
bool showtimetofull() const {
|
||||
return p_showtimetofull;
|
||||
}
|
||||
void setShowtimetofull(const bool &value) {
|
||||
auto oldValue = p_showtimetofull;
|
||||
p_showtimetofull = value;
|
||||
markPropertySet(3);
|
||||
if (auto config = m_config.loadRelaxed()) {
|
||||
QMetaObject::invokeMethod(config, [this, value]() {
|
||||
m_config.loadRelaxed()->setValue(QStringLiteral("showtimetofull"), value);
|
||||
});
|
||||
}
|
||||
if (p_showtimetofull != oldValue) {
|
||||
Q_EMIT showtimetofullChanged();
|
||||
}
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void controlChanged();
|
||||
void enableChanged();
|
||||
void menu-enableChanged();
|
||||
void showtimetofullChanged();
|
||||
private:
|
||||
void initialize(DTK_CORE_NAMESPACE::DConfig *config) {
|
||||
Q_ASSERT(!m_config.loadRelaxed());
|
||||
m_config.storeRelaxed(config);
|
||||
if (testPropertySet(0)) {
|
||||
config->setValue(QStringLiteral("control"), QVariant::fromValue(p_control));
|
||||
} else {
|
||||
updateValue(QStringLiteral("control"), QVariant::fromValue(p_control));
|
||||
}
|
||||
if (testPropertySet(1)) {
|
||||
config->setValue(QStringLiteral("enable"), QVariant::fromValue(p_enable));
|
||||
} else {
|
||||
updateValue(QStringLiteral("enable"), QVariant::fromValue(p_enable));
|
||||
}
|
||||
if (testPropertySet(2)) {
|
||||
config->setValue(QStringLiteral("menu-enable"), QVariant::fromValue(p_menu-enable));
|
||||
} else {
|
||||
updateValue(QStringLiteral("menu-enable"), QVariant::fromValue(p_menu-enable));
|
||||
}
|
||||
if (testPropertySet(3)) {
|
||||
config->setValue(QStringLiteral("showtimetofull"), QVariant::fromValue(p_showtimetofull));
|
||||
} else {
|
||||
updateValue(QStringLiteral("showtimetofull"), QVariant::fromValue(p_showtimetofull));
|
||||
}
|
||||
|
||||
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
|
||||
updateValue(key);
|
||||
}, Qt::DirectConnection);
|
||||
}
|
||||
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
|
||||
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
|
||||
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
|
||||
if (key == QStringLiteral("control")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_control != newValue) {
|
||||
p_control = newValue;
|
||||
Q_EMIT controlChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("enable")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_enable != newValue) {
|
||||
p_enable = newValue;
|
||||
Q_EMIT enableChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("menu-enable")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_menu-enable != newValue) {
|
||||
p_menu-enable = newValue;
|
||||
Q_EMIT menu-enableChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (key == QStringLiteral("showtimetofull")) {
|
||||
auto newValue = qvariant_cast<bool>(value);
|
||||
QMetaObject::invokeMethod(this, [this, newValue]() {
|
||||
if (p_showtimetofull != newValue) {
|
||||
p_showtimetofull = newValue;
|
||||
Q_EMIT showtimetofullChanged();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
inline void markPropertySet(const int index) {
|
||||
if (index < 32) {
|
||||
m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0));
|
||||
return;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
inline bool testPropertySet(const int index) const {
|
||||
if (index < 32) {
|
||||
return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0)));
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
QAtomicPointer<DTK_CORE_NAMESPACE::DConfig> m_config = nullptr;
|
||||
bool p_control { false };
|
||||
bool p_enable { true };
|
||||
bool p_menu-enable { true };
|
||||
bool p_showtimetofull { true };
|
||||
QAtomicInteger<quint32> m_propertySetStatus0 = 0;
|
||||
};
|
||||
|
||||
#endif // ORG_DEEPIN_DDE_DOCK_POWER_H
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/gschema/com.deepin.dde.dock.module.gschema.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschemaAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschema.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschemaAdaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/gschema/com.deepin.dde.dock.module.gschema.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschemaAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschema.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_DDE_DOCK_MODULE_GSCHEMAADAPTOR_H
|
||||
#define COM_DEEPIN_DDE_DOCK_MODULE_GSCHEMAADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.dde.dock.module.gschema.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
365
toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor.cpp
Normal file
365
toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor.cpp
Normal file
@ -0,0 +1,365 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/com.deepin.wm.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wm.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class WmAdaptor
|
||||
*/
|
||||
|
||||
WmAdaptor::WmAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
WmAdaptor::~WmAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool WmAdaptor::compositingAllowSwitch() const
|
||||
{
|
||||
// get the value of property compositingAllowSwitch
|
||||
return qvariant_cast< bool >(parent()->property("compositingAllowSwitch"));
|
||||
}
|
||||
|
||||
bool WmAdaptor::compositingEnabled() const
|
||||
{
|
||||
// get the value of property compositingEnabled
|
||||
return qvariant_cast< bool >(parent()->property("compositingEnabled"));
|
||||
}
|
||||
|
||||
void WmAdaptor::setCompositingEnabled(bool value)
|
||||
{
|
||||
// set the value of property compositingEnabled
|
||||
parent()->setProperty("compositingEnabled", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
bool WmAdaptor::compositingPossible() const
|
||||
{
|
||||
// get the value of property compositingPossible
|
||||
return qvariant_cast< bool >(parent()->property("compositingPossible"));
|
||||
}
|
||||
|
||||
int WmAdaptor::cursorSize() const
|
||||
{
|
||||
// get the value of property cursorSize
|
||||
return qvariant_cast< int >(parent()->property("cursorSize"));
|
||||
}
|
||||
|
||||
void WmAdaptor::setCursorSize(int value)
|
||||
{
|
||||
// set the value of property cursorSize
|
||||
parent()->setProperty("cursorSize", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString WmAdaptor::cursorTheme() const
|
||||
{
|
||||
// get the value of property cursorTheme
|
||||
return qvariant_cast< QString >(parent()->property("cursorTheme"));
|
||||
}
|
||||
|
||||
void WmAdaptor::setCursorTheme(const QString &value)
|
||||
{
|
||||
// set the value of property cursorTheme
|
||||
parent()->setProperty("cursorTheme", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
bool WmAdaptor::zoneEnabled() const
|
||||
{
|
||||
// get the value of property zoneEnabled
|
||||
return qvariant_cast< bool >(parent()->property("zoneEnabled"));
|
||||
}
|
||||
|
||||
void WmAdaptor::setZoneEnabled(bool value)
|
||||
{
|
||||
// set the value of property zoneEnabled
|
||||
parent()->setProperty("zoneEnabled", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
void WmAdaptor::BeginToMoveActiveWindow()
|
||||
{
|
||||
// handle method call com.deepin.wm.BeginToMoveActiveWindow
|
||||
QMetaObject::invokeMethod(parent(), "BeginToMoveActiveWindow");
|
||||
}
|
||||
|
||||
void WmAdaptor::CancelPreviewWindow()
|
||||
{
|
||||
// handle method call com.deepin.wm.CancelPreviewWindow
|
||||
QMetaObject::invokeMethod(parent(), "CancelPreviewWindow");
|
||||
}
|
||||
|
||||
void WmAdaptor::ChangeCurrentWorkspaceBackground(const QString &uri)
|
||||
{
|
||||
// handle method call com.deepin.wm.ChangeCurrentWorkspaceBackground
|
||||
QMetaObject::invokeMethod(parent(), "ChangeCurrentWorkspaceBackground", Q_ARG(QString, uri));
|
||||
}
|
||||
|
||||
void WmAdaptor::EnableZoneDetected(bool enabled)
|
||||
{
|
||||
// handle method call com.deepin.wm.EnableZoneDetected
|
||||
QMetaObject::invokeMethod(parent(), "EnableZoneDetected", Q_ARG(bool, enabled));
|
||||
}
|
||||
|
||||
QStringList WmAdaptor::GetAccel(const QString &id)
|
||||
{
|
||||
// handle method call com.deepin.wm.GetAccel
|
||||
QStringList data;
|
||||
QMetaObject::invokeMethod(parent(), "GetAccel", Q_RETURN_ARG(QStringList, data), Q_ARG(QString, id));
|
||||
return data;
|
||||
}
|
||||
|
||||
QString WmAdaptor::GetAllAccels()
|
||||
{
|
||||
// handle method call com.deepin.wm.GetAllAccels
|
||||
QString data;
|
||||
QMetaObject::invokeMethod(parent(), "GetAllAccels", Q_RETURN_ARG(QString, data));
|
||||
return data;
|
||||
}
|
||||
|
||||
int WmAdaptor::GetCurrentWorkspace()
|
||||
{
|
||||
// handle method call com.deepin.wm.GetCurrentWorkspace
|
||||
int index;
|
||||
QMetaObject::invokeMethod(parent(), "GetCurrentWorkspace", Q_RETURN_ARG(int, index));
|
||||
return index;
|
||||
}
|
||||
|
||||
QString WmAdaptor::GetCurrentWorkspaceBackground()
|
||||
{
|
||||
// handle method call com.deepin.wm.GetCurrentWorkspaceBackground
|
||||
QString result;
|
||||
QMetaObject::invokeMethod(parent(), "GetCurrentWorkspaceBackground", Q_RETURN_ARG(QString, result));
|
||||
return result;
|
||||
}
|
||||
|
||||
QString WmAdaptor::GetCurrentWorkspaceBackgroundForMonitor(const QString &strMonitorName)
|
||||
{
|
||||
// handle method call com.deepin.wm.GetCurrentWorkspaceBackgroundForMonitor
|
||||
QString result;
|
||||
QMetaObject::invokeMethod(parent(), "GetCurrentWorkspaceBackgroundForMonitor", Q_RETURN_ARG(QString, result), Q_ARG(QString, strMonitorName));
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList WmAdaptor::GetDefaultAccel(const QString &id)
|
||||
{
|
||||
// handle method call com.deepin.wm.GetDefaultAccel
|
||||
QStringList data;
|
||||
QMetaObject::invokeMethod(parent(), "GetDefaultAccel", Q_RETURN_ARG(QStringList, data), Q_ARG(QString, id));
|
||||
return data;
|
||||
}
|
||||
|
||||
bool WmAdaptor::GetIsShowDesktop()
|
||||
{
|
||||
// handle method call com.deepin.wm.GetIsShowDesktop
|
||||
bool isShowDesktop;
|
||||
QMetaObject::invokeMethod(parent(), "GetIsShowDesktop", Q_RETURN_ARG(bool, isShowDesktop));
|
||||
return isShowDesktop;
|
||||
}
|
||||
|
||||
bool WmAdaptor::GetMultiTaskingStatus()
|
||||
{
|
||||
// handle method call com.deepin.wm.GetMultiTaskingStatus
|
||||
bool isActive;
|
||||
QMetaObject::invokeMethod(parent(), "GetMultiTaskingStatus", Q_RETURN_ARG(bool, isActive));
|
||||
return isActive;
|
||||
}
|
||||
|
||||
QString WmAdaptor::GetWorkspaceBackground(int index)
|
||||
{
|
||||
// handle method call com.deepin.wm.GetWorkspaceBackground
|
||||
QString result;
|
||||
QMetaObject::invokeMethod(parent(), "GetWorkspaceBackground", Q_RETURN_ARG(QString, result), Q_ARG(int, index));
|
||||
return result;
|
||||
}
|
||||
|
||||
QString WmAdaptor::GetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName)
|
||||
{
|
||||
// handle method call com.deepin.wm.GetWorkspaceBackgroundForMonitor
|
||||
QString result;
|
||||
QMetaObject::invokeMethod(parent(), "GetWorkspaceBackgroundForMonitor", Q_RETURN_ARG(QString, result), Q_ARG(int, index), Q_ARG(QString, strMonitorName));
|
||||
return result;
|
||||
}
|
||||
|
||||
void WmAdaptor::MinimizeActiveWindow()
|
||||
{
|
||||
// handle method call com.deepin.wm.MinimizeActiveWindow
|
||||
QMetaObject::invokeMethod(parent(), "MinimizeActiveWindow");
|
||||
}
|
||||
|
||||
void WmAdaptor::NextWorkspace()
|
||||
{
|
||||
// handle method call com.deepin.wm.NextWorkspace
|
||||
QMetaObject::invokeMethod(parent(), "NextWorkspace");
|
||||
}
|
||||
|
||||
void WmAdaptor::PerformAction(int type)
|
||||
{
|
||||
// handle method call com.deepin.wm.PerformAction
|
||||
QMetaObject::invokeMethod(parent(), "PerformAction", Q_ARG(int, type));
|
||||
}
|
||||
|
||||
void WmAdaptor::PresentWindows(const QList<uint> &xids)
|
||||
{
|
||||
// handle method call com.deepin.wm.PresentWindows
|
||||
QMetaObject::invokeMethod(parent(), "PresentWindows", Q_ARG(QList<uint>, xids));
|
||||
}
|
||||
|
||||
void WmAdaptor::PreviewWindow(uint xid)
|
||||
{
|
||||
// handle method call com.deepin.wm.PreviewWindow
|
||||
QMetaObject::invokeMethod(parent(), "PreviewWindow", Q_ARG(uint, xid));
|
||||
}
|
||||
|
||||
void WmAdaptor::PreviousWorkspace()
|
||||
{
|
||||
// handle method call com.deepin.wm.PreviousWorkspace
|
||||
QMetaObject::invokeMethod(parent(), "PreviousWorkspace");
|
||||
}
|
||||
|
||||
void WmAdaptor::RemoveAccel(const QString &id)
|
||||
{
|
||||
// handle method call com.deepin.wm.RemoveAccel
|
||||
QMetaObject::invokeMethod(parent(), "RemoveAccel", Q_ARG(QString, id));
|
||||
}
|
||||
|
||||
bool WmAdaptor::SetAccel(const QString &data)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetAccel
|
||||
bool result;
|
||||
QMetaObject::invokeMethod(parent(), "SetAccel", Q_RETURN_ARG(bool, result), Q_ARG(QString, data));
|
||||
return result;
|
||||
}
|
||||
|
||||
void WmAdaptor::SetCurrentWorkspace(int index)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetCurrentWorkspace
|
||||
QMetaObject::invokeMethod(parent(), "SetCurrentWorkspace", Q_ARG(int, index));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetCurrentWorkspaceBackground(const QString &uri)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetCurrentWorkspaceBackground
|
||||
QMetaObject::invokeMethod(parent(), "SetCurrentWorkspaceBackground", Q_ARG(QString, uri));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetCurrentWorkspaceBackgroundForMonitor(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetCurrentWorkspaceBackgroundForMonitor
|
||||
QMetaObject::invokeMethod(parent(), "SetCurrentWorkspaceBackgroundForMonitor", Q_ARG(QString, uri), Q_ARG(QString, strMonitorName));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetDecorationDeepinTheme(const QString &deepinThemeName)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetDecorationDeepinTheme
|
||||
QMetaObject::invokeMethod(parent(), "SetDecorationDeepinTheme", Q_ARG(QString, deepinThemeName));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetDecorationTheme(const QString &themeType, const QString &themeName)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetDecorationTheme
|
||||
QMetaObject::invokeMethod(parent(), "SetDecorationTheme", Q_ARG(QString, themeType), Q_ARG(QString, themeName));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetMultiTaskingStatus(bool isActive)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetMultiTaskingStatus
|
||||
QMetaObject::invokeMethod(parent(), "SetMultiTaskingStatus", Q_ARG(bool, isActive));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetShowDesktop(bool isShowDesktop)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetShowDesktop
|
||||
QMetaObject::invokeMethod(parent(), "SetShowDesktop", Q_ARG(bool, isShowDesktop));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetTransientBackground(const QString &in0)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetTransientBackground
|
||||
QMetaObject::invokeMethod(parent(), "SetTransientBackground", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetTransientBackgroundForMonitor(const QString &uri, const QString &strMonitorName)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetTransientBackgroundForMonitor
|
||||
QMetaObject::invokeMethod(parent(), "SetTransientBackgroundForMonitor", Q_ARG(QString, uri), Q_ARG(QString, strMonitorName));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetWorkspaceBackground(int index, const QString &uri)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetWorkspaceBackground
|
||||
QMetaObject::invokeMethod(parent(), "SetWorkspaceBackground", Q_ARG(int, index), Q_ARG(QString, uri));
|
||||
}
|
||||
|
||||
void WmAdaptor::SetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName, const QString &uri)
|
||||
{
|
||||
// handle method call com.deepin.wm.SetWorkspaceBackgroundForMonitor
|
||||
QMetaObject::invokeMethod(parent(), "SetWorkspaceBackgroundForMonitor", Q_ARG(int, index), Q_ARG(QString, strMonitorName), Q_ARG(QString, uri));
|
||||
}
|
||||
|
||||
void WmAdaptor::ShowAllWindow()
|
||||
{
|
||||
// handle method call com.deepin.wm.ShowAllWindow
|
||||
QMetaObject::invokeMethod(parent(), "ShowAllWindow");
|
||||
}
|
||||
|
||||
void WmAdaptor::ShowWindow()
|
||||
{
|
||||
// handle method call com.deepin.wm.ShowWindow
|
||||
QMetaObject::invokeMethod(parent(), "ShowWindow");
|
||||
}
|
||||
|
||||
void WmAdaptor::ShowWorkspace()
|
||||
{
|
||||
// handle method call com.deepin.wm.ShowWorkspace
|
||||
QMetaObject::invokeMethod(parent(), "ShowWorkspace");
|
||||
}
|
||||
|
||||
void WmAdaptor::SwitchApplication(bool backward)
|
||||
{
|
||||
// handle method call com.deepin.wm.SwitchApplication
|
||||
QMetaObject::invokeMethod(parent(), "SwitchApplication", Q_ARG(bool, backward));
|
||||
}
|
||||
|
||||
void WmAdaptor::SwitchToWorkspace(bool backward)
|
||||
{
|
||||
// handle method call com.deepin.wm.SwitchToWorkspace
|
||||
QMetaObject::invokeMethod(parent(), "SwitchToWorkspace", Q_ARG(bool, backward));
|
||||
}
|
||||
|
||||
void WmAdaptor::TileActiveWindow(uint side)
|
||||
{
|
||||
// handle method call com.deepin.wm.TileActiveWindow
|
||||
QMetaObject::invokeMethod(parent(), "TileActiveWindow", Q_ARG(uint, side));
|
||||
}
|
||||
|
||||
void WmAdaptor::ToggleActiveWindowMaximize()
|
||||
{
|
||||
// handle method call com.deepin.wm.ToggleActiveWindowMaximize
|
||||
QMetaObject::invokeMethod(parent(), "ToggleActiveWindowMaximize");
|
||||
}
|
||||
|
||||
int WmAdaptor::WorkspaceCount()
|
||||
{
|
||||
// handle method call com.deepin.wm.WorkspaceCount
|
||||
int count;
|
||||
QMetaObject::invokeMethod(parent(), "WorkspaceCount", Q_RETURN_ARG(int, count));
|
||||
return count;
|
||||
}
|
||||
|
289
toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor.h
Normal file
289
toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor.h
Normal file
@ -0,0 +1,289 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/com.deepin.wm.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wmAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wm.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef COM_DEEPIN_WMADAPTOR_H
|
||||
#define COM_DEEPIN_WMADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/com.deepin.wm.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface com.deepin.wm
|
||||
*/
|
||||
class WmAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "com.deepin.wm")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"com.deepin.wm\">\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"compositingEnabled\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"compositingPossible\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"compositingAllowSwitch\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"zoneEnabled\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"s\" name=\"cursorTheme\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"cursorSize\"/>\n"
|
||||
" <method name=\"SwitchApplication\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"backward\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"TileActiveWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\" name=\"side\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"BeginToMoveActiveWindow\"/>\n"
|
||||
" <method name=\"ToggleActiveWindowMaximize\"/>\n"
|
||||
" <method name=\"MinimizeActiveWindow\"/>\n"
|
||||
" <method name=\"ShowWorkspace\"/>\n"
|
||||
" <method name=\"ShowWindow\"/>\n"
|
||||
" <method name=\"ShowAllWindow\"/>\n"
|
||||
" <method name=\"PerformAction\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"type\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"PreviewWindow\">\n"
|
||||
" <arg direction=\"in\" type=\"u\" name=\"xid\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"CancelPreviewWindow\"/>\n"
|
||||
" <method name=\"GetCurrentWorkspaceBackground\">\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"result\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetCurrentWorkspaceBackground\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetWorkspaceBackground\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"result\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetWorkspaceBackground\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetTransientBackground\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetCurrentWorkspaceBackgroundForMonitor\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"result\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetCurrentWorkspaceBackgroundForMonitor\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetWorkspaceBackgroundForMonitor\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"result\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetWorkspaceBackgroundForMonitor\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetTransientBackgroundForMonitor\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetCurrentWorkspace\">\n"
|
||||
" <arg direction=\"out\" type=\"i\" name=\"index\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"WorkspaceCount\">\n"
|
||||
" <arg direction=\"out\" type=\"i\" name=\"count\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetCurrentWorkspace\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"index\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"PreviousWorkspace\"/>\n"
|
||||
" <method name=\"NextWorkspace\"/>\n"
|
||||
" <method name=\"GetAllAccels\">\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"data\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetAccel\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"id\"/>\n"
|
||||
" <arg direction=\"out\" type=\"as\" name=\"data\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetDefaultAccel\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"id\"/>\n"
|
||||
" <arg direction=\"out\" type=\"as\" name=\"data\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAccel\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"data\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\" name=\"result\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RemoveAccel\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"id\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetDecorationTheme\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"themeType\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"themeName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetDecorationDeepinTheme\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"deepinThemeName\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"WorkspaceBackgroundChanged\">\n"
|
||||
" <arg type=\"i\" name=\"index\"/>\n"
|
||||
" <arg type=\"s\" name=\"newUri\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"WorkspaceBackgroundChangedForMonitor\">\n"
|
||||
" <arg type=\"i\" name=\"index\"/>\n"
|
||||
" <arg type=\"s\" name=\"strMonitorName\"/>\n"
|
||||
" <arg type=\"s\" name=\"uri\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"compositingEnabledChanged\">\n"
|
||||
" <arg type=\"b\" name=\"enabled\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"wmCompositingEnabledChanged\">\n"
|
||||
" <arg type=\"b\" name=\"enabled\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"workspaceCountChanged\">\n"
|
||||
" <arg type=\"i\" name=\"count\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"BeginToMoveActiveWindowChanged\"/>\n"
|
||||
" <signal name=\"SwitchApplicationChanged\">\n"
|
||||
" <arg type=\"b\" name=\"backward\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TileActiveWindowChanged\">\n"
|
||||
" <arg type=\"i\" name=\"side\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"ToggleActiveWindowMaximizeChanged\"/>\n"
|
||||
" <signal name=\"ShowAllWindowChanged\"/>\n"
|
||||
" <signal name=\"ShowWindowChanged\"/>\n"
|
||||
" <signal name=\"ShowWorkspaceChanged\"/>\n"
|
||||
" <signal name=\"ResumeCompositorChanged\">\n"
|
||||
" <arg type=\"i\" name=\"reason\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"SuspendCompositorChanged\">\n"
|
||||
" <arg type=\"i\" name=\"reason\"/>\n"
|
||||
" </signal>\n"
|
||||
" <method name=\"ChangeCurrentWorkspaceBackground\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"uri\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SwitchToWorkspace\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"backward\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"PresentWindows\">\n"
|
||||
" <arg direction=\"in\" type=\"au\" name=\"xids\"/>\n"
|
||||
" <annotation value=\"QList<uint>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"EnableZoneDetected\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"enabled\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"WorkspaceSwitched\">\n"
|
||||
" <arg type=\"i\" name=\"from\"/>\n"
|
||||
" <arg type=\"i\" name=\"to\"/>\n"
|
||||
" </signal>\n"
|
||||
" <method name=\"GetMultiTaskingStatus\">\n"
|
||||
" <arg direction=\"out\" type=\"b\" name=\"isActive\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetMultiTaskingStatus\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"isActive\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetIsShowDesktop\">\n"
|
||||
" <arg direction=\"out\" type=\"b\" name=\"isShowDesktop\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetShowDesktop\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"isShowDesktop\"/>\n"
|
||||
" </method>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
WmAdaptor(QObject *parent);
|
||||
virtual ~WmAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(bool compositingAllowSwitch READ compositingAllowSwitch)
|
||||
bool compositingAllowSwitch() const;
|
||||
|
||||
Q_PROPERTY(bool compositingEnabled READ compositingEnabled WRITE setCompositingEnabled)
|
||||
bool compositingEnabled() const;
|
||||
void setCompositingEnabled(bool value);
|
||||
|
||||
Q_PROPERTY(bool compositingPossible READ compositingPossible)
|
||||
bool compositingPossible() const;
|
||||
|
||||
Q_PROPERTY(int cursorSize READ cursorSize WRITE setCursorSize)
|
||||
int cursorSize() const;
|
||||
void setCursorSize(int value);
|
||||
|
||||
Q_PROPERTY(QString cursorTheme READ cursorTheme WRITE setCursorTheme)
|
||||
QString cursorTheme() const;
|
||||
void setCursorTheme(const QString &value);
|
||||
|
||||
Q_PROPERTY(bool zoneEnabled READ zoneEnabled WRITE setZoneEnabled)
|
||||
bool zoneEnabled() const;
|
||||
void setZoneEnabled(bool value);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void BeginToMoveActiveWindow();
|
||||
void CancelPreviewWindow();
|
||||
void ChangeCurrentWorkspaceBackground(const QString &uri);
|
||||
void EnableZoneDetected(bool enabled);
|
||||
QStringList GetAccel(const QString &id);
|
||||
QString GetAllAccels();
|
||||
int GetCurrentWorkspace();
|
||||
QString GetCurrentWorkspaceBackground();
|
||||
QString GetCurrentWorkspaceBackgroundForMonitor(const QString &strMonitorName);
|
||||
QStringList GetDefaultAccel(const QString &id);
|
||||
bool GetIsShowDesktop();
|
||||
bool GetMultiTaskingStatus();
|
||||
QString GetWorkspaceBackground(int index);
|
||||
QString GetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName);
|
||||
void MinimizeActiveWindow();
|
||||
void NextWorkspace();
|
||||
void PerformAction(int type);
|
||||
void PresentWindows(const QList<uint> &xids);
|
||||
void PreviewWindow(uint xid);
|
||||
void PreviousWorkspace();
|
||||
void RemoveAccel(const QString &id);
|
||||
bool SetAccel(const QString &data);
|
||||
void SetCurrentWorkspace(int index);
|
||||
void SetCurrentWorkspaceBackground(const QString &uri);
|
||||
void SetCurrentWorkspaceBackgroundForMonitor(const QString &uri, const QString &strMonitorName);
|
||||
void SetDecorationDeepinTheme(const QString &deepinThemeName);
|
||||
void SetDecorationTheme(const QString &themeType, const QString &themeName);
|
||||
void SetMultiTaskingStatus(bool isActive);
|
||||
void SetShowDesktop(bool isShowDesktop);
|
||||
void SetTransientBackground(const QString &in0);
|
||||
void SetTransientBackgroundForMonitor(const QString &uri, const QString &strMonitorName);
|
||||
void SetWorkspaceBackground(int index, const QString &uri);
|
||||
void SetWorkspaceBackgroundForMonitor(int index, const QString &strMonitorName, const QString &uri);
|
||||
void ShowAllWindow();
|
||||
void ShowWindow();
|
||||
void ShowWorkspace();
|
||||
void SwitchApplication(bool backward);
|
||||
void SwitchToWorkspace(bool backward);
|
||||
void TileActiveWindow(uint side);
|
||||
void ToggleActiveWindowMaximize();
|
||||
int WorkspaceCount();
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void BeginToMoveActiveWindowChanged();
|
||||
void ResumeCompositorChanged(int reason);
|
||||
void ShowAllWindowChanged();
|
||||
void ShowWindowChanged();
|
||||
void ShowWorkspaceChanged();
|
||||
void SuspendCompositorChanged(int reason);
|
||||
void SwitchApplicationChanged(bool backward);
|
||||
void TileActiveWindowChanged(int side);
|
||||
void ToggleActiveWindowMaximizeChanged();
|
||||
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);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/airplane-mode/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class AirplaneMode1Adaptor
|
||||
*/
|
||||
|
||||
AirplaneMode1Adaptor::AirplaneMode1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
AirplaneMode1Adaptor::~AirplaneMode1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool AirplaneMode1Adaptor::bluetoothEnabled() const
|
||||
{
|
||||
// get the value of property BluetoothEnabled
|
||||
return qvariant_cast< bool >(parent()->property("BluetoothEnabled"));
|
||||
}
|
||||
|
||||
bool AirplaneMode1Adaptor::enabled() const
|
||||
{
|
||||
// get the value of property Enabled
|
||||
return qvariant_cast< bool >(parent()->property("Enabled"));
|
||||
}
|
||||
|
||||
bool AirplaneMode1Adaptor::wifiEnabled() const
|
||||
{
|
||||
// get the value of property WifiEnabled
|
||||
return qvariant_cast< bool >(parent()->property("WifiEnabled"));
|
||||
}
|
||||
|
||||
void AirplaneMode1Adaptor::DumpState()
|
||||
{
|
||||
// handle method call org.deepin.dde.AirplaneMode1.DumpState
|
||||
QMetaObject::invokeMethod(parent(), "DumpState");
|
||||
}
|
||||
|
||||
void AirplaneMode1Adaptor::Enable(bool enabled)
|
||||
{
|
||||
// handle method call org.deepin.dde.AirplaneMode1.Enable
|
||||
QMetaObject::invokeMethod(parent(), "Enable", Q_ARG(bool, enabled));
|
||||
}
|
||||
|
||||
void AirplaneMode1Adaptor::EnableBluetooth(bool enabled)
|
||||
{
|
||||
// handle method call org.deepin.dde.AirplaneMode1.EnableBluetooth
|
||||
QMetaObject::invokeMethod(parent(), "EnableBluetooth", Q_ARG(bool, enabled));
|
||||
}
|
||||
|
||||
void AirplaneMode1Adaptor::EnableWifi(bool enabled)
|
||||
{
|
||||
// handle method call org.deepin.dde.AirplaneMode1.EnableWifi
|
||||
QMetaObject::invokeMethod(parent(), "EnableWifi", Q_ARG(bool, enabled));
|
||||
}
|
||||
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/airplane-mode/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_AIRPLANEMODE1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_AIRPLANEMODE1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.AirplaneMode1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.AirplaneMode1
|
||||
*/
|
||||
class AirplaneMode1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.AirplaneMode1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.AirplaneMode1\">\n"
|
||||
" <method name=\"DumpState\"/>\n"
|
||||
" <method name=\"Enable\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"enabled\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"EnableBluetooth\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"enabled\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"EnableWifi\">\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"enabled\"/>\n"
|
||||
" </method>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"BluetoothEnabled\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"Enabled\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"WifiEnabled\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
AirplaneMode1Adaptor(QObject *parent);
|
||||
virtual ~AirplaneMode1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(bool BluetoothEnabled READ bluetoothEnabled)
|
||||
bool bluetoothEnabled() const;
|
||||
|
||||
Q_PROPERTY(bool Enabled READ enabled)
|
||||
bool enabled() const;
|
||||
|
||||
Q_PROPERTY(bool WifiEnabled READ wifiEnabled)
|
||||
bool wifiEnabled() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void DumpState();
|
||||
void Enable(bool enabled);
|
||||
void EnableBluetooth(bool enabled);
|
||||
void EnableWifi(bool enabled);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
143
toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor.cpp
Normal file
143
toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor.cpp
Normal file
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Appearance1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class Appearance1Adaptor
|
||||
*/
|
||||
|
||||
Appearance1Adaptor::Appearance1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
Appearance1Adaptor::~Appearance1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::background() const
|
||||
{
|
||||
// get the value of property Background
|
||||
return qvariant_cast< QString >(parent()->property("Background"));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::cursorTheme() const
|
||||
{
|
||||
// get the value of property CursorTheme
|
||||
return qvariant_cast< QString >(parent()->property("CursorTheme"));
|
||||
}
|
||||
|
||||
double Appearance1Adaptor::fontSize() const
|
||||
{
|
||||
// get the value of property FontSize
|
||||
return qvariant_cast< double >(parent()->property("FontSize"));
|
||||
}
|
||||
|
||||
void Appearance1Adaptor::setFontSize(double value)
|
||||
{
|
||||
// set the value of property FontSize
|
||||
parent()->setProperty("FontSize", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::globalTheme() const
|
||||
{
|
||||
// get the value of property GlobalTheme
|
||||
return qvariant_cast< QString >(parent()->property("GlobalTheme"));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::gtkTheme() const
|
||||
{
|
||||
// get the value of property GtkTheme
|
||||
return qvariant_cast< QString >(parent()->property("GtkTheme"));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::iconTheme() const
|
||||
{
|
||||
// get the value of property IconTheme
|
||||
return qvariant_cast< QString >(parent()->property("IconTheme"));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::monospaceFont() const
|
||||
{
|
||||
// get the value of property MonospaceFont
|
||||
return qvariant_cast< QString >(parent()->property("MonospaceFont"));
|
||||
}
|
||||
|
||||
double Appearance1Adaptor::opacity() const
|
||||
{
|
||||
// get the value of property Opacity
|
||||
return qvariant_cast< double >(parent()->property("Opacity"));
|
||||
}
|
||||
|
||||
void Appearance1Adaptor::setOpacity(double value)
|
||||
{
|
||||
// set the value of property Opacity
|
||||
parent()->setProperty("Opacity", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::qtActiveColor() const
|
||||
{
|
||||
// get the value of property QtActiveColor
|
||||
return qvariant_cast< QString >(parent()->property("QtActiveColor"));
|
||||
}
|
||||
|
||||
void Appearance1Adaptor::setQtActiveColor(const QString &value)
|
||||
{
|
||||
// set the value of property QtActiveColor
|
||||
parent()->setProperty("QtActiveColor", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::standardFont() const
|
||||
{
|
||||
// get the value of property StandardFont
|
||||
return qvariant_cast< QString >(parent()->property("StandardFont"));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::wallpaperSlideShow() const
|
||||
{
|
||||
// get the value of property WallpaperSlideShow
|
||||
return qvariant_cast< QString >(parent()->property("WallpaperSlideShow"));
|
||||
}
|
||||
|
||||
void Appearance1Adaptor::setWallpaperSlideShow(const QString &value)
|
||||
{
|
||||
// set the value of property WallpaperSlideShow
|
||||
parent()->setProperty("WallpaperSlideShow", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString Appearance1Adaptor::wallpaperURls() const
|
||||
{
|
||||
// get the value of property WallpaperURls
|
||||
return qvariant_cast< QString >(parent()->property("WallpaperURls"));
|
||||
}
|
||||
|
||||
int Appearance1Adaptor::windowRadius() const
|
||||
{
|
||||
// get the value of property WindowRadius
|
||||
return qvariant_cast< int >(parent()->property("WindowRadius"));
|
||||
}
|
||||
|
||||
void Appearance1Adaptor::setWindowRadius(int value)
|
||||
{
|
||||
// set the value of property WindowRadius
|
||||
parent()->setProperty("WindowRadius", QVariant::fromValue(value));
|
||||
}
|
||||
|
113
toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor.h
Normal file
113
toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor.h
Normal file
@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Appearance1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_APPEARANCE1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_APPEARANCE1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Appearance1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Appearance1
|
||||
*/
|
||||
class Appearance1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Appearance1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Appearance1\">\n"
|
||||
" <property access=\"readwrite\" type=\"d\" name=\"FontSize\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"d\" name=\"Opacity\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"WindowRadius\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"Background\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"GlobalTheme\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"GtkTheme\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"IconTheme\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"CursorTheme\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"MonospaceFont\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"s\" name=\"QtActiveColor\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"StandardFont\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"s\" name=\"WallpaperSlideShow\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"WallpaperURls\"/>\n"
|
||||
" <signal name=\"Changed\">\n"
|
||||
" <arg type=\"s\" name=\"ty\"/>\n"
|
||||
" <arg type=\"s\" name=\"value\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"Refreshed\">\n"
|
||||
" <arg type=\"s\" name=\"type\"/>\n"
|
||||
" </signal>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
Appearance1Adaptor(QObject *parent);
|
||||
virtual ~Appearance1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(QString Background READ background)
|
||||
QString background() const;
|
||||
|
||||
Q_PROPERTY(QString CursorTheme READ cursorTheme)
|
||||
QString cursorTheme() const;
|
||||
|
||||
Q_PROPERTY(double FontSize READ fontSize WRITE setFontSize)
|
||||
double fontSize() const;
|
||||
void setFontSize(double value);
|
||||
|
||||
Q_PROPERTY(QString GlobalTheme READ globalTheme)
|
||||
QString globalTheme() const;
|
||||
|
||||
Q_PROPERTY(QString GtkTheme READ gtkTheme)
|
||||
QString gtkTheme() const;
|
||||
|
||||
Q_PROPERTY(QString IconTheme READ iconTheme)
|
||||
QString iconTheme() const;
|
||||
|
||||
Q_PROPERTY(QString MonospaceFont READ monospaceFont)
|
||||
QString monospaceFont() const;
|
||||
|
||||
Q_PROPERTY(double Opacity READ opacity WRITE setOpacity)
|
||||
double opacity() const;
|
||||
void setOpacity(double value);
|
||||
|
||||
Q_PROPERTY(QString QtActiveColor READ qtActiveColor WRITE setQtActiveColor)
|
||||
QString qtActiveColor() const;
|
||||
void setQtActiveColor(const QString &value);
|
||||
|
||||
Q_PROPERTY(QString StandardFont READ standardFont)
|
||||
QString standardFont() const;
|
||||
|
||||
Q_PROPERTY(QString WallpaperSlideShow READ wallpaperSlideShow WRITE setWallpaperSlideShow)
|
||||
QString wallpaperSlideShow() const;
|
||||
void setWallpaperSlideShow(const QString &value);
|
||||
|
||||
Q_PROPERTY(QString WallpaperURls READ wallpaperURls)
|
||||
QString wallpaperURls() const;
|
||||
|
||||
Q_PROPERTY(int WindowRadius READ windowRadius WRITE setWindowRadius)
|
||||
int windowRadius() const;
|
||||
void setWindowRadius(int value);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void Changed(const QString &ty, const QString &value);
|
||||
void Refreshed(const QString &type);
|
||||
};
|
||||
|
||||
#endif
|
145
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor.cpp
Normal file
145
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor.cpp
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Audio1.Sink.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.Sink.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class SinkAdaptor
|
||||
*/
|
||||
|
||||
SinkAdaptor::SinkAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
SinkAdaptor::~SinkAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
AudioPort SinkAdaptor::activePort() const
|
||||
{
|
||||
// get the value of property ActivePort
|
||||
return qvariant_cast< AudioPort >(parent()->property("ActivePort"));
|
||||
}
|
||||
|
||||
double SinkAdaptor::balance() const
|
||||
{
|
||||
// get the value of property Balance
|
||||
return qvariant_cast< double >(parent()->property("Balance"));
|
||||
}
|
||||
|
||||
double SinkAdaptor::baseVolume() const
|
||||
{
|
||||
// get the value of property BaseVolume
|
||||
return qvariant_cast< double >(parent()->property("BaseVolume"));
|
||||
}
|
||||
|
||||
uint SinkAdaptor::card() const
|
||||
{
|
||||
// get the value of property Card
|
||||
return qvariant_cast< uint >(parent()->property("Card"));
|
||||
}
|
||||
|
||||
QString SinkAdaptor::description() const
|
||||
{
|
||||
// get the value of property Description
|
||||
return qvariant_cast< QString >(parent()->property("Description"));
|
||||
}
|
||||
|
||||
double SinkAdaptor::fade() const
|
||||
{
|
||||
// get the value of property Fade
|
||||
return qvariant_cast< double >(parent()->property("Fade"));
|
||||
}
|
||||
|
||||
bool SinkAdaptor::mute() const
|
||||
{
|
||||
// get the value of property Mute
|
||||
return qvariant_cast< bool >(parent()->property("Mute"));
|
||||
}
|
||||
|
||||
QString SinkAdaptor::name() const
|
||||
{
|
||||
// get the value of property Name
|
||||
return qvariant_cast< QString >(parent()->property("Name"));
|
||||
}
|
||||
|
||||
AudioPortList SinkAdaptor::ports() const
|
||||
{
|
||||
// get the value of property Ports
|
||||
return qvariant_cast< AudioPortList >(parent()->property("Ports"));
|
||||
}
|
||||
|
||||
bool SinkAdaptor::supportBalance() const
|
||||
{
|
||||
// get the value of property SupportBalance
|
||||
return qvariant_cast< bool >(parent()->property("SupportBalance"));
|
||||
}
|
||||
|
||||
bool SinkAdaptor::supportFade() const
|
||||
{
|
||||
// get the value of property SupportFade
|
||||
return qvariant_cast< bool >(parent()->property("SupportFade"));
|
||||
}
|
||||
|
||||
double SinkAdaptor::volume() const
|
||||
{
|
||||
// get the value of property Volume
|
||||
return qvariant_cast< double >(parent()->property("Volume"));
|
||||
}
|
||||
|
||||
QDBusObjectPath SinkAdaptor::GetMeter()
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.GetMeter
|
||||
QDBusObjectPath out0;
|
||||
QMetaObject::invokeMethod(parent(), "GetMeter", Q_RETURN_ARG(QDBusObjectPath, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void SinkAdaptor::SetBalance(double in0, bool in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.SetBalance
|
||||
QMetaObject::invokeMethod(parent(), "SetBalance", Q_ARG(double, in0), Q_ARG(bool, in1));
|
||||
}
|
||||
|
||||
void SinkAdaptor::SetFade(double in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.SetFade
|
||||
QMetaObject::invokeMethod(parent(), "SetFade", Q_ARG(double, in0));
|
||||
}
|
||||
|
||||
void SinkAdaptor::SetMute(bool in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.SetMute
|
||||
QMetaObject::invokeMethod(parent(), "SetMute", Q_ARG(bool, in0));
|
||||
}
|
||||
|
||||
void SinkAdaptor::SetPort(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.SetPort
|
||||
QMetaObject::invokeMethod(parent(), "SetPort", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void SinkAdaptor::SetVolume(double in0, bool in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Sink.SetVolume
|
||||
QMetaObject::invokeMethod(parent(), "SetVolume", Q_ARG(double, in0), Q_ARG(bool, in1));
|
||||
}
|
||||
|
125
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor.h
Normal file
125
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor.h
Normal file
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Audio1.Sink.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.SinkAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.Sink.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_AUDIO1_SINKADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_AUDIO1_SINKADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.Sink.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Audio1.Sink
|
||||
*/
|
||||
class SinkAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Audio1.Sink")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Audio1.Sink\">\n"
|
||||
" <method name=\"GetMeter\">\n"
|
||||
" <arg direction=\"out\" type=\"o\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetBalance\">\n"
|
||||
" <arg direction=\"in\" type=\"d\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetFade\">\n"
|
||||
" <arg direction=\"in\" type=\"d\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetMute\">\n"
|
||||
" <arg direction=\"in\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetPort\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetVolume\">\n"
|
||||
" <arg direction=\"in\" type=\"d\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"Name\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"Description\"/>\n"
|
||||
" <property access=\"read\" type=\"d\" name=\"BaseVolume\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"Mute\"/>\n"
|
||||
" <property access=\"read\" type=\"d\" name=\"Volume\"/>\n"
|
||||
" <property access=\"read\" type=\"d\" name=\"Balance\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"SupportBalance\"/>\n"
|
||||
" <property access=\"read\" type=\"d\" name=\"Fade\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"SupportFade\"/>\n"
|
||||
" <property access=\"read\" type=\"a(ssy)\" name=\"Ports\">\n"
|
||||
" <annotation value=\"AudioPortList\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"(ssy)\" name=\"ActivePort\">\n"
|
||||
" <annotation value=\"AudioPort\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"u\" name=\"Card\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
SinkAdaptor(QObject *parent);
|
||||
virtual ~SinkAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(AudioPort ActivePort READ activePort)
|
||||
AudioPort activePort() const;
|
||||
|
||||
Q_PROPERTY(double Balance READ balance)
|
||||
double balance() const;
|
||||
|
||||
Q_PROPERTY(double BaseVolume READ baseVolume)
|
||||
double baseVolume() const;
|
||||
|
||||
Q_PROPERTY(uint Card READ card)
|
||||
uint card() const;
|
||||
|
||||
Q_PROPERTY(QString Description READ description)
|
||||
QString description() const;
|
||||
|
||||
Q_PROPERTY(double Fade READ fade)
|
||||
double fade() const;
|
||||
|
||||
Q_PROPERTY(bool Mute READ mute)
|
||||
bool mute() const;
|
||||
|
||||
Q_PROPERTY(QString Name READ name)
|
||||
QString name() const;
|
||||
|
||||
Q_PROPERTY(AudioPortList Ports READ ports)
|
||||
AudioPortList ports() const;
|
||||
|
||||
Q_PROPERTY(bool SupportBalance READ supportBalance)
|
||||
bool supportBalance() const;
|
||||
|
||||
Q_PROPERTY(bool SupportFade READ supportFade)
|
||||
bool supportFade() const;
|
||||
|
||||
Q_PROPERTY(double Volume READ volume)
|
||||
double volume() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
QDBusObjectPath GetMeter();
|
||||
void SetBalance(double in0, bool in1);
|
||||
void SetFade(double in0);
|
||||
void SetMute(bool in0);
|
||||
void SetPort(const QString &in0);
|
||||
void SetVolume(double in0, bool in1);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
163
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor.cpp
Normal file
163
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor.cpp
Normal file
@ -0,0 +1,163 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Audio1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class Audio1Adaptor
|
||||
*/
|
||||
|
||||
Audio1Adaptor::Audio1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
Audio1Adaptor::~Audio1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
QString Audio1Adaptor::bluetoothAudioMode() const
|
||||
{
|
||||
// get the value of property BluetoothAudioMode
|
||||
return qvariant_cast< QString >(parent()->property("BluetoothAudioMode"));
|
||||
}
|
||||
|
||||
QStringList Audio1Adaptor::bluetoothAudioModeOpts() const
|
||||
{
|
||||
// get the value of property BluetoothAudioModeOpts
|
||||
return qvariant_cast< QStringList >(parent()->property("BluetoothAudioModeOpts"));
|
||||
}
|
||||
|
||||
QString Audio1Adaptor::cards() const
|
||||
{
|
||||
// get the value of property Cards
|
||||
return qvariant_cast< QString >(parent()->property("Cards"));
|
||||
}
|
||||
|
||||
QString Audio1Adaptor::cardsWithoutUnavailable() const
|
||||
{
|
||||
// get the value of property CardsWithoutUnavailable
|
||||
return qvariant_cast< QString >(parent()->property("CardsWithoutUnavailable"));
|
||||
}
|
||||
|
||||
QDBusObjectPath Audio1Adaptor::defaultSink() const
|
||||
{
|
||||
// get the value of property DefaultSink
|
||||
return qvariant_cast< QDBusObjectPath >(parent()->property("DefaultSink"));
|
||||
}
|
||||
|
||||
QDBusObjectPath Audio1Adaptor::defaultSource() const
|
||||
{
|
||||
// get the value of property DefaultSource
|
||||
return qvariant_cast< QDBusObjectPath >(parent()->property("DefaultSource"));
|
||||
}
|
||||
|
||||
bool Audio1Adaptor::increaseVolume() const
|
||||
{
|
||||
// get the value of property IncreaseVolume
|
||||
return qvariant_cast< bool >(parent()->property("IncreaseVolume"));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::setIncreaseVolume(bool value)
|
||||
{
|
||||
// set the value of property IncreaseVolume
|
||||
parent()->setProperty("IncreaseVolume", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
double Audio1Adaptor::maxUIVolume() const
|
||||
{
|
||||
// get the value of property MaxUIVolume
|
||||
return qvariant_cast< double >(parent()->property("MaxUIVolume"));
|
||||
}
|
||||
|
||||
bool Audio1Adaptor::reduceNoise() const
|
||||
{
|
||||
// get the value of property ReduceNoise
|
||||
return qvariant_cast< bool >(parent()->property("ReduceNoise"));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::setReduceNoise(bool value)
|
||||
{
|
||||
// set the value of property ReduceNoise
|
||||
parent()->setProperty("ReduceNoise", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> Audio1Adaptor::sinkInputs() const
|
||||
{
|
||||
// get the value of property SinkInputs
|
||||
return qvariant_cast< QList<QDBusObjectPath> >(parent()->property("SinkInputs"));
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> Audio1Adaptor::sinks() const
|
||||
{
|
||||
// get the value of property Sinks
|
||||
return qvariant_cast< QList<QDBusObjectPath> >(parent()->property("Sinks"));
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> Audio1Adaptor::sources() const
|
||||
{
|
||||
// get the value of property Sources
|
||||
return qvariant_cast< QList<QDBusObjectPath> >(parent()->property("Sources"));
|
||||
}
|
||||
|
||||
bool Audio1Adaptor::IsPortEnabled(uint in0, const QString &in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.IsPortEnabled
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "IsPortEnabled", Q_RETURN_ARG(bool, out0), Q_ARG(uint, in0), Q_ARG(QString, in1));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void Audio1Adaptor::Reset()
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.Reset
|
||||
QMetaObject::invokeMethod(parent(), "Reset");
|
||||
}
|
||||
|
||||
void Audio1Adaptor::SetBluetoothAudioMode(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.SetBluetoothAudioMode
|
||||
QMetaObject::invokeMethod(parent(), "SetBluetoothAudioMode", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::SetDefaultSink(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.SetDefaultSink
|
||||
QMetaObject::invokeMethod(parent(), "SetDefaultSink", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::SetDefaultSource(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.SetDefaultSource
|
||||
QMetaObject::invokeMethod(parent(), "SetDefaultSource", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::SetPort(uint in0, const QString &in1, int in2)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.SetPort
|
||||
QMetaObject::invokeMethod(parent(), "SetPort", Q_ARG(uint, in0), Q_ARG(QString, in1), Q_ARG(int, in2));
|
||||
}
|
||||
|
||||
void Audio1Adaptor::SetPortEnabled(uint in0, const QString &in1, bool in2)
|
||||
{
|
||||
// handle method call org.deepin.dde.Audio1.SetPortEnabled
|
||||
QMetaObject::invokeMethod(parent(), "SetPortEnabled", Q_ARG(uint, in0), Q_ARG(QString, in1), Q_ARG(bool, in2));
|
||||
}
|
||||
|
137
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor.h
Normal file
137
toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor.h
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Audio1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_AUDIO1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_AUDIO1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Audio1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Audio1
|
||||
*/
|
||||
class Audio1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Audio1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Audio1\">\n"
|
||||
" <method name=\"Reset\"/>\n"
|
||||
" <method name=\"SetDefaultSink\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetDefaultSource\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetBluetoothAudioMode\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetPort\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetPortEnabled\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"IsPortEnabled\">\n"
|
||||
" <arg direction=\"in\" type=\"u\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"PortEnabledChanged\">\n"
|
||||
" <arg type=\"u\"/>\n"
|
||||
" <arg type=\"s\"/>\n"
|
||||
" <arg type=\"b\"/>\n"
|
||||
" </signal>\n"
|
||||
" <property access=\"read\" type=\"ao\" name=\"SinkInputs\"/>\n"
|
||||
" <property access=\"read\" type=\"ao\" name=\"Sinks\"/>\n"
|
||||
" <property access=\"read\" type=\"ao\" name=\"Sources\"/>\n"
|
||||
" <property access=\"read\" type=\"as\" name=\"BluetoothAudioModeOpts\">\n"
|
||||
" <annotation value=\"QStringList\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"BluetoothAudioMode\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"Cards\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"CardsWithoutUnavailable\"/>\n"
|
||||
" <property access=\"read\" type=\"o\" name=\"DefaultSink\"/>\n"
|
||||
" <property access=\"read\" type=\"o\" name=\"DefaultSource\"/>\n"
|
||||
" <property access=\"read\" type=\"d\" name=\"MaxUIVolume\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"IncreaseVolume\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"ReduceNoise\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
Audio1Adaptor(QObject *parent);
|
||||
virtual ~Audio1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(QString BluetoothAudioMode READ bluetoothAudioMode)
|
||||
QString bluetoothAudioMode() const;
|
||||
|
||||
Q_PROPERTY(QStringList BluetoothAudioModeOpts READ bluetoothAudioModeOpts)
|
||||
QStringList bluetoothAudioModeOpts() const;
|
||||
|
||||
Q_PROPERTY(QString Cards READ cards)
|
||||
QString cards() const;
|
||||
|
||||
Q_PROPERTY(QString CardsWithoutUnavailable READ cardsWithoutUnavailable)
|
||||
QString cardsWithoutUnavailable() const;
|
||||
|
||||
Q_PROPERTY(QDBusObjectPath DefaultSink READ defaultSink)
|
||||
QDBusObjectPath defaultSink() const;
|
||||
|
||||
Q_PROPERTY(QDBusObjectPath DefaultSource READ defaultSource)
|
||||
QDBusObjectPath defaultSource() const;
|
||||
|
||||
Q_PROPERTY(bool IncreaseVolume READ increaseVolume WRITE setIncreaseVolume)
|
||||
bool increaseVolume() const;
|
||||
void setIncreaseVolume(bool value);
|
||||
|
||||
Q_PROPERTY(double MaxUIVolume READ maxUIVolume)
|
||||
double maxUIVolume() const;
|
||||
|
||||
Q_PROPERTY(bool ReduceNoise READ reduceNoise WRITE setReduceNoise)
|
||||
bool reduceNoise() const;
|
||||
void setReduceNoise(bool value);
|
||||
|
||||
Q_PROPERTY(QList<QDBusObjectPath> SinkInputs READ sinkInputs)
|
||||
QList<QDBusObjectPath> sinkInputs() const;
|
||||
|
||||
Q_PROPERTY(QList<QDBusObjectPath> Sinks READ sinks)
|
||||
QList<QDBusObjectPath> sinks() const;
|
||||
|
||||
Q_PROPERTY(QList<QDBusObjectPath> Sources READ sources)
|
||||
QList<QDBusObjectPath> sources() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
bool IsPortEnabled(uint in0, const QString &in1);
|
||||
void Reset();
|
||||
void SetBluetoothAudioMode(const QString &in0);
|
||||
void SetDefaultSink(const QString &in0);
|
||||
void SetDefaultSource(const QString &in0);
|
||||
void SetPort(uint in0, const QString &in1, int in2);
|
||||
void SetPortEnabled(uint in0, const QString &in1, bool in2);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void PortEnabledChanged(uint in0, const QString &in1, bool in2);
|
||||
};
|
||||
|
||||
#endif
|
193
toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor.cpp
Normal file
193
toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor.cpp
Normal file
@ -0,0 +1,193 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.Bluetooth1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class Bluetooth1Adaptor
|
||||
*/
|
||||
|
||||
Bluetooth1Adaptor::Bluetooth1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
Bluetooth1Adaptor::~Bluetooth1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool Bluetooth1Adaptor::canSendFile() const
|
||||
{
|
||||
// get the value of property CanSendFile
|
||||
return qvariant_cast< bool >(parent()->property("CanSendFile"));
|
||||
}
|
||||
|
||||
bool Bluetooth1Adaptor::displaySwitch() const
|
||||
{
|
||||
// get the value of property DisplaySwitch
|
||||
return qvariant_cast< bool >(parent()->property("DisplaySwitch"));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::setDisplaySwitch(bool value)
|
||||
{
|
||||
// set the value of property DisplaySwitch
|
||||
parent()->setProperty("DisplaySwitch", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
uint Bluetooth1Adaptor::state() const
|
||||
{
|
||||
// get the value of property State
|
||||
return qvariant_cast< uint >(parent()->property("State"));
|
||||
}
|
||||
|
||||
bool Bluetooth1Adaptor::transportable() const
|
||||
{
|
||||
// get the value of property Transportable
|
||||
return qvariant_cast< bool >(parent()->property("Transportable"));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::CancelTransferSession(const QDBusObjectPath &sessionPath)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.CancelTransferSession
|
||||
QMetaObject::invokeMethod(parent(), "CancelTransferSession", Q_ARG(QDBusObjectPath, sessionPath));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::ClearUnpairedDevice()
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.ClearUnpairedDevice
|
||||
QMetaObject::invokeMethod(parent(), "ClearUnpairedDevice");
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::Confirm(const QDBusObjectPath &device, bool accept)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.Confirm
|
||||
QMetaObject::invokeMethod(parent(), "Confirm", Q_ARG(QDBusObjectPath, device), Q_ARG(bool, accept));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::ConnectDevice(const QDBusObjectPath &device, const QDBusObjectPath &adapter)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.ConnectDevice
|
||||
QMetaObject::invokeMethod(parent(), "ConnectDevice", Q_ARG(QDBusObjectPath, device), Q_ARG(QDBusObjectPath, adapter));
|
||||
}
|
||||
|
||||
QString Bluetooth1Adaptor::DebugInfo()
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.DebugInfo
|
||||
QString info;
|
||||
QMetaObject::invokeMethod(parent(), "DebugInfo", Q_RETURN_ARG(QString, info));
|
||||
return info;
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::DisconnectDevice(const QDBusObjectPath &device)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.DisconnectDevice
|
||||
QMetaObject::invokeMethod(parent(), "DisconnectDevice", Q_ARG(QDBusObjectPath, device));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::FeedPasskey(const QDBusObjectPath &device, bool accept, uint passkey)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.FeedPasskey
|
||||
QMetaObject::invokeMethod(parent(), "FeedPasskey", Q_ARG(QDBusObjectPath, device), Q_ARG(bool, accept), Q_ARG(uint, passkey));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::FeedPinCode(const QDBusObjectPath &device, bool accept, const QString &pinCode)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.FeedPinCode
|
||||
QMetaObject::invokeMethod(parent(), "FeedPinCode", Q_ARG(QDBusObjectPath, device), Q_ARG(bool, accept), Q_ARG(QString, pinCode));
|
||||
}
|
||||
|
||||
QString Bluetooth1Adaptor::GetAdapters()
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.GetAdapters
|
||||
QString adaptersJSON;
|
||||
QMetaObject::invokeMethod(parent(), "GetAdapters", Q_RETURN_ARG(QString, adaptersJSON));
|
||||
return adaptersJSON;
|
||||
}
|
||||
|
||||
QString Bluetooth1Adaptor::GetDevices(const QDBusObjectPath &adapter)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.GetDevices
|
||||
QString devicesJSON;
|
||||
QMetaObject::invokeMethod(parent(), "GetDevices", Q_RETURN_ARG(QString, devicesJSON), Q_ARG(QDBusObjectPath, adapter));
|
||||
return devicesJSON;
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::RemoveDevice(const QDBusObjectPath &adapter, const QDBusObjectPath &device)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.RemoveDevice
|
||||
QMetaObject::invokeMethod(parent(), "RemoveDevice", Q_ARG(QDBusObjectPath, adapter), Q_ARG(QDBusObjectPath, device));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::RequestDiscovery(const QDBusObjectPath &adapter)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.RequestDiscovery
|
||||
QMetaObject::invokeMethod(parent(), "RequestDiscovery", Q_ARG(QDBusObjectPath, adapter));
|
||||
}
|
||||
|
||||
QDBusObjectPath Bluetooth1Adaptor::SendFiles(const QString &device, const QStringList &files)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SendFiles
|
||||
QDBusObjectPath sessionPath;
|
||||
QMetaObject::invokeMethod(parent(), "SendFiles", Q_RETURN_ARG(QDBusObjectPath, sessionPath), Q_ARG(QString, device), Q_ARG(QStringList, files));
|
||||
return sessionPath;
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetAdapterAlias(const QDBusObjectPath &adapter, const QString &alias)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetAdapterAlias
|
||||
QMetaObject::invokeMethod(parent(), "SetAdapterAlias", Q_ARG(QDBusObjectPath, adapter), Q_ARG(QString, alias));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetAdapterDiscoverable(const QDBusObjectPath &adapter, bool discoverable)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetAdapterDiscoverable
|
||||
QMetaObject::invokeMethod(parent(), "SetAdapterDiscoverable", Q_ARG(QDBusObjectPath, adapter), Q_ARG(bool, discoverable));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetAdapterDiscoverableTimeout(const QDBusObjectPath &adapter, uint timeout)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetAdapterDiscoverableTimeout
|
||||
QMetaObject::invokeMethod(parent(), "SetAdapterDiscoverableTimeout", Q_ARG(QDBusObjectPath, adapter), Q_ARG(uint, timeout));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetAdapterDiscovering(const QDBusObjectPath &adapter, bool discovering)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetAdapterDiscovering
|
||||
QMetaObject::invokeMethod(parent(), "SetAdapterDiscovering", Q_ARG(QDBusObjectPath, adapter), Q_ARG(bool, discovering));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetAdapterPowered(const QDBusObjectPath &adapter, bool powered)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetAdapterPowered
|
||||
QMetaObject::invokeMethod(parent(), "SetAdapterPowered", Q_ARG(QDBusObjectPath, adapter), Q_ARG(bool, powered));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetDeviceAlias(const QDBusObjectPath &device, const QString &alias)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetDeviceAlias
|
||||
QMetaObject::invokeMethod(parent(), "SetDeviceAlias", Q_ARG(QDBusObjectPath, device), Q_ARG(QString, alias));
|
||||
}
|
||||
|
||||
void Bluetooth1Adaptor::SetDeviceTrusted(const QDBusObjectPath &device, bool trusted)
|
||||
{
|
||||
// handle method call org.deepin.dde.Bluetooth1.SetDeviceTrusted
|
||||
QMetaObject::invokeMethod(parent(), "SetDeviceTrusted", Q_ARG(QDBusObjectPath, device), Q_ARG(bool, trusted));
|
||||
}
|
||||
|
253
toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor.h
Normal file
253
toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor.h
Normal file
@ -0,0 +1,253 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.Bluetooth1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_BLUETOOTH1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_BLUETOOTH1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Bluetooth1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Bluetooth1
|
||||
*/
|
||||
class Bluetooth1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Bluetooth1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Bluetooth1\">\n"
|
||||
" <method name=\"CancelTransferSession\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ClearUnpairedDevice\"/>\n"
|
||||
" <method name=\"Confirm\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"accept\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ConnectDevice\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"DebugInfo\">\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"info\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"DisconnectDevice\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"FeedPasskey\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"accept\"/>\n"
|
||||
" <arg direction=\"in\" type=\"u\" name=\"passkey\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"FeedPinCode\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"accept\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"pinCode\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetAdapters\">\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"adaptersJSON\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetDevices\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\" name=\"devicesJSON\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RemoveDevice\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RequestDiscovery\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SendFiles\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"as\" name=\"files\"/>\n"
|
||||
" <arg direction=\"out\" type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAdapterAlias\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"alias\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAdapterDiscoverable\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"discoverable\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAdapterDiscoverableTimeout\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"u\" name=\"timeout\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAdapterDiscovering\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"discovering\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetAdapterPowered\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"adapter\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"powered\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetDeviceAlias\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"alias\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetDeviceTrusted\">\n"
|
||||
" <arg direction=\"in\" type=\"o\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"trusted\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"AdapterAdded\">\n"
|
||||
" <arg type=\"s\" name=\"adapterJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"AdapterRemoved\">\n"
|
||||
" <arg type=\"s\" name=\"adapterJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"AdapterPropertiesChanged\">\n"
|
||||
" <arg type=\"s\" name=\"adapterJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"DeviceAdded\">\n"
|
||||
" <arg type=\"s\" name=\"devJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"DeviceRemoved\">\n"
|
||||
" <arg type=\"s\" name=\"devJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"DevicePropertiesChanged\">\n"
|
||||
" <arg type=\"s\" name=\"devJSON\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"DisplayPinCode\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" <arg type=\"s\" name=\"pinCode\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"DisplayPasskey\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" <arg type=\"u\" name=\"passkey\"/>\n"
|
||||
" <arg type=\"u\" name=\"entered\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"RequestConfirmation\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" <arg type=\"s\" name=\"passkey\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"RequestAuthorization\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"RequestPinCode\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"RequestPasskey\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"Cancelled\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"ObexSessionCreated\">\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"ObexSessionRemoved\">\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"ObexSessionProgress\">\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" <arg type=\"t\" name=\"totalSize\"/>\n"
|
||||
" <arg type=\"t\" name=\"transferred\"/>\n"
|
||||
" <arg type=\"i\" name=\"currentIdx\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TransferCreated\">\n"
|
||||
" <arg type=\"s\" name=\"file\"/>\n"
|
||||
" <arg type=\"o\" name=\"transferPath\"/>\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TransferRemoved\">\n"
|
||||
" <arg type=\"s\" name=\"file\"/>\n"
|
||||
" <arg type=\"o\" name=\"transferPath\"/>\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" <arg type=\"b\" name=\"done\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TransferFailed\">\n"
|
||||
" <arg type=\"s\" name=\"file\"/>\n"
|
||||
" <arg type=\"o\" name=\"sessionPath\"/>\n"
|
||||
" <arg type=\"s\" name=\"errInfo\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"ConnectFailed\">\n"
|
||||
" <arg type=\"o\" name=\"device\"/>\n"
|
||||
" </signal>\n"
|
||||
" <property access=\"read\" type=\"u\" name=\"State\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"DisplaySwitch\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"Transportable\"/>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"CanSendFile\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
Bluetooth1Adaptor(QObject *parent);
|
||||
virtual ~Bluetooth1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(bool CanSendFile READ canSendFile)
|
||||
bool canSendFile() const;
|
||||
|
||||
Q_PROPERTY(bool DisplaySwitch READ displaySwitch WRITE setDisplaySwitch)
|
||||
bool displaySwitch() const;
|
||||
void setDisplaySwitch(bool value);
|
||||
|
||||
Q_PROPERTY(uint State READ state)
|
||||
uint state() const;
|
||||
|
||||
Q_PROPERTY(bool Transportable READ transportable)
|
||||
bool transportable() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void CancelTransferSession(const QDBusObjectPath &sessionPath);
|
||||
void ClearUnpairedDevice();
|
||||
void Confirm(const QDBusObjectPath &device, bool accept);
|
||||
void ConnectDevice(const QDBusObjectPath &device, const QDBusObjectPath &adapter);
|
||||
QString DebugInfo();
|
||||
void DisconnectDevice(const QDBusObjectPath &device);
|
||||
void FeedPasskey(const QDBusObjectPath &device, bool accept, uint passkey);
|
||||
void FeedPinCode(const QDBusObjectPath &device, bool accept, const QString &pinCode);
|
||||
QString GetAdapters();
|
||||
QString GetDevices(const QDBusObjectPath &adapter);
|
||||
void RemoveDevice(const QDBusObjectPath &adapter, const QDBusObjectPath &device);
|
||||
void RequestDiscovery(const QDBusObjectPath &adapter);
|
||||
QDBusObjectPath SendFiles(const QString &device, const QStringList &files);
|
||||
void SetAdapterAlias(const QDBusObjectPath &adapter, const QString &alias);
|
||||
void SetAdapterDiscoverable(const QDBusObjectPath &adapter, bool discoverable);
|
||||
void SetAdapterDiscoverableTimeout(const QDBusObjectPath &adapter, uint timeout);
|
||||
void SetAdapterDiscovering(const QDBusObjectPath &adapter, bool discovering);
|
||||
void SetAdapterPowered(const QDBusObjectPath &adapter, bool powered);
|
||||
void SetDeviceAlias(const QDBusObjectPath &device, const QString &alias);
|
||||
void SetDeviceTrusted(const QDBusObjectPath &device, bool trusted);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void AdapterAdded(const QString &adapterJSON);
|
||||
void AdapterPropertiesChanged(const QString &adapterJSON);
|
||||
void AdapterRemoved(const QString &adapterJSON);
|
||||
void Cancelled(const QDBusObjectPath &device);
|
||||
void ConnectFailed(const QDBusObjectPath &device);
|
||||
void DeviceAdded(const QString &devJSON);
|
||||
void DevicePropertiesChanged(const QString &devJSON);
|
||||
void DeviceRemoved(const QString &devJSON);
|
||||
void DisplayPasskey(const QDBusObjectPath &device, uint passkey, uint entered);
|
||||
void DisplayPinCode(const QDBusObjectPath &device, const QString &pinCode);
|
||||
void ObexSessionCreated(const QDBusObjectPath &sessionPath);
|
||||
void ObexSessionProgress(const QDBusObjectPath &sessionPath, qulonglong totalSize, qulonglong transferred, int currentIdx);
|
||||
void ObexSessionRemoved(const QDBusObjectPath &sessionPath);
|
||||
void RequestAuthorization(const QDBusObjectPath &device);
|
||||
void RequestConfirmation(const QDBusObjectPath &device, const QString &passkey);
|
||||
void RequestPasskey(const QDBusObjectPath &device);
|
||||
void RequestPinCode(const QDBusObjectPath &device);
|
||||
void TransferCreated(const QString &file, const QDBusObjectPath &transferPath, const QDBusObjectPath &sessionPath);
|
||||
void TransferFailed(const QString &file, const QDBusObjectPath &sessionPath, const QString &errInfo);
|
||||
void TransferRemoved(const QString &file, const QDBusObjectPath &transferPath, const QDBusObjectPath &sessionPath, bool done);
|
||||
};
|
||||
|
||||
#endif
|
251
toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor.cpp
Normal file
251
toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor.cpp
Normal file
@ -0,0 +1,251 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Display1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class Display1Adaptor
|
||||
*/
|
||||
|
||||
Display1Adaptor::Display1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
Display1Adaptor::~Display1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
BrightnessMap Display1Adaptor::brightness() const
|
||||
{
|
||||
// get the value of property Brightness
|
||||
return qvariant_cast< BrightnessMap >(parent()->property("Brightness"));
|
||||
}
|
||||
|
||||
int Display1Adaptor::colorTemperatureManual() const
|
||||
{
|
||||
// get the value of property ColorTemperatureManual
|
||||
return qvariant_cast< int >(parent()->property("ColorTemperatureManual"));
|
||||
}
|
||||
|
||||
int Display1Adaptor::colorTemperatureMode() const
|
||||
{
|
||||
// get the value of property ColorTemperatureMode
|
||||
return qvariant_cast< int >(parent()->property("ColorTemperatureMode"));
|
||||
}
|
||||
|
||||
QString Display1Adaptor::currentCustomId() const
|
||||
{
|
||||
// get the value of property CurrentCustomId
|
||||
return qvariant_cast< QString >(parent()->property("CurrentCustomId"));
|
||||
}
|
||||
|
||||
QStringList Display1Adaptor::customIdList() const
|
||||
{
|
||||
// get the value of property CustomIdList
|
||||
return qvariant_cast< QStringList >(parent()->property("CustomIdList"));
|
||||
}
|
||||
|
||||
uchar Display1Adaptor::displayMode() const
|
||||
{
|
||||
// get the value of property DisplayMode
|
||||
return qvariant_cast< uchar >(parent()->property("DisplayMode"));
|
||||
}
|
||||
|
||||
bool Display1Adaptor::hasChanged() const
|
||||
{
|
||||
// get the value of property HasChanged
|
||||
return qvariant_cast< bool >(parent()->property("HasChanged"));
|
||||
}
|
||||
|
||||
uint Display1Adaptor::maxBacklightBrightness() const
|
||||
{
|
||||
// get the value of property MaxBacklightBrightness
|
||||
return qvariant_cast< uint >(parent()->property("MaxBacklightBrightness"));
|
||||
}
|
||||
|
||||
QList<QDBusObjectPath> Display1Adaptor::monitors() const
|
||||
{
|
||||
// get the value of property Monitors
|
||||
return qvariant_cast< QList<QDBusObjectPath> >(parent()->property("Monitors"));
|
||||
}
|
||||
|
||||
QString Display1Adaptor::primary() const
|
||||
{
|
||||
// get the value of property Primary
|
||||
return qvariant_cast< QString >(parent()->property("Primary"));
|
||||
}
|
||||
|
||||
ScreenRect Display1Adaptor::primaryRect() const
|
||||
{
|
||||
// get the value of property PrimaryRect
|
||||
return qvariant_cast< ScreenRect >(parent()->property("PrimaryRect"));
|
||||
}
|
||||
|
||||
ushort Display1Adaptor::screenHeight() const
|
||||
{
|
||||
// get the value of property ScreenHeight
|
||||
return qvariant_cast< ushort >(parent()->property("ScreenHeight"));
|
||||
}
|
||||
|
||||
ushort Display1Adaptor::screenWidth() const
|
||||
{
|
||||
// get the value of property ScreenWidth
|
||||
return qvariant_cast< ushort >(parent()->property("ScreenWidth"));
|
||||
}
|
||||
|
||||
TouchscreenMap Display1Adaptor::touchMap() const
|
||||
{
|
||||
// get the value of property TouchMap
|
||||
return qvariant_cast< TouchscreenMap >(parent()->property("TouchMap"));
|
||||
}
|
||||
|
||||
TouchscreenInfoList Display1Adaptor::touchscreens() const
|
||||
{
|
||||
// get the value of property Touchscreens
|
||||
return qvariant_cast< TouchscreenInfoList >(parent()->property("Touchscreens"));
|
||||
}
|
||||
|
||||
TouchscreenInfoList_V2 Display1Adaptor::touchscreensV2() const
|
||||
{
|
||||
// get the value of property TouchscreensV2
|
||||
return qvariant_cast< TouchscreenInfoList_V2 >(parent()->property("TouchscreensV2"));
|
||||
}
|
||||
|
||||
void Display1Adaptor::ApplyChanges()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ApplyChanges
|
||||
QMetaObject::invokeMethod(parent(), "ApplyChanges");
|
||||
}
|
||||
|
||||
void Display1Adaptor::AssociateTouch(const QString &in0, const QString &in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.AssociateTouch
|
||||
QMetaObject::invokeMethod(parent(), "AssociateTouch", Q_ARG(QString, in0), Q_ARG(QString, in1));
|
||||
}
|
||||
|
||||
void Display1Adaptor::AssociateTouchByUUID(const QString &in0, const QString &in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.AssociateTouchByUUID
|
||||
QMetaObject::invokeMethod(parent(), "AssociateTouchByUUID", Q_ARG(QString, in0), Q_ARG(QString, in1));
|
||||
}
|
||||
|
||||
void Display1Adaptor::ChangeBrightness(bool in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ChangeBrightness
|
||||
QMetaObject::invokeMethod(parent(), "ChangeBrightness", Q_ARG(bool, in0));
|
||||
}
|
||||
|
||||
void Display1Adaptor::DeleteCustomMode(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.DeleteCustomMode
|
||||
QMetaObject::invokeMethod(parent(), "DeleteCustomMode", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
uchar Display1Adaptor::GetRealDisplayMode()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.GetRealDisplayMode
|
||||
uchar out0;
|
||||
QMetaObject::invokeMethod(parent(), "GetRealDisplayMode", Q_RETURN_ARG(uchar, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
QStringList Display1Adaptor::ListOutputNames()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ListOutputNames
|
||||
QStringList out0;
|
||||
QMetaObject::invokeMethod(parent(), "ListOutputNames", Q_RETURN_ARG(QStringList, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
ResolutionList Display1Adaptor::ListOutputsCommonModes()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ListOutputsCommonModes
|
||||
ResolutionList out0;
|
||||
QMetaObject::invokeMethod(parent(), "ListOutputsCommonModes", Q_RETURN_ARG(ResolutionList, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void Display1Adaptor::ModifyConfigName(const QString &in0, const QString &in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ModifyConfigName
|
||||
QMetaObject::invokeMethod(parent(), "ModifyConfigName", Q_ARG(QString, in0), Q_ARG(QString, in1));
|
||||
}
|
||||
|
||||
void Display1Adaptor::RefreshBrightness()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.RefreshBrightness
|
||||
QMetaObject::invokeMethod(parent(), "RefreshBrightness");
|
||||
}
|
||||
|
||||
void Display1Adaptor::Reset()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.Reset
|
||||
QMetaObject::invokeMethod(parent(), "Reset");
|
||||
}
|
||||
|
||||
void Display1Adaptor::ResetChanges()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.ResetChanges
|
||||
QMetaObject::invokeMethod(parent(), "ResetChanges");
|
||||
}
|
||||
|
||||
void Display1Adaptor::Save()
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.Save
|
||||
QMetaObject::invokeMethod(parent(), "Save");
|
||||
}
|
||||
|
||||
void Display1Adaptor::SetAndSaveBrightness(const QString &in0, double in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SetAndSaveBrightness
|
||||
QMetaObject::invokeMethod(parent(), "SetAndSaveBrightness", Q_ARG(QString, in0), Q_ARG(double, in1));
|
||||
}
|
||||
|
||||
void Display1Adaptor::SetBrightness(const QString &in0, double in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SetBrightness
|
||||
QMetaObject::invokeMethod(parent(), "SetBrightness", Q_ARG(QString, in0), Q_ARG(double, in1));
|
||||
}
|
||||
|
||||
void Display1Adaptor::SetColorTemperature(int in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SetColorTemperature
|
||||
QMetaObject::invokeMethod(parent(), "SetColorTemperature", Q_ARG(int, in0));
|
||||
}
|
||||
|
||||
void Display1Adaptor::SetMethodAdjustCCT(int in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SetMethodAdjustCCT
|
||||
QMetaObject::invokeMethod(parent(), "SetMethodAdjustCCT", Q_ARG(int, in0));
|
||||
}
|
||||
|
||||
void Display1Adaptor::SetPrimary(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SetPrimary
|
||||
QMetaObject::invokeMethod(parent(), "SetPrimary", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void Display1Adaptor::SwitchMode(uchar in0, const QString &in1)
|
||||
{
|
||||
// handle method call org.deepin.dde.Display1.SwitchMode
|
||||
QMetaObject::invokeMethod(parent(), "SwitchMode", Q_ARG(uchar, in0), Q_ARG(QString, in1));
|
||||
}
|
||||
|
194
toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor.h
Normal file
194
toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor.h
Normal file
@ -0,0 +1,194 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Display1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_DISPLAY1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_DISPLAY1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Display1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Display1
|
||||
*/
|
||||
class Display1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Display1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Display1\">\n"
|
||||
" <method name=\"ApplyChanges\"/>\n"
|
||||
" <method name=\"AssociateTouch\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"AssociateTouchByUUID\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ChangeBrightness\">\n"
|
||||
" <arg direction=\"in\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"DeleteCustomMode\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetRealDisplayMode\">\n"
|
||||
" <arg direction=\"out\" type=\"y\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ListOutputNames\">\n"
|
||||
" <arg direction=\"out\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ListOutputsCommonModes\">\n"
|
||||
" <arg direction=\"out\" type=\"a(uqqd)\"/>\n"
|
||||
" <annotation value=\"ResolutionList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ModifyConfigName\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"RefreshBrightness\"/>\n"
|
||||
" <method name=\"Reset\"/>\n"
|
||||
" <method name=\"ResetChanges\"/>\n"
|
||||
" <method name=\"Save\"/>\n"
|
||||
" <method name=\"SetAndSaveBrightness\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"d\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetBrightness\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"in\" type=\"d\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetPrimary\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SwitchMode\">\n"
|
||||
" <arg direction=\"in\" type=\"y\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetMethodAdjustCCT\">\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"SetColorTemperature\">\n"
|
||||
" <arg direction=\"in\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <property access=\"read\" type=\"b\" name=\"HasChanged\"/>\n"
|
||||
" <property access=\"read\" type=\"y\" name=\"DisplayMode\"/>\n"
|
||||
" <property access=\"read\" type=\"q\" name=\"ScreenWidth\"/>\n"
|
||||
" <property access=\"read\" type=\"q\" name=\"ScreenHeight\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"Primary\"/>\n"
|
||||
" <property access=\"read\" type=\"s\" name=\"CurrentCustomId\"/>\n"
|
||||
" <property access=\"read\" type=\"as\" name=\"CustomIdList\"/>\n"
|
||||
" <property access=\"read\" type=\"u\" name=\"MaxBacklightBrightness\"/>\n"
|
||||
" <property access=\"read\" type=\"(nnqq)\" name=\"PrimaryRect\">\n"
|
||||
" <annotation value=\"ScreenRect\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"ao\" name=\"Monitors\"/>\n"
|
||||
" <property access=\"read\" type=\"a{sd}\" name=\"Brightness\">\n"
|
||||
" <annotation value=\"BrightnessMap\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"a(isss)\" name=\"Touchscreens\">\n"
|
||||
" <annotation value=\"TouchscreenInfoList\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"a(issss)\" name=\"TouchscreensV2\">\n"
|
||||
" <annotation value=\"TouchscreenInfoList_V2\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"a{ss}\" name=\"TouchMap\">\n"
|
||||
" <annotation value=\"TouchscreenMap\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <property access=\"read\" type=\"i\" name=\"ColorTemperatureMode\"/>\n"
|
||||
" <property access=\"read\" type=\"i\" name=\"ColorTemperatureManual\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
Display1Adaptor(QObject *parent);
|
||||
virtual ~Display1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(BrightnessMap Brightness READ brightness)
|
||||
BrightnessMap brightness() const;
|
||||
|
||||
Q_PROPERTY(int ColorTemperatureManual READ colorTemperatureManual)
|
||||
int colorTemperatureManual() const;
|
||||
|
||||
Q_PROPERTY(int ColorTemperatureMode READ colorTemperatureMode)
|
||||
int colorTemperatureMode() const;
|
||||
|
||||
Q_PROPERTY(QString CurrentCustomId READ currentCustomId)
|
||||
QString currentCustomId() const;
|
||||
|
||||
Q_PROPERTY(QStringList CustomIdList READ customIdList)
|
||||
QStringList customIdList() const;
|
||||
|
||||
Q_PROPERTY(uchar DisplayMode READ displayMode)
|
||||
uchar displayMode() const;
|
||||
|
||||
Q_PROPERTY(bool HasChanged READ hasChanged)
|
||||
bool hasChanged() const;
|
||||
|
||||
Q_PROPERTY(uint MaxBacklightBrightness READ maxBacklightBrightness)
|
||||
uint maxBacklightBrightness() const;
|
||||
|
||||
Q_PROPERTY(QList<QDBusObjectPath> Monitors READ monitors)
|
||||
QList<QDBusObjectPath> monitors() const;
|
||||
|
||||
Q_PROPERTY(QString Primary READ primary)
|
||||
QString primary() const;
|
||||
|
||||
Q_PROPERTY(ScreenRect PrimaryRect READ primaryRect)
|
||||
ScreenRect primaryRect() const;
|
||||
|
||||
Q_PROPERTY(ushort ScreenHeight READ screenHeight)
|
||||
ushort screenHeight() const;
|
||||
|
||||
Q_PROPERTY(ushort ScreenWidth READ screenWidth)
|
||||
ushort screenWidth() const;
|
||||
|
||||
Q_PROPERTY(TouchscreenMap TouchMap READ touchMap)
|
||||
TouchscreenMap touchMap() const;
|
||||
|
||||
Q_PROPERTY(TouchscreenInfoList Touchscreens READ touchscreens)
|
||||
TouchscreenInfoList touchscreens() const;
|
||||
|
||||
Q_PROPERTY(TouchscreenInfoList_V2 TouchscreensV2 READ touchscreensV2)
|
||||
TouchscreenInfoList_V2 touchscreensV2() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void ApplyChanges();
|
||||
void AssociateTouch(const QString &in0, const QString &in1);
|
||||
void AssociateTouchByUUID(const QString &in0, const QString &in1);
|
||||
void ChangeBrightness(bool in0);
|
||||
void DeleteCustomMode(const QString &in0);
|
||||
uchar GetRealDisplayMode();
|
||||
QStringList ListOutputNames();
|
||||
ResolutionList ListOutputsCommonModes();
|
||||
void ModifyConfigName(const QString &in0, const QString &in1);
|
||||
void RefreshBrightness();
|
||||
void Reset();
|
||||
void ResetChanges();
|
||||
void Save();
|
||||
void SetAndSaveBrightness(const QString &in0, double in1);
|
||||
void SetBrightness(const QString &in0, double in1);
|
||||
void SetColorTemperature(int in0);
|
||||
void SetMethodAdjustCCT(int in0);
|
||||
void SetPrimary(const QString &in0);
|
||||
void SwitchMode(uchar in0, const QString &in1);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
35
toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor.cpp
Normal file
35
toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class Gesture1Adaptor
|
||||
*/
|
||||
|
||||
Gesture1Adaptor::Gesture1Adaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
Gesture1Adaptor::~Gesture1Adaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
76
toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor.h
Normal file
76
toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1Adaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_GESTURE1ADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_GESTURE1ADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.Gesture1.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.Gesture1
|
||||
*/
|
||||
class Gesture1Adaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Gesture1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.Gesture1\">\n"
|
||||
" <signal name=\"TouchSinglePressTimeout\">\n"
|
||||
" <arg type=\"i\" name=\"time\"/>\n"
|
||||
" <arg type=\"d\" name=\"scalex\"/>\n"
|
||||
" <arg type=\"d\" name=\"scaley\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TouchUpOrCancel\">\n"
|
||||
" <arg type=\"d\" name=\"scalex\"/>\n"
|
||||
" <arg type=\"d\" name=\"scaley\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TouchMoving\">\n"
|
||||
" <arg type=\"d\" name=\"scalex\"/>\n"
|
||||
" <arg type=\"d\" name=\"scaley\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TouchPressTimeout\">\n"
|
||||
" <arg type=\"i\" name=\"fingers\"/>\n"
|
||||
" <arg type=\"i\" name=\"time\"/>\n"
|
||||
" <arg type=\"d\" name=\"scalex\"/>\n"
|
||||
" <arg type=\"d\" name=\"scaley\"/>\n"
|
||||
" </signal>\n"
|
||||
" <signal name=\"TouchEdgeEvent\">\n"
|
||||
" <arg type=\"s\" name=\"direction\"/>\n"
|
||||
" <arg type=\"d\" name=\"scalex\"/>\n"
|
||||
" <arg type=\"d\" name=\"scaley\"/>\n"
|
||||
" </signal>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
Gesture1Adaptor(QObject *parent);
|
||||
virtual ~Gesture1Adaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void TouchEdgeEvent(const QString &direction, double scalex, double scaley);
|
||||
void TouchMoving(double scalex, double scaley);
|
||||
void TouchPressTimeout(int fingers, int time, double scalex, double scaley);
|
||||
void TouchSinglePressTimeout(int time, double scalex, double scaley);
|
||||
void TouchUpOrCancel(double scalex, double scaley);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,183 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/keyboard-layout/dbusinterface/xml/org.deepin.dde.InputDevice1.Keyboard.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.KeyboardAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.Keyboard.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.KeyboardAdaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class KeyboardAdaptor
|
||||
*/
|
||||
|
||||
KeyboardAdaptor::KeyboardAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
KeyboardAdaptor::~KeyboardAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
bool KeyboardAdaptor::capslockToggle() const
|
||||
{
|
||||
// get the value of property CapslockToggle
|
||||
return qvariant_cast< bool >(parent()->property("CapslockToggle"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setCapslockToggle(bool value)
|
||||
{
|
||||
// set the value of property CapslockToggle
|
||||
parent()->setProperty("CapslockToggle", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QString KeyboardAdaptor::currentLayout() const
|
||||
{
|
||||
// get the value of property CurrentLayout
|
||||
return qvariant_cast< QString >(parent()->property("CurrentLayout"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setCurrentLayout(const QString &value)
|
||||
{
|
||||
// set the value of property CurrentLayout
|
||||
parent()->setProperty("CurrentLayout", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
int KeyboardAdaptor::cursorBlink() const
|
||||
{
|
||||
// get the value of property CursorBlink
|
||||
return qvariant_cast< int >(parent()->property("CursorBlink"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setCursorBlink(int value)
|
||||
{
|
||||
// set the value of property CursorBlink
|
||||
parent()->setProperty("CursorBlink", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
int KeyboardAdaptor::layoutScope() const
|
||||
{
|
||||
// get the value of property LayoutScope
|
||||
return qvariant_cast< int >(parent()->property("LayoutScope"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setLayoutScope(int value)
|
||||
{
|
||||
// set the value of property LayoutScope
|
||||
parent()->setProperty("LayoutScope", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
uint KeyboardAdaptor::repeatDelay() const
|
||||
{
|
||||
// get the value of property RepeatDelay
|
||||
return qvariant_cast< uint >(parent()->property("RepeatDelay"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setRepeatDelay(uint value)
|
||||
{
|
||||
// set the value of property RepeatDelay
|
||||
parent()->setProperty("RepeatDelay", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
bool KeyboardAdaptor::repeatEnabled() const
|
||||
{
|
||||
// get the value of property RepeatEnabled
|
||||
return qvariant_cast< bool >(parent()->property("RepeatEnabled"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setRepeatEnabled(bool value)
|
||||
{
|
||||
// set the value of property RepeatEnabled
|
||||
parent()->setProperty("RepeatEnabled", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
uint KeyboardAdaptor::repeatInterval() const
|
||||
{
|
||||
// get the value of property RepeatInterval
|
||||
return qvariant_cast< uint >(parent()->property("RepeatInterval"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::setRepeatInterval(uint value)
|
||||
{
|
||||
// set the value of property RepeatInterval
|
||||
parent()->setProperty("RepeatInterval", QVariant::fromValue(value));
|
||||
}
|
||||
|
||||
QStringList KeyboardAdaptor::userLayoutList() const
|
||||
{
|
||||
// get the value of property UserLayoutList
|
||||
return qvariant_cast< QStringList >(parent()->property("UserLayoutList"));
|
||||
}
|
||||
|
||||
QStringList KeyboardAdaptor::userOptionList() const
|
||||
{
|
||||
// get the value of property UserOptionList
|
||||
return qvariant_cast< QStringList >(parent()->property("UserOptionList"));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::AddLayoutOption(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.AddLayoutOption
|
||||
QMetaObject::invokeMethod(parent(), "AddLayoutOption", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::AddUserLayout(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.AddUserLayout
|
||||
QMetaObject::invokeMethod(parent(), "AddUserLayout", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::ClearLayoutOption()
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.ClearLayoutOption
|
||||
QMetaObject::invokeMethod(parent(), "ClearLayoutOption");
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::DeleteLayoutOption(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.DeleteLayoutOption
|
||||
QMetaObject::invokeMethod(parent(), "DeleteLayoutOption", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::DeleteUserLayout(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.DeleteUserLayout
|
||||
QMetaObject::invokeMethod(parent(), "DeleteUserLayout", Q_ARG(QString, in0));
|
||||
}
|
||||
|
||||
QString KeyboardAdaptor::GetLayoutDesc(const QString &in0)
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.GetLayoutDesc
|
||||
QString out0;
|
||||
QMetaObject::invokeMethod(parent(), "GetLayoutDesc", Q_RETURN_ARG(QString, out0), Q_ARG(QString, in0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
KeyboardLayoutList KeyboardAdaptor::LayoutList()
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.LayoutList
|
||||
KeyboardLayoutList out0;
|
||||
QMetaObject::invokeMethod(parent(), "LayoutList", Q_RETURN_ARG(KeyboardLayoutList, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
void KeyboardAdaptor::Reset()
|
||||
{
|
||||
// handle method call org.deepin.dde.InputDevice1.Keyboard.Reset
|
||||
QMetaObject::invokeMethod(parent(), "Reset");
|
||||
}
|
||||
|
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp ./dde-dock/plugins/keyboard-layout/dbusinterface/xml/org.deepin.dde.InputDevice1.Keyboard.xml -a ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.KeyboardAdaptor -i ./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.Keyboard.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#ifndef ORG_DEEPIN_DDE_INPUTDEVICE1_KEYBOARDADAPTOR_H
|
||||
#define ORG_DEEPIN_DDE_INPUTDEVICE1_KEYBOARDADAPTOR_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "./dde-dock/toolGenerate/qdbusxml2cpp/org.deepin.dde.InputDevice1.Keyboard.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.deepin.dde.InputDevice1.Keyboard
|
||||
*/
|
||||
class KeyboardAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.InputDevice1.Keyboard")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.dde.InputDevice1.Keyboard\">\n"
|
||||
" <method name=\"AddLayoutOption\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"AddUserLayout\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ClearLayoutOption\"/>\n"
|
||||
" <method name=\"DeleteLayoutOption\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"DeleteUserLayout\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"GetLayoutDesc\">\n"
|
||||
" <arg direction=\"in\" type=\"s\"/>\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"LayoutList\">\n"
|
||||
" <arg direction=\"out\" type=\"a{ss}\"/>\n"
|
||||
" <annotation value=\"KeyboardLayoutList\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"Reset\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"RepeatEnabled\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"b\" name=\"CapslockToggle\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"CursorBlink\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"RepeatInterval\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"u\" name=\"RepeatDelay\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"i\" name=\"LayoutScope\"/>\n"
|
||||
" <property access=\"readwrite\" type=\"s\" name=\"CurrentLayout\"/>\n"
|
||||
" <property access=\"read\" type=\"as\" name=\"UserLayoutList\"/>\n"
|
||||
" <property access=\"read\" type=\"as\" name=\"UserOptionList\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
KeyboardAdaptor(QObject *parent);
|
||||
virtual ~KeyboardAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(bool CapslockToggle READ capslockToggle WRITE setCapslockToggle)
|
||||
bool capslockToggle() const;
|
||||
void setCapslockToggle(bool value);
|
||||
|
||||
Q_PROPERTY(QString CurrentLayout READ currentLayout WRITE setCurrentLayout)
|
||||
QString currentLayout() const;
|
||||
void setCurrentLayout(const QString &value);
|
||||
|
||||
Q_PROPERTY(int CursorBlink READ cursorBlink WRITE setCursorBlink)
|
||||
int cursorBlink() const;
|
||||
void setCursorBlink(int value);
|
||||
|
||||
Q_PROPERTY(int LayoutScope READ layoutScope WRITE setLayoutScope)
|
||||
int layoutScope() const;
|
||||
void setLayoutScope(int value);
|
||||
|
||||
Q_PROPERTY(uint RepeatDelay READ repeatDelay WRITE setRepeatDelay)
|
||||
uint repeatDelay() const;
|
||||
void setRepeatDelay(uint value);
|
||||
|
||||
Q_PROPERTY(bool RepeatEnabled READ repeatEnabled WRITE setRepeatEnabled)
|
||||
bool repeatEnabled() const;
|
||||
void setRepeatEnabled(bool value);
|
||||
|
||||
Q_PROPERTY(uint RepeatInterval READ repeatInterval WRITE setRepeatInterval)
|
||||
uint repeatInterval() const;
|
||||
void setRepeatInterval(uint value);
|
||||
|
||||
Q_PROPERTY(QStringList UserLayoutList READ userLayoutList)
|
||||
QStringList userLayoutList() const;
|
||||
|
||||
Q_PROPERTY(QStringList UserOptionList READ userOptionList)
|
||||
QStringList userOptionList() const;
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
void AddLayoutOption(const QString &in0);
|
||||
void AddUserLayout(const QString &in0);
|
||||
void ClearLayoutOption();
|
||||
void DeleteLayoutOption(const QString &in0);
|
||||
void DeleteUserLayout(const QString &in0);
|
||||
QString GetLayoutDesc(const QString &in0);
|
||||
KeyboardLayoutList LayoutList();
|
||||
void Reset();
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user