diff options
author | Benjamin Otte <otte@redhat.com> | 2012-04-04 18:55:51 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-17 08:59:19 +0200 |
commit | 04c5fdaca675e324ca3c5fab0c4fac4b579d0d41 (patch) | |
tree | fc54880e3b04cfd48d5b5abc81cf36f490a08b43 /gtk/gtkwidget.c | |
parent | dcd54e20d14be57a9d080e87a47bbef8d2271c05 (diff) | |
download | gtk+-04c5fdaca675e324ca3c5fab0c4fac4b579d0d41.tar.gz |
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.
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r-- | gtk/gtkwidget.c | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 4738d2a364..d74c94140e 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); } } |