diff options
author | Tim Janik <timj@gtk.org> | 2001-03-18 04:50:34 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2001-03-18 04:50:34 +0000 |
commit | ac68581f9655392ab4b41ac5d6b0b76c0adf532f (patch) | |
tree | 3a8c1043c94817b941e70dfce7fefb309b0cf517 /gtk/gtkstyle.h | |
parent | 882bb853891b30c98c58d384d311fa24fbd1b326 (diff) | |
download | gtk+-ac68581f9655392ab4b41ac5d6b0b76c0adf532f.tar.gz |
added rc-style argument GtkSpinButton::shadow_type. removed
Sun Mar 18 01:15:30 2001 Tim Janik <timj@gtk.org>
* gtk/gtkspinbutton.[hc]: added rc-style argument
GtkSpinButton::shadow_type.
removed spin_button->shadow_type, gtk_spin_button_set_shadow_type()
and ARG_SHADOW_TYPE as it doesn' make much sense to try to override
rc-style settings.
* gtk/gtkfixed.c: removed gtk_fixed_paint() (was unused).
* gtk/gtkwidget.c: quark cleanups.
* gtk/gtkrc.[hc]: added gtk_rc_scanner_new() to create an rc-file
scanner with appropriate configuration, renamed GtkRcStyleClass.clone
to create_rc_style() (we don't do cloning in standard OO sense).
added per rc style properties.
* gtk/gtkstyle.[hc]: added code to retrive pspec conformant rc-style
property values and for caching those. some cleanups.
* gtk/Makefile.am: -DG_DISABLE_CONST_RETURNS.
* gtk/gtksettings.[hc]: new file for global rc-file properties
(at least currently, should get extended to support X properties
and other communication mechanisms).
* gtk/gtkwidget.[hc]: added style property support:
(gtk_widget_class_install_style_property_parser): install style
property pspec with parser function for rc-file values other
than LONG, DOUBLE or STRING.
(gtk_widget_class_install_style_property): same as above without
parser (parsers are going to be needed quite infrequently).
(gtk_widget_style_get_property): retrive style property value.
(gtk_widget_style_get_valist): same as above with varargs support,
has NOCOPY semantics.
(gtk_widget_style_get): wrapper around gtk_widget_style_get_valist().
Diffstat (limited to 'gtk/gtkstyle.h')
-rw-r--r-- | gtk/gtkstyle.h | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h index bcb02be505..407f9ae77c 100644 --- a/gtk/gtkstyle.h +++ b/gtk/gtkstyle.h @@ -36,9 +36,6 @@ extern "C" { #endif /* __cplusplus */ -typedef struct _GtkStyle GtkStyle; -typedef struct _GtkStyleClass GtkStyleClass; - #define GTK_TYPE_STYLE (gtk_style_get_type ()) #define GTK_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle)) #define GTK_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass)) @@ -49,10 +46,16 @@ typedef struct _GtkStyleClass GtkStyleClass; /* Some forward declarations needed to rationalize the header * files. */ +typedef struct _GtkStyle GtkStyle; +typedef struct _GtkStyleClass GtkStyleClass; typedef struct _GtkThemeEngine GtkThemeEngine; typedef struct _GtkRcStyle GtkRcStyle; typedef struct _GtkIconSet GtkIconSet; typedef struct _GtkIconSource GtkIconSource; +typedef struct _GtkRcProperty GtkRcProperty; +typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec, + const GString *rc_string, + GValue *property_value); /* We make this forward declaration here, since we pass * GtkWidgt's to the draw functions. @@ -64,7 +67,7 @@ typedef struct _GtkWidget GtkWidget; */ #define GTK_STYLE_NUM_STYLECOLORS() (7 * 5) -#define GTK_STYLE_ATTACHED(style) (((GtkStyle*) (style))->attach_count > 0) +#define GTK_STYLE_ATTACHED(style) (GTK_STYLE (style)->attach_count > 0) struct _GtkStyle { @@ -107,12 +110,12 @@ struct _GtkStyle gint depth; GdkColormap *colormap; - GtkRcStyle *rc_style; /* the Rc style from which this style - * was created - */ - GSList *styles; + /* the RcStyle from which this style was created */ + GtkRcStyle *rc_style; - GSList *icon_factories; + GSList *styles; /* of type GtkStyle* */ + GBSearchArray *property_cache; + GSList *icon_factories; /* of type GtkIconFactory* */ }; struct _GtkStyleClass @@ -409,7 +412,7 @@ void gtk_style_apply_default_background (GtkStyle *style, GtkIconSet* gtk_style_lookup_icon_set (GtkStyle *style, const gchar *stock_id); -GdkPixbuf * gtk_style_render_icon (GtkStyle *style, +GdkPixbuf* gtk_style_render_icon (GtkStyle *style, const GtkIconSource *source, GtkTextDirection direction, GtkStateType state, @@ -461,14 +464,6 @@ void gtk_draw_diamond (GtkStyle *style, gint y, gint width, gint height); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - const gchar *string); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_draw_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -640,17 +635,6 @@ void gtk_paint_diamond (GtkStyle *style, gint y, gint width, gint height); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_paint_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_paint_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -799,6 +783,32 @@ void gtk_paint_layout (GtkStyle *style, PangoLayout *layout); +/* --- private API --- */ +const GValue* _gtk_style_peek_property_value (GtkStyle *style, + GType widget_type, + GParamSpec *pspec, + GtkRcPropertyParser parser); + + +/* depprecated */ +#ifndef GTK_DISABLE_DEPRECATED +void gtk_draw_string (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gint x, + gint y, + const gchar *string); +void gtk_paint_string (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + const gchar *string); +#endif /* GTK_DISABLE_DEPRECATED */ + #ifdef __cplusplus } #endif /* __cplusplus */ |