]> Shamusworld >> Repos - architektonas/blobdiff - src/drawingview.h
Selection of Lines works, ctrl held for multi-select.
[architektonas] / src / drawingview.h
index 55384fa48a3c7c686abc5ba2d44b46dd2d961718..c4a7234fe733314ffc34bbebfcf98b3232a314e0 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef __DRAWINGVIEW_H__
 #define __DRAWINGVIEW_H__
 
-#include <QtGui>
+#include <QtWidgets>
 #include <stdint.h>
-#include "action.h"
-#include "container.h"
+#include "structs.h"
+
+class Painter;
 
 class DrawingView: public QWidget
 {
@@ -14,13 +15,20 @@ class DrawingView: public QWidget
                DrawingView(QWidget * parent = NULL);
 
        public:
-               void SetRotateToolActive(bool state = true);
-               void SetToolActive(Action * action);
+//             void SetToolActive(Action * action);
                void SetGridSize(uint32_t);
                void UpdateGridBackground(void);
+               Point SnapPointToGrid(Point);
+               void RenderObjects(Painter *, Container *);
+               void DeleteSelectedItems(void);
+               void ClearSelection(void);
+               void AddHoveredToSelection(void);
+               void GetSelection(std::vector<void *> &);
+               void GetHovered(std::vector<void *> &);
 
        public slots:
                void AddNewObjectToDocument(Object *);
+               void HandleActionUpdate(void);
                void SetCurrentLayer(int);
 
        protected:
@@ -29,6 +37,7 @@ class DrawingView: public QWidget
                void mousePressEvent(QMouseEvent * event);
                void mouseMoveEvent(QMouseEvent * event);
                void mouseReleaseEvent(QMouseEvent * event);
+               void wheelEvent(QWheelEvent * event);
                void keyPressEvent(QKeyEvent * event);
                void keyReleaseEvent(QKeyEvent * event);
 
@@ -38,6 +47,10 @@ class DrawingView: public QWidget
 
        public:
                bool useAntialiasing;
+               uint32_t numSelected;
+               uint32_t numHovered;
+               bool shiftDown;
+               bool ctrlDown;
 
        private:
                QPixmap gridBackground;
@@ -48,18 +61,17 @@ class DrawingView: public QWidget
                uint32_t gridPixels;                                    // Grid size in pixels
        private:
                bool collided;
-//Should this go into Object's class variables???
-//maybe, maybe not... :-P
-               bool rotateTool;
-               double rx, ry;
                bool scrollDrag;
                Vector oldPoint;
-//             bool addLineTool;
-//             bool addCircleTool;
-//             bool addDimensionTool;
 
        public:
-               Action * toolAction;
+               std::vector<void *> select;
+               std::vector<void *> hover;
+//             Action * toolAction;
+
+//     public:
+//             static Container document;
 };
 
 #endif // __DRAWINGVIEW_H__
+