diff options
author | Dave Brolley <brolley@redhat.com> | 2009-09-17 20:36:24 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-09-17 20:36:24 -0400 |
commit | 762684a57fa5420cc122b475f592545e8eeb29cd (patch) | |
tree | c1b55657f1aff31e7298d76852bbe8522a84db13 /grapher | |
parent | 8afee8bbf045e858dae186d40653293c99dbbcdd (diff) | |
parent | 6bde4f381475cea055352d8ad5f60bb2f24de21d (diff) | |
download | systemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.tar.gz systemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.tar.xz systemtap-steved-762684a57fa5420cc122b475f592545e8eeb29cd.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'grapher')
-rw-r--r-- | grapher/Graph.cxx | 6 | ||||
-rw-r--r-- | grapher/Graph.hxx | 2 | ||||
-rw-r--r-- | grapher/GraphWidget.cxx | 4 | ||||
-rw-r--r-- | grapher/StapParser.cxx | 4 | ||||
-rw-r--r-- | grapher/grapher.cxx | 7 |
5 files changed, 15 insertions, 8 deletions
diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index ec5e4035..e1ea01f6 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -9,11 +9,13 @@ namespace systemtap using namespace std; using namespace std::tr1; - Graph::Graph() - : _lineWidth(2), _autoScaling(true), _autoScrolling(true), + Graph::Graph(double x, double y) + : _graphX(0), _graphY(0), + _lineWidth(2), _autoScaling(true), _autoScrolling(true), _zoomFactor(1.0), _playButton(new CairoPlayButton), _left(0.0), _right(1.0), _top(5.0), _bottom(0.0) { + setOrigin(x, y); } diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index 1cc1892d..aad63767 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -12,7 +12,7 @@ namespace systemtap { public: friend class GraphWidget; - Graph(); + Graph(double x = 0.0, double y = 0.0); virtual void draw(Cairo::RefPtr<Cairo::Context> cr); virtual bool containsPoint(double x, double y); double getLineWidth() { return _lineWidth; } diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx index 4a1e0918..53c7645d 100644 --- a/grapher/GraphWidget.cxx +++ b/grapher/GraphWidget.cxx @@ -70,8 +70,10 @@ namespace systemtap cr->paint(); for (GraphList::iterator g = _graphs.begin(); g != _graphs.end(); ++g) { + double x, y; + (*g)->getOrigin(x, y); cr->save(); - cr->translate((*g)->_graphX, (*g)->_graphY); + cr->translate(x, y); (*g)->draw(cr); cr->restore(); } diff --git a/grapher/StapParser.cxx b/grapher/StapParser.cxx index d70c75b6..47dfbe30 100644 --- a/grapher/StapParser.cxx +++ b/grapher/StapParser.cxx @@ -58,7 +58,7 @@ vector<string> commaSplit(const string& inStr, size_t pos = 0) { size_t found; if ((found = src.find(tag)) != string::npos) - result = src.substr(strlen(tag)); + result = src.substr(found + strlen(tag)); return found; } @@ -152,7 +152,7 @@ vector<string> commaSplit(const string& inStr, size_t pos = 0) shared_ptr<GraphDataBase> gdata = itr->second; string decl; // Hack: scan from the beginning of dataString again - if (findTaggedValue(dataString, "%Title", decl) + if (findTaggedValue(dataString, "%Title:", decl) != string::npos) { gdata->title = decl; diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx index a0d35017..95ac232d 100644 --- a/grapher/grapher.cxx +++ b/grapher/grapher.cxx @@ -13,6 +13,7 @@ #include <gtkmm/stock.h> #include <gtkmm/main.h> #include <gtkmm/window.h> +#include <gtkmm/scrolledwindow.h> #include <unistd.h> #include <poll.h> #include <signal.h> @@ -27,6 +28,7 @@ public: GrapherWindow(); virtual ~GrapherWindow() {} Gtk::VBox m_Box; + Gtk::ScrolledWindow scrolled; GraphWidget w; protected: virtual void on_menu_file_quit(); @@ -70,10 +72,11 @@ GrapherWindow::GrapherWindow() std::cerr << "building menus failed: " << ex.what(); } Gtk::Widget* pMenubar = m_refUIManager->get_widget("/MenuBar"); + scrolled.add(w); if(pMenubar) m_Box.pack_start(*pMenubar, Gtk::PACK_SHRINK); - m_Box.pack_start(w, Gtk::PACK_EXPAND_WIDGET); - w.show(); + m_Box.pack_start(scrolled, Gtk::PACK_EXPAND_WIDGET); + scrolled.show(); show_all_children(); |