diff options
Diffstat (limited to 'gtk/src/icons.c')
-rw-r--r-- | gtk/src/icons.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/gtk/src/icons.c b/gtk/src/icons.c index 042525592..56555a154 100644 --- a/gtk/src/icons.c +++ b/gtk/src/icons.c @@ -6,43 +6,43 @@ void ghb_load_icons() { - GHashTableIter iter; - gchar *key; - GValue *gval; + GHashTableIter iter; + gchar *key; + GValue *gval; - GValue *icons = ghb_resource_get("icons"); - ghb_dict_iter_init(&iter, icons); - // middle (void*) cast prevents gcc warning "defreferencing type-punned - // pointer will break strict-aliasing rules" - while (g_hash_table_iter_next( - &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval)) - { - gint colorspace, bps, width, height, rowstride; - gboolean alpha; - ghb_rawdata_t *rd; - gint size; - GdkPixbuf *pb; - char *name = g_strdup(key); - char *pos; + GValue *icons = ghb_resource_get("icons"); + ghb_dict_iter_init(&iter, icons); + // middle (void*) cast prevents gcc warning "defreferencing type-punned + // pointer will break strict-aliasing rules" + while (g_hash_table_iter_next( + &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval)) + { + gint colorspace, bps, width, height, rowstride; + gboolean alpha; + ghb_rawdata_t *rd; + gint size; + GdkPixbuf *pb; + char *name = g_strdup(key); + char *pos; - pos = g_strstr_len(name, -1, "."); - if (pos != NULL) - *pos = '\0'; + pos = g_strstr_len(name, -1, "."); + if (pos != NULL) + *pos = '\0'; - colorspace = ghb_value_int(ghb_dict_lookup(gval, "colorspace")); - alpha = ghb_value_boolean(ghb_dict_lookup(gval, "alpha")); - bps = ghb_value_int(ghb_dict_lookup(gval, "bps")); - width = ghb_value_int(ghb_dict_lookup(gval, "width")); - height = ghb_value_int(ghb_dict_lookup(gval, "height")); - rowstride = ghb_value_int(ghb_dict_lookup(gval, "rowstride")); - rd = g_value_get_boxed(ghb_dict_lookup(gval, "data")); - pb = gdk_pixbuf_new_from_data( - rd->data, colorspace, alpha, bps, - width, height, rowstride, - NULL, NULL); - size = gdk_pixbuf_get_height(pb); - gtk_icon_theme_add_builtin_icon(name, size, pb); - g_object_unref(pb); - g_free(name); - } + colorspace = ghb_value_int(ghb_dict_lookup(gval, "colorspace")); + alpha = ghb_value_boolean(ghb_dict_lookup(gval, "alpha")); + bps = ghb_value_int(ghb_dict_lookup(gval, "bps")); + width = ghb_value_int(ghb_dict_lookup(gval, "width")); + height = ghb_value_int(ghb_dict_lookup(gval, "height")); + rowstride = ghb_value_int(ghb_dict_lookup(gval, "rowstride")); + rd = g_value_get_boxed(ghb_dict_lookup(gval, "data")); + pb = gdk_pixbuf_new_from_data( + rd->data, colorspace, alpha, bps, + width, height, rowstride, + NULL, NULL); + size = gdk_pixbuf_get_height(pb); + gtk_icon_theme_add_builtin_icon(name, size, pb); + g_object_unref(pb); + g_free(name); + } } |