]> Shamusworld >> Repos - architektonas/blob - src/drawingview.h
Added Architektonas drawing file loading/saving infrastructure.
[architektonas] / src / drawingview.h
1 #ifndef __DRAWINGVIEW_H__
2 #define __DRAWINGVIEW_H__
3
4 #include <QtGui>
5 #include <stdint.h>
6 #include "action.h"
7 #include "container.h"
8
9 class DrawingView: public QWidget
10 {
11         Q_OBJECT
12
13         public:
14                 DrawingView(QWidget * parent = NULL);
15
16         public:
17                 void SetRotateToolActive(bool state = true);
18                 void SetAddLineToolActive(bool state = true);
19                 void SetAddCircleToolActive(bool state = true);
20                 void UpdateGridBackground(void);
21
22         public slots:
23                 void AddNewObjectToDocument(Object *);
24
25         protected:
26                 void paintEvent(QPaintEvent * event);
27                 void mousePressEvent(QMouseEvent * event);
28                 void mouseMoveEvent(QMouseEvent * event);
29                 void mouseReleaseEvent(QMouseEvent * event);
30
31         private:
32                 QPoint GetAdjustedMousePosition(QMouseEvent * event);
33                 QPoint GetAdjustedClientPosition(int x, int y);
34
35         public:
36                 bool useAntialiasing;
37
38         private:
39 //              QBrush * backgroundBrush;
40                 QPixmap gridBackground;
41                 double scale;                                                   // Window scaling factor
42                 int32_t offsetX, offsetY;                               // Window offsets
43         public:
44                 Container document;
45                 double gridSpacing;
46         private:
47                 bool collided;
48 //Should this go into Object's class variables???
49                 bool rotateTool;
50                 double rx, ry;
51                 bool scrollDrag;
52                 Vector oldPoint;
53                 bool addLineTool;
54                 bool addCircleTool;
55                 Action * toolAction;
56 /*              QSize minimumSizeHint() const;
57                 QSize sizeHint() const;
58
59         private:
60                 void CreateCursors(void);
61                 QPoint GetAdjustedMousePosition(QMouseEvent * event);
62                 QPoint GetAdjustedClientPosition(int x, int y);
63
64                 QImage image;
65                 QPoint pt, ptOffset, ptPrevious;
66                 ToolType tool;                                                  // Current tool
67                 GlyphPoints pts;                                                // Glyph point structure
68                 int32 ptHighlight, oldPtHighlight, ptNextHighlight, oldPtNextHighlight;
69                 bool polyFirstPoint;
70
71                 ToolWindow * toolPalette;
72                 QCursor cur[8];
73 */
74 };
75
76 #endif  // __DRAWINGVIEW_H__