| 1 | /* |
| 2 | * Copyright © 2025 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 | |
| 20 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/ |
| 23 | |
| 24 | #include "account.h"cxx . . $ `<file>/src/account.h`/ |
| 25 | #include "background.h"cxx . . $ `<file>/src/background.h`/ |
| 26 | #include "camera.h"cxx . . $ `<file>/src/camera.h`/ |
| 27 | #include "clipboard.h"cxx . . $ `<file>/src/clipboard.h`/ |
| 28 | #include "dynamic-launcher.h"cxx . . $ `<file>/src/dynamic-launcher.h`/ |
| 29 | #include "email.h"cxx . . $ `<file>/src/email.h`/ |
| 30 | #include "file-chooser.h"cxx . . $ `<file>/src/file-chooser.h`/ |
| 31 | #include "gamemode.h"cxx . . $ `<file>/src/gamemode.h`/ |
| 32 | #include "global-shortcuts.h"cxx . . $ `<file>/src/global-shortcuts.h`/ |
| 33 | #include "inhibit.h"cxx . . $ `<file>/src/inhibit.h`/ |
| 34 | #include "input-capture.h"cxx . . $ `<file>/src/input-capture.h`/ |
| 35 | #include "location.h"cxx . . $ `<file>/src/location.h`/ |
| 36 | #include "memory-monitor.h"cxx . . $ `<file>/src/memory-monitor.h`/ |
| 37 | #include "network-monitor.h"cxx . . $ `<file>/src/network-monitor.h`/ |
| 38 | #include "notification.h"cxx . . $ `<file>/src/notification.h`/ |
| 39 | #include "open-uri.h"cxx . . $ `<file>/src/open-uri.h`/ |
| 40 | #include "power-profile-monitor.h"cxx . . $ `<file>/src/power-profile-monitor.h`/ |
| 41 | #include "print.h"cxx . . $ `<file>/src/print.h`/ |
| 42 | #include "proxy-resolver.h"cxx . . $ `<file>/src/proxy-resolver.h`/ |
| 43 | #include "realtime.h"cxx . . $ `<file>/src/realtime.h`/ |
| 44 | #include "registry.h"cxx . . $ `<file>/src/registry.h`/ |
| 45 | #include "remote-desktop.h"cxx . . $ `<file>/src/remote-desktop.h`/ |
| 46 | #include "screen-cast.h"cxx . . $ `<file>/src/screen-cast.h`/ |
| 47 | #include "screenshot.h"cxx . . $ `<file>/src/screenshot.h`/ |
| 48 | #include "secret.h"cxx . . $ `<file>/src/secret.h`/ |
| 49 | #include "settings.h"cxx . . $ `<file>/src/settings.h`/ |
| 50 | #include "trash.h"cxx . . $ `<file>/src/trash.h`/ |
| 51 | #include "usb.h"cxx . . $ `<file>/src/usb.h`/ |
| 52 | #include "wallpaper.h"cxx . . $ `<file>/src/wallpaper.h`/ |
| 53 | #include "xdp-app-info-registry.h"cxx . . $ `<file>/src/xdp-app-info-registry.h`/ |
| 54 | #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/ |
| 55 | #include "xdp-documents.h"cxx . . $ `<file>/src/xdp-documents.h`/ |
| 56 | #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/ |
| 57 | #include "xdp-method-info.h"cxx . . $ `<file>/src/xdp-method-info.h`/ |
| 58 | #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/ |
| 59 | #include "xdp-portal-config.h"cxx . . $ `<file>/src/xdp-portal-config.h`/ |
| 60 | #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/ |
| 61 | #include "xdp-session-persistence.h"cxx . . $ `<file>/src/xdp-session-persistence.h`/ |
| 62 | #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/ |
| 63 | |
| 64 | enumcxx . . $ $anonymous_type_40521671c662e631_0# |
| 65 | { |
| 66 | PEER_DISCONNECTcxx . . $ PEER_DISCONNECT., |
| 67 | N_SIGNALScxx . . $ N_SIGNALS., |
| 68 | }; |
| 69 | |
| 70 | static guintcxx . . $ guint# signalscxx . . $ signals.[N_SIGNALScxx . . $ N_SIGNALS.] = { 0 }; |
| 71 | |
| 72 | struct _XdpContextcxx . . $ _XdpContext# |
| 73 | { |
| 74 | GObjectcxx . . $ GObject# parent_instancecxx . . $ _XdpContext#parent_instance.; |
| 75 | |
| 76 | gbooleancxx . . $ gboolean# verbosecxx . . $ _XdpContext#verbose.; |
| 77 | |
| 78 | XdpPortalConfigcxx . . $ XdpPortalConfig# *portal_configcxx . . $ _XdpContext#portal_config.; |
| 79 | GDBusConnectioncxx . . $ GDBusConnection# *connectioncxx . . $ _XdpContext#connection.; |
| 80 | XdpDbusImplLockdowncxx . . $ XdpDbusImplLockdown# *lockdown_implcxx . . $ _XdpContext#lockdown_impl.; |
| 81 | XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# *access_implcxx . . $ _XdpContext#access_impl.; |
| 82 | guintcxx . . $ guint# peer_disconnect_handle_idcxx . . $ _XdpContext#peer_disconnect_handle_id.; |
| 83 | XdpAppInfoRegistrycxx . . $ XdpAppInfoRegistry# *app_info_registrycxx . . $ _XdpContext#app_info_registry.; |
| 84 | GHashTablecxx . . $ GHashTable# *exported_portalscxx . . $ _XdpContext#exported_portals.; /* iface name -> GDBusInterfaceSkeleton */ |
| 85 | GHashTablecxx . . $ GHashTable# *registered_object_pathscxx . . $ _XdpContext#registered_object_paths.; /* char *object_path set */ |
| 86 | GMutexcxx . . $ GMutex# registered_object_paths_lockcxx . . $ _XdpContext#registered_object_paths_lock.; |
| 87 | |
| 88 | GCancellablecxx . . $ GCancellable# *cancellablecxx . . $ _XdpContext#cancellable.; |
| 89 | }; |
| 90 | |
| 91 | G_DEFINE_FINAL_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1940:9`! (XdpContext, |
| 92 | xdp_context, |
| 93 | G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!); |
| 94 | |
| 95 | static void |
| 96 | xdp_context_disposecxx . . $ xdp_context_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 97 | { |
| 98 | XdpContextcxx . . $ XdpContext# *context = XDP_CONTEXTcxx . . $ XDP_CONTEXT(136535a435f175a1). (object); |
| 99 | |
| 100 | if (context->peer_disconnect_handle_idcxx . . $ _XdpContext#peer_disconnect_handle_id.) |
| 101 | { |
| 102 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (context->connection); |
| 103 | xdp_connection_untrack_peer_disconnectcxx . . $ xdp_connection_untrack_peer_disconnect(21eb64a5380286b0). (context->connectioncxx . . $ _XdpContext#connection., |
| 104 | context->peer_disconnect_handle_idcxx . . $ _XdpContext#peer_disconnect_handle_id.); |
| 105 | context->peer_disconnect_handle_idcxx . . $ _XdpContext#peer_disconnect_handle_id. = 0; |
| 106 | } |
| 107 | |
| 108 | g_cancellable_cancelcxx . . $ g_cancellable_cancel(ff72ec99b913803a). (context->cancellablecxx . . $ _XdpContext#cancellable.); |
| 109 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->cancellable); |
| 110 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->portal_config); |
| 111 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->connection); |
| 112 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->lockdown_impl); |
| 113 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->access_impl); |
| 114 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&context->app_info_registry); |
| 115 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&context->exported_portals, g_hash_table_unref); |
| 116 | |
| 117 | if (context->registered_object_pathscxx . . $ _XdpContext#registered_object_paths.) |
| 118 | { |
| 119 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&context->registered_object_paths, g_hash_table_unref); |
| 120 | g_mutex_clearcxx . . $ g_mutex_clear(d80b1953a7cb7fd1). (&context->registered_object_paths_lockcxx . . $ _XdpContext#registered_object_paths_lock.); |
| 121 | } |
| 122 | |
| 123 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (xdp_context_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object); |
| 124 | } |
| 125 | |
| 126 | static void |
| 127 | xdp_context_class_initcxx . . $ xdp_context_class_init(2c98bb7716b88d19). (XdpContextClasscxx . . $ XdpContextClass# *klass) |
| 128 | { |
| 129 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 130 | |
| 131 | object_class->disposecxx . . $ _GObjectClass#dispose. = xdp_context_disposecxx . . $ xdp_context_dispose(6087475fa43034d3).; |
| 132 | |
| 133 | signalscxx . . $ signals.[PEER_DISCONNECTcxx . . $ PEER_DISCONNECT.] = |
| 134 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). ("peer-disconnect", |
| 135 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (object_class), |
| 136 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 137 | 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 138 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 139 | G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 140 | } |
| 141 | |
| 142 | static void |
| 143 | xdp_context_initcxx . . $ xdp_context_init(7d190a42f72e5c4f). (XdpContextcxx . . $ XdpContext# *context) |
| 144 | { |
| 145 | } |
| 146 | |
| 147 | XdpContextcxx . . $ XdpContext# * |
| 148 | xdp_context_newcxx . . $ xdp_context_new(293669cc44d77af7). (gbooleancxx . . $ gboolean# opt_verbose) |
| 149 | { |
| 150 | XdpContextcxx . . $ XdpContext# *context = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (XDP_TYPE_CONTEXTcxx . . $ `src/xdp-context.h:32:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 151 | |
| 152 | context->verbosecxx . . $ _XdpContext#verbose. = opt_verbose; |
| 153 | context->cancellablecxx . . $ _XdpContext#cancellable. = g_cancellable_newcxx . . $ g_cancellable_new(decaddcb7afe0309). (); |
| 154 | context->portal_configcxx . . $ _XdpContext#portal_config. = xdp_portal_config_newcxx . . $ xdp_portal_config_new(3deea62d2e42aa7). (context); |
| 155 | context->app_info_registrycxx . . $ _XdpContext#app_info_registry. = xdp_app_info_registry_newcxx . . $ xdp_app_info_registry_new(712ae31f899850bf). (); |
| 156 | context->exported_portalscxx . . $ _XdpContext#exported_portals. = g_hash_table_new_fullcxx . . $ g_hash_table_new_full(e2dd12b570de7430). (g_str_hashcxx . . $ g_str_hash(b11f534102b1ad6)., g_str_equalcxx . . $ g_str_equal(9148c8c3ff42c9d8)., |
| 157 | g_freecxx . . $ g_free(5d22bdacc48458e8)., |
| 158 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 159 | context->registered_object_pathscxx . . $ _XdpContext#registered_object_paths. = |
| 160 | g_hash_table_new_fullcxx . . $ g_hash_table_new_full(e2dd12b570de7430). (g_str_hashcxx . . $ g_str_hash(b11f534102b1ad6)., g_str_equalcxx . . $ g_str_equal(9148c8c3ff42c9d8)., g_freecxx . . $ g_free(5d22bdacc48458e8)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 161 | g_mutex_initcxx . . $ g_mutex_init(d80b1953a7cb7fd1). (&context->registered_object_paths_lockcxx . . $ _XdpContext#registered_object_paths_lock.); |
| 162 | |
| 163 | return context; |
| 164 | } |
| 165 | |
| 166 | gbooleancxx . . $ gboolean# |
| 167 | xdp_context_is_verbosecxx . . $ xdp_context_is_verbose(14a61a24a5c89f0b). (XdpContextcxx . . $ XdpContext# *context) |
| 168 | { |
| 169 | return context->verbosecxx . . $ _XdpContext#verbose.; |
| 170 | } |
| 171 | |
| 172 | XdpAppInfoRegistrycxx . . $ XdpAppInfoRegistry# * |
| 173 | xdp_context_get_app_info_registrycxx . . $ xdp_context_get_app_info_registry(1aaec1ac2d18e9a2). (XdpContextcxx . . $ XdpContext# *context) |
| 174 | { |
| 175 | return context->app_info_registrycxx . . $ _XdpContext#app_info_registry.; |
| 176 | } |
| 177 | |
| 178 | GDBusConnectioncxx . . $ GDBusConnection# * |
| 179 | xdp_context_get_connectioncxx . . $ xdp_context_get_connection(a09559f10e8590c5). (XdpContextcxx . . $ XdpContext# *context) |
| 180 | { |
| 181 | return context->connectioncxx . . $ _XdpContext#connection.; |
| 182 | } |
| 183 | |
| 184 | XdpPortalConfigcxx . . $ XdpPortalConfig# * |
| 185 | xdp_context_get_configcxx . . $ xdp_context_get_config(3deea62d2e42aa7). (XdpContextcxx . . $ XdpContext# *context) |
| 186 | { |
| 187 | return context->portal_configcxx . . $ _XdpContext#portal_config.; |
| 188 | } |
| 189 | |
| 190 | XdpDbusImplLockdowncxx . . $ XdpDbusImplLockdown# * |
| 191 | xdp_context_get_lockdown_implcxx . . $ xdp_context_get_lockdown_impl(9ee3f1c16a0ceb58). (XdpContextcxx . . $ XdpContext# *context) |
| 192 | { |
| 193 | return context->lockdown_implcxx . . $ _XdpContext#lockdown_impl.; |
| 194 | } |
| 195 | |
| 196 | XdpDbusImplAccesscxx . . $ XdpDbusImplAccess# * |
| 197 | xdp_context_get_access_implcxx . . $ xdp_context_get_access_impl(c8ed220d2ee32a9b). (XdpContextcxx . . $ XdpContext# *context) |
| 198 | { |
| 199 | return context->access_implcxx . . $ _XdpContext#access_impl.; |
| 200 | } |
| 201 | |
| 202 | static gbooleancxx . . $ gboolean# |
| 203 | method_needs_requestcxx . . $ method_needs_request(4fbb76638ba9977b). (GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation) |
| 204 | { |
| 205 | const char *interface; |
| 206 | const char *method; |
| 207 | const XdpMethodInfocxx . . $ XdpMethodInfo# *method_info; |
| 208 | |
| 209 | interface = g_dbus_method_invocation_get_interface_namecxx . . $ g_dbus_method_invocation_get_interface_name(fb2cbbb785aa0d4d). (invocation); |
| 210 | method = g_dbus_method_invocation_get_method_namecxx . . $ g_dbus_method_invocation_get_method_name(fb2cbbb785aa0d4d). (invocation); |
| 211 | |
| 212 | method_info = xdp_method_info_findcxx . . $ xdp_method_info_find(741099d6aee7684a). (interface, method); |
| 213 | |
| 214 | if (!method_info) |
| 215 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Support for %s::%s missing in %s", |
| 216 | interface, method, G_STRLOCcxx . . $ `<external>/12741050725406041920/gmacros.h:928:9`!); |
| 217 | |
| 218 | return method_info ? method_info->uses_requestcxx . . $ $anonymous_type_a4b700419668b39d_0#uses_request. : TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 219 | } |
| 220 | |
| 221 | static gbooleancxx . . $ gboolean# |
| 222 | authorize_callbackcxx . . $ authorize_callback(a372c9f6c5124328). (GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *interface, |
| 223 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 224 | gpointercxx . . $ gpointer# user_data) |
| 225 | { |
| 226 | XdpContextcxx . . $ XdpContext# *context = XDP_CONTEXTcxx . . $ XDP_CONTEXT(136535a435f175a1). (user_data); |
| 227 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpAppInfo) app_info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 228 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 229 | |
| 230 | app_info = xdp_app_info_registry_ensure_for_invocation_synccxx . . $ xdp_app_info_registry_ensure_for_invocation_sync(8a390d254b7e578b). (context->app_info_registrycxx . . $ _XdpContext#app_info_registry., |
| 231 | invocation, |
| 232 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 233 | &error); |
| 234 | if (app_info == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 235 | { |
| 236 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 237 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 238 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 239 | "Portal operation not allowed: %s", error->messagecxx . . $ _GError#message.); |
| 240 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 241 | } |
| 242 | |
| 243 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (invocation), "xdp-app-info", app_info); |
| 244 | |
| 245 | if (method_needs_requestcxx . . $ method_needs_request(4fbb76638ba9977b). (invocation)) |
| 246 | { |
| 247 | if (!xdp_request_init_invocationcxx . . $ xdp_request_init_invocation(cf613f254033935). (invocation, context, app_info, &error)) |
| 248 | { |
| 249 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 250 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 255 | } |
| 256 | |
| 257 | void |
| 258 | xdp_context_take_and_export_portalcxx . . $ xdp_context_take_and_export_portal(54303e2939dd494f). (XdpContextcxx . . $ XdpContext# *context, |
| 259 | GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *skeleton_, |
| 260 | XdpContextExportFlagscxx . . $ XdpContextExportFlags# flags) |
| 261 | { |
| 262 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GDBusInterfaceSkeleton) skeleton = skeleton_; |
| 263 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 264 | const char *name; |
| 265 | |
| 266 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (XDP_IS_CONTEXT (context)); |
| 267 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (G_IS_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:35:9`! (skeleton)); |
| 268 | |
| 269 | name = g_dbus_interface_skeleton_get_infocxx . . $ g_dbus_interface_skeleton_get_info(6bd24842581abba5). (skeleton)->namecxx . . $ _GDBusInterfaceInfo#name.; |
| 270 | |
| 271 | if (!(flags & XDP_CONTEXT_EXPORT_FLAGS_HOST_PORTALcxx . . $ XDP_CONTEXT_EXPORT_FLAGS_HOST_PORTAL.)) |
| 272 | { |
| 273 | /* Host portal dbus method invocations run in the main thread without yielding |
| 274 | * to the main loop. This means that any later method call of any portal will |
| 275 | * see the effects of the host portal method call. |
| 276 | * |
| 277 | * This is important because the Registry modifies the XdpAppInfo and later |
| 278 | * method calls must see the modified value. |
| 279 | */ |
| 280 | |
| 281 | g_dbus_interface_skeleton_set_flagscxx . . $ g_dbus_interface_skeleton_set_flags(9e6b05200e191a32). ( |
| 282 | skeleton, |
| 283 | G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREADcxx . . $ G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD.); |
| 284 | |
| 285 | g_signal_connect_objectcxx . . $ g_signal_connect_object(567cfbe0c886a38e). (skeleton, "g-authorize-method", |
| 286 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (authorize_callback), |
| 287 | context, |
| 288 | G_CONNECT_DEFAULTcxx . . $ G_CONNECT_DEFAULT.); |
| 289 | } |
| 290 | |
| 291 | if (g_dbus_interface_skeleton_exportcxx . . $ g_dbus_interface_skeleton_export(b7cdb5e81947cba7). (skeleton, |
| 292 | context->connectioncxx . . $ _XdpContext#connection., |
| 293 | DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!, |
| 294 | &error)) |
| 295 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("Providing portal %s", name); |
| 296 | else |
| 297 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Exporting portal failed: %s", error->message); |
| 298 | |
| 299 | g_hash_table_insertcxx . . $ g_hash_table_insert(6a7c46015dd5ef26). (context->exported_portalscxx . . $ _XdpContext#exported_portals., |
| 300 | g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (name), |
| 301 | g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&skeleton)); |
| 302 | } |
| 303 | |
| 304 | GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# * |
| 305 | xdp_context_get_portalcxx . . $ xdp_context_get_portal(313a8746cb5c160d). (XdpContextcxx . . $ XdpContext# *context, |
| 306 | const char *interface) |
| 307 | { |
| 308 | return g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (context->exported_portalscxx . . $ _XdpContext#exported_portals., interface); |
| 309 | } |
| 310 | |
| 311 | static void |
| 312 | on_peer_disconnectcxx . . $ on_peer_disconnect(4611f29f2f861a56). (const char *name, |
| 313 | gpointercxx . . $ gpointer# user_data) |
| 314 | { |
| 315 | XdpContextcxx . . $ XdpContext# *context = XDP_CONTEXTcxx . . $ XDP_CONTEXT(136535a435f175a1). (user_data); |
| 316 | |
| 317 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (context, signalscxx . . $ signals.[PEER_DISCONNECTcxx . . $ PEER_DISCONNECT.], 0, name); |
| 318 | |
| 319 | xdp_app_info_registry_deletecxx . . $ xdp_app_info_registry_delete(e0ce5bc68fc09767). (context->app_info_registrycxx . . $ _XdpContext#app_info_registry., name); |
| 320 | } |
| 321 | |
| 322 | gbooleancxx . . $ gboolean# |
| 323 | xdp_context_registercxx . . $ xdp_context_register(2bdac4020e64e657). (XdpContextcxx . . $ XdpContext# *context, |
| 324 | GDBusConnectioncxx . . $ GDBusConnection# *connection, |
| 325 | GErrorcxx . . $ GError# **error) |
| 326 | { |
| 327 | XdpPortalConfigcxx . . $ XdpPortalConfig# *portal_config = context->portal_configcxx . . $ _XdpContext#portal_config.; |
| 328 | XdpImplConfigcxx . . $ XdpImplConfig# *lockdown_impl_config; |
| 329 | XdpImplConfigcxx . . $ XdpImplConfig# *access_impl_config; |
| 330 | GQuarkcxx . . $ GQuark# portal_errors G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`!; |
| 331 | |
| 332 | /* make sure errors are registered */ |
| 333 | portal_errors = XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!; |
| 334 | |
| 335 | g_set_objectcxx . . $ `<external>/1341695927569185362/gobject.h:762:9`! (&context->connection, connection); |
| 336 | |
| 337 | context->peer_disconnect_handle_idcxx . . $ _XdpContext#peer_disconnect_handle_id. = |
| 338 | xdp_connection_track_peer_disconnectcxx . . $ xdp_connection_track_peer_disconnect(e6f369cc4a2ac753). (connection, |
| 339 | on_peer_disconnectcxx . . $ on_peer_disconnect(4611f29f2f861a56)., |
| 340 | context); |
| 341 | |
| 342 | if (!xdp_init_permission_storecxx . . $ xdp_init_permission_store(3bd67427cbb778d0). (connection, error)) |
| 343 | { |
| 344 | g_prefix_error_literalcxx . . $ g_prefix_error_literal(da9e69cb796d59ed). (error, "No permission store: "); |
| 345 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 346 | } |
| 347 | |
| 348 | if (!xdp_init_document_proxycxx . . $ xdp_init_document_proxy(3bd67427cbb778d0). (connection, error)) |
| 349 | { |
| 350 | g_prefix_error_literalcxx . . $ g_prefix_error_literal(da9e69cb796d59ed). (error, "No document portal: "); |
| 351 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 352 | } |
| 353 | |
| 354 | lockdown_impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (portal_config, LOCKDOWN_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:51:9`!); |
| 355 | if (lockdown_impl_config != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 356 | { |
| 357 | context->lockdown_implcxx . . $ _XdpContext#lockdown_impl. = |
| 358 | xdp_dbus_impl_lockdown_proxy_new_synccxx . . $ xdp_dbus_impl_lockdown_proxy_new_sync(4275cbf2d3f78534). (connection, |
| 359 | G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE., |
| 360 | lockdown_impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name., |
| 361 | DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!, |
| 362 | 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`!); |
| 363 | } |
| 364 | |
| 365 | if (context->lockdown_implcxx . . $ _XdpContext#lockdown_impl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 366 | context->lockdown_implcxx . . $ _XdpContext#lockdown_impl. = xdp_dbus_impl_lockdown_skeleton_newcxx . . $ xdp_dbus_impl_lockdown_skeleton_new(1b8b8b6a717261). (); |
| 367 | |
| 368 | access_impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (portal_config, ACCESS_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:49:9`!); |
| 369 | if (access_impl_config != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 370 | { |
| 371 | context->access_implcxx . . $ _XdpContext#access_impl. = |
| 372 | xdp_dbus_impl_access_proxy_new_synccxx . . $ xdp_dbus_impl_access_proxy_new_sync(9e184c7775ccd278). (connection, |
| 373 | G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE., |
| 374 | access_impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name., |
| 375 | DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!, |
| 376 | 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 | } |
| 378 | |
| 379 | if (context->access_implcxx . . $ _XdpContext#access_impl.) |
| 380 | { |
| 381 | g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (context->access_impl), |
| 382 | G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!); |
| 383 | } |
| 384 | |
| 385 | init_memory_monitorcxx . . $ init_memory_monitor(7d190a42f72e5c4f). (context); |
| 386 | init_power_profile_monitorcxx . . $ init_power_profile_monitor(7d190a42f72e5c4f). (context); |
| 387 | init_network_monitorcxx . . $ init_network_monitor(7d190a42f72e5c4f). (context); |
| 388 | init_proxy_resolvercxx . . $ init_proxy_resolver(7d190a42f72e5c4f). (context); |
| 389 | init_trashcxx . . $ init_trash(7d190a42f72e5c4f). (context); |
| 390 | init_game_modecxx . . $ init_game_mode(7d190a42f72e5c4f). (context); |
| 391 | init_realtimecxx . . $ init_realtime(7d190a42f72e5c4f). (context); |
| 392 | init_settingscxx . . $ init_settings(7d190a42f72e5c4f). (context); |
| 393 | init_file_choosercxx . . $ init_file_chooser(7d190a42f72e5c4f). (context); |
| 394 | init_open_uricxx . . $ init_open_uri(7d190a42f72e5c4f). (context); |
| 395 | init_printcxx . . $ init_print(7d190a42f72e5c4f). (context); |
| 396 | init_notificationcxx . . $ init_notification(7d190a42f72e5c4f). (context); |
| 397 | init_inhibitcxx . . $ init_inhibit(7d190a42f72e5c4f). (context); |
| 398 | #if HAVE_GEOCLUEcxx . . $ `build/config.h:14:9`! |
| 399 | init_locationcxx . . $ init_location(7d190a42f72e5c4f). (context); |
| 400 | #endif |
| 401 | init_cameracxx . . $ init_camera(7d190a42f72e5c4f). (context); |
| 402 | init_screenshotcxx . . $ init_screenshot(7d190a42f72e5c4f). (context); |
| 403 | init_backgroundcxx . . $ init_background(7d190a42f72e5c4f). (context); |
| 404 | init_wallpapercxx . . $ init_wallpaper(7d190a42f72e5c4f). (context); |
| 405 | init_accountcxx . . $ init_account(7d190a42f72e5c4f). (context); |
| 406 | init_emailcxx . . $ init_email(7d190a42f72e5c4f). (context); |
| 407 | init_secretcxx . . $ init_secret(999245e24d7406e). (context, context->cancellablecxx . . $ _XdpContext#cancellable.); |
| 408 | init_global_shortcutscxx . . $ init_global_shortcuts(7d190a42f72e5c4f). (context); |
| 409 | init_dynamic_launchercxx . . $ init_dynamic_launcher(7d190a42f72e5c4f). (context); |
| 410 | init_screen_castcxx . . $ init_screen_cast(7d190a42f72e5c4f). (context); |
| 411 | init_remote_desktopcxx . . $ init_remote_desktop(7d190a42f72e5c4f). (context); |
| 412 | init_clipboardcxx . . $ init_clipboard(7d190a42f72e5c4f). (context); |
| 413 | init_input_capturecxx . . $ init_input_capture(7d190a42f72e5c4f). (context); |
| 414 | #if HAVE_GUDEVcxx . . $ `build/config.h:16:9`! |
| 415 | init_usbcxx . . $ init_usb(7d190a42f72e5c4f). (context); |
| 416 | #endif |
| 417 | init_registrycxx . . $ init_registry(7d190a42f72e5c4f). (context); |
| 418 | |
| 419 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 420 | } |
| 421 | |
| 422 | gbooleancxx . . $ gboolean# |
| 423 | xdp_context_claim_object_pathcxx . . $ xdp_context_claim_object_path(738797183355f6b2). (XdpContextcxx . . $ XdpContext# *context, |
| 424 | const char *object_path) |
| 425 | { |
| 426 | G_MUTEX_AUTO_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:429:9`! (&context->registered_object_paths_lock, locker); |
| 427 | |
| 428 | if (g_hash_table_containscxx . . $ g_hash_table_contains(453ebbf4abdbe50e). (context->registered_object_pathscxx . . $ _XdpContext#registered_object_paths., object_path)) |
| 429 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 430 | |
| 431 | g_hash_table_addcxx . . $ g_hash_table_add(69c5b3b3568d4848). (context->registered_object_pathscxx . . $ _XdpContext#registered_object_paths., |
| 432 | g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (object_path)); |
| 433 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 434 | } |
| 435 | |
| 436 | void |
| 437 | xdp_context_unclaim_object_pathcxx . . $ xdp_context_unclaim_object_path(d5f567db9407aaf). (XdpContextcxx . . $ XdpContext# *context, |
| 438 | const char *object_path) |
| 439 | { |
| 440 | G_MUTEX_AUTO_LOCKcxx . . $ `<external>/457917468643292165/gthread.h:429:9`! (&context->registered_object_paths_lock, locker); |
| 441 | |
| 442 | g_hash_table_removecxx . . $ g_hash_table_remove(453ebbf4abdbe50e). (context->registered_object_pathscxx . . $ _XdpContext#registered_object_paths., object_path); |
| 443 | } |