| 1 | /* |
| 2 | * Copyright (C) 2016 Canonical, Ltd. |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify it under |
| 5 | * the terms of the GNU Lesser General Public License version 3, as published by |
| 6 | * the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
| 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | * Lesser General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU Lesser General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | |
| 17 | #include "registry.h"cxx . . $ `<file>/src/lomiriappmenu/registry.h`/ |
| 18 | #include "logging.h"cxx . . $ `<file>/src/lomiriappmenu/logging.h`/ |
| 19 | #include "menuregistrar_interface.h"cxx . . $ `<file>/src/lomiriappmenu/menuregistrar_interface.h`/ |
| 20 | |
| 21 | #include <QDBusObjectPath> |
| 22 | #include <QDBusServiceWatcher> |
| 23 | |
| 24 | Q_LOGGING_CATEGORYcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:114:9`!(lomiriappmenuRegistrar, "lomiriappmenu.registrar", QtWarningMsg) |
| 25 | |
| 26 | #define REGISTRAR_SERVICEcxx . . $ `src/lomiriappmenu/registry.cpp:26:9`! "com.lomiri.MenuRegistrar" |
| 27 | #define REGISTRY_OBJECT_PATHcxx . . $ `src/lomiriappmenu/registry.cpp:27:9`! "/com/lomiri/MenuRegistrar" |
| 28 | |
| 29 | LomiriMenuRegistrycxx . . $ LomiriMenuRegistry# *LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::instancecxx . . $ LomiriMenuRegistry#instance(b0a1ce46fb707340).() |
| 30 | { |
| 31 | static LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#* registry(new LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#()); |
| 32 | return registry; |
| 33 | } |
| 34 | |
| 35 | LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#LomiriMenuRegistry(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) |
| 36 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 37 | , m_serviceWatchercxx . . $ LomiriMenuRegistry#m_serviceWatcher.(new QDBusServiceWatchercxx . . $ QDBusServiceWatcher#QDBusServiceWatcher(32062b066f491ab2).(REGISTRAR_SERVICEcxx . . $ `src/lomiriappmenu/registry.cpp:26:9`!, QDBusConnectioncxx . . $ QDBusConnection#::sessionBuscxx . . $ QDBusConnection#sessionBus(45d475f1888103b2).(), QDBusServiceWatchercxx . . $ QFlags#QFlags(9b289cee16747614).::WatchForOwnerChangecxx . . $ QDBusServiceWatcher#WatchForOwnerChange., this)) |
| 38 | , m_interfacecxx . . $ LomiriMenuRegistry#m_interface.(new ComLomiriMenuRegistrarInterfacecxx . . $ ComLomiriMenuRegistrarInterface#ComLomiriMenuRegistrarInterface(efb8a75220d7552f).(REGISTRAR_SERVICEcxx . . $ `src/lomiriappmenu/registry.cpp:26:9`!, REGISTRY_OBJECT_PATHcxx . . $ `src/lomiriappmenu/registry.cpp:27:9`!, QDBusConnectioncxx . . $ QDBusConnection#::sessionBuscxx . . $ QDBusConnection#sessionBus(45d475f1888103b2).(), this)) |
| 39 | , m_connectedcxx . . $ LomiriMenuRegistry#m_connected.(m_interfacecxx . . $ LomiriMenuRegistry#m_interface.->cxx . . $ QScopedPointer#`operator->`(5a2a78a048fb49a8).isValidcxx . . $ QDBusAbstractInterface#isValid(50ce9a9e25b4a850).()) |
| 40 | { |
| 41 | connectcxx . . $ QObject#connect(835f87066c895669).(m_serviceWatchercxx . . $ LomiriMenuRegistry#m_serviceWatcher..datacxx . . $ QScopedPointer#data(5a2a78a048fb49a8).(), &QDBusServiceWatchercxx . . $ QDBusServiceWatcher#::serviceOwnerChangedcxx . . $ QDBusServiceWatcher#serviceOwnerChanged(9f9ceb6f9de3a67b)., this, &LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::serviceOwnerChangedcxx . . $ LomiriMenuRegistry#serviceOwnerChanged(9f9ceb6f9de3a67b).); |
| 42 | } |
| 43 | |
| 44 | LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::~cxx . . $ LomiriMenuRegistry#`~LomiriMenuRegistry`(49f6e7a06ebc5aa8).LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#() |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | void LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::registerApplicationMenucxx . . $ LomiriMenuRegistry#registerApplicationMenu(d940720556290bb7).(pid_t pid, QDBusObjectPathcxx . . $ QDBusObjectPath# menuObjectPath, const QStringcxx . . $ QString# &service) |
| 49 | { |
| 50 | qCDebugcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:122:11`!(lomiriappmenuRegistrar, "LomiriMenuRegistry::registerMenu(pid=%d, menuObjectPath=%s, service=%s)", |
| 51 | pid, |
| 52 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(menuObjectPath.path()), |
| 53 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(service)); |
| 54 | |
| 55 | m_interfacecxx . . $ LomiriMenuRegistry#m_interface.->cxx . . $ QScopedPointer#`operator->`(5a2a78a048fb49a8).RegisterAppMenucxx . . $ ComLomiriMenuRegistrarInterface#RegisterAppMenu(81a50a97a76ce2e8).(pid, menuObjectPath, menuObjectPath, service); |
| 56 | } |
| 57 | |
| 58 | void LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::unregisterApplicationMenucxx . . $ LomiriMenuRegistry#unregisterApplicationMenu(ed291af23ed92a62).(pid_t pid, QDBusObjectPathcxx . . $ QDBusObjectPath# menuObjectPath) |
| 59 | { |
| 60 | qCDebugcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:122:11`!(lomiriappmenuRegistrar, "LomiriMenuRegistry::unregisterSurfaceMenu(pid=%d, menuObjectPath=%s)", |
| 61 | pid, |
| 62 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(menuObjectPath.path())); |
| 63 | |
| 64 | m_interfacecxx . . $ LomiriMenuRegistry#m_interface.->cxx . . $ QScopedPointer#`operator->`(5a2a78a048fb49a8).UnregisterAppMenucxx . . $ ComLomiriMenuRegistrarInterface#UnregisterAppMenu(c0047c6d6ff3e4da).(pid, menuObjectPath); |
| 65 | } |
| 66 | |
| 67 | void LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::registerSurfaceMenucxx . . $ LomiriMenuRegistry#registerSurfaceMenu(ea9db58ee935b3e8).(const QStringcxx . . $ QString# &surfaceId, QDBusObjectPathcxx . . $ QDBusObjectPath# menuObjectPath, const QStringcxx . . $ QString# &service) |
| 68 | { |
| 69 | qCDebugcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:122:11`!(lomiriappmenuRegistrar, "LomiriMenuRegistry::registerMenu(surfaceId=%s, menuObjectPath=%s, service=%s)", |
| 70 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(surfaceId), |
| 71 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(menuObjectPath.path()), |
| 72 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(service)); |
| 73 | |
| 74 | m_interfacecxx . . $ LomiriMenuRegistry#m_interface.->cxx . . $ QScopedPointer#`operator->`(5a2a78a048fb49a8).RegisterSurfaceMenucxx . . $ ComLomiriMenuRegistrarInterface#RegisterSurfaceMenu(19b1699c178b0a2e).(surfaceId, menuObjectPath, menuObjectPath, service); |
| 75 | } |
| 76 | |
| 77 | void LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::unregisterSurfaceMenucxx . . $ LomiriMenuRegistry#unregisterSurfaceMenu(88b147b41fa0c21e).(const QStringcxx . . $ QString# &surfaceId, QDBusObjectPathcxx . . $ QDBusObjectPath# menuObjectPath) |
| 78 | { |
| 79 | qCDebugcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:122:11`!(lomiriappmenuRegistrar, "LomiriMenuRegistry::unregisterSurfaceMenu(surfaceId=%s, menuObjectPath=%s)", |
| 80 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(surfaceId), |
| 81 | qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(menuObjectPath.path())); |
| 82 | |
| 83 | m_interfacecxx . . $ LomiriMenuRegistry#m_interface.->cxx . . $ QScopedPointer#`operator->`(5a2a78a048fb49a8).UnregisterSurfaceMenucxx . . $ ComLomiriMenuRegistrarInterface#UnregisterSurfaceMenu(645db5b65d9db4cb).(surfaceId, menuObjectPath); |
| 84 | } |
| 85 | |
| 86 | |
| 87 | void LomiriMenuRegistrycxx . . $ LomiriMenuRegistry#::serviceOwnerChangedcxx . . $ LomiriMenuRegistry#serviceOwnerChanged(9f9ceb6f9de3a67b).(const QStringcxx . . $ QString# &serviceName, const QStringcxx . . $ QString#& oldOwner, const QStringcxx . . $ QString# &newOwner) |
| 88 | { |
| 89 | qCDebugcxx . . $ `<external>/13903568758641964362/qloggingcategory.h:122:11`!(lomiriappmenuRegistrar, "LomiriMenuRegistry::serviceOwnerChanged(newOwner=%s)", qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(newOwner)); |
| 90 | |
| 91 | if (serviceName !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). REGISTRAR_SERVICEcxx . . $ `src/lomiriappmenu/registry.cpp:26:9`!) return; |
| 92 | |
| 93 | if (oldOwner !=cxx . . $ `operator!=`(edf9e4f73813982f). newOwner) { |
| 94 | m_connectedcxx . . $ LomiriMenuRegistry#m_connected. = !newOwner.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).(); |
| 95 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! serviceChangedcxx . . $ LomiriMenuRegistry#serviceChanged(49f6e7a06ebc5aa8).(); |
| 96 | } |
| 97 | } |