| 1 | /* |
| 2 | * Copyright © 2016 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 | * Matthias Clasen <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 24 | |
| 25 | #include "screenshot.h"cxx . . $ `<file>/src/screenshot.h`/ |
| 26 | |
| 27 | #include <errno.h> |
| 28 | #include <fcntl.h> |
| 29 | #include <stdint.h> |
| 30 | #include <stdio.h> |
| 31 | #include <string.h> |
| 32 | #include <sys/stat.h> |
| 33 | #include <sys/types.h> |
| 34 | |
| 35 | #include <gio/gdesktopappinfo.h> |
| 36 | #include <gio/gio.h> |
| 37 | #include <glib/gi18n.h> |
| 38 | |
| 39 | #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/ |
| 40 | #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/ |
| 41 | #include "xdp-documents.h"cxx . . $ `<file>/src/xdp-documents.h`/ |
| 42 | #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/ |
| 43 | #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/ |
| 44 | #include "xdp-portal-config.h"cxx . . $ `<file>/src/xdp-portal-config.h`/ |
| 45 | #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/ |
| 46 | #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/ |
| 47 | |
| 48 | typedef enumcxx . . $ $anonymous_type_3be3cc549b2afc19_0# |
| 49 | { |
| 50 | SCREENSHOT_TARGET_SCREENcxx . . $ SCREENSHOT_TARGET_SCREEN. = 1u << 0, |
| 51 | SCREENSHOT_TARGET_WINDOWcxx . . $ SCREENSHOT_TARGET_WINDOW. = 1u << 1, |
| 52 | SCREENSHOT_TARGET_AREAcxx . . $ SCREENSHOT_TARGET_AREA. = 1u << 2, |
| 53 | SCREENSHOT_TARGET_ACTIVE_WINDOWcxx . . $ SCREENSHOT_TARGET_ACTIVE_WINDOW. = 1u << 3, |
| 54 | } ScreenshotTargetcxx . . $ ScreenshotTarget#; |
| 55 | |
| 56 | typedef struct _Screenshotcxx . . $ _Screenshot# Screenshotcxx . . $ Screenshot#; |
| 57 | typedef struct _ScreenshotClasscxx . . $ _ScreenshotClass# ScreenshotClasscxx . . $ ScreenshotClass#; |
| 58 | |
| 59 | struct _Screenshotcxx . . $ _Screenshot# |
| 60 | { |
| 61 | XdpDbusScreenshotSkeletoncxx . . $ XdpDbusScreenshotSkeleton# parent_instancecxx . . $ _Screenshot#parent_instance.; |
| 62 | |
| 63 | XdpDbusImplScreenshotcxx . . $ XdpDbusImplScreenshot# *implcxx . . $ _Screenshot#impl.; |
| 64 | XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_implcxx . . $ _Screenshot#access_impl.; |
| 65 | guint32cxx . . $ guint32# impl_versioncxx . . $ _Screenshot#impl_version.; |
| 66 | }; |
| 67 | |
| 68 | struct _ScreenshotClasscxx . . $ _ScreenshotClass# |
| 69 | { |
| 70 | XdpDbusScreenshotSkeletonClasscxx . . $ XdpDbusScreenshotSkeletonClass# parent_classcxx . . $ _ScreenshotClass#parent_class.; |
| 71 | }; |
| 72 | |
| 73 | GTypecxx . . $ GType# screenshot_get_typecxx . . $ screenshot_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 74 | static void screenshot_iface_initcxx . . $ screenshot_iface_init(a989a243c4aad2bc). (XdpDbusScreenshotIfacecxx . . $ XdpDbusScreenshotIface# *iface); |
| 75 | |
| 76 | G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (Screenshot, screenshot, XDP_DBUS_TYPE_SCREENSHOT_SKELETONcxx . . $ `build/src/xdp-dbus.h:7482:9`!, |
| 77 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_SCREENSHOTcxx . . $ `build/src/xdp-dbus.h:7300:9`!, |
| 78 | screenshot_iface_init)); |
| 79 | |
| 80 | G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (Screenshot, g_object_unref) |
| 81 | |
| 82 | static void |
| 83 | send_responsecxx . . $ send_response(9511a0e0d3f58956). (XdpRequestcxx . . $ XdpRequest# *request, |
| 84 | guintcxx . . $ guint# response, |
| 85 | GVariantcxx . . $ GVariant# *results) |
| 86 | { |
| 87 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 88 | { |
| 89 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("sending response: %d", response); |
| 90 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request), response, results); |
| 91 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 92 | } |
| 93 | else |
| 94 | { |
| 95 | g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (results); |
| 96 | g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84). (results); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static void |
| 101 | send_response_in_thread_funccxx . . $ send_response_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task, |
| 102 | gpointercxx . . $ gpointer# source_object, |
| 103 | gpointercxx . . $ gpointer# task_data, |
| 104 | GCancellablecxx . . $ GCancellable# *cancellable) |
| 105 | { |
| 106 | XdpRequestcxx . . $ XdpRequest# *request = task_data; |
| 107 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) results = |
| 108 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 109 | guintcxx . . $ guint# response; |
| 110 | GVariantcxx . . $ GVariant# *options; |
| 111 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 112 | const char *retval; |
| 113 | |
| 114 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 115 | |
| 116 | response = GPOINTER_TO_INTcxx . . $ `<external>/10505296616216143549/glibconfig.h:103:9`! (g_object_get_data (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "response")); |
| 117 | options = (GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options"); |
| 118 | |
| 119 | if (response != 0) |
| 120 | goto out; |
| 121 | |
| 122 | retval = g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (task), "retval"); |
| 123 | if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (retval, "url") == 0) |
| 124 | { |
| 125 | const char *uri; |
| 126 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *ruri = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 127 | |
| 128 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "uri", "&s", &uri)) |
| 129 | { |
| 130 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("No URI was provided"); |
| 131 | goto out; |
| 132 | } |
| 133 | |
| 134 | if (xdp_app_info_is_hostcxx . . $ xdp_app_info_is_host(ac6b23a20a03546d). (request->app_infocxx . . $ _XdpRequest#app_info.)) |
| 135 | ruri = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (uri); |
| 136 | else |
| 137 | ruri = xdp_register_documentcxx . . $ xdp_register_document(e16c043bff209580). (uri, xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), XDP_DOCUMENT_FLAG_DELETABLEcxx . . $ XDP_DOCUMENT_FLAG_DELETABLE., &error); |
| 138 | |
| 139 | if (ruri == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 140 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to register %s: %s", uri, error->message); |
| 141 | else |
| 142 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&results, "{&sv}", "uri", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (ruri)); |
| 143 | } |
| 144 | else if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (retval, "color") == 0) |
| 145 | { |
| 146 | double red, green, blue; |
| 147 | |
| 148 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "color", "(ddd)", &red, &green, &blue)) |
| 149 | { |
| 150 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("No color was provided"); |
| 151 | goto out; |
| 152 | } |
| 153 | |
| 154 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&results, "{&sv}", "color", g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(ddd)", red, green, blue)); |
| 155 | } |
| 156 | else |
| 157 | { |
| 158 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Don't know what to return"); |
| 159 | } |
| 160 | |
| 161 | out: |
| 162 | send_responsecxx . . $ send_response(9511a0e0d3f58956). (request, response, g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&results)); |
| 163 | } |
| 164 | |
| 165 | static void |
| 166 | screenshot_donecxx . . $ screenshot_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 167 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 168 | gpointercxx . . $ gpointer# data) |
| 169 | { |
| 170 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 171 | guintcxx . . $ guint# response = 2; |
| 172 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 173 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 174 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 175 | |
| 176 | if (!xdp_dbus_impl_screenshot_call_screenshot_finishcxx . . $ xdp_dbus_impl_screenshot_call_screenshot_finish(3fb82aff02c0d5e5). (XDP_DBUS_IMPL_SCREENSHOTcxx . . $ `build/src/xdp-impl-dbus.h:5292:9`! (source), |
| 177 | &response, |
| 178 | &options, |
| 179 | result, |
| 180 | &error)) |
| 181 | { |
| 182 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 183 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message); |
| 184 | } |
| 185 | |
| 186 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "response", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (response)); |
| 187 | if (options) |
| 188 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options", g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (options), (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).); |
| 189 | |
| 190 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 191 | g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, screenshot_donecxx . . $ screenshot_done(aa1d200d824d915d).); |
| 192 | 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).); |
| 193 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (task), "retval", "url"); |
| 194 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, send_response_in_thread_funccxx . . $ send_response_in_thread_func(4704ff26353eb8ae).); |
| 195 | } |
| 196 | |
| 197 | static gbooleancxx . . $ gboolean# |
| 198 | validate_screenshot_targetcxx . . $ validate_screenshot_target(784467b506ceef6a). (Screenshotcxx . . $ Screenshot# *screenshot, |
| 199 | uint32_tcxx . . $ uint32_t# target, |
| 200 | GErrorcxx . . $ GError# **error) |
| 201 | { |
| 202 | uint32_tcxx . . $ uint32_t# available_targets; |
| 203 | |
| 204 | switch (target) |
| 205 | { |
| 206 | case SCREENSHOT_TARGET_SCREENcxx . . $ SCREENSHOT_TARGET_SCREEN.: |
| 207 | case SCREENSHOT_TARGET_WINDOWcxx . . $ SCREENSHOT_TARGET_WINDOW.: |
| 208 | case SCREENSHOT_TARGET_AREAcxx . . $ SCREENSHOT_TARGET_AREA.: |
| 209 | case SCREENSHOT_TARGET_ACTIVE_WINDOWcxx . . $ SCREENSHOT_TARGET_ACTIVE_WINDOW.: |
| 210 | break; |
| 211 | default: |
| 212 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!, XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 213 | "Invalid screenshot target %x", target); |
| 214 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 215 | } |
| 216 | |
| 217 | available_targets = |
| 218 | xdp_dbus_screenshot_get_available_targetscxx . . $ xdp_dbus_screenshot_get_available_targets(2fefa7b015ac31aa). (XDP_DBUS_SCREENSHOTcxx . . $ `build/src/xdp-dbus.h:7301:9`! (screenshot)); |
| 219 | if (!(available_targets & target)) |
| 220 | { |
| 221 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!, XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 222 | "Unavailable screenshot target %x", target); |
| 223 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 224 | } |
| 225 | |
| 226 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 227 | } |
| 228 | |
| 229 | static gbooleancxx . . $ gboolean# |
| 230 | validate_screenshot_target_filtercxx . . $ validate_screenshot_target_filter(c4684b9d3da33c87). (const char *key, |
| 231 | GVariantcxx . . $ GVariant# *value, |
| 232 | GVariantcxx . . $ GVariant# *options, |
| 233 | gpointercxx . . $ gpointer# user_data, |
| 234 | GErrorcxx . . $ GError# **error) |
| 235 | { |
| 236 | return validate_screenshot_targetcxx . . $ validate_screenshot_target(784467b506ceef6a). (user_data, g_variant_get_uint32cxx . . $ g_variant_get_uint32(59fb6aaaf011986f). (value), error); |
| 237 | } |
| 238 | |
| 239 | static XdpOptionKeycxx . . $ XdpOptionKey# screenshot_options_v3cxx . . $ screenshot_options_v3.[] = { |
| 240 | { "modal", G_VARIANT_TYPE_BOOLEANcxx . . $ `<external>/14064154155447831270/gvarianttype.h:41:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }, |
| 241 | { "interactive", G_VARIANT_TYPE_BOOLEANcxx . . $ `<external>/14064154155447831270/gvarianttype.h:41:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }, |
| 242 | { "target", G_VARIANT_TYPE_UINT32cxx . . $ `<external>/14064154155447831270/gvarianttype.h:81:9`!, validate_screenshot_target_filtercxx . . $ validate_screenshot_target_filter(c4684b9d3da33c87). } |
| 243 | }; |
| 244 | |
| 245 | static gbooleancxx . . $ gboolean# |
| 246 | check_non_interactive_permission_in_threadcxx . . $ check_non_interactive_permission_in_thread(c5b0462eafd6b7d). (Screenshotcxx . . $ Screenshot# *screenshot, |
| 247 | XdpRequestcxx . . $ XdpRequest# *request, |
| 248 | const char *parent_window, |
| 249 | gbooleancxx . . $ gboolean# modal) |
| 250 | { |
| 251 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 252 | 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`!; |
| 253 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) access_opt_builder = |
| 254 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 255 | XdpPermissioncxx . . $ XdpPermission# permission; |
| 256 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *subtitle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 257 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! char *title = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 258 | const char *body = ""; |
| 259 | uintcxx . . $ uint# access_response = 2; |
| 260 | const char *app_id; |
| 261 | |
| 262 | permission = xdp_get_permission_synccxx . . $ xdp_get_permission_sync(178fd6ce07e9d2e2). (request->app_infocxx . . $ _XdpRequest#app_info., |
| 263 | SCREENSHOT_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:129:9`!, |
| 264 | SCREENSHOT_PERMISSION_IDcxx . . $ `src/xdp-types.h:130:9`!); |
| 265 | |
| 266 | if (permission == XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES.) |
| 267 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 268 | |
| 269 | if (permission == XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.) |
| 270 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 271 | |
| 272 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}", |
| 273 | "deny_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Deny"))); |
| 274 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}", |
| 275 | "grant_label", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow"))); |
| 276 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}", |
| 277 | "icon", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). ("applets-screenshooter-symbolic")); |
| 278 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&access_opt_builder, "{sv}", |
| 279 | "modal", g_variant_new_booleancxx . . $ g_variant_new_boolean(d662e1c280be90d3). (modal)); |
| 280 | |
| 281 | app_id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.); |
| 282 | |
| 283 | if (g_strcmp0cxx . . $ g_strcmp0(5ae29d726ae57f88). (app_id, "") != 0) |
| 284 | { |
| 285 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GDesktopAppInfo) info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 286 | g_autofreecxx . . $ `<external>/12741050725406041920/gmacros.h:1429:9`! gcharcxx . . $ gchar# *id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 287 | const gcharcxx . . $ gchar# *name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 288 | |
| 289 | id = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). (app_id, ".desktop", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 290 | info = g_desktop_app_info_newcxx . . $ g_desktop_app_info_new(eecce1e92d8304e9). (id); |
| 291 | |
| 292 | if (info) |
| 293 | name = g_app_info_get_display_namecxx . . $ g_app_info_get_display_name(946cbaa9210a41). (G_APP_INFOcxx . . $ `<external>/6793221688627496808/gappinfo.h:35:9`! (info)); |
| 294 | else |
| 295 | name = app_id; |
| 296 | |
| 297 | if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.) |
| 298 | { |
| 299 | title = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow %s to Take Screenshots?"), name); |
| 300 | subtitle = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("%s wants to take screenshots at any time"), name); |
| 301 | } |
| 302 | else /* permission == XDP_PERMISSION_ASK */ |
| 303 | { |
| 304 | title = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow %s to Take a Screenshot?"), name); |
| 305 | subtitle = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("%s wants to take a screenshot"), name); |
| 306 | } |
| 307 | } |
| 308 | else |
| 309 | { |
| 310 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (xdp_app_info_is_host (request->app_info)); |
| 311 | if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.) |
| 312 | { |
| 313 | /* Note: this will set the screenshot permission for all unsandboxed |
| 314 | * apps for which an app ID can't be determined. |
| 315 | */ |
| 316 | title = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow Apps to Take Screenshots?")); |
| 317 | subtitle = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("An app wants to take screenshots at any time")); |
| 318 | } |
| 319 | else /* permission == XDP_PERMISSION_ASK */ |
| 320 | { |
| 321 | title = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("Allow to Take a Screenshot?")); |
| 322 | subtitle = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (_cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("An app wants to take a screenshot")); |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.) |
| 327 | body = _cxx . . $ `<external>/12274105664691031387/gi18n.h:28:10`!("This permission can be changed at any time from the privacy settings"); |
| 328 | |
| 329 | if (!xdp_dbus_impl_access_call_access_dialog_synccxx . . $ xdp_dbus_impl_access_call_access_dialog_sync(434f1c6fac184201). (screenshot->access_implcxx . . $ _Screenshot#access_impl., |
| 330 | request->idcxx . . $ _XdpRequest#id., |
| 331 | app_id, |
| 332 | parent_window, |
| 333 | title, |
| 334 | subtitle, |
| 335 | body, |
| 336 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&access_opt_builder), |
| 337 | &access_response, |
| 338 | &access_results, |
| 339 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 340 | &error)) |
| 341 | { |
| 342 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to show access dialog: %s", error->message); |
| 343 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 344 | } |
| 345 | |
| 346 | if (permission == XDP_PERMISSION_UNSETcxx . . $ XDP_PERMISSION_UNSET.) |
| 347 | { |
| 348 | xdp_set_permission_synccxx . . $ xdp_set_permission_sync(cba2464d6dcfb7ce). (request->app_infocxx . . $ _XdpRequest#app_info., |
| 349 | SCREENSHOT_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:129:9`!, |
| 350 | SCREENSHOT_PERMISSION_IDcxx . . $ `src/xdp-types.h:130:9`!, |
| 351 | access_response == 0 ? XDP_PERMISSION_YEScxx . . $ XDP_PERMISSION_YES. : XDP_PERMISSION_NOcxx . . $ XDP_PERMISSION_NO.); |
| 352 | } |
| 353 | |
| 354 | return access_response == 0; |
| 355 | } |
| 356 | |
| 357 | |
| 358 | static void |
| 359 | handle_screenshot_in_thread_funccxx . . $ handle_screenshot_in_thread_func(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task, |
| 360 | gpointercxx . . $ gpointer# source_object, |
| 361 | gpointercxx . . $ gpointer# task_data, |
| 362 | GCancellablecxx . . $ GCancellable# *cancellable) |
| 363 | { |
| 364 | Screenshotcxx . . $ Screenshot# *screenshot = (Screenshotcxx . . $ Screenshot# *) source_object; |
| 365 | XdpRequestcxx . . $ XdpRequest# *request = XDP_REQUESTcxx . . $ XDP_REQUEST(e3ad50a9247c4f2e). (task_data); |
| 366 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 367 | 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`!; |
| 368 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder = |
| 369 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 370 | GVariantItercxx . . $ GVariantIter# options_iter; |
| 371 | GVariantcxx . . $ GVariant# *options; |
| 372 | const char *key; |
| 373 | GVariantcxx . . $ GVariant# *value; |
| 374 | gbooleancxx . . $ gboolean# permission_store_checked = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 375 | gbooleancxx . . $ gboolean# interactive; |
| 376 | gbooleancxx . . $ gboolean# modal; |
| 377 | const char *parent_window; |
| 378 | const char *app_id; |
| 379 | |
| 380 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 381 | |
| 382 | app_id = xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.); |
| 383 | parent_window = ((const char *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "parent-window")); |
| 384 | options = ((GVariantcxx . . $ GVariant# *)g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options")); |
| 385 | |
| 386 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "interactive", "b", &interactive)) |
| 387 | interactive = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 388 | |
| 389 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "modal", "b", &modal)) |
| 390 | modal = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 391 | |
| 392 | if (xdp_dbus_impl_screenshot_get_versioncxx . . $ xdp_dbus_impl_screenshot_get_version(d29ba791510407d4). (screenshot->implcxx . . $ _Screenshot#impl.) >= 2) |
| 393 | { |
| 394 | if (!interactive && |
| 395 | !check_non_interactive_permission_in_threadcxx . . $ check_non_interactive_permission_in_thread(c5b0462eafd6b7d). (screenshot, |
| 396 | request, |
| 397 | parent_window, |
| 398 | modal)) |
| 399 | { |
| 400 | send_responsecxx . . $ send_response(9511a0e0d3f58956). (request, 2, g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder)); |
| 401 | return; |
| 402 | } |
| 403 | permission_store_checked = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 404 | } |
| 405 | |
| 406 | impl_request = |
| 407 | 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`! (screenshot->impl)), |
| 408 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 409 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screenshot->impl)), |
| 410 | request->idcxx . . $ _XdpRequest#id., |
| 411 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 412 | if (!impl_request) |
| 413 | { |
| 414 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to to create screenshot implementation proxy: %s", error->message); |
| 415 | send_responsecxx . . $ send_response(9511a0e0d3f58956). (request, 2, g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder)); |
| 416 | return; |
| 417 | } |
| 418 | |
| 419 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 420 | |
| 421 | g_variant_iter_initcxx . . $ g_variant_iter_init(83d0c9c646e4f22c). (&options_iter, options); |
| 422 | while (g_variant_iter_nextcxx . . $ g_variant_iter_next(eaf615a8ce2e43df). (&options_iter, "{&sv}", &key, &value)) |
| 423 | { |
| 424 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opt_builder, "{sv}", key, value); |
| 425 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&value, g_variant_unref); |
| 426 | } |
| 427 | |
| 428 | if (permission_store_checked) |
| 429 | { |
| 430 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&opt_builder, "{sv}", "permission_store_checked", |
| 431 | g_variant_new_booleancxx . . $ g_variant_new_boolean(d662e1c280be90d3). (TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!)); |
| 432 | } |
| 433 | |
| 434 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Calling Screenshot with interactive=%d", interactive); |
| 435 | xdp_dbus_impl_screenshot_call_screenshotcxx . . $ xdp_dbus_impl_screenshot_call_screenshot(37fa477994aae43d). (screenshot->implcxx . . $ _Screenshot#impl., |
| 436 | request->idcxx . . $ _XdpRequest#id., |
| 437 | app_id, |
| 438 | parent_window, |
| 439 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder), |
| 440 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 441 | screenshot_donecxx . . $ screenshot_done(aa1d200d824d915d)., |
| 442 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 443 | |
| 444 | } |
| 445 | |
| 446 | static gbooleancxx . . $ gboolean# |
| 447 | handle_screenshotcxx . . $ handle_screenshot(280f3a84b8fb2a3f). (XdpDbusScreenshotcxx . . $ XdpDbusScreenshot# *object, |
| 448 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 449 | const gcharcxx . . $ gchar# *arg_parent_window, |
| 450 | GVariantcxx . . $ GVariant# *arg_options) |
| 451 | { |
| 452 | Screenshotcxx . . $ Screenshot# *screenshot = (Screenshotcxx . . $ Screenshot# *) object; |
| 453 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 454 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder = |
| 455 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 456 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 457 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 458 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 459 | |
| 460 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Handle Screenshot"); |
| 461 | |
| 462 | if (!xdp_filter_optionscxx . . $ xdp_filter_options(e9350dfce557ba5e). (arg_options, &opt_builder, |
| 463 | screenshot_options_v3cxx . . $ screenshot_options_v3., G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (screenshot_options_v3), |
| 464 | screenshot, &error)) |
| 465 | { |
| 466 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 467 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 468 | } |
| 469 | options = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder)); |
| 470 | |
| 471 | 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).); |
| 472 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), |
| 473 | "options", |
| 474 | g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&options), |
| 475 | (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).); |
| 476 | |
| 477 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 478 | xdp_dbus_screenshot_complete_screenshotcxx . . $ xdp_dbus_screenshot_complete_screenshot(920a84f3212931c4). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 479 | |
| 480 | 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`!); |
| 481 | g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, handle_screenshotcxx . . $ handle_screenshot(280f3a84b8fb2a3f).); |
| 482 | 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).); |
| 483 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, handle_screenshot_in_thread_funccxx . . $ handle_screenshot_in_thread_func(4704ff26353eb8ae).); |
| 484 | |
| 485 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 486 | } |
| 487 | |
| 488 | static void |
| 489 | pick_color_donecxx . . $ pick_color_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 490 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 491 | gpointercxx . . $ gpointer# data) |
| 492 | { |
| 493 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 494 | guintcxx . . $ guint# response = 2; |
| 495 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 496 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 497 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GTask) task = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 498 | |
| 499 | if (!xdp_dbus_impl_screenshot_call_pick_color_finishcxx . . $ xdp_dbus_impl_screenshot_call_pick_color_finish(3fb82aff02c0d5e5). (XDP_DBUS_IMPL_SCREENSHOTcxx . . $ `build/src/xdp-impl-dbus.h:5292:9`! (source), |
| 500 | &response, |
| 501 | &options, |
| 502 | result, |
| 503 | &error)) |
| 504 | { |
| 505 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 506 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message); |
| 507 | } |
| 508 | |
| 509 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "response", GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (response)); |
| 510 | if (options) |
| 511 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), "options", g_variant_refcxx . . $ g_variant_ref(3606eab35379b54a). (options), (GDestroyNotifycxx . . $ GDestroyNotify#)g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84).); |
| 512 | |
| 513 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 514 | g_task_set_source_tagcxx . . $ g_task_set_source_tag(8d6a21f582f50705). (task, pick_color_donecxx . . $ pick_color_done(aa1d200d824d915d).); |
| 515 | 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).); |
| 516 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (task), "retval", "color"); |
| 517 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, send_response_in_thread_funccxx . . $ send_response_in_thread_func(4704ff26353eb8ae).); |
| 518 | } |
| 519 | |
| 520 | static XdpOptionKeycxx . . $ XdpOptionKey# pick_color_optionscxx . . $ pick_color_options.[] = { |
| 521 | }; |
| 522 | |
| 523 | static gbooleancxx . . $ gboolean# |
| 524 | handle_pick_colorcxx . . $ handle_pick_color(280f3a84b8fb2a3f). (XdpDbusScreenshotcxx . . $ XdpDbusScreenshot# *object, |
| 525 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 526 | const gcharcxx . . $ gchar# *arg_parent_window, |
| 527 | GVariantcxx . . $ GVariant# *arg_options) |
| 528 | { |
| 529 | Screenshotcxx . . $ Screenshot# *screenshot = (Screenshotcxx . . $ Screenshot# *) object; |
| 530 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 531 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 532 | 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`!; |
| 533 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) opt_builder = |
| 534 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 535 | |
| 536 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 537 | |
| 538 | impl_request = |
| 539 | 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`! (screenshot->impl)), |
| 540 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 541 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screenshot->impl)), |
| 542 | request->idcxx . . $ _XdpRequest#id., |
| 543 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 544 | if (!impl_request) |
| 545 | { |
| 546 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 547 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 548 | } |
| 549 | |
| 550 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 551 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 552 | |
| 553 | xdp_filter_optionscxx . . $ xdp_filter_options(e9350dfce557ba5e). (arg_options, &opt_builder, |
| 554 | pick_color_optionscxx . . $ pick_color_options., G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (pick_color_options), |
| 555 | 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`!); |
| 556 | |
| 557 | xdp_dbus_impl_screenshot_call_pick_colorcxx . . $ xdp_dbus_impl_screenshot_call_pick_color(37fa477994aae43d). (screenshot->implcxx . . $ _Screenshot#impl., |
| 558 | request->idcxx . . $ _XdpRequest#id., |
| 559 | xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), |
| 560 | arg_parent_window, |
| 561 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&opt_builder), |
| 562 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 563 | pick_color_donecxx . . $ pick_color_done(aa1d200d824d915d)., |
| 564 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 565 | |
| 566 | xdp_dbus_screenshot_complete_pick_colorcxx . . $ xdp_dbus_screenshot_complete_pick_color(920a84f3212931c4). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 567 | |
| 568 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 569 | } |
| 570 | |
| 571 | static void |
| 572 | screenshot_iface_initcxx . . $ screenshot_iface_init(a989a243c4aad2bc). (XdpDbusScreenshotIfacecxx . . $ XdpDbusScreenshotIface# *iface) |
| 573 | { |
| 574 | iface->handle_screenshotcxx . . $ _XdpDbusScreenshotIface#handle_screenshot. = handle_screenshotcxx . . $ handle_screenshot(280f3a84b8fb2a3f).; |
| 575 | iface->handle_pick_colorcxx . . $ _XdpDbusScreenshotIface#handle_pick_color. = handle_pick_colorcxx . . $ handle_pick_color(280f3a84b8fb2a3f).; |
| 576 | } |
| 577 | |
| 578 | static void |
| 579 | screenshot_disposecxx . . $ screenshot_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 580 | { |
| 581 | Screenshotcxx . . $ Screenshot# *screenshot = (Screenshotcxx . . $ Screenshot# *) object; |
| 582 | |
| 583 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&screenshot->impl); |
| 584 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&screenshot->access_impl); |
| 585 | |
| 586 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (screenshot_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object); |
| 587 | } |
| 588 | |
| 589 | static void |
| 590 | screenshot_initcxx . . $ screenshot_init(6de3a289389bd6dd). (Screenshotcxx . . $ Screenshot# *screenshot) |
| 591 | { |
| 592 | } |
| 593 | |
| 594 | static void |
| 595 | screenshot_class_initcxx . . $ screenshot_class_init(23ce98f9110823f7). (ScreenshotClasscxx . . $ ScreenshotClass# *klass) |
| 596 | { |
| 597 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 598 | |
| 599 | object_class->disposecxx . . $ _GObjectClass#dispose. = screenshot_disposecxx . . $ screenshot_dispose(6087475fa43034d3).; |
| 600 | } |
| 601 | |
| 602 | static Screenshotcxx . . $ Screenshot# * |
| 603 | screenshot_newcxx . . $ screenshot_new(782b16d9d3bb0f63). (XdpDbusImplScreenshotcxx . . $ XdpDbusImplScreenshot# *impl, |
| 604 | XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_impl) |
| 605 | { |
| 606 | Screenshotcxx . . $ Screenshot# *screenshot; |
| 607 | |
| 608 | screenshot = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (screenshot_get_typecxx . . $ screenshot_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 609 | screenshot->access_implcxx . . $ _Screenshot#access_impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (access_impl); |
| 610 | screenshot->implcxx . . $ _Screenshot#impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (impl); |
| 611 | |
| 612 | g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screenshot->impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!); |
| 613 | |
| 614 | |
| 615 | /* Before there was a version property, the version was hardcoded to 2, so |
| 616 | * make sure we retain that behaviour */ |
| 617 | screenshot->impl_versioncxx . . $ _Screenshot#impl_version. = |
| 618 | MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (xdp_dbus_impl_screenshot_get_version (screenshot->impl), 2); |
| 619 | |
| 620 | xdp_dbus_screenshot_set_versioncxx . . $ xdp_dbus_screenshot_set_version(657567683a8d7b74). (XDP_DBUS_SCREENSHOTcxx . . $ `build/src/xdp-dbus.h:7301:9`! (screenshot), |
| 621 | MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (screenshot->impl_version, 3)); |
| 622 | |
| 623 | if (screenshot->impl_versioncxx . . $ _Screenshot#impl_version. >= 3) |
| 624 | { |
| 625 | g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screenshot->impl), "available-targets", |
| 626 | G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screenshot), "available-targets", |
| 627 | G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.); |
| 628 | } |
| 629 | |
| 630 | return screenshot; |
| 631 | } |
| 632 | |
| 633 | void |
| 634 | init_screenshotcxx . . $ init_screenshot(7d190a42f72e5c4f). (XdpContextcxx . . $ XdpContext# *context) |
| 635 | { |
| 636 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(Screenshot) screenshot = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 637 | GDBusConnectioncxx . . $ GDBusConnection# *connection = xdp_context_get_connectioncxx . . $ xdp_context_get_connection(a09559f10e8590c5). (context); |
| 638 | XdpPortalConfigcxx . . $ XdpPortalConfig# *config = xdp_context_get_configcxx . . $ xdp_context_get_config(3deea62d2e42aa7). (context); |
| 639 | XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_impl; |
| 640 | XdpImplConfigcxx . . $ XdpImplConfig# *impl_config; |
| 641 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplScreenshot) impl = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 642 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 643 | |
| 644 | impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (config, SCREENSHOT_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:128:9`!); |
| 645 | if (impl_config == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 646 | return; |
| 647 | |
| 648 | access_impl = xdp_context_get_access_implcxx . . $ xdp_context_get_access_impl(c8ed220d2ee32a9b). (context); |
| 649 | if (access_impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 650 | { |
| 651 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("The screenshot portal requires an access impl"); |
| 652 | return; |
| 653 | } |
| 654 | |
| 655 | impl = xdp_dbus_impl_screenshot_proxy_new_synccxx . . $ xdp_dbus_impl_screenshot_proxy_new_sync(23a6e20181dbb532). (connection, |
| 656 | G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE., |
| 657 | impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name., |
| 658 | DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!, |
| 659 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 660 | &error); |
| 661 | if (impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 662 | { |
| 663 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create screenshot proxy: %s", error->message); |
| 664 | return; |
| 665 | } |
| 666 | |
| 667 | screenshot = screenshot_newcxx . . $ screenshot_new(782b16d9d3bb0f63). (impl, access_impl); |
| 668 | |
| 669 | xdp_context_take_and_export_portalcxx . . $ xdp_context_take_and_export_portal(54303e2939dd494f). (context, |
| 670 | G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&screenshot)), |
| 671 | XDP_CONTEXT_EXPORT_FLAGS_NONEcxx . . $ XDP_CONTEXT_EXPORT_FLAGS_NONE.); |
| 672 | } |