From 36d892d1f0f0a919e70f81abddaeb568f1f7625c Mon Sep 17 00:00:00 2001 From: neoraider Date: Mon, 5 May 2008 19:26:05 +0000 Subject: zoomedit: * Use signals to inform RenderArea of view changes --- src/View/MapView.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/View/MapView.h') diff --git a/src/View/MapView.h b/src/View/MapView.h index 2fb0df4..e34cae5 100644 --- a/src/View/MapView.h +++ b/src/View/MapView.h @@ -21,6 +21,7 @@ #define ZOOMEDIT_VIEW_MAPVIEW_H_ #include "View.h" +#include namespace ZoomEdit { @@ -34,29 +35,33 @@ class TopView; class MapView : public View { private: - Data::Level *level; + sigc::connection mainViewUpdate; - Gui::RenderArea *mainArea; + float viewWidth, viewHeight; + + TopView *mainView; float scale, xCenter, yCenter; void getBounds(float *minX, float *maxX, float *minY, float *maxY); public: - MapView(Gui::RenderArea *mainArea0 = 0, Data::Level *level0 = 0) - : level(level0), mainArea(mainArea0), scale(1), xCenter(0), yCenter(0) {} + MapView(TopView *mainView0 = 0) + : mainView(0), scale(1), xCenter(0), yCenter(0) { + setMainView(mainView0); + } - Data::Level* getLevel() {return level;} - void setLevel(Data::Level *level0) {level = level0;} + TopView* getMainView() {return mainView;} + void setMainView(TopView *mainView0); - Gui::RenderArea* getMainArea() {return mainArea;} - void setMainArea(Gui::RenderArea *mainArea0) {mainArea = mainArea0;} + virtual void init(); + virtual void resize(float width, float height); - virtual void zoom(Gui::RenderArea*, int zoom, float, float); - virtual void move(Gui::RenderArea*, float x, float y, unsigned int state); - virtual void click(Gui::RenderArea *renderArea, float x, float y); + virtual void render(); - virtual void render(Gui::RenderArea *renderArea); + virtual void zoom(int zoom, float, float); + virtual void move(float x, float y, unsigned int state); + virtual void click(float x, float y); }; } -- cgit v1.2.3