[gegl-qt] Renaming: GeglQtViewOptions -> GeglQt::NodeViewOptions



commit 07ff13b33c9c46298d0a3fd063adea57512adf98
Author: Jon Nordby <jononor gmail com>
Date:   Mon Aug 22 19:22:40 2011 +0200

    Renaming: GeglQtViewOptions -> GeglQt::NodeViewOptions
    
    New namespace GeglQt, move view options class into it.
    Also add "using namespace GeglQt" to most parts of the code.

 examples/qgv-basic/qgv-basic.cpp                   |    2 +
 examples/qml-basic/qml-basic.cpp                   |    2 +
 examples/qml-paint/qml-paint.cpp                   |    2 +
 .../autotransform-controls.cpp                     |   14 ++++----
 .../qwidget-autotransform/autotransform-controls.h |    6 ++-
 .../qwidget-autotransform.cpp                      |    2 +
 examples/qwidget-basic/qwidget-basic.cpp           |    2 +
 .../qwidget-transformations.cpp                    |    2 +-
 .../transformation-controls.cpp                    |    2 +-
 .../transformation-controls.h                      |    6 ++-
 gegl-qt/gegl-qt.h                                  |    1 +
 gegl-qt/geglqtdeclarativeview.cpp                  |    4 ++-
 gegl-qt/geglqtdeclarativeview.h                    |    2 +-
 gegl-qt/geglqtgraphicswidgetview.cpp               |    4 ++-
 gegl-qt/geglqtgraphicswidgetview.h                 |    2 +-
 gegl-qt/geglqtview.cpp                             |    4 ++-
 gegl-qt/geglqtview.h                               |    2 +-
 gegl-qt/geglqtviewimplementation.cpp               |   20 ++++++-----
 gegl-qt/geglqtviewimplementation.h                 |    8 ++---
 gegl-qt/geglqtviewoptions.cpp                      |   34 ++++++++++---------
 gegl-qt/geglqtviewoptions.h                        |   19 +++++++----
 operations/geglqtdisplay.cpp                       |    4 ++-
 tests/test-view-internal/test-view-internal.cpp    |    2 +
 23 files changed, 89 insertions(+), 57 deletions(-)
---
diff --git a/examples/qgv-basic/qgv-basic.cpp b/examples/qgv-basic/qgv-basic.cpp
index f02db14..4d1c8db 100644
--- a/examples/qgv-basic/qgv-basic.cpp
+++ b/examples/qgv-basic/qgv-basic.cpp
@@ -21,6 +21,8 @@
 #include <QtGui>
 #include <QtCore>
 
