summaryrefslogtreecommitdiffstats
path: root/grapher/Graph.hxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-07-27 12:46:30 +0200
committerTim Moore <timoore@redhat.com>2009-07-28 11:21:15 +0200
commit364ad890e341bb60ae169af69933a382d4bf9f81 (patch)
tree4b2fb5eb5644bdebc38b935077fa96ace8d831c5 /grapher/Graph.hxx
parenta030ced8c0b8109ba7b23bbbc65deddf88154a2f (diff)
downloadsystemtap-steved-364ad890e341bb60ae169af69933a382d4bf9f81.tar.gz
systemtap-steved-364ad890e341bb60ae169af69933a382d4bf9f81.tar.xz
systemtap-steved-364ad890e341bb60ae169af69933a382d4bf9f81.zip
Support for presenting multiple graphs
* grapher/Graph.hxx: New file; class for single graph display. * grapher/Graph.cxx: New file. * grapher/GraphData.hxx: Associate title and axis labels with graph data and not a graph display. * grapher/GraphWidget.hxx: Move graph-related members to Graph class. * grapher/GraphWidget.cxx (getExtents, setExtents): Move to Graph class (on_expose_event): Move graph rendering to Graph. (on_button_press_event): Delegate to Graph. (on_motion_notify_event, on_scroll_event): Modify "active" graph. * grapher/StapParser.cxx (findTaggedValue): New parsing helper function. (io_callback): Support new syntax where properties are attached to graph data and not the entire graph. * grapher/grapher.cxx (GrapherWindow): Don't set graph values. * grapher/Makefile.am: Add Graph.cxx. * testsuite/systemtap.examples/general/grapher.stp: New property syntax.
Diffstat (limited to 'grapher/Graph.hxx')
-rw-r--r--grapher/Graph.hxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx
new file mode 100644
index 00000000..1cc1892d
--- /dev/null
+++ b/grapher/Graph.hxx
@@ -0,0 +1,48 @@
+#ifndef SYSTEMTAP_GRAPH_HXX
+#define SYSTEMTAP_GRAPH_HXX 1
+
+#include <cairomm/context.h>
+
+#include "GraphData.hxx"
+#include "CairoWidget.hxx"
+
+namespace systemtap
+{
+ class Graph : public CairoWidget
+ {
+ public:
+ friend class GraphWidget;
+ Graph();
+ virtual void draw(Cairo::RefPtr<Cairo::Context> cr);
+ virtual bool containsPoint(double x, double y);
+ double getLineWidth() { return _lineWidth; }
+ void setLineWidth(double lineWidth) { _lineWidth = lineWidth; }
+ bool getAutoScaling() const { return _autoScaling; }
+ void setAutoScaling(bool val) { _autoScaling = val; }
+ void addGraphData(std::tr1::shared_ptr<GraphDataBase> data);
+ void getExtents(double& left, double& right, double& top, double& bottom)
+ const;
+ void setExtents(double left, double right, double top, double bottom);
+ // extents of the whole graph area
+ double _width;
+ double _height;
+ // Position, extents of the graph
+ double _graphX;
+ double _graphY;
+ double _graphWidth;
+ double _graphHeight;
+ double _lineWidth;
+ bool _autoScaling;
+ bool _autoScrolling;
+ double _zoomFactor;
+ std::tr1::shared_ptr<CairoPlayButton> _playButton;
+ protected:
+ typedef std::vector<std::tr1::shared_ptr<GraphDataBase> > DatasetList;
+ DatasetList _datasets;
+ double _left;
+ double _right;
+ double _top;
+ double _bottom;
+ };
+}
+#endif