diff options
author | Benjamin Otte <otte@redhat.com> | 2014-10-23 04:10:03 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-01-07 14:26:46 +0100 |
commit | 4168e0385efd9231731ed35b96ce58bafc3eb03f (patch) | |
tree | 1b43a6658abd650fce4f1eb1a4a17dd16d0098d6 /gtk/gtkcssstyleprivate.h | |
parent | 572f46067f44da99e9ee0ea3210e1c0fac148928 (diff) | |
download | gtk+-4168e0385efd9231731ed35b96ce58bafc3eb03f.tar.gz |
cssstyle: Split into GtkCssStyle and GtkCssAnimatedStyle
GtkCssStyle is the base class to be used for all types of styles that do
exist.
GtkCssAnimatedStyle is the only implementation so far, that is exactly a
copy/paste of the old GtkCssStyle code.
Diffstat (limited to 'gtk/gtkcssstyleprivate.h')
-rw-r--r-- | gtk/gtkcssstyleprivate.h | 53 |
1 files changed, 15 insertions, 38 deletions
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h index f566426561..d61b4c3cf9 100644 --- a/gtk/gtkcssstyleprivate.h +++ b/gtk/gtkcssstyleprivate.h @@ -41,62 +41,39 @@ typedef struct _GtkCssStyleClass GtkCssStyleClass; struct _GtkCssStyle { GObject parent; - - GPtrArray *values; /* the unanimated (aka intrinsic) values */ - GPtrArray *sections; /* sections the values are defined in */ - - GPtrArray *animated_values; /* NULL or array of animated values/NULL if not animated */ - gint64 current_time; /* the current time in our world */ - GSList *animations; /* the running animations, least important one first */ - - GtkBitmask *depends_on_parent; /* for intrinsic values */ - GtkBitmask *equals_parent; /* dito */ - GtkBitmask *depends_on_color; /* dito */ - GtkBitmask *depends_on_font_size; /* dito */ }; struct _GtkCssStyleClass { GObjectClass parent_class; + + /* Get the value for the given property id. This needs to be FAST. */ + GtkCssValue * (* get_value) (GtkCssStyle *style, + guint id); + /* Get the section the value at the given id was declared at or NULL if unavailable. + * Optional: default impl will just return NULL */ + GtkCssSection * (* get_section) (GtkCssStyle *style, + guint id); + /* Compute the bitmask of potentially changed properties if the parent has changed + * the passed in ones. + * This is for example needed when changes in the "color" property will affect + * all properties using "currentColor" as a color. + * Optional: The default impl just returns the parent changes unchanged */ + GtkBitmask * (* compute_dependencies) (GtkCssStyle *style, + const GtkBitmask *parent_changes); }; GType gtk_css_style_get_type (void) G_GNUC_CONST; -GtkCssStyle * gtk_css_style_new (void); - -void gtk_css_style_compute_value (GtkCssStyle *style, - GtkStyleProviderPrivate*provider, - int scale, - GtkCssStyle *parent_style, - guint id, - GtkCssValue *specified, - GtkCssSection *section); -void gtk_css_style_set_animated_value (GtkCssStyle *style, - guint id, - GtkCssValue *value); - GtkCssValue * gtk_css_style_get_value (GtkCssStyle *style, guint id); GtkCssSection * gtk_css_style_get_section (GtkCssStyle *style, guint id); -GtkCssValue * gtk_css_style_get_intrinsic_value (GtkCssStyle *style, - guint id); GtkBitmask * gtk_css_style_get_difference (GtkCssStyle *style, GtkCssStyle *other); GtkBitmask * gtk_css_style_compute_dependencies (GtkCssStyle *style, const GtkBitmask *parent_changes); -void gtk_css_style_create_animations (GtkCssStyle *style, - GtkCssStyle *parent_style, - gint64 timestamp, - GtkStyleProviderPrivate*provider, - int scale, - GtkCssStyle *source); -GtkBitmask * gtk_css_style_advance (GtkCssStyle *style, - gint64 timestamp); -void gtk_css_style_cancel_animations (GtkCssStyle *style); -gboolean gtk_css_style_is_static (GtkCssStyle *style); - char * gtk_css_style_to_string (GtkCssStyle *style); void gtk_css_style_print (GtkCssStyle *style, GString *string); |