Debian Codegraph @

src/wallpaper.c

raw symbols SCIP
1 /*
2 * Copyright © 2019 Red Hat, Inc
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authors:
20 * Felipe Borges <[email protected]>
21 */
22
23 #include "config.h"cxx . . $ `<file>/build/config.h`/
24
25 #include "wallpaper.h"cxx . . $ `<file>/src/wallpaper.h`/
26
27 #include <string.h>
28
29 #include <gio/gdesktopappinfo.h>
30 #include <gio/gio.h>
31 #include <gio/gunixfdlist.h>
32 #include <glib/gi18n.h>
33
34 #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/
35 #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/
36 #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/
37 #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/
38 #include "xdp-portal-config.h"cxx . . $ `<file>/src/xdp-portal-config.h`/
39 #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/
40 #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/
41
42 typedef struct _Wallpapercxx . . $ _Wallpaper# Wallpapercxx . . $ Wallpaper#;
43 typedef struct _WallpaperClasscxx . . $ _WallpaperClass# WallpaperClasscxx . . $ WallpaperClass#;
44
45 struct _Wallpapercxx . . $ _Wallpaper#
46 {
47 XdpDbusWallpaperSkeletoncxx . . $ XdpDbusWallpaperSkeleton# parent_instancecxx . . $ _Wallpaper#parent_instance.;
48
49 XdpDbusImplWallpapercxx . . $ XdpDbusImplWallpaper# *implcxx . . $ _Wallpaper#impl.;
50 XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_implcxx . . $ _Wallpaper#access_impl.;
51 };
52
53 struct _WallpaperClasscxx . . $ _WallpaperClass#
54 {
55 XdpDbusWallpaperSkeletonClasscxx . . $ XdpDbusWallpaperSkeletonClass# parent_classcxx . . $ _WallpaperClass#parent_class.;
56 };
57
58 GTypecxx . . $ GType# wallpaper_get_typecxx . . $ wallpaper_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!;
59 static void wallpaper_iface_initcxx . . $ wallpaper_iface_init(3888ed91b3d25922). (XdpDbusWallpaperIfacecxx . . $ XdpDbusWallpaperIface# *iface);
60
61 G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (Wallpaper, wallpaper, XDP_DBUS_TYPE_WALLPAPER_SKELETONcxx . . $ `build/src/xdp-dbus.h:8835:9`!,
62 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_WALLPAPERcxx . . $ `build/src/xdp-dbus.h:8646:9`!,
63 wallpaper_iface_init));
64
65 G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (Wallpaper, g_object_unref)
66
67 static void
68 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (XdpRequestcxx . . $ XdpRequest# *request,
69 guintcxx . . $ guint# response)
70 {
71 if (request->exportedcxx . . $ _XdpRequest#exported.)
72 {
73 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder =
74 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
75
76 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("sending response: %d", response);
77 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request),
78 response,
79 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
80 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
81 }
82 }
83
84 static void
85 handle_set_wallpaper_uri_donecxx . . $ handle_set_wallpaper_uri_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source,
86 GAsyncResultcxx . . $ GAsyncResult# *result,
87 gpointercxx . . $ gpointer# data)
88 {
89 guintcxx . . $ guint# response = 2;
90 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
91 XdpRequestcxx . . $ XdpRequest# *request = data;
92
93 if (!xdp_dbus_impl_wallpaper_call_set_wallpaper_uri_finishcxx . . $ xdp_dbus_impl_wallpaper_call_set_wallpaper_uri_finish(798bc4e1371a348). (XDP_DBUS_IMPL_WALLPAPERcxx . . $ `build/src/xdp-impl-dbus.h:6317:9`! (source),
94 &response,
95 result,
96 &error))
97 {
98 g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error);
99 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message);
100 }
101
102 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, response);
103 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (request);
104 }
105
106 static gbooleancxx . . $ gboolean#
107 validate_set_oncxx . . $ validate_set_on(c4684b9d3da33c87). (const char *key,
108 GVariantcxx . . $ GVariant# *value,
109 GVariantcxx . . $ GVariant# *options,
110 gpointercxx . . $ gpointer# user_data,
111 GErrorcxx . . $ GError# **error)
112 {
113 const char *string = g_variant_get_stringcxx . . $ g_variant_get_string(5d5cac9792ea78b8). (value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
114
115 return ((g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "both") == 0) ||
116 (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "background") == 0) ||
117 (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "lockscreen") == 0));
118 }
119
120 static XdpOptionKeycxx . . $ XdpOptionKey# wallpaper_optionscxx . . $ wallpaper_options.[] = {
121 { "show-preview", G_VARIANT_TYPE_BOOLEANcxx . . $ `<external>/14064154155447831270/gvarianttype.h:41:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! },
122 { "set-on", G_VARIANT_TYPE_STRINGcxx . . $ `<external>/14064154155447831270/gvarianttype.h:122:9`!, validate_set_oncxx . . $ validate_set_on(c4684b9d3da33c87). }
123 };
124
125 static void
126 handle_set_wallpaper_in_thread_funccxx . . $ handle_set_wallpaper_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task,
127 gpointercxx . . $ gpointer# source_object,
128 gpointercxx . . $ gpointer# task_data,
129 GCancellablecxx . . $ GCancellable# *cancellable)
130 {
131 Wallpapercxx . . $ Wallpaper# *wallpaper = (Wallpapercxx . . $ Wallpaper# *) source_object;
132 XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data);
133 const char *parent_window;
134 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
135 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *uri = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
136 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder =
137 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
138 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplRequest) impl_request = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
139 GVariantcxx . . $ GVariant# *options;
140 gbooleancxx . . $ gboolean# show_preview = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
141 g_autofdcxx . . $ `<external>/6704587548159124736/gstdio.h:291:9`! int fd = -1;
142 XdpPermissioncxx . . $ XdpPermission# permission;
143
144 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request);
145
146 parent_window = ((const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window"));
147 uri = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! ((const char *)g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri"));
148 fd = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd"));
149 options = ((GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options"));
150
151 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (-1));
152
153 if (uri != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && fd != -1)
154 {
155 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Rejecting invalid set-wallpaper request (both URI and fd are set)");
156 if (request->exportedcxx . . $ _XdpRequest#exported.)
157 {
158 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request),
159 XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER.,
160 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
161 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
162 }
163 return;
164 }
165
166 permission = xdp_get_permission_synccxx . . $ xdp_get_permission_sync(178fd6ce07e9d2e2). (request->app_infocxx . . $ _XdpRequest#app_info.,
167 WALLPAPER_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:147:9`!,
168 WALLPAPER_PERMISSION_IDcxx . . $ `src/xdp-types.h:148:9`!);
169
170 if (permission == XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.)
171 {
172 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
173 return;
174 }
175
176 g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "show-preview", "b", &show_preview);
177 if (!show_preview && permission != XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES.)
178 {
179 const char *app_id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.);
180 const char *app_name = xdp_app_info_get_app_display_namecxx . . $ xdp_app_info_get_app_display_name(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.);
181 guintcxx . . $ guint# access_response = 2;
182 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) access_results = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
183 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) access_opt_builder =
184 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
185 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! gcharcxx . . $ gchar# *title = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
186 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! gcharcxx . . $ gchar# *subtitle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
187 const gcharcxx . . $ gchar# *body;
188
189 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
190 "deny_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Deny")));
191 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
192 "grant_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow")));
193 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
194 "icon", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). ("preferences-desktop-wallpaper-symbolic"));
195
196 if (app_name)
197 {
198 title = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow %s to Set Backgrounds?"), app_name);
199 subtitle = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("%s wants to change the background image"),
200 app_name);
201 }
202 else
203 {
204 title = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow Apps to Set Backgrounds?"));
205 subtitle = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("An app wants to change the background image"));
206 }
207
208 body = _cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("This permission can be changed at any time from the privacy settings");
209
210 if (!xdp_dbus_impl_access_call_access_dialog_synccxx . . $ xdp_dbus_impl_access_call_access_dialog_sync(434f1c6fac184201). (wallpaper->access_implcxx . . $ _Wallpaper#access_impl.,
211 request->idcxx . . $ _XdpRequest#id.,
212 app_id,
213 parent_window,
214 title,
215 subtitle,
216 body,
217 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&access_opt_builder),
218 &access_response,
219 &access_results,
220 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
221 &error))
222 {
223 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to show access dialog: %s", error->message);
224 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
225 return;
226 }
227
228 if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.)
229 xdp_set_permission_synccxx . . $ xdp_set_permission_sync(cba2464d6dcfb7ce). (request->app_infocxx . . $ _XdpRequest#app_info.,
230 WALLPAPER_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:147:9`!,
231 WALLPAPER_PERMISSION_IDcxx . . $ `src/xdp-types.h:148:9`!,
232 access_response == 0 ?
233 XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES. : XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.);
234
235 if (access_response != 0)
236 {
237 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
238 return;
239 }
240 }
241
242 if (!uri)
243 {
244 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
245
246 path = xdp_app_info_get_path_for_fdcxx . . $ xdp_app_info_get_path_for_fd(2620023ef1f997b4). (request->app_infocxx . . $ _XdpRequest#app_info., fd, 0, 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`!, &error);
247 if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
248 {
249 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Cannot get path for fd: %s", error->message);
250
251 /* Reject the request */
252 if (request->exportedcxx . . $ _XdpRequest#exported.)
253 {
254 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request),
255 XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER.,
256 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
257 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
258 }
259 return;
260 }
261
262 uri = g_filename_to_uricxx . . $ g_filename_to_uri(aa426d2e062653f5). (path, 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`!);
263 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri), g_freecxx . . $ g_free(5d22bdacc48458e8).);
264 }
265
266 impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). (
267 g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (wallpaper->impl)),
268 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES.,
269 g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (wallpaper->impl)),
270 request->idcxx . . $ _XdpRequest#id.,
271 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error);
272
273 if (!impl_request)
274 {
275 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to to create wallpaper implementation proxy: %s", error->message);
276 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
277 return;
278 }
279
280 xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request);
281
282 xdp_filter_optionscxx . . $ xdp_filter_options(e9350dfce557ba5e). (options, &opt_builder,
283 wallpaper_optionscxx . . $ wallpaper_options., G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (wallpaper_options),
284 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`!);
285
286 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Calling SetWallpaperURI with %s", uri);
287 xdp_dbus_impl_wallpaper_call_set_wallpaper_uricxx . . $ xdp_dbus_impl_wallpaper_call_set_wallpaper_uri(11f7cf373eac9deb). (wallpaper->implcxx . . $ _Wallpaper#impl.,
288 request->idcxx . . $ _XdpRequest#id.,
289 xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.),
290 parent_window,
291 uri,
292 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder),
293 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
294 handle_set_wallpaper_uri_donecxx . . $ handle_set_wallpaper_uri_done(aa1d200d824d915d).,
295 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request));
296 }
297
298 static gbooleancxx . . $ gboolean#
299 handle_set_wallpaper_uricxx . . $ handle_set_wallpaper_uri(5869461c09cd2b77). (XdpDbusWallpapercxx . . $ XdpDbusWallpaper# *object,
300 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
301 const char *arg_parent_window,
302 const char *arg_uri,
303 GVariantcxx . . $ GVariant# *arg_options)
304 {
305 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
306 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
307
308 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handle SetWallpaperURI");
309
310 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "uri", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_uri), g_freecxx . . $ g_free(5d22bdacc48458e8).);
311 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).);
312 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request),
313 "options",
314 g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (arg_options),
315 (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).);
316
317 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
318 xdp_dbus_wallpaper_complete_set_wallpaper_uricxx . . $ xdp_dbus_wallpaper_complete_set_wallpaper_uri(73907c2c7303f941). (object, invocation, request->idcxx . . $ _XdpRequest#id.);
319
320 task = g_task_newcxx . . $ g_task_new(292d224db8478659). (object, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
321 g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, handle_set_wallpaper_uricxx . . $ handle_set_wallpaper_uri(5869461c09cd2b77).);
322 g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).);
323 g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_set_wallpaper_in_thread_funccxx . . $ handle_set_wallpaper_in_thread_func(4704ff26353eb8ae).);
324
325 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
326 }
327
328 static gbooleancxx . . $ gboolean#
329 handle_set_wallpaper_filecxx . . $ handle_set_wallpaper_file(51872eeaeba6475e). (XdpDbusWallpapercxx . . $ XdpDbusWallpaper# *object,
330 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
331 GUnixFDListcxx . . $ GUnixFDList# *fd_list,
332 const char *arg_parent_window,
333 GVariantcxx . . $ GVariant# *arg_fd,
334 GVariantcxx . . $ GVariant# *arg_options)
335 {
336 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
337 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
338 g_autofdcxx . . $ `<external>/6704587548159124736/gstdio.h:291:9`! int fd = -1;
339 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
340
341 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handle SetWallpaperFile");
342
343 fd = xdp_get_portal_call_fdcxx . . $ xdp_get_portal_call_fd(57b895fb290201ec). (fd_list, g_variant_get_handlecxx . . $ g_variant_get_handle(defe45d02e0cfb24). (arg_fd), &error);
344 if (fd < 0)
345 {
346 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error);
347 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
348 }
349
350 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (g_steal_fd (&fd)));
351 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).);
352 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request),
353 "options",
354 g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (arg_options),
355 (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).);
356
357 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
358 xdp_dbus_wallpaper_complete_set_wallpaper_filecxx . . $ xdp_dbus_wallpaper_complete_set_wallpaper_file(936c0cf3136ed5d6). (object, invocation, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, request->idcxx . . $ _XdpRequest#id.);
359
360 task = g_task_newcxx . . $ g_task_new(292d224db8478659). (object, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
361 g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, handle_set_wallpaper_filecxx . . $ handle_set_wallpaper_file(51872eeaeba6475e).);
362 g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).);
363 g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_set_wallpaper_in_thread_funccxx . . $ handle_set_wallpaper_in_thread_func(4704ff26353eb8ae).);
364
365 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
366 }
367 static void
368 wallpaper_iface_initcxx . . $ wallpaper_iface_init(3888ed91b3d25922). (XdpDbusWallpaperIfacecxx . . $ XdpDbusWallpaperIface# *iface)
369 {
370 iface->handle_set_wallpaper_uricxx . . $ _XdpDbusWallpaperIface#handle_set_wallpaper_uri. = handle_set_wallpaper_uricxx . . $ handle_set_wallpaper_uri(5869461c09cd2b77).;
371 iface->handle_set_wallpaper_filecxx . . $ _XdpDbusWallpaperIface#handle_set_wallpaper_file. = handle_set_wallpaper_filecxx . . $ handle_set_wallpaper_file(51872eeaeba6475e).;
372 }
373
374 static void
375 wallpaper_disposecxx . . $ wallpaper_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
376 {
377 Wallpapercxx . . $ Wallpaper# *wallpaper = (Wallpapercxx . . $ Wallpaper# *) object;
378
379 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&wallpaper->impl);
380 g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&wallpaper->access_impl);
381
382 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (wallpaper_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
383 }
384
385 static void
386 wallpaper_initcxx . . $ wallpaper_init(cf1f890f01b4c363). (Wallpapercxx . . $ Wallpaper# *wallpaper)
387 {
388 }
389
390 static void
391 wallpaper_class_initcxx . . $ wallpaper_class_init(3c325f9c6e642143). (WallpaperClasscxx . . $ WallpaperClass# *klass)
392 {
393 GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
394
395 object_class->disposecxx . . $ _GObjectClass#dispose. = wallpaper_disposecxx . . $ wallpaper_dispose(6087475fa43034d3).;
396 }
397
398 static Wallpapercxx . . $ Wallpaper# *
399 wallpaper_newcxx . . $ wallpaper_new(ae4239e6958c8379). (XdpDbusImplWallpapercxx . . $ XdpDbusImplWallpaper# *impl,
400 XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_impl)
401 {
402 Wallpapercxx . . $ Wallpaper# *wallpaper;
403
404 wallpaper = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (wallpaper_get_typecxx . . $ wallpaper_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
405 wallpaper->implcxx . . $ _Wallpaper#impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (impl);
406 wallpaper->access_implcxx . . $ _Wallpaper#access_impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (access_impl);
407
408 g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (wallpaper->impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!);
409
410 xdp_dbus_wallpaper_set_versioncxx . . $ xdp_dbus_wallpaper_set_version(d11dd44a4d5fc54f). (XDP_DBUS_WALLPAPERcxx . . $ `build/src/xdp-dbus.h:8647:9`! (wallpaper), 1);
411
412 return wallpaper;
413 }
414
415 void
416 init_wallpapercxx . . $ init_wallpaper(7d190a42f72e5c4f). (XdpContextcxx . . $ XdpContext# *context)
417 {
418 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(Wallpaper) wallpaper = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
419 GDBusConnectioncxx . . $ GDBusConnection# *connection = xdp_context_get_connectioncxx . . $ xdp_context_get_connection(a09559f10e8590c5). (context);
420 XdpPortalConfigcxx . . $ XdpPortalConfig# *config = xdp_context_get_configcxx . . $ xdp_context_get_config(3deea62d2e42aa7). (context);
421 XdpImplConfigcxx . . $ XdpImplConfig# *impl_config;
422 XdpDbusImplWallpapercxx . . $ XdpDbusImplWallpaper# *impl;
423 XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_impl;
424 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) version = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
425 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
426
427 impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (config, WALLPAPER_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:146:9`!);
428 if (impl_config == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
429 return;
430
431 access_impl = xdp_context_get_access_implcxx . . $ xdp_context_get_access_impl(c8ed220d2ee32a9b). (context);
432 if (access_impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
433 {
434 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("The wallpaper portal requires an access impl");
435 return;
436 }
437
438 impl = xdp_dbus_impl_wallpaper_proxy_new_synccxx . . $ xdp_dbus_impl_wallpaper_proxy_new_sync(f617f0dea6409d4a). (connection,
439 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
440 impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name.,
441 DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!,
442 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
443 &error);
444 if (impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
445 {
446 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create wallpaper proxy: %s", error->message);
447 return;
448 }
449
450 wallpaper = wallpaper_newcxx . . $ wallpaper_new(ae4239e6958c8379). (impl, access_impl);
451
452 xdp_context_take_and_export_portalcxx . . $ xdp_context_take_and_export_portal(54303e2939dd494f). (context,
453 G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&wallpaper)),
454 XDP_CONTEXT_EXPORT_FLAGS_NONEcxx . . $ XDP_CONTEXT_EXPORT_FLAGS_NONE.);
455 }