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