File: kis_dlg_stroke_selection_properties.h

package info (click to toggle)
krita 1%3A4.1.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 450,716 kB
  • sloc: cpp: 568,916; python: 12,026; xml: 7,904; ansic: 3,840; perl: 438; sh: 250; lisp: 110; makefile: 26
file content (113 lines) | stat: -rw-r--r-- 3,039 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 *  Copyright (c) 2016 Alexey Kapustin <akapust1n@yandex.ru>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
#ifndef KIS_DLG_STROKE_SELECTION_PROPERTIES_H_
#define KIS_DLG_STROKE_SELECTION_PROPERTIES_H_

#include <KoDialog.h>
#include "KisProofingConfiguration.h"
#include <kis_types.h>
#include "KisViewManager.h"
#include "KoStrokeConfigWidget.h"
#include "ui_wdgstrokeselectionproperties.h"
#include <kis_painter.h>
#include <kis_canvas2.h>

class KoColorSpace;
class KoColorPopupAction;

enum class linePosition
{
    OUTSIDE, INSIDE, CENTER
};

enum class drawType{
    brushDraw, lineDraw
};
enum class colorFillSource {
    None, PaintColor, BGColor, CustomColor, FGColor
};

struct StrokeSelectionOptions {
    StrokeSelectionOptions ();
    int lineSize;
    bool brushSelected;
    int _colorFillSource;
    int lineColorSource;
    int lineDimension;
    KoColor color;
    KoColor fillColor;
    KoColor customColor;
    KisPainter::FillStyle fillStyle() const;
    void lock();
};

class WdgStrokeSelection : public QWidget, public Ui::WdgStrokeSelection
{
    Q_OBJECT


public:
    WdgStrokeSelection(QWidget *parent) ;
    StrokeSelectionOptions  m_options;

Q_SIGNALS:
    void colorFillSelectorChanged();
    void colorSelectorChanged();

private Q_SLOTS:
    void on_fillBox_currentIndexChanged(int index);
    void on_typeBox_currentIndexChanged(const QString &arg1);
    void on_lineColorBox_currentIndexChanged(const QString &arg1);

};


class KisDlgStrokeSelection : public KoDialog
{

    Q_OBJECT


public:
    KisDlgStrokeSelection(KisImageWSP image, KisViewManager *view, bool isVectorLayer);
    ~KisDlgStrokeSelection() override;
    int getLineSize() const;
    linePosition getLinePosition() const;
    KoColor getSelectedColor() const;
    bool isBrushSelected() const;
    KoColor getFillSelectedColor() const;
    StrokeSelectionOptions  getParams() const;
    void lockVectorLayerFunctions();
    void unlockVectorLayerFunctions();

private:
    WdgStrokeSelection * m_page;
    KisImageWSP m_image;
    KoCanvasResourceManager *m_resourceManager;
    KisDisplayColorConverter *converter;

private Q_SLOTS:
    void setColorFillButton();
    void setColorButton();
    void colorChanged(const QColor &newColor);
    void colorFillChanged(const QColor &newColor);
};



#endif // KIS_DLG_STROKE_SEL_PROPERTIES_H_