summaryrefslogtreecommitdiffstats
path: root/grapher/GraphStyle.hxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-01 19:05:09 +0100
committerTim Moore <timoore@redhat.com>2009-12-02 19:39:37 +0100
commit6197b0dc80c4f87000d26213293fe2cb72fbe081 (patch)
tree23e7b4716f9d618e0891d67cee127c614177b370 /grapher/GraphStyle.hxx
parent06e217d9990635be43a59233d75c504385d1e243 (diff)
downloadsystemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.tar.gz
systemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.tar.xz
systemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.zip
Refactor drawing of different styles of graph into classes
* grapher/GraphStyle.cxx: New file * grapher/GraphStyle.hxx: New file * grapher/Graph(draw): Move much drawing code to GraphStyle::draw
Diffstat (limited to 'grapher/GraphStyle.hxx')
-rw-r--r--grapher/GraphStyle.hxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/grapher/GraphStyle.hxx b/grapher/GraphStyle.hxx
new file mode 100644
index 00000000..4a0cd955
--- /dev/null
+++ b/grapher/GraphStyle.hxx
@@ -0,0 +1,43 @@
+#ifndef SYSTEMTAP_GRAPHSTYLE_HXX
+#define SYSTEMTAP_GRAPHSTYLE_HXX 1
+#include <tr1/memory>
+
+#include <cairomm/context.h>
+
+namespace systemtap
+{
+ class GraphDataBase;
+ class Graph;
+
+ class GraphStyle
+ {
+ public:
+ virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
+ Graph* graph, Cairo::RefPtr<Cairo::Context> cr) = 0;
+ };
+
+ class GraphStyleBar : public GraphStyle
+ {
+ public:
+ virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
+ Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
+ static GraphStyleBar instance;
+ };
+
+ class GraphStyleDot : public GraphStyle
+ {
+ public:
+ virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
+ Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
+ static GraphStyleDot instance;
+ };
+
+ class GraphStyleEvent : public GraphStyle
+ {
+ public:
+ virtual void draw(std::tr1::shared_ptr<GraphDataBase> graphData,
+ Graph* graph, Cairo::RefPtr<Cairo::Context> cr);
+ static GraphStyleEvent instance;
+ };
+}
+#endif