2 #include "icon_tools.h"
14 GValue *icons = ghb_resource_get("icons");
15 ghb_dict_iter_init(&iter, icons);
16 // middle (void*) cast prevents gcc warning "defreferencing type-punned
17 // pointer will break strict-aliasing rules"
18 while (g_hash_table_iter_next(
19 &iter, (gpointer*)(void*)&name, (gpointer*)(void*)&gval))
21 gint colorspace, bps, width, height, rowstride;
27 colorspace = ghb_value_int(ghb_dict_lookup(gval, "colorspace"));
28 alpha = ghb_value_boolean(ghb_dict_lookup(gval, "alpha"));
29 bps = ghb_value_int(ghb_dict_lookup(gval, "bps"));
30 width = ghb_value_int(ghb_dict_lookup(gval, "width"));
31 height = ghb_value_int(ghb_dict_lookup(gval, "height"));
32 rowstride = ghb_value_int(ghb_dict_lookup(gval, "rowstride"));
33 rd = g_value_get_boxed(ghb_dict_lookup(gval, "data"));
34 pb = gdk_pixbuf_new_from_data(
35 rd->data, colorspace, alpha, bps,
36 width, height, rowstride,
38 size = gdk_pixbuf_get_height(pb);
39 gtk_icon_theme_add_builtin_icon(name, size, pb);
56 GValue *icons = ghb_resource_get("icons");
57 ghb_dict_iter_init(&iter, icons);
58 // middle (void*) cast prevents gcc warning "defreferencing type-punned
59 // pointer will break strict-aliasing rules"
60 while (g_hash_table_iter_next(
61 &iter, (gpointer*)(void*)&name, (gpointer*)(void*)&gval))
63 rd = g_value_get_boxed(gval);
64 pb = icon_deserialize(rd->data, rd->size);
65 size = gdk_pixbuf_get_height(pb);
66 gtk_icon_theme_add_builtin_icon(name, size, pb);