Index: Makefile.am
===================================================================
--- Makefile.am	(revision 53)
+++ Makefile.am	(revision 60)
@@ -1,8 +1,4 @@
 AM_CPPFLAGS = -I$(top_srcdir)
 LDADD = $(top_builddir)/lemon/libemon.la
-
-
-noinst_DATA = guipixbufs.h
-CLEANFILES = $(noinst_DATA)
 
 bin_PROGRAMS = gd
@@ -31,22 +27,14 @@
 gd_CXXFLAGS = $(GTK_CFLAGS)
 gd_LDFLAGS = $(GTK_LIBS)
+gd_CPPFLAGS = -DDATADIR=\"$(datadir)\"
 
-IMAGES = addlink.png addnode.png delete.png \
-	editlink.png editnode.png move.png newmap.png
+pixmapdir = $(datadir)/pixmaps/gd
 
-VARIABLES = \
-	gui_icons_addlink $(srcdir)/addlink.png \
-	gui_icons_addnode $(srcdir)/addnode.png \
-	gui_icons_delete $(srcdir)/delete.png \
-	gui_icons_editlink $(srcdir)/editlink.png \
-	gui_icons_editnode $(srcdir)/editnode.png \
-	gui_icons_move $(srcdir)/move.png \
-	gui_icons_newmap $(srcdir)/newmap.png
-
-
-guipixbufs.h: $(IMAGES)
-	gdk-pixbuf-csource \
-	--raw --build-list $(VARIABLES) > guipixbufs.h ||  \
-	( rm -f guipixbufs.h && false )
-
-EXTRA_DIST = $(IMAGES) guipixbufs.h
+pixmap_DATA =
+	addlink.png \
+	addnode.png \
+	delete.png \
+	editlink.png \
+	editnode.png \
+	move.png \
+	newmap.png
Index: main_win.cc
===================================================================
--- main_win.cc	(revision 57)
+++ main_win.cc	(revision 60)
@@ -8,4 +8,73 @@
   set_default_size(WIN_WIDTH,WIN_HEIGHT);
   add(vbox);
+
+
+  // custom icons for the toolbar
+
+  Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create();
+ 
+  std::vector<std::string> icon_path;
+  icon_path.push_back(DATADIR);
+  icon_path.push_back("pixmaps");
+  icon_path.push_back("gd");
+
+  std::vector<std::string> move_icon_path(icon_path);
+  move_icon_path.push_back("move.png");
+  Gtk::IconSource move_icon_source;
+  move_icon_source.set_filename(Glib::build_filename(move_icon_path));
+  Gtk::IconSet move_icon_set;
+  move_icon_set.add_source(move_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set);
+
+  std::vector<std::string> addnode_icon_path(icon_path);
+  addnode_icon_path.push_back("addnode.png");
+  Gtk::IconSource addnode_icon_source;
+  addnode_icon_source.set_filename(Glib::build_filename(addnode_icon_path));
+  Gtk::IconSet addnode_icon_set;
+  addnode_icon_set.add_source(addnode_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set);
+
+  std::vector<std::string> addlink_icon_path(icon_path);
+  addlink_icon_path.push_back("addlink.png");
+  Gtk::IconSource addlink_icon_source;
+  addlink_icon_source.set_filename(Glib::build_filename(addlink_icon_path));
+  Gtk::IconSet addlink_icon_set;
+  addlink_icon_set.add_source(addlink_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set);
+
+  std::vector<std::string> delete_icon_path(icon_path);
+  delete_icon_path.push_back("delete.png");
+  Gtk::IconSource delete_icon_source;
+  delete_icon_source.set_filename(Glib::build_filename(delete_icon_path));
+  Gtk::IconSet delete_icon_set;
+  delete_icon_set.add_source(delete_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set);
+
+  std::vector<std::string> editlink_icon_path(icon_path);
+  editlink_icon_path.push_back("editlink.png");
+  Gtk::IconSource editlink_icon_source;
+  editlink_icon_source.set_filename(Glib::build_filename(editlink_icon_path));
+  Gtk::IconSet editlink_icon_set;
+  editlink_icon_set.add_source(editlink_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set);
+
+  std::vector<std::string> editnode_icon_path(icon_path);
+  editnode_icon_path.push_back("editnode.png");
+  Gtk::IconSource editnode_icon_source;
+  editnode_icon_source.set_filename(Glib::build_filename(editnode_icon_path));
+  Gtk::IconSet editnode_icon_set;
+  editnode_icon_set.add_source(editnode_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set);
+
+  std::vector<std::string> newmap_icon_path(icon_path);
+  newmap_icon_path.push_back("newmap.png");
+  Gtk::IconSource newmap_icon_source;
+  newmap_icon_source.set_filename(Glib::build_filename(newmap_icon_path));
+  Gtk::IconSet newmap_icon_set;
+  newmap_icon_set.add_source(newmap_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);
+
+  p_icon_factory->add_default();
+  
 
   ag=Gtk::ActionGroup::create();
@@ -40,17 +109,19 @@
 
   Gtk::RadioAction::Group tool_group;
-  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::Stock::CONVERT, "Move"),
+  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), "Move"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) );
-  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::Stock::NO, "Create node"),
+  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), "Create node"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 1) );
-  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::Stock::REMOVE, "Create edge"),
+  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), "Create edge"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 2) );
-  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::Stock::DELETE, "Delete"),
+  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), "Delete"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 3) );
-  ag->add( Gtk::Action::create("EditEdgeMap", Gtk::Stock::PROPERTIES),
+
+  ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), "Edit edge map"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 4) );
-  ag->add( Gtk::Action::create("EditNodeMap", Gtk::Stock::PREFERENCES),
+  ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), "Edit node map"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 5) );
-  ag->add( Gtk::Action::create("AddMap", Gtk::Stock::NEW),
+
+  ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
       sigc::mem_fun ( this->newmapwin, &NewMapWin::show ) );
 
@@ -100,4 +171,5 @@
       "    <toolitem action='EditEdgeMap' />"
       "    <toolitem action='EditNodeMap' />"
+      "    <separator />"
       "    <toolitem action='AddMap' />"
       "  </toolbar>"
Index: mapstorage.cc
===================================================================
--- mapstorage.cc	(revision 58)
+++ mapstorage.cc	(revision 60)
@@ -1,3 +1,4 @@
 #include "mapstorage.h"
+#include <cmath>
 
 MapStorage::MapStorage() : modified(false), file_name("")
