diff options
author | Tim Moore <timoore@redhat.com> | 2009-04-20 08:13:38 +0200 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-04-20 08:13:38 +0200 |
commit | a6e65750e80380d42ea238f3c688c3499de16d74 (patch) | |
tree | f5ef0b9df733e04d405b969d2fc6290d5ddce773 /grapher/CairoWidget.hxx | |
parent | 2d45e339f3287cf0b4805ea91b3aa9f17b6d4752 (diff) | |
download | systemtap-steved-a6e65750e80380d42ea238f3c688c3499de16d74.tar.gz systemtap-steved-a6e65750e80380d42ea238f3c688c3499de16d74.tar.xz systemtap-steved-a6e65750e80380d42ea238f3c688c3499de16d74.zip |
Move grapher to subdirectory
Diffstat (limited to 'grapher/CairoWidget.hxx')
-rw-r--r-- | grapher/CairoWidget.hxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/grapher/CairoWidget.hxx b/grapher/CairoWidget.hxx new file mode 100644 index 00000000..077a4c7a --- /dev/null +++ b/grapher/CairoWidget.hxx @@ -0,0 +1,42 @@ +#ifndef SYSTEMTAP_CAIROWIDGET_H +#define SYSTEMTAP_CAIROWIDGET_H 1 + +#include <cairomm/context.h> +namespace systemtap +{ + class CairoWidget + { + public: + CairoWidget(bool visible = false) + : _visible(visible), _size(50.0), _radius(5) + {} + bool isVisible() const { return _visible; } + void setVisible(bool visible) { _visible = visible; } + void getOrigin(double &x, double &y) const + { + x = _x0; + y = _y0; + } + void setOrigin(double x, double y) + { + _x0 = x; + _y0 = y; + } + virtual void draw(Cairo::RefPtr<Cairo::Context> cr) = 0; + virtual bool containsPoint(double x, double y) { return false; } + protected: + bool _visible; + double _x0; + double _y0; + double _size; + double _radius; + }; + + class CairoPlayButton : public CairoWidget + { + public: + virtual void draw(Cairo::RefPtr<Cairo::Context> cr); + virtual bool containsPoint(double x, double y); + }; +} +#endif |