diff options
Diffstat (limited to 'Drawer.h')
-rw-r--r-- | Drawer.h | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/Drawer.h b/Drawer.h deleted file mode 100644 index cded19a..0000000 --- a/Drawer.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef DRAWER_H_ -#define DRAWER_H_ - -#include <gtk/gtk.h> -#include <gtk/gtkgl.h> -#include "Vertex.h" -#include "Renderer.h" - -class Window; - - -class Drawer { - private: - GtkWidget *drawer; - GtkWidget *drawingArea; - GtkAdjustment *hAdjustment, *vAdjustment; - GtkWidget *hRuler, *vRuler; - int zoomExp; - - Window *window; - - Renderer renderer; - - float scale; - float xCenter, yCenter; - - // prevent shallow copy - Drawer(const Drawer &w); - const Drawer& operator=(const Drawer &w); - - void updateViewport(); - void updateScrolling(); - void updateScrollbars(float x = 0.5f, float y = 0.5f); - - void updateHoveredPoint(float x, float y); - - void render(); - - gint getWidth() const { - return drawingArea->allocation.width; - } - - gint getHeight() const { - return drawingArea->allocation.height; - } - - static void realize(GtkWidget *widget, Drawer *drawer); - static gboolean eventHandler(GtkWidget *widget, GdkEvent *event, Drawer *drawer); - static void valueChanged(GtkAdjustment *adjustment, Drawer *drawer); - - public: - Drawer(Window *window, GdkGLConfig *glconfig); - virtual ~Drawer(); - - void zoom(int zoom, float x = 0.5f, float y = 0.5f); - - void imageToView(Vertex *v) const; - void viewToImage(Vertex *v) const; - - float getImageWidth() const; - float getImageHeight() const; - - float getXCenter() const { - return xCenter; - } - - float getYCenter() const { - return yCenter; - } - - float getScale() const { - return scale; - } - - GtkWidget *getWidget() const { - return drawer; - } - - void update() { - updateScrollbars(); - } -}; - -#endif /*DRAWER_H_*/ |