-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
169 lines (115 loc) · 3.89 KB
/
mainwindow.h
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/**
* Copyright (C) 2017 VIPainter
*
* 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 3 of the License, or
* 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, see <http://www.gnu.org/licenses/>.
**/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QVector>
#include <QPaintEvent>
#include <QActionGroup>
#include <QDir>
#include <QMenu>
#include <QCloseEvent>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QScrollArea>
#include <vcursortype.h>
#include "vectorgraphwidget.h"
#include "imagewidget.h"
#include "paintwidget.h"
#include "vshape.h"
#include "vdelegate.h"
#include "vlistview.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
signals:
void cursorChange(VCursorType type,VShape *plugin=nullptr);
protected:
bool eventFilter(QObject * obj, QEvent * ev)override;
void closeEvent(QCloseEvent *event)override;
void dropEvent(QDropEvent *event)override;
void dragEnterEvent(QDragEnterEvent *event)override;
private slots:
void on_actionZoomIn_triggered();
void on_actionZoomOut_triggered();
void on_actionResume_triggered();
void on_actionSave_triggered();
void on_actionSaveAs_triggered();
void on_actionOpen_triggered();
void on_actionMove_triggered();
void on_actionChoose_triggered();
void changeCursor(VCursorType type,VShape *plugin=nullptr);
void on_actionNew_triggered();
void on_actionCanvasSize_triggered();
void on_actionShapeSize_triggered();
void on_actionBreakUp_triggered();
void on_actionRotate_triggered();
void on_actionRedo_triggered();
void on_actionReloadPlugon_triggered();
void on_actionLoadExPlugin_triggered();
void on_actionAntialiasing_toggled(bool antialiasing);
void on_actionDelete_triggered();
void on_actionClose_triggered();
void on_actionCopy_triggered();
void on_actionCut_triggered();
void on_actionPaste_triggered();
void on_actionGroup_triggered();
void initAction(QDir dir=QDir("plugin"));
void focusDock(bool checked);
void on_actionSelectAll_triggered();
void on_actionBrushColor_triggered();
void on_actionPenColor_triggered();
void on_actionPenStyle_triggered();
void on_actionPen_triggered();
void on_actionAbout_triggered();
void on_actionUndo_triggered();
void on_actionPolyLine_triggered();
void on_actionCurveLine_triggered();
void on_actionForceGroup_triggered();
void on_actionTest_triggered();
void on_actionNewImage_triggered();
void on_actionMarquee_triggered();
private:
QVector<VShape*>plugins;
Ui::MainWindow *ui;
VShape *chooseShape;
QDockWidget *focus=nullptr;
QVector<QDockWidget *> docks;
QActionGroup *barGroup;
VCursorType cursorState;
VShape *plugin;
VDelegate *delegate;
VListView *listView;
QMenu *contextMenu;
void changeMenuAction(VectorgraphWidget *widget, bool flag=false);
void loadPlugin(QString filename);
QDockWidget * newDock(QWidget *widget, QString dockname="" );
VectorgraphWidget* newVectorgraphWidget();
ImageWidget *newImageWidget();
void focusDock(QDockWidget * target);
PaintWidget * getPaintWidget();
PaintWidget * getPaintWidget(QDockWidget *target);
bool closeWidget(PaintWidget *widget);
bool openFile(QString filename);
};
#endif // MAINWINDOW_H