[kgraphviewer-devel] [kgraphviewer/libkgraphviz] src/kgraphviz: Minor: Cleanup header interfaces

Kevin Funk krf at electrostorm.net
Thu Feb 10 18:22:31 CET 2011


Git commit 91833f36c6146437ecfe1bfad5a0f0eb1a7afef1 by Kevin Funk.
Committed on 09/02/2011 at 16:42.
Pushed by kfunk into branch 'libkgraphviz'.

Minor: Cleanup header interfaces

M  +0    -8    src/kgraphviz/canvasedge.h     
M  +6    -11   src/kgraphviz/canvaselement.h     
M  +2    -35   src/kgraphviz/canvasnode.h     
M  +5    -5    src/kgraphviz/canvassubgraph.cpp     
M  +2    -9    src/kgraphviz/canvassubgraph.h     
M  +0    -4    src/kgraphviz/dotgraph.h     
M  +14   -4    src/kgraphviz/dotgraphview.h     
M  +1    -10   src/kgraphviz/graphedge.h     
M  +0    -6    src/kgraphviz/graphsubgraph.h     

http://commits.kde.org/kgraphviewer/91833f36c6146437ecfe1bfad5a0f0eb1a7afef1

diff --git a/src/kgraphviz/canvasedge.h b/src/kgraphviz/canvasedge.h
index 0bab360..bc6b3ea 100644
--- a/src/kgraphviz/canvasedge.h
+++ b/src/kgraphviz/canvasedge.h
@@ -24,14 +24,6 @@
    License as published by the Free Software Foundation, version 2.
 */
 
-/*
- * Canvas Items:
- * - CanvasNode       (Rectangular Area)
- * - CanvasEdge       (Spline curve)
- * - CanvasEdgeLabel  (Label for edges)
- * - CanvasEdgeArrow  (Arrows at the end of the edge spline)
- */
-
 #ifndef CANVAS_EDGE_H
 #define CANVAS_EDGE_H
 
diff --git a/src/kgraphviz/canvaselement.h b/src/kgraphviz/canvaselement.h
index a781efa..44d27b3 100644
--- a/src/kgraphviz/canvaselement.h
+++ b/src/kgraphviz/canvaselement.h
@@ -16,10 +16,6 @@
    02110-1301, USA
 */
 
-/*
- * Canvas Subgraph (subgraph node view)
- */
-
 #ifndef CANVAS_ELEMENT_H
 #define CANVAS_ELEMENT_H
 
@@ -43,24 +39,21 @@ public:
       GraphElement* s,
       QGraphicsScene* c,
       QGraphicsItem* parent = 0);
-      
+
   virtual ~CanvasElement();
-  
+
   GraphElement* element() const;
 
   virtual void paint(QPainter* p, const QStyleOptionGraphicsItem *option,
         QWidget *widget = 0 );
 
-  virtual QRectF boundingRect () const;
-  
+  virtual QRectF boundingRect() const;
+
   void initialize(qreal scaleX, qreal scaleY,
                   qreal marginX, qreal marginY,
                   qreal gh,
                   qreal wdhcf, qreal hdvcf);
 
-  qreal gh() const;
-  void setGh(qreal gh);
-
   virtual void modelChanged();
 
 protected:
@@ -71,6 +64,8 @@ protected:
   virtual void computeBoundingRect();
   void setBoundingRect(const QRectF& rect);
 
+  qreal gh() const;
+  void setGh(qreal gh);
   QFont font() const;
   void setFont(const QFont& font);
   qreal scaleX() const;
diff --git a/src/kgraphviz/canvasnode.h b/src/kgraphviz/canvasnode.h
index 4a9bf39..734a4d7 100644
--- a/src/kgraphviz/canvasnode.h
+++ b/src/kgraphviz/canvasnode.h
@@ -24,10 +24,6 @@
    License as published by the Free Software Foundation, version 2.
 */
 
-/*
- * Canvas Node (graph node view)
- */
-
 #ifndef CANVAS_NODE_H
 #define CANVAS_NODE_H
 
