Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/kis_tool_paint.h
Context not available. | |||||
36 | #include "kis_signal_compressor_with_param.h" | 36 | #include "kis_signal_compressor_with_param.h" | ||
---|---|---|---|---|---|
37 | #include <brushengine/kis_paintop_settings.h> | 37 | #include <brushengine/kis_paintop_settings.h> | ||
38 | #include <resources/KoPattern.h> | 38 | #include <resources/KoPattern.h> | ||
39 | #include "kis_tool_utils.h" | ||||
39 | 40 | | |||
40 | class QGridLayout; | 41 | class QGridLayout; | ||
41 | class KoCompositeOp; | 42 | class KoCompositeOp; | ||
Context not available. | |||||
43 | 44 | | |||
44 | class KRITAUI_EXPORT KisToolPaint : public KisTool | 45 | class KRITAUI_EXPORT KisToolPaint : public KisTool | ||
45 | { | 46 | { | ||
46 | | ||||
47 | Q_OBJECT | 47 | Q_OBJECT | ||
48 | 48 | | |||
49 | public: | 49 | public: | ||
Context not available. | |||||
56 | void mouseMoveEvent(KoPointerEvent *event) override; | 56 | void mouseMoveEvent(KoPointerEvent *event) override; | ||
57 | 57 | | |||
58 | protected: | 58 | protected: | ||
59 | | ||||
60 | void setMode(ToolMode mode) override; | 59 | void setMode(ToolMode mode) override; | ||
61 | 60 | | |||
62 | void canvasResourceChanged(int key, const QVariant &v) override; | 61 | void canvasResourceChanged(int key, const QVariant &v) override; | ||
Context not available. | |||||
86 | const KoPointerEvent *event, | 85 | const KoPointerEvent *event, | ||
87 | KisPaintOpSettings::OutlineMode outlineMode); | 86 | KisPaintOpSettings::OutlineMode outlineMode); | ||
88 | 87 | | |||
89 | protected: | | |||
90 | bool isOutlineEnabled() const; | 88 | bool isOutlineEnabled() const; | ||
91 | void setOutlineEnabled(bool enabled); | 89 | void setOutlineEnabled(bool enabled); | ||
92 | 90 | | |||
93 | bool pickColor(const QPointF &documentPixel, AlternateAction action); | | |||
94 | | ||||
95 | /// Add the tool-specific layout to the default option widget layout. | 91 | /// Add the tool-specific layout to the default option widget layout. | ||
96 | void addOptionWidgetLayout(QLayout *layout); | 92 | void addOptionWidgetLayout(QLayout *layout); | ||
97 | 93 | | |||
Context not available. | |||||
122 | 118 | | |||
123 | const KoCompositeOp* compositeOp(); | 119 | const KoCompositeOp* compositeOp(); | ||
124 | 120 | | |||
125 | public Q_SLOTS: | | |||
126 | void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes) override; | | |||
127 | void deactivate() override; | | |||
128 | | ||||
129 | private Q_SLOTS: | | |||
130 | | ||||
131 | void slotPopupQuickHelp(); | | |||
132 | | ||||
133 | void increaseBrushSize(); | | |||
134 | void decreaseBrushSize(); | | |||
135 | | ||||
136 | void activatePickColorDelayed(); | | |||
137 | | ||||
138 | void slotColorPickingFinished(const KoColor &color); | | |||
139 | | ||||
140 | protected: | | |||
141 | quint8 m_opacity; | 121 | quint8 m_opacity; | ||
142 | bool m_paintOutline; | 122 | bool m_paintOutline; | ||
143 | QPointF m_outlineDocPoint; | 123 | QPointF m_outlineDocPoint; | ||
Context not available. | |||||
162 | int colorPreviewResourceId(AlternateAction action); | 142 | int colorPreviewResourceId(AlternateAction action); | ||
163 | QRectF colorPreviewDocRect(const QPointF &outlineDocPoint); | 143 | QRectF colorPreviewDocRect(const QPointF &outlineDocPoint); | ||
164 | 144 | | |||
145 | bool pickColor(const QPointF &documentPixel, AlternateAction action); | ||||
165 | bool isPickingAction(AlternateAction action); | 146 | bool isPickingAction(AlternateAction action); | ||
166 | 147 | | |||
167 | struct PickingJob { | 148 | struct PickingJob { | ||
Context not available. | |||||
176 | }; | 157 | }; | ||
177 | void addPickerJob(const PickingJob &pickingJob); | 158 | void addPickerJob(const PickingJob &pickingJob); | ||
178 | 159 | | |||
179 | private: | | |||
180 | | ||||
181 | bool m_specialHoverModifier; | 160 | bool m_specialHoverModifier; | ||
182 | QGridLayout *m_optionsWidgetLayout; | 161 | QGridLayout *m_optionsWidgetLayout; | ||
183 | 162 | | |||
184 | bool m_supportOutline; | 163 | bool m_supportOutline; | ||
185 | 164 | | |||
186 | /** | | |||
187 | * Used as a switch for pickColor | | |||
188 | */ | | |||
189 | | ||||
190 | // used to skip some of the tablet events and don't update the colour that often | 165 | // used to skip some of the tablet events and don't update the colour that often | ||
191 | QTimer m_colorPickerDelayTimer; | 166 | QTimer m_colorPickerDelayTimer; | ||
192 | AlternateAction delayedAction; | 167 | AlternateAction delayedAction; | ||
Context not available. | |||||
196 | 171 | | |||
197 | KisStrokeId m_pickerStrokeId; | 172 | KisStrokeId m_pickerStrokeId; | ||
198 | int m_pickingResource; | 173 | int m_pickingResource; | ||
174 | KisPickerUtils::ColorPickerConfig m_pickerSettings; | ||||
199 | typedef KisSignalCompressorWithParam<PickingJob> PickingCompressor; | 175 | typedef KisSignalCompressorWithParam<PickingJob> PickingCompressor; | ||
200 | QScopedPointer<PickingCompressor> m_colorPickingCompressor; | 176 | QScopedPointer<PickingCompressor> m_colorPickingCompressor; | ||
201 | 177 | | |||
202 | qreal m_localOpacity {1.0}; | 178 | qreal m_localOpacity {1.0}; | ||
203 | qreal m_oldOpacity {1.0}; | 179 | qreal m_oldOpacity {1.0}; | ||
204 | 180 | | |||
181 | public Q_SLOTS: | ||||
182 | void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes) override; | ||||
183 | void deactivate() override; | ||||
184 | | ||||
185 | private Q_SLOTS: | ||||
186 | void slotPopupQuickHelp(); | ||||
187 | | ||||
188 | void increaseBrushSize(); | ||||
189 | void decreaseBrushSize(); | ||||
190 | | ||||
191 | void activatePickColorDelayed(); | ||||
192 | void slotColorPickingFinished(const KoColor &color); | ||||
193 | | ||||
205 | Q_SIGNALS: | 194 | Q_SIGNALS: | ||
206 | void sigPaintingFinished(); | 195 | void sigPaintingFinished(); | ||
207 | }; | 196 | }; | ||
208 | 197 | | |||
209 | #endif // KIS_TOOL_PAINT_H_ | 198 | #endif // KIS_TOOL_PAINT_H_ | ||
210 | | ||||
Context not available. |