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
This commit is contained in:
Havoc Pennington
2002-02-09 23:03:52 +00:00
committed by Havoc Pennington
parent 29a86695d1
commit 245c9c2d7e
9 changed files with 992 additions and 579 deletions

View File

@ -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

View File

@ -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 ();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB