-
-
-static void
-create_icon_factory (void)
-{
- gint c;
- GtkIconFactory *factory = gtk_icon_factory_new ();
- struct icon_context xx[2];
- xx[0] = action_icon_context;
- xx[1] = category_icon_context;
- for (c = 0 ; c < 2 ; ++c)
- {
- const struct icon_context *ic = &xx[c];
- gint i;
- for (i = 0 ; i < ic->n_icons ; ++i)
- {
- GtkIconSet *icon_set = gtk_icon_set_new ();
- int r;
- for (r = 0 ; r < sizeof (sizes) / sizeof (sizes[0]); ++r)
- {
- GtkIconSource *source = gtk_icon_source_new ();
- gchar *filename = g_strdup_printf ("%s/%s/%dx%d/%s.png", PKGDATADIR,
- ic->context_name,
- sizes[r].resolution, sizes[r].resolution,
- ic->icon_name[i]);
-
- gtk_icon_source_set_filename (source, filename);
- gtk_icon_source_set_size_wildcarded (source, FALSE);
- gtk_icon_source_set_size (source, sizes[r].size);
- g_free (filename);
- gtk_icon_set_add_source (icon_set, source);
- }
-
- gtk_icon_factory_add (factory, ic->icon_name[i], icon_set);
- }
- }
-
- {
- struct iconmap
- {
- const gchar *gtk_id;
- gchar *pspp_id;
- };
-
- /* We have our own icons for some things.
- But we want the Stock Item to be identical to the Gtk standard
- ones in all other respects.
- */
- const struct iconmap map[] = {
- {GTK_STOCK_NEW, "file-new-document"},
- {GTK_STOCK_QUIT, "file-quit"},
- {GTK_STOCK_SAVE, "file-save-document"},
- {GTK_STOCK_CUT, "edit-cut"},
- {GTK_STOCK_COPY, "edit-copy"},
- {GTK_STOCK_PASTE, "edit-paste"},
- {GTK_STOCK_ABOUT, "help-about"},
- {GTK_STOCK_PRINT, "file-print-document"}
- };
-
- GtkStockItem customised[sizeof (map) / sizeof (map[0])];
- int i;
-
- for (i = 0; i < sizeof (map) / sizeof (map[0]); ++i)
- {
- gtk_stock_lookup (map[i].gtk_id, &customised[i]);
- customised[i].stock_id = map[i].pspp_id;
- }
-
-
-
- gtk_stock_add (customised, sizeof (map) / sizeof (map[0]));
- }
-
- {
- /* Create our own "pspp-stock-reset" item, using the
- GTK_STOCK_REFRESH icon set */
- GtkStockItem items[2] = {
- {"pspp-stock-reset", N_("_Reset"), 0, 0, PACKAGE},
- {"pspp-stock-select", N_("_Select"), 0, 0, PACKAGE}
- };
-
- gtk_stock_add (items, 2);
-
- gtk_icon_factory_add (factory, "pspp-stock-reset",
- gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH)
- );
-
- gtk_icon_factory_add (factory, "pspp-stock-select",
- gtk_icon_factory_lookup_default (GTK_STOCK_INDEX)
- );
- }
-
- gtk_icon_factory_add_default (factory);
-}