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 ToolMouseDown(Point);
28 void ToolMouseMove(Point);
29 void ToolMouseUp(Point);
30 void ToolDraw(Painter *);
33 void AddNewObjectToDocument(Object *);
34 void HandleActionUpdate(void);
35 void SetCurrentLayer(int);
38 void paintEvent(QPaintEvent * event);
39 void resizeEvent(QResizeEvent * event);
40 void mousePressEvent(QMouseEvent * event);
41 void mouseMoveEvent(QMouseEvent * event);
42 void mouseReleaseEvent(QMouseEvent * event);
43 void wheelEvent(QWheelEvent * event);
44 void keyPressEvent(QKeyEvent * event);
45 void keyReleaseEvent(QKeyEvent * event);
48 QPoint GetAdjustedMousePosition(QMouseEvent * event);
49 QPoint GetAdjustedClientPosition(int x, int y);
59 QPixmap gridBackground;
60 double scale; // Window scaling factor
61 int32_t offsetX, offsetY; // Window offsets
64 uint32_t gridPixels; // Grid size in pixels
71 std::vector<void *> select;
72 std::vector<void *> hover;
75 // Object * toolObject;
77 // Tool methods (static)
81 // static Container document;
84 #endif // __DRAWINGVIEW_H__