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 *, std::vector<void *> &);
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 RotateHandler(int, Point);
31 void CheckObjectBounds(void);
32 bool HitTestObjects(Point);
33 void HandleObjectMovement(Point);
36 void AddNewObjectToDocument(Object *);
37 void HandleActionUpdate(void);
38 void SetCurrentLayer(int);
41 void paintEvent(QPaintEvent * event);
42 void resizeEvent(QResizeEvent * event);
43 void mousePressEvent(QMouseEvent * event);
44 void mouseMoveEvent(QMouseEvent * event);
45 void mouseReleaseEvent(QMouseEvent * event);
46 void wheelEvent(QWheelEvent * event);
47 void keyPressEvent(QKeyEvent * event);
48 void keyReleaseEvent(QKeyEvent * event);
51 QPoint GetAdjustedMousePosition(QMouseEvent * event);
52 QPoint GetAdjustedClientPosition(int x, int y);
63 QPixmap gridBackground;
64 double scale; // Window scaling factor
65 int32_t offsetX, offsetY; // Window offsets
68 uint32_t gridPixels; // Grid size in pixels
75 std::vector<void *> select;
76 std::vector<void *> hover;
77 std::vector<void *> toolObjects;
81 // static Container document;
84 #endif // __DRAWINGVIEW_H__