[gimp] icons, libgimpwidgets: get rid of compiled-in icons



commit 306e81b11d7f36321b640817b403129a6272b61b
Author: Michael Natterer <mitch gimp org>
Date:   Tue May 20 02:13:28 2014 +0200

    icons, libgimpwidgets: get rid of compiled-in icons
    
    Register the stock icons with icon-name sources instead of inline
    pixbuf sources so they simply use the icon theme icons insatead of
    duplicating them.

 icons/.gitignore           |    3 +-
 icons/Makefile.am          |  252 ++++++++-----------
 libgimpwidgets/gimpstock.c |  590 ++++++--------------------------------------
 3 files changed, 176 insertions(+), 669 deletions(-)
---
diff --git a/icons/.gitignore b/icons/.gitignore
index fbf83a5..f1c3aa0 100644
--- a/icons/.gitignore
+++ b/icons/.gitignore
@@ -1,5 +1,4 @@
 /Makefile
 /Makefile.in
-/stock-icons.list
 /gimp-core-pixbufs.h
-/gimp-stock-pixbufs.h
+/gimp-icon-pixbufs.h
diff --git a/icons/Makefile.am b/icons/Makefile.am
index 829aab1..d63b92f 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -12,21 +12,12 @@ icons48dir = $(gimpdatadir)/icons/hicolor/48x48/apps
 icons64dir = $(gimpdatadir)/icons/hicolor/64x64/apps
 
 
-## A warning Wilber that is used from the core
-
-CORE_IMAGES = \
-       64/gimp-question.png
-
-CORE_VARIABLES = \
-       gimp_question_64 $(srcdir)/64/gimp-question.png
-
-
-## Compiled in stock icons
+## The icon theme images
 
 icons_DATA = \
        index.theme
 
-icons12_IMAGES = \
+icons12_DATA = \
        12/gimp-close.png                       \
        12/gimp-default-colors.png              \
        12/gimp-linked.png                      \
@@ -38,10 +29,7 @@ icons12_IMAGES = \
        12/gimp-visible.png                     \
        12/gimp-zoom-follow-window.png
 
-icons12_DATA = \
-       $(icons12_IMAGES)
-
-icons16_IMAGES = \
+icons16_DATA = \
        16/gimp-anchor.png                              \
        16/gimp-cap-butt.png                            \
        16/gimp-cap-round.png                           \
@@ -122,6 +110,26 @@ icons16_IMAGES = \
        16/gimp-paths.png                               \
        16/gimp-plugin.png                              \
        16/gimp-portrait.png                            \
+       16/gimp-prefs-folders-brushes.png               \
+       16/gimp-prefs-folders-dynamics.png              \
+       16/gimp-prefs-folders-environ.png               \
+       16/gimp-prefs-folders-fonts.png                 \
+       16/gimp-prefs-folders-gradients.png             \
+       16/gimp-prefs-folders-interp.png                \
+       16/gimp-prefs-folders-modules.png               \
+       16/gimp-prefs-folders-palettes.png              \
+       16/gimp-prefs-folders-patterns.png              \
+       16/gimp-prefs-folders-plug-ins.png              \
+       16/gimp-prefs-folders-scripts.png               \
+       16/gimp-prefs-folders-themes.png                \
+       16/gimp-prefs-folders-tool-plug-ins.png         \
+       16/gimp-prefs-folders-tool-presets.png          \
+       16/gimp-prefs-folders-tools.png                 \
+       16/gimp-prefs-image-windows.png                 \
+       16/gimp-prefs-interface.png                     \
+       16/gimp-prefs-theme.png                         \
+       16/gimp-prefs-toolbox.png                       \
+       16/gimp-prefs-window-management.png             \
        16/gimp-print-resolution.png                    \
        16/gimp-reset.png                               \
        16/gimp-reshow-filter.png                       \
@@ -206,48 +214,16 @@ icons16_IMAGES = \
        16/gimp-web.png                                 \
        16/gimp-wilber.png
 
-icons16_NOSTOCK_IMAGES = \
-       16/gimp-prefs-folders-brushes.png       \
-       16/gimp-prefs-folders-dynamics.png      \
-       16/gimp-prefs-folders-environ.png       \
-       16/gimp-prefs-folders-fonts.png         \
-       16/gimp-prefs-folders-gradients.png     \
-       16/gimp-prefs-folders-interp.png        \
-       16/gimp-prefs-folders-modules.png       \
-       16/gimp-prefs-folders-palettes.png      \
-       16/gimp-prefs-folders-patterns.png      \
-       16/gimp-prefs-folders-plug-ins.png      \
-       16/gimp-prefs-folders-scripts.png       \
-       16/gimp-prefs-folders-themes.png        \
-       16/gimp-prefs-folders-tool-plug-ins.png \
-       16/gimp-prefs-folders-tool-presets.png  \
-       16/gimp-prefs-folders-tools.png         \
-       16/gimp-prefs-image-windows.png         \
-       16/gimp-prefs-interface.png             \
-       16/gimp-prefs-theme.png                 \
-       16/gimp-prefs-toolbox.png               \
-       16/gimp-prefs-window-management.png
-
-icons16_DATA = \
-       $(icons16_IMAGES)                       \
-       $(icons16_NOSTOCK_IMAGES)
-
-icons18_IMAGES = \
+icons18_DATA = \
        18/gimp-color-picker-black.png          \
        18/gimp-color-picker-gray.png           \
        18/gimp-color-picker-white.png
 
-icons18_DATA = \
-       $(icons18_IMAGES)
-
-icons20_IMAGES = \
+icons20_DATA = \
        20/gimp-linked.png                      \
        20/gimp-visible.png
 
-icons20_DATA = \
-       $(icons20_IMAGES)
-
-icons22_IMAGES = \
+icons22_DATA = \
        22/gimp-char-picker.png                 \
        22/gimp-dynamics.png                    \
        22/gimp-gegl.png                        \
@@ -257,6 +233,38 @@ icons22_IMAGES = \
        22/gimp-line-spacing.png                \
        22/gimp-path.png                        \
        22/gimp-paths.png                       \
+       22/gimp-prefs-color-management.png      \
+       22/gimp-prefs-controllers.png           \
+       22/gimp-prefs-default-grid.png          \
+       22/gimp-prefs-display.png               \
+       22/gimp-prefs-environment.png           \
+       22/gimp-prefs-folders-brushes.png       \
+       22/gimp-prefs-folders-dynamics.png      \
+       22/gimp-prefs-folders-environ.png       \
+       22/gimp-prefs-folders-fonts.png         \
+       22/gimp-prefs-folders-gradients.png     \
+       22/gimp-prefs-folders-interp.png        \
+       22/gimp-prefs-folders-modules.png       \
+       22/gimp-prefs-folders-palettes.png      \
+       22/gimp-prefs-folders-patterns.png      \
+       22/gimp-prefs-folders-plug-ins.png      \
+       22/gimp-prefs-folders-scripts.png       \
+       22/gimp-prefs-folders-themes.png        \
+       22/gimp-prefs-folders-tool-plug-ins.png \
+       22/gimp-prefs-folders-tool-presets.png  \
+       22/gimp-prefs-folders-tools.png         \
+       22/gimp-prefs-folders.png               \
+       22/gimp-prefs-help-system.png           \
+       22/gimp-prefs-image-title.png           \
+       22/gimp-prefs-image-windows.png         \
+       22/gimp-prefs-input-devices.png         \
+       22/gimp-prefs-interface.png             \
+       22/gimp-prefs-new-image.png             \
+       22/gimp-prefs-session.png               \
+       22/gimp-prefs-theme.png                 \
+       22/gimp-prefs-tool-options.png          \
+       22/gimp-prefs-toolbox.png               \
+       22/gimp-prefs-window-management.png     \
        22/gimp-tool-airbrush.png               \
        22/gimp-tool-align.png                  \
        22/gimp-tool-blend.png                  \
