COIN-OR::LEMON - Graph Library

Changeset 1635:1d2e5352e99b in lemon-0.x for gui


Ignore:
Timestamp:
08/17/05 17:20:18 (19 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2145
Message:

Images are compiled in now.

Location:
gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gui/Makefile.am

    r1634 r1635  
    11AM_CPPFLAGS = -I$(top_srcdir)
    22LDADD = $(top_builddir)/lemon/libemon.la
     3
     4
     5noinst_DATA = guipixbufs.h
     6CLEANFILES = $(noinst_DATA)
    37
    48bin_PROGRAMS = gd
     
    2731gd_CXXFLAGS = $(GTK_CFLAGS)
    2832gd_LDFLAGS = $(GTK_LIBS)
    29 gd_CPPFLAGS = -DDATADIR=\"$(datadir)\"
    3033
    31 pixmapdir = $(datadir)/pixmaps/gd
     34IMAGES = addlink.png addnode.png delete.png \
     35        editlink.png editnode.png move.png newmap.png
    3236
    33 pixmap_DATA =
    34         addlink.png \
    35         addnode.png \
    36         delete.png \
    37         editlink.png \
    38         editnode.png \
    39         move.png \
    40         newmap.png
     37VARIABLES = \
     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
     47guipixbufs.h: $(IMAGES)
     48        gdk-pixbuf-csource \
     49        --raw --build-list $(VARIABLES) > guipixbufs.h ||  \
     50        ( rm -f guipixbufs.h && false )
     51
     52EXTRA_DIST = $(IMAGES) guipixbufs.h
  • gui/main_win.cc

    r1634 r1635  
    11#include "main_win.h"
     2#include "guipixbufs.h"
    23
    34MainWin::MainWin(const std::string& title) :
     
    1415  Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create();
    1516 
    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
    2332  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);
    2534  Gtk::IconSet move_icon_set;
    2635  move_icon_set.add_source(move_icon_source);
    2736  p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set);
    2837
    29   std::vector<std::string> addnode_icon_path(icon_path);
    30   addnode_icon_path.push_back("addnode.png");
    3138  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);
    3340  Gtk::IconSet addnode_icon_set;
    3441  addnode_icon_set.add_source(addnode_icon_source);
    3542  p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set);
    3643
    37   std::vector<std::string> addlink_icon_path(icon_path);
    38   addlink_icon_path.push_back("addlink.png");
    3944  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);
    4146  Gtk::IconSet addlink_icon_set;
    4247  addlink_icon_set.add_source(addlink_icon_source);
    4348  p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set);
    4449
    45   std::vector<std::string> delete_icon_path(icon_path);
    46   delete_icon_path.push_back("delete.png");
    4750  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);
    4952  Gtk::IconSet delete_icon_set;
    5053  delete_icon_set.add_source(delete_icon_source);
    5154  p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set);
    5255
    53   std::vector<std::string> editlink_icon_path(icon_path);
    54   editlink_icon_path.push_back("editlink.png");
    5556  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);
    5758  Gtk::IconSet editlink_icon_set;
    5859  editlink_icon_set.add_source(editlink_icon_source);
    5960  p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set);
    6061
    61   std::vector<std::string> editnode_icon_path(icon_path);
    62   editnode_icon_path.push_back("editnode.png");
    6362  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);
    6564  Gtk::IconSet editnode_icon_set;
    6665  editnode_icon_set.add_source(editnode_icon_source);
    6766  p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set);
    6867
    69   std::vector<std::string> newmap_icon_path(icon_path);
    70   newmap_icon_path.push_back("newmap.png");
    7168  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);
    7370  Gtk::IconSet newmap_icon_set;
    7471  newmap_icon_set.add_source(newmap_icon_source);
Note: See TracChangeset for help on using the changeset viewer.