Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/gamutmask/gamutmask_plugin.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2018 Anna Medonosova <anna.medonosova@gmail.com> | ||||
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 "gamutmask_plugin.h" | ||||
19 | #include "gamutmask_dock.h" | ||||
20 | | ||||
21 | #include <kpluginfactory.h> | ||||
22 | #include <klocalizedstring.h> | ||||
23 | #include <KoDockFactoryBase.h> | ||||
24 | #include <KoDockRegistry.h> | ||||
25 | | ||||
26 | K_PLUGIN_FACTORY_WITH_JSON(PaletteDockPluginFactory, "krita_gamutmask.json", registerPlugin<GamutMaskPlugin>();) | ||||
27 | | ||||
28 | class GamutMaskDockFactory: public KoDockFactoryBase | ||||
29 | { | ||||
30 | public: | ||||
31 | QString id() const override { | ||||
32 | return QString("GamutMask"); | ||||
33 | } | ||||
34 | | ||||
35 | virtual Qt::DockWidgetArea defaultDockWidgetArea() const { | ||||
36 | return Qt::RightDockWidgetArea; | ||||
37 | } | ||||
38 | | ||||
39 | QDockWidget* createDockWidget() override { | ||||
40 | GamutMaskDock* dockWidget = new GamutMaskDock(); | ||||
41 | dockWidget->setObjectName(id()); | ||||
42 | return dockWidget; | ||||
43 | } | ||||
44 | | ||||
45 | DockPosition defaultDockPosition() const override { | ||||
46 | return DockMinimized; | ||||
47 | } | ||||
48 | }; | ||||
49 | | ||||
50 | | ||||
51 | GamutMaskPlugin::GamutMaskPlugin(QObject* parent, const QVariantList &): | ||||
52 | QObject(parent) | ||||
53 | { | ||||
54 | KoDockRegistry::instance()->add(new GamutMaskDockFactory()); | ||||
55 | } | ||||
56 | | ||||
57 | #include "gamutmask_plugin.moc" |