+using namespace GeglQt;
+
 int main(int argc, char *argv[])
 {
     GeglNode *graph, *node;
diff --git a/examples/qml-basic/qml-basic.cpp b/examples/qml-basic/qml-basic.cpp
index 92b5561..eee9cd3 100644
--- a/examples/qml-basic/qml-basic.cpp
+++ b/examples/qml-basic/qml-basic.cpp
@@ -22,6 +22,8 @@
 #include <QtCore>
 #include <QtDeclarative>
 
+using namespace GeglQt;
+
 int main(int argc, char *argv[])
 {
     GeglNode *graph, *node;
diff --git a/examples/qml-paint/qml-paint.cpp b/examples/qml-paint/qml-paint.cpp
index bba908a..3331bba 100644
--- a/examples/qml-paint/qml-paint.cpp
+++ b/examples/qml-paint/qml-paint.cpp
@@ -24,6 +24,8 @@
 #include <QtCore>
 #include <QtDeclarative>
 
+using namespace GeglQt;
+
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
diff --git a/examples/qwidget-autotransform/autotransform-controls.cpp b/examples/qwidget-autotransform/autotransform-controls.cpp
index 30566b6..50876d5 100644
--- a/examples/qwidget-autotransform/autotransform-controls.cpp
+++ b/examples/qwidget-autotransform/autotransform-controls.cpp
@@ -25,7 +25,7 @@ AutoTransformControls::buildUi()
 }
 
 void
-AutoTransformControls::setViewOptionsInstance(GeglQtViewOptions *options)
+AutoTransformControls::setViewOptionsInstance(NodeViewOptions *options)
 {
     mViewOptions = options;
 
@@ -41,12 +41,12 @@ AutoTransformControls::setViewOptionsInstance(GeglQtViewOptions *options)
 void
 AutoTransformControls::autoCenterChanged(bool newValue)
 {
-    GeglQtViewOptions::AutoCenter autoCenter = newValue ?
-                GeglQtViewOptions::AutoCenterEnabled : GeglQtViewOptions::AutoCenterDisabled;
+    NodeViewOptions::AutoCenter autoCenter = newValue ?
+                NodeViewOptions::AutoCenterEnabled : NodeViewOptions::AutoCenterDisabled;
 
     mViewOptions->setAutoCenterPolicy(autoCenter);
 
-    if (autoCenter == GeglQtViewOptions::AutoCenterDisabled) {
+    if (autoCenter == NodeViewOptions::AutoCenterDisabled) {
         // To get a nice toggling effect, reset translation
         // Otherwise the view would just have stayed where it is when autocentering is disabled.
         mViewOptions->setTranslationX(0.0);
@@ -57,11 +57,11 @@ AutoTransformControls::autoCenterChanged(bool newValue)
 void
 AutoTransformControls::autoScaleChanged(bool newValue)
 {
-    GeglQtViewOptions::AutoScale autoScale = newValue ?
-                GeglQtViewOptions::AutoScaleToView : GeglQtViewOptions::AutoScaleDisabled;
+    NodeViewOptions::AutoScale autoScale = newValue ?
+                NodeViewOptions::AutoScaleToView : NodeViewOptions::AutoScaleDisabled;
     mViewOptions->setAutoScalePolicy(autoScale);
 
-    if (autoScale == GeglQtViewOptions::AutoScaleDisabled) {
+    if (autoScale == NodeViewOptions::AutoScaleDisabled) {
         // To get a nice toggling effect, reset scale
         // Otherwise the view would just have stayed where it os when autoscale is disabled.
         mViewOptions->setScale(1.0);
diff --git a/examples/qwidget-autotransform/autotransform-controls.h b/examples/qwidget-autotransform/autotransform-controls.h
index 6b769d0..c9c52d3 100644
--- a/examples/qwidget-autotransform/autotransform-controls.h
+++ b/examples/qwidget-autotransform/autotransform-controls.h
@@ -4,13 +4,15 @@
 #include <QtGui>
 #include "geglqtviewoptions.h"
 
+using namespace GeglQt;
+
 class AutoTransformControls : public QWidget
 {
     Q_OBJECT
 public:
     explicit AutoTransformControls(QWidget *parent = 0);
 
-    void setViewOptionsInstance(GeglQtViewOptions*);
+    void setViewOptionsInstance(NodeViewOptions*);
 
 private Q_SLOTS:
     void autoCenterChanged(bool newValue);
@@ -22,7 +24,7 @@ private:
 private:
     QCheckBox *m_autoCenterCheckBox;
     QCheckBox *m_autoScaleCheckBox;
-    GeglQtViewOptions *mViewOptions;
+    NodeViewOptions *mViewOptions;
 };
 
 
diff --git a/examples/qwidget-autotransform/qwidget-autotransform.cpp b/examples/qwidget-autotransform/qwidget-autotransform.cpp
index 8a607a0..0946bd4 100644
--- a/examples/qwidget-autotransform/qwidget-autotransform.cpp
+++ b/examples/qwidget-autotransform/qwidget-autotransform.cpp
@@ -22,6 +22,8 @@
 #include <QtGui/QApplication>
 #include <QtCore>
 
+using namespace GeglQt;
+
 int main(int argc, char *argv[])
 {
     GeglNode *graph, *node;
diff --git a/examples/qwidget-basic/qwidget-basic.cpp b/examples/qwidget-basic/qwidget-basic.cpp
index d39f3b3..15d02fe 100644
--- a/examples/qwidget-basic/qwidget-basic.cpp
+++ b/examples/qwidget-basic/qwidget-basic.cpp
@@ -21,6 +21,8 @@
 #include <QtGui/QApplication>
 #include <QtCore>
 
+using namespace GeglQt;
+
 int main(int argc, char *argv[])
 {
     GeglNode *graph, *node;
diff --git a/examples/qwidget-transformations/qwidget-transformations.cpp b/examples/qwidget-transformations/qwidget-transformations.cpp
index 50f8564..63d22b2 100644
--- a/examples/qwidget-transformations/qwidget-transformations.cpp
+++ b/examples/qwidget-transformations/qwidget-transformations.cpp
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
     layout->addWidget(view, 1);
 
     TransformationControls *controls = new TransformationControls();
-    GeglQtViewOptions *options = view->options();
+    NodeViewOptions *options = view->options();
     controls->setViewOptionsInstance(options);
     layout->addWidget(controls);
 
diff --git a/examples/qwidget-transformations/transformation-controls.cpp b/examples/qwidget-transformations/transformation-controls.cpp
index d3312b2..c61ae76 100644
--- a/examples/qwidget-transformations/transformation-controls.cpp
+++ b/examples/qwidget-transformations/transformation-controls.cpp
@@ -47,7 +47,7 @@ TransformationControls::buildUi()
 }
 
 void
-TransformationControls::setViewOptionsInstance(GeglQtViewOptions *options)
+TransformationControls::setViewOptionsInstance(NodeViewOptions *options)
 {
     mViewOptions = options;
 
diff --git a/examples/qwidget-transformations/transformation-controls.h b/examples/qwidget-transformations/transformation-controls.h
index 6e353b5..2cb2e2f 100644
--- a/examples/qwidget-transformations/transformation-controls.h
+++ b/examples/qwidget-transformations/transformation-controls.h
@@ -5,18 +5,20 @@
 
 #include "geglqtviewoptions.h"
 
+using namespace GeglQt;
+
 class TransformationControls : public QWidget
 {
     Q_OBJECT
 public:
     explicit TransformationControls(QWidget *parent = 0);
 
-    void setViewOptionsInstance(GeglQtViewOptions *options);
+    void setViewOptionsInstance(NodeViewOptions *options);
 
 private:
     void buildUi();
 private:
-    GeglQtViewOptions *mViewOptions;
+    NodeViewOptions *mViewOptions;
     QDoubleSpinBox *m_xSpinBox;
     QDoubleSpinBox *m_ySpinBox;
     QDoubleSpinBox *m_scaleSpinBox;
diff --git a/gegl-qt/gegl-qt.h b/gegl-qt/gegl-qt.h
index 494d785..d0f56f0 100644
--- a/gegl-qt/gegl-qt.h
+++ b/gegl-qt/gegl-qt.h
@@ -2,6 +2,7 @@
 #define GEGLQT_H
 
 // Widgets
+
 #include "geglqtview.h"
 #include "geglqtgraphicswidgetview.h"
 #include "geglqtdeclarativeview.h"
diff --git a/gegl-qt/geglqtdeclarativeview.cpp b/gegl-qt/geglqtdeclarativeview.cpp
index cc0afe1..f27b968 100644
--- a/gegl-qt/geglqtdeclarativeview.cpp
+++ b/gegl-qt/geglqtdeclarativeview.cpp
@@ -1,6 +1,8 @@
 #include "geglqtdeclarativeview.h"
 #include "geglqtviewimplementation.h"
 
+using namespace GeglQt;
+
 GeglQtDeclarativeView::GeglQtDeclarativeView(QDeclarativeItem *parent)
     : QDeclarativeItem(parent)
     , priv(new GeglQtViewImplementation())
@@ -34,7 +36,7 @@ GeglQtDeclarativeView::inputNode()
     return qVariantFromValue(static_cast<void*>(priv->inputNode()));
 }
 
-GeglQtViewOptions *
+NodeViewOptions *
 GeglQtDeclarativeView::options() const
 {
     return priv->options();
diff --git a/gegl-qt/geglqtdeclarativeview.h b/gegl-qt/geglqtdeclarativeview.h
index 38bffdd..e8c9b0c 100644
--- a/gegl-qt/geglqtdeclarativeview.h
+++ b/gegl-qt/geglqtdeclarativeview.h
@@ -20,7 +20,7 @@ public:
     QVariant inputNode();
     Q_PROPERTY(QVariant inputNode READ inputNode WRITE setInputNode NOTIFY inputNodeChanged)
 
-    Q_INVOKABLE GeglQtViewOptions *options() const;
+    Q_INVOKABLE GeglQt::NodeViewOptions *options() const;
 
     //! reimpl
     void geometryChanged(const QRectF & newGeometry, const QRectF & oldGeometry);
diff --git a/gegl-qt/geglqtgraphicswidgetview.cpp b/gegl-qt/geglqtgraphicswidgetview.cpp
index d8ee9b7..dd524a6 100644
--- a/gegl-qt/geglqtgraphicswidgetview.cpp
+++ b/gegl-qt/geglqtgraphicswidgetview.cpp
@@ -19,6 +19,8 @@
 #include "geglqtgraphicswidgetview.h"
 #include "geglqtviewimplementation.h"
 
+using namespace GeglQt;
+
 GeglQtGraphicsWidgetView::GeglQtGraphicsWidgetView(QGraphicsItem * parent)
     : QGraphicsWidget(parent)
     , priv(new GeglQtViewImplementation())
@@ -50,7 +52,7 @@ GeglQtGraphicsWidgetView::inputNode()
     return priv->inputNode();
 }
 
-GeglQtViewOptions *
+NodeViewOptions *
 GeglQtGraphicsWidgetView::options() const
 {
     return priv->options();
diff --git a/gegl-qt/geglqtgraphicswidgetview.h b/gegl-qt/geglqtgraphicswidgetview.h
index a03329d..efce143 100644
--- a/gegl-qt/geglqtgraphicswidgetview.h
+++ b/gegl-qt/geglqtgraphicswidgetview.h
@@ -35,7 +35,7 @@ public:
     void setInputNode(GeglNode *node);
     GeglNode *inputNode();
 
-    GeglQtViewOptions *options() const;
+    GeglQt::NodeViewOptions *options() const;
 
     //! reimpl
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
diff --git a/gegl-qt/geglqtview.cpp b/gegl-qt/geglqtview.cpp
index d1f345f..74c8c92 100644
--- a/gegl-qt/geglqtview.cpp
+++ b/gegl-qt/geglqtview.cpp
@@ -22,6 +22,8 @@
 #include <Qt/QtGui>
 #include <QtDebug>
 
+using namespace GeglQt;
+
 /* GeglQtView is a QWidget that displays the output of a single GeglNode. */
 
 /* Responsible for drawing the contents of the GeglNode, and
@@ -60,7 +62,7 @@ GeglQtView::setInputNode(GeglNode *newNode)
     priv->setInputNode(newNode);
 }
 
-GeglQtViewOptions *
+NodeViewOptions *
 GeglQtView::options() const
 {
     return priv->options();
diff --git a/gegl-qt/geglqtview.h b/gegl-qt/geglqtview.h
index c5ead41..20b0f78 100644
--- a/gegl-qt/geglqtview.h
+++ b/gegl-qt/geglqtview.h
@@ -38,7 +38,7 @@ public:
     GeglNode *inputNode() const;
     void setInputNode(GeglNode *node);
 
-    GeglQtViewOptions *options() const;
+    GeglQt::NodeViewOptions *options() const;
 
     //! \reimpl
     virtual void paintEvent(QPaintEvent *event);
diff --git a/gegl-qt/geglqtviewimplementation.cpp b/gegl-qt/geglqtviewimplementation.cpp
index 0eb8d13..c69b80d 100644
--- a/gegl-qt/geglqtviewimplementation.cpp
+++ b/gegl-qt/geglqtviewimplementation.cpp
@@ -21,6 +21,8 @@
 #include <QtCore>
 #include <QTransform>
 
+using namespace GeglQt;
+
 /* Utility functions */
 namespace {
     void gegl_rectangle_set_from_qrect(GeglRectangle *rect, const QRect &qrect)
@@ -40,13 +42,13 @@ namespace {
     }
 
     /* TODO: handle the clipping caused by the viewport size */
-    QRectF viewAreaFromModelArea(const QRectF & modelArea, GeglQtViewOptions *viewOptions)
+    QRectF viewAreaFromModelArea(const QRectF & modelArea, NodeViewOptions *viewOptions)
     {
         QTransform transform = viewOptions->transformation();
         return transform.mapRect(modelArea);
     }
 
-    QRectF modelAreaFromViewArea(const QRectF & viewArea, GeglQtViewOptions *viewOptions)
+    QRectF modelAreaFromViewArea(const QRectF & viewArea, NodeViewOptions *viewOptions)
     {
         Q_ASSERT(transform.isInvertible());
         QTransform transform = viewOptions->transformation().inverted();
@@ -132,14 +134,14 @@ GeglQtViewImplementation::inputNode() const
     return mInputNode;
 }
 
-GeglQtViewOptions *
+NodeViewOptions *
 GeglQtViewImplementation::options() const
 {
     return mOptions;
 }
 
 void
-GeglQtViewImplementation::setOptions(GeglQtViewOptions *newOptions)
+GeglQtViewImplementation::setOptions(NodeViewOptions *newOptions)
 {
     if (mOptions && mOptions == newOptions) {
         return;
@@ -148,7 +150,7 @@ GeglQtViewImplementation::setOptions(GeglQtViewOptions *newOptions)
     /* FIXME: Don't take complete ownership of the options instance.
      * Use refcounting instead? */
     delete mOptions;
-    mOptions = newOptions ? newOptions : new GeglQtViewOptions();
+    mOptions = newOptions ? newOptions : new NodeViewOptions();
 
     connect(options(), SIGNAL(transformationChanged()),
             this, SLOT(transformationChanged()));
@@ -174,7 +176,7 @@ GeglQtViewImplementation::updateAutoCenterScale()
         return;
     }
 
-    if (options()->autoScalePolicy() == GeglQtViewOptions::AutoScaleToView) {
+    if (options()->autoScalePolicy() == NodeViewOptions::AutoScaleToView) {
         // Set scale such that the full model fits inside the viewport
         GeglRectangle bbox = gegl_node_get_bounding_box(inputNode());
         QRectF modelArea(bbox.x, bbox.y, bbox.width, bbox.height);
@@ -188,7 +190,7 @@ GeglQtViewImplementation::updateAutoCenterScale()
 
         options()->setScale(options()->scale()*(1.0/maxRatio));
 
-    } else if (options()->autoScalePolicy() == GeglQtViewOptions::AutoScaleViewport) {
+    } else if (options()->autoScalePolicy() == NodeViewOptions::AutoScaleViewport) {
         // Reset transformation, and request that the widget changes its viewport size to fit the model
         options()->setScale(1.0);
         options()->setTranslationX(0.0);
@@ -198,8 +200,8 @@ GeglQtViewImplementation::updateAutoCenterScale()
         Q_EMIT viewportSizeRequest(QSizeF(bbox.width, bbox.height));
     }
 
-    if (options()->autoCenterPolicy() == GeglQtViewOptions::AutoCenterEnabled
-        && options()->autoScalePolicy() != GeglQtViewOptions::AutoScaleViewport) {
+    if (options()->autoCenterPolicy() == NodeViewOptions::AutoCenterEnabled
+        && options()->autoScalePolicy() != NodeViewOptions::AutoScaleViewport) {
         // Set translation such that the center of the model is center of the viewport
         GeglRectangle bbox = gegl_node_get_bounding_box(inputNode());
         QPointF modelCenter(bbox.width/2.0, bbox.height/2.0);
diff --git a/gegl-qt/geglqtviewimplementation.h b/gegl-qt/geglqtviewimplementation.h
index 2bde222..3df4a22 100644
--- a/gegl-qt/geglqtviewimplementation.h
+++ b/gegl-qt/geglqtviewimplementation.h
@@ -23,8 +23,6 @@
 #include <gegl.h>
 #include "geglqtviewoptions.h"
 
-class GeglQtViewOptions;
-
 class GeglQtViewImplementation : public QObject
 {
     Q_OBJECT
@@ -35,8 +33,8 @@ public:
     void setInputNode(GeglNode *node);
     GeglNode *inputNode() const;
 
-    GeglQtViewOptions *options() const;
-    void setOptions(GeglQtViewOptions *newOptions);
+    GeglQt::NodeViewOptions *options() const;
+    void setOptions(GeglQt::NodeViewOptions *newOptions);
 
     void paint(QPainter *painter, const QRectF & viewRect);
 
@@ -63,7 +61,7 @@ private:
     GeglNode *mInputNode; // The node the widget displays.
     GeglProcessor *processor; // Used to process the GeglNode when invalidated.
     QTimer *timer; // Used to defer operations to the mainloop.
-    GeglQtViewOptions *mOptions;
+    GeglQt::NodeViewOptions *mOptions;
     QSizeF mViewportSize;
 };
 
diff --git a/gegl-qt/geglqtviewoptions.cpp b/gegl-qt/geglqtviewoptions.cpp
index 99b454b..f02b8fd 100644
--- a/gegl-qt/geglqtviewoptions.cpp
+++ b/gegl-qt/geglqtviewoptions.cpp
@@ -20,12 +20,14 @@
 
 #include <QtGui>
 
+using namespace GeglQt;
+
 struct GeglQtViewOptionsPrivate {
     double translationX;
     double translationY;
     double scale;
-    GeglQtViewOptions::AutoCenter autoCenter;
-    GeglQtViewOptions::AutoScale autoScale;
+    NodeViewOptions::AutoCenter autoCenter;
+    NodeViewOptions::AutoScale autoScale;
 };
 
 /*
@@ -56,7 +58,7 @@ struct GeglQtViewOptionsPrivate {
  * Suprising that calling setSomething(), and then something() would not return the same value;
  * or that scale() returns a different value from the current transformation (and that transformation() indicates)
  */
-GeglQtViewOptions::GeglQtViewOptions(QObject *parent)
+NodeViewOptions::NodeViewOptions(QObject *parent)
     : QObject(parent)
     , priv(new GeglQtViewOptionsPrivate())
 {
@@ -69,7 +71,7 @@ GeglQtViewOptions::GeglQtViewOptions(QObject *parent)
 }
 
 void
-GeglQtViewOptions::setScale(double newScale)
+NodeViewOptions::setScale(double newScale)
 {
     if (priv->scale == newScale) {
         return;
@@ -80,13 +82,13 @@ GeglQtViewOptions::setScale(double newScale)
 }
 
 double
-GeglQtViewOptions::scale()
+NodeViewOptions::scale()
 {
     return priv->scale;
 }
 
 void
-GeglQtViewOptions::setTranslationX(double newTranslationX)
+NodeViewOptions::setTranslationX(double newTranslationX)
 {
     if (priv->translationX == newTranslationX) {
         return;
@@ -97,13 +99,13 @@ GeglQtViewOptions::setTranslationX(double newTranslationX)
 }
 
 double
-GeglQtViewOptions::translationX()
+NodeViewOptions::translationX()
 {
     return priv->translationX;
 }
 
 void
-GeglQtViewOptions::setTranslationY(double newTranslationY)
+NodeViewOptions::setTranslationY(double newTranslationY)
 {
     if (priv->translationY == newTranslationY) {
         return;
@@ -114,13 +116,13 @@ GeglQtViewOptions::setTranslationY(double newTranslationY)
 }
 
 double
-GeglQtViewOptions::translationY()
+NodeViewOptions::translationY()
 {
     return priv->translationY;
 }
 
 QTransform
-GeglQtViewOptions::transformation()
+NodeViewOptions::transformation()
 {
     QTransform transform;
     transform.translate(translationX(), translationY());
@@ -130,7 +132,7 @@ GeglQtViewOptions::transformation()
 
 
 void
-GeglQtViewOptions::setAutoCenterPolicy(AutoCenter newAutoCenter)
+NodeViewOptions::setAutoCenterPolicy(AutoCenter newAutoCenter)
 {
     if (priv->autoCenter == newAutoCenter) {
         return;
@@ -140,7 +142,7 @@ GeglQtViewOptions::setAutoCenterPolicy(AutoCenter newAutoCenter)
 }
 
 void
-GeglQtViewOptions::setAutoScalePolicy(AutoScale newAutoScale)
+NodeViewOptions::setAutoScalePolicy(AutoScale newAutoScale)
 {
     if (priv->autoScale == newAutoScale) {
         return;
@@ -149,14 +151,14 @@ GeglQtViewOptions::setAutoScalePolicy(AutoScale newAutoScale)
     Q_EMIT autoScalePolicyChanged();
 }
 
-GeglQtViewOptions::AutoCenter
-GeglQtViewOptions::autoCenterPolicy()
+NodeViewOptions::AutoCenter
+NodeViewOptions::autoCenterPolicy()
 {
     return priv->autoCenter;
 }
 
-GeglQtViewOptions::AutoScale
-GeglQtViewOptions::autoScalePolicy()
+NodeViewOptions::AutoScale
+NodeViewOptions::autoScalePolicy()
 {
     return priv->autoScale;
 }
diff --git a/gegl-qt/geglqtviewoptions.h b/gegl-qt/geglqtviewoptions.h
index 465c4aa..8e7db23 100644
--- a/gegl-qt/geglqtviewoptions.h
+++ b/gegl-qt/geglqtviewoptions.h
@@ -23,12 +23,15 @@
 
 class GeglQtViewOptionsPrivate;
 
-class GeglQtViewOptions : public QObject
+namespace GeglQt
+{
+
+class NodeViewOptions : public QObject
 {
     Q_OBJECT
 
 public:
-    explicit GeglQtViewOptions(QObject *parent = 0);
+    explicit NodeViewOptions(QObject *parent = 0);
 
 public:
     enum AutoCenter {
@@ -67,9 +70,9 @@ public:
     Q_PROPERTY(double translationY
                READ translationY WRITE setTranslationY NOTIFY translationChanged)
 
-    Q_PROPERTY(GeglQtViewOptions::AutoCenter autoCenterPolicy
+    Q_PROPERTY(AutoCenter autoCenterPolicy
                READ autoCenterPolicy WRITE setAutoCenterPolicy NOTIFY autoCenterPolicyChanged)
-    Q_PROPERTY(GeglQtViewOptions::AutoScale autoScalePolicy
+    Q_PROPERTY(AutoScale autoScalePolicy
                READ autoScalePolicy WRITE setAutoScalePolicy NOTIFY autoScalePolicyChanged)
 
 Q_SIGNALS:
@@ -81,11 +84,13 @@ Q_SIGNALS:
     void autoScalePolicyChanged();
 
 private:
-    Q_DISABLE_COPY(GeglQtViewOptions)
+    Q_DISABLE_COPY(NodeViewOptions)
     GeglQtViewOptionsPrivate *priv;
 };
 
-Q_DECLARE_METATYPE(GeglQtViewOptions::AutoCenter)
-Q_DECLARE_METATYPE(GeglQtViewOptions::AutoScale)
+}
+
+Q_DECLARE_METATYPE(GeglQt::NodeViewOptions::AutoCenter)
+Q_DECLARE_METATYPE(GeglQt::NodeViewOptions::AutoScale)
 
 #endif // GEGLVIEWOPTIONS_H
diff --git a/operations/geglqtdisplay.cpp b/operations/geglqtdisplay.cpp
index cbe9c01..b28184f 100644
--- a/operations/geglqtdisplay.cpp
+++ b/operations/geglqtdisplay.cpp
@@ -31,6 +31,8 @@ gegl_chant_string  (window_title, "Window Title", "", "Title to give window.")
 #include <QtGui>
 #include <gegl-qt.h>
 
+using namespace GeglQt;
+
 typedef struct
 {
   GeglQtView *viewWidget;
@@ -49,7 +51,7 @@ init_priv (GeglOperation *operation)
       o->chant_data = (void*) priv;
 
       priv->viewWidget = new GeglQtView();
-      priv->viewWidget->options()->setAutoScalePolicy(GeglQtViewOptions::AutoScaleViewport);
+      priv->viewWidget->options()->setAutoScalePolicy(NodeViewOptions::AutoScaleViewport);
       priv->viewWidget->show();
     }
   return (Priv*)(o->chant_data);
diff --git a/tests/test-view-internal/test-view-internal.cpp b/tests/test-view-internal/test-view-internal.cpp
index b7c3b27..c68742e 100644
--- a/tests/test-view-internal/test-view-internal.cpp
+++ b/tests/test-view-internal/test-view-internal.cpp
@@ -4,6 +4,8 @@
 
 #include <QtTest>
 
+using namespace GeglQt;
+
 /* Tests GeglQtViewImplementation, not the widgets
  * themselves. */
 TestViewInternal::TestViewInternal(QObject *parent) :



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