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);
30 void CheckObjectBounds(void);
31 bool HitTestObjects(Point);
34 void AddNewObjectToDocument(Object *);
35 void HandleActionUpdate(void);
36 void SetCurrentLayer(int);
39 void paintEvent(QPaintEvent * event);
40 void resizeEvent(QResizeEvent * event);
41 void mousePressEvent(QMouseEvent * event);
42 void mouseMoveEvent(QMouseEvent * event);
43 void mouseReleaseEvent(QMouseEvent * event);
44 void wheelEvent(QWheelEvent * event);
45 void keyPressEvent(QKeyEvent * event);
46 void keyReleaseEvent(QKeyEvent * event);
49 QPoint GetAdjustedMousePosition(QMouseEvent * event);
50 QPoint GetAdjustedClientPosition(int x, int y);
60 QPixmap gridBackground;
61 double scale; // Window scaling factor
62 int32_t offsetX, offsetY; // Window offsets
65 uint32_t gridPixels; // Grid size in pixels
72 std::vector<void *> select;
73 std::vector<void *> hover;
77 // static Container document;
80 #endif // __DRAWINGVIEW_H__