summaryrefslogtreecommitdiffstats
path: root/gtk/src/icons.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-09-09 23:14:28 +0000
committerjstebbins <[email protected]>2008-09-09 23:14:28 +0000
commite57d4d0bf36c3b5d4691134d0fdb8171cb25f843 (patch)
treead4dddfe057558ad5cd8fd5c02eb1d156079c709 /gtk/src/icons.c
parentebf4b4d663b9eeeed5d9632b5a2076355cff7145 (diff)
LinGui: consolidate all resources into one stringified plist file that gets
compiled in. icons and everyting all rolled up into one ball-o-wax. hehe, plists are cool git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1685 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/icons.c')
-rw-r--r--gtk/src/icons.c117
1 files changed, 22 insertions, 95 deletions
diff --git a/gtk/src/icons.c b/gtk/src/icons.c
index 3d4e7ef0b..af7d84e05 100644
--- a/gtk/src/icons.c
+++ b/gtk/src/icons.c
@@ -1,102 +1,29 @@
#include <gtk/gtk.h>
-#include "hb-activity.32.h"
-#include "hb-add-queue.32.h"
-#include "hb-canceled.16.h"
-#include "hb-complete.16.h"
-#include "hb-drawer.32.h"
-#include "hb-icon.128.h"
-#include "hb-icon.64.h"
-#include "hb-pause.32.h"
-#include "hb-play.32.h"
-#include "hb-pref.32.h"
-#include "hb-queue.32.h"
-#include "hb-queue-delete.16.h"
-#include "hb-queue-job.16.h"
-#include "hb-queue-pass1.16.h"
-#include "hb-queue-pass2.16.h"
-#include "hb-queue-subtitle.16.h"
-#include "hb-remove.32.h"
-#include "hb-source.32.h"
-#include "hb-stop.32.h"
-#include "hb-working0.16.h"
-#include "hb-working1.16.h"
-#include "hb-working2.16.h"
-#include "hb-working3.16.h"
-#include "hb-working4.16.h"
-#include "hb-working5.16.h"
+#include "icon_tools.h"
+#include "values.h"
+#include "resources.h"
void
ghb_load_icons()
{
GdkPixbuf *pb;
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_activity32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-activity", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_add_queue32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-add-queue", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_canceled16, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-canceled", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_complete16, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-complete", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_drawer32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-drawer", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_icon128, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-icon", 128, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_play32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-play", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_pref32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-pref", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue_delete16, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue-delete", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue_job16, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue-job", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue_pass1, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue-pass1", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue_pass2, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue-pass2", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_queue_subtitle16, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-queue-subtitle", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_remove32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-remove", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_source32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-source", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_stop32, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-stop", 32, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working0, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working0", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working1, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working1", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working2, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working2", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working3, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working3", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working4, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working4", 16, pb);
-
- pb = gdk_pixbuf_new_from_inline(-1, hb_working5, FALSE, NULL);
- gtk_icon_theme_add_builtin_icon("hb-working5", 16, pb);
-
+ GHashTableIter iter;
+ gchar *name;
+ GValue *gval;
+ ghb_rawdata_t *rd;
+ gint size;
+
+ 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*)&name, (gpointer*)(void*)&gval))
+ {
+ rd = g_value_get_boxed(gval);
+ pb = icon_deserialize(rd->data, rd->size);
+ size = gdk_pixbuf_get_height(pb);
+ gtk_icon_theme_add_builtin_icon(name, size, pb);
+ gdk_pixbuf_unref(pb);
+ }
}