ladanyi@2012: #ifdef HAVE_CONFIG_H
ladanyi@2012: #include <config.h>
ladanyi@2012: #endif
ladanyi@2012: 
ladanyi@1606: #include "all_include.h"
ladanyi@1606: #include "mapstorage.h"
ladanyi@1606: #include "main_win.h"
ladanyi@1412: #include <libgnomecanvasmm.h>
ladanyi@1412: #include <libgnomecanvasmm/polygon.h>
ladanyi@1412: 
ladanyi@2012: #include <locale.h>
ladanyi@2012: 
ladanyi@1412: #define MAIN_PART
ladanyi@1412: 
hegyi@1512: std::vector <std::string> edge_property_strings;
hegyi@1512: std::vector <double> edge_property_defaults;
hegyi@1512: std::vector <std::string> node_property_strings;
hegyi@1512: std::vector <double> node_property_defaults;
hegyi@1731: int longest_property_string_length;
ladanyi@1412: 
ladanyi@1412: int main(int argc, char *argv[])
ladanyi@1412: {
ladanyi@2052:   setlocale(LC_ALL, "");
ladanyi@2012:   bindtextdomain(PACKAGE, LOCALEDIR);
ladanyi@2012:   bind_textdomain_codeset(PACKAGE, "UTF-8");
ladanyi@2012:   textdomain(PACKAGE);
hegyi@1440: 
hegyi@1440:   //initializing
hegyi@1440: 
hegyi@1512:   edge_property_strings.resize(EDGE_PROPERTY_NUM);
hegyi@1512:   edge_property_strings[E_WIDTH]="Edge Width";
hegyi@1512:   edge_property_strings[E_COLOR]="Edge Color";
hegyi@1512:   edge_property_strings[E_TEXT]="Edge Text";
ladanyi@1412: 
hegyi@1512:   edge_property_defaults.resize(EDGE_PROPERTY_NUM);
hegyi@1512:   edge_property_defaults[E_WIDTH]=10.0;
hegyi@1512:   edge_property_defaults[E_COLOR]=100;
hegyi@1512:   edge_property_defaults[E_TEXT]=0;
hegyi@1512: 
hegyi@1512:   node_property_strings.resize(NODE_PROPERTY_NUM);
hegyi@1512:   node_property_strings[N_RADIUS]="Node Radius";
hegyi@1512:   node_property_strings[N_COLOR]="Node Color";
hegyi@1512:   node_property_strings[N_TEXT]="Node Text";
hegyi@1512: 
hegyi@1512:   node_property_defaults.resize(NODE_PROPERTY_NUM);
hegyi@1512:   node_property_defaults[N_RADIUS]=20.0;
hegyi@1512:   node_property_defaults[N_COLOR]=100;
hegyi@1512:   node_property_defaults[N_TEXT]=0;
ladanyi@1412: 
hegyi@1731:   longest_property_string_length=0;
hegyi@1731:   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
hegyi@1731:     {
hegyi@1731:       int j=edge_property_strings[i].size();
hegyi@1731:       if(j>longest_property_string_length)
hegyi@1731: 	{
hegyi@1731: 	  longest_property_string_length=j;
hegyi@1731: 	}
hegyi@1731:     }
hegyi@1731:   for(int i=0;i<NODE_PROPERTY_NUM;i++)
hegyi@1731:     {
hegyi@1731:       int j=node_property_strings[i].size();
hegyi@1731:       if(j>longest_property_string_length)
hegyi@1731: 	{
hegyi@1731: 	  longest_property_string_length=j;
hegyi@1731: 	}
hegyi@1731:     }
hegyi@1731: 
hegyi@1731: 
hegyi@1440:   //initializing GUI
hegyi@1440: 
ladanyi@1412:   Gnome::Canvas::init();
ladanyi@1412:   Gtk::Main app(argc, argv);
ladanyi@1412: 
hegyi@1849:   MainWin mytab;
ladanyi@1616: 
hegyi@1869: //   if ((argc == 2) && (Glib::file_test(argv[1], Glib::FILE_TEST_IS_REGULAR)))
hegyi@1869: //     {
hegyi@1869: //       mytab.readFile(argv[1]);
hegyi@1869: //     }
hegyi@1869:   if(argc>=2)
hegyi@1849:     {
hegyi@1869:       for(int i=1;i<argc;i++)
hegyi@1869: 	{
hegyi@1869: 	  if(Glib::file_test(argv[i], Glib::FILE_TEST_IS_REGULAR))
hegyi@1869: 	    {
hegyi@1869: 	      mytab.readFile(argv[i]);
hegyi@1869: 	    }
hegyi@1869: 	}
hegyi@1869:     }
hegyi@1869:   else
hegyi@1869:     {
hegyi@1869:       mytab.newTab();
hegyi@1849:     }
ladanyi@1616:   
hegyi@1849:   app.run(mytab);
ladanyi@1412: 
ladanyi@1412:   return 0;
ladanyi@1412: }