From 73e9d113a797c28a08a9a9a4ebefaaefb29e098d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 19 Mar 2001 22:40:35 +0000 Subject: Make GtkIconSource an opaque datatype, and add a bunch of accessor 2001-03-19 Havoc Pennington * gtk/gtkiconfactory.c: Make GtkIconSource an opaque datatype, and add a bunch of accessor functions. This is because we have reasonable expectations of extending what fields it contains in the future. * gtk/gtkstyle.c (gtk_default_render_icon): adapt to icon source changes * gtk/gtkrc.c (gtk_rc_parse_icon_source): fix to use new GtkIconSource --- gtk/gtkiconfactory.h | 61 +++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 27 deletions(-) (limited to 'gtk/gtkiconfactory.h') diff --git a/gtk/gtkiconfactory.h b/gtk/gtkiconfactory.h index 89c0f161c8..c4b755af7c 100644 --- a/gtk/gtkiconfactory.h +++ b/gtk/gtkiconfactory.h @@ -117,34 +117,41 @@ GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set, void gtk_icon_set_add_source (GtkIconSet *icon_set, const GtkIconSource *source); -/* INTERNAL */ -void _gtk_icon_set_invalidate_caches (void); - -struct _GtkIconSource -{ - /* Either filename or pixbuf can be NULL. If both are non-NULL, - * the pixbuf is assumed to be the already-loaded contents of the - * file. - */ - gchar *filename; - GdkPixbuf *pixbuf; - - GtkTextDirection direction; - GtkStateType state; - GtkIconSize size; - - /* If TRUE, then the parameter is wildcarded, and the above - * fields should be ignored. If FALSE, the parameter is - * specified, and the above fields should be valid. - */ - guint any_direction : 1; - guint any_state : 1; - guint any_size : 1; -}; - -GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source); -void gtk_icon_source_free (GtkIconSource *source); +GtkIconSource* gtk_icon_source_new (void); +GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source); +void gtk_icon_source_free (GtkIconSource *source); + +void gtk_icon_source_set_filename (GtkIconSource *source, + const gchar *filename); +void gtk_icon_source_set_pixbuf (GtkIconSource *source, + GdkPixbuf *pixbuf); + +G_CONST_RETURN gchar* gtk_icon_source_get_filename (const GtkIconSource *source); +GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source); + +void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source, + gboolean setting); +void gtk_icon_source_set_state_wildcarded (GtkIconSource *source, + gboolean setting); +void gtk_icon_source_set_size_wildcarded (GtkIconSource *source, + gboolean setting); +gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source); +gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source); +gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source); +void gtk_icon_source_set_direction (GtkIconSource *source, + GtkTextDirection direction); +void gtk_icon_source_set_state (GtkIconSource *source, + GtkStateType state); +void gtk_icon_source_set_size (GtkIconSource *source, + GtkIconSize size); +GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source); +GtkStateType gtk_icon_source_get_state (const GtkIconSource *source); +GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source); + + +/* ignore this */ +void _gtk_icon_set_invalidate_caches (void); #ifdef __cplusplus } -- cgit v1.2.1