File indexing completed on 2024-12-22 04:14:54
0001 /* 0002 * SPDX-FileCopyrightText: 2009 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "patterndocker.h" 0008 0009 #include <stdlib.h> 0010 0011 #include <QTimer> 0012 0013 0014 #include <kpluginfactory.h> 0015 #include <klocalizedstring.h> 0016 0017 #include <KoDockFactoryBase.h> 0018 0019 #include <kis_debug.h> 0020 #include "kis_config.h" 0021 #include "kis_cursor.h" 0022 #include "kis_global.h" 0023 #include "kis_types.h" 0024 #include "KisViewManager.h" 0025 0026 #include "patterndocker_dock.h" 0027 #include <KoDockRegistry.h> 0028 0029 K_PLUGIN_FACTORY_WITH_JSON(PatternDockerPluginFactory, "krita_patterndocker.json", registerPlugin<PatternDockerPlugin>();) 0030 0031 class PatternDockerDockFactory : public KoDockFactoryBase { 0032 public: 0033 PatternDockerDockFactory() 0034 { 0035 } 0036 0037 QString id() const override 0038 { 0039 return QString( "PatternDocker" ); 0040 } 0041 0042 virtual Qt::DockWidgetArea defaultDockWidgetArea() const 0043 { 0044 return Qt::RightDockWidgetArea; 0045 } 0046 0047 QDockWidget* createDockWidget() override 0048 { 0049 PatternDockerDock * dockWidget = new PatternDockerDock(); 0050 dockWidget->setObjectName(id()); 0051 0052 return dockWidget; 0053 } 0054 0055 DockPosition defaultDockPosition() const override 0056 { 0057 return DockMinimized; 0058 } 0059 private: 0060 0061 0062 }; 0063 0064 0065 PatternDockerPlugin::PatternDockerPlugin(QObject *parent, const QVariantList &) 0066 : QObject(parent) 0067 { 0068 KoDockRegistry::instance()->add(new PatternDockerDockFactory()); 0069 } 0070 0071 PatternDockerPlugin::~PatternDockerPlugin() 0072 { 0073 m_view = 0; 0074 } 0075 0076 #include "patterndocker.moc"