Blame xdao/Icons.cc

Packit bf707c
#include "Icons.h"
Packit bf707c
#include "stock/pixbufs.h"
Packit bf707c
Packit bf707c
Gtk::StockID Icons::PLAY("gcdmaster-play");
Packit bf707c
Gtk::StockID Icons::STOP("gcdmaster-stop");
Packit bf707c
Gtk::StockID Icons::PAUSE("gcdmaster-pause");
Packit bf707c
Gtk::StockID Icons::GCDMASTER("gcdmaster-gcdmaster");
Packit bf707c
Gtk::StockID Icons::OPEN("gcdmaster-open");
Packit bf707c
Gtk::StockID Icons::AUDIOCD("gcdmaster-audiocd");
Packit bf707c
Gtk::StockID Icons::COPYCD("gcdmaster-copycd");
Packit bf707c
Gtk::StockID Icons::DUMPCD("gcdmaster-dumpcd");
Packit bf707c
Gtk::StockID Icons::RECORD("gcdmaster-record");
Packit bf707c
Packit bf707c
struct Icons::IconEntry Icons::iconList[] = {
Packit bf707c
  { Icons::PLAY,      play_pixbuf },
Packit bf707c
  { Icons::STOP,      stop_pixbuf },
Packit bf707c
  { Icons::PAUSE,     pause_pixbuf },
Packit bf707c
  { Icons::GCDMASTER, gcdmaster_pixbuf },
Packit bf707c
  { Icons::OPEN,      open_pixbuf },
Packit bf707c
  { Icons::AUDIOCD,   audiocd_pixbuf },
Packit bf707c
  { Icons::COPYCD,    copycd_pixbuf},
Packit bf707c
  { Icons::DUMPCD,    dumpcd_pixbuf},
Packit bf707c
  { Icons::RECORD,    record_pixbuf}
Packit bf707c
};
Packit bf707c
Packit bf707c
void Icons::registerStockIcons()
Packit bf707c
{
Packit bf707c
  Glib::RefPtr<Gtk::IconFactory> factory = Gtk::IconFactory::create();
Packit bf707c
  factory->add_default();
Packit bf707c
Packit bf707c
  for (unsigned i = 0; i < G_N_ELEMENTS(iconList); i++) {
Packit bf707c
    Gtk::IconSource* source = new Gtk::IconSource;
Packit bf707c
    Glib::RefPtr<Gdk::Pixbuf> pixbuf =
Packit bf707c
        Gdk::Pixbuf::create_from_inline(-1, iconList[i].pixbuf);
Packit bf707c
    source->set_pixbuf(pixbuf);
Packit bf707c
    Gtk::IconSet* set = new Gtk::IconSet;
Packit bf707c
    set->add_source(*source);
Packit bf707c
    factory->add(iconList[i].name, *set);
Packit bf707c
  }
Packit bf707c
}