@@ -35,7 +31,7 @@
 
 namespace KGraphViz
 {
-  
+
 class GraphNode;
 
 class CanvasNode : public CanvasElement
@@ -45,39 +41,10 @@ public:
             GraphNode* s,
             QGraphicsScene* c,
             QGraphicsItem* parent = 0);
-  
+
   virtual ~CanvasNode();
-  
 };
 
-// class CanvasHtmlNode: public KHTMLPart, public CanvasNode
-// {
-//   Q_OBJECT
-// public:
-//   CanvasHtmlNode(
-//                      DotGraphView* v, 
-//                      GraphNode* n,
-//                      const DotRenderOp& dro,
-//                      const DotRenderOpVec& dros,
-//                      QGraphicsScene* c,
-//                      double scaleX, double scaleY, int xMargin, int yMargin, int gh,
-//                      int wdhcf, int hdvcf);
-//   virtual ~CanvasHtmlNode();
-//   
-//   QRect rect() {return view()->contentsRect();}
-//   
-// protected:
-// //   virtual void paint(QPainter&);
-// 
-// public slots:
-//   void move(int x, int y);
-//   void zoomed(double factor);
-// 
-// private:
-//   double m_zoomFactor;
-//   int m_xMovedTo, m_yMovedTo;
-// };
-
 }
 
 #endif
diff --git a/src/kgraphviz/canvassubgraph.cpp b/src/kgraphviz/canvassubgraph.cpp
index acc7831..1fdd3b2 100644
--- a/src/kgraphviz/canvassubgraph.cpp
+++ b/src/kgraphviz/canvassubgraph.cpp
@@ -16,15 +16,12 @@
    02110-1301, USA
 */
 
-
 #include "canvassubgraph.h"
 
 #include "graphsubgraph.h"
 
