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 <string.h>
26 #include <glib/gi18n.h>
27 #include <gio/gio.h>
28 #include <gio/gdesktopappinfo.h>
29 #include <gio/gunixfdlist.h>
30
31 #include "wallpaper.h"cxx . . $ `<file>/src/wallpaper.h`/
32 #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/
33 #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/
34 #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/
35 #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/
36 #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/
37
38 #define PERMISSION_TABLEcxx . . $ `src/wallpaper.c:38:9`! "wallpaper"
39 #define PERMISSION_IDcxx . . $ `src/wallpaper.c:39:9`! "wallpaper"
40
41 typedef struct _Wallpapercxx . . $ _Wallpaper# Wallpapercxx . . $ Wallpaper#;
42 typedef struct _WallpaperClasscxx . . $ _WallpaperClass# WallpaperClasscxx . . $ WallpaperClass#;
43
44 struct _Wallpapercxx . . $ _Wallpaper#
45 {
46 XdpDbusWallpaperSkeletoncxx . . $ XdpDbusWallpaperSkeleton# parent_instancecxx . . $ _Wallpaper#parent_instance.;
47 };
48
49 struct _WallpaperClasscxx . . $ _WallpaperClass#
50 {
51 XdpDbusWallpaperSkeletonClasscxx . . $ XdpDbusWallpaperSkeletonClass# parent_classcxx . . $ _WallpaperClass#parent_class.;
52 };
53
54 static XdpDbusImplWallpapercxx . . $ XdpDbusImplWallpaper# *implcxx . . $ impl.;
55 static XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_implcxx . . $ access_impl.;
56 static Wallpapercxx . . $ Wallpaper# *wallpapercxx . . $ wallpaper.;
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:8731:9`!,
62 G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_WALLPAPERcxx . . $ `build/src/xdp-dbus.h:8542:9`!,
63 wallpaper_iface_init));
64
65 static void
66 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (XdpRequestcxx . . $ XdpRequest# *request,
67 guintcxx . . $ guint# response)
68 {
69 if (request->exportedcxx . . $ _XdpRequest#exported.)
70 {
71 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder =
72 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
73
74 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("sending response: %d", response);
75 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request),
76 response,
77 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
78 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
79 }
80 }
81
82 static void
83 handle_set_wallpaper_uri_donecxx . . $ handle_set_wallpaper_uri_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source,
84 GAsyncResultcxx . . $ GAsyncResult# *result,
85 gpointercxx . . $ gpointer# data)
86 {
87 guintcxx . . $ guint# response = 2;
88 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
89 XdpRequestcxx . . $ XdpRequest# *request = data;
90
91 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:6198:9`! (source),
92 &response,
93 result,
94 &error))
95 {
96 g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error);
97 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message);
98 }
99
100 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, response);
101 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (request);
102 }
103
104 static gbooleancxx . . $ gboolean#
105 validate_set_oncxx . . $ validate_set_on(a4f81f97d7ea3409). (const char *key,
106 GVariantcxx . . $ GVariant# *value,
107 GVariantcxx . . $ GVariant# *options,
108 GErrorcxx . . $ GError# **error)
109 {
110 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`!);
111
112 return ((g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "both") == 0) ||
113 (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "background") == 0) ||
114 (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (string, "lockscreen") == 0));
115 }
116
117 static XdpOptionKeycxx . . $ XdpOptionKey# wallpaper_optionscxx . . $ wallpaper_options.[] = {
118 { "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`! },
119 { "set-on", G_VARIANT_TYPE_STRINGcxx . . $ `<external>/14064154155447831270/gvarianttype.h:122:9`!, validate_set_oncxx . . $ validate_set_on(a4f81f97d7ea3409). }
120 };
121
122 static void
123 handle_set_wallpaper_in_thread_funccxx . . $ handle_set_wallpaper_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task,
124 gpointercxx . . $ gpointer# source_object,
125 gpointercxx . . $ gpointer# task_data,
126 GCancellablecxx . . $ GCancellable# *cancellable)
127 {
128 XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data);
129 const char *parent_window;
130 const char *id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.);
131 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
132 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *uri = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
133 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder =
134 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
135 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`!;
136 GVariantcxx . . $ GVariant# *options;
137 gbooleancxx . . $ gboolean# show_preview = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
138 g_autofdcxx . . $ `<external>/6704587548159124736/gstdio.h:291:9`! int fd = -1;
139 XdpPermissioncxx . . $ XdpPermission# permission;
140
141 REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:103:9`! (request);
142
143 parent_window = ((const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window"));
144 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"));
145 fd = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "fd"));
146 options = ((GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options"));
147
148 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));
149
150 if (uri != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && fd != -1)
151 {
152 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Rejecting invalid set-wallpaper request (both URI and fd are set)");
153 if (request->exportedcxx . . $ _XdpRequest#exported.)
154 {
155 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request),
156 XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER.,
157 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
158 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
159 }
160 return;
161 }
162
163
164 permission = xdp_get_permission_synccxx . . $ xdp_get_permission_sync(ebdf098f7b403ac8). (id, PERMISSION_TABLEcxx . . $ `src/wallpaper.c:38:9`!, PERMISSION_IDcxx . . $ `src/wallpaper.c:39:9`!);
165
166 if (permission == XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.)
167 {
168 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
169 return;
170 }
171
172 g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "show-preview", "b", &show_preview);
173 if (!show_preview && permission != XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES.)
174 {
175 guintcxx . . $ guint# access_response = 2;
176 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`!;
177 g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) access_opt_builder =
178 G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!);
179 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! gcharcxx . . $ gchar# *app_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
180 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`!;
181 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`!;
182 const gcharcxx . . $ gchar# *body;
183
184 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
185 "deny_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Deny")));
186 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
187 "grant_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow")));
188 g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}",
189 "icon", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). ("preferences-desktop-wallpaper-symbolic"));
190
191 if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (id, "") != 0)
192 {
193 GAppInfocxx . . $ GAppInfo# *info = xdp_app_info_get_gappinfocxx . . $ xdp_app_info_get_gappinfo(1a83d38acf834677). (request->app_infocxx . . $ _XdpRequest#app_info.);
194 const gcharcxx . . $ gchar# *name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
195
196 if (info)
197 {
198 name = g_app_info_get_display_namecxx . . $ g_app_info_get_display_name(946cbaa9210a41). (G_APP_INFOcxx . . $ `<external>/6793221688627496808/gappinfo.h:35:9`! (info));
199 app_id = xdp_get_app_id_from_desktop_idcxx . . $ xdp_get_app_id_from_desktop_id(a8b8e32347182212). (g_app_info_get_idcxx . . $ g_app_info_get_id(946cbaa9210a41). (info));
200 }
201 else
202 {
203 name = id;
204 app_id = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (id);
205 }
206
207 title = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow %s to Set Backgrounds?"), name);
208 subtitle = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("%s is requesting to be able to change the background image."), name);
209 }
210 else
211 {
212 /* Note: this will set the wallpaper permission for all unsandboxed
213 * apps for which an app ID can't be determined.
214 */
215 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (xdp_app_info_is_host (request->app_info));
216 app_id = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! ("");
217 title = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow Applications to Set Backgrounds?"));
218 subtitle = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("An application is requesting to be able to change the background image."));
219 }
220 body = _cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("This permission can be changed at any time from the privacy settings.");
221
222 if (!xdp_dbus_impl_access_call_access_dialog_synccxx . . $ xdp_dbus_impl_access_call_access_dialog_sync(434f1c6fac184201). (access_implcxx . . $ access_impl.,
223 request->idcxx . . $ _XdpRequest#id.,
224 app_id,
225 parent_window,
226 title,
227 subtitle,
228 body,
229 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&access_opt_builder),
230 &access_response,
231 &access_results,
232 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
233 &error))
234 {
235 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to show access dialog: %s", error->message);
236 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
237 return;
238 }
239
240 if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.)
241 xdp_set_permission_synccxx . . $ xdp_set_permission_sync(25a2d507ac2781bd). (id, PERMISSION_TABLEcxx . . $ `src/wallpaper.c:38:9`!, PERMISSION_IDcxx . . $ `src/wallpaper.c:39:9`!, access_response == 0 ? XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES. : XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.);
242
243 if (access_response != 0)
244 {
245 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
246 return;
247 }
248 }
249
250 if (!uri)
251 {
252 g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
253
254 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);
255 if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
256 {
257 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Cannot get path for fd: %s", error->message);
258
259 /* Reject the request */
260 if (request->exportedcxx . . $ _XdpRequest#exported.)
261 {
262 xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6732:9`! (request),
263 XDG_DESKTOP_PORTAL_RESPONSE_OTHERcxx . . $ XDG_DESKTOP_PORTAL_RESPONSE_OTHER.,
264 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder));
265 xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request);
266 }
267 return;
268 }
269
270 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`!);
271 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).);
272 }
273
274 impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). (g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl)),
275 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES.,
276 g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl)),
277 request->idcxx . . $ _XdpRequest#id.,
278 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error);
279
280 if (!impl_request)
281 {
282 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to to create wallpaper implementation proxy: %s", error->message);
283 send_responsecxx . . $ send_response(2a3fcf0baf84982d). (request, 2);
284 return;
285 }
286
287 xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request);
288
289 xdp_filter_optionscxx . . $ xdp_filter_options(d63f67045969ba55). (options, &opt_builder,
290 wallpaper_optionscxx . . $ wallpaper_options., G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (wallpaper_options),
291 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
292
293 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Calling SetWallpaperURI with %s", uri);
294 xdp_dbus_impl_wallpaper_call_set_wallpaper_uricxx . . $ xdp_dbus_impl_wallpaper_call_set_wallpaper_uri(11f7cf373eac9deb). (implcxx . . $ impl.,
295 request->idcxx . . $ _XdpRequest#id.,
296 id,
297 parent_window,
298 uri,
299 g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder),
300 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
301 handle_set_wallpaper_uri_donecxx . . $ handle_set_wallpaper_uri_done(aa1d200d824d915d).,
302 g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request));
303 }
304
305 static gbooleancxx . . $ gboolean#
306 handle_set_wallpaper_uricxx . . $ handle_set_wallpaper_uri(5869461c09cd2b77). (XdpDbusWallpapercxx . . $ XdpDbusWallpaper# *object,
307 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
308 const char *arg_parent_window,
309 const char *arg_uri,
310 GVariantcxx . . $ GVariant# *arg_options)
311 {
312 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
313 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
314
315 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handle SetWallpaperURI");
316
317 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).);
318 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).);
319 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request),
320 "options",
321 g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (arg_options),
322 (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).);
323
324 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
325 xdp_dbus_wallpaper_complete_set_wallpaper_uricxx . . $ xdp_dbus_wallpaper_complete_set_wallpaper_uri(73907c2c7303f941). (object, invocation, request->idcxx . . $ _XdpRequest#id.);
326
327 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`!);
328 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).);
329 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).);
330
331 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
332 }
333
334 static gbooleancxx . . $ gboolean#
335 handle_set_wallpaper_filecxx . . $ handle_set_wallpaper_file(51872eeaeba6475e). (XdpDbusWallpapercxx . . $ XdpDbusWallpaper# *object,
336 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation,
337 GUnixFDListcxx . . $ GUnixFDList# *fd_list,
338 const char *arg_parent_window,
339 GVariantcxx . . $ GVariant# *arg_fd,
340 GVariantcxx . . $ GVariant# *arg_options)
341 {
342 XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation);
343 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
344 int fd_id, fd;
345 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
346
347 g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handle SetWallpaperFile");
348
349 g_variant_getcxx . . $ g_variant_get(671e9cd8f09cd612). (arg_fd, "h", &fd_id);
350 if (fd_id >= g_unix_fd_list_get_lengthcxx . . $ g_unix_fd_list_get_length(7ddaba1b89c413c0). (fd_list))
351 {
352 g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation,
353 XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:98:9`!,
354 XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT.,
355 "Bad file descriptor index");
356 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
357 }
358
359 fd = g_unix_fd_list_getcxx . . $ g_unix_fd_list_get(57b895fb290201ec). (fd_list, fd_id, &error);
360 if (fd == -1)
361 {
362 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error);
363 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
364 }
365
366 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`! (fd));
367 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).);
368 g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request),
369 "options",
370 g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (arg_options),
371 (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).);
372
373 xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation));
374 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.);
375
376 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`!);
377 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).);
378 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).);
379
380 return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!;
381 }
382 static void
383 wallpaper_iface_initcxx . . $ wallpaper_iface_init(3888ed91b3d25922). (XdpDbusWallpaperIfacecxx . . $ XdpDbusWallpaperIface# *iface)
384 {
385 iface->handle_set_wallpaper_uricxx . . $ _XdpDbusWallpaperIface#handle_set_wallpaper_uri. = handle_set_wallpaper_uricxx . . $ handle_set_wallpaper_uri(5869461c09cd2b77).;
386 iface->handle_set_wallpaper_filecxx . . $ _XdpDbusWallpaperIface#handle_set_wallpaper_file. = handle_set_wallpaper_filecxx . . $ handle_set_wallpaper_file(51872eeaeba6475e).;
387 }
388
389 static void
390 wallpaper_initcxx . . $ wallpaper_init(cf1f890f01b4c363). (Wallpapercxx . . $ Wallpaper# *wallpaper)
391 {
392 xdp_dbus_wallpaper_set_versioncxx . . $ xdp_dbus_wallpaper_set_version(d11dd44a4d5fc54f). (XDP_DBUS_WALLPAPERcxx . . $ `build/src/xdp-dbus.h:8543:9`! (wallpaper), 1);
393 }
394
395 static void
396 wallpaper_class_initcxx . . $ wallpaper_class_init(3c325f9c6e642143). (WallpaperClasscxx . . $ WallpaperClass# *klass)
397 {
398 }
399
400 GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *
401 wallpaper_createcxx . . $ wallpaper_create(62a3b994be72c646). (GDBusConnectioncxx . . $ GDBusConnection# *connection,
402 const char *dbus_name_access,
403 const char *dbus_name_wallpaper)
404 {
405 g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
406
407 implcxx . . $ impl. = xdp_dbus_impl_wallpaper_proxy_new_synccxx . . $ xdp_dbus_impl_wallpaper_proxy_new_sync(f617f0dea6409d4a). (connection,
408 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
409 dbus_name_wallpaper,
410 DESKTOP_PORTAL_OBJECT_PATHcxx . . $ `src/xdp-utils.h:37:9`!,
411 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
412 &error);
413 if (implcxx . . $ impl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
414 {
415 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create wallpaper proxy: %s", error->message);
416 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
417 }
418
419 g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!);
420 wallpapercxx . . $ 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`!);
421
422 access_implcxx . . $ access_impl. = xdp_dbus_impl_access_proxy_new_synccxx . . $ xdp_dbus_impl_access_proxy_new_sync(9e184c7775ccd278). (connection,
423 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
424 dbus_name_access,
425 DESKTOP_PORTAL_OBJECT_PATHcxx . . $ `src/xdp-utils.h:37:9`!,
426 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
427 &error);
428
429 return G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (wallpaper);
430 }