summaryrefslogtreecommitdiffstats
path: root/grapher/CairoWidget.hxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-05-21 16:57:04 -0500
committerDavid Smith <dsmith@redhat.com>2009-05-21 16:57:04 -0500
commitc8e9eb18d8d13d099a4a177fe53de507c1d9ce8b (patch)
treeab2388afb795ed1a7ead2fbbf8b9d1b368a8231f /grapher/CairoWidget.hxx
parentdd9a3bcbef65bde65491d959e9458bc641924811 (diff)
parent3863e7999255deeaa7f8f4bba7df893773812537 (diff)
downloadsystemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.tar.gz
systemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.tar.xz
systemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.zip
Merge commit 'origin/master' into pr7043
Conflicts: runtime/print.c runtime/transport/transport.c runtime/transport/transport_msgs.h
Diffstat (limited to 'grapher/CairoWidget.hxx')
-rw-r--r--grapher/CairoWidget.hxx42
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