-namespace KGraphViz
-{
-  
-  
+using namespace KGraphViz;
+
 CanvasSubgraph::CanvasSubgraph(
                               DotGraphView* v,
                               GraphSubgraph* gsubgraph,
@@ -35,4 +32,7 @@ CanvasSubgraph::CanvasSubgraph(
 {
 }
 
+CanvasSubgraph::~CanvasSubgraph()
+{
+
 }
diff --git a/src/kgraphviz/canvassubgraph.h b/src/kgraphviz/canvassubgraph.h
index 6bc93ea..5c81f64 100644
--- a/src/kgraphviz/canvassubgraph.h
+++ b/src/kgraphviz/canvassubgraph.h
@@ -16,22 +16,15 @@
    02110-1301, USA
 */
 
-/*
- * Canvas Subgraph (subgraph node view)
- */
-
 #ifndef CANVAS_SUBGRAPH_H
 #define CANVAS_SUBGRAPH_H
 
 #include "canvaselement.h"
 
-class QGraphicsScene;
-
 namespace KGraphViz
 {
-  
+
 class GraphSubgraph;
-class DotGraphView;
 
 class CanvasSubgraph: public CanvasElement
 {
@@ -41,7 +34,7 @@ public:
       GraphSubgraph* s,
       QGraphicsScene* c,
       QGraphicsItem* parent = 0);
-  virtual ~CanvasSubgraph() {}
+  virtual ~CanvasSubgraph();
 };
 
 }
diff --git a/src/kgraphviz/dotgraph.h b/src/kgraphviz/dotgraph.h
index efe8728..829dacf 100644
--- a/src/kgraphviz/dotgraph.h
+++ b/src/kgraphviz/dotgraph.h
@@ -16,10 +16,6 @@
    02110-1301, USA
 */
 
-/*
- * GraphViz dot Graph model
- */
-
 #ifndef DOT_GRAPH_H
 #define DOT_GRAPH_H
 
diff --git a/src/kgraphviz/dotgraphview.h b/src/kgraphviz/dotgraphview.h
index 3eced9f..edf1541 100644
--- a/src/kgraphviz/dotgraphview.h
+++ b/src/kgraphviz/dotgraphview.h
@@ -112,25 +112,30 @@ public:
   bool highlighting() const;
   void setHighlighting(bool highlightingValue);
 
-  // public so that the panner view can bubble through
+  /// public so that the panner view can bubble through
   void contextMenuEvent(QContextMenuEvent*);
 
   void setBackgroundColor(const QColor& color);
-  
+
 public Q_SLOTS:
   void zoomIn();
   void zoomOut();  
   void zoomRectMovedTo(QPointF newZoomPos);
   void zoomRectMoveFinished();
+
+  void initEmpty();
   bool reload();
   bool displayGraph();
+
   void dirty(const QString& dotFileName);
   void pageSetup();
-  void initEmpty();
+
   void print();
   void printPreview();
+
   void setPannerPosition(DotGraphView::PannerPosition pos);
   void setPannerEnabled(bool enabled);
+
   void slotExportImage();
   void slotSelectLayoutAlgo(const QString& text);
   void slotLayoutSpecify();
@@ -152,21 +157,25 @@ public Q_SLOTS:
 protected:
   void scrollContentsBy(int dx, int dy);
   void resizeEvent(QResizeEvent*);
+
   void mousePressEvent(QMouseEvent*);
   void mouseMoveEvent(QMouseEvent*);
   void mouseReleaseEvent(QMouseEvent*);
   void mouseDoubleClickEvent(QMouseEvent*);
+
   void keyPressEvent(QKeyEvent*);
   void keyReleaseEvent(QKeyEvent*);
+
   void focusInEvent(QFocusEvent*);
   void focusOutEvent(QFocusEvent*);
+
   void wheelEvent(QWheelEvent* e);
   
   void timerEvent ( QTimerEvent * event );
   void leaveEvent ( QEvent * event );
   void enterEvent ( QEvent * event );
 
-  DotGraphViewPrivate * const d_ptr;
+  DotGraphViewPrivate* const d_ptr;
 
 Q_SIGNALS:
   void zoomed(double factor);
@@ -188,6 +197,7 @@ Q_SIGNALS:
       const QString&, const QString&,
       const QMap<QString, QString>&);
   void contextMenuEvent(const QString&, const QPoint&);
+
   void hoverEnter(const QString&);
   void hoverLeave(const QString&);
 
diff --git a/src/kgraphviz/graphedge.h b/src/kgraphviz/graphedge.h
index 9310c35..0fd9044 100644
--- a/src/kgraphviz/graphedge.h
+++ b/src/kgraphviz/graphedge.h
@@ -50,19 +50,10 @@ public:
 
   GraphNode* fromNode() const;
   void setFromNode(GraphNode* node);
-  
+
   GraphNode* toNode() const;
   void setToNode(GraphNode* node);
 
-//   inline const QVector< QPair< float, float > >& edgePoints() const {return m_edgePoints;}
-//   inline QVector< QPair< float, float > >& edgePoints() {return m_edgePoints;}
-//   inline void edgePoints(const QVector< QPair< float, float > >& ep) {m_edgePoints = ep;}
-  
-/*  inline void labelX(float x) {m_labelX = x;}
-  inline void labelY(float y) {m_labelY = y;}
-  inline float labelX() const {return m_labelX;}
-  inline float labelY() const {return m_labelY;}*/
-
   QList<DotRenderOp>& arrowheads();
   const QList<DotRenderOp>& arrowheads() const;
 
diff --git a/src/kgraphviz/graphsubgraph.h b/src/kgraphviz/graphsubgraph.h
index f24da2d..a25bd07 100644
--- a/src/kgraphviz/graphsubgraph.h
+++ b/src/kgraphviz/graphsubgraph.h
@@ -16,10 +16,6 @@
    02110-1301, USA
 */
 
-/*
- * Subgraph model
- */
-
 #ifndef GRAPH_SUBGRAPH_H
 #define GRAPH_SUBGRAPH_H
 
@@ -66,7 +62,6 @@ public:
   /// @return the node found or 0 if there is no such node
   GraphElement* elementNamed(const QString& id) const;
 
-
   /// Recursively walk through this subgraph and its subsubgraphs to make
   /// the given element selected or not depending on the selectValue parameter
   /// and unselect other elements depending on the  unselect others parameter
@@ -84,7 +79,6 @@ private:
 };
 
 KGRAPHVIZ_EXPORT QTextStream& operator<<(QTextStream& stream, const GraphSubgraph& s);
-
 }
 
 #endif


More information about the kgraphviewer-devel mailing list