[gtk+] css: Remove GtkCssStyleProperty::affects-size
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] css: Remove GtkCssStyleProperty::affects-size
- Date: Tue, 27 Jan 2015 04:08:25 +0000 (UTC)
commit ffff7b055bb82f4412c6c0549b84e90f285b5480
Author: Benjamin Otte <otte redhat com>
Date: Tue Jan 27 04:36:00 2015 +0100
css: Remove GtkCssStyleProperty::affects-size
... and GtkCssStyleProperty::affects-font properties. Code now uses
GtkCssStyleProperty::affects instead.
gtk/gtkcssstyleproperty.c | 68 +------------------------------------
gtk/gtkcssstylepropertyimpl.c | 2 -
gtk/gtkcssstylepropertyprivate.h | 2 -
3 files changed, 2 insertions(+), 70 deletions(-)
---
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 5f99a1b..4d04dc7 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -40,8 +40,6 @@ enum {
PROP_0,
PROP_ANIMATED,
PROP_AFFECTS,
- PROP_AFFECTS_SIZE,
- PROP_AFFECTS_FONT,
PROP_ID,
PROP_INHERIT,
PROP_INITIAL
@@ -63,10 +61,10 @@ gtk_css_style_property_constructed (GObject *object)
property->id = klass->style_properties->len;
g_ptr_array_add (klass->style_properties, property);
- if (property->affects_size)
+ if (property->affects & (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
_properties_affecting_size = _gtk_bitmask_set (_properties_affecting_size, property->id, TRUE);
- if (property->affects_font)
+ if (property->affects & GTK_CSS_AFFECTS_FONT)
_properties_affecting_font = _gtk_bitmask_set (_properties_affecting_font, property->id, TRUE);
G_OBJECT_CLASS (_gtk_css_style_property_parent_class)->constructed (object);
@@ -88,12 +86,6 @@ gtk_css_style_property_set_property (GObject *object,
case PROP_AFFECTS:
property->affects = g_value_get_flags (value);
break;
- case PROP_AFFECTS_SIZE:
- property->affects_size = g_value_get_boolean (value);
- break;
- case PROP_AFFECTS_FONT:
- property->affects_font = g_value_get_boolean (value);
- break;
case PROP_INHERIT:
property->inherit = g_value_get_boolean (value);
break;
@@ -123,12 +115,6 @@ gtk_css_style_property_get_property (GObject *object,
case PROP_AFFECTS:
g_value_set_flags (value, property->affects);
break;
- case PROP_AFFECTS_SIZE:
- g_value_set_boolean (value, property->affects_size);
- break;
- case PROP_AFFECTS_FONT:
- g_value_set_boolean (value, property->affects_font);
- break;
case PROP_ID:
g_value_set_boolean (value, property->id);
break;
@@ -240,20 +226,6 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
- PROP_AFFECTS_SIZE,
- g_param_spec_boolean ("affects-size",
- P_("Affects size"),
- P_("Set if the value affects the sizing of
elements"),
- TRUE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class,
- PROP_AFFECTS_FONT,
- g_param_spec_boolean ("affects-font",
- P_("Affects font"),
- P_("Set if the value affects the font"),
- FALSE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class,
PROP_ID,
g_param_spec_uint ("id",
P_("ID"),
@@ -400,42 +372,6 @@ _gtk_css_style_property_get_affects (GtkCssStyleProperty *property)
}
/**
- * _gtk_css_style_property_affects_size:
- * @property: the property
- *
- * Queries if the given @property affects the size of elements. This is
- * used for optimizations inside GTK, where a gtk_widget_queue_resize()
- * can be avoided if the property does not affect size.
- *
- * Returns: %TRUE if the property affects sizing of elements.
- **/
-gboolean
-_gtk_css_style_property_affects_size (GtkCssStyleProperty *property)
-{
- g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), FALSE);
-
- return property->affects_size;
-}
-
-/**
- * _gtk_css_style_property_affects_font:
- * @property: the property
- *
- * Queries if the given @property affects the default font. This is
- * used for optimizations inside GTK, where clearing pango
- * layouts can be avoided if the font doesn’t change.
- *
- * Returns: %TRUE if the property affects the font.
- **/
-gboolean
-_gtk_css_style_property_affects_font (GtkCssStyleProperty *property)
-{
- g_return_val_if_fail (GTK_IS_CSS_STYLE_PROPERTY (property), FALSE);
-
- return property->affects_font;
-}
-
-/**
* _gtk_css_style_property_get_id:
* @property: the property
*
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index d1ce972..9f90184 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -92,8 +92,6 @@ gtk_css_style_property_register (const char * name,
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
"value-type", value_type,
"affects", affects,
- "affects-size", (affects & (GTK_CSS_AFFECTS_CLIP | GTK_CSS_AFFECTS_SIZE)) ? TRUE :
FALSE,
- "affects-font", (affects & GTK_CSS_AFFECTS_FONT) ? TRUE : FALSE,
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
"initial-value", initial_value,
diff --git a/gtk/gtkcssstylepropertyprivate.h b/gtk/gtkcssstylepropertyprivate.h
index bd72bc9..47cd051 100644
--- a/gtk/gtkcssstylepropertyprivate.h
+++ b/gtk/gtkcssstylepropertyprivate.h
@@ -50,8 +50,6 @@ struct _GtkCssStyleProperty
GtkCssAffects affects;
guint inherit :1;
guint animated :1;
- guint affects_size :1;
- guint affects_font :1;
GtkCssStylePropertyParseFunc parse_value;
GtkCssStylePropertyQueryFunc query_value;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]