@@ -305,45 +313,7 @@ icons22_IMAGES = \
        22/gimp-tool-zoom.png                   \
        22/gimp-wilber.png
 
-icons22_NOSTOCK_IMAGES = \
-       22/gimp-prefs-color-management.png      \
-       22/gimp-prefs-controllers.png           \
-       22/gimp-prefs-default-grid.png          \
-       22/gimp-prefs-display.png               \
-       22/gimp-prefs-environment.png           \
-       22/gimp-prefs-folders-brushes.png       \
-       22/gimp-prefs-folders-dynamics.png      \
-       22/gimp-prefs-folders-environ.png       \
-       22/gimp-prefs-folders-fonts.png         \
-       22/gimp-prefs-folders-gradients.png     \
-       22/gimp-prefs-folders-interp.png        \
-       22/gimp-prefs-folders-modules.png       \
-       22/gimp-prefs-folders-palettes.png      \
-       22/gimp-prefs-folders-patterns.png      \
-       22/gimp-prefs-folders-plug-ins.png      \
-       22/gimp-prefs-folders-scripts.png       \
-       22/gimp-prefs-folders-themes.png        \
-       22/gimp-prefs-folders-tool-plug-ins.png \
-       22/gimp-prefs-folders-tool-presets.png  \
-       22/gimp-prefs-folders-tools.png         \
-       22/gimp-prefs-folders.png               \
-       22/gimp-prefs-help-system.png           \
-       22/gimp-prefs-image-title.png           \
-       22/gimp-prefs-image-windows.png         \
-       22/gimp-prefs-input-devices.png         \
-       22/gimp-prefs-interface.png             \
-       22/gimp-prefs-new-image.png             \
-       22/gimp-prefs-session.png               \
-       22/gimp-prefs-theme.png                 \
-       22/gimp-prefs-tool-options.png          \
-       22/gimp-prefs-toolbox.png               \
-       22/gimp-prefs-window-management.png
-
-icons22_DATA = \
-       $(icons22_IMAGES)                       \
-       $(icons22_NOSTOCK_IMAGES)
-
-icons24_IMAGES = \
+icons24_DATA = \
        24/gimp-center.png                      \
        24/gimp-channel-alpha.png               \
        24/gimp-channel-blue.png                \
@@ -407,10 +377,7 @@ icons24_IMAGES = \
        24/gimp-warning.png                     \
        24/gimp-web.png
 
-icons24_DATA = \
-       $(icons24_IMAGES)
-
-icons32_IMAGES = \
+icons32_DATA = \
        32/gimp-channel-alpha.png       \
        32/gimp-channel-blue.png        \
        32/gimp-channel-gray.png        \
@@ -425,24 +392,18 @@ icons32_IMAGES = \
        32/gimp-text-layer.png          \
        32/gimp-user-manual.png
 
-icons32_DATA = \
-       $(icons32_IMAGES)
-
-icons48_IMAGES = \
-       48/gimp-channel-alpha.png       \
-       48/gimp-channel-blue.png        \
-       48/gimp-channel-gray.png        \
-       48/gimp-channel-green.png       \
-       48/gimp-channel-indexed.png     \
-       48/gimp-channel-red.png         \
-       48/gimp-channel.png             \
-       48/gimp-floating-selection.png  \
-       48/gimp-image.png               \
-       48/gimp-layer-mask.png          \
-       48/gimp-layer.png               \
-       48/gimp-text-layer.png
-
-icons48_NOSTOCK_IMAGES = \
+icons48_DATA = \
+       48/gimp-channel-alpha.png               \
+       48/gimp-channel-blue.png                \
+       48/gimp-channel-gray.png                \
+       48/gimp-channel-green.png               \
+       48/gimp-channel-indexed.png             \
+       48/gimp-channel-red.png                 \
+       48/gimp-channel.png                     \
+       48/gimp-floating-selection.png          \
+       48/gimp-image.png                       \
+       48/gimp-layer-mask.png                  \
+       48/gimp-layer.png                       \
        48/gimp-prefs-color-management.png      \
        48/gimp-prefs-controllers.png           \
        48/gimp-prefs-default-comment.png       \
@@ -476,12 +437,9 @@ icons48_NOSTOCK_IMAGES = \
        48/gimp-prefs-tool-options.png          \
        48/gimp-prefs-toolbox.png               \
        48/gimp-prefs-window-management.png
+       48/gimp-text-layer.png
 
-icons48_DATA = \
-       $(icons48_IMAGES)               \
-       $(icons48_NOSTOCK_IMAGES)
-
-icons64_IMAGES = \
+icons64_DATA = \
        64/gimp-error.png               \
        64/gimp-frame.png               \
        64/gimp-info.png                \
@@ -492,47 +450,45 @@ icons64_IMAGES = \
        64/gimp-wilber-eek.png          \
        64/gimp-wilber.png
 
-icons64_DATA = \
-       $(icons64_IMAGES)
 
-STOCK_IMAGES = \
-       $(icons12_IMAGES)       \
-       $(icons16_IMAGES)       \
-       $(icons18_IMAGES)       \
-       $(icons20_IMAGES)       \
-       $(icons22_IMAGES)       \
-       $(icons24_IMAGES)       \
-       $(icons32_IMAGES)       \
-       $(icons48_IMAGES)       \
-       $(icons64_IMAGES)
+## Compiled-in icons for both the core and libgimpwidgets
+
+CORE_IMAGES = \
+       64/gimp-question.png
+
+CORE_VARIABLES = \
+       gimp_question_64        $(srcdir)/64/gimp-question.png
+
+ICON_IMAGES = \
+       64/gimp-wilber-eek.png
+
+ICON_VARIABLES = \
+       gimp_wilber_eek_64      $(srcdir)/64/gimp-wilber-eek.png
 
-NOSTOCK_IMAGES = \
-       $(icons16_NOSTOCK_IMAGES)       \
-       $(icons48_NOSTOCK_IMAGES)       \
-       $(icons22_NOSTOCK_IMAGES)
 
 EXTRA_DIST = \
-       $(icons_DATA)           \
-       $(STOCK_IMAGES)         \
-       $(NOSTOCK_IMAGES)
+       $(icons_DATA)   \
+       $(icons12_DATA) \
+       $(icons16_DATA) \
+       $(icons18_DATA) \
+       $(icons20_DATA) \
+       $(icons22_DATA) \
+       $(icons24_DATA) \
+       $(icons32_DATA) \
+       $(icons48_DATA) \
+       $(icons64_DATA)
 
 noinst_DATA = \
        gimp-core-pixbufs.h     \
-       gimp-stock-pixbufs.h
-
-CLEANFILES = $(noinst_DATA) stock-icons.list
+       gimp-icon-pixbufs.h
 
+CLEANFILES = $(noinst_DATA)
 
-stock-icons.list: $(STOCK_IMAGES) Makefile.am
-       $(AM_V_GEN) ( rm -f $@; \
-          for image in $(STOCK_IMAGES); do \
-            echo $$image | \
-              sed -e 's|\(.*\)/\(.*\).png|\2-\1.png|' -e 's|-|_|g' -e 's|\.png$$||' >> $@; \
-           echo "  $(srcdir)/$$image" >> $@; \
-         done )
 
 gimp-core-pixbufs.h: $(CORE_IMAGES) Makefile.am
