File indexing completed on 2024-04-28 15:22:24
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "kglobalaccel_interface.h" 0009 #include "globalshortcutsregistry.h" 0010 0011 class KGlobalAccelInterface::Private 0012 { 0013 public: 0014 Private(GlobalShortcutsRegistry *owner) 0015 : owner(owner) 0016 { 0017 } 0018 GlobalShortcutsRegistry *owner; 0019 }; 0020 0021 KGlobalAccelInterface::KGlobalAccelInterface(QObject *owner) 0022 : QObject(owner) 0023 , d(new Private(qobject_cast<GlobalShortcutsRegistry *>(owner))) 0024 { 0025 } 0026 0027 KGlobalAccelInterface::~KGlobalAccelInterface() = default; 0028 0029 void KGlobalAccelInterface::setRegistry(GlobalShortcutsRegistry *registry) 0030 { 0031 setParent(registry); 0032 d->owner = registry; 0033 } 0034 0035 void KGlobalAccelInterface::syncWindowingSystem() 0036 { 0037 } 0038 0039 bool KGlobalAccelInterface::keyPressed(int keyQt) 0040 { 0041 return d->owner->keyPressed(keyQt); 0042 } 0043 0044 void KGlobalAccelInterface::grabKeys() 0045 { 0046 d->owner->grabKeys(); 0047 } 0048 0049 void KGlobalAccelInterface::ungrabKeys() 0050 { 0051 d->owner->ungrabKeys(); 0052 } 0053 0054 KGlobalAccelInterfaceV2::KGlobalAccelInterfaceV2(QObject *parent) 0055 : KGlobalAccelInterface(parent) 0056 { 0057 } 0058 0059 bool KGlobalAccelInterfaceV2::keyReleased(int keyQt) 0060 { 0061 return d->owner->keyReleased(keyQt); 0062 } 0063 0064 #include "moc_kglobalaccel_interface.cpp"