summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-02-09 23:03:52 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-02-09 23:03:52 +0000
commit245c9c2d7e27445744eee764ecae6e3914fabd1e (patch)
treea20a282963f71f7d064de2276619afa138eeb6af /src/tools
parent29a86695d1eabfaab0675511dc2c3f80e548258d (diff)
downloadmetacity-245c9c2d7e27445744eee764ecae6e3914fabd1e.tar.gz
metacity-245c9c2d7e27445744eee764ecae6e3914fabd1e.tar.bz2
port to icon cache
2002-02-09 Havoc Pennington <hp@pobox.com> * src/window.c (update_icon): port to icon cache * src/iconcache.c, src/iconcache.c: begin process of cleaning up window.c by moving the icon-reading code in here, based on the code in libwnck, which was in turn based on the earlier metacity code
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/Makefile.am5
-rw-r--r--src/tools/metacity-window-demo.c21
-rw-r--r--src/tools/metacity-window-demo.pngbin0 -> 3453 bytes
3 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
index 29d8531..0a8bbf4 100644
--- a/src/tools/Makefile.am
+++ b/src/tools/Makefile.am
@@ -1,5 +1,8 @@
-INCLUDES=@METACITY_WINDOW_DEMO_CFLAGS@ @METACITY_MESSAGE_CFLAGS@
+icondir=$(pkgdatadir)/icons
+icon_DATA=metacity-window-demo.png
+
+INCLUDES=@METACITY_WINDOW_DEMO_CFLAGS@ @METACITY_MESSAGE_CFLAGS@ -DMETACITY_ICON_DIR=\"$(pkgdatadir)/icons\"
metacity_message_SOURCES= \
metacity-message.c
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index a0ac657..96a65d0 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -153,8 +153,29 @@ set_gtk_window_type (GtkWindow *window,
int
main (int argc, char **argv)
{
+ GList *list;
+ GdkPixbuf *pixbuf;
+ GError *err;
+
gtk_init (&argc, &argv);
+ err = NULL;
+ pixbuf = gdk_pixbuf_new_from_file (METACITY_ICON_DIR"/metacity-window-demo.png",
+ &err);
+ if (pixbuf)
+ {
+ list = g_list_prepend (NULL, pixbuf);
+
+ gtk_window_set_default_icon_list (list);
+ g_list_free (list);
+ g_object_unref (G_OBJECT (pixbuf));
+ }
+ else
+ {
+ g_printerr ("Could not load icon: %s\n", err->message);
+ g_error_free (err);
+ }
+
do_appwindow ();
gtk_main ();
diff --git a/src/tools/metacity-window-demo.png b/src/tools/metacity-window-demo.png
new file mode 100644
index 0000000..d87f829
--- /dev/null
+++ b/src/tools/metacity-window-demo.png
Binary files differ