-#ifndef USE_STABLE_LIBGNOMEUI
-static GdkPixbuf *
-scale_icon (GdkPixbuf *pixbuf,
- double *scale)
-{
- guint width, height;
-
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
-
- width = floor (width * *scale + 0.5);
- height = floor (height * *scale + 0.5);
-
- return gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
-}
-
-static GdkPixbuf *
-load_icon_file (char *filename,
- guint base_size,
- guint nominal_size)
-{
- GdkPixbuf *pixbuf, *scaled_pixbuf;
- guint width, height, size;
- double scale;
-
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
-
- if (pixbuf == NULL) {
- return NULL;
- }
-
- if (base_size == 0) {
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
- size = MAX (width, height);
- if (size > nominal_size) {
- base_size = size;
- } else {
- /* Don't scale up small icons */
- base_size = nominal_size;
- }
- }
-
- if (base_size != nominal_size) {
- scale = (double)nominal_size/base_size;
- scaled_pixbuf = scale_icon (pixbuf, &scale);
- g_object_unref (pixbuf);
- pixbuf = scaled_pixbuf;
- }
-
- return pixbuf;
-}
-