-       $(AM_V_GEN) $(GDK_PIXBUF_CSOURCE) --raw --build-list $(CORE_VARIABLES) > $(@F)
+       $(AM_V_GEN) $(GDK_PIXBUF_CSOURCE) \
+       --raw --build-list $(CORE_VARIABLES) > $(@F)
 
-gimp-stock-pixbufs.h: stock-icons.list
-       $(AM_V_GEN) $(GDK_PIXBUF_CSOURCE) --raw --build-list `cat $<` > $(@F)
+gimp-icon-pixbufs.h: $(ICON_IMAGES) Makefile.am
+       $(AM_V_GEN) $(GDK_PIXBUF_CSOURCE) \
+       --raw --build-list $(ICON_VARIABLES) > $(@F)
diff --git a/libgimpwidgets/gimpstock.c b/libgimpwidgets/gimpstock.c
index 53a98a5..95b2b47 100644
--- a/libgimpwidgets/gimpstock.c
+++ b/libgimpwidgets/gimpstock.c
@@ -27,7 +27,7 @@
 
 #include "gimpstock.h"
 
-#include "icons/gimp-stock-pixbufs.h"
+#include "icons/gimp-icon-pixbufs.h"
 
 #include "libgimp/libgimp-intl.h"
 
@@ -55,75 +55,6 @@
 static GtkIconFactory *gimp_stock_factory = NULL;
 
 
-static void
-icon_set_from_inline (GtkIconSet       *set,
-                      const guchar     *inline_data,
-                      GtkIconSize       size,
-                      GtkTextDirection  direction,
-                      gboolean          fallback)
-{
-  GtkIconSource *source;
-  GdkPixbuf     *pixbuf;
-
-  source = gtk_icon_source_new ();
-
-  if (direction != GTK_TEXT_DIR_NONE)
-    {
-      gtk_icon_source_set_direction (source, direction);
-      gtk_icon_source_set_direction_wildcarded (source, FALSE);
-    }
-
-  gtk_icon_source_set_size (source, size);
-  gtk_icon_source_set_size_wildcarded (source, FALSE);
-
-  pixbuf = gdk_pixbuf_new_from_inline (-1, inline_data, FALSE, NULL);
-
-  g_assert (pixbuf);
-
-  gtk_icon_source_set_pixbuf (source, pixbuf);
-
-  g_object_unref (pixbuf);
-
-  gtk_icon_set_add_source (set, source);
-
-  if (fallback)
-    {
-      gtk_icon_source_set_size_wildcarded (source, TRUE);
-      gtk_icon_set_add_source (set, source);
-    }
-
-  gtk_icon_source_free (source);
-}
-
-static void
-add_sized_with_same_fallback (GtkIconFactory *factory,
-                              const guchar   *inline_data,
-                              const guchar   *inline_data_rtl,
-                              GtkIconSize     size,
-                              const gchar    *stock_id)
-{
-  GtkIconSet *set;
-  gboolean    fallback = FALSE;
-
-  set = gtk_icon_factory_lookup (factory, stock_id);
-
-  if (! set)
-    {
-      set = gtk_icon_set_new ();
-      gtk_icon_factory_add (factory, stock_id, set);
-      gtk_icon_set_unref (set);
-
-      fallback = TRUE;
-    }
-
-  icon_set_from_inline (set, inline_data, size, GTK_TEXT_DIR_NONE, fallback);
-
-  if (inline_data_rtl)
-    icon_set_from_inline (set,
-                          inline_data_rtl, size, GTK_TEXT_DIR_RTL, fallback);
-}
-
-
 static const GtkStockItem gimp_stock_items[] =
 {
   { GIMP_STOCK_ANCHOR,         N_("Anchor"),          0, 0, LIBGIMP_DOMAIN },
@@ -239,7 +170,6 @@ static const GtkStockItem gimp_stock_items[] =
   { GIMP_STOCK_PATH,                     NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_TEMPLATE,                 NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_COLORMAP,                 NULL,        0, 0, LIBGIMP_DOMAIN },
-  { "gimp-indexed-palette", /* compat */ NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_HISTOGRAM,                NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_HISTOGRAM_LINEAR,         NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_HISTOGRAM_LOGARITHMIC,    NULL,        0, 0, LIBGIMP_DOMAIN },
@@ -255,8 +185,6 @@ static const GtkStockItem gimp_stock_items[] =
   { GIMP_STOCK_NAVIGATION,               NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_QUICK_MASK_OFF,           NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_QUICK_MASK_ON,            NULL,        0, 0, LIBGIMP_DOMAIN },
-  { "gimp-qmask-off", /* compat */       NULL,        0, 0, LIBGIMP_DOMAIN },
-  { "gimp-qmask-on",  /* compat */       NULL,        0, 0, LIBGIMP_DOMAIN },
 
   { GIMP_STOCK_CONTROLLER,               NULL,        0, 0, LIBGIMP_DOMAIN },
   { GIMP_STOCK_CONTROLLER_KEYBOARD,      NULL,        0, 0, LIBGIMP_DOMAIN },
@@ -353,421 +281,66 @@ static const GtkStockItem gimp_stock_items[] =
   { GIMP_STOCK_TOOL_ZOOM,                NULL,        0, 0, LIBGIMP_DOMAIN }
 };
 
