[gegl-qt] Renaming: GeglQtViewImplementation -> GeglQt::NodeViewImplementation



commit 6663b0c0a47b9f348134c2e755e6752123dbdae9
Author: Jon Nordby <jononor gmail com>
Date:   Mon Aug 22 19:52:50 2011 +0200

    Renaming: GeglQtViewImplementation -> GeglQt::NodeViewImplementation
    
    Internal class, but still declaration is exposed through some
    forward declarations.

 gegl-qt/geglqtdeclarativeview.cpp               |    2 +-
 gegl-qt/geglqtdeclarativeview.h                 |    6 ++--
 gegl-qt/geglqtgraphicswidgetview.cpp            |    2 +-
 gegl-qt/geglqtgraphicswidgetview.h              |    6 ++--
 gegl-qt/geglqtview.cpp                          |    2 +-
 gegl-qt/geglqtview.h                            |    6 ++--
 gegl-qt/geglqtviewimplementation.cpp            |   30 +++++++++++-----------
 gegl-qt/geglqtviewimplementation.h              |   10 +++++--
 tests/test-view-internal/test-view-internal.cpp |    2 +-
 9 files changed, 35 insertions(+), 31 deletions(-)
---
diff --git a/gegl-qt/geglqtdeclarativeview.cpp b/gegl-qt/geglqtdeclarativeview.cpp
index 0a6131a..7f66362 100644
--- a/gegl-qt/geglqtdeclarativeview.cpp
+++ b/gegl-qt/geglqtdeclarativeview.cpp
@@ -5,7 +5,7 @@ using namespace GeglQt;
 
 NodeViewDeclarativeItem::NodeViewDeclarativeItem(QDeclarativeItem *parent)
     : QDeclarativeItem(parent)
