Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/recorder/recorderdocker.cpp
- This file was added.
| 1 | /* | ||||
|---|---|---|---|---|---|
| 2 | * Copyright (c) 2009 Cyrille Berger <cberger@cberger.net> | ||||
| 3 | * | ||||
| 4 | * This library is free software; you can redistribute it and/or modify | ||||
| 5 | * it under the terms of the GNU Lesser General Public License as published by | ||||
| 6 | * the Free Software Foundation; version 2.1 of the License. | ||||
| 7 | * | ||||
| 8 | * This library is distributed in the hope that it will be useful, | ||||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| 11 | * GNU 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, write to the Free Software | ||||
| 15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| 16 | */ | ||||
| 17 | | ||||
| 18 | #include "recorderdocker.h" | ||||
| 19 | | ||||
| 20 | #include <stdlib.h> | ||||
| 21 | | ||||
| 22 | #include <QTimer> | ||||
| 23 | | ||||
| 24 | | ||||
| 25 | #include <kis_debug.h> | ||||
| 26 | #include <kpluginfactory.h> | ||||
| 27 | #include <klocalizedstring.h> | ||||
| 28 | | ||||
| 29 | #include <KoDockFactoryBase.h> | ||||
| 30 | | ||||
| 31 | #include "kis_config.h" | ||||
| 32 | #include "kis_cursor.h" | ||||
| 33 | #include "kis_global.h" | ||||
| 34 | #include "kis_types.h" | ||||
| 35 | #include "KisViewManager.h" | ||||
| 36 | | ||||
| 37 | #include "recorderdocker_dock.h" | ||||
| 38 | #include <KoDockRegistry.h> | ||||
| 39 | | ||||
| 40 | K_PLUGIN_FACTORY_WITH_JSON(RecorderDockerPluginFactory, "krita_recorderdocker.json", registerPlugin<RecorderDockerPlugin>();) | ||||
| 41 | | ||||
| 42 | class RecorderDockerDockFactory : public KoDockFactoryBase { | ||||
| 43 | public: | ||||
| 44 | RecorderDockerDockFactory() | ||||
| 45 | { | ||||
| 46 | } | ||||
| 47 | | ||||
| 48 | QString id() const override | ||||
| 49 | { | ||||
| 50 | return QString( "RecorderDocker" ); | ||||
| 51 | } | ||||
| 52 | | ||||
| 53 | virtual Qt::DockWidgetArea defaultDockWidgetArea() const | ||||
| 54 | { | ||||
| 55 | return Qt::RightDockWidgetArea; | ||||
| 56 | } | ||||
| 57 | | ||||
| 58 | QDockWidget* createDockWidget() override | ||||
| 59 | { | ||||
| 60 | RecorderDockerDock * dockWidget = new RecorderDockerDock(); | ||||
| 61 | dockWidget->setObjectName(id()); | ||||
| 62 | | ||||
| 63 | return dockWidget; | ||||
| 64 | } | ||||
| 65 | | ||||
| 66 | DockPosition defaultDockPosition() const override | ||||
| 67 | { | ||||
| 68 | return DockMinimized; | ||||
| 69 | } | ||||
| 70 | private: | ||||
| 71 | | ||||
| 72 | | ||||
| 73 | }; | ||||
| 74 | | ||||
| 75 | | ||||
| 76 | RecorderDockerPlugin::RecorderDockerPlugin(QObject *parent, const QVariantList &) | ||||
| 77 | : QObject(parent) | ||||
| 78 | { | ||||
| 79 | KoDockRegistry::instance()->add(new RecorderDockerDockFactory()); | ||||
| 80 | } | ||||
| 81 | | ||||
| 82 | RecorderDockerPlugin::~RecorderDockerPlugin() | ||||
| 83 | { | ||||
| 84 | m_view = 0; | ||||
| 85 | } | ||||
| 86 | | ||||
| 87 | #include "recorderdocker.moc" | ||||