Mapstorage does not need to know NoteBookTab furthermore.
1.1 --- a/mapstorage.cc Wed Feb 28 18:20:28 2007 +0000
1.2 +++ b/mapstorage.cc Thu Mar 01 08:07:39 2007 +0000
1.3 @@ -21,8 +21,6 @@
1.4 #include <gtkmm.h>
1.5
1.6 #include <mapstorage.h>
1.7 -#include <graph_displayer_canvas.h> //kivenni
1.8 -#include <nbtab.h> //kivenni
1.9 #include <gui_writer.h>
1.10 #include <gui_reader.h>
1.11 #include <lemon/graph_to_eps.h>
1.12 @@ -31,7 +29,7 @@
1.13 const double a_d=0.05;
1.14 const double p_d=40000;
1.15
1.16 -MapStorage::MapStorage(NoteBookTab& tab) : mytab(tab), modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d), background_set(false)
1.17 +MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d), background_set(false)
1.18 {
1.19 nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
1.20 coords.setXMap(*nodemap_storage["coordinates_x"]);
1.21 @@ -570,7 +568,7 @@
1.22 background_file_name = file_name;
1.23 background_set = true;
1.24 }
1.25 - mytab.gd_canvas->setBackground();
1.26 + signal_background.emit();
1.27 }
1.28
1.29 const std::string& MapStorage::getBackgroundFilename()
2.1 --- a/mapstorage.h Wed Feb 28 18:20:28 2007 +0000
2.2 +++ b/mapstorage.h Thu Mar 01 08:07:39 2007 +0000
2.3 @@ -23,8 +23,6 @@
2.4 #include <xymap.h>
2.5 #include <libgnomecanvasmm.h>
2.6
2.7 -class NoteBookTab;
2.8 -
2.9 ///class MapStorage handles NodeMaps and EdgeMaps.
2.10
2.11 ///Class MapStorage is responsible for storing
2.12 @@ -42,7 +40,6 @@
2.13 std::string background_file_name;
2.14 bool background_set;
2.15 double background_scaling;
2.16 - NoteBookTab& mytab;
2.17 public:
2.18 void setBackground(const std::string& file_name);
2.19 const std::string& getBackgroundFilename();
2.20 @@ -115,6 +112,9 @@
2.21 /// Signal emitted, when entry in \ref DesignWin should be changed.
2.22 sigc::signal<void, double, double, int> signal_design_win;
2.23
2.24 + ///Signal emitted when background should be set by \ref NoteBookTab
2.25 + sigc::signal<void> signal_background;
2.26 +
2.27 ///Iteration number during graph design
2.28 int iterations;
2.29
2.30 @@ -129,7 +129,7 @@
2.31
2.32 ///Its all activity is initializing default values
2.33 ///for different visualization attributes.
2.34 - MapStorage(NoteBookTab& tab);
2.35 + MapStorage();
2.36
2.37 ///Destructor of MapStorage
2.38
2.39 @@ -184,6 +184,10 @@
2.40 ///returns \ref signal_design_win to be able to connect functions to it
2.41 sigc::signal<void, double, double, int> signal_design_win_ch(){return signal_design_win;};
2.42
2.43 + ///returns \ref signal_background to be able to connect functions to it
2.44 + sigc::signal<void> signal_background_ch(){return signal_background;};
2.45 +
2.46 +
2.47 ///Adds given map to storage.
2.48
2.49 ///A name and the map itself has to be provided.
3.1 --- a/nbtab.cc Wed Feb 28 18:20:28 2007 +0000
3.2 +++ b/nbtab.cc Thu Mar 01 08:07:39 2007 +0000
3.3 @@ -27,7 +27,7 @@
3.4
3.5 NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false)
3.6 {
3.7 - mapstorage=new MapStorage(*this);
3.8 + mapstorage=new MapStorage();
3.9
3.10 Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow);
3.11 gd_canvas=new GraphDisplayerCanvas(*this);
3.12 @@ -38,6 +38,7 @@
3.13 mapstorage->signal_prop_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::propertyChange));
3.14 mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap));
3.15 mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap));
3.16 + mapstorage->signal_background_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::setBackground));
3.17 show_all_children();
3.18 show();
3.19 }