-static const struct
+static const GtkStockItem gimp_compat_stock_items[] =
 {
-  const gchar   *stock_id;
-  gconstpointer  inline_data;
-}
-gimp_stock_button_pixbufs[] =
-{
-  { GIMP_STOCK_ANCHOR,                   gimp_anchor_16                   },
-  { GIMP_STOCK_CENTER,                   gimp_center_24                   },
-  { GIMP_STOCK_DUPLICATE,                gimp_duplicate_16                },
-  { GIMP_STOCK_EDIT,                     gimp_edit_16                     },
-  { GIMP_STOCK_PASTE_AS_NEW,             gimp_paste_as_new_16             },
-  { GIMP_STOCK_PASTE_INTO,               gimp_paste_into_16               },
-  { GIMP_STOCK_RESET,                    gimp_reset_16                    },
-
-  { GIMP_STOCK_GRAVITY_EAST,             gimp_gravity_east_24             },
-  { GIMP_STOCK_GRAVITY_NORTH,            gimp_gravity_north_24            },
-  { GIMP_STOCK_GRAVITY_NORTH_EAST,       gimp_gravity_north_east_24       },
-  { GIMP_STOCK_GRAVITY_NORTH_WEST,       gimp_gravity_north_west_24       },
-  { GIMP_STOCK_GRAVITY_SOUTH,            gimp_gravity_south_24            },
-  { GIMP_STOCK_GRAVITY_SOUTH_EAST,       gimp_gravity_south_east_24       },
-  { GIMP_STOCK_GRAVITY_SOUTH_WEST,       gimp_gravity_south_west_24       },
-  { GIMP_STOCK_GRAVITY_WEST,             gimp_gravity_west_24             },
-
-  { GIMP_STOCK_HCENTER,                  gimp_hcenter_24                  },
-  { GIMP_STOCK_VCENTER,                  gimp_vcenter_24                  },
-
-  { GIMP_STOCK_HFILL,                    gimp_hfill_24                    },
-  { GIMP_STOCK_VFILL,                    gimp_vfill_24                    },
-
-  { GIMP_STOCK_HCHAIN,                   gimp_hchain_24                   },
-  { GIMP_STOCK_HCHAIN_BROKEN,            gimp_hchain_broken_24            },
-  { GIMP_STOCK_VCHAIN,                   gimp_vchain_24                   },
-  { GIMP_STOCK_VCHAIN_BROKEN,            gimp_vchain_broken_24            },
-
-  { GIMP_STOCK_SELECTION,                gimp_selection_16                },
-  { GIMP_STOCK_SELECTION_REPLACE,        gimp_selection_replace_16        },
-  { GIMP_STOCK_SELECTION_ADD,            gimp_selection_add_16            },
-  { GIMP_STOCK_SELECTION_SUBTRACT,       gimp_selection_subtract_16       },
-  { GIMP_STOCK_SELECTION_INTERSECT,      gimp_selection_intersect_16      },
-  { GIMP_STOCK_SELECTION_STROKE,         gimp_selection_stroke_16         },
-  { GIMP_STOCK_SELECTION_TO_CHANNEL,     gimp_selection_to_channel_16     },
-  { GIMP_STOCK_SELECTION_TO_PATH,        gimp_selection_to_path_16        },
-
-  { GIMP_STOCK_PATH_STROKE,              gimp_path_stroke_16              },
-
-  { GIMP_STOCK_CURVE_FREE,               gimp_curve_free_16               },
-  { GIMP_STOCK_CURVE_SMOOTH,             gimp_curve_smooth_16             },
-
-  { GIMP_STOCK_COLOR_PICKER_BLACK,       gimp_color_picker_black_18       },
-  { GIMP_STOCK_COLOR_PICKER_GRAY,        gimp_color_picker_gray_18        },
-  { GIMP_STOCK_COLOR_PICKER_WHITE,       gimp_color_picker_white_18       },
-  { GIMP_STOCK_COLOR_TRIANGLE,           gimp_color_triangle_16           },
-  { GIMP_STOCK_COLOR_PICK_FROM_SCREEN,   gimp_color_pick_from_screen_16   },
-
-  { GIMP_STOCK_CHAR_PICKER,              gimp_char_picker_22              },
-  { GIMP_STOCK_LETTER_SPACING,           gimp_letter_spacing_22           },
-  { GIMP_STOCK_LINE_SPACING,             gimp_line_spacing_22             },
-  { GIMP_STOCK_TEXT_DIR_LTR,             gimp_text_dir_ltr_24             },
-  { GIMP_STOCK_TEXT_DIR_RTL,             gimp_text_dir_rtl_24             },
-  { GIMP_STOCK_PRINT_RESOLUTION,         gimp_print_resolution_24         },
-
-  { GIMP_STOCK_IMAGES,                   gimp_images_24                   },
-  { GIMP_STOCK_LAYERS,                   gimp_layers_24                   },
-  { GIMP_STOCK_CHANNELS,                 gimp_channels_24                 },
-  { GIMP_STOCK_PATHS,                    gimp_paths_22                    },
-  { GIMP_STOCK_TOOLS,                    gimp_tools_24                    },
-  { GIMP_STOCK_TOOL_OPTIONS,             gimp_tool_options_24             },
-  { GIMP_STOCK_DEVICE_STATUS,            gimp_device_status_24            },
-  { GIMP_STOCK_INPUT_DEVICE,             gimp_input_device_22             },
-  { GIMP_STOCK_CURSOR,                   gimp_cursor_24                   },
-  { GIMP_STOCK_SAMPLE_POINT,             gimp_sample_point_24             },
-  { GIMP_STOCK_DYNAMICS,                 gimp_dynamics_22                 },
-  { GIMP_STOCK_TOOL_PRESET,              gimp_tool_preset_22              },
-
-  { GIMP_STOCK_CONTROLLER,               gimp_controller_24               },
-  { GIMP_STOCK_CONTROLLER_KEYBOARD,      gimp_controller_keyboard_24      },
-  { GIMP_STOCK_CONTROLLER_LINUX_INPUT,   gimp_controller_linux_input_24   },
-  { GIMP_STOCK_CONTROLLER_MIDI,          gimp_controller_midi_24          },
-  { GIMP_STOCK_CONTROLLER_WHEEL,         gimp_controller_wheel_24         },
-
-  { GIMP_STOCK_DISPLAY_FILTER,            gimp_display_filter_24            },
-  { GIMP_STOCK_DISPLAY_FILTER_COLORBLIND, gimp_display_filter_colorblind_24 },
-  { GIMP_STOCK_DISPLAY_FILTER_CONTRAST,   gimp_display_filter_contrast_24   },
-  { GIMP_STOCK_DISPLAY_FILTER_GAMMA,      gimp_display_filter_gamma_24      },
-  { GIMP_STOCK_DISPLAY_FILTER_LCMS,       gimp_display_filter_lcms_24       },
-  { GIMP_STOCK_DISPLAY_FILTER_PROOF,      gimp_display_filter_proof_24      },
-
-  { GIMP_STOCK_CHANNEL,                  gimp_channel_24                  },
-  { GIMP_STOCK_CHANNEL_RED,              gimp_channel_red_24              },
-  { GIMP_STOCK_CHANNEL_GREEN,            gimp_channel_green_24            },
-  { GIMP_STOCK_CHANNEL_BLUE,             gimp_channel_blue_24             },
-  { GIMP_STOCK_CHANNEL_GRAY,             gimp_channel_gray_24             },
-  { GIMP_STOCK_CHANNEL_INDEXED,          gimp_channel_indexed_24          },
-  { GIMP_STOCK_CHANNEL_ALPHA,            gimp_channel_alpha_24            },
-  { GIMP_STOCK_LAYER_MASK,               gimp_layer_mask_24               },
-  { GIMP_STOCK_IMAGE,                    gimp_image_24                    },
-  { GIMP_STOCK_LAYER,                    gimp_layer_24                    },
-  { GIMP_STOCK_TEXT_LAYER,               gimp_text_layer_24               },
-  { GIMP_STOCK_FLOATING_SELECTION,       gimp_floating_selection_24       },
-  { GIMP_STOCK_PATH,                     gimp_path_22                     },
-  { GIMP_STOCK_TEMPLATE,                 gimp_template_24                 },
-  { GIMP_STOCK_COLORMAP,                 gimp_colormap_24                 },
-  { "gimp-indexed-palette", /* compat */ gimp_colormap_24                 },
-  { GIMP_STOCK_HISTOGRAM,                gimp_histogram_22                },
-  { GIMP_STOCK_UNDO_HISTORY,             gimp_undo_history_24             },
-  { GIMP_STOCK_TRANSPARENCY,             gimp_transparency_24             },
-
-  { GIMP_STOCK_LINKED,                   gimp_linked_20                   },
-  { GIMP_STOCK_VISIBLE,                  gimp_visible_20                  },
-
-  { GIMP_STOCK_MOVE_TO_SCREEN,           gimp_move_to_screen_24           },
-
-  { GIMP_STOCK_TOOL_AIRBRUSH,            gimp_tool_airbrush_22            },
-  { GIMP_STOCK_TOOL_ALIGN,               gimp_tool_align_22               },
-  { GIMP_STOCK_TOOL_BLEND,               gimp_tool_blend_22               },
-  { GIMP_STOCK_TOOL_BLUR,                gimp_tool_blur_22                },
-  { GIMP_STOCK_TOOL_BRIGHTNESS_CONTRAST, gimp_tool_brightness_contrast_22 },
-  { GIMP_STOCK_TOOL_BUCKET_FILL,         gimp_tool_bucket_fill_22         },
-  { GIMP_STOCK_TOOL_BY_COLOR_SELECT,     gimp_tool_by_color_select_22     },
-  { GIMP_STOCK_TOOL_CAGE,                gimp_tool_cage_22                },
-  { GIMP_STOCK_TOOL_CLONE,               gimp_tool_clone_22               },
-  { GIMP_STOCK_TOOL_COLOR_BALANCE,       gimp_tool_color_balance_22       },
-  { GIMP_STOCK_TOOL_COLOR_PICKER,        gimp_tool_color_picker_22        },
-  { GIMP_STOCK_TOOL_COLORIZE,            gimp_tool_colorize_22            },
-  { GIMP_STOCK_TOOL_CROP,                gimp_tool_crop_22                },
-  { GIMP_STOCK_TOOL_CURVES,              gimp_tool_curves_22              },
-  { GIMP_STOCK_TOOL_DESATURATE,          gimp_tool_desaturate_22          },
-  { GIMP_STOCK_TOOL_DODGE,               gimp_tool_dodge_22               },
-  { GIMP_STOCK_TOOL_ELLIPSE_SELECT,      gimp_tool_ellipse_select_22      },
-  { GIMP_STOCK_TOOL_ERASER,              gimp_tool_eraser_22              },
-  { GIMP_STOCK_TOOL_FLIP,                gimp_tool_flip_22                },
-  { GIMP_STOCK_TOOL_FREE_SELECT,         gimp_tool_free_select_22         },
-  { GIMP_STOCK_TOOL_FOREGROUND_SELECT,   gimp_tool_foreground_select_22   },
-  { GIMP_STOCK_TOOL_FUZZY_SELECT,        gimp_tool_fuzzy_select_22        },
-  { GIMP_STOCK_TOOL_HEAL,                gimp_tool_heal_22                },
-  { GIMP_STOCK_TOOL_HUE_SATURATION,      gimp_tool_hue_saturation_22      },
-  { GIMP_STOCK_TOOL_INK,                 gimp_tool_ink_22                 },
-  { GIMP_STOCK_TOOL_ISCISSORS,           gimp_tool_iscissors_22           },
-  { GIMP_STOCK_TOOL_LEVELS,              gimp_tool_levels_22              },
-  { GIMP_STOCK_TOOL_MEASURE,             gimp_tool_measure_22             },
-  { GIMP_STOCK_TOOL_MOVE,                gimp_tool_move_22                },
-  { GIMP_STOCK_TOOL_PAINTBRUSH,          gimp_tool_paintbrush_22          },
-  { GIMP_STOCK_TOOL_PATH,                gimp_tool_path_22                },
-  { GIMP_STOCK_TOOL_PENCIL,              gimp_tool_pencil_22              },
-  { GIMP_STOCK_TOOL_PERSPECTIVE,         gimp_tool_perspective_22         },
-  { GIMP_STOCK_TOOL_PERSPECTIVE_CLONE,   gimp_tool_perspective_clone_22   },
-  { GIMP_STOCK_TOOL_POSTERIZE,           gimp_tool_posterize_22           },
-  { GIMP_STOCK_TOOL_RECT_SELECT,         gimp_tool_rect_select_22         },
-  { GIMP_STOCK_TOOL_ROTATE,              gimp_tool_rotate_22              },
-  { GIMP_STOCK_TOOL_SCALE,               gimp_tool_scale_22               },
-  { GIMP_STOCK_TOOL_SEAMLESS_CLONE,      gimp_tool_clone_22               },
-  { GIMP_STOCK_TOOL_SHEAR,               gimp_tool_shear_22               },
-  { GIMP_STOCK_TOOL_SMUDGE,              gimp_tool_smudge_22              },
-  { GIMP_STOCK_TOOL_TEXT,                gimp_tool_text_22                },
-  { GIMP_STOCK_TOOL_THRESHOLD,           gimp_tool_threshold_22           },
-  { GIMP_STOCK_TOOL_UNIFIED_TRANSFORM,   gimp_tool_unified_transform_22   },
-  { GIMP_STOCK_TOOL_WARP,                gimp_tool_warp_22                },
-  { GIMP_STOCK_TOOL_ZOOM,                gimp_tool_zoom_22                },
-
-  { GIMP_STOCK_INFO,                     gimp_info_24                     },
-  { GIMP_STOCK_WARNING,                  gimp_warning_24                  },
-  { GIMP_TOILET_PAPER,                   gimp_toilet_paper_24             },
-  { GIMP_STOCK_WEB,                      gimp_web_24                      },
-  { GIMP_STOCK_WILBER,                   gimp_wilber_22                   },
-  { GIMP_STOCK_VIDEO,                    gimp_video_24                    },
-  { GIMP_STOCK_GEGL,                     gimp_gegl_22                     }
+  { "gimp-indexed-palette", NULL, 0, 0, LIBGIMP_DOMAIN },
+  { "gimp-qmask-off",       NULL, 0, 0, LIBGIMP_DOMAIN },
+  { "gimp-qmask-on",        NULL, 0, 0, LIBGIMP_DOMAIN }
 };
 
