diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-01 19:05:09 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-02 19:39:37 +0100 |
commit | 6197b0dc80c4f87000d26213293fe2cb72fbe081 (patch) | |
tree | 23e7b4716f9d618e0891d67cee127c614177b370 /grapher/GraphStyle.hxx | |
parent | 06e217d9990635be43a59233d75c504385d1e243 (diff) | |
download | systemtap-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.hxx | 43 |
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 |