1 #ifndef __DRAWINGVIEW_H__
2 #define __DRAWINGVIEW_H__
10 class DrawingView: public QWidget
15 DrawingView(QWidget * parent = NULL);
18 void SetGridSize(uint32_t);
19 void UpdateGridBackground(void);
20 Point SnapPointToGrid(Point);
21 void RenderObjects(Painter *, Container *);
22 void DeleteSelectedItems(void);
23 void ClearSelection(void);
24 void AddHoveredToSelection(void);
25 void GetSelection(std::vector<void *> &);
26 void GetHovered(std::vector<void *> &);
27 void ToolMouse(int, Point);
28 void ToolDraw(Painter *);
29 void LineHandler(int, Point);
32 void AddNewObjectToDocument(Object *);
33 void HandleActionUpdate(void);
34 void SetCurrentLayer(int);
37 void paintEvent(QPaintEvent * event);
38 void resizeEvent(QResizeEvent * event);
39 void mousePressEvent(QMouseEvent * event);
40 void mouseMoveEvent(QMouseEvent * event);
41 void mouseReleaseEvent(QMouseEvent * event);
42 void wheelEvent(QWheelEvent * event);
43 void keyPressEvent(QKeyEvent * event);
44 void keyReleaseEvent(QKeyEvent * event);
47 QPoint GetAdjustedMousePosition(QMouseEvent * event);
48 QPoint GetAdjustedClientPosition(int x, int y);
58 QPixmap gridBackground;
59 double scale; // Window scaling factor
60 int32_t offsetX, offsetY; // Window offsets
63 uint32_t gridPixels; // Grid size in pixels
70 std::vector<void *> select;
71 std::vector<void *> hover;
75 // static Container document;
78 #endif // __DRAWINGVIEW_H__