-static const struct
-{
-  const gchar   *stock_id;
-  gconstpointer  inline_data;
-}
-gimp_stock_menu_pixbufs[] =
-{
-  { GIMP_STOCK_CENTER,                   gimp_center_16                   },
-
-  { GIMP_STOCK_CONVERT_RGB,              gimp_convert_rgb_16              },
-  { GIMP_STOCK_CONVERT_GRAYSCALE,        gimp_convert_grayscale_16        },
-  { GIMP_STOCK_CONVERT_INDEXED,          gimp_convert_indexed_16          },
-  { GIMP_STOCK_INVERT,                   gimp_invert_16                   },
-  { GIMP_STOCK_MERGE_DOWN,               gimp_merge_down_16               },
-  { GIMP_STOCK_LAYER_TO_IMAGESIZE,       gimp_layer_to_imagesize_16       },
-  { GIMP_STOCK_PLUGIN,                   gimp_plugin_16                   },
-  { GIMP_STOCK_RESHOW_FILTER,            gimp_reshow_filter_16            },
-  { GIMP_STOCK_ROTATE_90,                gimp_rotate_90_16                },
-  { GIMP_STOCK_ROTATE_180,               gimp_rotate_180_16               },
-  { GIMP_STOCK_ROTATE_270,               gimp_rotate_270_16               },
-  { GIMP_STOCK_RESIZE,                   gimp_resize_16                   },
-  { GIMP_STOCK_SCALE,                    gimp_scale_16                    },
-  { GIMP_STOCK_FLIP_HORIZONTAL,          gimp_flip_horizontal_16          },
-  { GIMP_STOCK_FLIP_VERTICAL,            gimp_flip_vertical_16            },
-
-  { GIMP_STOCK_PRINT_RESOLUTION,         gimp_print_resolution_16         },
-
-  { GIMP_STOCK_IMAGES,                   gimp_images_16                   },
-  { GIMP_STOCK_LAYERS,                   gimp_layers_16                   },
-  { GIMP_STOCK_CHANNELS,                 gimp_channels_16                 },
-  { GIMP_STOCK_PATHS,                    gimp_paths_16                    },
-  { GIMP_STOCK_TOOLS,                    gimp_tools_16                    },
-  { GIMP_STOCK_TOOL_OPTIONS,             gimp_tool_options_16             },
-  { GIMP_STOCK_DEVICE_STATUS,            gimp_device_status_16            },
-  { GIMP_STOCK_INPUT_DEVICE,             gimp_input_device_16             },
-  { GIMP_STOCK_CURSOR,                   gimp_cursor_16                   },
-  { GIMP_STOCK_SAMPLE_POINT,             gimp_sample_point_16             },
-  { GIMP_STOCK_DYNAMICS,                 gimp_dynamics_16                 },
-  { GIMP_STOCK_TOOL_PRESET,              gimp_tool_preset_16              },
-
-  { GIMP_STOCK_CONTROLLER,               gimp_controller_16               },
-  { GIMP_STOCK_CONTROLLER_KEYBOARD,      gimp_controller_keyboard_16      },
-  { GIMP_STOCK_CONTROLLER_LINUX_INPUT,   gimp_controller_linux_input_16   },
-  { GIMP_STOCK_CONTROLLER_MIDI,          gimp_controller_midi_16          },
-  { GIMP_STOCK_CONTROLLER_WHEEL,         gimp_controller_wheel_16         },
-
-  { GIMP_STOCK_DISPLAY_FILTER,            gimp_display_filter_16            },
-  { GIMP_STOCK_DISPLAY_FILTER_COLORBLIND, gimp_display_filter_colorblind_16 },
-  { GIMP_STOCK_DISPLAY_FILTER_CONTRAST,   gimp_display_filter_contrast_16   },
-  { GIMP_STOCK_DISPLAY_FILTER_GAMMA,      gimp_display_filter_gamma_16      },
-  { GIMP_STOCK_DISPLAY_FILTER_LCMS,       gimp_display_filter_lcms_16       },
-  { GIMP_STOCK_DISPLAY_FILTER_PROOF,      gimp_display_filter_proof_16      },
-
-  { GIMP_STOCK_CHANNEL,                  gimp_channel_16                  },
-  { GIMP_STOCK_CHANNEL_RED,              gimp_channel_red_16              },
-  { GIMP_STOCK_CHANNEL_GREEN,            gimp_channel_green_16            },
-  { GIMP_STOCK_CHANNEL_BLUE,             gimp_channel_blue_16             },
-  { GIMP_STOCK_CHANNEL_GRAY,             gimp_channel_gray_16             },
-  { GIMP_STOCK_CHANNEL_INDEXED,          gimp_channel_indexed_16          },
-  { GIMP_STOCK_CHANNEL_ALPHA,            gimp_channel_alpha_16            },
-  { GIMP_STOCK_LAYER_MASK,               gimp_layer_mask_16               },
-  { GIMP_STOCK_IMAGE,                    gimp_image_16                    },
-  { GIMP_STOCK_LAYER,                    gimp_layer_16                    },
-  { GIMP_STOCK_TEXT_LAYER,               gimp_text_layer_16               },
-  { GIMP_STOCK_FLOATING_SELECTION,       gimp_floating_selection_16       },
-  { GIMP_STOCK_PATH,                     gimp_path_16                     },
-  { GIMP_STOCK_TEMPLATE,                 gimp_template_16                 },
-  { GIMP_STOCK_COLORMAP,                 gimp_colormap_16                 },
-  { "gimp-indexed-palette", /* compat */ gimp_colormap_16                 },
-  { GIMP_STOCK_HISTOGRAM,                gimp_histogram_16                },
-  { GIMP_STOCK_HISTOGRAM_LINEAR,         gimp_histogram_linear_16         },
-  { GIMP_STOCK_HISTOGRAM_LOGARITHMIC,    gimp_histogram_logarithmic_16    },
-  { GIMP_STOCK_UNDO_HISTORY,             gimp_undo_history_16             },
-  { GIMP_STOCK_TRANSPARENCY,             gimp_transparency_16             },
-
-  { GIMP_STOCK_LINKED,                   gimp_linked_12                   },
-  { GIMP_STOCK_VISIBLE,                  gimp_visible_12                  },
-
-  { GIMP_STOCK_SELECTION_ALL,            gimp_selection_all_16            },
-  { GIMP_STOCK_SELECTION_NONE,           gimp_selection_none_16           },
-  { GIMP_STOCK_SELECTION_GROW,           gimp_selection_grow_16           },
-  { GIMP_STOCK_SELECTION_SHRINK,         gimp_selection_shrink_16         },
-  { GIMP_STOCK_SELECTION_BORDER,         gimp_selection_border_16         },
-
-  { GIMP_STOCK_NAVIGATION,               gimp_navigation_16               },
-  { GIMP_STOCK_QUICK_MASK_OFF,           gimp_quick_mask_off_12           },
-  { GIMP_STOCK_QUICK_MASK_ON,            gimp_quick_mask_on_12            },
-  { "gimp-qmask-off", /* compat */       gimp_quick_mask_off_12           },
-  { "gimp-qmask-on",  /* compat */       gimp_quick_mask_on_12            },
-
-  { GIMP_STOCK_LIST,                     gimp_list_16                     },
-  { GIMP_STOCK_GRID,                     gimp_grid_16                     },
-
-  { GIMP_STOCK_PORTRAIT,                 gimp_portrait_16                 },
-  { GIMP_STOCK_LANDSCAPE,                gimp_landscape_16                },
-
-  { GIMP_STOCK_CLOSE,                    gimp_close_12                    },
-  { GIMP_STOCK_MOVE_TO_SCREEN,           gimp_move_to_screen_16           },
-  { GIMP_STOCK_DEFAULT_COLORS,           gimp_default_colors_12           },
-  { GIMP_STOCK_SWAP_COLORS,              gimp_swap_colors_12              },
-  { GIMP_STOCK_ZOOM_FOLLOW_WINDOW,       gimp_zoom_follow_window_12       },
-
-  { GIMP_STOCK_GRADIENT_LINEAR,               gimp_gradient_linear_16               },
-  { GIMP_STOCK_GRADIENT_BILINEAR,             gimp_gradient_bilinear_16             },
-  { GIMP_STOCK_GRADIENT_RADIAL,               gimp_gradient_radial_16               },
-  { GIMP_STOCK_GRADIENT_SQUARE,               gimp_gradient_square_16               },
-  { GIMP_STOCK_GRADIENT_CONICAL_SYMMETRIC,    gimp_gradient_conical_symmetric_16    },
-  { GIMP_STOCK_GRADIENT_CONICAL_ASYMMETRIC,   gimp_gradient_conical_asymmetric_16   },
-  { GIMP_STOCK_GRADIENT_SHAPEBURST_ANGULAR,   gimp_gradient_shapeburst_angular_16   },
-  { GIMP_STOCK_GRADIENT_SHAPEBURST_SPHERICAL, gimp_gradient_shapeburst_spherical_16 },
-  { GIMP_STOCK_GRADIENT_SHAPEBURST_DIMPLED,   gimp_gradient_shapeburst_dimpled_16   },
-  { GIMP_STOCK_GRADIENT_SPIRAL_CLOCKWISE,     gimp_gradient_spiral_clockwise_16     },
-  { GIMP_STOCK_GRADIENT_SPIRAL_ANTICLOCKWISE, gimp_gradient_spiral_anticlockwise_16 },
-
-  { GIMP_STOCK_TOOL_AIRBRUSH,            gimp_tool_airbrush_16            },
-  { GIMP_STOCK_TOOL_ALIGN,               gimp_tool_align_16               },
-  { GIMP_STOCK_TOOL_BLEND,               gimp_tool_blend_16               },
-  { GIMP_STOCK_TOOL_BLUR,                gimp_tool_blur_16                },
-  { GIMP_STOCK_TOOL_BRIGHTNESS_CONTRAST, gimp_tool_brightness_contrast_16 },
-  { GIMP_STOCK_TOOL_BUCKET_FILL,         gimp_tool_bucket_fill_16         },
-  { GIMP_STOCK_TOOL_BY_COLOR_SELECT,     gimp_tool_by_color_select_16     },
-  { GIMP_STOCK_TOOL_CAGE,                gimp_tool_cage_16                },
-  { GIMP_STOCK_TOOL_CLONE,               gimp_tool_clone_16               },
-  { GIMP_STOCK_TOOL_COLOR_BALANCE,       gimp_tool_color_balance_16       },
-  { GIMP_STOCK_TOOL_COLOR_PICKER,        gimp_tool_color_picker_16        },
-  { GIMP_STOCK_TOOL_COLORIZE,            gimp_tool_colorize_16            },
-  { GIMP_STOCK_TOOL_CROP,                gimp_tool_crop_16                },
-  { GIMP_STOCK_TOOL_CURVES,              gimp_tool_curves_16              },
-  { GIMP_STOCK_TOOL_DESATURATE,          gimp_tool_desaturate_16          },
-  { GIMP_STOCK_TOOL_DODGE,               gimp_tool_dodge_16               },
-  { GIMP_STOCK_TOOL_ELLIPSE_SELECT,      gimp_tool_ellipse_select_16      },
-  { GIMP_STOCK_TOOL_ERASER,              gimp_tool_eraser_16              },
-  { GIMP_STOCK_TOOL_FLIP,                gimp_tool_flip_16                },
-  { GIMP_STOCK_TOOL_FREE_SELECT,         gimp_tool_free_select_16         },
-  { GIMP_STOCK_TOOL_FOREGROUND_SELECT,   gimp_tool_foreground_select_16   },
-  { GIMP_STOCK_TOOL_FUZZY_SELECT,        gimp_tool_fuzzy_select_16        },
-  { GIMP_STOCK_TOOL_HEAL,                gimp_tool_heal_16                },
-  { GIMP_STOCK_TOOL_HUE_SATURATION,      gimp_tool_hue_saturation_16      },
-  { GIMP_STOCK_TOOL_INK,                 gimp_tool_ink_16                 },
-  { GIMP_STOCK_TOOL_ISCISSORS,           gimp_tool_iscissors_16           },
-  { GIMP_STOCK_TOOL_LEVELS,              gimp_tool_levels_16              },
-  { GIMP_STOCK_TOOL_MEASURE,             gimp_tool_measure_16             },
-  { GIMP_STOCK_TOOL_MOVE,                gimp_tool_move_16                },
-  { GIMP_STOCK_TOOL_PAINTBRUSH,          gimp_tool_paintbrush_16          },
-  { GIMP_STOCK_TOOL_PATH,                gimp_tool_path_16                },
-  { GIMP_STOCK_TOOL_PENCIL,              gimp_tool_pencil_16              },
-  { GIMP_STOCK_TOOL_PERSPECTIVE,         gimp_tool_perspective_16         },
-  { GIMP_STOCK_TOOL_PERSPECTIVE_CLONE,   gimp_tool_perspective_clone_16   },
-  { GIMP_STOCK_TOOL_POSTERIZE,           gimp_tool_posterize_16           },
-  { GIMP_STOCK_TOOL_RECT_SELECT,         gimp_tool_rect_select_16         },
-  { GIMP_STOCK_TOOL_ROTATE,              gimp_tool_rotate_16              },
-  { GIMP_STOCK_TOOL_SCALE,               gimp_tool_scale_16               },
-  { GIMP_STOCK_TOOL_SEAMLESS_CLONE,      gimp_tool_clone_16               },
-  { GIMP_STOCK_TOOL_SHEAR,               gimp_tool_shear_16               },
-  { GIMP_STOCK_TOOL_SMUDGE,              gimp_tool_smudge_16              },
-  { GIMP_STOCK_TOOL_TEXT,                gimp_tool_text_16                },
-  { GIMP_STOCK_TOOL_THRESHOLD,           gimp_tool_threshold_16           },
-  { GIMP_STOCK_TOOL_UNIFIED_TRANSFORM,   gimp_tool_unified_transform_16   },
-  { GIMP_STOCK_TOOL_WARP,                gimp_tool_warp_16                },
-  { GIMP_STOCK_TOOL_ZOOM,                gimp_tool_zoom_16                },
-
-  { GIMP_STOCK_INFO,                     gimp_info_16                     },
-  { GIMP_STOCK_WARNING,                  gimp_warning_16                  },
-  { GIMP_STOCK_WILBER,                   gimp_wilber_16                   },
-  { GIMP_TOILET_PAPER,                   gimp_toilet_paper_16             },
-  { GIMP_STOCK_USER_MANUAL,              gimp_user_manual_16              },
-  { GIMP_STOCK_WEB,                      gimp_web_16                      },
-  { GIMP_STOCK_VIDEO,                    gimp_video_16                    },
-  { GIMP_STOCK_GEGL,                     gimp_gegl_16                     },
-
-  { GIMP_STOCK_SHAPE_CIRCLE,             gimp_shape_circle_16             },
-  { GIMP_STOCK_SHAPE_SQUARE,             gimp_shape_square_16             },
-  { GIMP_STOCK_SHAPE_DIAMOND,            gimp_shape_diamond_16            },
-  { GIMP_STOCK_CAP_BUTT,                 gimp_cap_butt_16                 },
-  { GIMP_STOCK_CAP_ROUND,                gimp_cap_round_16                },
-  { GIMP_STOCK_CAP_SQUARE,               gimp_cap_square_16               },
-  { GIMP_STOCK_JOIN_MITER,               gimp_join_miter_16               },
-  { GIMP_STOCK_JOIN_ROUND,               gimp_join_round_16               },
-  { GIMP_STOCK_JOIN_BEVEL,               gimp_join_bevel_16               }
-};
 
