[gtk+/wip/cssvalue: 122/164] css: Remove old animation code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssvalue: 122/164] css: Remove old animation code
- Date: Wed, 11 Apr 2012 14:50:10 +0000 (UTC)
commit c6e5a4d16b2d9acb2f40e06c92c7a13f4404f51c
Author: Benjamin Otte <otte redhat com>
Date: Wed Apr 4 18:55:51 2012 +0200
css: Remove old animation code
Deprecate public API where appropriate and make it no-ops.
Remove all calls to it.
Get rid of the 'transition' css property.
For now, this means spinners don't animate anymore.
gtk/Makefile.am | 4 -
gtk/gtk-default.css | 8 -
gtk/gtk-win32-base.css | 6 +-
gtk/gtkanimationdescription.c | 175 ----------
gtk/gtkanimationdescription.h | 49 ---
gtk/gtkcssstylefuncs.c | 42 ---
gtk/gtkcssstylepropertyimpl.c | 48 ---
gtk/gtkcsstypesprivate.h | 1 -
gtk/gtkexpander.c | 23 --
gtk/gtkstylecontext.c | 574 +------------------------------
gtk/gtkstylecontext.h | 6 +
gtk/gtkstylecontextprivate.h | 3 -
gtk/gtkstyleproperties.c | 1 -
gtk/gtkswitch.c | 11 -
gtk/gtkthemingengine.c | 7 +-
gtk/gtktimeline.c | 760 -----------------------------------------
gtk/gtktimeline.h | 116 -------
gtk/gtktoolitemgroup.c | 19 -
gtk/gtktreeview.c | 52 ---
gtk/gtkwidget.c | 119 -------
tests/styleexamples.c | 6 -
21 files changed, 23 insertions(+), 2007 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 062b999..7d8d6dd 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -405,7 +405,6 @@ gtk_private_h_sources = \
gtkaccelgroupprivate.h \
gtkaccelmapprivate.h \
gtkallocatedbitmaskprivate.h \
- gtkanimationdescription.h \
gtkappchooserprivate.h \
gtkappchoosermodule.h \
gtkappchooseronline.h \
@@ -525,7 +524,6 @@ gtk_private_h_sources = \
gtktextutil.h \
gtkthemingbackgroundprivate.h \
gtkthemingengineprivate.h \
- gtktimeline.h \
gtktoolpaletteprivate.h \
gtktreedatalist.h \
gtktreeprivate.h \
@@ -591,7 +589,6 @@ gtk_base_c_sources = \
gtkappchooseronline.c \
gtkapplication.c \
gtkapplicationwindow.c \
- gtkanimationdescription.c \
gtkarrow.c \
gtkaspectframe.c \
gtkassistant.c \
@@ -819,7 +816,6 @@ gtk_base_c_sources = \
gtktextview.c \
gtkthemingbackground.c \
gtkthemingengine.c \
- gtktimeline.c \
gtktoggleaction.c \
gtktogglebutton.c \
gtktoggletoolbutton.c \
diff --git a/gtk/gtk-default.css b/gtk/gtk-default.css
index 023139f..593ae89 100644
--- a/gtk/gtk-default.css
+++ b/gtk/gtk-default.css
@@ -36,10 +36,6 @@ GtkTreeView.view.expander:selected:hover {
color: @text_color;
}
-.expander:active {
- transition: 200ms linear;
-}
-
*:insensitive {
border-color: shade (@bg_color, 0.7);
background-color: shade (@bg_color, 0.9);
@@ -295,10 +291,6 @@ GtkLabel:selected:focused {
background-color: @selected_bg_color;
}
-.spinner:active {
- transition: 750ms linear loop;
-}
-
.info {
background-color: @info_bg_color;
color: @info_fg_color;
diff --git a/gtk/gtk-win32-base.css b/gtk/gtk-win32-base.css
index f628456..0c86bbb 100644
--- a/gtk/gtk-win32-base.css
+++ b/gtk/gtk-win32-base.css
@@ -77,10 +77,6 @@ GtkFrame {
color: #fff;
}
-.spinner:active {
- transition: 750ms linear loop;
-}
-
.notebook > GtkScrolledWindow.frame {
border-style: none;
}
@@ -837,4 +833,4 @@ GtkStatusbar > GtkFrame {
background-color: transparent;
background-image: -gtk-win32-theme-part(status, 3 1);
}
-*/
\ No newline at end of file
+*/
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 2105d5a..3315fbf 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -27,7 +27,6 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <cairo-gobject.h>
-#include "gtkanimationdescription.h"
#include "gtkcssimagegradientprivate.h"
#include "gtkcssprovider.h"
#include "gtkcssrgbavalueprivate.h"
@@ -603,43 +602,6 @@ theming_engine_value_print (const GValue *value,
}
static gboolean
-animation_description_value_parse (GtkCssParser *parser,
- GFile *base,
- GValue *value)
-{
- GtkAnimationDescription *desc;
- char *str;
-
- str = _gtk_css_parser_read_value (parser);
- if (str == NULL)
- return FALSE;
-
- desc = _gtk_animation_description_from_string (str);
- g_free (str);
-
- if (desc == NULL)
- {
- _gtk_css_parser_error (parser, "Invalid animation description");
- return FALSE;
- }
-
- g_value_take_boxed (value, desc);
- return TRUE;
-}
-
-static void
-animation_description_value_print (const GValue *value,
- GString *string)
-{
- GtkAnimationDescription *desc = g_value_get_boxed (value);
-
- if (desc == NULL)
- g_string_append (string, "none");
- else
- _gtk_animation_description_print (desc, string);
-}
-
-static gboolean
border_value_parse (GtkCssParser *parser,
GFile *base,
GValue *value)
@@ -1038,10 +1000,6 @@ gtk_css_style_funcs_init (void)
theming_engine_value_parse,
theming_engine_value_print,
NULL);
- register_conversion_function (GTK_TYPE_ANIMATION_DESCRIPTION,
- animation_description_value_parse,
- animation_description_value_print,
- NULL);
register_conversion_function (GTK_TYPE_BORDER,
border_value_parse,
border_value_print,
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index a5aafc0..6da51b0 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -38,7 +38,6 @@
#include "fallback-c89.c"
/* the actual parsers we have */
-#include "gtkanimationdescription.h"
#include "gtkbindings.h"
#include "gtkcssarrayvalueprivate.h"
#include "gtkcssbgsizevalueprivate.h"
@@ -114,21 +113,6 @@ gtk_css_style_property_register (const char * name,
/*** IMPLEMENTATIONS ***/
static void
-query_simple (GtkCssStyleProperty *property,
- const GtkCssValue *css_value,
- GValue *value)
-{
- _gtk_css_value_init_gvalue (css_value, value);
-}
-
-static GtkCssValue *
-assign_simple (GtkCssStyleProperty *property,
- const GValue *value)
-{
- return _gtk_css_value_new_from_gvalue (value);
-}
-
-static void
query_length_as_int (GtkCssStyleProperty *property,
const GtkCssValue *css_value,
GValue *value)
@@ -817,27 +801,6 @@ engine_assign (GtkCssStyleProperty *property,
}
static GtkCssValue *
-transition_parse (GtkCssStyleProperty *property,
- GtkCssParser *parser,
- GFile *base)
-{
- GValue value = G_VALUE_INIT;
- GtkCssValue *result;
-
- g_value_init (&value, GTK_TYPE_ANIMATION_DESCRIPTION);
- if (!_gtk_css_style_parse_value (&value, parser, base))
- {
- g_value_unset (&value);
- return NULL;
- }
-
- result = _gtk_css_value_new_from_gvalue (&value);
- g_value_unset (&value);
-
- return result;
-}
-
-static GtkCssValue *
parse_margin (GtkCssStyleProperty *property,
GtkCssParser *parser,
GFile *base)
@@ -1602,17 +1565,6 @@ _gtk_css_style_property_init_properties (void)
engine_assign,
NULL,
_gtk_css_engine_value_new (gtk_theming_engine_load (NULL)));
- gtk_css_style_property_register ("transition",
- GTK_CSS_PROPERTY_TRANSITION,
- GTK_TYPE_ANIMATION_DESCRIPTION,
- 0,
- transition_parse,
- NULL,
- NULL,
- query_simple,
- assign_simple,
- NULL,
- _gtk_css_value_new_from_boxed (GTK_TYPE_ANIMATION_DESCRIPTION, NULL));
/* Private property holding the binding sets */
gtk_css_style_property_register ("gtk-key-bindings",
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 9f2b370..22c1546 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -108,7 +108,6 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
GTK_CSS_PROPERTY_TRANSITION_DELAY,
GTK_CSS_PROPERTY_ENGINE,
- GTK_CSS_PROPERTY_TRANSITION,
GTK_CSS_PROPERTY_GTK_KEY_BINDINGS,
/* add more */
GTK_CSS_PROPERTY_N_PROPERTIES
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index a72cc1f..6a98910 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -911,15 +911,11 @@ gtk_expander_paint (GtkExpander *expander,
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
- /* The expander is the only animatable region */
- gtk_style_context_push_animatable_region (context, GUINT_TO_POINTER (1));
-
gtk_render_expander (context, cr,
clip.x - allocation.x,
clip.y - allocation.y,
size, size);
- gtk_style_context_pop_animatable_region (context);
gtk_style_context_restore (context);
}
@@ -1709,28 +1705,9 @@ gtk_expander_set_expanded (GtkExpander *expander,
if (priv->expanded != expanded)
{
GtkWidget *widget = GTK_WIDGET (expander);
- GtkSettings *settings = gtk_widget_get_settings (widget);
- GtkStyleContext *context;
- gboolean enable_animations;
- context = gtk_widget_get_style_context (widget);
priv->expanded = expanded;
- g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
-
- if (enable_animations && gtk_widget_get_realized (widget))
- {
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
-
- gtk_style_context_notify_state_change (context,
- gtk_widget_get_window (widget),
- GUINT_TO_POINTER (1),
- GTK_STATE_ACTIVE,
- expanded);
- gtk_style_context_restore (context);
- }
-
child = gtk_bin_get_child (GTK_BIN (expander));
if (child)
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index b59d217..99b013f 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -33,9 +33,7 @@
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtksymboliccolorprivate.h"
-#include "gtkanimationdescription.h"
#include "gtkcssnumbervalueprivate.h"
-#include "gtktimeline.h"
#include "gtkiconfactory.h"
#include "gtkwidgetpath.h"
#include "gtkwidgetprivate.h"
@@ -314,7 +312,6 @@
typedef struct GtkStyleInfo GtkStyleInfo;
typedef struct GtkRegion GtkRegion;
typedef struct PropertyValue PropertyValue;
-typedef struct AnimationInfo AnimationInfo;
typedef struct StyleData StyleData;
struct GtkRegion
@@ -346,25 +343,6 @@ struct StyleData
GArray *property_cache;
};
-struct AnimationInfo
-{
- GtkTimeline *timeline;
-
- gpointer region_id;
-
- /* Region stack (until region_id) at the time of
- * rendering, this is used for nested cancellation.
- */
- GSList *parent_regions;
-
- GdkWindow *window;
- GtkStateType state;
- gboolean target_value;
-
- cairo_region_t *invalidation_region;
- GArray *rectangles;
-};
-
struct _GtkStyleContextPrivate
{
GdkScreen *screen;
@@ -378,9 +356,6 @@ struct _GtkStyleContextPrivate
GHashTable *style_data;
GSList *info_stack;
- GSList *animation_regions;
- GSList *animations;
-
GtkThemingEngine *theming_engine;
GtkTextDirection direction;
@@ -388,7 +363,6 @@ struct _GtkStyleContextPrivate
GtkCssChange relevant_changes;
GtkCssChange pending_changes;
- guint animations_invalidated : 1;
guint invalidating_context : 1;
guint invalid : 1;
};
@@ -657,167 +631,10 @@ gtk_style_context_init (GtkStyleContext *style_context)
}
static void
-animation_info_free (AnimationInfo *info)
-{
- g_object_unref (info->timeline);
- g_object_unref (info->window);
-
- if (info->invalidation_region)
- cairo_region_destroy (info->invalidation_region);
-
- g_array_free (info->rectangles, TRUE);
- g_slist_free (info->parent_regions);
- g_slice_free (AnimationInfo, info);
-}
-
-static AnimationInfo *
-animation_info_lookup_by_timeline (GtkStyleContext *context,
- GtkTimeline *timeline)
-{
- GtkStyleContextPrivate *priv;
- AnimationInfo *info;
- GSList *l;
-
- priv = context->priv;
-
- for (l = priv->animations; l; l = l->next)
- {
- info = l->data;
-
- if (info->timeline == timeline)
- return info;
- }
-
- return NULL;
-}
-
-static void
-timeline_frame_cb (GtkTimeline *timeline,
- gdouble progress,
- gpointer user_data)
-{
- GtkStyleContextPrivate *priv;
- GtkStyleContext *context;
- AnimationInfo *info;
-
- context = user_data;
- priv = context->priv;
- info = animation_info_lookup_by_timeline (context, timeline);
-
- g_assert (info != NULL);
-
- /* Cancel transition if window is gone */
- if (gdk_window_is_destroyed (info->window) ||
- !gdk_window_is_visible (info->window))
- {
- priv->animations = g_slist_remove (priv->animations, info);
- animation_info_free (info);
- return;
- }
-
- if (info->invalidation_region &&
- !cairo_region_is_empty (info->invalidation_region))
- gdk_window_invalidate_region (info->window, info->invalidation_region, TRUE);
- else
- gdk_window_invalidate_rect (info->window, NULL, TRUE);
-}
-
-static void
-timeline_finished_cb (GtkTimeline *timeline,
- gpointer user_data)
-{
- GtkStyleContextPrivate *priv;
- GtkStyleContext *context;
- AnimationInfo *info;
-
- context = user_data;
- priv = context->priv;
- info = animation_info_lookup_by_timeline (context, timeline);
-
- g_assert (info != NULL);
-
- priv->animations = g_slist_remove (priv->animations, info);
-
- /* Invalidate one last time the area, so the final content is painted */
- if (info->invalidation_region &&
- !cairo_region_is_empty (info->invalidation_region))
- gdk_window_invalidate_region (info->window, info->invalidation_region, TRUE);
- else
- gdk_window_invalidate_rect (info->window, NULL, TRUE);
-
- animation_info_free (info);
-}
-
-static AnimationInfo *
-animation_info_new (GtkStyleContext *context,
- gpointer region_id,
- guint duration,
- GtkTimelineProgressType progress_type,
- gboolean loop,
- GtkStateType state,
- gboolean target_value,
- GdkWindow *window)
-{
- AnimationInfo *info;
-
- info = g_slice_new0 (AnimationInfo);
-
- info->rectangles = g_array_new (FALSE, FALSE, sizeof (cairo_rectangle_int_t));
- info->timeline = _gtk_timeline_new (duration);
- info->window = g_object_ref (window);
- info->state = state;
- info->target_value = target_value;
- info->region_id = region_id;
-
- _gtk_timeline_set_progress_type (info->timeline, progress_type);
- _gtk_timeline_set_loop (info->timeline, loop);
-
- if (!loop && !target_value)
- {
- _gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
- _gtk_timeline_rewind (info->timeline);
- }
-
- g_signal_connect (info->timeline, "frame",
- G_CALLBACK (timeline_frame_cb), context);
- g_signal_connect (info->timeline, "finished",
- G_CALLBACK (timeline_finished_cb), context);
-
- _gtk_timeline_start (info->timeline);
-
- return info;
-}
-
-static AnimationInfo *
-animation_info_lookup (GtkStyleContext *context,
- gpointer region_id,
- GtkStateType state)
-{
- GtkStyleContextPrivate *priv;
- GSList *l;
-
- priv = context->priv;
-
- for (l = priv->animations; l; l = l->next)
- {
- AnimationInfo *info;
-
- info = l->data;
-
- if (info->state == state &&
- info->region_id == region_id)
- return info;
- }
-
- return NULL;
-}
-
-static void
gtk_style_context_finalize (GObject *object)
{
GtkStyleContextPrivate *priv;
GtkStyleContext *style_context;
- GSList *l;
style_context = GTK_STYLE_CONTEXT (object);
priv = style_context->priv;
@@ -836,13 +653,6 @@ gtk_style_context_finalize (GObject *object)
g_slist_free_full (priv->info_stack, (GDestroyNotify) style_info_free);
- g_slist_free (priv->animation_regions);
-
- for (l = priv->animations; l; l = l->next)
- animation_info_free ((AnimationInfo *) l->data);
-
- g_slist_free (priv->animations);
-
if (priv->theming_engine)
g_object_unref (priv->theming_engine);
@@ -1481,22 +1291,6 @@ gtk_style_context_get_state (GtkStyleContext *context)
return info->state_flags;
}
-static gboolean
-context_has_animatable_region (GtkStyleContext *context,
- gpointer region_id)
-{
- GtkStyleContextPrivate *priv;
-
- /* NULL region_id means everything
- * rendered through the style context
- */
- if (!region_id)
- return TRUE;
-
- priv = context->priv;
- return g_slist_find (priv->animation_regions, region_id) != NULL;
-}
-
/**
* gtk_style_context_state_is_running:
* @context: a #GtkStyleContext
@@ -1515,34 +1309,16 @@ context_has_animatable_region (GtkStyleContext *context,
* Returns: %TRUE if there is a running transition animation for @state.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function always returns %FALSE
**/
gboolean
gtk_style_context_state_is_running (GtkStyleContext *context,
GtkStateType state,
gdouble *progress)
{
- GtkStyleContextPrivate *priv;
- AnimationInfo *info;
- GSList *l;
-
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
- priv = context->priv;
-
- for (l = priv->animations; l; l = l->next)
- {
- info = l->data;
-
- if (info->state == state &&
- context_has_animatable_region (context, info->region_id))
- {
- if (progress)
- *progress = _gtk_timeline_get_progress (info->timeline);
-
- return TRUE;
- }
- }
-
return FALSE;
}
@@ -2864,6 +2640,8 @@ gtk_style_context_lookup_color (GtkStyleContext *context,
* is why the style places the transition under the :hover pseudo-class.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function does nothing.
**/
void
gtk_style_context_notify_state_change (GtkStyleContext *context,
@@ -2872,100 +2650,10 @@ gtk_style_context_notify_state_change (GtkStyleContext *context,
GtkStateType state,
gboolean state_value)
{
- GtkStyleContextPrivate *priv;
- GtkAnimationDescription *desc;
- AnimationInfo *info;
- GtkStateFlags flags;
- GtkCssValue *v;
- StyleData *data;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (state > GTK_STATE_NORMAL && state <= GTK_STATE_FOCUSED);
-
- priv = context->priv;
- g_return_if_fail (priv->widget != NULL || priv->widget_path != NULL);
-
- state_value = (state_value == TRUE);
-
- switch (state)
- {
- case GTK_STATE_ACTIVE:
- flags = GTK_STATE_FLAG_ACTIVE;
- break;
- case GTK_STATE_PRELIGHT:
- flags = GTK_STATE_FLAG_PRELIGHT;
- break;
- case GTK_STATE_SELECTED:
- flags = GTK_STATE_FLAG_SELECTED;
- break;
- case GTK_STATE_INSENSITIVE:
- flags = GTK_STATE_FLAG_INSENSITIVE;
- break;
- case GTK_STATE_INCONSISTENT:
- flags = GTK_STATE_FLAG_INCONSISTENT;
- break;
- case GTK_STATE_FOCUSED:
- flags = GTK_STATE_FLAG_FOCUSED;
- break;
- case GTK_STATE_NORMAL:
- default:
- flags = 0;
- break;
- }
-
- /* Find out if there is any animation description for the given
- * state, it will fallback to the normal state as well if necessary.
- */
- gtk_style_context_save (context);
- gtk_style_context_set_state (context, flags);
- data = style_data_lookup (context);
- gtk_style_context_restore (context);
- v = _gtk_css_computed_values_get_value (data->store, GTK_CSS_PROPERTY_TRANSITION);
- if (!v)
- return;
- desc = _gtk_css_value_get_boxed (v);
- if (!desc)
- return;
-
- if (_gtk_animation_description_get_duration (desc) == 0)
- return;
-
- info = animation_info_lookup (context, region_id, state);
-
- if (info &&
- info->target_value != state_value)
- {
- /* Target values are the opposite */
- if (!_gtk_timeline_get_loop (info->timeline))
- {
- /* Reverse the animation */
- if (_gtk_timeline_get_direction (info->timeline) == GTK_TIMELINE_DIRECTION_FORWARD)
- _gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
- else
- _gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_FORWARD);
-
- info->target_value = state_value;
- }
- else
- {
- /* Take it out of its looping state */
- _gtk_timeline_set_loop (info->timeline, FALSE);
- }
- }
- else if (!info &&
- (!_gtk_animation_description_get_loop (desc) ||
- state_value))
- {
- info = animation_info_new (context, region_id,
- _gtk_animation_description_get_duration (desc),
- _gtk_animation_description_get_progress_type (desc),
- _gtk_animation_description_get_loop (desc),
- state, state_value, window);
-
- priv->animations = g_slist_prepend (priv->animations, info);
- priv->animations_invalidated = TRUE;
- }
+ g_return_if_fail (context->priv->widget != NULL || context->priv->widget_path != NULL);
}
/**
@@ -2985,60 +2673,14 @@ gtk_style_context_notify_state_change (GtkStyleContext *context,
* animatable regions.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function does nothing.
**/
void
gtk_style_context_cancel_animations (GtkStyleContext *context,
gpointer region_id)
{
- GtkStyleContextPrivate *priv;
- AnimationInfo *info;
- GSList *l;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-
- priv = context->priv;
- l = priv->animations;
-
- while (l)
- {
- info = l->data;
- l = l->next;
-
- if (!region_id ||
- info->region_id == region_id ||
- g_slist_find (info->parent_regions, region_id))
- {
- priv->animations = g_slist_remove (priv->animations, info);
- animation_info_free (info);
- }
- }
-}
-
-static gboolean
-is_parent_of (GdkWindow *parent,
- GdkWindow *child)
-{
- GtkWidget *child_widget, *parent_widget;
- GdkWindow *window;
-
- gdk_window_get_user_data (child, (gpointer *) &child_widget);
- gdk_window_get_user_data (parent, (gpointer *) &parent_widget);
-
- if (child_widget != parent_widget &&
- !gtk_widget_is_ancestor (child_widget, parent_widget))
- return FALSE;
-
- window = child;
-
- while (window)
- {
- if (window == parent)
- return TRUE;
-
- window = gdk_window_get_parent (window);
- }
-
- return FALSE;
}
/**
@@ -3055,6 +2697,8 @@ is_parent_of (GdkWindow *parent,
* with it.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function does nothing.
**/
void
gtk_style_context_scroll_animations (GtkStyleContext *context,
@@ -3062,26 +2706,8 @@ gtk_style_context_scroll_animations (GtkStyleContext *context,
gint dx,
gint dy)
{
- GtkStyleContextPrivate *priv;
- AnimationInfo *info;
- GSList *l;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (GDK_IS_WINDOW (window));
-
- priv = context->priv;
- l = priv->animations;
-
- while (l)
- {
- info = l->data;
- l = l->next;
-
- if (info->invalidation_region &&
- (window == info->window ||
- is_parent_of (window, info->window)))
- cairo_region_translate (info->invalidation_region, dx, dy);
- }
}
/**
@@ -3100,18 +2726,15 @@ gtk_style_context_scroll_animations (GtkStyleContext *context,
* can uniquely identify rendered elements subject to a state transition.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function does nothing.
**/
void
gtk_style_context_push_animatable_region (GtkStyleContext *context,
gpointer region_id)
{
- GtkStyleContextPrivate *priv;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
g_return_if_fail (region_id != NULL);
-
- priv = context->priv;
- priv->animation_regions = g_slist_prepend (priv->animation_regions, region_id);
}
/**
@@ -3122,150 +2745,13 @@ gtk_style_context_push_animatable_region (GtkStyleContext *context,
* See gtk_style_context_push_animatable_region().
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: This function does nothing.
**/
void
gtk_style_context_pop_animatable_region (GtkStyleContext *context)
{
- GtkStyleContextPrivate *priv;
-
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-
- priv = context->priv;
- priv->animation_regions = g_slist_delete_link (priv->animation_regions,
- priv->animation_regions);
-}
-
-void
-_gtk_style_context_invalidate_animation_areas (GtkStyleContext *context)
-{
- GtkStyleContextPrivate *priv;
- GSList *l;
-
- priv = context->priv;
-
- for (l = priv->animations; l; l = l->next)
- {
- AnimationInfo *info;
-
- info = l->data;
-
- /* A NULL invalidation region means it has to be recreated on
- * the next expose event, this happens usually after a widget
- * allocation change, so the next expose after it will update
- * the invalidation region.
- */
- if (info->invalidation_region)
- {
- cairo_region_destroy (info->invalidation_region);
- info->invalidation_region = NULL;
- }
- }
-
- priv->animations_invalidated = TRUE;
-}
-
-void
-_gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
- GtkWidget *widget)
-{
- GtkStyleContextPrivate *priv;
- GSList *l;
-
- priv = context->priv;
-
- if (!priv->animations_invalidated)
- return;
-
- l = priv->animations;
-
- while (l)
- {
- AnimationInfo *info;
- gint rel_x, rel_y;
- GSList *cur;
- guint i;
-
- cur = l;
- info = cur->data;
- l = l->next;
-
- if (info->invalidation_region)
- continue;
-
- if (info->rectangles->len == 0)
- continue;
-
- info->invalidation_region = cairo_region_create ();
- _gtk_widget_get_translation_to_window (widget, info->window, &rel_x, &rel_y);
-
- for (i = 0; i < info->rectangles->len; i++)
- {
- cairo_rectangle_int_t *rect;
-
- rect = &g_array_index (info->rectangles, cairo_rectangle_int_t, i);
-
- /* These are widget relative coordinates,
- * so have them inverted to be window relative
- */
- rect->x -= rel_x;
- rect->y -= rel_y;
-
- cairo_region_union_rectangle (info->invalidation_region, rect);
- }
-
- g_array_remove_range (info->rectangles, 0, info->rectangles->len);
- }
-
- priv->animations_invalidated = FALSE;
-}
-
-static void
-store_animation_region (GtkStyleContext *context,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
-{
- GtkStyleContextPrivate *priv;
- GSList *l;
-
- priv = context->priv;
-
- if (!priv->animations_invalidated)
- return;
-
- for (l = priv->animations; l; l = l->next)
- {
- AnimationInfo *info;
-
- info = l->data;
-
- /* The animation doesn't need updating
- * the invalidation area, bail out.
- */
- if (info->invalidation_region)
- continue;
-
- if (context_has_animatable_region (context, info->region_id))
- {
- cairo_rectangle_int_t rect;
-
- rect.x = (gint) x;
- rect.y = (gint) y;
- rect.width = (gint) width;
- rect.height = (gint) height;
-
- g_array_append_val (info->rectangles, rect);
-
- if (!info->parent_regions)
- {
- GSList *parent_regions;
-
- parent_regions = g_slist_find (priv->animation_regions, info->region_id);
- info->parent_regions = g_slist_copy (parent_regions);
- }
- }
- }
}
static void
@@ -3775,7 +3261,6 @@ gtk_render_check (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_check (priv->theming_engine, cr,
@@ -3826,8 +3311,6 @@ gtk_render_option (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_option (priv->theming_engine, cr,
x, y, width, height);
@@ -3878,8 +3361,6 @@ gtk_render_arrow (GtkStyleContext *context,
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_ARROW);
- store_animation_region (context, x, y, size, size);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_arrow (priv->theming_engine, cr,
angle, x, y, size);
@@ -3931,8 +3412,6 @@ gtk_render_background (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_background (priv->theming_engine, cr, x, y, width, height);
@@ -3984,8 +3463,6 @@ gtk_render_frame (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_frame (priv->theming_engine, cr, x, y, width, height);
@@ -4034,8 +3511,6 @@ gtk_render_expander (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_expander (priv->theming_engine, cr, x, y, width, height);
@@ -4081,8 +3556,6 @@ gtk_render_focus (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_focus (priv->theming_engine, cr, x, y, width, height);
@@ -4123,12 +3596,6 @@ gtk_render_layout (GtkStyleContext *context,
pango_layout_get_extents (layout, &extents, NULL);
- store_animation_region (context,
- x + extents.x,
- y + extents.y,
- extents.width,
- extents.height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_layout (priv->theming_engine, cr, x, y, layout);
@@ -4217,8 +3684,6 @@ gtk_render_slider (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_slider (priv->theming_engine, cr, x, y, width, height, orientation);
@@ -4282,8 +3747,6 @@ gtk_render_frame_gap (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_frame_gap (priv->theming_engine, cr,
x, y, width, height, gap_side,
@@ -4336,8 +3799,6 @@ gtk_render_extension (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_extension (priv->theming_engine, cr, x, y, width, height, gap_side);
@@ -4386,8 +3847,6 @@ gtk_render_handle (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_handle (priv->theming_engine, cr, x, y, width, height);
@@ -4431,8 +3890,6 @@ gtk_render_activity (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context, x, y, width, height);
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_activity (priv->theming_engine, cr, x, y, width, height);
@@ -4502,11 +3959,6 @@ gtk_render_icon (GtkStyleContext *context,
cairo_save (cr);
- store_animation_region (context,
- x, y,
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf));
-
_gtk_theming_engine_set_context (priv->theming_engine, context);
engine_class->render_icon (priv->theming_engine, cr, pixbuf, x, y);
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 6572537..c5dd07e 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -741,6 +741,7 @@ void gtk_style_context_set_state (GtkStyleContext *context,
GtkStateFlags flags);
GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
+GDK_DEPRECATED_IN_3_6
gboolean gtk_style_context_state_is_running (GtkStyleContext *context,
GtkStateType state,
gdouble *progress);
@@ -803,20 +804,25 @@ gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
const gchar *color_name,
GdkRGBA *color);
+GDK_DEPRECATED_IN_3_6
void gtk_style_context_notify_state_change (GtkStyleContext *context,
GdkWindow *window,
gpointer region_id,
GtkStateType state,
gboolean state_value);
+GDK_DEPRECATED_IN_3_6
void gtk_style_context_cancel_animations (GtkStyleContext *context,
gpointer region_id);
+GDK_DEPRECATED_IN_3_6
void gtk_style_context_scroll_animations (GtkStyleContext *context,
GdkWindow *window,
gint dx,
gint dy);
+GDK_DEPRECATED_IN_3_6
void gtk_style_context_push_animatable_region (GtkStyleContext *context,
gpointer region_id);
+GDK_DEPRECATED_IN_3_6
void gtk_style_context_pop_animatable_region (GtkStyleContext *context);
/* Some helper functions to retrieve most common properties */
diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h
index 9feaf78..43566c9 100644
--- a/gtk/gtkstylecontextprivate.h
+++ b/gtk/gtkstylecontextprivate.h
@@ -39,9 +39,6 @@ void _gtk_style_context_validate (GtkStyleContext *c
GtkCssChange change);
void _gtk_style_context_queue_invalidate (GtkStyleContext *context,
GtkCssChange change);
-void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
-void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
- GtkWidget *widget);
gboolean _gtk_style_context_check_region_name (const gchar *str);
gboolean _gtk_style_context_resolve_color (GtkStyleContext *context,
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 8d01fb2..2b1986f 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -26,7 +26,6 @@
#include "gtkstyleprovider.h"
#include "gtksymboliccolor.h"
#include "gtkthemingengine.h"
-#include "gtkanimationdescription.h"
#include "gtkgradient.h"
#include "gtkcssshadowvalueprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index d81a68c..b3ed707 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -1021,10 +1021,7 @@ gtk_switch_set_active (GtkSwitch *sw,
if (priv->is_active != is_active)
{
AtkObject *accessible;
- GtkWidget *widget;
- GtkStyleContext *context;
- widget = GTK_WIDGET (sw);
priv->is_active = is_active;
g_object_notify_by_pspec (G_OBJECT (sw), switch_props[PROP_ACTIVE]);
@@ -1038,14 +1035,6 @@ gtk_switch_set_active (GtkSwitch *sw,
accessible = gtk_widget_get_accessible (GTK_WIDGET (sw));
atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, priv->is_active);
- if (gtk_widget_get_realized (widget))
- {
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_notify_state_change (context,
- gtk_widget_get_window (widget),
- NULL, GTK_STATE_ACTIVE, is_active);
- }
-
if (priv->is_active)
gtk_widget_set_state_flags (GTK_WIDGET (sw), GTK_STATE_FLAG_ACTIVE, FALSE);
else
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 675f8ae..3f37512 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -580,18 +580,17 @@ gtk_theming_engine_get_state (GtkThemingEngine *engine)
* Returns: %TRUE if there is a running transition animation for @state.
*
* Since: 3.0
+ *
+ * Deprecated: 3.6: Always returns %FALSE
**/
gboolean
gtk_theming_engine_state_is_running (GtkThemingEngine *engine,
GtkStateType state,
gdouble *progress)
{
- GtkThemingEnginePrivate *priv;
-
g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
- priv = engine->priv;
- return gtk_style_context_state_is_running (priv->context, state, progress);
+ return FALSE;
}
/**
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 09f6e3a..8221571 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -303,14 +303,10 @@ gtk_tool_item_group_header_draw_cb (GtkWidget *widget,
y = 0;
}
- /* The expander is the only animatable region */
- gtk_style_context_push_animatable_region (context, GUINT_TO_POINTER (1));
-
gtk_render_expander (context, cr, x, y,
priv->expander_size,
priv->expander_size);
- gtk_style_context_pop_animatable_region (context);
gtk_style_context_restore (context);
return FALSE;
@@ -1909,8 +1905,6 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
GTK_WIDGET (group));
if (collapsed != priv->collapsed)
{
- GtkStyleContext *context;
-
if (priv->animation)
{
if (priv->animation_timeout)
@@ -1923,19 +1917,6 @@ gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
gtk_tool_item_group_animation_cb,
group, NULL);
g_source_attach (priv->animation_timeout, NULL);
-
- context = gtk_widget_get_style_context (gtk_bin_get_child (GTK_BIN (priv->header)));
-
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
-
- gtk_style_context_notify_state_change (context,
- gtk_widget_get_window (priv->header),
- GUINT_TO_POINTER (1),
- GTK_STATE_FLAG_ACTIVE,
- !collapsed);
-
- gtk_style_context_restore (context);
}
else
gtk_tool_item_group_force_expose (group);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index f48d61e..fb9fa8a 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2299,7 +2299,6 @@ gtk_tree_view_unrealize (GtkWidget *widget)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GtkTreeViewPrivate *priv = tree_view->priv;
- GtkStyleContext *context;
GList *list;
if (priv->scroll_timeout != 0)
@@ -2320,9 +2319,6 @@ gtk_tree_view_unrealize (GtkWidget *widget)
priv->open_dest_timeout = 0;
}
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_cancel_animations (context, NULL);
-
if (priv->presize_handler_timer != 0)
{
g_source_remove (priv->presize_handler_timer);
@@ -9009,7 +9005,6 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
gboolean selection_changed = FALSE, cursor_changed = FALSE;
GtkRBTree *cursor_tree = NULL;
GtkRBNode *cursor_node = NULL;
- GtkStyleContext *context;
g_return_if_fail (path != NULL);
@@ -9114,10 +9109,6 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
tree_view->priv->top_row = NULL;
}
- /* Cancel any ongoing animation happening within the row */
- context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
- gtk_style_context_cancel_animations (context, node);
-
install_scroll_sync_handler (tree_view);
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
@@ -10140,13 +10131,10 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view,
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
- gtk_style_context_push_animatable_region (context, node);
-
gtk_render_expander (context, cr,
area.x, area.y,
area.width, area.height);
- gtk_style_context_pop_animatable_region (context);
gtk_style_context_restore (context);
}
@@ -11255,7 +11243,6 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment,
{
if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
{
- GtkStyleContext *context;
gint dy;
gdk_window_move (tree_view->priv->bin_window,
@@ -11298,9 +11285,6 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment,
}
gdk_window_scroll (tree_view->priv->bin_window, 0, dy);
- context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
- gtk_style_context_scroll_animations (context, tree_view->priv->bin_window, 0, dy);
-
if (tree_view->priv->dy != (int) gtk_adjustment_get_value (tree_view->priv->vadjustment))
{
/* update our dy and top_row */
@@ -11395,14 +11379,10 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
if (tree_view->priv->model)
{
GList *tmplist = tree_view->priv->columns;
- GtkStyleContext *context;
gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->priv->tree);
gtk_tree_view_stop_editing (tree_view, TRUE);
- context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
- gtk_style_context_cancel_animations (context, NULL);
-
g_signal_handlers_disconnect_by_func (tree_view->priv->model,
gtk_tree_view_row_changed,
tree_view);
@@ -12794,22 +12774,6 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
tree, node,
GTK_CELL_RENDERER_EXPANDED);
- if (animate)
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
-
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
-
- gtk_style_context_notify_state_change (context, tree_view->priv->bin_window,
- node, GTK_STATE_ACTIVE, TRUE);
-
- _gtk_style_context_invalidate_animation_areas (context);
- gtk_style_context_restore (context);
- }
-
install_presize_handler (tree_view);
g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path);
@@ -12973,22 +12937,6 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
if (selection_changed)
g_signal_emit_by_name (tree_view->priv->selection, "changed");
- if (animate)
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
-
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
-
- gtk_style_context_notify_state_change (context, tree_view->priv->bin_window,
- node, GTK_STATE_ACTIVE, FALSE);
-
- _gtk_style_context_invalidate_animation_areas (context);
- gtk_style_context_restore (context);
- }
-
if (gtk_widget_get_mapped (GTK_WIDGET (tree_view)))
{
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3db7328..066380b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -56,7 +56,6 @@
#include "gtkstylecontextprivate.h"
#include "gtksymboliccolor.h"
#include "gtkcssprovider.h"
-#include "gtkanimationdescription.h"
#include "gtkmodifierstyle.h"
#include "gtkversion.h"
#include "gtkdebug.h"
@@ -4177,82 +4176,6 @@ gtk_widget_show_all (GtkWidget *widget)
class->show_all (widget);
}
-static void
-_gtk_widget_notify_state_change (GtkWidget *widget,
- GtkStateFlags flag,
- gboolean target)
-{
- GtkStateType state;
-
- switch (flag)
- {
- case GTK_STATE_FLAG_ACTIVE:
- state = GTK_STATE_ACTIVE;
- break;
- case GTK_STATE_FLAG_PRELIGHT:
- state = GTK_STATE_PRELIGHT;
- break;
- case GTK_STATE_FLAG_SELECTED:
- state = GTK_STATE_SELECTED;
- break;
- case GTK_STATE_FLAG_INSENSITIVE:
- state = GTK_STATE_INSENSITIVE;
- break;
- case GTK_STATE_FLAG_INCONSISTENT:
- state = GTK_STATE_INCONSISTENT;
- break;
- case GTK_STATE_FLAG_FOCUSED:
- state = GTK_STATE_FOCUSED;
- break;
- default:
- return;
- }
-
- gtk_style_context_notify_state_change (widget->priv->context,
- gtk_widget_get_window (widget),
- NULL, state, target);
-}
-
-/* Initializes state transitions for those states that
- * were enabled before mapping and have a looping animation.
- */
-static void
-_gtk_widget_start_state_transitions (GtkWidget *widget)
-{
- GtkStateFlags state, flag;
-
- if (!widget->priv->context)
- return;
-
- state = gtk_widget_get_state_flags (widget);
- flag = GTK_STATE_FLAG_FOCUSED;
-
- while (flag)
- {
- GtkAnimationDescription *animation_desc;
-
- if ((state & flag) == 0)
- {
- flag >>= 1;
- continue;
- }
-
- gtk_style_context_get (widget->priv->context, state,
- "transition", &animation_desc,
- NULL);
-
- if (animation_desc)
- {
- if (_gtk_animation_description_get_loop (animation_desc))
- _gtk_widget_notify_state_change (widget, flag, TRUE);
-
- _gtk_animation_description_unref (animation_desc);
- }
-
- flag >>= 1;
- }
-}
-
/**
* gtk_widget_map:
* @widget: a #GtkWidget
@@ -4284,8 +4207,6 @@ gtk_widget_map (GtkWidget *widget)
gdk_window_invalidate_rect (priv->window, &priv->allocation, FALSE);
gtk_widget_pop_verify_invariants (widget);
-
- _gtk_widget_start_state_transitions (widget);
}
}
@@ -4316,9 +4237,6 @@ gtk_widget_unmap (GtkWidget *widget)
gtk_widget_pop_verify_invariants (widget);
- if (priv->context)
- gtk_style_context_cancel_animations (priv->context, NULL);
-
/* Unset pointer/window info */
g_object_set_qdata (G_OBJECT (widget), quark_pointer_window, NULL);
}
@@ -5024,14 +4942,6 @@ gtk_widget_size_allocate (GtkWidget *widget,
cairo_region_destroy (invalidate);
}
}
-
- if (size_changed || position_changed)
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (widget);
- _gtk_style_context_invalidate_animation_areas (context);
- }
}
if ((size_changed || position_changed) && priv->parent &&
@@ -5807,8 +5717,6 @@ _gtk_widget_draw_internal (GtkWidget *widget,
cairo_t *cr,
gboolean clip_to_size)
{
- GtkStyleContext *context;
-
if (!gtk_widget_is_drawable (widget))
return;
@@ -5844,9 +5752,6 @@ _gtk_widget_draw_internal (GtkWidget *widget,
cairo_status_to_string (cairo_status (cr)));
}
}
-
- context = gtk_widget_get_style_context (widget);
- _gtk_style_context_coalesce_animation_areas (context, widget);
}
/**
@@ -11024,30 +10929,6 @@ gtk_widget_propagate_state (GtkWidget *widget,
&child_data);
}
- /* Trigger state change transitions for the widget */
- if (priv->context &&
- gtk_widget_get_mapped (widget))
- {
- gint diff, flag = 1;
-
- diff = old_flags ^ new_flags;
-
- while (diff != 0)
- {
- if ((diff & flag) != 0)
- {
- gboolean target;
-
- target = ((new_flags & flag) != 0);
- _gtk_widget_notify_state_change (widget, flag, target);
-
- diff &= ~flag;
- }
-
- flag <<= 1;
- }
- }
-
g_object_unref (widget);
}
}
diff --git a/tests/styleexamples.c b/tests/styleexamples.c
index e583ce8..b3169f4 100644
--- a/tests/styleexamples.c
+++ b/tests/styleexamples.c
@@ -151,12 +151,6 @@ draw_cb_activity (GtkWidget *widget, cairo_t *cr)
GtkWidgetPath *path;
context = gtk_widget_get_style_context (widget);
- gtk_style_context_notify_state_change (context,
- gtk_widget_get_window (widget),
- NULL,
- GTK_STATE_FLAG_ACTIVE,
- TRUE);
-
gtk_style_context_save (context);
path = gtk_widget_path_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]