[gtk+] cssstyle: Move function from vfunc to static func
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssstyle: Move function from vfunc to static func
- Date: Wed, 7 Jan 2015 13:56:57 +0000 (UTC)
commit 9645daf48fa28c26ff623fc9541a860217426e60
Author: Benjamin Otte <otte redhat com>
Date: Wed Dec 17 13:30:51 2014 +0100
cssstyle: Move function from vfunc to static func
compute_dependencies() is only used internally by GtkCssStaticStyle,
so there's no need to have it elsewhere.
gtk/gtkcssanimatedstyle.c | 11 -----------
gtk/gtkcssstaticstyle.c | 12 ++++++++----
gtk/gtkcssstyle.c | 17 -----------------
gtk/gtkcssstyleprivate.h | 9 ---------
4 files changed, 8 insertions(+), 41 deletions(-)
---
diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c
index a86621b..98aa930 100644
--- a/gtk/gtkcssanimatedstyle.c
+++ b/gtk/gtkcssanimatedstyle.c
@@ -63,16 +63,6 @@ gtk_css_animated_style_get_section (GtkCssStyle *style,
return gtk_css_style_get_section (animated->style, id);
}
-static GtkBitmask *
-gtk_css_animated_style_compute_dependencies (GtkCssStyle *style,
- const GtkBitmask *parent_changes)
-{
- GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
-
- /* XXX: This misses dependencies due to animations */
- return gtk_css_style_compute_dependencies (animated->style, parent_changes);
-}
-
static void
gtk_css_animated_style_dispose (GObject *object)
{
@@ -111,7 +101,6 @@ gtk_css_animated_style_class_init (GtkCssAnimatedStyleClass *klass)
style_class->get_value = gtk_css_animated_style_get_value;
style_class->get_section = gtk_css_animated_style_get_section;
- style_class->compute_dependencies = gtk_css_animated_style_compute_dependencies;
}
static void
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index d34deb0..d849953 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -65,9 +65,14 @@ gtk_css_static_style_get_section (GtkCssStyle *style,
return g_ptr_array_index (sstyle->sections, 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.
+ */
static GtkBitmask *
-gtk_css_static_style_compute_dependencies (GtkCssStyle *style,
- const GtkBitmask *parent_changes)
+gtk_css_static_style_compute_dependencies (GtkCssStaticStyle *style,
+ const GtkBitmask *parent_changes)
{
GtkCssStaticStyle *sstyle = GTK_CSS_STATIC_STYLE (style);
GtkBitmask *changes;
@@ -125,7 +130,6 @@ gtk_css_static_style_class_init (GtkCssStaticStyleClass *klass)
style_class->get_value = gtk_css_static_style_get_value;
style_class->get_section = gtk_css_static_style_get_section;
- style_class->compute_dependencies = gtk_css_static_style_compute_dependencies;
}
static void
@@ -225,7 +229,7 @@ gtk_css_static_style_new_update (GtkCssStaticStyle *style,
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
gtk_internal_return_val_if_fail (matcher != NULL, NULL);
- changes = gtk_css_style_compute_dependencies (GTK_CSS_STYLE (style), parent_changes);
+ changes = gtk_css_static_style_compute_dependencies (style, parent_changes);
if (_gtk_bitmask_is_empty (changes))
{
_gtk_bitmask_free (changes);
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index f24557c..040998b 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -46,18 +46,10 @@ gtk_css_style_real_get_section (GtkCssStyle *style,
return NULL;
}
-static GtkBitmask *
-gtk_css_style_real_compute_dependencies (GtkCssStyle *style,
- const GtkBitmask *parent_changes)
-{
- return _gtk_bitmask_copy (parent_changes);
-}
-
static void
gtk_css_style_class_init (GtkCssStyleClass *klass)
{
klass->get_section = gtk_css_style_real_get_section;
- klass->compute_dependencies = gtk_css_style_real_compute_dependencies;
}
static void
@@ -102,15 +94,6 @@ gtk_css_style_get_difference (GtkCssStyle *style,
return result;
}
-GtkBitmask *
-gtk_css_style_compute_dependencies (GtkCssStyle *style,
- const GtkBitmask *parent_changes)
-{
- gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), _gtk_bitmask_new ());
-
- return GTK_CSS_STYLE_GET_CLASS (style)->compute_dependencies (style, parent_changes);
-}
-
void
gtk_css_style_print (GtkCssStyle *style,
GString *string)
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h
index d61b4c3..ad5b596 100644
--- a/gtk/gtkcssstyleprivate.h
+++ b/gtk/gtkcssstyleprivate.h
@@ -54,13 +54,6 @@ struct _GtkCssStyleClass
* 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;
@@ -71,8 +64,6 @@ GtkCssSection * gtk_css_style_get_section (GtkCssStyle
guint id);
GtkBitmask * gtk_css_style_get_difference (GtkCssStyle *style,
GtkCssStyle *other);
-GtkBitmask * gtk_css_style_compute_dependencies (GtkCssStyle *style,
- const GtkBitmask *parent_changes);
char * gtk_css_style_to_string (GtkCssStyle *style);
void gtk_css_style_print (GtkCssStyle *style,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]