-static const struct
-{
-  const gchar   *stock_id;
-  gconstpointer  inline_data;
-}
-gimp_stock_dnd_pixbufs[] =
+static void
+register_stock_icon (GtkIconFactory *factory,
+                    const gchar    *stock_id,
+                     const gchar    *icon_name)
 {
-  { GIMP_STOCK_CHANNEL,              gimp_channel_32              },
-  { GIMP_STOCK_CHANNEL_RED,          gimp_channel_red_32          },
-  { GIMP_STOCK_CHANNEL_GREEN,        gimp_channel_green_32        },
-  { GIMP_STOCK_CHANNEL_BLUE,         gimp_channel_blue_32         },
-  { GIMP_STOCK_CHANNEL_GRAY,         gimp_channel_gray_32         },
-  { GIMP_STOCK_CHANNEL_INDEXED,      gimp_channel_indexed_32      },
-  { GIMP_STOCK_CHANNEL_ALPHA,        gimp_channel_alpha_32        },
-  { GIMP_STOCK_FLOATING_SELECTION,   gimp_floating_selection_32   },
-  { GIMP_STOCK_LAYER_MASK,           gimp_layer_mask_32           },
-  { GIMP_STOCK_IMAGE,                gimp_image_32                },
-  { GIMP_STOCK_LAYER,                gimp_layer_32                },
-  { GIMP_STOCK_TEXT_LAYER,           gimp_text_layer_32           },
-  { GIMP_STOCK_USER_MANUAL,          gimp_user_manual_32          }
-};
+  GtkIconSet    *set    = gtk_icon_set_new ();
+  GtkIconSource *source = gtk_icon_source_new ();
 
