Bug Summary

File:ctk/ctkcssstyleproperty.c
Warning:line 421, column 16
Using a fixed address is not portable because that address will probably not be valid in all environments or platforms

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name ctkcssstyleproperty.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/ctk -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -D G_LOG_DOMAIN="Ctk" -D G_LOG_USE_STRUCTURED=1 -D CTK_VERSION="3.25.5" -D CTK_BINARY_VERSION="3.0.0" -D CTK_COMPILATION -D CTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -D CTK_LIBDIR="/usr/lib" -D CTK_LOCALEDIR="/usr/share/locale" -D CTK_DATADIR="/usr/share" -D CTK_DATA_PREFIX="/usr" -D CTK_SYSCONFDIR="/usr/etc" -D CTK_HOST="x86_64-pc-linux-gnu" -D CTK_PRINT_BACKENDS="file,cups" -D X11_DATA_PREFIX="/usr" -D ISO_CODES_PREFIX="" -I .. -I ../ctk -I .. -I ../cdk -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -D G_ENABLE_DEBUG -D G_ENABLE_CONSISTENCY_CHECKS -D GLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_66 -D GLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_66 -I /usr/include/pango-1.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/atk-1.0 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/gio-unix-2.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/sysprof-6 -I /usr/include/pango-1.0 -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -D PIC -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/ctk -ferror-limit 19 -fvisibility=hidden -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-09-19-170037-43636-1 -x c ctkcssstyleproperty.c
1/*
2 * Copyright © 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.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 "ctkcssstylepropertyprivate.h"
23
24#include "ctkcssenumvalueprivate.h"
25#include "ctkcssinheritvalueprivate.h"
26#include "ctkcssinitialvalueprivate.h"
27#include "ctkcssstylefuncsprivate.h"
28#include "ctkcsstypesprivate.h"
29#include "ctkcssunsetvalueprivate.h"
30#include "ctkintl.h"
31#include "ctkprivatetypebuiltins.h"
32#include "ctkstylepropertiesprivate.h"
33#include "ctkprivate.h"
34
35/* this is in case round() is not provided by the compiler,
36 * such as in the case of C89 compilers, like MSVC
37 */
38#include "fallback-c89.c"
39
40enum {
41 PROP_0,
42 PROP_ANIMATED,
43 PROP_AFFECTS,
44 PROP_ID,
45 PROP_INHERIT,
46 PROP_INITIAL
47};
48
49G_DEFINE_TYPE (CtkCssStyleProperty, _ctk_css_style_property, CTK_TYPE_STYLE_PROPERTY)static void _ctk_css_style_property_init (CtkCssStyleProperty
*self); static void _ctk_css_style_property_class_init (CtkCssStylePropertyClass
*klass); static GType _ctk_css_style_property_get_type_once (
void); static gpointer _ctk_css_style_property_parent_class =
((void*)0); static gint CtkCssStyleProperty_private_offset; static
void _ctk_css_style_property_class_intern_init (gpointer klass
) { _ctk_css_style_property_parent_class = g_type_class_peek_parent
(klass); if (CtkCssStyleProperty_private_offset != 0) g_type_class_adjust_private_offset
(klass, &CtkCssStyleProperty_private_offset); _ctk_css_style_property_class_init
((CtkCssStylePropertyClass*) klass); } __attribute__ ((__unused__
)) static inline gpointer _ctk_css_style_property_get_instance_private
(CtkCssStyleProperty *self) { return (((gpointer) ((guint8*)
(self) + (glong) (CtkCssStyleProperty_private_offset)))); } GType
_ctk_css_style_property_get_type (void) { static GType static_g_define_type_id
= 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id
) == sizeof (gpointer), "Expression evaluates to false"); (void
) (0 ? (gpointer) * (&static_g_define_type_id) : ((void*)
0)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id
) == sizeof (gpointer), "Expression evaluates to false"); __typeof__
(*(&static_g_define_type_id)) gapg_temp_newval; __typeof__
((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id
); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)
; gapg_temp_newval; })) && g_once_init_enter_pointer (
&static_g_define_type_id)); })) ) { GType g_define_type_id
= _ctk_css_style_property_get_type_once (); (__extension__ (
{ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof
(gpointer), "Expression evaluates to false"); 0 ? (void) (*(
&static_g_define_type_id) = (g_define_type_id)) : (void) 0
; g_once_init_leave_pointer ((&static_g_define_type_id), (
gpointer) (guintptr) (g_define_type_id)); })) ; } return static_g_define_type_id
; } __attribute__ ((__noinline__)) static GType _ctk_css_style_property_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((_ctk_style_property_get_type ()), g_intern_static_string (
"CtkCssStyleProperty"), sizeof (CtkCssStylePropertyClass), (GClassInitFunc
)(void (*)(void)) _ctk_css_style_property_class_intern_init, sizeof
(CtkCssStyleProperty), (GInstanceInitFunc)(void (*)(void)) _ctk_css_style_property_init
, (GTypeFlags) 0); { {{};} } return g_define_type_id; }
50
51static CtkCssStylePropertyClass *ctk_css_style_property_class = NULL((void*)0);
52
53static void
54ctk_css_style_property_constructed (GObject *object)
55{
56 CtkCssStyleProperty *property = CTK_CSS_STYLE_PROPERTY (object)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (object), ((_ctk_css_style_property_get_type
()))))))
;
57 CtkCssStylePropertyClass *klass = CTK_CSS_STYLE_PROPERTY_GET_CLASS (property)((((CtkCssStylePropertyClass*) (((GTypeInstance*) ((property)
))->g_class))))
;
58
59 property->id = klass->style_properties->len;
60 g_ptr_array_add (klass->style_properties, property);
61
62 G_OBJECT_CLASS (_ctk_css_style_property_parent_class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((_ctk_css_style_property_parent_class)), (((GType) ((20) <<
(2))))))))
->constructed (object);
63}
64
65static void
66ctk_css_style_property_set_property (GObject *object,
67 guint prop_id,
68 const GValue *value,
69 GParamSpec *pspec)
70{
71 CtkCssStyleProperty *property = CTK_CSS_STYLE_PROPERTY (object)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (object), ((_ctk_css_style_property_get_type
()))))))
;
72
73 switch (prop_id)
74 {
75 case PROP_ANIMATED:
76 property->animated = g_value_get_boolean (value);
77 break;
78 case PROP_AFFECTS:
79 property->affects = g_value_get_flags (value);
80 break;
81 case PROP_INHERIT:
82 property->inherit = g_value_get_boolean (value);
83 break;
84 case PROP_INITIAL:
85 property->initial_value = g_value_dup_boxed (value);
86 g_assert (property->initial_value != NULL)do { if (property->initial_value != ((void*)0)) ; else g_assertion_message_expr
("Ctk", "ctkcssstyleproperty.c", 86, ((const char*) (__func__
)), "property->initial_value != NULL"); } while (0)
;
87 break;
88 default:
89 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)do { GObject *_glib__object = (GObject*) ((object)); GParamSpec
*_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id
= ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"
, "ctkcssstyleproperty.c", 89, ("property"), _glib__property_id
, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance
*) (_glib__pspec))->g_class))->g_type)))), (g_type_name
((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class
))->g_type)))))); } while (0)
;
90 break;
91 }
92}
93
94static void
95ctk_css_style_property_get_property (GObject *object,
96 guint prop_id,
97 GValue *value,
98 GParamSpec *pspec)
99{
100 CtkCssStyleProperty *property = CTK_CSS_STYLE_PROPERTY (object)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (object), ((_ctk_css_style_property_get_type
()))))))
;
101
102 switch (prop_id)
103 {
104 case PROP_ANIMATED:
105 g_value_set_boolean (value, property->animated);
106 break;
107 case PROP_AFFECTS:
108 g_value_set_flags (value, property->affects);
109 break;
110 case PROP_ID:
111 g_value_set_boolean (value, property->id);
112 break;
113 case PROP_INHERIT:
114 g_value_set_boolean (value, property->inherit);
115 break;
116 case PROP_INITIAL:
117 g_value_set_boxed (value, property->initial_value);
118 break;
119 default:
120 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec)do { GObject *_glib__object = (GObject*) ((object)); GParamSpec
*_glib__pspec = (GParamSpec*) ((pspec)); guint _glib__property_id
= ((prop_id)); g_warning ("%s:%d: invalid %s id %u for \"%s\" of type '%s' in '%s'"
, "ctkcssstyleproperty.c", 120, ("property"), _glib__property_id
, _glib__pspec->name, g_type_name ((((((GTypeClass*) (((GTypeInstance
*) (_glib__pspec))->g_class))->g_type)))), (g_type_name
((((((GTypeClass*) (((GTypeInstance*) (_glib__object))->g_class
))->g_type)))))); } while (0)
;
121 break;
122 }
123}
124
125static void
126_ctk_css_style_property_assign (CtkStyleProperty *property,
127 CtkStyleProperties *props,
128 CtkStateFlags state,
129 const GValue *value)
130{
131 CtkCssStyleProperty *style;
132 CtkCssValue *css_value;
133
134 style = CTK_CSS_STYLE_PROPERTY (property)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (property), ((_ctk_css_style_property_get_type
()))))))
;
135 css_value = style->assign_value (style, value);
136
137 _ctk_style_properties_set_property_by_property (props,
138 style,
139 state,
140 css_value);
141 _ctk_css_value_unref (css_value);
142}
143
144static void
145_ctk_css_style_property_query (CtkStyleProperty *property,
146 GValue *value,
147 CtkStyleQueryFunc query_func,
148 gpointer query_data)
149{
150 CtkCssStyleProperty *style_property = CTK_CSS_STYLE_PROPERTY (property)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (property), ((_ctk_css_style_property_get_type
()))))))
;
151 CtkCssValue *css_value;
152
153 css_value = (* query_func) (CTK_CSS_STYLE_PROPERTY (property)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (property), ((_ctk_css_style_property_get_type
()))))))
->id, query_data);
154 if (css_value == NULL((void*)0))
155 css_value =_ctk_css_style_property_get_initial_value (style_property);
156
157 style_property->query_value (style_property, css_value, value);
158}
159
160static CtkCssValue *
161ctk_css_style_property_parse_value (CtkStyleProperty *property,
162 CtkCssParser *parser)
163{
164 CtkCssStyleProperty *style_property = CTK_CSS_STYLE_PROPERTY (property)((((CtkCssStyleProperty*) (void *) g_type_check_instance_cast
((GTypeInstance*) (property), ((_ctk_css_style_property_get_type
()))))))
;
165
166 if (_ctk_css_parser_try (parser, "initial", TRUE(!(0))))
167 {
168 /* the initial value can be explicitly specified with the
169 * ‘initial’ keyword which all properties accept.
170 */
171 return _ctk_css_initial_value_new ();
172 }
173 else if (_ctk_css_parser_try (parser, "inherit", TRUE(!(0))))
174 {
175 /* All properties accept the ‘inherit’ value which
176 * explicitly specifies that the value will be determined
177 * by inheritance. The ‘inherit’ value can be used to
178 * strengthen inherited values in the cascade, and it can
179 * also be used on properties that are not normally inherited.
180 */
181 return _ctk_css_inherit_value_new ();
182 }
183 else if (_ctk_css_parser_try (parser, "unset", TRUE(!(0))))
184 {
185 /* If the cascaded value of a property is the unset keyword,
186 * then if it is an inherited property, this is treated as
187 * inherit, and if it is not, this is treated as initial.
188 */
189 return _ctk_css_unset_value_new ();
190 }
191
192 return (* style_property->parse_value) (style_property, parser);
193}
194
195static void
196_ctk_css_style_property_class_init (CtkCssStylePropertyClass *klass)
197{
198 GObjectClass *object_class = G_OBJECT_CLASS (klass)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), (((GType) ((20) << (2))))))))
;
199 CtkStylePropertyClass *property_class = CTK_STYLE_PROPERTY_CLASS (klass)((((CtkStylePropertyClass*) (void *) g_type_check_class_cast (
(GTypeClass*) (klass), ((_ctk_style_property_get_type ())))))
)
;
200
201 object_class->constructed = ctk_css_style_property_constructed;
202 object_class->set_property = ctk_css_style_property_set_property;
203 object_class->get_property = ctk_css_style_property_get_property;
204
205 g_object_class_install_property (object_class,
206 PROP_ANIMATED,
207 g_param_spec_boolean ("animated",
208 P_("Animated")g_dgettext("ctk30" "-properties","Animated"),
209 P_("Set if the value can be animated")g_dgettext("ctk30" "-properties","Set if the value can be animated"
)
,
210 FALSE(0),
211 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
212 g_object_class_install_property (object_class,
213 PROP_AFFECTS,
214 g_param_spec_flags ("affects",
215 P_("Affects")g_dgettext("ctk30" "-properties","Affects"),
216 P_("Set if the value affects the sizing of elements")g_dgettext("ctk30" "-properties","Set if the value affects the sizing of elements"
)
,
217 CTK_TYPE_CSS_AFFECTS(_ctk_css_affects_get_type ()),
218 0,
219 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
220 g_object_class_install_property (object_class,
221 PROP_ID,
222 g_param_spec_uint ("id",
223 P_("ID")g_dgettext("ctk30" "-properties","ID"),
224 P_("The numeric id for quick access")g_dgettext("ctk30" "-properties","The numeric id for quick access"
)
,
225 0, G_MAXUINT(2147483647 *2U +1U), 0,
226 G_PARAM_READABLE));
227 g_object_class_install_property (object_class,
228 PROP_INHERIT,
229 g_param_spec_boolean ("inherit",
230 P_("Inherit")g_dgettext("ctk30" "-properties","Inherit"),
231 P_("Set if the value is inherited by default")g_dgettext("ctk30" "-properties","Set if the value is inherited by default"
)
,
232 FALSE(0),
233 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
234 g_object_class_install_property (object_class,
235 PROP_INITIAL,
236 g_param_spec_boxed ("initial-value",
237 P_("Initial value")g_dgettext("ctk30" "-properties","Initial value"),
238 P_("The initial specified value used for this property")g_dgettext("ctk30" "-properties","The initial specified value used for this property"
)
,
239 CTK_TYPE_CSS_VALUE(_ctk_css_value_get_type ()),
240 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
241
242 property_class->assign = _ctk_css_style_property_assign;
243 property_class->query = _ctk_css_style_property_query;
244 property_class->parse_value = ctk_css_style_property_parse_value;
245
246 klass->style_properties = g_ptr_array_new ();
247
248 ctk_css_style_property_class = klass;
249}
250
251static CtkCssValue *
252ctk_css_style_property_real_parse_value (CtkCssStyleProperty *property G_GNUC_UNUSED__attribute__ ((__unused__)),
253 CtkCssParser *parser G_GNUC_UNUSED__attribute__ ((__unused__)))
254{
255 g_assert_not_reached ()do { g_assertion_message_expr ("Ctk", "ctkcssstyleproperty.c"
, 255, ((const char*) (__func__)), ((void*)0)); } while (0)
;
256 return NULL((void*)0);
257}
258
259static void
260_ctk_css_style_property_init (CtkCssStyleProperty *property)
261{
262 property->parse_value = ctk_css_style_property_real_parse_value;
263}
264
265/**
266 * _ctk_css_style_property_get_n_properties:
267 *
268 * Gets the number of style properties. This number can increase when new
269 * theme engines are loaded. Shorthand properties are not included here.
270 *
271 * Returns: The number of style properties.
272 **/
273guint
274_ctk_css_style_property_get_n_properties (void)
275{
276 if (G_UNLIKELY (ctk_css_style_property_class == NULL)(ctk_css_style_property_class == ((void*)0)))
277 {
278 _ctk_style_property_init_properties ();
279 g_assert (ctk_css_style_property_class)do { if (ctk_css_style_property_class) ; else g_assertion_message_expr
("Ctk", "ctkcssstyleproperty.c", 279, ((const char*) (__func__
)), "ctk_css_style_property_class"); } while (0)
;
280 }
281
282 return ctk_css_style_property_class->style_properties->len;
283}
284
285/**
286 * _ctk_css_style_property_lookup_by_id:
287 * @id: the id of the property
288 *
289 * Gets the style property with the given id. All style properties (but not
290 * shorthand properties) are indexable by id so that it’s easy to use arrays
291 * when doing style lookups.
292 *
293 * Returns: (transfer none): The style property with the given id
294 **/
295CtkCssStyleProperty *
296_ctk_css_style_property_lookup_by_id (guint id)
297{
298
299 if (G_UNLIKELY (ctk_css_style_property_class == NULL)(ctk_css_style_property_class == ((void*)0)))
300 {
301 _ctk_style_property_init_properties ();
302 g_assert (ctk_css_style_property_class)do { if (ctk_css_style_property_class) ; else g_assertion_message_expr
("Ctk", "ctkcssstyleproperty.c", 302, ((const char*) (__func__
)), "ctk_css_style_property_class"); } while (0)
;
303 }
304
305 ctk_internal_return_val_if_fail (id < ctk_css_style_property_class->style_properties->len, NULL)do { if ((id < ctk_css_style_property_class->style_properties
->len)) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "id < ctk_css_style_property_class->style_properties->len"
); return (((void*)0)); } } while (0)
;
306
307 return g_ptr_array_index (ctk_css_style_property_class->style_properties, id)((ctk_css_style_property_class->style_properties)->pdata
)[id]
;
308}
309
310/**
311 * _ctk_css_style_property_is_inherit:
312 * @property: the property
313 *
314 * Queries if the given @property is inherited. See the
315 * [CSS Documentation](http://www.w3.org/TR/css3-cascade/#inheritance)
316 * for an explanation of this concept.
317 *
318 * Returns: %TRUE if the property is inherited by default.
319 **/
320gboolean
321_ctk_css_style_property_is_inherit (CtkCssStyleProperty *property)
322{
323 ctk_internal_return_val_if_fail (CTK_IS_CSS_STYLE_PROPERTY (property), FALSE)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) (property); GType __t = ((_ctk_css_style_property_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (property); GType __t = ((_ctk_css_style_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))"
); return ((0)); } } while (0)
;
324
325 return property->inherit;
326}
327
328/**
329 * _ctk_css_style_property_is_animated:
330 * @property: the property
331 *
332 * Queries if the given @property can be is animated. See the
333 * [CSS Documentation](http://www.w3.org/TR/css3-transitions/#animatable-css)
334 * for animatable properties.
335 *
336 * Returns: %TRUE if the property can be animated.
337 **/
338gboolean
339_ctk_css_style_property_is_animated (CtkCssStyleProperty *property)
340{
341 ctk_internal_return_val_if_fail (CTK_IS_CSS_STYLE_PROPERTY (property), FALSE)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) (property); GType __t = ((_ctk_css_style_property_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (property); GType __t = ((_ctk_css_style_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))"
); return ((0)); } } while (0)
;
342
343 return property->animated;
344}
345
346/**
347 * _ctk_css_style_property_get_affects:
348 * @property: the property
349 *
350 * Returns all the things this property affects. See @CtkCssAffects for what
351 * the flags mean.
352 *
353 * Returns: The things this property affects.
354 **/
355CtkCssAffects
356_ctk_css_style_property_get_affects (CtkCssStyleProperty *property)
357{
358 ctk_internal_return_val_if_fail (CTK_IS_CSS_STYLE_PROPERTY (property), 0)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) (property); GType __t = ((_ctk_css_style_property_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (property); GType __t = ((_ctk_css_style_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))"
); return (0); } } while (0)
;
359
360 return property->affects;
361}
362
363/**
364 * _ctk_css_style_property_get_id:
365 * @property: the property
366 *
367 * Gets the id for the given property. IDs are used to allow using arrays
368 * for style lookups.
369 *
370 * Returns: The id of the property
371 **/
372guint
373_ctk_css_style_property_get_id (CtkCssStyleProperty *property)
374{
375 ctk_internal_return_val_if_fail (CTK_IS_CSS_STYLE_PROPERTY (property), 0)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) (property); GType __t = ((_ctk_css_style_property_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (property); GType __t = ((_ctk_css_style_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))"
); return (0); } } while (0)
;
376
377 return property->id;
378}
379
380/**
381 * _ctk_css_style_property_get_initial_value:
382 * @property: the property
383 *
384 * Queries the initial value of the given @property. See the
385 * [CSS Documentation](http://www.w3.org/TR/css3-cascade/#intial)
386 * for an explanation of this concept.
387 *
388 * Returns: (transfer none): the initial value. The value will never change.
389 **/
390CtkCssValue *
391_ctk_css_style_property_get_initial_value (CtkCssStyleProperty *property)
392{
393 ctk_internal_return_val_if_fail (CTK_IS_CSS_STYLE_PROPERTY (property), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance
*) (property); GType __t = ((_ctk_css_style_property_get_type
())); gboolean __r; if (!__inst) __r = (0); else if (__inst->
g_class && __inst->g_class->g_type == __t) __r =
(!(0)); else __r = g_type_check_instance_is_a (__inst, __t);
__r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const
char*) (__func__)), "(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) (property); GType __t = ((_ctk_css_style_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))"
); return (((void*)0)); } } while (0)
;
394
395 return property->initial_value;
396}
397
398/**
399 * _ctk_css_style_property_get_mask_affecting:
400 * @flags: the flags that are affected
401 *
402 * Computes a bitmask for all properties that have at least one of @flags
403 * set.
404 *
405 * Returns: (transfer full): A #CtkBitmask with the bit set for every
406 * property that has at least one of @flags set.
407 */
408CtkBitmask *
409_ctk_css_style_property_get_mask_affecting (CtkCssAffects affects)
410{
411 CtkBitmask *result;
412 guint i;
413
414 result = _ctk_bitmask_new ();
415
416 for (i = 0; i < _ctk_css_style_property_get_n_properties (); i++)
1
Assuming the condition is true
2
Loop condition is true. Entering loop body
417 {
418 CtkCssStyleProperty *prop = _ctk_css_style_property_lookup_by_id (i);
419
420 if (_ctk_css_style_property_get_affects (prop) & affects)
3
Assuming the condition is true
4
Taking true branch
421 result = _ctk_bitmask_set (result, i, TRUE(!(0)));
5
Using a fixed address is not portable because that address will probably not be valid in all environments or platforms
422 }
423
424 return result;
425}
426