X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.h;h=3531291ac5bb4b1f51d84b65068032ebd6394171;hb=84afe881653a02a16b19d4da37435b8701b1a826;hp=dfb9f8fc0b43c18dc96d5872a41415487ef7d667;hpb=f19a3a172c425b7fcc5a648a94870f0247c6be89;p=architektonas diff --git a/src/drawingview.h b/src/drawingview.h index dfb9f8f..3531291 100644 --- a/src/drawingview.h +++ b/src/drawingview.h @@ -1,9 +1,13 @@ #ifndef __DRAWINGVIEW_H__ #define __DRAWINGVIEW_H__ -#include +#include #include -#include "container.h" +//#include "action.h" +//#include "container.h" +#include "structs.h" + +class Painter; class DrawingView: public QWidget { @@ -13,15 +17,26 @@ class DrawingView: public QWidget DrawingView(QWidget * parent = NULL); public: - void SetRotateToolActive(bool state = true); -// void ZoomIn(void); -// void ZoomOut(void); +// void SetToolActive(Action * action); + void SetGridSize(uint32_t); + void UpdateGridBackground(void); + Point SnapPointToGrid(Point); + void RenderObjects(Painter *, Container *); + + 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); @@ -31,34 +46,23 @@ 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; bool scrollDrag; Vector oldPoint; -/* QSize minimumSizeHint() const; - QSize sizeHint() const; - - 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__ +