Debian Codegraph @

gtk/gtkcsstransition.c

raw symbols SCIP
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 <[email protected]>
18 */
19
20 #include "config.h"cxx . . $ `<file>/build/config.h`/
21
22 #include "gtkcsstransitionprivate.h"cxx . . $ `<file>/gtk/gtkcsstransitionprivate.h`/
23
24 #include "gtkcsseasevalueprivate.h"cxx . . $ `<file>/gtk/gtkcsseasevalueprivate.h`/
25 #include "gtkprogresstrackerprivate.h"cxx . . $ `<file>/gtk/gtkprogresstrackerprivate.h`/
26
27 struct _GtkCssTransitioncxx . . $ _GtkCssTransition#
28 {
29 GtkStyleAnimationcxx . . $ GtkStyleAnimation# parentcxx . . $ _GtkCssTransition#parent.;
30
31 guintcxx . . $ guint# propertycxx . . $ _GtkCssTransition#property.;
32 guintcxx . . $ guint# finishedcxx . . $ _GtkCssTransition#finished.;
33 GtkCssValuecxx . . $ GtkCssValue# *startcxx . . $ _GtkCssTransition#start.;
34 GtkCssValuecxx . . $ GtkCssValue# *easecxx . . $ _GtkCssTransition#ease.;
35 GtkProgressTrackercxx . . $ GtkProgressTracker# trackercxx . . $ _GtkCssTransition#tracker.;
36 };
37
38
39 static GtkStyleAnimationcxx . . $ GtkStyleAnimation# * gtk_css_transition_advancecxx . . $ gtk_css_transition_advance(c9be253501494dd2). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *style_animation,
40 gint64cxx . . $ gint64# timestamp);
41
42
43
44 static void
45 gtk_css_transition_apply_valuescxx . . $ gtk_css_transition_apply_values(5c5931ab97899c35). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *style_animation,
46 GtkCssAnimatedStylecxx . . $ GtkCssAnimatedStyle# *style)
47 {
48 GtkCssTransitioncxx . . $ GtkCssTransition# *transition = (GtkCssTransitioncxx . . $ GtkCssTransition# *)style_animation;
49 GtkCssValuecxx . . $ GtkCssValue# *value, *end;
50 double progress;
51 GtkProgressStatecxx . . $ GtkProgressState# state;
52
53 if (transition->finishedcxx . . $ _GtkCssTransition#finished.)
54 return;
55
56 end = gtk_css_animated_style_get_intrinsic_valuecxx . . $ gtk_css_animated_style_get_intrinsic_value(b0573aeadc4b3379). (style, transition->propertycxx . . $ _GtkCssTransition#property.);
57 state = gtk_progress_tracker_get_statecxx . . $ gtk_progress_tracker_get_state(cef4b9c3257cded0). (&transition->trackercxx . . $ _GtkCssTransition#tracker.);
58
59 if (state == GTK_PROGRESS_STATE_BEFOREcxx . . $ GTK_PROGRESS_STATE_BEFORE.)
60 value = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (transition->start);
61 else if (state == GTK_PROGRESS_STATE_DURINGcxx . . $ GTK_PROGRESS_STATE_DURING.)
62 {
63 progress = gtk_progress_tracker_get_progresscxx . . $ gtk_progress_tracker_get_progress(b4682671a7b8a656). (&transition->trackercxx . . $ _GtkCssTransition#tracker., FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
64 progress = _gtk_css_ease_value_transformcxx . . $ _gtk_css_ease_value_transform(aaf4d8e9bc9f0cb0). (transition->easecxx . . $ _GtkCssTransition#ease., progress);
65
66 value = gtk_css_value_transitioncxx . . $ gtk_css_value_transition(f8a3466892fba181). (transition->startcxx . . $ _GtkCssTransition#start.,
67 end,
68 transition->propertycxx . . $ _GtkCssTransition#property.,
69 progress);
70 }
71 else
72 return;
73
74 if (value == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
75 value = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (end);
76
77 gtk_css_animated_style_set_animated_valuecxx . . $ gtk_css_animated_style_set_animated_value(10efdf1e6344ddf5). (style, transition->propertycxx . . $ _GtkCssTransition#property., value);
78 }
79
80 static gbooleancxx . . $ gboolean#
81 gtk_css_transition_is_finishedcxx . . $ gtk_css_transition_is_finished(f539036858864597). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *animation)
82 {
83 GtkCssTransitioncxx . . $ GtkCssTransition# *transition = (GtkCssTransitioncxx . . $ GtkCssTransition# *)animation;
84
85 return transition->finishedcxx . . $ _GtkCssTransition#finished.;
86 }
87
88 static gbooleancxx . . $ gboolean#
89 gtk_css_transition_is_staticcxx . . $ gtk_css_transition_is_static(f539036858864597). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *animation)
90 {
91 GtkCssTransitioncxx . . $ GtkCssTransition# *transition = (GtkCssTransitioncxx . . $ GtkCssTransition# *)animation;
92
93 return transition->finishedcxx . . $ _GtkCssTransition#finished.;
94 }
95
96 static void
97 gtk_css_transition_freecxx . . $ gtk_css_transition_free(11e2d194b686d477). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *animation)
98 {
99 GtkCssTransitioncxx . . $ GtkCssTransition# *self = (GtkCssTransitioncxx . . $ GtkCssTransition# *)animation;
100
101 gtk_css_value_unrefcxx . . $ `gtk/gtkcssvalueprivate.h:134:9`! (self->start);
102 gtk_css_value_unrefcxx . . $ `gtk/gtkcssvalueprivate.h:134:9`! (self->ease);
103 g_freecxx . . $ g_free(5d22bdacc48458e8). (self);
104 }
105
106 static const GtkStyleAnimationClasscxx . . $ GtkStyleAnimationClass# GTK_CSS_TRANSITION_CLASScxx . . $ GTK_CSS_TRANSITION_CLASS. = {
107 "GtkCssTransition",
108 gtk_css_transition_freecxx . . $ gtk_css_transition_free(11e2d194b686d477).,
109 gtk_css_transition_is_finishedcxx . . $ gtk_css_transition_is_finished(f539036858864597).,
110 gtk_css_transition_is_staticcxx . . $ gtk_css_transition_is_static(f539036858864597).,
111 gtk_css_transition_apply_valuescxx . . $ gtk_css_transition_apply_values(5c5931ab97899c35).,
112 gtk_css_transition_advancecxx . . $ gtk_css_transition_advance(c9be253501494dd2).,
113 };
114
115 static GtkStyleAnimationcxx . . $ GtkStyleAnimation# *
116 gtk_css_transition_advancecxx . . $ gtk_css_transition_advance(c9be253501494dd2). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *style_animation,
117 gint64cxx . . $ gint64# timestamp)
118 {
119 GtkCssTransitioncxx . . $ GtkCssTransition# *source = (GtkCssTransitioncxx . . $ GtkCssTransition# *)style_animation;
120 GtkCssTransitioncxx . . $ GtkCssTransition# *transition;
121
122 transition = g_newcxx . . $ `<external>/1123956534522462559/gmem.h:318:9`! (GtkCssTransition, 1);
123 transition->parentcxx . . $ _GtkCssTransition#parent..classcxx . . $ _GtkStyleAnimation#class. = &GTK_CSS_TRANSITION_CLASScxx . . $ GTK_CSS_TRANSITION_CLASS.;
124 transition->parentcxx . . $ _GtkCssTransition#parent..ref_countcxx . . $ _GtkStyleAnimation#ref_count. = 1;
125
126 transition->propertycxx . . $ _GtkCssTransition#property. = source->propertycxx . . $ _GtkCssTransition#property.;
127 transition->startcxx . . $ _GtkCssTransition#start. = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (source->start);
128 transition->easecxx . . $ _GtkCssTransition#ease. = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (source->ease);
129
130 gtk_progress_tracker_init_copycxx . . $ gtk_progress_tracker_init_copy(adfe756a105be08f). (&source->trackercxx . . $ _GtkCssTransition#tracker., &transition->trackercxx . . $ _GtkCssTransition#tracker.);
131 gtk_progress_tracker_advance_framecxx . . $ gtk_progress_tracker_advance_frame(7bf6683cbbaeba3e). (&transition->trackercxx . . $ _GtkCssTransition#tracker., timestamp);
132 transition->finishedcxx . . $ _GtkCssTransition#finished. = gtk_progress_tracker_get_statecxx . . $ gtk_progress_tracker_get_state(cef4b9c3257cded0). (&transition->trackercxx . . $ _GtkCssTransition#tracker.) == GTK_PROGRESS_STATE_AFTERcxx . . $ GTK_PROGRESS_STATE_AFTER.;
133
134 return (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *)transition;
135 }
136 GtkStyleAnimationcxx . . $ GtkStyleAnimation# *
137 _gtk_css_transition_newcxx . . $ _gtk_css_transition_new(d81b1aa21ec369f4). (guintcxx . . $ guint# property,
138 GtkCssValuecxx . . $ GtkCssValue# *start,
139 GtkCssValuecxx . . $ GtkCssValue# *ease,
140 gint64cxx . . $ gint64# timestamp,
141 gint64cxx . . $ gint64# duration_us,
142 gint64cxx . . $ gint64# delay_us)
143 {
144 GtkCssTransitioncxx . . $ GtkCssTransition# *transition;
145
146 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (start != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
147 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (ease != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
148
149 transition = g_newcxx . . $ `<external>/1123956534522462559/gmem.h:318:9`! (GtkCssTransition, 1);
150 transition->parentcxx . . $ _GtkCssTransition#parent..classcxx . . $ _GtkStyleAnimation#class. = &GTK_CSS_TRANSITION_CLASScxx . . $ GTK_CSS_TRANSITION_CLASS.;
151 transition->parentcxx . . $ _GtkCssTransition#parent..ref_countcxx . . $ _GtkStyleAnimation#ref_count. = 1;
152
153 transition->propertycxx . . $ _GtkCssTransition#property. = property;
154 transition->startcxx . . $ _GtkCssTransition#start. = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (start);
155 transition->easecxx . . $ _GtkCssTransition#ease. = gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (ease);
156 gtk_progress_tracker_startcxx . . $ gtk_progress_tracker_start(3b78ad0d90561db6). (&transition->trackercxx . . $ _GtkCssTransition#tracker., duration_us, delay_us, 1.0);
157 gtk_progress_tracker_advance_framecxx . . $ gtk_progress_tracker_advance_frame(7bf6683cbbaeba3e). (&transition->trackercxx . . $ _GtkCssTransition#tracker., timestamp);
158 transition->finishedcxx . . $ _GtkCssTransition#finished. = gtk_progress_tracker_get_statecxx . . $ gtk_progress_tracker_get_state(cef4b9c3257cded0). (&transition->trackercxx . . $ _GtkCssTransition#tracker.) == GTK_PROGRESS_STATE_AFTERcxx . . $ GTK_PROGRESS_STATE_AFTER.;
159
160 return (GtkStyleAnimationcxx . . $ GtkStyleAnimation#*)transition;
161 }
162
163 guintcxx . . $ guint#
164 _gtk_css_transition_get_propertycxx . . $ _gtk_css_transition_get_property(77fc1e82265f65c1). (GtkCssTransitioncxx . . $ GtkCssTransition# *transition)
165 {
166 return transition->propertycxx . . $ _GtkCssTransition#property.;
167 }
168
169 gbooleancxx . . $ gboolean#
170 _gtk_css_transition_is_transitioncxx . . $ _gtk_css_transition_is_transition(f539036858864597). (GtkStyleAnimationcxx . . $ GtkStyleAnimation# *animation)
171 {
172 return animation->classcxx . . $ _GtkStyleAnimation#class. == &GTK_CSS_TRANSITION_CLASScxx . . $ GTK_CSS_TRANSITION_CLASS.;
173 }