diff options
author | Dave Brolley <brolley@redhat.com> | 2009-12-02 16:41:11 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-12-02 16:41:11 -0500 |
commit | 6bb613f9be856632dec47cab4b27a7fe92c2fe64 (patch) | |
tree | 76e778645ea20df5fd89981994ee249fc760d4f5 /grapher/GraphStyle.hxx | |
parent | 5d4ea4cc1d1f7531fb0ff4d0498957e0333a61eb (diff) | |
parent | 4a0ae64c47b159d4dd0ea471f1f8044503843a7f (diff) | |
download | systemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.tar.gz systemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.tar.xz systemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'grapher/GraphStyle.hxx')
-rw-r--r-- | grapher/GraphStyle.hxx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/grapher/GraphStyle.hxx b/grapher/GraphStyle.hxx new file mode 100644 index 00000000..9625f451 --- /dev/null +++ b/grapher/GraphStyle.hxx @@ -0,0 +1,54 @@ +#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; + virtual ssize_t dataIndexAtPoint(double x, double y, + std::tr1::shared_ptr<GraphDataBase> + graphData, + std::tr1::shared_ptr<Graph> graph) + { + return -1; + } + }; + + class GraphStyleBar : public GraphStyle + { + public: + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + + static GraphStyleBar instance; + ssize_t dataIndexAtPoint(double x, double y, + std::tr1::shared_ptr<GraphDataBase> graphData, + std::tr1::shared_ptr<Graph> graph); + }; + + class GraphStyleDot : public GraphStyle + { + public: + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + static GraphStyleDot instance; + }; + + class GraphStyleEvent : public GraphStyle + { + public: + void draw(std::tr1::shared_ptr<GraphDataBase> graphData, + Graph* graph, Cairo::RefPtr<Cairo::Context> cr); + static GraphStyleEvent instance; + }; +} +#endif |