| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2020 Mathias Wein <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#include "WGColorSelectorDock.h" |
| 8 |
|
| 9 |
#include <kpluginfactory.h> |
| 10 |
//#include <klocalizedstring.h> |
| 11 |
#include <KoDockFactoryBase.h> |
| 12 |
#include <KoDockRegistry.h> |
| 13 |
|
| 14 |
class WGColorSelectorPlugin: public QObject |
| 15 |
{ |
| 16 |
Q_OBJECT |
| 17 |
public: |
| 18 |
WGColorSelectorPlugin(QObject *parent, const QVariantList &); |
| 19 |
~WGColorSelectorPlugin() override; |
| 20 |
}; |
| 21 |
|
| 22 |
K_PLUGIN_FACTORY_WITH_JSON(WGColorSelectorPluginFactory, "krita_widegamutcolorselector.json", registerPlugin<WGColorSelectorPlugin>();) |
| 23 |
|
| 24 |
class WGColorSelectorDockFactory : public KoDockFactoryBase |
| 25 |
{ |
| 26 |
public: |
| 27 |
WGColorSelectorDockFactory() { |
| 28 |
} |
| 29 |
|
| 30 |
QString id() const override { |
| 31 |
return QString("WideGamutColorSelector"); |
| 32 |
} |
| 33 |
|
| 34 |
QDockWidget* createDockWidget() override { |
| 35 |
WGColorSelectorDock * dockWidget = new WGColorSelectorDock(); |
| 36 |
dockWidget->setObjectName(id()); |
| 37 |
|
| 38 |
return dockWidget; |
| 39 |
} |
| 40 |
|
| 41 |
DockPosition defaultDockPosition() const override { |
| 42 |
return DockMinimized; |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
WGColorSelectorPlugin::WGColorSelectorPlugin(QObject *parent, const QVariantList &) |
| 48 |
: QObject(parent) |
| 49 |
{ |
| 50 |
KoDockRegistry::instance()->add(new WGColorSelectorDockFactory()); |
| 51 |
|
| 52 |
// TODO: own preference set |
| 53 |
} |
| 54 |
|
| 55 |
WGColorSelectorPlugin::~WGColorSelectorPlugin() |
| 56 |
{ |
| 57 |
|
| 58 |
} |
| 59 |
|
| 60 |
#include "WGColorSelectorPlugin.moc" |