1 | /* |
---|---|
2 | * Copyright © 2012 Red Hat Inc. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2.1 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | * Authors: Benjamin Otte <otte@gnome.org> |
18 | */ |
19 | |
20 | #include "config.h" |
21 | |
22 | #include "gtkstyleanimationprivate.h" |
23 | |
24 | GtkStyleAnimation * |
25 | _gtk_style_animation_advance (GtkStyleAnimation *animation, |
26 | gint64 timestamp) |
27 | { |
28 | g_assert (animation != NULL); |
29 | |
30 | return animation->class->advance (animation, timestamp); |
31 | } |
32 | |
33 | void |
34 | _gtk_style_animation_apply_values (GtkStyleAnimation *animation, |
35 | GtkCssAnimatedStyle *style) |
36 | { |
37 | animation->class->apply_values (animation, style); |
38 | } |
39 | |
40 | gboolean |
41 | _gtk_style_animation_is_finished (GtkStyleAnimation *animation) |
42 | { |
43 | return animation->class->is_finished (animation); |
44 | } |
45 | |
46 | |
47 | GtkStyleAnimation * |
48 | gtk_style_animation_ref (GtkStyleAnimation *animation) |
49 | { |
50 | animation->ref_count++; |
51 | return animation; |
52 | } |
53 | |
54 | GtkStyleAnimation * |
55 | gtk_style_animation_unref (GtkStyleAnimation *animation) |
56 | { |
57 | animation->ref_count--; |
58 | |
59 | if (animation->ref_count == 0) |
60 | { |
61 | animation->class->free (animation); |
62 | return NULL; |
63 | } |
64 | return animation; |
65 | } |
66 | |
67 | /** |
68 | * _gtk_style_animation_is_static: |
69 | * @animation: The animation to query |
70 | * @at_time_us: The timestamp to query for |
71 | * |
72 | * Checks if @animation will not change its values anymore after |
73 | * @at_time_us. This happens for example when the animation has reached its |
74 | * final value or when it has been paused. |
75 | * |
76 | * Returns: %TRUE if @animation will not change anymore after @at_time_us |
77 | **/ |
78 | gboolean |
79 | _gtk_style_animation_is_static (GtkStyleAnimation *animation) |
80 | { |
81 | return animation->class->is_static (animation); |
82 | } |
83 |