Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/gamutmask/gamutmask_dock.h
- 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 | #ifndef H_GAMUT_MASK_DOCK_H | ||||
19 | #define H_GAMUT_MASK_DOCK_H | ||||
20 | | ||||
21 | #include <QDockWidget> | ||||
22 | #include <QPointer> | ||||
23 | #include <QRegExpValidator> | ||||
24 | | ||||
25 | #include <KoCanvasObserverBase.h> | ||||
26 | #include <KoResourceServerProvider.h> | ||||
27 | #include <KoResourceServerAdapter.h> | ||||
28 | #include <KoResourceServerObserver.h> | ||||
29 | #include <resources/KoGamutMask.h> | ||||
30 | #include <KisDocument.h> | ||||
31 | //#include <KisView.h> | ||||
32 | #include <kis_types.h> | ||||
33 | #include <KoResourceItemChooser.h> | ||||
34 | | ||||
35 | #include <kis_mainwindow_observer.h> | ||||
36 | | ||||
37 | class KisCanvasResourceProvider; | ||||
38 | class KisColor; | ||||
39 | class QButtonGroup; | ||||
40 | class QMenu; | ||||
41 | | ||||
42 | struct GamutMaskChooserUI; | ||||
43 | | ||||
44 | class GamutMaskDock: public QDockWidget, public KisMainwindowObserver, public KoResourceServerObserver<KoGamutMask> | ||||
45 | { | ||||
46 | Q_OBJECT | ||||
47 | | ||||
48 | public: | ||||
49 | GamutMaskDock(); | ||||
50 | ~GamutMaskDock() override; | ||||
51 | QString observerName() override { return "GamutMaskDock"; } | ||||
52 | void setMainWindow(KisViewManager* kisview) override; | ||||
53 | void setCanvas(KoCanvasBase *canvas) override; | ||||
54 | void unsetCanvas() override; | ||||
55 | | ||||
56 | public: // KoResourceServerObserver | ||||
57 | void unsetResourceServer() override; | ||||
58 | void resourceAdded(KoGamutMask* resource) override {} | ||||
59 | void removingResource(KoGamutMask* resource) override; | ||||
60 | void resourceChanged(KoGamutMask* resource) override; | ||||
61 | void syncTaggedResourceView() override {} | ||||
62 | void syncTagAddition(const QString&) override {} | ||||
63 | void syncTagRemoval(const QString&) override {} | ||||
64 | | ||||
65 | Q_SIGNALS: | ||||
66 | void sigGamutMaskSet(KoGamutMask* mask); | ||||
67 | void sigGamutMaskChanged(KoGamutMask* mask); | ||||
68 | void sigGamutMaskUnset(); | ||||
69 | // void sigGamutMaskPreviewUpdate(KoGamutMask* mask); | ||||
70 | | ||||
71 | private Q_SLOTS: | ||||
72 | void slotGamutMaskEdit(); | ||||
73 | void slotGamutMaskSave(); | ||||
74 | void slotGamutMaskCancelEdit(); | ||||
75 | void slotGamutMaskSelected(KoGamutMask* mask); | ||||
76 | void slotGamutMaskPreview(); | ||||
77 | void slotGamutMaskNew(); | ||||
78 | void slotGamutMaskDelete(); | ||||
79 | void slotGamutMaskSet(); | ||||
80 | | ||||
81 | private: | ||||
82 | KisCanvasResourceProvider* m_resourceProvider; | ||||
83 | | ||||
84 | bool closeMaskDocument(); | ||||
85 | void openMaskEditor(bool creatingNewMask); | ||||
86 | | ||||
87 | QList<KoShape*> getShapesFromLayer(); | ||||
88 | | ||||
89 | GamutMaskChooserUI* m_dockerUI; | ||||
90 | KoResourceItemChooser* m_maskChooser; | ||||
91 | | ||||
92 | KoGamutMask* m_selectedMask; | ||||
93 | QRegExpValidator* m_maskTitleValidator; | ||||
94 | | ||||
95 | KisDocument* m_maskDocument; | ||||
96 | }; | ||||
97 | | ||||
98 | | ||||
99 | #endif // H_GAMUT_MASK_DOCK_H |