-static const struct
-{
-  const gchar   *stock_id;
-  gconstpointer  inline_data;
+  gtk_icon_source_set_direction_wildcarded (source, TRUE);
+  gtk_icon_source_set_size_wildcarded (source, TRUE);
+  gtk_icon_source_set_state_wildcarded (source, TRUE);
+  gtk_icon_source_set_icon_name (source, icon_name);
+
+  gtk_icon_set_add_source (set, source);
+  gtk_icon_source_free (source);
+
+  gtk_icon_factory_add (factory, stock_id, set);
+  gtk_icon_set_unref (set);
 }
-gimp_stock_dialog_pixbufs[] =
-{
-  { GIMP_STOCK_CHANNEL,              gimp_channel_48              },
-  { GIMP_STOCK_CHANNEL_RED,          gimp_channel_red_48          },
-  { GIMP_STOCK_CHANNEL_GREEN,        gimp_channel_green_48        },
-  { GIMP_STOCK_CHANNEL_BLUE,         gimp_channel_blue_48         },
-  { GIMP_STOCK_CHANNEL_GRAY,         gimp_channel_gray_48         },
-  { GIMP_STOCK_CHANNEL_INDEXED,      gimp_channel_indexed_48      },
-  { GIMP_STOCK_CHANNEL_ALPHA,        gimp_channel_alpha_48        },
-  { GIMP_STOCK_FLOATING_SELECTION,   gimp_floating_selection_48   },
-  { GIMP_STOCK_LAYER_MASK,           gimp_layer_mask_48           },
-  { GIMP_STOCK_IMAGE,                gimp_image_48                },
-  { GIMP_STOCK_LAYER,                gimp_layer_48                },
-  { GIMP_STOCK_TEXT_LAYER,           gimp_text_layer_48           },
-
-  { GIMP_STOCK_ERROR,                gimp_error_64                },
-  { GIMP_STOCK_INFO,                 gimp_info_64                 },
-  { GIMP_STOCK_QUESTION,             gimp_question_64             },
-  { GIMP_STOCK_USER_MANUAL,          gimp_user_manual_64          },
-  { GIMP_STOCK_WARNING,              gimp_warning_64              },
-  { GIMP_STOCK_WILBER,               gimp_wilber_64               },
-  { GIMP_STOCK_WILBER_EEK,           gimp_wilber_eek_64           },
-
-  { GIMP_STOCK_FRAME,                gimp_frame_64                },
-  { GIMP_STOCK_TEXTURE,              gimp_texture_64              }
-};
 
