diff options
author | JP Rosevear <jpr@novell.com> | 2004-11-26 21:57:33 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-11-26 21:57:33 +0800 |
commit | b66bfd09f72ecd36a44aef9338cb53891c27048e (patch) | |
tree | 28bdb7fa525c4791be40d66d2ebdf1e098995557 | |
parent | 686e2dabe9ecfb69423dc50f84d012eb06b98dde (diff) | |
download | gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar.gz gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar.bz2 gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar.lz gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar.xz gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.tar.zst gsoc2013-evolution-b66bfd09f72ecd36a44aef9338cb53891c27048e.zip |
add proto
2004-11-26 JP Rosevear <jpr@novell.com>
* e-icon-factory.h: add proto
* e-icon-factory.c (e_icon_factory_init): cast to kill warning
(e_icon_factory_get_image): new function to return a GtkImage
widget give an icon name and size
svn path=/trunk/; revision=27995
-rw-r--r-- | e-util/ChangeLog | 8 | ||||
-rw-r--r-- | e-util/e-icon-factory.c | 15 | ||||
-rw-r--r-- | e-util/e-icon-factory.h | 5 |
3 files changed, 26 insertions, 2 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index cd9a9dc108..f10860327b 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,11 @@ +2004-11-26 JP Rosevear <jpr@novell.com> + + * e-icon-factory.h: add proto + + * e-icon-factory.c (e_icon_factory_init): cast to kill warning + (e_icon_factory_get_image): new function to return a GtkImage + widget give an icon name and size + 2004-11-25 Chenthill Palanisamy <pchenthill@novell.com> * e-config.c (ec_rebuild): Set the row and column spacings as diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index 82461f0c26..eac14f4e9f 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -34,6 +34,7 @@ #include <pthread.h> +#include <gtk/gtkimage.h> #include <libgnomeui/gnome-icon-theme.h> #include <e-util/e-icon-factory.h> @@ -200,7 +201,7 @@ e_icon_factory_init (void) icon_theme = gnome_icon_theme_new (); name_to_icon = g_hash_table_new (g_str_hash, g_str_equal); - g_signal_connect (G_OBJECT (icon_theme), "changed", icon_theme_changed_cb, NULL); + g_signal_connect (G_OBJECT (icon_theme), "changed", G_CALLBACK (icon_theme_changed_cb), NULL); broken16_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) broken_image_16_xpm); broken24_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) broken_image_24_xpm); @@ -333,6 +334,18 @@ e_icon_factory_get_icon (const char *icon_name, int icon_size) return pixbuf; } +GtkWidget * +e_icon_factory_get_image (const char *icon_name, int icon_size) +{ + GdkPixbuf *pixbuf; + GtkWidget *image; + + pixbuf = e_icon_factory_get_icon (icon_name, icon_size); + image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + + return image; +} /** * e_icon_factory_get_icon_list: diff --git a/e-util/e-icon-factory.h b/e-util/e-icon-factory.h index cdb80b040b..966e1f56e4 100644 --- a/e-util/e-icon-factory.h +++ b/e-util/e-icon-factory.h @@ -1,7 +1,7 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* e-icon-factory.h - Icon factory for the Evolution shell. * - * Copyright (C) 2002 Ximian, Inc. + * Copyright (C) 2002-2004 Novell, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -24,6 +24,7 @@ #define _E_ICON_FACTORY_H_ #include <gdk-pixbuf/gdk-pixbuf.h> +#include <gtk/gtkwidget.h> enum { E_ICON_SIZE_MENU, @@ -50,6 +51,8 @@ char *e_icon_factory_get_icon_filename (const char *icon_name, int icon_siz GdkPixbuf *e_icon_factory_get_icon (const char *icon_name, int icon_size); +GtkWidget *e_icon_factory_get_image (const char *icon_name, int icon_size); + GList *e_icon_factory_get_icon_list (const char *icon_name); #endif /* _E_ICON_FACTORY_H_ */ |