[gtk+/wip/ricotz/deprecated: 5/7] stylecontext: Remove deprecated API
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ricotz/deprecated: 5/7] stylecontext: Remove deprecated API
- Date: Sun, 23 Oct 2016 16:24:46 +0000 (UTC)
commit 502e63eddc6c8c705edbc89c26572a443baa6e26
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Oct 23 17:26:37 2016 +0200
stylecontext: Remove deprecated API
docs/reference/gtk/gtk4-sections.txt | 3 -
gtk/gtkstylecontext.c | 126 ----------------------------------
gtk/gtkstylecontext.h | 8 --
testsuite/gtk/stylecontext.c | 19 -----
4 files changed, 0 insertions(+), 156 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 36a9a91..683ca98 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -5396,7 +5396,6 @@ gtk_style_context_new
gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_get
-gtk_style_context_get_direction
GtkJunctionSides
gtk_style_context_get_junction_sides
gtk_style_context_get_parent
@@ -5417,7 +5416,6 @@ gtk_style_context_get_border
gtk_style_context_get_padding
gtk_style_context_get_margin
gtk_style_context_get_font
-gtk_style_context_invalidate
gtk_style_context_state_is_running
gtk_style_context_lookup_color
gtk_style_context_remove_provider
@@ -5426,7 +5424,6 @@ gtk_style_context_reset_widgets
gtk_style_context_set_background
gtk_style_context_restore
gtk_style_context_save
-gtk_style_context_set_direction
gtk_style_context_set_junction_sides
gtk_style_context_set_parent
gtk_style_context_set_path
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 326d7ab..5911db3 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -144,7 +144,6 @@ struct _GtkStyleContextPrivate
enum {
PROP_0,
PROP_SCREEN,
- PROP_DIRECTION,
PROP_FRAME_CLOCK,
PROP_PARENT,
LAST_PROP
@@ -230,14 +229,6 @@ gtk_style_context_class_init (GtkStyleContextClass *klass)
GDK_TYPE_FRAME_CLOCK,
GTK_PARAM_READWRITE);
- properties[PROP_DIRECTION] =
- g_param_spec_enum ("direction",
- P_("Direction"),
- P_("Text direction"),
- GTK_TYPE_TEXT_DIRECTION,
- GTK_TEXT_DIR_LTR,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED);
-
/**
* GtkStyleContext:parent:
*
@@ -394,11 +385,6 @@ gtk_style_context_impl_set_property (GObject *object,
case PROP_SCREEN:
gtk_style_context_set_screen (context, g_value_get_object (value));
break;
- case PROP_DIRECTION:
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- gtk_style_context_set_direction (context, g_value_get_enum (value));
- G_GNUC_END_IGNORE_DEPRECATIONS;
- break;
case PROP_FRAME_CLOCK:
gtk_style_context_set_frame_clock (context, g_value_get_object (value));
break;
@@ -425,11 +411,6 @@ gtk_style_context_impl_get_property (GObject *object,
case PROP_SCREEN:
g_value_set_object (value, priv->screen);
break;
- case PROP_DIRECTION:
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- g_value_set_enum (value, gtk_style_context_get_direction (context));
- G_GNUC_END_IGNORE_DEPRECATIONS;
- break;
case PROP_FRAME_CLOCK:
g_value_set_object (value, priv->frame_clock);
break;
@@ -898,17 +879,9 @@ void
gtk_style_context_set_state (GtkStyleContext *context,
GtkStateFlags flags)
{
- GtkStateFlags old_flags;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- old_flags = gtk_css_node_get_state (context->priv->cssnode);
-
gtk_css_node_set_state (context->priv->cssnode, flags);
-
- if (((old_flags ^ flags) & (GTK_STATE_FLAG_DIR_LTR | GTK_STATE_FLAG_DIR_RTL)) &&
- !gtk_style_context_is_saved (context))
- g_object_notify_by_pspec (G_OBJECT (context), properties[PROP_DIRECTION]);
}
/**
@@ -1758,83 +1731,6 @@ gtk_style_context_get_frame_clock (GtkStyleContext *context)
}
/**
- * gtk_style_context_set_direction:
- * @context: a #GtkStyleContext
- * @direction: the new direction.
- *
- * Sets the reading direction for rendering purposes.
- *
- * If you are using a #GtkStyleContext returned from
- * gtk_widget_get_style_context(), you do not need to
- * call this yourself.
- *
- * Since: 3.0
- *
- * Deprecated: 3.8: Use gtk_style_context_set_state() with
- * #GTK_STATE_FLAG_DIR_LTR and #GTK_STATE_FLAG_DIR_RTL
- * instead.
- **/
-void
-gtk_style_context_set_direction (GtkStyleContext *context,
- GtkTextDirection direction)
-{
- GtkStateFlags state;
-
- g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-
- state = gtk_style_context_get_state (context);
- state &= ~(GTK_STATE_FLAG_DIR_LTR | GTK_STATE_FLAG_DIR_RTL);
-
- switch (direction)
- {
- case GTK_TEXT_DIR_LTR:
- state |= GTK_STATE_FLAG_DIR_LTR;
- break;
-
- case GTK_TEXT_DIR_RTL:
- state |= GTK_STATE_FLAG_DIR_RTL;
- break;
-
- case GTK_TEXT_DIR_NONE:
- default:
- break;
- }
-
- gtk_style_context_set_state (context, state);
-}
-
-/**
- * gtk_style_context_get_direction:
- * @context: a #GtkStyleContext
- *
- * Returns the widget direction used for rendering.
- *
- * Returns: the widget direction
- *
- * Since: 3.0
- *
- * Deprecated: 3.8: Use gtk_style_context_get_state() and
- * check for #GTK_STATE_FLAG_DIR_LTR and
- * #GTK_STATE_FLAG_DIR_RTL instead.
- **/
-GtkTextDirection
-gtk_style_context_get_direction (GtkStyleContext *context)
-{
- GtkStateFlags state;
-
- g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), GTK_TEXT_DIR_LTR);
-
- state = gtk_style_context_get_state (context);
-
- if (state & GTK_STATE_FLAG_DIR_LTR)
- return GTK_TEXT_DIR_LTR;
- else if (state & GTK_STATE_FLAG_DIR_RTL)
- return GTK_TEXT_DIR_RTL;
- else
- return GTK_TEXT_DIR_NONE;
-}
-
-/**
* gtk_style_context_set_junction_sides:
* @context: a #GtkStyleContext
* @sides: sides where rendered elements are visually connected to
@@ -1957,28 +1853,6 @@ gtk_style_context_validate (GtkStyleContext *context,
}
/**
- * gtk_style_context_invalidate:
- * @context: a #GtkStyleContext.
- *
- * Invalidates @context style information, so it will be reconstructed
- * again. It is useful if you modify the @context and need the new
- * information immediately.
- *
- * Since: 3.0
- *
- * Deprecated: 3.12: Style contexts are invalidated automatically.
- **/
-void
-gtk_style_context_invalidate (GtkStyleContext *context)
-{
- g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-
- gtk_style_context_clear_property_cache (context);
-
- gtk_style_context_validate (context, NULL);
-}
-
-/**
* gtk_style_context_get_color:
* @context: a #GtkStyleContext
* @color: (out): return value for the foreground color
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 6a6d3a8..a7f7825 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -1080,12 +1080,6 @@ void gtk_style_context_set_frame_clock (GtkStyleContext *context,
GDK_AVAILABLE_IN_3_8
GdkFrameClock *gtk_style_context_get_frame_clock (GtkStyleContext *context);
-GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_set_state)
-void gtk_style_context_set_direction (GtkStyleContext *context,
- GtkTextDirection direction);
-GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get_state)
-GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context);
-
GDK_AVAILABLE_IN_ALL
void gtk_style_context_set_junction_sides (GtkStyleContext *context,
GtkJunctionSides sides);
@@ -1118,8 +1112,6 @@ GDK_AVAILABLE_IN_ALL
void gtk_style_context_get_margin (GtkStyleContext *context,
GtkBorder *margin);
-GDK_DEPRECATED_IN_3_12
-void gtk_style_context_invalidate (GtkStyleContext *context);
GDK_AVAILABLE_IN_ALL
void gtk_style_context_reset_widgets (GdkScreen *screen);
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
index e12b1ae..57a8dd5 100644
--- a/testsuite/gtk/stylecontext.c
+++ b/testsuite/gtk/stylecontext.c
@@ -258,24 +258,6 @@ test_basic_properties (void)
}
void
-test_invalidate_saved (void)
-{
- GtkWidget *window;
- GtkStyleContext *context;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- context = gtk_widget_get_style_context (window);
- gtk_style_context_save (context);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_style_context_invalidate (context);
-G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_style_context_restore (context);
-
- gtk_widget_destroy (window);
-}
-
-void
test_widget_path_parent (void)
{
GtkStyleContext *parent, *context;
@@ -533,7 +515,6 @@ main (int argc, char *argv[])
g_test_add_func ("/style/path", test_path);
g_test_add_func ("/style/match", test_match);
g_test_add_func ("/style/basic", test_basic_properties);
- g_test_add_func ("/style/invalidate-saved", test_invalidate_saved);
g_test_add_func ("/style/widget-path-parent", test_widget_path_parent);
g_test_add_func ("/style/classes", test_style_classes);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]