File indexing completed on 2024-12-22 04:14:56

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