-    , priv(new GeglQtViewImplementation())
+    , priv(new NodeViewImplementation())
 {
     setFlag(QGraphicsItem::ItemHasNoContents, false);
 
diff --git a/gegl-qt/geglqtdeclarativeview.h b/gegl-qt/geglqtdeclarativeview.h
index dce8980..6360d0c 100644
--- a/gegl-qt/geglqtdeclarativeview.h
+++ b/gegl-qt/geglqtdeclarativeview.h
@@ -6,10 +6,10 @@
 #include <gegl.h>
 #include "geglqtviewoptions.h"
 
-class GeglQtViewImplementation;
-
 namespace GeglQt {
 
+class NodeViewImplementation;
+
 class NodeViewDeclarativeItem : public QDeclarativeItem
 {
     Q_OBJECT
@@ -38,7 +38,7 @@ private Q_SLOTS:
 
 private:
     Q_DISABLE_COPY(NodeViewDeclarativeItem)
-    GeglQtViewImplementation *priv;
+    NodeViewImplementation *priv;
 };
 
 }
diff --git a/gegl-qt/geglqtgraphicswidgetview.cpp b/gegl-qt/geglqtgraphicswidgetview.cpp
index 50a4708..57e8387 100644
--- a/gegl-qt/geglqtgraphicswidgetview.cpp
+++ b/gegl-qt/geglqtgraphicswidgetview.cpp
@@ -23,7 +23,7 @@ using namespace GeglQt;
 
 NodeViewGraphicsWidget::NodeViewGraphicsWidget(QGraphicsItem * parent)
     : QGraphicsWidget(parent)
-    , priv(new GeglQtViewImplementation())
+    , priv(new NodeViewImplementation())
 {
     connect(priv, SIGNAL(viewAreaChanged(QRectF)),
             this, SLOT(invalidate(QRectF)));
diff --git a/gegl-qt/geglqtgraphicswidgetview.h b/gegl-qt/geglqtgraphicswidgetview.h
index 27850c9..df632f3 100644
--- a/gegl-qt/geglqtgraphicswidgetview.h
+++ b/gegl-qt/geglqtgraphicswidgetview.h
@@ -23,10 +23,10 @@
 #include <gegl.h>
 #include "geglqtviewoptions.h"
 
-class GeglQtViewImplementation;
-
 namespace GeglQt {
 
+class NodeViewImplementation;
+
 class NodeViewGraphicsWidget : public QGraphicsWidget
 {
     Q_OBJECT
@@ -51,7 +51,7 @@ private Q_SLOTS:
 
 private:
     Q_DISABLE_COPY(NodeViewGraphicsWidget)
-    GeglQtViewImplementation *priv;
+    NodeViewImplementation *priv;
 };
 
 }
diff --git a/gegl-qt/geglqtview.cpp b/gegl-qt/geglqtview.cpp
index f2d2e1e..b8cadb4 100644
--- a/gegl-qt/geglqtview.cpp
+++ b/gegl-qt/geglqtview.cpp
@@ -37,7 +37,7 @@ using namespace GeglQt;
  * Note that this would also test the implementation class, which is not ideal. */
 NodeViewWidget::NodeViewWidget(QWidget *parent)
     : QWidget(parent),
-      priv(new GeglQtViewImplementation())
+      priv(new NodeViewImplementation())
 {
     connect(priv, SIGNAL(viewAreaChanged(QRectF)),
             this, SLOT(invalidate(QRectF)));
diff --git a/gegl-qt/geglqtview.h b/gegl-qt/geglqtview.h
index 52dd7f6..e1f04da 100644
--- a/gegl-qt/geglqtview.h
+++ b/gegl-qt/geglqtview.h
@@ -25,10 +25,10 @@
 
 #include "geglqtviewoptions.h"
 
-class GeglQtViewImplementation;
-
 namespace GeglQt {
 
+class NodeViewImplementation;
+
 class NodeViewWidget : public QWidget
 {
     Q_OBJECT
@@ -53,7 +53,7 @@ private Q_SLOTS:
 
 private:
     Q_DISABLE_COPY(NodeViewWidget)
-    GeglQtViewImplementation *priv;
+    NodeViewImplementation *priv;
 };
 
 }
diff --git a/gegl-qt/geglqtviewimplementation.cpp b/gegl-qt/geglqtviewimplementation.cpp
index c69b80d..4c2798e 100644
--- a/gegl-qt/geglqtviewimplementation.cpp
+++ b/gegl-qt/geglqtviewimplementation.cpp
@@ -58,7 +58,7 @@ namespace {
 
 /* Just forward to the implementation class. */
 static void
-invalidated_event(GeglNode *node, GeglRectangle *rect, GeglQtViewImplementation *impl)
+invalidated_event(GeglNode *node, GeglRectangle *rect, NodeViewImplementation *impl)
 {
     Q_UNUSED(node);
     impl->nodeInvalidated(rect);
@@ -66,7 +66,7 @@ invalidated_event(GeglNode *node, GeglRectangle *rect, GeglQtViewImplementation
 
 /* Just forward to the implementation class. */
 static void
-computed_event(GeglNode *node, GeglRectangle *rect, GeglQtViewImplementation *impl)
+computed_event(GeglNode *node, GeglRectangle *rect, NodeViewImplementation *impl)
 {
     Q_UNUSED(node);
     impl->nodeComputed(rect);
@@ -84,7 +84,7 @@ computed_event(GeglNode *node, GeglRectangle *rect, GeglQtViewImplementation *im
 * - emitting 'invalidated' on the input node, observing that the 'computed' signal is emitted correctly
 * - emitting 'computed' on the input node, observing that the 'viewAreaChanged' signal is emitted correctly
 */
-GeglQtViewImplementation::GeglQtViewImplementation(QObject *parent)
+NodeViewImplementation::NodeViewImplementation(QObject *parent)
     : QObject(parent)
     , mInputNode(0)
     , processor(0)
@@ -97,7 +97,7 @@ GeglQtViewImplementation::GeglQtViewImplementation(QObject *parent)
     connect(timer, SIGNAL(timeout()), this, SLOT(processNode()));
 }
 
-GeglQtViewImplementation::~GeglQtViewImplementation()
+NodeViewImplementation::~NodeViewImplementation()
 {
     delete timer;
     if (processor) {
@@ -107,7 +107,7 @@ GeglQtViewImplementation::~GeglQtViewImplementation()
 }
 
 void
-GeglQtViewImplementation::setInputNode(GeglNode *node)
+NodeViewImplementation::setInputNode(GeglNode *node)
 {
     if (mInputNode) {
         g_object_unref(mInputNode);
@@ -129,19 +129,19 @@ GeglQtViewImplementation::setInputNode(GeglNode *node)
 }
 
 GeglNode *
-GeglQtViewImplementation::inputNode() const
+NodeViewImplementation::inputNode() const
 {
     return mInputNode;
 }
 
 NodeViewOptions *
-GeglQtViewImplementation::options() const
+NodeViewImplementation::options() const
 {
     return mOptions;
 }
 
 void
-GeglQtViewImplementation::setOptions(NodeViewOptions *newOptions)
+NodeViewImplementation::setOptions(NodeViewOptions *newOptions)
 {
     if (mOptions && mOptions == newOptions) {
         return;
@@ -170,7 +170,7 @@ GeglQtViewImplementation::setOptions(NodeViewOptions *newOptions)
  * - Autoscale and Autocenter options
  */
 void
-GeglQtViewImplementation::updateAutoCenterScale()
+NodeViewImplementation::updateAutoCenterScale()
 {
     if (!mViewportSize.isValid() || !inputNode()) {
         return;
@@ -217,7 +217,7 @@ GeglQtViewImplementation::updateAutoCenterScale()
 /* The model->view transformation changed
  * we must recalculate the viewport */
 void
-GeglQtViewImplementation::transformationChanged()
+NodeViewImplementation::transformationChanged()
 {
     /* OPTIMIZE: On simple transformation changes like
      * translation, only a portion of the viewport actually needs to be redrawn. */
@@ -229,7 +229,7 @@ GeglQtViewImplementation::transformationChanged()
 
 /* */
 void
-GeglQtViewImplementation::viewportSizeChanged(QSizeF newSize)
+NodeViewImplementation::viewportSizeChanged(QSizeF newSize)
 {
     mViewportSize = newSize;
     updateAutoCenterScale();
@@ -238,7 +238,7 @@ GeglQtViewImplementation::viewportSizeChanged(QSizeF newSize)
 /* An area in the GeglNode has been invalidated,
  * process it to compute the contents. */
 void
-GeglQtViewImplementation::nodeInvalidated(GeglRectangle *rect)
+NodeViewImplementation::nodeInvalidated(GeglRectangle *rect)
 {
     if (!mInputNode) {
         return;
@@ -255,7 +255,7 @@ GeglQtViewImplementation::nodeInvalidated(GeglRectangle *rect)
 }
 
 void
-GeglQtViewImplementation::processNode()
+NodeViewImplementation::processNode()
 {
     if (!processor) {
         return;
@@ -268,7 +268,7 @@ GeglQtViewImplementation::processNode()
 }
 
 void
-GeglQtViewImplementation::nodeComputed(GeglRectangle *rect)
+NodeViewImplementation::nodeComputed(GeglRectangle *rect)
 {
     updateAutoCenterScale(); // Notify of potential changes in the GeglNode bounding box
 
@@ -280,7 +280,7 @@ GeglQtViewImplementation::nodeComputed(GeglRectangle *rect)
 
 /* XXX: Should this really be part of this class? Consider moving to dedicted class? */
 void
-GeglQtViewImplementation::paint(QPainter *painter, const QRectF & viewRect)
+NodeViewImplementation::paint(QPainter *painter, const QRectF & viewRect)
 {
     guchar *buffer = NULL;
     GeglRectangle roi;
diff --git a/gegl-qt/geglqtviewimplementation.h b/gegl-qt/geglqtviewimplementation.h
index 3df4a22..f4a5306 100644
--- a/gegl-qt/geglqtviewimplementation.h
+++ b/gegl-qt/geglqtviewimplementation.h
@@ -23,12 +23,14 @@
 #include <gegl.h>
 #include "geglqtviewoptions.h"
 
-class GeglQtViewImplementation : public QObject
+namespace GeglQt {
+
+class NodeViewImplementation : public QObject
 {
     Q_OBJECT
 public:
-    explicit GeglQtViewImplementation(QObject *parent = 0);
-    ~GeglQtViewImplementation();
+    explicit NodeViewImplementation(QObject *parent = 0);
+    ~NodeViewImplementation();
 
     void setInputNode(GeglNode *node);
     GeglNode *inputNode() const;
@@ -65,4 +67,6 @@ private:
     QSizeF mViewportSize;
 };
 
+}
+
 #endif // GEGLQTVIEWIMPLEMENTATION_H
diff --git a/tests/test-view-internal/test-view-internal.cpp b/tests/test-view-internal/test-view-internal.cpp
index c68742e..d4cf77e 100644
--- a/tests/test-view-internal/test-view-internal.cpp
+++ b/tests/test-view-internal/test-view-internal.cpp
@@ -14,7 +14,7 @@ TestViewInternal::TestViewInternal(QObject *parent) :
 
 void TestViewInternal::testNothing()
 {
-    GeglQtViewImplementation viewImplementation;
+    NodeViewImplementation viewImplementation;
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]