diff options
author | David Smith <dsmith@redhat.com> | 2009-04-20 13:55:45 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-04-20 13:55:45 -0500 |
commit | d1b6c2866b35575219fb36fa2307c9f87e876750 (patch) | |
tree | 4cc6d22bb879f302259074da840c279ee0b3c185 /grapher/CairoWidget.hxx | |
parent | cfee927fb9fc96fa06c55219abce6349a15d47e6 (diff) | |
parent | 555b11c26094bafa5e450d8ad70b72a8fcbea10f (diff) | |
download | systemtap-steved-d1b6c2866b35575219fb36fa2307c9f87e876750.tar.gz systemtap-steved-d1b6c2866b35575219fb36fa2307c9f87e876750.tar.xz systemtap-steved-d1b6c2866b35575219fb36fa2307c9f87e876750.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
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 |