blob: ee81ddf5d87b0ab9feb4716c44421c62019a5659 (
plain)
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
|
/***************************************************************************
* *
* DrawPad - a drawing program for Opie Environment *
* *
* (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
* *
* 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. *
* *
***************************************************************************/
#ifndef DRAWPAD_H
#define DRAWPAD_H
#include <qmainwindow.h>
#include <qpen.h>
class DrawMode;
class DrawPadCanvas;
class QAction;
class QColor;
class QToolButton;
class QWidgetStack;
class DrawPad : public QMainWindow
{
Q_OBJECT
public:
DrawPad(QWidget* parent = 0, const char* name = 0, WFlags f = WType_TopLevel);
~DrawPad();
DrawMode* drawMode() { return m_pDrawMode; }
QPen pen() { return m_pen; }
QBrush brush() { return m_brush; }
private slots:
void setPointDrawMode();
void setLineDrawMode();
void setRectangleDrawMode();
void setEllipseDrawMode();
void setFillDrawMode();
void setEraseDrawMode();
void changePenWidth(int value);
void changePenColor(int index);
void changeBrushColor(int index);
void updateUndoRedoToolButtons();
void updateNavigationToolButtons();
private:
DrawPadCanvas* m_pDrawPadCanvas;
QArray<QColor> m_colors;
DrawMode* m_pDrawMode;
QPen m_pen;
QBrush m_brush;
QAction* m_pUndoAction;
QAction* m_pRedoAction;
QAction* m_pFirstPageAction;
QAction* m_pPreviousPageAction;
QAction* m_pNextPageAction;
QAction* m_pLastPageAction;
QAction* m_pPointDrawModeAction;
QAction* m_pLineDrawModeAction;
QAction* m_pRectangleDrawModeAction;
QAction* m_pEllipseDrawModeAction;
QAction* m_pFillDrawModeAction;
QAction* m_pEraseDrawModeAction;
QToolButton* m_pPenColorToolButton;
QToolButton* m_pBrushColorToolButton;
};
#endif // DRAWPAD_H
|