diff options
author | Tim Janik <timj@gtk.org> | 2001-06-26 20:56:32 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2001-06-26 20:56:32 +0000 |
commit | d4f0062f5e9c8a3fe8e4c7ba0daff28b5e76f69a (patch) | |
tree | cbec6c1be2f06e4fbe13852147b9554e02d70f83 /gtk | |
parent | 3704749e94a270a7101dce94d498c3649ceb6c3c (diff) | |
download | gtk+-d4f0062f5e9c8a3fe8e4c7ba0daff28b5e76f69a.tar.gz |
use gdk_pixbuf_new_from_stream(). fixed up item factory so inlined pixbufs
Tue Jun 26 10:04:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkiconfactory.c:
* gtk/gtkitemfactory.c: use gdk_pixbuf_new_from_stream(). fixed up
item factory so inlined pixbufs actually work.
Tue Jun 26 09:48:02 2001 Tim Janik <timj@gtk.org>
* Makefile.am (noinst_PROGRAMS): get rid of make-inline-pixbuf
* gdk-pixbuf-data.[hc]: provide gdk_pixbuf_new_from_stream()
instead from gdk_pixbuf_new_from_inline().
* gdk-pixdata.[hc]: auxillary GdkPixdata structure, public
installed API for applications that need to serialize/deserialize
on their own (gimp, BEAST).
* gdk-pixbuf/gdk-pixbuf-csource.c: provide publically installed
program that can dump images in CSource format and Pixbuf
stream format. supports RLE encoding, MACRO formatting etc...
invoke with --help.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkiconfactory.c | 10 | ||||
-rw-r--r-- | gtk/gtkitemfactory.c | 8 | ||||
-rw-r--r-- | gtk/gtkitemfactory.h | 8 |
3 files changed, 14 insertions, 12 deletions
diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index ae80f3180b..64c57b33b5 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -335,7 +335,7 @@ sized_icon_set_from_inline (const guchar *inline_data, set = gtk_icon_set_new (); - source.pixbuf = gdk_pixbuf_new_from_inline (inline_data, FALSE, -1, NULL); + source.pixbuf = gdk_pixbuf_new_from_stream (-1, inline_data, FALSE, NULL); g_assert (source.pixbuf); @@ -361,7 +361,7 @@ sized_with_fallback_icon_set_from_inline (const guchar *fallback_data, set = gtk_icon_set_new (); - source.pixbuf = gdk_pixbuf_new_from_inline (inline_data, FALSE, -1, NULL); + source.pixbuf = gdk_pixbuf_new_from_stream (-1, inline_data, FALSE, NULL); g_assert (source.pixbuf); @@ -371,7 +371,7 @@ sized_with_fallback_icon_set_from_inline (const guchar *fallback_data, source.any_size = TRUE; - source.pixbuf = gdk_pixbuf_new_from_inline (fallback_data, FALSE, -1, NULL); + source.pixbuf = gdk_pixbuf_new_from_stream (-1, fallback_data, FALSE, NULL); g_assert (source.pixbuf); @@ -393,7 +393,7 @@ unsized_icon_set_from_inline (const guchar *inline_data) set = gtk_icon_set_new (); - source.pixbuf = gdk_pixbuf_new_from_inline (inline_data, FALSE, -1, NULL); + source.pixbuf = gdk_pixbuf_new_from_stream (-1, inline_data, FALSE, NULL); g_assert (source.pixbuf); @@ -1090,7 +1090,7 @@ render_fallback_image (GtkStyle *style, static GtkIconSource fallback_source = { NULL, NULL, 0, 0, 0, TRUE, TRUE, TRUE }; if (fallback_source.pixbuf == NULL) - fallback_source.pixbuf = gdk_pixbuf_new_from_inline (MISSING_IMAGE_INLINE, FALSE, -1, NULL); + fallback_source.pixbuf = gdk_pixbuf_new_from_stream (-1, MISSING_IMAGE_INLINE, FALSE, NULL); return gtk_style_render_icon (style, &fallback_source, diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c index ff3b8cdd4f..b47970e760 100644 --- a/gtk/gtkitemfactory.c +++ b/gtk/gtkitemfactory.c @@ -228,8 +228,8 @@ gtk_item_factory_class_init (GtkItemFactoryClass *class) quark_type_toggle_item = g_quark_from_static_string ("<ToggleItem>"); quark_type_image_item = g_quark_from_static_string ("<ImageItem>"); quark_type_stock_item = g_quark_from_static_string ("<StockItem>"); - quark_type_tearoff_item = g_quark_from_static_string ("<Tearoff>"); quark_type_separator_item = g_quark_from_static_string ("<Separator>"); + quark_type_tearoff_item = g_quark_from_static_string ("<Tearoff>"); quark_type_branch = g_quark_from_static_string ("<Branch>"); quark_type_last_branch = g_quark_from_static_string ("<LastBranch>"); } @@ -1228,14 +1228,14 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory, gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (widget), radio_group); if (GTK_IS_CHECK_MENU_ITEM (widget)) gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (widget), TRUE); - if (GTK_IS_IMAGE_MENU_ITEM (widget)) + if (type_id == quark_type_image_item) { GdkPixbuf *pixbuf = NULL; image = NULL; - pixbuf = gdk_pixbuf_new_from_inline (entry->extra_data, + pixbuf = gdk_pixbuf_new_from_stream (-1, + entry->extra_data, FALSE, - entry->extra_data2, NULL); if (pixbuf) diff --git a/gtk/gtkitemfactory.h b/gtk/gtkitemfactory.h index 536d4ea7be..5132f9d1db 100644 --- a/gtk/gtkitemfactory.h +++ b/gtk/gtkitemfactory.h @@ -99,22 +99,24 @@ struct _GtkItemFactoryEntry * "" -> "<Item>" * "<Title>" -> create a title item * "<Item>" -> create a simple item + * "<ImageItem>" -> create an item holding an image + * "<StockItem>" -> create an item holding a stock image * "<CheckItem>" -> create a check item * "<ToggleItem>" -> create a toggle item * "<RadioItem>" -> create a radio item * <path> -> path of a radio item to link against * "<Separator>" -> create a separator + * "<Tearoff>" -> create a tearoff separator * "<Branch>" -> create an item to hold sub items * "<LastBranch>" -> create a right justified item to hold sub items */ gchar *item_type; /* Extra data for some item types: - * ImageItem -> pointer to inline pixbuf + inline pixbuf length + * ImageItem -> pointer to inlined pixbuf stream * StockItem -> name of stock item */ - gpointer extra_data; - guint extra_data2; + gconstpointer extra_data; }; struct _GtkItemFactoryItem |