File indexing completed on 2024-12-22 04:14:48
0001 /* 0002 * SPDX-FileCopyrightText: 2018 Anna Medonosova <anna.medonosova@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "gamutmask_plugin.h" 0008 #include "gamutmask_dock.h" 0009 0010 #include <kpluginfactory.h> 0011 #include <klocalizedstring.h> 0012 #include <KoDockFactoryBase.h> 0013 #include <KoDockRegistry.h> 0014 0015 K_PLUGIN_FACTORY_WITH_JSON(PaletteDockPluginFactory, "krita_gamutmask.json", registerPlugin<GamutMaskPlugin>();) 0016 0017 class GamutMaskDockFactory: public KoDockFactoryBase 0018 { 0019 public: 0020 QString id() const override { 0021 return QString("GamutMask"); 0022 } 0023 0024 virtual Qt::DockWidgetArea defaultDockWidgetArea() const { 0025 return Qt::RightDockWidgetArea; 0026 } 0027 0028 QDockWidget* createDockWidget() override { 0029 GamutMaskDock* dockWidget = new GamutMaskDock(); 0030 dockWidget->setObjectName(id()); 0031 return dockWidget; 0032 } 0033 0034 DockPosition defaultDockPosition() const override { 0035 return DockMinimized; 0036 } 0037 }; 0038 0039 0040 GamutMaskPlugin::GamutMaskPlugin(QObject* parent, const QVariantList &): 0041 QObject(parent) 0042 { 0043 KoDockRegistry::instance()->add(new GamutMaskDockFactory()); 0044 } 0045 0046 #include "gamutmask_plugin.moc"