Debian Codegraph @

gtk/gtkcsseasevalue.c

raw symbols SCIP
1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2011 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 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
18 #include "config.h"cxx . . $ `<file>/build/config.h`/
19
20 #include "gtkcsseasevalueprivate.h"cxx . . $ `<file>/gtk/gtkcsseasevalueprivate.h`/
21
22 #include <math.h>
23
24 typedef enumcxx . . $ $anonymous_type_10c22586a19b4ccb_0# {
25 GTK_CSS_EASE_CUBIC_BEZIERcxx . . $ GTK_CSS_EASE_CUBIC_BEZIER.,
26 GTK_CSS_EASE_STEPScxx . . $ GTK_CSS_EASE_STEPS.
27 } GtkCssEaseTypecxx . . $ GtkCssEaseType#;
28
29 struct _GtkCssValuecxx . . $ _GtkCssValue# {
30 GTK_CSS_VALUE_BASEcxx . . $ `gtk/gtkcssvalueprivate.h:38:9`!
31 GtkCssEaseTypecxx . . $ GtkCssEaseType# typecxx . . $ _GtkCssValue#type.;
32 unioncxx . . $ _GtkCssValue#$anonymous_type_1# {
33 structcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2# {
34 double x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1.;
35 double y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1.;
36 double x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2.;
37 double y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2.;
38 } cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic.;
39 structcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3# {
40 guintcxx . . $ guint# stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps.;
41 gbooleancxx . . $ gboolean# startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start.;
42 } stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps.;
43 } ucxx . . $ _GtkCssValue#u.;
44 };
45
46 static void
47 gtk_css_value_ease_freecxx . . $ gtk_css_value_ease_free(eca506aa56b70245). (GtkCssValuecxx . . $ GtkCssValue# *value)
48 {
49 g_freecxx . . $ g_free(5d22bdacc48458e8). (value);
50 }
51
52 static GtkCssValuecxx . . $ GtkCssValue# *
53 gtk_css_value_ease_computecxx . . $ gtk_css_value_ease_compute(cbde7e31d878f1be). (GtkCssValuecxx . . $ GtkCssValue# *value,
54 guintcxx . . $ guint# property_id,
55 GtkCssComputeContextcxx . . $ GtkCssComputeContext# *context)
56 {
57 return gtk_css_value_refcxx . . $ `gtk/gtkcssvalueprivate.h:133:9`! (value);
58 }
59
60 static gbooleancxx . . $ gboolean#
61 gtk_css_value_ease_equalcxx . . $ gtk_css_value_ease_equal(9e96a8b1dd095d1c). (const GtkCssValuecxx . . $ GtkCssValue# *ease1,
62 const GtkCssValuecxx . . $ GtkCssValue# *ease2)
63 {
64 if (ease1->typecxx . . $ _GtkCssValue#type. != ease2->typecxx . . $ _GtkCssValue#type.)
65 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
66
67 switch (ease1->typecxx . . $ _GtkCssValue#type.)
68 {
69 case GTK_CSS_EASE_CUBIC_BEZIERcxx . . $ GTK_CSS_EASE_CUBIC_BEZIER.:
70 return ease1->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == ease2->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. &&
71 ease1->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == ease2->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. &&
72 ease1->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == ease2->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. &&
73 ease1->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == ease2->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2.;
74 case GTK_CSS_EASE_STEPScxx . . $ GTK_CSS_EASE_STEPS.:
75 return ease1->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps. == ease2->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps. &&
76 ease1->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start. == ease2->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start.;
77 default:
78 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
79 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
80 }
81 }
82
83 static GtkCssValuecxx . . $ GtkCssValue# *
84 gtk_css_value_ease_transitioncxx . . $ gtk_css_value_ease_transition(f8a3466892fba181). (GtkCssValuecxx . . $ GtkCssValue# *start,
85 GtkCssValuecxx . . $ GtkCssValue# *end,
86 guintcxx . . $ guint# property_id,
87 double progress)
88 {
89 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
90 }
91
92 static void
93 gtk_css_value_ease_printcxx . . $ gtk_css_value_ease_print(36b72f8115f1fefa). (const GtkCssValuecxx . . $ GtkCssValue# *ease,
94 GStringcxx . . $ GString# *string)
95 {
96 switch (ease->typecxx . . $ _GtkCssValue#type.)
97 {
98 case GTK_CSS_EASE_CUBIC_BEZIERcxx . . $ GTK_CSS_EASE_CUBIC_BEZIER.:
99 if (ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == 0.25 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == 0.1 &&
100 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == 0.25 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == 1.0)
101 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, "ease");
102 else if (ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == 0.0 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == 0.0 &&
103 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == 1.0 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == 1.0)
104 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, "linear");
105 else if (ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == 0.42 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == 0.0 &&
106 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == 1.0 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == 1.0)
107 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, "ease-in");
108 else if (ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == 0.0 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == 0.0 &&
109 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == 0.58 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == 1.0)
110 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, "ease-out");
111 else if (ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. == 0.42 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. == 0.0 &&
112 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. == 0.58 && ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. == 1.0)
113 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, "ease-in-out");
114 else
115 g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (string, "cubic-bezier(%g,%g,%g,%g)",
116 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1., ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1.,
117 ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2., ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2.);
118 break;
119 case GTK_CSS_EASE_STEPScxx . . $ GTK_CSS_EASE_STEPS.:
120 if (ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps. == 1)
121 {
122 g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (string, ease->u.steps.start ? "step-start" : "step-end");
123 }
124 else
125 {
126 g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (string, "steps(%u%s)", ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps., ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start. ? ",start" : "");
127 }
128 break;
129 default:
130 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
131 break;
132 }
133 }
134
135 static const GtkCssValueClasscxx . . $ GtkCssValueClass# GTK_CSS_VALUE_EASEcxx . . $ GTK_CSS_VALUE_EASE. = {
136 "GtkCssEaseValue",
137 gtk_css_value_ease_freecxx . . $ gtk_css_value_ease_free(eca506aa56b70245).,
138 gtk_css_value_ease_computecxx . . $ gtk_css_value_ease_compute(cbde7e31d878f1be).,
139 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
140 gtk_css_value_ease_equalcxx . . $ gtk_css_value_ease_equal(9e96a8b1dd095d1c).,
141 gtk_css_value_ease_transitioncxx . . $ gtk_css_value_ease_transition(f8a3466892fba181).,
142 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
143 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
144 gtk_css_value_ease_printcxx . . $ gtk_css_value_ease_print(36b72f8115f1fefa).
145 };
146
147 GtkCssValuecxx . . $ GtkCssValue# *
148 _gtk_css_ease_value_new_cubic_beziercxx . . $ _gtk_css_ease_value_new_cubic_bezier(e5874b2d84eb9fef). (double x1,
149 double y1,
150 double x2,
151 double y2)
152 {
153 GtkCssValuecxx . . $ GtkCssValue# *value;
154
155 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (x1 >= 0.0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
156 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (x1 <= 1.0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
157 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (x2 >= 0.0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
158 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (x2 <= 1.0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
159
160 value = gtk_css_value_newcxx . . $ `gtk/gtkcssvalueprivate.h:80:9`! (GtkCssValue, &GTK_CSS_VALUE_EASE);
161
162 value->typecxx . . $ _GtkCssValue#type. = GTK_CSS_EASE_CUBIC_BEZIERcxx . . $ GTK_CSS_EASE_CUBIC_BEZIER.;
163 value->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. = x1;
164 value->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. = y1;
165 value->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2. = x2;
166 value->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2. = y2;
167 value->is_computedcxx . . $ _GtkCssValue#is_computed. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
168
169 return value;
170 }
171
172 static GtkCssValuecxx . . $ GtkCssValue# *
173 _gtk_css_ease_value_new_stepscxx . . $ _gtk_css_ease_value_new_steps(18ad43ec1558473d). (guintcxx . . $ guint# n_steps,
174 gbooleancxx . . $ gboolean# start)
175 {
176 GtkCssValuecxx . . $ GtkCssValue# *value;
177
178 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (n_steps > 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
179
180 value = gtk_css_value_newcxx . . $ `gtk/gtkcssvalueprivate.h:80:9`! (GtkCssValue, &GTK_CSS_VALUE_EASE);
181
182 value->typecxx . . $ _GtkCssValue#type. = GTK_CSS_EASE_STEPScxx . . $ GTK_CSS_EASE_STEPS.;
183 value->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps. = n_steps;
184 value->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start. = start;
185 value->is_computedcxx . . $ _GtkCssValue#is_computed. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
186
187 return value;
188 }
189
190 static const structcxx . . $ $anonymous_type_10c22586a19b4ccb_4# {
191 const char *namecxx . . $ $anonymous_type_10c22586a19b4ccb_4#name.;
192 guintcxx . . $ guint# is_beziercxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_bezier. :1;
193 guintcxx . . $ guint# is_functioncxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_function. :1;
194 double valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[4];
195 } parser_valuescxx . . $ parser_values.[] = {
196 { "linear", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 0.0, 0.0, 1.0, 1.0 } },
197 { "ease-in-out", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 0.42, 0.0, 0.58, 1.0 } },
198 { "ease-in", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 0.42, 0.0, 1.0, 1.0 } },
199 { "ease-out", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 0.0, 0.0, 0.58, 1.0 } },
200 { "ease", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 0.25, 0.1, 0.25, 1.0 } },
201 { "step-start", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 1.0, 1.0, 0.0, 0.0 } },
202 { "step-end", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, { 1.0, 0.0, 0.0, 0.0 } },
203 { "steps", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, { 0.0, 0.0, 0.0, 0.0 } },
204 { "cubic-bezier", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, { 0.0, 0.0, 0.0, 0.0 } }
205 };
206
207 gbooleancxx . . $ gboolean#
208 _gtk_css_ease_value_can_parsecxx . . $ _gtk_css_ease_value_can_parse(1218f77d161081c9). (GtkCssParsercxx . . $ GtkCssParser# *parser)
209 {
210 guintcxx . . $ guint# i;
211
212 for (i = 0; i < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (parser_values); i++)
213 {
214 if (parser_valuescxx . . $ parser_values.[i].is_functioncxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_function.)
215 {
216 if (gtk_css_parser_has_functioncxx . . $ gtk_css_parser_has_function(b5471d620daa5380). (parser, parser_valuescxx . . $ parser_values.[i].namecxx . . $ $anonymous_type_10c22586a19b4ccb_4#name.))
217 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
218 }
219 else
220 {
221 if (gtk_css_parser_has_identcxx . . $ gtk_css_parser_has_ident(b5471d620daa5380). (parser, parser_valuescxx . . $ parser_values.[i].namecxx . . $ $anonymous_type_10c22586a19b4ccb_4#name.))
222 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
223 }
224 }
225
226 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
227 }
228
229 static guintcxx . . $ guint#
230 gtk_css_ease_value_parse_cubic_bezier_argcxx . . $ gtk_css_ease_value_parse_cubic_bezier_arg(85cb31622730dea6). (GtkCssParsercxx . . $ GtkCssParser# *parser,
231 guintcxx . . $ guint# arg,
232 gpointercxx . . $ gpointer# data)
233 {
234 double *values = data;
235
236 if (!gtk_css_parser_consume_numbercxx . . $ gtk_css_parser_consume_number(92239878c1c3a678). (parser, &values[arg]))
237 return 0;
238
239 if (arg % 2 == 0)
240 {
241 if (values[arg] < 0 || values[arg] > 1.0)
242 {
243 gtk_css_parser_error_valuecxx . . $ gtk_css_parser_error_value(41ac99f7292d7f5f). (parser, "value %g out of range. Must be from 0.0 to 1.0", values[arg]);
244 return 0;
245 }
246 }
247
248 return 1;
249 }
250
251 static GtkCssValuecxx . . $ GtkCssValue# *
252 gtk_css_ease_value_parse_cubic_beziercxx . . $ gtk_css_ease_value_parse_cubic_bezier(66d8ac11734e4f87). (GtkCssParsercxx . . $ GtkCssParser# *parser)
253 {
254 double values[4];
255
256 if (!gtk_css_parser_consume_functioncxx . . $ gtk_css_parser_consume_function(949a2555ad96460b). (parser, 4, 4, gtk_css_ease_value_parse_cubic_bezier_argcxx . . $ gtk_css_ease_value_parse_cubic_bezier_arg(85cb31622730dea6)., values))
257 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
258
259 return _gtk_css_ease_value_new_cubic_beziercxx . . $ _gtk_css_ease_value_new_cubic_bezier(e5874b2d84eb9fef). (values[0], values[1], values[2], values[3]);
260 }
261
262 typedef structcxx . . $ $anonymous_type_10c22586a19b4ccb_5#
263 {
264 int n_stepscxx . . $ $anonymous_type_10c22586a19b4ccb_5#n_steps.;
265 gbooleancxx . . $ gboolean# startcxx . . $ $anonymous_type_10c22586a19b4ccb_5#start.;
266 } ParseStepsDatacxx . . $ ParseStepsData#;
267
268 static guintcxx . . $ guint#
269 gtk_css_ease_value_parse_steps_argcxx . . $ gtk_css_ease_value_parse_steps_arg(85cb31622730dea6). (GtkCssParsercxx . . $ GtkCssParser# *parser,
270 guintcxx . . $ guint# arg,
271 gpointercxx . . $ gpointer# data_)
272 {
273 ParseStepsDatacxx . . $ ParseStepsData# *data = data_;
274
275 switch (arg)
276 {
277 case 0:
278 if (!gtk_css_parser_consume_integercxx . . $ gtk_css_parser_consume_integer(6750d787187027e7). (parser, &data->n_stepscxx . . $ $anonymous_type_10c22586a19b4ccb_5#n_steps.))
279 {
280 return 0;
281 }
282 else if (data->n_stepscxx . . $ $anonymous_type_10c22586a19b4ccb_5#n_steps. < 1)
283 {
284 gtk_css_parser_error_valuecxx . . $ gtk_css_parser_error_value(41ac99f7292d7f5f). (parser, "Number of steps must be > 0");
285 return 0;
286 }
287 return 1;
288
289 case 1:
290 if (gtk_css_parser_try_identcxx . . $ gtk_css_parser_try_ident(b5471d620daa5380). (parser, "start"))
291 data->startcxx . . $ $anonymous_type_10c22586a19b4ccb_5#start. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
292 else if (gtk_css_parser_try_identcxx . . $ gtk_css_parser_try_ident(b5471d620daa5380). (parser, "end"))
293 data->startcxx . . $ $anonymous_type_10c22586a19b4ccb_5#start. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
294 else
295 {
296 gtk_css_parser_error_syntaxcxx . . $ gtk_css_parser_error_syntax(41ac99f7292d7f5f). (parser, "Only allowed values are 'start' and 'end'");
297 return 0;
298 }
299 return 1;
300
301 default:
302 g_return_val_if_reachedcxx . . $ `<external>/5169755362661750954/gmessages.h:689:9`! (0);
303 }
304 }
305
306 static GtkCssValuecxx . . $ GtkCssValue# *
307 gtk_css_ease_value_parse_stepscxx . . $ gtk_css_ease_value_parse_steps(66d8ac11734e4f87). (GtkCssParsercxx . . $ GtkCssParser# *parser)
308 {
309 ParseStepsDatacxx . . $ ParseStepsData# data = { 0, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`! };
310
311 if (!gtk_css_parser_consume_functioncxx . . $ gtk_css_parser_consume_function(949a2555ad96460b). (parser, 1, 2, gtk_css_ease_value_parse_steps_argcxx . . $ gtk_css_ease_value_parse_steps_arg(85cb31622730dea6)., &data))
312 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
313
314 return _gtk_css_ease_value_new_stepscxx . . $ _gtk_css_ease_value_new_steps(18ad43ec1558473d). (data.n_stepscxx . . $ $anonymous_type_10c22586a19b4ccb_5#n_steps., data.startcxx . . $ $anonymous_type_10c22586a19b4ccb_5#start.);
315 }
316
317 GtkCssValuecxx . . $ GtkCssValue# *
318 _gtk_css_ease_value_parsecxx . . $ _gtk_css_ease_value_parse(66d8ac11734e4f87). (GtkCssParsercxx . . $ GtkCssParser# *parser)
319 {
320 guintcxx . . $ guint# i;
321
322 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (parser != 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`!);
323
324 for (i = 0; i < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (parser_values); i++)
325 {
326 if (parser_valuescxx . . $ parser_values.[i].is_functioncxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_function.)
327 {
328 if (gtk_css_parser_has_functioncxx . . $ gtk_css_parser_has_function(b5471d620daa5380). (parser, parser_valuescxx . . $ parser_values.[i].namecxx . . $ $anonymous_type_10c22586a19b4ccb_4#name.))
329 {
330 if (parser_valuescxx . . $ parser_values.[i].is_beziercxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_bezier.)
331 return gtk_css_ease_value_parse_cubic_beziercxx . . $ gtk_css_ease_value_parse_cubic_bezier(66d8ac11734e4f87). (parser);
332 else
333 return gtk_css_ease_value_parse_stepscxx . . $ gtk_css_ease_value_parse_steps(66d8ac11734e4f87). (parser);
334 }
335 }
336 else
337 {
338 if (gtk_css_parser_try_identcxx . . $ gtk_css_parser_try_ident(b5471d620daa5380). (parser, parser_valuescxx . . $ parser_values.[i].namecxx . . $ $anonymous_type_10c22586a19b4ccb_4#name.))
339 {
340 if (parser_valuescxx . . $ parser_values.[i].is_beziercxx . . $ $anonymous_type_10c22586a19b4ccb_4#is_bezier.)
341 return _gtk_css_ease_value_new_cubic_beziercxx . . $ _gtk_css_ease_value_new_cubic_bezier(e5874b2d84eb9fef). (parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[0],
342 parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[1],
343 parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[2],
344 parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[3]);
345 else
346 return _gtk_css_ease_value_new_stepscxx . . $ _gtk_css_ease_value_new_steps(18ad43ec1558473d). (parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[0],
347 parser_valuescxx . . $ parser_values.[i].valuescxx . . $ $anonymous_type_10c22586a19b4ccb_4#values.[1] != 0.0);
348 }
349 }
350 }
351
352 gtk_css_parser_error_syntaxcxx . . $ gtk_css_parser_error_syntax(41ac99f7292d7f5f). (parser, "Expected a valid ease value");
353 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
354 }
355
356 double
357 _gtk_css_ease_value_transformcxx . . $ _gtk_css_ease_value_transform(aaf4d8e9bc9f0cb0). (const GtkCssValuecxx . . $ GtkCssValue# *ease,
358 double progress)
359 {
360 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (ease->class == &GTK_CSS_VALUE_EASE, 1.0);
361
362 if (progress <= 0)
363 return 0;
364 if (progress >= 1)
365 return 1;
366
367 switch (ease->typecxx . . $ _GtkCssValue#type.)
368 {
369 case GTK_CSS_EASE_CUBIC_BEZIERcxx . . $ GTK_CSS_EASE_CUBIC_BEZIER.:
370 {
371 static const double epsilon = 0.00001;
372 double tmin, t, tmax;
373
374 tmin = 0.0;
375 tmax = 1.0;
376 t = progress;
377
378 while (tmin < tmax)
379 {
380 double sample;
381 sample = (((1.0 + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. - 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2.) * t
382 + -6 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x2.) * t
383 + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..x1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#x1. ) * t;
384 if (fabs(sample - progress) < epsilon)
385 break;
386
387 if (progress > sample)
388 tmin = t;
389 else
390 tmax = t;
391 t = (tmax + tmin) * .5;
392 }
393
394 return (((1.0 + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. - 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2.) * t
395 + -6 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y2cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y2.) * t
396 + 3 * ease->ucxx . . $ _GtkCssValue#u..cubiccxx . . $ _GtkCssValue#$anonymous_type_1#cubic..y1cxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_2#y1. ) * t;
397 }
398 case GTK_CSS_EASE_STEPScxx . . $ GTK_CSS_EASE_STEPS.:
399 progress *= ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps.;
400 progress = floor (progress) + (ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..startcxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#start. ? 0 : 1);
401 return progress / ease->ucxx . . $ _GtkCssValue#u..stepscxx . . $ _GtkCssValue#$anonymous_type_1#steps..stepscxx . . $ _GtkCssValue#$anonymous_type_1#$anonymous_type_3#steps.;
402 default:
403 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
404 return 1.0;
405 }
406 }
407
408
409