MidoriExtension* extension_init (void) { GtkIconFactory* factory; GtkIconSource* icon_source; GtkIconSet* icon_set; static GtkStockItem items[] = { { STOCK_PAGE_HOLDER, N_("_Pageholder"), 0, 0, NULL }, }; factory = gtk_icon_factory_new (); gtk_stock_add (items, G_N_ELEMENTS (items)); icon_set = gtk_icon_set_new (); icon_source = gtk_icon_source_new (); gtk_icon_source_set_icon_name (icon_source, GTK_STOCK_ORIENTATION_PORTRAIT); gtk_icon_set_add_source (icon_set, icon_source); gtk_icon_source_free (icon_source); gtk_icon_factory_add (factory, STOCK_PAGE_HOLDER, icon_set); gtk_icon_set_unref (icon_set); gtk_icon_factory_add_default (factory); g_object_unref (factory); MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION, "name", _("Pageholder"), "description", "", "version", "0.1", "authors", "Christian Dywan <*****@*****.**>", NULL); g_signal_connect (extension, "activate", G_CALLBACK (page_holder_activate_cb), NULL); return extension; }
static void add_stock_item(void) { GtkIconSet *icon_set; GtkIconFactory *factory = gtk_icon_factory_new(); GtkIconTheme *theme = gtk_icon_theme_get_default(); GtkStockItem item = { (gchar*)(GEANYSENDMAIL_STOCK_MAIL), (gchar*)(N_("Mail")), 0, 0, (gchar*)(GETTEXT_PACKAGE) }; if (gtk_icon_theme_has_icon(theme, "mail-message-new")) { GtkIconSource *icon_source = gtk_icon_source_new(); icon_set = gtk_icon_set_new(); gtk_icon_source_set_icon_name(icon_source, "mail-message-new"); gtk_icon_set_add_source(icon_set, icon_source); gtk_icon_source_free(icon_source); } else { GdkPixbuf *pb = gdk_pixbuf_new_from_xpm_data(mail_icon); icon_set = gtk_icon_set_new_from_pixbuf(pb); g_object_unref(pb); } gtk_icon_factory_add(factory, item.stock_id, icon_set); gtk_stock_add(&item, 1); gtk_icon_factory_add_default(factory); g_object_unref(factory); gtk_icon_set_unref(icon_set); }
/** * @param item a validly filled out GxkStockItem * * Register a new stock item. The new stock item * @a item->stock_id is registered with an item label * of @a item->label and the stock icon @a item->stock_fallback. * If @a item->label is NULL, @a item->stock_fallback must * not be NULL, and @a item->stock_id becomes merely an * alias of @a item->stock_fallback. */ void gxk_stock_register_item (const GxkStockItem *item) { GtkStockItem tkitem = { NULL, }; g_return_if_fail (item != NULL); g_return_if_fail (item->stock_id != NULL); g_return_if_fail (item->label != NULL || item->stock_fallback != NULL); tkitem.stock_id = (gchar*) item->stock_id; if (item->label) tkitem.label = (gchar*) item->label; else tkitem.label = (gchar*) gxk_stock_item (item->stock_fallback); tkitem.modifier = 0; tkitem.keyval = 0; tkitem.translation_domain = NULL; gtk_stock_add (&tkitem, 1); if (item->stock_fallback) { GtkIconSet *iset = gtk_icon_factory_lookup_default (item->stock_fallback); if (iset) gtk_icon_factory_add (stock_icon_factory, item->stock_id, iset); } }
static void register_stock_icons (void) { static gboolean registered = FALSE; if (!registered) { GdkPixbuf *pixbuf; GtkIconFactory *factory; GtkIconSet *icon_set; static GtkStockItem items[] = { { "demo-gtk-logo", "_GTK!", 0, 0, NULL } }; registered = TRUE; gtk_stock_add (items, G_N_ELEMENTS (items)); factory = gtk_icon_factory_new (); gtk_icon_factory_add_default (factory); pixbuf = gdk_pixbuf_new_from_resource ("/application/gtk-logo-24.png", NULL); icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set); gtk_icon_set_unref (icon_set); g_object_unref (pixbuf); /* Drop our reference to the factory, GTK will hold a reference. */ g_object_unref (factory); } }
static VALUE stock_m_add(int argc, VALUE *argv, VALUE klass) { VALUE stock_id, label, modifier, keyval, translation_domain; GtkStockItem item; rb_scan_args(argc, argv, "23", &stock_id, &label, &modifier, &keyval, &translation_domain); Check_Symbol(stock_id); item.stock_id = (gchar *)SYM2CSTR(stock_id); item.label = RVAL2CSTR(label); item.modifier = NIL_P(modifier) ? 0 : NUM2UINT(modifier); item.keyval = NIL_P(keyval) ? 0 : NUM2UINT(keyval); item.translation_domain = NIL_P(translation_domain) ? NULL : RVAL2CSTR(translation_domain); gtk_stock_add(&item, 1); return Qnil; }
static void register_stock_icon(void) { static gboolean registered = FALSE; if (!registered) { GdkPixbuf *pixbuf; GtkIconFactory *factory; static GtkStockItem items[] = { { (gchar*)"abi-table-widget", (gchar*)"_Table", static_cast<GdkModifierType>(0), 0, NULL } }; registered = TRUE; /* Register our stock items */ gtk_stock_add (items, G_N_ELEMENTS (items)); /* Add our custom icon factory to the list of defaults */ factory = gtk_icon_factory_new (); gtk_icon_factory_add_default (factory); // Must be C cast pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)widget_tb_insert_table_xpm); /* Register icon to accompany stock item */ if (pixbuf != NULL) { GtkIconSet *icon_set; icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); gtk_icon_factory_add (factory, "abi-table-widget", icon_set); gtk_icon_set_unref (icon_set); g_object_unref (G_OBJECT (pixbuf)); } else { UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); } /* Drop our reference to the factory, GTK will hold a reference. */ g_object_unref (G_OBJECT (factory)); } }
/* register custom edit stock icon */ static void gm_audio_profile_manage_register_stock (void) { static gboolean registered = FALSE; if (!registered) { GtkIconFactory *factory; GtkIconSet *icons; static const GtkStockItem edit_item [] = { { MANAGE_STOCK_EDIT, N_("_Edit"), 0, 0, GETTEXT_PACKAGE }, }; icons = gtk_icon_factory_lookup_default (GTK_STOCK_PREFERENCES); factory = gtk_icon_factory_new (); gtk_icon_factory_add (factory, MANAGE_STOCK_EDIT, icons); gtk_icon_factory_add_default (factory); gtk_stock_add (edit_item, 1); registered = TRUE; } }
void add_about_stock(void) { GtkStockItem *stock; GtkIconFactory *icon_factory; GtkIconSet *icon_set; stock = g_malloc(sizeof(GtkStockItem)); stock->stock_id = "my-gtk-about"; // stock->label = _("_About"); stock->label = "About"; stock->modifier = 0; stock->keyval = 0; stock->translation_domain = PACKAGE; gtk_stock_add(stock, 1); icon_factory = gtk_icon_factory_new(); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_HELP); gtk_icon_factory_add(icon_factory, stock->stock_id, icon_set); gtk_icon_set_unref(icon_set); gtk_icon_factory_add_default(icon_factory); g_object_unref(icon_factory); }
MidoriExtension* extension_init (void) { GtkIconFactory* factory; GtkIconSource* icon_source; GtkIconSet* icon_set; static GtkStockItem items[] = { { STOCK_TAB_PANEL, N_("T_ab Panel"), 0, 0, NULL }, }; MidoriExtension* extension; factory = gtk_icon_factory_new (); gtk_stock_add (items, G_N_ELEMENTS (items)); icon_set = gtk_icon_set_new (); icon_source = gtk_icon_source_new (); gtk_icon_source_set_icon_name (icon_source, GTK_STOCK_INDEX); gtk_icon_set_add_source (icon_set, icon_source); gtk_icon_source_free (icon_source); gtk_icon_factory_add (factory, STOCK_TAB_PANEL, icon_set); gtk_icon_set_unref (icon_set); gtk_icon_factory_add_default (factory); g_object_unref (factory); extension = g_object_new (MIDORI_TYPE_EXTENSION, "name", _("Tab Panel"), "description", _("Show tabs in a vertical panel"), "version", "0.1", "authors", "Christian Dywan <*****@*****.**>", NULL); g_signal_connect (extension, "activate", G_CALLBACK (tab_panel_activate_cb), NULL); return extension; }
void osmo_register_stock_icons(void) { GdkPixbuf *pixbuf; gint i; GtkIconFactory *factory; GtkIconSet *icon_set; GtkIconSource *icon_source; GtkStockItem calendar_stock_items[] = { { (gchar*) OSMO_STOCK_BUTTON_ADD, (gchar*) N_("Add"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CLEAR, (gchar*) N_("Clear"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CLOSE, (gchar*) N_("Close"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CANCEL, (gchar*) N_("Cancel"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_JUMPTO, (gchar*) N_("Jump to"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CONTACTS_EXPORT, (gchar*) N_("Export"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CONTACTS_IMPORT, (gchar*) N_("Import"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_INSERT_TIMELINE, (gchar*) N_("Insert timeline"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_NEXT_YEAR, (gchar*) N_("Next year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_NO, (gchar*) N_("No"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_OK, (gchar*) N_("OK"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_OPEN, (gchar*) N_("Browse"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_PREV_YEAR, (gchar*) N_("Previous year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_REMOVE, (gchar*) N_("Remove"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_SELECT_DATE, (gchar*) N_("Select date"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_SELECT_FONT, (gchar*) N_("Select font"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_TODAY, (gchar*) N_("Today"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_YES, (gchar*) N_("Yes"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_ABOUT, (gchar*) N_("About"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CALENDAR, (gchar*) N_("Calendar"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_ADD, (gchar*) N_("Add contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_EDIT, (gchar*) N_("Edit contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_EXPORT, (gchar*) N_("Export contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_IMPORT, (gchar*) N_("Import contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_REMOVE, (gchar*) N_("Remove contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS, (gchar*) N_("Contacts"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDIT_NOTE, (gchar*) N_("Edit day note"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_FULLYEAR, (gchar*) N_("Display full-year calendar"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_HELP, (gchar*) N_("Help"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_JUMPTO, (gchar*) N_("Jump to date"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_LICENSE, (gchar*) N_("License"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_DAY, (gchar*) N_("Next day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_MONTH, (gchar*) N_("Next month"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_YEAR, (gchar*) N_("Next year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREFERENCES, (gchar*) N_("Preferences"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_DAY, (gchar*) N_("Previous day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_MONTH, (gchar*) N_("Previous month"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_YEAR, (gchar*) N_("Previous year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_ADD, (gchar*) N_("Add task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_EDIT, (gchar*) N_("Edit task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_REMOVE, (gchar*) N_("Remove task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS, (gchar*) N_("Tasks"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TODAY, (gchar*) N_("Today"), 0, 0, TRANSLATION_DOMAIN }, }; const guint8* calendar_stock_item_data[] = { (const guint8*) osmo_stock_button_add, (const guint8*) osmo_stock_button_clear, (const guint8*) osmo_stock_button_close, (const guint8*) osmo_stock_button_cancel, (const guint8*) osmo_stock_button_jumpto, (const guint8*) osmo_stock_button_contacts_export, (const guint8*) osmo_stock_button_contacts_import, (const guint8*) osmo_stock_button_insert_timeline, (const guint8*) osmo_stock_button_next_year, (const guint8*) osmo_stock_button_no, (const guint8*) osmo_stock_button_ok, (const guint8*) osmo_stock_button_open, (const guint8*) osmo_stock_button_prev_year, (const guint8*) osmo_stock_button_remove, (const guint8*) osmo_stock_button_select_date, (const guint8*) osmo_stock_button_select_font, (const guint8*) osmo_stock_button_today, (const guint8*) osmo_stock_button_yes, (const guint8*) osmo_stock_about, (const guint8*) osmo_stock_calendar, (const guint8*) osmo_stock_contacts_add, (const guint8*) osmo_stock_contacts_edit, (const guint8*) osmo_stock_contacts_export, (const guint8*) osmo_stock_contacts_import, (const guint8*) osmo_stock_contacts_remove, (const guint8*) osmo_stock_contacts, (const guint8*) osmo_stock_edit_note, (const guint8*) osmo_stock_fullyear, (const guint8*) osmo_stock_help, (const guint8*) osmo_stock_jumpto, (const guint8*) osmo_stock_license, (const guint8*) osmo_stock_next_day, (const guint8*) osmo_stock_next_month, (const guint8*) osmo_stock_next_year, (const guint8*) osmo_stock_preferences, (const guint8*) osmo_stock_prev_day, (const guint8*) osmo_stock_prev_month, (const guint8*) osmo_stock_prev_year, (const guint8*) osmo_stock_tasks_add, (const guint8*) osmo_stock_tasks_edit, (const guint8*) osmo_stock_tasks_remove, (const guint8*) osmo_stock_tasks, (const guint8*) osmo_stock_today, }; gtk_stock_add (calendar_stock_items, G_N_ELEMENTS (calendar_stock_items)); factory = gtk_icon_factory_new (); gtk_icon_factory_add_default(factory); for(i = 0; i < G_N_ELEMENTS(calendar_stock_item_data); i++) { pixbuf = gdk_pixbuf_new_from_inline(-1, calendar_stock_item_data[i], FALSE, NULL); icon_source = gtk_icon_source_new (); gtk_icon_source_set_pixbuf (icon_source, pixbuf); icon_set = gtk_icon_set_new (); gtk_icon_set_add_source (icon_set, icon_source); gtk_icon_factory_add(factory, calendar_stock_items[i].stock_id, icon_set); g_object_unref(pixbuf); gtk_icon_source_free (icon_source); gtk_icon_set_unref (icon_set); } g_object_unref (factory); }
void osmo_register_stock_icons(void) { GdkPixbuf *pixbuf; gint i; GtkIconFactory *factory; GtkIconSet *icon_set; GtkIconSource *icon_source; GtkStockItem osmo_stock_items[] = { { (gchar*) OSMO_STOCK_BUTTON_ADD, (gchar*) N_("Add"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CLEAR, (gchar*) N_("Clear"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CLOSE, (gchar*) N_("Close"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CANCEL, (gchar*) N_("Cancel"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_JUMPTO, (gchar*) N_("Jump to"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_EDIT, (gchar*) N_("Edit"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_DOWN, (gchar*) N_("Go Down"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_INFO, (gchar*) N_("Info"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_INSERT_TIMELINE, (gchar*) N_("Insert"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_NEXT_YEAR, (gchar*) N_("Next year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_NO, (gchar*) N_("No"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_OK, (gchar*) N_("OK"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_OPEN, (gchar*) N_("Browse"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_PREV_YEAR, (gchar*) N_("Previous year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_REMOVE, (gchar*) N_("Remove"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_SELECT_COLOR, (gchar*) N_("Select color"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_SELECT_DATE, (gchar*) N_("Select date"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_SELECT_FONT, (gchar*) N_("Select font"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_TODAY, (gchar*) N_("Today"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_YES, (gchar*) N_("Yes"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_NORMAL, (gchar*) "Osmo", 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_NOTE, (gchar*) N_("Note"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_MENU_CALENDAR, (gchar*) N_("Calendar"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_ABOUT, (gchar*) N_("About"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CALENDAR, (gchar*) N_("Calendar"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CLOSE, (gchar*) N_("Close"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CALCULATOR, (gchar*) N_("Calculator"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDIT_NOTE, (gchar*) N_("Edit day note"), 0, 0, TRANSLATION_DOMAIN }, #ifdef CONTACTS_ENABLED { (gchar*) OSMO_STOCK_CONTACTS_ADD, (gchar*) N_("Add contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_BIRTHDAYS, (gchar*) N_("Show birthdays"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_EDIT, (gchar*) N_("Edit contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_EXPORT, (gchar*) N_("Export contacts"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_IMPORT, (gchar*) N_("Import contacts"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_MAP_LOCATION, (gchar*) N_("Contact map location"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS_REMOVE, (gchar*) N_("Remove contact"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CONTACTS_EXPORT, (gchar*) N_("Export"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_BUTTON_CONTACTS_IMPORT, (gchar*) N_("Import"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_CONTACTS, (gchar*) N_("Contacts"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_BIRTHDAY, (gchar*) N_("Birthday"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_MENU_CONTACTS, (gchar*) N_("Contacts"), 0, 0, TRANSLATION_DOMAIN }, #endif /* CONTACTS_ENABLED */ #ifdef NOTES_ENABLED { (gchar*) OSMO_STOCK_EDITOR_BOLD, (gchar*) N_("Bold"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_CLEAR, (gchar*) N_("Clear"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_FIND, (gchar*) N_("Find"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_HIGHLIGHT, (gchar*) N_("Highlight"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_INFO, (gchar*) N_("Info"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_INSERT_DATE_TIME, (gchar*) N_("Insert current date and time"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_INSERT_SEPARATOR, (gchar*) N_("Insert separator"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_ITALIC, (gchar*) N_("Italic"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_SAVE, (gchar*) N_("Save"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_SPELL_CHECKER, (gchar*) N_("Toggle spell checker"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_STRIKETHROUGH, (gchar*) N_("Strikethrough"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_EDITOR_UNDERLINE, (gchar*) N_("Underline"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NOTES_ADD, (gchar*) N_("Add note"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NOTES_EDIT, (gchar*) N_("Edit note"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NOTES_REMOVE, (gchar*) N_("Remove note"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NOTES, (gchar*) N_("Notes"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_MENU_NOTES, (gchar*) N_("Notes"), 0, 0, TRANSLATION_DOMAIN }, #endif /* NOTES_ENABLED */ { (gchar*) OSMO_STOCK_FULLYEAR, (gchar*) N_("Display full-year calendar"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_HELP, (gchar*) N_("Help"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_INFO_HELP, (gchar*) N_("Help"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_JUMPTO, (gchar*) N_("Jump to date"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_LICENSE, (gchar*) N_("License"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_LIST_INVALID, (gchar*) N_("Invalid item"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_LIST_VALID, (gchar*) N_("Valid item"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_DAY, (gchar*) N_("Next day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_MONTH, (gchar*) N_("Next month"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_NEXT_YEAR, (gchar*) N_("Next year"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREFERENCES, (gchar*) N_("Preferences"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_DAY, (gchar*) N_("Previous day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_MONTH, (gchar*) N_("Previous month"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_PREV_YEAR, (gchar*) N_("Previous year"), 0, 0, TRANSLATION_DOMAIN }, #ifdef TASKS_ENABLED { (gchar*) OSMO_STOCK_TASKS_ADD, (gchar*) N_("Add task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_EDIT, (gchar*) N_("Edit task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_REMOVE, (gchar*) N_("Remove task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_PREV_DAY, (gchar*) N_("Change due date to previous day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS_NEXT_DAY, (gchar*) N_("Change due date to next day"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TASKS, (gchar*) N_("Tasks"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_TASK, (gchar*) N_("Task"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_SYSTRAY_MENU_TASKS, (gchar*) N_("Tasks"), 0, 0, TRANSLATION_DOMAIN }, #endif /* TASKS_ENABLED */ { (gchar*) OSMO_STOCK_TODAY, (gchar*) N_("Today"), 0, 0, TRANSLATION_DOMAIN }, #ifdef PRINTING_SUPPORT { (gchar*) OSMO_STOCK_PRINT, (gchar*) N_("Print"), 0, 0, TRANSLATION_DOMAIN }, #endif /* PRINTING_SUPPORT */ { (gchar*) OSMO_STOCK_TYPE_NORMAL, (gchar*) N_("Normal"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TYPE_ENCRYPTED, (gchar*) N_("Encrypted"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TYPE_RECURRENT, (gchar*) N_("Recurrent"), 0, 0, TRANSLATION_DOMAIN }, { (gchar*) OSMO_STOCK_TYPE_RECURRENT_INACTIVE, (gchar*) N_("Inactive recurrent"), 0, 0, TRANSLATION_DOMAIN } }; const guint8* osmo_stock_item_data[] = { (const guint8*) osmo_stock_button_add, (const guint8*) osmo_stock_button_clear, (const guint8*) osmo_stock_button_close, (const guint8*) osmo_stock_button_cancel, (const guint8*) osmo_stock_button_jumpto, (const guint8*) osmo_stock_button_edit, (const guint8*) osmo_stock_button_down, (const guint8*) osmo_stock_button_info, (const guint8*) osmo_stock_button_insert_timeline, (const guint8*) osmo_stock_button_next_year, (const guint8*) osmo_stock_button_no, (const guint8*) osmo_stock_button_ok, (const guint8*) osmo_stock_button_open, (const guint8*) osmo_stock_button_prev_year, (const guint8*) osmo_stock_button_remove, (const guint8*) osmo_stock_button_select_color, (const guint8*) osmo_stock_button_select_date, (const guint8*) osmo_stock_button_select_font, (const guint8*) osmo_stock_button_today, (const guint8*) osmo_stock_button_yes, (const guint8*) osmo_stock_systray_normal, (const guint8*) osmo_stock_systray_note, (const guint8*) osmo_stock_systray_menu_calendar, (const guint8*) osmo_stock_about, (const guint8*) osmo_stock_calendar, (const guint8*) osmo_stock_close, (const guint8*) osmo_stock_calculator, (const guint8*) osmo_stock_edit_note, #ifdef CONTACTS_ENABLED (const guint8*) osmo_stock_contacts_add, (const guint8*) osmo_stock_contacts_birthdays, (const guint8*) osmo_stock_contacts_edit, (const guint8*) osmo_stock_contacts_export, (const guint8*) osmo_stock_contacts_import, (const guint8*) osmo_stock_contacts_map_location, (const guint8*) osmo_stock_contacts_remove, (const guint8*) osmo_stock_button_contacts_export, (const guint8*) osmo_stock_button_contacts_import, (const guint8*) osmo_stock_contacts, (const guint8*) osmo_stock_systray_birthday, (const guint8*) osmo_stock_systray_menu_contacts, #endif /* CONTACTS_ENABLED */ #ifdef NOTES_ENABLED (const guint8*) osmo_stock_editor_bold, (const guint8*) osmo_stock_editor_clear, (const guint8*) osmo_stock_editor_find, (const guint8*) osmo_stock_editor_highlight, (const guint8*) osmo_stock_editor_info, (const guint8*) osmo_stock_editor_insert_date_time, (const guint8*) osmo_stock_editor_insert_separator, (const guint8*) osmo_stock_editor_italic, (const guint8*) osmo_stock_editor_save, (const guint8*) osmo_stock_editor_spell_checker, (const guint8*) osmo_stock_editor_strikethrough, (const guint8*) osmo_stock_editor_underline, (const guint8*) osmo_stock_notes_add, (const guint8*) osmo_stock_notes_edit, (const guint8*) osmo_stock_notes_remove, (const guint8*) osmo_stock_notes, (const guint8*) osmo_stock_systray_menu_notes, #endif /* NOTES_ENABLED */ (const guint8*) osmo_stock_fullyear, (const guint8*) osmo_stock_help, (const guint8*) osmo_stock_info_help, (const guint8*) osmo_stock_jumpto, (const guint8*) osmo_stock_license, (const guint8*) osmo_stock_list_invalid, (const guint8*) osmo_stock_list_valid, (const guint8*) osmo_stock_next_day, (const guint8*) osmo_stock_next_month, (const guint8*) osmo_stock_next_year, (const guint8*) osmo_stock_preferences, (const guint8*) osmo_stock_prev_day, (const guint8*) osmo_stock_prev_month, (const guint8*) osmo_stock_prev_year, #ifdef TASKS_ENABLED (const guint8*) osmo_stock_tasks_add, (const guint8*) osmo_stock_tasks_edit, (const guint8*) osmo_stock_tasks_remove, (const guint8*) osmo_stock_tasks_prev_day, (const guint8*) osmo_stock_tasks_next_day, (const guint8*) osmo_stock_tasks, (const guint8*) osmo_stock_systray_task, (const guint8*) osmo_stock_systray_menu_tasks, #endif /* TASKS_ENABLED */ (const guint8*) osmo_stock_today, #ifdef PRINTING_SUPPORT (const guint8*) osmo_stock_print, #endif /* PRINTING_SUPPORT */ (const guint8*) osmo_stock_type_normal, (const guint8*) osmo_stock_type_encrypted, (const guint8*) osmo_stock_type_recurrent, (const guint8*) osmo_stock_type_recurrent_inactive }; gtk_stock_add (osmo_stock_items, G_N_ELEMENTS (osmo_stock_items)); factory = gtk_icon_factory_new (); gtk_icon_factory_add_default(factory); for(i = 0; i < G_N_ELEMENTS(osmo_stock_item_data); i++) { pixbuf = gdk_pixbuf_new_from_inline(-1, osmo_stock_item_data[i], FALSE, NULL); icon_source = gtk_icon_source_new (); gtk_icon_source_set_pixbuf (icon_source, pixbuf); icon_set = gtk_icon_set_new (); gtk_icon_set_add_source (icon_set, icon_source); gtk_icon_factory_add(factory, osmo_stock_items[i].stock_id, icon_set); g_object_unref(pixbuf); gtk_icon_source_free (icon_source); gtk_icon_set_unref (icon_set); } g_object_unref (factory); }
/** * pixbuf_cache_register_stocks: register galeon icons with the gnome stock * system so people can theme our icons */ void gul_pixbuf_cache_register_stocks (void) { static gboolean done = FALSE; GtkIconFactory *factory; GtkIconSet *icon_set; GtkIconSource *icon_source; gint i; GtkStockItem items[] = { { GALEON_STOCK_SEPARATOR ,"_Separator", 0, 0, NULL }, { GALEON_STOCK_FOLDER ,"_Folder", 0, 0, NULL }, { GALEON_STOCK_DEFAULT ,"_Default", 0, 0, NULL }, { GALEON_STOCK_HISTORY ,"_History", 0, 0, NULL }, { GALEON_STOCK_FILTER ,"_Filter", 0, 0, NULL }, { GALEON_STOCK_POPUP_BLOCKED ,"_Popup blocked", 0, 0, NULL }, { GALEON_STOCK_SECURE ,"_Secure", 0, 0, NULL }, { GALEON_STOCK_INSECURE ,"_Insecure", 0, 0, NULL }, { GALEON_STOCK_DOWNLOAD ,"_Download", 0, 0, NULL }, { GALEON_STOCK_ENTRY ,"_Entry", 0, 0, NULL } }; const char * icon_theme_items[] = { STOCK_ZOOM, STOCK_NEW_TAB, STOCK_FULLSCREEN, STOCK_VIEW_SOURCE, STOCK_SEND_MAIL, STOCK_ADD_BOOKMARK, STOCK_SPINNER_REST, STOCK_SELECT_ALL, STOCK_EDIT_BOOKMARK, STOCK_CONNECT, STOCK_DISCONNECT, STOCK_LOCK_BROKEN }; if (done) { return; } done = TRUE; gtk_stock_add (items, G_N_ELEMENTS (items)); factory = gtk_icon_factory_new (); gtk_icon_factory_add_default (factory); for (i = 0; i < (gint) G_N_ELEMENTS (items); i++) { GdkPixbuf *pixbuf; gchar *fn; fn = g_strconcat (items[i].stock_id, ".png", NULL); pixbuf = gul_pixbuf_cache_get (fn); g_free (fn); icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); gtk_icon_factory_add (factory, items[i].stock_id, icon_set); gtk_icon_set_unref (icon_set); g_object_unref (G_OBJECT (pixbuf)); } for (i = 0; i < (int) G_N_ELEMENTS (icon_theme_items); i++) { icon_set = gtk_icon_set_new (); icon_source = gtk_icon_source_new (); gtk_icon_source_set_icon_name (icon_source, icon_theme_items[i]); gtk_icon_set_add_source (icon_set, icon_source); gtk_icon_factory_add (factory, icon_theme_items[i], icon_set); gtk_icon_set_unref (icon_set); gtk_icon_source_free (icon_source); } g_object_unref (G_OBJECT (factory)); }
/* generate application specific stock items */ void stock_icons_init(void) { GtkIconFactory * factory; gint32 i; GdkPixbuf * pixbuf; GtkIconSet *icon_set; /* register non-standard pixmaps with the gtk-stock engine */ static const GtkStockItem stock_items[] = { { WIRESHARK_STOCK_CAPTURE_INTERFACES, "_Interfaces", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_OPTIONS, "_Options", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_START, "_Start", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_STOP, "S_top", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_RESTART, "_Restart", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_FILTER, "_Capture Filter", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY, "_Capture Filter:", 0, 0, NULL }, { WIRESHARK_STOCK_CAPTURE_DETAILS, "_Details", 0, 0, NULL }, #ifdef HAVE_GEOIP { WIRESHARK_STOCK_MAP, "Map", 0, 0, NULL }, #endif { WIRESHARK_STOCK_FOLLOW_STREAM, "Follow Stream", 0, 0, NULL }, { WIRESHARK_STOCK_DISPLAY_FILTER, "Display _Filter", 0, 0, NULL }, { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY, "F_ilter:", 0, 0, NULL }, { WIRESHARK_STOCK_BROWSE, "_Browse...", 0, 0, NULL }, { WIRESHARK_STOCK_CREATE_STAT, "Create _Stat", 0, 0, NULL }, { WIRESHARK_STOCK_EXPORT, "_Export...", 0, 0, NULL }, { WIRESHARK_STOCK_IMPORT, "_Import...", 0, 0, NULL }, { WIRESHARK_STOCK_EDIT, "_Edit...", 0, 0, NULL }, { WIRESHARK_STOCK_ADD_EXPRESSION, "E_xpression..." , 0, 0, NULL }, /* plus sign coming from icon */ { WIRESHARK_STOCK_CLEAR_EXPRESSION, "Clea_r" , 0, 0, NULL }, { WIRESHARK_STOCK_APPLY_EXPRESSION, "App_ly" , 0, 0, NULL }, { WIRESHARK_STOCK_SAVE_ALL, "Save A_ll", 0, 0, NULL }, { WIRESHARK_STOCK_DONT_SAVE, "Continue _without Saving", 0, 0, NULL }, { WIRESHARK_STOCK_QUIT_DONT_SAVE, "Quit _without Saving", 0, 0, NULL }, { WIRESHARK_STOCK_STOP_DONT_SAVE, "Stop and Continue _without Saving", 0, 0, NULL }, { WIRESHARK_STOCK_STOP_QUIT_DONT_SAVE, "Stop and Quit _without Saving", 0, 0, NULL }, { WIRESHARK_STOCK_STOP_SAVE, "Stop and Save", 0, 0, NULL }, { WIRESHARK_STOCK_ABOUT, "_About", 0, 0, NULL }, { WIRESHARK_STOCK_COLORIZE, "_Colorize", 0, 0, NULL }, { WIRESHARK_STOCK_AUTOSCROLL, "_Auto Scroll", 0, 0, NULL }, { WIRESHARK_STOCK_RESIZE_COLUMNS, "Resize Columns", 0, 0, NULL }, { WIRESHARK_STOCK_TIME, "Time", 0, 0, NULL }, { WIRESHARK_STOCK_INTERNET, "Internet", 0, 0, NULL }, { WIRESHARK_STOCK_WEB_SUPPORT, "Web Support", 0, 0, NULL }, { WIRESHARK_STOCK_WIKI, "Wiki", 0, 0, NULL }, { WIRESHARK_STOCK_CONVERSATIONS, "Conversations", 0, 0, NULL }, { WIRESHARK_STOCK_ENDPOINTS, "Endpoints", 0, 0, NULL }, { WIRESHARK_STOCK_EXPERT_INFO, "Expert Info", 0, 0, NULL }, { WIRESHARK_STOCK_GRAPHS, "Graphs", 0, 0, NULL }, { WIRESHARK_STOCK_FLOW_GRAPH, "Flow Graph", 0, 0, NULL }, { WIRESHARK_STOCK_TELEPHONY, "Telephony", 0, 0, NULL }, { WIRESHARK_STOCK_DECODE_AS, "Decode As", 0, 0, NULL }, { WIRESHARK_STOCK_CHECKBOX, "Checkbox", 0, 0, NULL }, { WIRESHARK_STOCK_FILE_SET_LIST, "List Files", 0, 0, NULL }, { WIRESHARK_STOCK_FILE_SET_NEXT, "Next File", 0, 0, NULL }, { WIRESHARK_STOCK_FILE_SET_PREVIOUS, "Previous File", 0, 0, NULL }, { WIRESHARK_STOCK_FILTER_OUT_STREAM, "Filter Out This Stream", 0, 0, NULL }, { WIRESHARK_STOCK_ENABLE, "Enable", 0, 0, NULL }, { WIRESHARK_STOCK_DISABLE, "Disable", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR1, "Color 1", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR2, "Color 2", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR3, "Color 3", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR4, "Color 4", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR5, "Color 5", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR6, "Color 6", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR7, "Color 7", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR8, "Color 8", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR9, "Color 9", 0, 0, NULL }, { WIRESHARK_STOCK_COLOR0, "Color 10", 0, 0, NULL }, { WIRESHARK_STOCK_DECODE, "Decode", 0, 0, NULL }, { WIRESHARK_STOCK_AUDIO_PLAYER, "Player", 0, 0, NULL }, { WIRESHARK_STOCK_VOIP_FLOW, "Flow", 0, 0, NULL }, { WIRESHARK_STOCK_TELEPHONE, "Telephone", 0, 0, NULL }, { WIRESHARK_STOCK_PREPARE_FILTER, "Prepare Filter", 0, 0, NULL }, { WIRESHARK_STOCK_ANALYZE, "Analyze", 0, 0, NULL }, { WIRESHARK_STOCK_FILE, "File", 0, 0, NULL } }; static const stock_pixmap_t pixmaps[] = { { WIRESHARK_STOCK_CAPTURE_INTERFACES, capture_interfaces_24_xpm }, { WIRESHARK_STOCK_CAPTURE_OPTIONS, capture_options_24_xpm }, { WIRESHARK_STOCK_CAPTURE_START, capture_start_24_xpm }, { WIRESHARK_STOCK_CAPTURE_STOP, capture_stop_24_xpm }, { WIRESHARK_STOCK_CAPTURE_RESTART, capture_restart_24_xpm }, { WIRESHARK_STOCK_CAPTURE_FILTER, capture_filter_24_xpm }, { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY, capture_filter_24_xpm }, { WIRESHARK_STOCK_CAPTURE_DETAILS, capture_details_24_xpm }, #ifdef HAVE_GEOIP { WIRESHARK_STOCK_MAP, internet_24_xpm}, #endif { WIRESHARK_STOCK_DISPLAY_FILTER, display_filter_24_xpm }, { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY, display_filter_24_xpm }, { WIRESHARK_STOCK_ABOUT, wsicon16_xpm }, { WIRESHARK_STOCK_COLORIZE, colorize_24_xpm }, { WIRESHARK_STOCK_AUTOSCROLL, autoscroll_24_xpm }, { WIRESHARK_STOCK_RESIZE_COLUMNS, resize_columns_24_xpm}, { WIRESHARK_STOCK_TIME, time_24_xpm}, { WIRESHARK_STOCK_INTERNET, internet_24_xpm}, { WIRESHARK_STOCK_WEB_SUPPORT, web_support_24_xpm}, { WIRESHARK_STOCK_WIKI, wiki_24_xpm}, { WIRESHARK_STOCK_CONVERSATIONS, conversations_16_xpm}, { WIRESHARK_STOCK_ENDPOINTS, endpoints_16_xpm}, { WIRESHARK_STOCK_EXPERT_INFO, expert_info_16_xpm}, { WIRESHARK_STOCK_GRAPHS, graphs_16_xpm}, { WIRESHARK_STOCK_FLOW_GRAPH, flow_graph_16_xpm}, { WIRESHARK_STOCK_TELEPHONY, telephony_16_xpm}, { WIRESHARK_STOCK_DECODE_AS, decode_as_16_xpm}, { WIRESHARK_STOCK_CHECKBOX, checkbox_16_xpm}, { WIRESHARK_STOCK_FILE_SET_LIST, file_set_list_16_xpm}, { WIRESHARK_STOCK_FILE_SET_NEXT, file_set_next_16_xpm}, { WIRESHARK_STOCK_FILE_SET_PREVIOUS, file_set_previous_16_xpm}, { WIRESHARK_STOCK_FILTER_OUT_STREAM, display_filter_24_xpm}, { WIRESHARK_STOCK_ENABLE, checkbox_16_xpm}, { WIRESHARK_STOCK_COLOR1, icon_color_1_xpm}, { WIRESHARK_STOCK_COLOR2, icon_color_2_xpm}, { WIRESHARK_STOCK_COLOR3, icon_color_3_xpm}, { WIRESHARK_STOCK_COLOR4, icon_color_4_xpm}, { WIRESHARK_STOCK_COLOR5, icon_color_5_xpm}, { WIRESHARK_STOCK_COLOR6, icon_color_6_xpm}, { WIRESHARK_STOCK_COLOR7, icon_color_7_xpm}, { WIRESHARK_STOCK_COLOR8, icon_color_8_xpm}, { WIRESHARK_STOCK_COLOR9, icon_color_9_xpm}, { WIRESHARK_STOCK_COLOR0, icon_color_0_xpm}, { WIRESHARK_STOCK_DECODE, decode_24_xpm}, { WIRESHARK_STOCK_AUDIO_PLAYER, audio_player_24_xpm}, { WIRESHARK_STOCK_VOIP_FLOW, voip_flow_24_xpm}, { WIRESHARK_STOCK_TELEPHONE, telephone_16_xpm}, { WIRESHARK_STOCK_PREPARE_FILTER, display_filter_24_xpm}, { WIRESHARK_STOCK_ANALYZE, analyze_24_xpm}, { WIRESHARK_STOCK_FILE, WiresharkDoc_24_xpm}, { NULL, NULL } }; /* Register our stock items */ gtk_stock_add (stock_items, G_N_ELEMENTS (stock_items)); /* Add our custom icon factory to the list of defaults */ factory = gtk_icon_factory_new(); gtk_icon_factory_add_default(factory); /* Create the stock items to add into our icon factory */ for (i = 0; pixmaps[i].name != NULL; i++) { /* The default icon */ pixbuf = gdk_pixbuf_new_from_xpm_data((const char **) (pixmaps[i].xpm_data)); g_assert(pixbuf); icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); /* XXX - add different sized icons here (some 16*16 icons look a bit blurred) */ /*gtk_icon_set_add_source(icon_set, const GtkIconSource *source);*/ gtk_icon_factory_add (factory, pixmaps[i].name, icon_set); gtk_icon_set_unref (icon_set); g_object_unref (G_OBJECT (pixbuf)); } /* use default stock icons for Wireshark specifics where the icon metapher makes sense */ /* PLEASE DON'T REUSE STOCK ICONS IF THEY ARE USUALLY USED FOR SOME DIFFERENT MEANING!!!) */ icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_OPEN); gtk_icon_factory_add(factory, WIRESHARK_STOCK_BROWSE, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_OK); gtk_icon_factory_add(factory, WIRESHARK_STOCK_CREATE_STAT, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_SAVE); gtk_icon_factory_add(factory, WIRESHARK_STOCK_EXPORT, icon_set); /* XXX: needs a better icon */ icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_OPEN); gtk_icon_factory_add(factory, WIRESHARK_STOCK_IMPORT, icon_set); /* XXX: needs a better icon */ icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_PROPERTIES); gtk_icon_factory_add(factory, WIRESHARK_STOCK_EDIT, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_ADD); gtk_icon_factory_add(factory, WIRESHARK_STOCK_ADD_EXPRESSION, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_CLEAR); gtk_icon_factory_add(factory, WIRESHARK_STOCK_CLEAR_EXPRESSION, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_APPLY); gtk_icon_factory_add(factory, WIRESHARK_STOCK_APPLY_EXPRESSION, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_CLEAR); gtk_icon_factory_add(factory, WIRESHARK_STOCK_DONT_SAVE, icon_set); gtk_icon_factory_add(factory, WIRESHARK_STOCK_QUIT_DONT_SAVE, icon_set); gtk_icon_factory_add(factory, WIRESHARK_STOCK_STOP_DONT_SAVE, icon_set); gtk_icon_factory_add(factory, WIRESHARK_STOCK_STOP_QUIT_DONT_SAVE, icon_set); icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_SAVE); gtk_icon_factory_add(factory, WIRESHARK_STOCK_STOP_SAVE, icon_set); gtk_icon_factory_add(factory, WIRESHARK_STOCK_SAVE_ALL, icon_set); /* XXX: needs a better icon */ icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_CLOSE); gtk_icon_factory_add(factory, WIRESHARK_STOCK_DISABLE, icon_set); /* Drop our reference to the factory, GTK will hold a reference.*/ g_object_unref (G_OBJECT (factory)); }