Debian Codegraph @

gtk/gtkiconpaintable.c

raw symbols SCIP
1 /* GtkIconTheme - a loader for icon themes
2 * gtk-icon-theme.c Copyright (C) 2002, 2003 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 <glib.h>
21
22 #include "gtkiconpaintableprivate.h"cxx . . $ `<file>/gtk/gtkiconpaintableprivate.h`/
23
24 #include "gtkiconthemeprivate.h"cxx . . $ `<file>/gtk/gtkiconthemeprivate.h`/
25 #include "gtksnapshotprivate.h"cxx . . $ `<file>/gtk/gtksnapshotprivate.h`/
26 #include "gtksymbolicpaintable.h"cxx . . $ `<file>/gtk/gtksymbolicpaintable.h`/
27 #include "gdktextureutilsprivate.h"cxx . . $ `<file>/gtk/gdktextureutilsprivate.h`/
28 #include "gdk/gdktextureprivate.h"cxx . . $ `<file>/gdk/gdktextureprivate.h`/
29 #include "gdk/gdkprofilerprivate.h"cxx . . $ `<file>/gdk/gdkprofilerprivate.h`/
30
31
32 /**
33 * GtkIconPaintable:
34 *
35 * Contains information found when looking up an icon in `GtkIconTheme`
36 * or loading it from a file.
37 *
38 * `GtkIconPaintable` implements `GdkPaintable` and `GtkSymbolicPaintable`.
39 */
40
41 /* {{{ Utilities */
42
43 static inline gbooleancxx . . $ gboolean#
44 icon_uri_is_symboliccxx . . $ icon_uri_is_symbolic(cb7559238bb26814). (const char *icon_name,
45 int icon_name_len)
46 {
47 if (g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon_name, "-symbolic.svg") ||
48 g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon_name, ".symbolic.png") ||
49 g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon_name, "-symbolic-ltr.svg") ||
50 g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon_name, "-symbolic-rtl.svg"))
51 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
52
53 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
54 }
55
56 static void
57 gtk_icon_paintable_set_filecxx . . $ gtk_icon_paintable_set_file(aba4ef0f9dc48b7). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon,
58 GFilecxx . . $ GFile# *file)
59 {
60 if (!file)
61 return;
62
63 icon->loadablecxx . . $ _GtkIconPaintable#loadable. = G_LOADABLE_ICONcxx . . $ `<external>/3440158711917559949/gloadableicon.h:35:9`! (g_file_icon_new (file));
64 icon->is_resourcecxx . . $ _GtkIconPaintable#is_resource. = g_file_has_uri_schemecxx . . $ g_file_has_uri_scheme(9805bf3891cc7879). (file, "resource");
65
66 if (icon->is_resourcecxx . . $ _GtkIconPaintable#is_resource.)
67 {
68 char *uri = g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (file);
69 icon->filenamecxx . . $ _GtkIconPaintable#filename. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri + strlen ("resource://"));
70 g_freecxx . . $ g_free(5d22bdacc48458e8). (uri);
71 }
72 else
73 {
74 icon->filenamecxx . . $ _GtkIconPaintable#filename. = g_file_get_pathcxx . . $ g_file_get_path(bd69fa69840f32a9). (file);
75 }
76
77 icon->is_svgcxx . . $ _GtkIconPaintable#is_svg. = g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon->filename, ".svg");
78 icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. = icon_uri_is_symboliccxx . . $ icon_uri_is_symbolic(cb7559238bb26814). (icon->filenamecxx . . $ _GtkIconPaintable#filename., -1);
79 }
80
81 static GFilecxx . . $ GFile# *
82 new_resource_filecxx . . $ new_resource_file(ba1fd5950b7d7bd5). (const char *filename)
83 {
84 char *escaped = g_uri_escape_stringcxx . . $ g_uri_escape_string(2e2de56da327d927). (filename,
85 G_URI_RESERVED_CHARS_ALLOWED_IN_PATHcxx . . $ `<external>/10191889811899801514/guri.h:377:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
86 char *uri = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). ("resource://", escaped, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
87 GFilecxx . . $ GFile# *file = g_file_new_for_uricxx . . $ g_file_new_for_uri(ba1fd5950b7d7bd5). (uri);
88
89 g_freecxx . . $ g_free(5d22bdacc48458e8). (escaped);
90 g_freecxx . . $ g_free(5d22bdacc48458e8). (uri);
91
92 return file;
93 }
94
95 /* }}} */
96 /* {{{ Icon loading */
97
98 /* This function contains the complicated logic for deciding
99 * on the size at which to load the icon and loading it at
100 * that size.
101 */
102 static void
103 icon_ensure_node__lockedcxx . . $ icon_ensure_node__locked(3cf104c42617365f). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon,
104 gbooleancxx . . $ gboolean# in_thread)
105 {
106 gint64cxx . . $ gint64# before;
107 int pixel_size;
108 GErrorcxx . . $ GError# *load_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
109 GdkTexturecxx . . $ GdkTexture# *texture = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
110 gbooleancxx . . $ gboolean# only_fg = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
111 gbooleancxx . . $ gboolean# single_path = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
112 gbooleancxx . . $ gboolean# has_strokes = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
113
114 icon_cache_mark_used_if_cachedcxx . . $ icon_cache_mark_used_if_cached(e552487ca8eeea2). (icon);
115
116 if (icon->nodecxx . . $ _GtkIconPaintable#node.)
117 return;
118
119 before = GDK_PROFILER_CURRENT_TIMEcxx . . $ `gdk/gdkprofilerprivate.h:39:9`!;
120
121 /* This is the natural pixel size for the requested icon size + scale in this directory.
122 * We precalculate this so we can use it as a rasterization size for svgs.
123 */
124 pixel_size = icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. * icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale.;
125
126 /* At this point, we need to actually get the icon; either from the
127 * builtin image or by loading the file
128 */
129 if (icon->is_resourcecxx . . $ _GtkIconPaintable#is_resource.)
130 {
131 if (icon->is_svgcxx . . $ _GtkIconPaintable#is_svg.)
132 {
133 if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic.)
134 {
135 if (icon->allow_nodecxx . . $ _GtkIconPaintable#allow_node.)
136 icon->nodecxx . . $ _GtkIconPaintable#node. = gsk_render_node_new_from_resource_symboliccxx . . $ gsk_render_node_new_from_resource_symbolic(9e153514bd2a9c69). (icon->filenamecxx . . $ _GtkIconPaintable#filename.,
137 &only_fg,
138 &single_path,
139 &has_strokes,
140 &icon->widthcxx . . $ _GtkIconPaintable#width.,
141 &icon->heightcxx . . $ _GtkIconPaintable#height.);
142 if (!icon->nodecxx . . $ _GtkIconPaintable#node.)
143 texture = gdk_texture_new_from_resource_symboliccxx . . $ gdk_texture_new_from_resource_symbolic(9255ba3a4d9a6bcb). (icon->filenamecxx . . $ _GtkIconPaintable#filename.,
144 pixel_size, pixel_size,
145 &only_fg,
146 &load_error);
147 }
148 else
149 texture = gdk_texture_new_from_resource_at_scalecxx . . $ gdk_texture_new_from_resource_at_scale(9255ba3a4d9a6bcb). (icon->filenamecxx . . $ _GtkIconPaintable#filename.,
150 pixel_size, pixel_size,
151 &only_fg,
152 &load_error);
153 }
154 else
155 texture = gdk_texture_new_from_resource_with_fgcxx . . $ gdk_texture_new_from_resource_with_fg(aae62580bb0729b). (icon->filenamecxx . . $ _GtkIconPaintable#filename., &only_fg);
156 }
157 else if (icon->filenamecxx . . $ _GtkIconPaintable#filename.)
158 {
159 if (icon->is_svgcxx . . $ _GtkIconPaintable#is_svg.)
160 {
161 if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic.)
162 {
163 if (icon->allow_nodecxx . . $ _GtkIconPaintable#allow_node.)
164 icon->nodecxx . . $ _GtkIconPaintable#node. = gsk_render_node_new_from_filename_symboliccxx . . $ gsk_render_node_new_from_filename_symbolic(9e153514bd2a9c69). (icon->filenamecxx . . $ _GtkIconPaintable#filename.,
165 &only_fg,
166 &single_path,
167 &has_strokes,
168 &icon->widthcxx . . $ _GtkIconPaintable#width.,
169 &icon->heightcxx . . $ _GtkIconPaintable#height.);
170 if (!icon->nodecxx . . $ _GtkIconPaintable#node.)
171 texture = gdk_texture_new_from_filename_symboliccxx . . $ gdk_texture_new_from_filename_symbolic(9255ba3a4d9a6bcb). (icon->filenamecxx . . $ _GtkIconPaintable#filename.,
172 pixel_size, pixel_size,
173 &only_fg,
174 &load_error);
175 }
176 else
177 {
178 GFilecxx . . $ GFile# *file = g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). (icon->filenamecxx . . $ _GtkIconPaintable#filename.);
179 GInputStreamcxx . . $ GInputStream# *stream = G_INPUT_STREAMcxx . . $ `<external>/7672699116365272328/ginputstream.h:35:9`! (g_file_read (file, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &load_error));
180
181 if (stream)
182 {
183 texture = gdk_texture_new_from_stream_at_scalecxx . . $ gdk_texture_new_from_stream_at_scale(1961a3f78daefd58). (stream,
184 pixel_size, pixel_size,
185 &only_fg,
186 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
187 &load_error);
188 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream);
189 }
190
191 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (file);
192 }
193 }
194 else
195 {
196 texture = gdk_texture_new_from_filename_with_fgcxx . . $ gdk_texture_new_from_filename_with_fg(f23d8baa8d6da8a). (icon->filenamecxx . . $ _GtkIconPaintable#filename., &only_fg, &load_error);
197 }
198 }
199 else
200 {
201 GInputStreamcxx . . $ GInputStream# *stream;
202
203 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (icon->loadable);
204
205 stream = g_loadable_icon_loadcxx . . $ g_loadable_icon_load(dc67b6450e94a6eb). (icon->loadablecxx . . $ _GtkIconPaintable#loadable., pixel_size, 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`!, &load_error);
206 if (stream)
207 {
208 /* SVG icons are a special case - we just immediately scale them
209 * to the desired size
210 */
211 if (icon->is_svgcxx . . $ _GtkIconPaintable#is_svg.)
212 texture = gdk_texture_new_from_stream_at_scalecxx . . $ gdk_texture_new_from_stream_at_scale(1961a3f78daefd58). (stream,
213 pixel_size, pixel_size,
214 &only_fg,
215 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
216 &load_error);
217 else
218 texture = gdk_texture_new_from_stream_with_fgcxx . . $ gdk_texture_new_from_stream_with_fg(11f7a7b4e9870ce6). (stream, &only_fg, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &load_error);
219
220 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream);
221 }
222 }
223
224 icon->only_fgcxx . . $ _GtkIconPaintable#only_fg. = only_fg;
225 icon->single_pathcxx . . $ _GtkIconPaintable#single_path. = single_path;
226 icon->has_strokescxx . . $ _GtkIconPaintable#has_strokes. = has_strokes;
227
228 if (icon->nodecxx . . $ _GtkIconPaintable#node.)
229 {
230 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (texture == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
231 }
232 else
233 {
234 if (!texture)
235 {
236 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:340:9`! ("Failed to load icon %s: %s", icon->filename, load_error ? load_error->message : "");
237 g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&load_error);
238 texture = gdk_texture_new_from_resourcecxx . . $ gdk_texture_new_from_resource(46c69d7b25d8ecce). (IMAGE_MISSING_RESOURCE_PATHcxx . . $ `gtk/gtkiconthemeprivate.h:27:9`!);
239 g_set_strcxx . . $ g_set_str(cc1a8f44225c7fe0). (&icon->icon_namecxx . . $ _GtkIconPaintable#icon_name., "image-missing");
240 icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
241 icon->only_fgcxx . . $ _GtkIconPaintable#only_fg. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
242 }
243
244 icon->widthcxx . . $ _GtkIconPaintable#width. = gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (texture);
245 icon->heightcxx . . $ _GtkIconPaintable#height. = gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (texture);
246 icon->nodecxx . . $ _GtkIconPaintable#node. = gsk_texture_node_newcxx . . $ gsk_texture_node_new(29a2c4e499c887af). (texture, &GRAPHENE_RECT_INITcxx . . $ `<external>/7539008420172022992/graphene-rect.h:50:9`! (0, 0,
247 icon->width,
248 icon->height));
249 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (texture);
250 }
251
252 if (GDK_PROFILER_IS_RUNNINGcxx . . $ `gdk/gdkprofilerprivate.h:38:9`!)
253 {
254 gint64cxx . . $ gint64# end = GDK_PROFILER_CURRENT_TIMEcxx . . $ `gdk/gdkprofilerprivate.h:39:9`!;
255 /* Don't report quick (< 0.5 msec) parses */
256 if (end - before > 500000 || !in_thread)
257 {
258 gdk_profiler_add_markfcxx . . $ `gdk/gdkprofilerprivate.h:79:9`! (before, (end - before), in_thread ? "Icon load (thread)" : "Icon load" ,
259 "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
260 }
261 }
262 }
263
264 static GskRenderNodecxx . . $ GskRenderNode# *
265 gtk_icon_paintable_ensure_nodecxx . . $ gtk_icon_paintable_ensure_node(47a8683f488e31d7). (GtkIconPaintablecxx . . $ GtkIconPaintable# *self)
266 {
267 GskRenderNodecxx . . $ GskRenderNode# *node = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
268
269 g_mutex_lockcxx . . $ g_mutex_lock(d80b1953a7cb7fd1). (&self->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
270
271 icon_ensure_node__lockedcxx . . $ icon_ensure_node__locked(3cf104c42617365f). (self, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
272
273 node = self->nodecxx . . $ _GtkIconPaintable#node.;
274
275 g_mutex_unlockcxx . . $ g_mutex_unlock(d80b1953a7cb7fd1). (&self->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
276
277 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (node != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
278
279 return node;
280 }
281
282 /* }}} */
283 /* {{{ Recoloring by color matrix */
284
285 static void
286 init_color_matrixcxx . . $ init_color_matrix(15123d820dbf1807). (graphene_matrix_tcxx . . $ graphene_matrix_t# *color_matrix,
287 graphene_vec4_tcxx . . $ graphene_vec4_t# *color_offset,
288 const GdkRGBAcxx . . $ GdkRGBA# *foreground_color,
289 const GdkRGBAcxx . . $ GdkRGBA# *success_color,
290 const GdkRGBAcxx . . $ GdkRGBA# *warning_color,
291 const GdkRGBAcxx . . $ GdkRGBA# *error_color)
292 {
293 const GdkRGBAcxx . . $ GdkRGBA# fg_default = { 0.7450980392156863, 0.7450980392156863, 0.7450980392156863, 1.0};
294 const GdkRGBAcxx . . $ GdkRGBA# success_default = { 0.3046921492332342,0.6015716792553597, 0.023437857633325704, 1.0};
295 const GdkRGBAcxx . . $ GdkRGBA# warning_default = {0.9570458533607996, 0.47266346227206835, 0.2421911955443656, 1.0 };
296 const GdkRGBAcxx . . $ GdkRGBA# error_default = { 0.796887159533074, 0 ,0, 1.0 };
297 const GdkRGBAcxx . . $ GdkRGBA# *fg = foreground_color ? foreground_color : &fg_default;
298 const GdkRGBAcxx . . $ GdkRGBA# *sc = success_color ? success_color : &success_default;
299 const GdkRGBAcxx . . $ GdkRGBA# *wc = warning_color ? warning_color : &warning_default;
300 const GdkRGBAcxx . . $ GdkRGBA# *ec = error_color ? error_color : &error_default;
301
302 graphene_matrix_init_from_floatcxx . . $ graphene_matrix_init_from_float(3b2d9e3ae13b80cc). (color_matrix,
303 (float[16]) {
304 sc->redcxx . . $ _GdkRGBA#red. - fg->redcxx . . $ _GdkRGBA#red., sc->greencxx . . $ _GdkRGBA#green. - fg->greencxx . . $ _GdkRGBA#green., sc->bluecxx . . $ _GdkRGBA#blue. - fg->bluecxx . . $ _GdkRGBA#blue., 0,
305 wc->redcxx . . $ _GdkRGBA#red. - fg->redcxx . . $ _GdkRGBA#red., wc->greencxx . . $ _GdkRGBA#green. - fg->greencxx . . $ _GdkRGBA#green., wc->bluecxx . . $ _GdkRGBA#blue. - fg->bluecxx . . $ _GdkRGBA#blue., 0,
306 ec->redcxx . . $ _GdkRGBA#red. - fg->redcxx . . $ _GdkRGBA#red., ec->greencxx . . $ _GdkRGBA#green. - fg->greencxx . . $ _GdkRGBA#green., ec->bluecxx . . $ _GdkRGBA#blue. - fg->bluecxx . . $ _GdkRGBA#blue., 0,
307 0, 0, 0, fg->alphacxx . . $ _GdkRGBA#alpha.
308 });
309 graphene_vec4_initcxx . . $ graphene_vec4_init(73afd23b6c26fd53). (color_offset, fg->redcxx . . $ _GdkRGBA#red., fg->greencxx . . $ _GdkRGBA#green., fg->bluecxx . . $ _GdkRGBA#blue., 0);
310 }
311
312 /* }}} */
313 /* {{{ GtkSymbolicPaintable implementation */
314
315 static void
316 gtk_icon_paintable_snapshot_with_weightcxx . . $ gtk_icon_paintable_snapshot_with_weight(fabb961a56a48e14). (GtkSymbolicPaintablecxx . . $ GtkSymbolicPaintable# *paintable,
317 GtkSnapshotcxx . . $ GtkSnapshot# *snapshot,
318 double width,
319 double height,
320 const GdkRGBAcxx . . $ GdkRGBA# *colors,
321 gsizecxx . . $ gsize# n_colors,
322 double weight)
323 {
324 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = GTK_ICON_PAINTABLEcxx . . $ GTK_ICON_PAINTABLE(b25946bb131e663e). (paintable);
325 GskRenderNodecxx . . $ GskRenderNode# *node, *recolored;
326 double render_width;
327 double render_height;
328 graphene_rect_tcxx . . $ graphene_rect_t# icon_rect;
329 graphene_rect_tcxx . . $ graphene_rect_t# render_rect;
330 gbooleancxx . . $ gboolean# colors_opaque;
331
332 node = gtk_icon_paintable_ensure_nodecxx . . $ gtk_icon_paintable_ensure_node(47a8683f488e31d7). (icon);
333 gsk_render_node_refcxx . . $ `gsk/gskrendernodeprivate.h:146:9`! (node);
334
335 if (icon->widthcxx . . $ _GtkIconPaintable#width. >= icon->heightcxx . . $ _GtkIconPaintable#height.)
336 {
337 render_width = width;
338 render_height = height * (icon->heightcxx . . $ _GtkIconPaintable#height. / icon->widthcxx . . $ _GtkIconPaintable#width.);
339 }
340 else
341 {
342 render_width = width * (icon->widthcxx . . $ _GtkIconPaintable#width. / icon->heightcxx . . $ _GtkIconPaintable#height.);
343 render_height = height;
344 }
345
346 graphene_rect_initcxx . . $ graphene_rect_init(41a513f04ded43b4). (&icon_rect, 0, 0, icon->widthcxx . . $ _GtkIconPaintable#width., icon->heightcxx . . $ _GtkIconPaintable#height.);
347 graphene_rect_initcxx . . $ graphene_rect_init(41a513f04ded43b4). (&render_rect,
348 (width - render_width) / 2,
349 (height - render_height) / 2,
350 render_width,
351 render_height);
352
353 if (icon->only_fgcxx . . $ _GtkIconPaintable#only_fg.)
354 colors_opaque = gdk_rgba_is_opaquecxx . . $ gdk_rgba_is_opaque(c8ce5f8f5f2819b9). (&colors[GTK_SYMBOLIC_COLOR_FOREGROUNDcxx . . $ GTK_SYMBOLIC_COLOR_FOREGROUND.]);
355 else
356 colors_opaque = gdk_rgba_is_opaquecxx . . $ gdk_rgba_is_opaque(c8ce5f8f5f2819b9). (&colors[GTK_SYMBOLIC_COLOR_FOREGROUNDcxx . . $ GTK_SYMBOLIC_COLOR_FOREGROUND.]) &&
357 GTK_SYMBOLIC_COLOR_SUCCESScxx . . $ GTK_SYMBOLIC_COLOR_SUCCESS. < n_colors && gdk_rgba_is_opaquecxx . . $ gdk_rgba_is_opaque(c8ce5f8f5f2819b9). (&colors[GTK_SYMBOLIC_COLOR_SUCCESScxx . . $ GTK_SYMBOLIC_COLOR_SUCCESS.]) &&
358 GTK_SYMBOLIC_COLOR_WARNINGcxx . . $ GTK_SYMBOLIC_COLOR_WARNING. < n_colors && gdk_rgba_is_opaquecxx . . $ gdk_rgba_is_opaque(c8ce5f8f5f2819b9). (&colors[GTK_SYMBOLIC_COLOR_WARNINGcxx . . $ GTK_SYMBOLIC_COLOR_WARNING.]) &&
359 GTK_SYMBOLIC_COLOR_ERRORcxx . . $ GTK_SYMBOLIC_COLOR_ERROR. < n_colors && gdk_rgba_is_opaquecxx . . $ gdk_rgba_is_opaque(c8ce5f8f5f2819b9). (&colors[GTK_SYMBOLIC_COLOR_ERRORcxx . . $ GTK_SYMBOLIC_COLOR_ERROR.]);
360
361 if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. && icon->allow_recolorcxx . . $ _GtkIconPaintable#allow_recolor. &&
362 (icon->single_pathcxx . . $ _GtkIconPaintable#single_path. || colors_opaque) &&
363 gsk_render_node_recolorcxx . . $ gsk_render_node_recolor(1df03b2d34c194bb). (node, colors, n_colors, weight, &recolored))
364 {
365 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:346:9`! ("snapshot symbolic icon as recolored node");
366
367 gtk_snapshot_append_node_scaledcxx . . $ gtk_snapshot_append_node_scaled(b7d4022d0d15b4fe). (snapshot, recolored, &icon_rect, &render_rect);
368 gsk_render_node_unrefcxx . . $ `gsk/gskrendernodeprivate.h:147:9`! (recolored);
369 }
370 else if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. && icon->only_fgcxx . . $ _GtkIconPaintable#only_fg. && icon->allow_maskcxx . . $ _GtkIconPaintable#allow_mask.)
371 {
372 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:346:9`! ("snapshot symbolic icon %s using mask",
373 gsk_render_node_get_node_typecxx . . $ `gsk/gskrendernodeprivate.h:158:9`! (node) == GSK_TEXTURE_NODE
374 ? "as texture" : "as node");
375
376 if (!icon->has_strokescxx . . $ _GtkIconPaintable#has_strokes. || !gsk_render_node_restrokecxx . . $ gsk_render_node_restroke(356200a9c7f622c9). (node, weight, &recolored))
377 recolored = gsk_render_node_refcxx . . $ `gsk/gskrendernodeprivate.h:146:9`! (node);
378
379 gtk_snapshot_push_maskcxx . . $ gtk_snapshot_push_mask(d50594115173f4c). (snapshot, GSK_MASK_MODE_ALPHAcxx . . $ GSK_MASK_MODE_ALPHA.);
380 gtk_snapshot_append_node_scaledcxx . . $ gtk_snapshot_append_node_scaled(b7d4022d0d15b4fe). (snapshot, recolored, &icon_rect, &render_rect);
381 gtk_snapshot_popcxx . . $ gtk_snapshot_pop(afbd0a0317d5665f). (snapshot);
382 gtk_snapshot_append_colorcxx . . $ gtk_snapshot_append_color(402330aed7850122). (snapshot, &colors[0], &render_rect);
383 gtk_snapshot_popcxx . . $ gtk_snapshot_pop(afbd0a0317d5665f). (snapshot);
384 gsk_render_node_unrefcxx . . $ `gsk/gskrendernodeprivate.h:147:9`! (recolored);
385 }
386 else if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic.)
387 {
388 graphene_matrix_tcxx . . $ graphene_matrix_t# matrix;
389 graphene_vec4_tcxx . . $ graphene_vec4_t# offset;
390
391 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:346:9`! ("snapshot symbolic icon %s using color-matrix",
392 gsk_render_node_get_node_typecxx . . $ `gsk/gskrendernodeprivate.h:158:9`! (node) == GSK_TEXTURE_NODE
393 ? "as texture" : "as node");
394
395 if (!icon->has_strokescxx . . $ _GtkIconPaintable#has_strokes. || !gsk_render_node_restrokecxx . . $ gsk_render_node_restroke(356200a9c7f622c9). (node, weight, &recolored))
396 recolored = gsk_render_node_refcxx . . $ `gsk/gskrendernodeprivate.h:146:9`! (node);
397
398 init_color_matrixcxx . . $ init_color_matrix(15123d820dbf1807). (&matrix, &offset,
399 &colors[GTK_SYMBOLIC_COLOR_FOREGROUNDcxx . . $ GTK_SYMBOLIC_COLOR_FOREGROUND.],
400 &colors[GTK_SYMBOLIC_COLOR_SUCCESScxx . . $ GTK_SYMBOLIC_COLOR_SUCCESS.],
401 &colors[GTK_SYMBOLIC_COLOR_WARNINGcxx . . $ GTK_SYMBOLIC_COLOR_WARNING.],
402 &colors[GTK_SYMBOLIC_COLOR_ERRORcxx . . $ GTK_SYMBOLIC_COLOR_ERROR.]);
403
404 gtk_snapshot_push_color_matrixcxx . . $ gtk_snapshot_push_color_matrix(c65a69c2fa99b957). (snapshot, &matrix, &offset);
405 gtk_snapshot_append_node_scaledcxx . . $ gtk_snapshot_append_node_scaled(b7d4022d0d15b4fe). (snapshot, recolored, &icon_rect, &render_rect);
406 gtk_snapshot_popcxx . . $ gtk_snapshot_pop(afbd0a0317d5665f). (snapshot);
407 gsk_render_node_unrefcxx . . $ `gsk/gskrendernodeprivate.h:147:9`! (recolored);
408 }
409 else
410 {
411 gtk_snapshot_append_node_scaledcxx . . $ gtk_snapshot_append_node_scaled(b7d4022d0d15b4fe). (snapshot, node, &icon_rect, &render_rect);
412 }
413
414 gsk_render_node_unrefcxx . . $ `gsk/gskrendernodeprivate.h:147:9`! (node);
415 }
416
417 static void
418 gtk_icon_paintable_snapshot_symboliccxx . . $ gtk_icon_paintable_snapshot_symbolic(854bc65bf6bf2a18). (GtkSymbolicPaintablecxx . . $ GtkSymbolicPaintable# *paintable,
419 GtkSnapshotcxx . . $ GtkSnapshot# *snapshot,
420 double width,
421 double height,
422 const GdkRGBAcxx . . $ GdkRGBA# *colors,
423 gsizecxx . . $ gsize# n_colors)
424 {
425 gtk_icon_paintable_snapshot_with_weightcxx . . $ gtk_icon_paintable_snapshot_with_weight(fabb961a56a48e14). (paintable, snapshot,
426 width, height,
427 colors, n_colors,
428 400);
429 }
430
431 static void
432 icon_symbolic_paintable_initcxx . . $ icon_symbolic_paintable_init(8bf2f2050e40793e). (GtkSymbolicPaintableInterfacecxx . . $ GtkSymbolicPaintableInterface# *iface)
433 {
434 iface->snapshot_with_weightcxx . . $ _GtkSymbolicPaintableInterface#snapshot_with_weight. = gtk_icon_paintable_snapshot_with_weightcxx . . $ gtk_icon_paintable_snapshot_with_weight(fabb961a56a48e14).;
435 iface->snapshot_symboliccxx . . $ _GtkSymbolicPaintableInterface#snapshot_symbolic. = gtk_icon_paintable_snapshot_symboliccxx . . $ gtk_icon_paintable_snapshot_symbolic(854bc65bf6bf2a18).;
436 }
437
438 /* }}} */
439 /* {{{ GdkPaintable implementation */
440
441 static void
442 icon_paintable_snapshotcxx . . $ icon_paintable_snapshot(59826c9f4416dc8a). (GdkPaintablecxx . . $ GdkPaintable# *paintable,
443 GtkSnapshotcxx . . $ GtkSnapshot# *snapshot,
444 double width,
445 double height)
446 {
447 gtk_symbolic_paintable_snapshot_symboliccxx . . $ gtk_symbolic_paintable_snapshot_symbolic(854bc65bf6bf2a18). (GTK_SYMBOLIC_PAINTABLEcxx . . $ GTK_SYMBOLIC_PAINTABLE(9ec6883cb195f655). (paintable), snapshot, width, height, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0);
448 }
449
450 static GdkPaintableFlagscxx . . $ GdkPaintableFlags#
451 icon_paintable_get_flagscxx . . $ icon_paintable_get_flags(e84cfbcbc5dd6c3c). (GdkPaintablecxx . . $ GdkPaintable# *paintable)
452 {
453 return GDK_PAINTABLE_STATIC_SIZEcxx . . $ GDK_PAINTABLE_STATIC_SIZE. | GDK_PAINTABLE_STATIC_CONTENTScxx . . $ GDK_PAINTABLE_STATIC_CONTENTS.;
454 }
455
456 static int
457 icon_paintable_get_intrinsic_widthcxx . . $ icon_paintable_get_intrinsic_width(f3fbaf4b8d531752). (GdkPaintablecxx . . $ GdkPaintable# *paintable)
458 {
459 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = GTK_ICON_PAINTABLEcxx . . $ GTK_ICON_PAINTABLE(b25946bb131e663e). (paintable);
460
461 return icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size.;
462 }
463
464 static int
465 icon_paintable_get_intrinsic_heightcxx . . $ icon_paintable_get_intrinsic_height(f3fbaf4b8d531752). (GdkPaintablecxx . . $ GdkPaintable# *paintable)
466 {
467 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = GTK_ICON_PAINTABLEcxx . . $ GTK_ICON_PAINTABLE(b25946bb131e663e). (paintable);
468
469 return icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size.;
470 }
471
472 static void
473 icon_paintable_initcxx . . $ icon_paintable_init(5a1c2be6845fa09d). (GdkPaintableInterfacecxx . . $ GdkPaintableInterface# *iface)
474 {
475 iface->snapshotcxx . . $ _GdkPaintableInterface#snapshot. = icon_paintable_snapshotcxx . . $ icon_paintable_snapshot(59826c9f4416dc8a).;
476 iface->get_flagscxx . . $ _GdkPaintableInterface#get_flags. = icon_paintable_get_flagscxx . . $ icon_paintable_get_flags(e84cfbcbc5dd6c3c).;
477 iface->get_intrinsic_widthcxx . . $ _GdkPaintableInterface#get_intrinsic_width. = icon_paintable_get_intrinsic_widthcxx . . $ icon_paintable_get_intrinsic_width(f3fbaf4b8d531752).;
478 iface->get_intrinsic_heightcxx . . $ _GdkPaintableInterface#get_intrinsic_height. = icon_paintable_get_intrinsic_heightcxx . . $ icon_paintable_get_intrinsic_height(f3fbaf4b8d531752).;
479 }
480
481 /* }}} */
482 /* {{{ GObject boilerplate */
483
484 struct _GtkIconPaintableClasscxx . . $ _GtkIconPaintableClass#
485 {
486 GObjectClasscxx . . $ GObjectClass# parent_classcxx . . $ _GtkIconPaintableClass#parent_class.;
487 };
488
489 enumcxx . . $ $anonymous_type_edb6e08541145dda_0#
490 {
491 PROP_0cxx . . $ PROP_0.,
492 PROP_FILEcxx . . $ PROP_FILE.,
493 PROP_ICON_NAMEcxx . . $ PROP_ICON_NAME.,
494 PROP_IS_SYMBOLICcxx . . $ PROP_IS_SYMBOLIC.,
495 PROP_SIZEcxx . . $ PROP_SIZE.,
496 PROP_SCALEcxx . . $ PROP_SCALE.,
497 };
498
499 G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (GtkIconPaintable, gtk_icon_paintable, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!,
500 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (GDK_TYPE_PAINTABLEcxx . . $ `gdk/gdkpaintable.h:30:9`!,
501 icon_paintable_init)
502 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (GTK_TYPE_SYMBOLIC_PAINTABLEcxx . . $ `gtk/gtksymbolicpaintable.h:30:9`!,
503 icon_symbolic_paintable_init))
504
505 static void
506 gtk_icon_paintable_initcxx . . $ gtk_icon_paintable_init(e552487ca8eeea2). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon)
507 {
508 g_mutex_initcxx . . $ g_mutex_init(d80b1953a7cb7fd1). (&icon->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
509
510 icon->allow_nodecxx . . $ _GtkIconPaintable#allow_node. = 1;
511 icon->allow_recolorcxx . . $ _GtkIconPaintable#allow_recolor. = 1;
512 icon->allow_maskcxx . . $ _GtkIconPaintable#allow_mask. = 1;
513
514 icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. = 16;
515 icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. = 1;
516 }
517
518 static void
519 gtk_icon_paintable_finalizecxx . . $ gtk_icon_paintable_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
520 {
521 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = (GtkIconPaintablecxx . . $ GtkIconPaintable# *) object;
522
523 icon_cache_removecxx . . $ icon_cache_remove(e552487ca8eeea2). (icon);
524
525 g_strfreevcxx . . $ g_strfreev(3ed91490e421178f). (icon->keycxx . . $ _GtkIconPaintable#key..icon_namescxx . . $ $anonymous_type_f1dbaab0cd7b42e5_0#icon_names.);
526
527 g_freecxx . . $ g_free(5d22bdacc48458e8). (icon->filenamecxx . . $ _GtkIconPaintable#filename.);
528 g_freecxx . . $ g_free(5d22bdacc48458e8). (icon->icon_namecxx . . $ _GtkIconPaintable#icon_name.);
529
530 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&icon->loadable);
531 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&icon->node, gsk_render_node_unref);
532
533 g_mutex_clearcxx . . $ g_mutex_clear(d80b1953a7cb7fd1). (&icon->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
534
535 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_icon_paintable_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
536 }
537
538 static void
539 gtk_icon_paintable_get_propertycxx . . $ gtk_icon_paintable_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object,
540 guintcxx . . $ guint# prop_id,
541 GValuecxx . . $ GValue# *value,
542 GParamSpeccxx . . $ GParamSpec# *pspec)
543 {
544 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = GTK_ICON_PAINTABLEcxx . . $ GTK_ICON_PAINTABLE(b25946bb131e663e). (object);
545
546 switch (prop_id)
547 {
548 case PROP_FILEcxx . . $ PROP_FILE.:
549 g_value_take_objectcxx . . $ g_value_take_object(e945b84c1e9702f). (value, gtk_icon_paintable_get_filecxx . . $ gtk_icon_paintable_get_file(7dcb2034ae890c40). (icon));
550 break;
551
552 case PROP_ICON_NAMEcxx . . $ PROP_ICON_NAME.:
553 g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (value, icon->icon_namecxx . . $ _GtkIconPaintable#icon_name.);
554 break;
555
556 case PROP_IS_SYMBOLICcxx . . $ PROP_IS_SYMBOLIC.:
557 g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic.);
558 break;
559
560 case PROP_SIZEcxx . . $ PROP_SIZE.:
561 g_value_set_intcxx . . $ g_value_set_int(b698c61e8e30c4ea). (value, icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size.);
562 break;
563
564 case PROP_SCALEcxx . . $ PROP_SCALE.:
565 g_value_set_intcxx . . $ g_value_set_int(b698c61e8e30c4ea). (value, icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale.);
566 break;
567
568 default:
569 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
570 }
571 }
572
573 static void
574 gtk_icon_paintable_set_propertycxx . . $ gtk_icon_paintable_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object,
575 guintcxx . . $ guint# prop_id,
576 const GValuecxx . . $ GValue# *value,
577 GParamSpeccxx . . $ GParamSpec# *pspec)
578 {
579 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon = GTK_ICON_PAINTABLEcxx . . $ GTK_ICON_PAINTABLE(b25946bb131e663e). (object);
580
581 switch (prop_id)
582 {
583 case PROP_FILEcxx . . $ PROP_FILE.:
584 gtk_icon_paintable_set_filecxx . . $ gtk_icon_paintable_set_file(aba4ef0f9dc48b7). (icon, g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value));
585 break;
586
587 case PROP_ICON_NAMEcxx . . $ PROP_ICON_NAME.:
588 icon->icon_namecxx . . $ _GtkIconPaintable#icon_name. = g_value_dup_stringcxx . . $ g_value_dup_string(602930317b8318e8). (value);
589 break;
590
591 case PROP_IS_SYMBOLICcxx . . $ PROP_IS_SYMBOLIC.:
592 if (icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. != g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value))
593 {
594 icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. = g_value_get_booleancxx . . $ g_value_get_boolean(f890c5c75ead5b21). (value);
595 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (object, pspec);
596 }
597 break;
598
599 case PROP_SIZEcxx . . $ PROP_SIZE.:
600 if (icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. != g_value_get_intcxx . . $ g_value_get_int(f890c5c75ead5b21). (value))
601 {
602 icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. = g_value_get_intcxx . . $ g_value_get_int(f890c5c75ead5b21). (value);
603 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (object, pspec);
604 }
605 break;
606
607 case PROP_SCALEcxx . . $ PROP_SCALE.:
608 if (icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. != g_value_get_intcxx . . $ g_value_get_int(f890c5c75ead5b21). (value))
609 {
610 icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. = g_value_get_intcxx . . $ g_value_get_int(f890c5c75ead5b21). (value);
611 g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (object, pspec);
612 }
613 break;
614
615 default:
616 G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec);
617 }
618 }
619
620
621 static void
622 gtk_icon_paintable_class_initcxx . . $ gtk_icon_paintable_class_init(498cd2dc12536bdc). (GtkIconPaintableClasscxx . . $ GtkIconPaintableClass# *klass)
623 {
624 GObjectClasscxx . . $ GObjectClass# *gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
625
626 gobject_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_icon_paintable_get_propertycxx . . $ gtk_icon_paintable_get_property(cee2c52f22407c66).;
627 gobject_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_icon_paintable_set_propertycxx . . $ gtk_icon_paintable_set_property(d7c4bb29f36c0dc4).;
628 gobject_class->finalizecxx . . $ _GObjectClass#finalize. = gtk_icon_paintable_finalizecxx . . $ gtk_icon_paintable_finalize(6087475fa43034d3).;
629
630 /**
631 * GtkIconPaintable:file:
632 *
633 * The file representing the icon, if any.
634 */
635 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class, PROP_FILEcxx . . $ PROP_FILE.,
636 g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("file", 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`!,
637 G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!,
638 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_STATIC_BLURBcxx . . $ G_PARAM_STATIC_BLURB. | G_PARAM_STATIC_NICKcxx . . $ G_PARAM_STATIC_NICK.));
639
640 /**
641 * GtkIconPaintable:icon-name:
642 *
643 * The icon name that was chosen during lookup.
644 *
645 * Deprecated: 4.20
646 */
647 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class, PROP_ICON_NAMEcxx . . $ PROP_ICON_NAME.,
648 g_param_spec_stringcxx . . $ g_param_spec_string(378e8746be5cd899). ("icon-name", 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`!,
649 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
650 G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_DEPRECATEDcxx . . $ G_PARAM_DEPRECATED.));
651
652 /**
653 * GtkIconPaintable:is-symbolic: (getter is_symbolic)
654 *
655 * Whether the icon is symbolic or not.
656 *
657 * Deprecated: 4.20
658 */
659 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class, PROP_IS_SYMBOLICcxx . . $ PROP_IS_SYMBOLIC.,
660 g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("is-symbolic", 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`!,
661 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
662 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY. | G_PARAM_DEPRECATEDcxx . . $ G_PARAM_DEPRECATED.));
663
664 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class, PROP_SIZEcxx . . $ PROP_SIZE.,
665 g_param_spec_intcxx . . $ g_param_spec_int(eedf0a930522f60e). ("size", 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`!,
666 0, G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!, 16,
667 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
668
669 g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (gobject_class, PROP_SCALEcxx . . $ PROP_SCALE.,
670 g_param_spec_intcxx . . $ g_param_spec_int(eedf0a930522f60e). ("scale", 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`!,
671 0, G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!, 1,
672 G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.));
673 }
674
675 /* }}} */
676 /* {{{ Private API */
677
678 void
679 gtk_icon_paintable_load_in_threadcxx . . $ gtk_icon_paintable_load_in_thread(e552487ca8eeea2). (GtkIconPaintablecxx . . $ GtkIconPaintable# *self)
680 {
681 g_mutex_lockcxx . . $ g_mutex_lock(d80b1953a7cb7fd1). (&self->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
682 icon_ensure_node__lockedcxx . . $ icon_ensure_node__locked(3cf104c42617365f). (self, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!);
683 g_mutex_unlockcxx . . $ g_mutex_unlock(d80b1953a7cb7fd1). (&self->texture_lockcxx . . $ _GtkIconPaintable#texture_lock.);
684 }
685
686 void
687 gtk_icon_paintable_set_debugcxx . . $ gtk_icon_paintable_set_debug(cc26b76dea6654bb). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon,
688 gbooleancxx . . $ gboolean# allow_node,
689 gbooleancxx . . $ gboolean# allow_recolor,
690 gbooleancxx . . $ gboolean# allow_mask)
691 {
692 icon->allow_nodecxx . . $ _GtkIconPaintable#allow_node. = allow_node;
693 icon->allow_recolorcxx . . $ _GtkIconPaintable#allow_recolor. = allow_recolor;
694 icon->allow_maskcxx . . $ _GtkIconPaintable#allow_mask. = allow_mask;
695 }
696
697 void
698 gtk_icon_paintable_set_icon_namecxx . . $ gtk_icon_paintable_set_icon_name(966d4e7f3a744287). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon,
699 const char *name)
700 {
701 g_set_strcxx . . $ g_set_str(cc1a8f44225c7fe0). (&icon->icon_namecxx . . $ _GtkIconPaintable#icon_name., name);
702 }
703
704 GtkIconPaintablecxx . . $ GtkIconPaintable# *
705 gtk_icon_paintable_new_for_texturecxx . . $ gtk_icon_paintable_new_for_texture(15de9fe75737c7d3). (GdkTexturecxx . . $ GdkTexture# *texture,
706 int desired_size,
707 int desired_scale)
708 {
709 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon;
710
711 icon = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_ICON_PAINTABLEcxx . . $ `gtk/gtkiconpaintable.h:29:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
712 icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. = desired_size;
713 icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. = desired_scale;
714 icon->widthcxx . . $ _GtkIconPaintable#width. = gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (texture);
715 icon->heightcxx . . $ _GtkIconPaintable#height. = gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (texture);
716 icon->nodecxx . . $ _GtkIconPaintable#node. = gsk_texture_node_newcxx . . $ gsk_texture_node_new(29a2c4e499c887af). (texture,
717 &GRAPHENE_RECT_INITcxx . . $ `<external>/7539008420172022992/graphene-rect.h:50:9`! (0, 0,
718 icon->width,
719 icon->height));
720
721 return icon;
722 }
723
724 GtkIconPaintablecxx . . $ GtkIconPaintable# *
725 gtk_icon_paintable_new_for_pathcxx . . $ gtk_icon_paintable_new_for_path(669eee8073ba1ceb). (const char *path,
726 gbooleancxx . . $ gboolean# is_resource,
727 int desired_size,
728 int desired_scale)
729 {
730 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon;
731
732 icon = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_ICON_PAINTABLEcxx . . $ `gtk/gtkiconpaintable.h:29:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
733 icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. = desired_size;
734 icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. = desired_scale;
735 icon->filenamecxx . . $ _GtkIconPaintable#filename. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (path);
736 icon->is_resourcecxx . . $ _GtkIconPaintable#is_resource. = is_resource;
737 icon->is_svgcxx . . $ _GtkIconPaintable#is_svg. = g_str_has_suffixcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:183:9`! (icon->filename, ".svg");
738 icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic. = icon_uri_is_symboliccxx . . $ icon_uri_is_symbolic(cb7559238bb26814). (icon->filenamecxx . . $ _GtkIconPaintable#filename., -1);
739
740 return icon;
741 }
742
743 GtkIconPaintablecxx . . $ GtkIconPaintable# *
744 gtk_icon_paintable_new_for_loadablecxx . . $ gtk_icon_paintable_new_for_loadable(98e81a26b3f0316d). (GLoadableIconcxx . . $ GLoadableIcon# *loadable,
745 int desired_size,
746 int desired_scale)
747 {
748 GtkIconPaintablecxx . . $ GtkIconPaintable# *icon;
749
750 icon = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_ICON_PAINTABLEcxx . . $ `gtk/gtkiconpaintable.h:29:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
751 icon->desired_sizecxx . . $ _GtkIconPaintable#desired_size. = desired_size;
752 icon->desired_scalecxx . . $ _GtkIconPaintable#desired_scale. = desired_scale;
753 icon->loadablecxx . . $ _GtkIconPaintable#loadable. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (loadable);
754
755 return icon;
756 }
757
758 /* }}} */
759 /* {{{ Public API */
760
761 /**
762 * gtk_icon_paintable_new_for_file:
763 * @file: a `GFile`
764 * @size: desired icon size, in application pixels
765 * @scale: the desired scale
766 *
767 * Creates a `GtkIconPaintable` for a file with a given size and scale.
768 *
769 * The icon can then be rendered by using it as a `GdkPaintable`.
770 *
771 * Returns: (transfer full): a `GtkIconPaintable` containing
772 * for the icon. Unref with g_object_unref()
773 */
774 GtkIconPaintablecxx . . $ GtkIconPaintable# *
775 gtk_icon_paintable_new_for_filecxx . . $ gtk_icon_paintable_new_for_file(fda37d9b333e60fe). (GFilecxx . . $ GFile# *file,
776 int size,
777 int scale)
778 {
779 return g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_ICON_PAINTABLEcxx . . $ `gtk/gtkiconpaintable.h:29:9`!,
780 "file", file,
781 "size", size,
782 "scale", scale,
783 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
784 }
785
786 /**
787 * gtk_icon_paintable_is_symbolic: (get-property is-symbolic)
788 * @self: an icon paintable
789 *
790 * Checks if the icon is symbolic or not.
791 *
792 * This currently uses only the file name and not the file contents
793 * for determining this. This behaviour may change in the future.
794 *
795 * Returns: true if the icon is symbolic, false otherwise
796 *
797 * Deprecated: 4.20
798 */
799 gbooleancxx . . $ gboolean#
800 gtk_icon_paintable_is_symboliccxx . . $ gtk_icon_paintable_is_symbolic(d9197ce3f4a98724). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon)
801 {
802 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_ICON_PAINTABLE (icon), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
803
804 return icon->is_symboliccxx . . $ _GtkIconPaintable#is_symbolic.;
805 }
806
807 /**
808 * gtk_icon_paintable_get_icon_name:
809 * @self: a `GtkIconPaintable`
810 *
811 * Get the icon name being used for this icon.
812 *
813 * When an icon looked up in the icon theme was not available, the
814 * icon theme may use fallback icons - either those specified to
815 * gtk_icon_theme_lookup_icon() or the always-available
816 * "image-missing". The icon chosen is returned by this function.
817 *
818 * If the icon was created without an icon theme, this function
819 * returns %NULL.
820 *
821 * Returns: (nullable) (type filename): the themed icon-name for the
822 * icon, or %NULL if its not a themed icon.
823 *
824 * Deprecated: 4.20
825 */
826 const char *
827 gtk_icon_paintable_get_icon_namecxx . . $ gtk_icon_paintable_get_icon_name(1231b0930450d813). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon)
828 {
829 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (icon != 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`!);
830
831 return icon->icon_namecxx . . $ _GtkIconPaintable#icon_name.;
832 }
833
834 /**
835 * gtk_icon_paintable_get_file:
836 * @self: a `GtkIconPaintable`
837 *
838 * Gets the `GFile` that was used to load the icon.
839 *
840 * Returns %NULL if the icon was not loaded from a file.
841 *
842 * Returns: (nullable) (transfer full): the `GFile` for the icon
843 */
844 GFilecxx . . $ GFile# *
845 gtk_icon_paintable_get_filecxx . . $ gtk_icon_paintable_get_file(7dcb2034ae890c40). (GtkIconPaintablecxx . . $ GtkIconPaintable# *icon)
846 {
847 if (G_IS_FILE_ICONcxx . . $ `<external>/10411090569537878496/gfileicon.h:37:9`! (icon->loadable))
848 {
849 return g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (g_file_icon_get_file (G_FILE_ICONcxx . . $ `<external>/10411090569537878496/gfileicon.h:35:9`! (icon->loadable)));
850 }
851 else if (icon->filenamecxx . . $ _GtkIconPaintable#filename.)
852 {
853 if (icon->is_resourcecxx . . $ _GtkIconPaintable#is_resource.)
854 return new_resource_filecxx . . $ new_resource_file(ba1fd5950b7d7bd5). (icon->filenamecxx . . $ _GtkIconPaintable#filename.);
855 else
856 return g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). (icon->filenamecxx . . $ _GtkIconPaintable#filename.);
857 }
858
859 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
860 }
861
862 /* }}} */
863
864 /* vim:set foldmethod=marker: */
865