Debian Codegraph @

gtk/gtkbitmaskprivateimpl.h

raw symbols SCIP
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, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 * Authors: Benjamin Otte <[email protected]>
19 */
20
21
22 static inline GtkBitmaskcxx . . $ GtkBitmask# *
23 _gtk_bitmask_newcxx . . $ _gtk_bitmask_new(362ac8b55a0f6712). (void)
24 {
25 return _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (0);
26 }
27
28 static inline GtkBitmaskcxx . . $ GtkBitmask# *
29 _gtk_bitmask_copycxx . . $ _gtk_bitmask_copy(5e69b92442e31eb0). (const GtkBitmaskcxx . . $ GtkBitmask# *mask)
30 {
31 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask))
32 return _gtk_allocated_bitmask_copycxx . . $ _gtk_allocated_bitmask_copy(5e69b92442e31eb0). (mask);
33 else
34 return (GtkBitmaskcxx . . $ GtkBitmask# *) mask;
35 }
36
37 static inline void
38 _gtk_bitmask_freecxx . . $ _gtk_bitmask_free(44a0a5f2c5822bdd). (GtkBitmaskcxx . . $ GtkBitmask# *mask)
39 {
40 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask))
41 _gtk_allocated_bitmask_freecxx . . $ _gtk_allocated_bitmask_free(44a0a5f2c5822bdd). (mask);
42 }
43
44 static inline char *
45 _gtk_bitmask_to_stringcxx . . $ _gtk_bitmask_to_string(67d397e5e5befe48). (const GtkBitmaskcxx . . $ GtkBitmask# *mask)
46 {
47 GStringcxx . . $ GString# *string;
48
49 string = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
50 _gtk_allocated_bitmask_printcxx . . $ _gtk_allocated_bitmask_print(70a817151bb95d36). (mask, string);
51 return g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (string, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
52 }
53
54 static inline void
55 _gtk_bitmask_printcxx . . $ _gtk_bitmask_print(70a817151bb95d36). (const GtkBitmaskcxx . . $ GtkBitmask# *mask,
56 GStringcxx . . $ GString# *string)
57 {
58 _gtk_allocated_bitmask_printcxx . . $ _gtk_allocated_bitmask_print(70a817151bb95d36). (mask, string);
59 }
60
61 static inline GtkBitmaskcxx . . $ GtkBitmask# *
62 _gtk_bitmask_intersectcxx . . $ _gtk_bitmask_intersect(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask,
63 const GtkBitmaskcxx . . $ GtkBitmask# *other)
64 {
65 return _gtk_allocated_bitmask_intersectcxx . . $ _gtk_allocated_bitmask_intersect(34e98e8a5c56d9c8). (mask, other);
66 }
67
68 static inline GtkBitmaskcxx . . $ GtkBitmask# *
69 _gtk_bitmask_unioncxx . . $ _gtk_bitmask_union(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask,
70 const GtkBitmaskcxx . . $ GtkBitmask# *other)
71 {
72 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask) ||
73 _gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (other))
74 return _gtk_allocated_bitmask_unioncxx . . $ _gtk_allocated_bitmask_union(34e98e8a5c56d9c8). (mask, other);
75 else
76 return _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (_gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask)
77 | _gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (other));
78 }
79
80 static inline GtkBitmaskcxx . . $ GtkBitmask# *
81 _gtk_bitmask_subtractcxx . . $ _gtk_bitmask_subtract(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask,
82 const GtkBitmaskcxx . . $ GtkBitmask# *other)
83 {
84 return _gtk_allocated_bitmask_subtractcxx . . $ _gtk_allocated_bitmask_subtract(34e98e8a5c56d9c8). (mask, other);
85 }
86
87 static inline gbooleancxx . . $ gboolean#
88 _gtk_bitmask_getcxx . . $ _gtk_bitmask_get(ec1f9572e2cb12df). (const GtkBitmaskcxx . . $ GtkBitmask# *mask,
89 guintcxx . . $ guint# index_)
90 {
91 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask))
92 return _gtk_allocated_bitmask_getcxx . . $ _gtk_allocated_bitmask_get(ec1f9572e2cb12df). (mask, index_);
93 else
94 return index_ < GTK_BITMASK_N_DIRECT_BITScxx . . $ `gtk/gtkallocatedbitmaskprivate.h:38:9`!
95 ? !!(_gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask) & (((gsizecxx . . $ gsize#) 1) << index_))
96 : FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
97 }
98
99 static inline GtkBitmaskcxx . . $ GtkBitmask# *
100 _gtk_bitmask_setcxx . . $ _gtk_bitmask_set(d4be56091f3b3606). (GtkBitmaskcxx . . $ GtkBitmask# *mask,
101 guintcxx . . $ guint# index_,
102 gbooleancxx . . $ gboolean# value)
103 {
104 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask) ||
105 (index_ >= GTK_BITMASK_N_DIRECT_BITScxx . . $ `gtk/gtkallocatedbitmaskprivate.h:38:9`! && value))
106 return _gtk_allocated_bitmask_setcxx . . $ _gtk_allocated_bitmask_set(d4be56091f3b3606). (mask, index_, value);
107 else if (index_ < GTK_BITMASK_N_DIRECT_BITScxx . . $ `gtk/gtkallocatedbitmaskprivate.h:38:9`!)
108 {
109 gsizecxx . . $ gsize# bits = _gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask);
110
111 if (value)
112 bits |= ((gsizecxx . . $ gsize#) 1) << index_;
113 else
114 bits &= ~(((gsizecxx . . $ gsize#) 1) << index_);
115
116 return _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (bits);
117 }
118 else
119 return mask;
120 }
121
122 static inline GtkBitmaskcxx . . $ GtkBitmask# *
123 _gtk_bitmask_invert_rangecxx . . $ _gtk_bitmask_invert_range(a06d9023d633a412). (GtkBitmaskcxx . . $ GtkBitmask# *mask,
124 guintcxx . . $ guint# start,
125 guintcxx . . $ guint# end)
126 {
127 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (start <= end);
128
129 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask) ||
130 (end > GTK_BITMASK_N_DIRECT_BITScxx . . $ `gtk/gtkallocatedbitmaskprivate.h:38:9`!))
131 return _gtk_allocated_bitmask_invert_rangecxx . . $ _gtk_allocated_bitmask_invert_range(a06d9023d633a412). (mask, start, end);
132 else
133 {
134 gsizecxx . . $ gsize# invert = (((gsizecxx . . $ gsize#) 1) << end) - (((gsizecxx . . $ gsize#) 1) << start);
135
136 return _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (_gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask) ^ invert);
137 }
138 }
139
140 static inline gbooleancxx . . $ gboolean#
141 _gtk_bitmask_is_emptycxx . . $ _gtk_bitmask_is_empty(2272a2a7969c90ab). (const GtkBitmaskcxx . . $ GtkBitmask# *mask)
142 {
143 return mask == _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (0);
144 }
145
146 static inline gbooleancxx . . $ gboolean#
147 _gtk_bitmask_equalscxx . . $ _gtk_bitmask_equals(c414c135749c1bec). (const GtkBitmaskcxx . . $ GtkBitmask# *mask,
148 const GtkBitmaskcxx . . $ GtkBitmask# *other)
149 {
150 if (mask == other)
151 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
152
153 if (!_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask) ||
154 !_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (other))
155 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
156
157 return _gtk_allocated_bitmask_equalscxx . . $ _gtk_allocated_bitmask_equals(c414c135749c1bec). (mask, other);
158 }
159
160 static inline gbooleancxx . . $ gboolean#
161 _gtk_bitmask_intersectscxx . . $ _gtk_bitmask_intersects(c414c135749c1bec). (const GtkBitmaskcxx . . $ GtkBitmask# *mask,
162 const GtkBitmaskcxx . . $ GtkBitmask# *other)
163 {
164 if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask) ||
165 _gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (other))
166 return _gtk_allocated_bitmask_intersectscxx . . $ _gtk_allocated_bitmask_intersects(c414c135749c1bec). (mask, other);
167 else
168 return _gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask) & _gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (other) ? TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`! : FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
169 }