]> Shamusworld >> Repos - architektonas/blobdiff - src/drawingview.h
Converted codebase from Qt4 to Qt5.
[architektonas] / src / drawingview.h
index 7d4301e81ef74603fbdfd21ac0aedc1d7f90cf0c..af0fa9265afdade5a85430e35b5a6905aad0dd64 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef __DRAWINGVIEW_H__
 #define __DRAWINGVIEW_H__
 
-#include <QtGui>
+#include <QtWidgets>
 #include <stdint.h>
+#include "action.h"
 #include "container.h"
 
 class DrawingView: public QWidget
@@ -13,13 +14,25 @@ class DrawingView: public QWidget
                DrawingView(QWidget * parent = NULL);
 
        public:
-               void SetRotateToolActive(bool state = true);
+//             void SetRotateToolActive(bool state = true);
+               void SetToolActive(Action * action);
+               void SetGridSize(uint32_t);
+               void UpdateGridBackground(void);
+
+       public slots:
+               void AddNewObjectToDocument(Object *);
+               void HandleActionUpdate(void);
+               void SetCurrentLayer(int);
 
        protected:
                void paintEvent(QPaintEvent * event);
+               void resizeEvent(QResizeEvent * event);
                void mousePressEvent(QMouseEvent * event);
                void mouseMoveEvent(QMouseEvent * event);
                void mouseReleaseEvent(QMouseEvent * event);
+               void wheelEvent(QWheelEvent * event);
+               void keyPressEvent(QKeyEvent * event);
+               void keyReleaseEvent(QKeyEvent * event);
 
        private:
                QPoint GetAdjustedMousePosition(QMouseEvent * event);
@@ -29,34 +42,30 @@ class DrawingView: public QWidget
                bool useAntialiasing;
 
        private:
+               QPixmap gridBackground;
                double scale;                                                   // Window scaling factor
                int32_t offsetX, offsetY;                               // Window offsets
+       public:
                Container document;
-               double gridSpacing;
+               uint32_t gridPixels;                                    // Grid size in pixels
+       private:
                bool collided;
 //Should this go into Object's class variables???
-               bool rotateTool;
-               double rx, ry;
+//maybe, maybe not... :-P
+//             bool rotateTool;
+//             double rx, ry;
                bool scrollDrag;
                Vector oldPoint;
-/*             QSize minimumSizeHint() const;
-               QSize sizeHint() const;
+//             bool addLineTool;
+//             bool addCircleTool;
+//             bool addDimensionTool;
 
-       private:
-               void CreateCursors(void);
-               QPoint GetAdjustedMousePosition(QMouseEvent * event);
-               QPoint GetAdjustedClientPosition(int x, int y);
-
-               QImage image;
-               QPoint pt, ptOffset, ptPrevious;
-               ToolType tool;                                                  // Current tool
-               GlyphPoints pts;                                                // Glyph point structure
-               int32 ptHighlight, oldPtHighlight, ptNextHighlight, oldPtNextHighlight;
-               bool polyFirstPoint;
+       public:
+               Action * toolAction;
 
-               ToolWindow * toolPalette;
-               QCursor cur[8];
-*/
+//     public:
+//             static Container document;
 };
 
 #endif // __DRAWINGVIEW_H__
+