Go nuts with Qt
[ipdf/code.git] / src / view.cpp
index 8b1857d..d7d1e34 100644 (file)
@@ -3,6 +3,10 @@
 #include "screen.h"
 #include "gl_core44.h"
 
+#ifndef CONTROLPANEL_DISABLED
+       #include "controlpanel.h"
+#endif //CONTROLPANEL_DISABLED
+
 using namespace IPDF;
 using namespace std;
 
@@ -28,6 +32,7 @@ View::View(Document & document, Screen & screen, const Rect & bounds, const Colo
        m_object_renderers[RECT_OUTLINE] = new RectOutlineRenderer();
        m_object_renderers[CIRCLE_FILLED] = new CircleFilledRenderer();
        m_object_renderers[BEZIER] = new BezierRenderer();
+       m_object_renderers[GROUP] = new GroupRenderer();
 
        // To add rendering for a new type of object;
        // 1. Add enum to ObjectType in ipdf.h
@@ -72,6 +77,21 @@ void View::Translate(Real x, Real y)
        m_bounds_dirty = true;
 }
 
+/**
+ * Set View bounds
+ * @param bounds - New bounds
+ */
+void View::SetBounds(const Rect & bounds)
+{
+       m_bounds.x = bounds.x;
+       m_bounds.y = bounds.y;
+       m_bounds.w = bounds.w;
+       m_bounds.h = bounds.h;
+       if (!m_use_gpu_transform)
+               m_buffer_dirty = true;
+       m_bounds_dirty = true;
+}
+
 /**
  * Scale the View at a point
  * @param x, y - Coordinates to scale at (eg: Mouse cursor position)
@@ -238,6 +258,11 @@ void View::Render(int width, int height)
        m_cached_display.Blit(); // blit FrameBuffer to screen
        m_buffer_dirty = false;
        glPopDebugGroup();
+       
+#ifndef CONTROLPANEL_DISABLED
+       ControlPanel::Update();
+#endif //CONTROLPANEL_DISABLED
+       
 }
 
 #ifndef QUADTREE_DISABLED

UCC git Repository :: git.ucc.asn.au