Index: Makefile.am
===================================================================
--- Makefile.am	(revision 186)
+++ Makefile.am	(revision 191)
@@ -49,5 +49,7 @@
 	dijkstrabox.cc \
 	background_chooser_dialog.h \
-	background_chooser_dialog.cc
+	background_chooser_dialog.cc \
+	eps_win.h \
+	eps_win.cc
 
 glemon_CXXFLAGS = $(GTK_CFLAGS) $(LEMON_CFLAGS)
Index: all_include.h
===================================================================
--- all_include.h	(revision 174)
+++ all_include.h	(revision 191)
@@ -35,4 +35,5 @@
 enum {E_WIDTH, E_COLOR, E_TEXT, EDGE_PROPERTY_NUM}; // edge properties;
 enum {N_RADIUS, N_COLOR, N_TEXT, NODE_PROPERTY_NUM}; // node properties;
+enum {N_MAPS, E_MAPS, ARROWS, PAR, EPS_PROPERTY_NUM}; // eps properties;
 enum {MOVE, CREATE_NODE, CREATE_EDGE, ERASER, MAP_EDIT, TOOL_NUM}; // tools;
 #define RANGE 3
Index: main_win.cc
===================================================================
--- main_win.cc	(revision 190)
+++ main_win.cc	(revision 191)
@@ -49,4 +49,6 @@
   Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline(
       2328, gui_icons_newmap);
+  Glib::RefPtr<Gdk::Pixbuf> p_eps_pixbuf = Gdk::Pixbuf::create_from_inline(
+      2328, gui_icons_eps);
 
   Gtk::IconSource move_icon_source;
@@ -85,4 +87,10 @@
   newmap_icon_set.add_source(newmap_icon_source);
   p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);
+
+  Gtk::IconSource eps_icon_source;
+  eps_icon_source.set_pixbuf(p_eps_pixbuf);
+  Gtk::IconSet eps_icon_set;
+  eps_icon_set.add_source(eps_icon_source);
+  p_icon_factory->add(Gtk::StockID("gd-eps"), eps_icon_set);
 
   p_icon_factory->add_default();
@@ -152,4 +160,7 @@
   ag->add( Gtk::Action::create("DesignGraph", Gtk::Stock::REFRESH),
       sigc::mem_fun ( *this , &MainWin::reDesignGraph ) );
+
+  ag->add( Gtk::Action::create("Eps", Gtk::StockID("gd-eps")),
+      sigc::mem_fun ( *this , &MainWin::exportToEPS ) );
 
   uim=Gtk::UIManager::create();
@@ -209,4 +220,5 @@
       "    <toolitem action='AddMap' />"
       "    <toolitem action='DesignGraph' />"
+      "    <toolitem action='Eps' />"
       "  </toolbar>"
       "</ui>";
@@ -611,4 +623,12 @@
 }
 
+void MainWin::exportToEPS()
+{
+  if(active_tab!=-1)
+    {
+      tabs[active_tab]->createExportToEPSWin(tabnames[active_tab]);
+    }
+}
+
 void MainWin::createBackgroundChooser()
 {
Index: main_win.h
===================================================================
--- main_win.h	(revision 190)
+++ main_win.h	(revision 191)
@@ -263,4 +263,6 @@
   virtual void reDesignGraph();
 
+  virtual void exportToEPS();
+
   void createBackgroundChooser();
 };
Index: mapstorage.cc
===================================================================
--- mapstorage.cc	(revision 184)
+++ mapstorage.cc	(revision 191)
@@ -24,6 +24,7 @@
 #include <cmath>
 #include <gtkmm.h>
-
-const double i_d=20;
+#include<lemon/graph_to_eps.h>
+
+const int i_d=20;
 const double a_d=0.05;
 const double p_d=40000;
@@ -590,2 +591,73 @@
   background_scaling = scaling;
 }