-static const struct
+static void
+register_bidi_stock_icon (GtkIconFactory *factory,
+                          const gchar    *stock_id,
+                          const gchar    *icon_name_ltr,
+                          const gchar    *icon_name_rtl)
 {
-  const gchar   *stock_id;
-  gconstpointer  inline_data_ltr;
-  gconstpointer  inline_data_rtl;
+  GtkIconSet    *set    = gtk_icon_set_new ();
+  GtkIconSource *source = gtk_icon_source_new ();
+
+  gtk_icon_source_set_direction (source, GTK_TEXT_DIR_LTR);
+  gtk_icon_source_set_direction_wildcarded (source, FALSE);
+  gtk_icon_source_set_size_wildcarded (source, TRUE);
+  gtk_icon_source_set_state_wildcarded (source, TRUE);
+  gtk_icon_source_set_icon_name (source, icon_name_ltr);
+
+  gtk_icon_set_add_source (set, source);
+  gtk_icon_source_free (source);
+
+  source = gtk_icon_source_new ();
+
+  gtk_icon_source_set_direction (source, GTK_TEXT_DIR_RTL);
+  gtk_icon_source_set_direction_wildcarded (source, FALSE);
+  gtk_icon_source_set_size_wildcarded (source, TRUE);
+  gtk_icon_source_set_state_wildcarded (source, TRUE);
+  gtk_icon_source_set_icon_name (source, icon_name_rtl);
+
+  gtk_icon_set_add_source (set, source);
+  gtk_icon_source_free (source);
+
+  gtk_icon_factory_add (factory, stock_id, set);
+  gtk_icon_set_unref (set);
 }
-gimp_stock_direction_pixbufs[] =
-{
-  { GIMP_STOCK_MENU_LEFT,  gimp_menu_left_12,  gimp_menu_right_12 },
-  { GIMP_STOCK_MENU_RIGHT, gimp_menu_right_12, gimp_menu_left_12  }
-};
 
 
 /**
@@ -792,54 +365,33 @@ gimp_stock_init (void)
 
   gimp_stock_factory = gtk_icon_factory_new ();
 
-  for (i = 0; i < G_N_ELEMENTS (gimp_stock_dialog_pixbufs); i++)
-    {
-      add_sized_with_same_fallback (gimp_stock_factory,
-                                    gimp_stock_dialog_pixbufs[i].inline_data,
-                                    NULL,
-                                    GTK_ICON_SIZE_DIALOG,
-                                    gimp_stock_dialog_pixbufs[i].stock_id);
-    }
-
-  for (i = 0; i < G_N_ELEMENTS (gimp_stock_dnd_pixbufs); i++)
+  for (i = 0; i < G_N_ELEMENTS (gimp_stock_items); i++)
     {
-      add_sized_with_same_fallback (gimp_stock_factory,
-                                    gimp_stock_dnd_pixbufs[i].inline_data,
-                                    NULL,
-                                    GTK_ICON_SIZE_DND,
-                                    gimp_stock_dnd_pixbufs[i].stock_id);
+      register_stock_icon (gimp_stock_factory,
+                           gimp_stock_items[i].stock_id,
+                           gimp_stock_items[i].stock_id);
     }
 
-  for (i = 0; i < G_N_ELEMENTS (gimp_stock_button_pixbufs); i++)
-    {
-      add_sized_with_same_fallback (gimp_stock_factory,
-                                    gimp_stock_button_pixbufs[i].inline_data,
-                                    NULL,
-                                    GTK_ICON_SIZE_BUTTON,
-                                    gimp_stock_button_pixbufs[i].stock_id);
-    }
+  register_bidi_stock_icon (gimp_stock_factory,
+                            GIMP_STOCK_MENU_LEFT,
+                            GIMP_STOCK_MENU_LEFT, GIMP_STOCK_MENU_RIGHT);
+  register_bidi_stock_icon (gimp_stock_factory,
+                            GIMP_STOCK_MENU_RIGHT,
+                            GIMP_STOCK_MENU_RIGHT, GIMP_STOCK_MENU_LEFT);
 
-  for (i = 0; i < G_N_ELEMENTS (gimp_stock_menu_pixbufs); i++)
-    {
-      add_sized_with_same_fallback (gimp_stock_factory,
-                                    gimp_stock_menu_pixbufs[i].inline_data,
-                                    NULL,
-                                    GTK_ICON_SIZE_MENU,
-                                    gimp_stock_menu_pixbufs[i].stock_id);
-    }
-
-  for (i = 0; i < G_N_ELEMENTS (gimp_stock_direction_pixbufs); i++)
-    {
-      add_sized_with_same_fallback (gimp_stock_factory,
-                                    gimp_stock_direction_pixbufs[i].inline_data_ltr,
-                                    gimp_stock_direction_pixbufs[i].inline_data_rtl,
-                                    GTK_ICON_SIZE_MENU,
-                                    gimp_stock_direction_pixbufs[i].stock_id);
-    }
+  register_stock_icon (gimp_stock_factory,
+                       "gimp-indexed-palette", GIMP_STOCK_COLORMAP);
+  register_stock_icon (gimp_stock_factory,
+                       "gimp-qmask-off", GIMP_STOCK_QUICK_MASK_OFF);
+  register_stock_icon (gimp_stock_factory,
+                       "gimp-qmask-on", GIMP_STOCK_QUICK_MASK_ON);
 
   gtk_icon_factory_add_default (gimp_stock_factory);
 
-  gtk_stock_add_static (gimp_stock_items, G_N_ELEMENTS (gimp_stock_items));
+  gtk_stock_add_static (gimp_stock_items,
+                        G_N_ELEMENTS (gimp_stock_items));
+  gtk_stock_add_static (gimp_compat_stock_items,
+                        G_N_ELEMENTS (gimp_compat_stock_items));
 
   icons_dir = g_build_filename (gimp_data_directory (), "icons", NULL);
   gtk_icon_theme_prepend_search_path (gtk_icon_theme_get_default (),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]