Images are compiled in now.
authorladanyi
Wed, 17 Aug 2005 15:20:18 +0000
changeset 16351d2e5352e99b
parent 1634 910b1bcb7d05
child 1636 260ac104190f
Images are compiled in now.
gui/Makefile.am
gui/main_win.cc
     1.1 --- a/gui/Makefile.am	Wed Aug 17 12:35:43 2005 +0000
     1.2 +++ b/gui/Makefile.am	Wed Aug 17 15:20:18 2005 +0000
     1.3 @@ -1,6 +1,10 @@
     1.4  AM_CPPFLAGS = -I$(top_srcdir)
     1.5  LDADD = $(top_builddir)/lemon/libemon.la
     1.6  
     1.7 +
     1.8 +noinst_DATA = guipixbufs.h
     1.9 +CLEANFILES = $(noinst_DATA)
    1.10 +
    1.11  bin_PROGRAMS = gd
    1.12  
    1.13  gd_SOURCES = \
    1.14 @@ -26,15 +30,23 @@
    1.15  
    1.16  gd_CXXFLAGS = $(GTK_CFLAGS)
    1.17  gd_LDFLAGS = $(GTK_LIBS)
    1.18 -gd_CPPFLAGS = -DDATADIR=\"$(datadir)\"
    1.19  
    1.20 -pixmapdir = $(datadir)/pixmaps/gd
    1.21 +IMAGES = addlink.png addnode.png delete.png \
    1.22 +	editlink.png editnode.png move.png newmap.png
    1.23  
    1.24 -pixmap_DATA =
    1.25 -	addlink.png \
    1.26 -	addnode.png \
    1.27 -	delete.png \
    1.28 -	editlink.png \
    1.29 -	editnode.png \
    1.30 -	move.png \
    1.31 -	newmap.png
    1.32 +VARIABLES = \
    1.33 +	gui_icons_addlink $(srcdir)/addlink.png \
    1.34 +	gui_icons_addnode $(srcdir)/addnode.png \
    1.35 +	gui_icons_delete $(srcdir)/delete.png \
    1.36 +	gui_icons_editlink $(srcdir)/editlink.png \
    1.37 +	gui_icons_editnode $(srcdir)/editnode.png \
    1.38 +	gui_icons_move $(srcdir)/move.png \
    1.39 +	gui_icons_newmap $(srcdir)/newmap.png
    1.40 +
    1.41 +
    1.42 +guipixbufs.h: $(IMAGES)
    1.43 +	gdk-pixbuf-csource \
    1.44 +	--raw --build-list $(VARIABLES) > guipixbufs.h ||  \
    1.45 +	( rm -f guipixbufs.h && false )
    1.46 +
    1.47 +EXTRA_DIST = $(IMAGES) guipixbufs.h
     2.1 --- a/gui/main_win.cc	Wed Aug 17 12:35:43 2005 +0000
     2.2 +++ b/gui/main_win.cc	Wed Aug 17 15:20:18 2005 +0000
     2.3 @@ -1,4 +1,5 @@
     2.4  #include "main_win.h"
     2.5 +#include "guipixbufs.h"
     2.6  
     2.7  MainWin::MainWin(const std::string& title) :
     2.8    mapwin("Map Setup", mapstorage, gd_canvas),
     2.9 @@ -13,63 +14,59 @@
    2.10  
    2.11    Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create();
    2.12   
    2.13 -  std::vector<std::string> icon_path;
    2.14 -  icon_path.push_back(DATADIR);
    2.15 -  icon_path.push_back("pixmaps");
    2.16 -  icon_path.push_back("gd");
    2.17 +  Glib::RefPtr<Gdk::Pixbuf> p_move_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.18 +      2328, gui_icons_move);
    2.19 +  Glib::RefPtr<Gdk::Pixbuf> p_addnode_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.20 +      2328, gui_icons_addnode);
    2.21 +  Glib::RefPtr<Gdk::Pixbuf> p_addlink_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.22 +      2328, gui_icons_addlink);
    2.23 +  Glib::RefPtr<Gdk::Pixbuf> p_delete_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.24 +      2328, gui_icons_delete);
    2.25 +  Glib::RefPtr<Gdk::Pixbuf> p_editlink_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.26 +      2328, gui_icons_editlink);
    2.27 +  Glib::RefPtr<Gdk::Pixbuf> p_editnode_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.28 +      2328, gui_icons_editnode);
    2.29 +  Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline(
    2.30 +      2328, gui_icons_newmap);
    2.31  
    2.32 -  std::vector<std::string> move_icon_path(icon_path);
    2.33 -  move_icon_path.push_back("move.png");
    2.34    Gtk::IconSource move_icon_source;
    2.35 -  move_icon_source.set_filename(Glib::build_filename(move_icon_path));
    2.36 +  move_icon_source.set_pixbuf(p_move_pixbuf);
    2.37    Gtk::IconSet move_icon_set;
    2.38    move_icon_set.add_source(move_icon_source);
    2.39    p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set);
    2.40  
    2.41 -  std::vector<std::string> addnode_icon_path(icon_path);
    2.42 -  addnode_icon_path.push_back("addnode.png");
    2.43    Gtk::IconSource addnode_icon_source;
    2.44 -  addnode_icon_source.set_filename(Glib::build_filename(addnode_icon_path));
    2.45 +  addnode_icon_source.set_pixbuf(p_addnode_pixbuf);
    2.46    Gtk::IconSet addnode_icon_set;
    2.47    addnode_icon_set.add_source(addnode_icon_source);
    2.48    p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set);
    2.49  
    2.50 -  std::vector<std::string> addlink_icon_path(icon_path);
    2.51 -  addlink_icon_path.push_back("addlink.png");
    2.52    Gtk::IconSource addlink_icon_source;
    2.53 -  addlink_icon_source.set_filename(Glib::build_filename(addlink_icon_path));
    2.54 +  addlink_icon_source.set_pixbuf(p_addlink_pixbuf);
    2.55    Gtk::IconSet addlink_icon_set;
    2.56    addlink_icon_set.add_source(addlink_icon_source);
    2.57    p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set);
    2.58  
    2.59 -  std::vector<std::string> delete_icon_path(icon_path);
    2.60 -  delete_icon_path.push_back("delete.png");
    2.61    Gtk::IconSource delete_icon_source;
    2.62 -  delete_icon_source.set_filename(Glib::build_filename(delete_icon_path));
    2.63 +  delete_icon_source.set_pixbuf(p_delete_pixbuf);
    2.64    Gtk::IconSet delete_icon_set;
    2.65    delete_icon_set.add_source(delete_icon_source);
    2.66    p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set);
    2.67  
    2.68 -  std::vector<std::string> editlink_icon_path(icon_path);
    2.69 -  editlink_icon_path.push_back("editlink.png");
    2.70    Gtk::IconSource editlink_icon_source;
    2.71 -  editlink_icon_source.set_filename(Glib::build_filename(editlink_icon_path));
    2.72 +  editlink_icon_source.set_pixbuf(p_editlink_pixbuf);
    2.73    Gtk::IconSet editlink_icon_set;
    2.74    editlink_icon_set.add_source(editlink_icon_source);
    2.75    p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set);
    2.76  
    2.77 -  std::vector<std::string> editnode_icon_path(icon_path);
    2.78 -  editnode_icon_path.push_back("editnode.png");
    2.79    Gtk::IconSource editnode_icon_source;
    2.80 -  editnode_icon_source.set_filename(Glib::build_filename(editnode_icon_path));
    2.81 +  editnode_icon_source.set_pixbuf(p_editnode_pixbuf);
    2.82    Gtk::IconSet editnode_icon_set;
    2.83    editnode_icon_set.add_source(editnode_icon_source);
    2.84    p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set);
    2.85  
    2.86 -  std::vector<std::string> newmap_icon_path(icon_path);
    2.87 -  newmap_icon_path.push_back("newmap.png");
    2.88    Gtk::IconSource newmap_icon_source;
    2.89 -  newmap_icon_source.set_filename(Glib::build_filename(newmap_icon_path));
    2.90 +  newmap_icon_source.set_pixbuf(p_newmap_pixbuf);
    2.91    Gtk::IconSet newmap_icon_set;
    2.92    newmap_icon_set.add_source(newmap_icon_source);
    2.93    p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set);