+
+void MapStorage::exportGraphToEPS(std::vector<bool> options, std::string filename)
+{
+  Graph::NodeMap<int> _nodeColors(graph, 0);
+  Graph::EdgeMap<int> _edgeColors(graph, 0);
+  Graph::NodeMap<double> _nodeSizes(graph, 6.0);
+  Graph::EdgeMap<double> _edgeWidths(graph, 1.0);
+  bool _drawArrows=options[ARROWS];
+  bool _enableParallel=options[PAR];
+
+  std::string emptyString="";
+  Graph::NodeMap<std::string> _nodeTextMap(graph,emptyString);
+
+  //_nodeTextMap=(Graph::NodeMap<void> *)&emptyStringMap;
+
+  if(options[N_MAPS])
+    {
+      if(active_nodemaps[N_RADIUS]!="")
+	{
+	  _nodeSizes=*(nodemap_storage[active_nodemaps[N_RADIUS]]);
+	}
+      if(active_nodemaps[N_COLOR]!="")
+	{
+	  for(NodeIt ni(graph);ni!=INVALID;++ni)
+	    {
+	      _nodeColors[ni]=(int)((*(nodemap_storage[active_nodemaps[N_COLOR]]))[ni]);
+	    }
+	}
+      if(active_nodemaps[N_TEXT]!="")
+	{
+	  for(NodeIt ni(graph);ni!=INVALID;++ni)
+	    {
+	      std::ostringstream o;
+	      o << ((*(nodemap_storage[active_nodemaps[N_TEXT]]))[ni]);
+	      _nodeTextMap[ni]=o.str();	      
+	    }
+	}
+    }
+  if(options[E_MAPS])
+    {
+      if(active_edgemaps[E_WIDTH]!="")
+	{
+	  _edgeWidths=*(edgemap_storage[active_edgemaps[E_WIDTH]]);
+	}
+      if(active_edgemaps[E_COLOR]!="")
+	{
+	  for(EdgeIt ei(graph);ei!=INVALID;++ei)
+	    {
+	      _edgeColors[ei]=(int)((*(edgemap_storage[active_edgemaps[E_COLOR]]))[ei]);
+	    }
+	}
+    }
+
+  Palette palette;
+  Palette paletteW(true);
+
+  graphToEps(graph,filename).
+    title("Sample .eps figure (fits to A4)").
+    copyright("(C) 2006 LEMON Project").
+    absoluteNodeSizes().absoluteEdgeWidths().
+    nodeScale(2).nodeSizes(_nodeSizes).
+    coords(coords).
+    nodeColors(composeMap(paletteW,_nodeColors)).
+    edgeColors(composeMap(palette,_edgeColors)).
+    edgeWidthScale(0.3).edgeWidths(_edgeWidths).
+    nodeTexts(_nodeTextMap).nodeTextSize(7).
+    enableParallel(_enableParallel).parEdgeDist(4).
+    drawArrows(_drawArrows).arrowWidth(7).arrowLength(7).
+    run();
+
+}
Index: mapstorage.h
===================================================================
--- mapstorage.h	(revision 184)
+++ mapstorage.h	(revision 191)
@@ -292,4 +292,6 @@
 
   void redesign_data_changed();
+
+  void exportGraphToEPS(std::vector<bool>, std::string);
 };
 
Index: nbtab.cc
===================================================================
--- nbtab.cc	(revision 186)
+++ nbtab.cc	(revision 191)
@@ -18,4 +18,5 @@
 
 #include <nbtab.h>
+#include <eps_win.h>
 
 NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false), mapstorage(*this)
@@ -227,4 +228,15 @@
 }
 
+void NoteBookTab::createExportToEPSWin(std::string name)
+{
+  if(!epswinexists)
+    {
+      epswin=new EpsWin("Export to EPS - "+name, *this);
+      epswin->show();
+      epswinexists=true;
+    }
+}
+
+
 void NoteBookTab::createDesignWin(std::string name)
 {
@@ -257,4 +269,10 @@
 }
 
+void NoteBookTab::closeEpsWin()
+{
+  epswinexists=false;
+  delete epswin;
+}
+
 bool NoteBookTab::closeDesignWin(GdkEventAny * e)
 {
@@ -291,2 +309,7 @@
   mapstorage.broadcastActiveMaps();
 }
+
+void NoteBookTab::exportGraphToEPS(std::vector<bool> options, std::string filename)
+{
+  mapstorage.exportGraphToEPS(options, filename);
+}
Index: nbtab.h
===================================================================
--- nbtab.h	(revision 177)
+++ nbtab.h	(revision 191)
@@ -24,4 +24,6 @@
 #include "mapstorage.h"
 #include "map_win.h"
+//#include "eps_win.h"
+class EpsWin;
 #include "design_win.h"
 #include "graph_displayer_canvas.h"
@@ -98,4 +100,7 @@
   bool designwinexists;
 
+  ///Indicates whether the \ref EpsWin is opened or not. See \ref epswin.
+  bool epswinexists;
+
   ///Address of the only \ref MapWin that the \ref NoteBookTab can open.
 
@@ -113,4 +118,11 @@
   ///more complicated to synchronize them.
   DesignWin * designwin;
+
+  ///Address of the only \ref EpsWin that the \ref NoteBookTab can open.
+
+  ///Only one of this window can be opened at the same time (\ref epswinexists), 
+  ///because there is no need for more, one per tab is enough.
+  ///There won't be benefit of more than one.
+  EpsWin * epswin;
 
 public:
@@ -186,4 +198,9 @@
   void createDesignWin(std::string);
 
+  ///Pops up a window, that can dump graph to EPS
+
+  ///Different parameters can be set here.
+  void createExportToEPSWin(std::string);
+
   ///Closes and deregistrates the \ref MapWin of \ref NoteBookTab.
   
@@ -192,5 +209,15 @@
   void closeMapWin();
 
+  ///Closes and deregistrates the \ref DesignWin of \ref NoteBookTab.
+  
+  ///See also
+  ///\ref designwin.
   bool closeDesignWin(GdkEventAny *);
+
+  ///Closes and deregistrates the \ref EpsWin of \ref NoteBookTab.
+  
+  ///See also
+  ///\ref epswin.
+  void closeEpsWin();
 
   ///Sets node representation settings
@@ -202,4 +229,7 @@
   ///Let the graph redesign, based on gravity and edge elasticity.
   void reDesignGraph();
+
+  ///Lets Mapstorage export the graph to EPS
+  void exportGraphToEPS(std::vector<bool>, std::string);
 
   ///\ref MapWin calls this function when it updates the maplist in comboboxes.
