Changeset 1635:1d2e5352e99b in lemon-0.x for gui
- Timestamp:
- 08/17/05 17:20:18 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2145
- Location:
- gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/Makefile.am
r1634 r1635 1 1 AM_CPPFLAGS = -I$(top_srcdir) 2 2 LDADD = $(top_builddir)/lemon/libemon.la 3 4 5 noinst_DATA = guipixbufs.h 6 CLEANFILES = $(noinst_DATA) 3 7 4 8 bin_PROGRAMS = gd … … 27 31 gd_CXXFLAGS = $(GTK_CFLAGS) 28 32 gd_LDFLAGS = $(GTK_LIBS) 29 gd_CPPFLAGS = -DDATADIR=\"$(datadir)\"30 33 31 pixmapdir = $(datadir)/pixmaps/gd 34 IMAGES = addlink.png addnode.png delete.png \ 35 editlink.png editnode.png move.png newmap.png 32 36 33 pixmap_DATA = 34 addlink.png \ 35 addnode.png \ 36 delete.png \ 37 editlink.png \ 38 editnode.png \ 39 move.png \ 40 newmap.png 37 VARIABLES = \ 38 gui_icons_addlink $(srcdir)/addlink.png \ 39 gui_icons_addnode $(srcdir)/addnode.png \ 40 gui_icons_delete $(srcdir)/delete.png \ 41 gui_icons_editlink $(srcdir)/editlink.png \ 42 gui_icons_editnode $(srcdir)/editnode.png \ 43 gui_icons_move $(srcdir)/move.png \ 44 gui_icons_newmap $(srcdir)/newmap.png 45 46 47 guipixbufs.h: $(IMAGES) 48 gdk-pixbuf-csource \ 49 --raw --build-list $(VARIABLES) > guipixbufs.h || \ 50 ( rm -f guipixbufs.h && false ) 51 52 EXTRA_DIST = $(IMAGES) guipixbufs.h -
gui/main_win.cc
r1634 r1635 1 1 #include "main_win.h" 2 #include "guipixbufs.h" 2 3 3 4 MainWin::MainWin(const std::string& title) : … … 14 15 Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create(); 15 16 16 std::vector<std::string> icon_path; 17 icon_path.push_back(DATADIR); 18 icon_path.push_back("pixmaps"); 19 icon_path.push_back("gd"); 20 21 std::vector<std::string> move_icon_path(icon_path); 22 move_icon_path.push_back("move.png"); 17 Glib::RefPtr<Gdk::Pixbuf> p_move_pixbuf = Gdk::Pixbuf::create_from_inline( 18 2328, gui_icons_move); 19 Glib::RefPtr<Gdk::Pixbuf> p_addnode_pixbuf = Gdk::Pixbuf::create_from_inline( 20 2328, gui_icons_addnode); 21 Glib::RefPtr<Gdk::Pixbuf> p_addlink_pixbuf = Gdk::Pixbuf::create_from_inline( 22 2328, gui_icons_addlink); 23 Glib::RefPtr<Gdk::Pixbuf> p_delete_pixbuf = Gdk::Pixbuf::create_from_inline( 24 2328, gui_icons_delete); 25 Glib::RefPtr<Gdk::Pixbuf> p_editlink_pixbuf = Gdk::Pixbuf::create_from_inline( 26 2328, gui_icons_editlink); 27 Glib::RefPtr<Gdk::Pixbuf> p_editnode_pixbuf = Gdk::Pixbuf::create_from_inline( 28 2328, gui_icons_editnode); 29 Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline( 30 2328, gui_icons_newmap); 31 23 32 Gtk::IconSource move_icon_source; 24 move_icon_source.set_ filename(Glib::build_filename(move_icon_path));33 move_icon_source.set_pixbuf(p_move_pixbuf); 25 34 Gtk::IconSet move_icon_set; 26 35 move_icon_set.add_source(move_icon_source); 27 36 p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set); 28 37 29 std::vector<std::string> addnode_icon_path(icon_path);30 addnode_icon_path.push_back("addnode.png");31 38 Gtk::IconSource addnode_icon_source; 32 addnode_icon_source.set_ filename(Glib::build_filename(addnode_icon_path));39 addnode_icon_source.set_pixbuf(p_addnode_pixbuf); 33 40 Gtk::IconSet addnode_icon_set; 34 41 addnode_icon_set.add_source(addnode_icon_source); 35 42 p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set); 36 43 37 std::vector<std::string> addlink_icon_path(icon_path);38 addlink_icon_path.push_back("addlink.png");39 44 Gtk::IconSource addlink_icon_source; 40 addlink_icon_source.set_ filename(Glib::build_filename(addlink_icon_path));45 addlink_icon_source.set_pixbuf(p_addlink_pixbuf); 41 46 Gtk::IconSet addlink_icon_set; 42 47 addlink_icon_set.add_source(addlink_icon_source); 43 48 p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set); 44 49 45 std::vector<std::string> delete_icon_path(icon_path);46 delete_icon_path.push_back("delete.png");47 50 Gtk::IconSource delete_icon_source; 48 delete_icon_source.set_ filename(Glib::build_filename(delete_icon_path));51 delete_icon_source.set_pixbuf(p_delete_pixbuf); 49 52 Gtk::IconSet delete_icon_set; 50 53 delete_icon_set.add_source(delete_icon_source); 51 54 p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set); 52 55 53 std::vector<std::string> editlink_icon_path(icon_path);54 editlink_icon_path.push_back("editlink.png");55 56 Gtk::IconSource editlink_icon_source; 56 editlink_icon_source.set_ filename(Glib::build_filename(editlink_icon_path));57 editlink_icon_source.set_pixbuf(p_editlink_pixbuf); 57 58 Gtk::IconSet editlink_icon_set; 58 59 editlink_icon_set.add_source(editlink_icon_source); 59 60 p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set); 60 61 61 std::vector<std::string> editnode_icon_path(icon_path);62 editnode_icon_path.push_back("editnode.png");63 62 Gtk::IconSource editnode_icon_source; 64 editnode_icon_source.set_ filename(Glib::build_filename(editnode_icon_path));63 editnode_icon_source.set_pixbuf(p_editnode_pixbuf); 65 64 Gtk::IconSet editnode_icon_set; 66 65 editnode_icon_set.add_source(editnode_icon_source); 67 66 p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set); 68 67 69 std::vector<std::string> newmap_icon_path(icon_path);70 newmap_icon_path.push_back("newmap.png");71 68 Gtk::IconSource newmap_icon_source; 72 newmap_icon_source.set_ filename(Glib::build_filename(newmap_icon_path));69 newmap_icon_source.set_pixbuf(p_newmap_pixbuf); 73 70 Gtk::IconSet newmap_icon_set; 74 71 newmap_icon_set.add_source(newmap_icon_source);
Note: See TracChangeset
for help on using the changeset viewer.