| 1 | /* |
| 2 | * Copyright © 2017-2018 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 | |
| 21 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 22 | |
| 23 | #include "screen-cast.h"cxx . . $ `<file>/src/screen-cast.h`/ |
| 24 | |
| 25 | #include <stdint.h> |
| 26 | |
| 27 | #include <gio/gunixfdlist.h> |
| 28 | #include <pipewire/pipewire.h> |
| 29 | |
| 30 | #include "pipewire.h"cxx . . $ `<file>/src/pipewire.h`/ |
| 31 | #include "remote-desktop.h"cxx . . $ `<file>/src/remote-desktop.h`/ |
| 32 | #include "xdp-context.h"cxx . . $ `<file>/src/xdp-context.h`/ |
| 33 | #include "xdp-dbus.h"cxx . . $ `<file>/build/src/xdp-dbus.h`/ |
| 34 | #include "xdp-impl-dbus.h"cxx . . $ `<file>/build/src/xdp-impl-dbus.h`/ |
| 35 | #include "xdp-permissions.h"cxx . . $ `<file>/src/xdp-permissions.h`/ |
| 36 | #include "xdp-portal-config.h"cxx . . $ `<file>/src/xdp-portal-config.h`/ |
| 37 | #include "xdp-request.h"cxx . . $ `<file>/src/xdp-request.h`/ |
| 38 | #include "xdp-session-persistence.h"cxx . . $ `<file>/src/xdp-session-persistence.h`/ |
| 39 | #include "xdp-session.h"cxx . . $ `<file>/src/xdp-session.h`/ |
| 40 | #include "xdp-utils.h"cxx . . $ `<file>/src/xdp-utils.h`/ |
| 41 | |
| 42 | #define PERMISSION_ITEMcxx . . $ `src/screen-cast.c:42:9`!(item_id, item_permissions) \ |
| 43 | ((struct pw_permission) { \ |
| 44 | .id = item_id, \ |
| 45 | .permissions = item_permissions \ |
| 46 | }) |
| 47 | |
| 48 | typedef struct _ScreenCastcxx . . $ _ScreenCast# ScreenCastcxx . . $ ScreenCast#; |
| 49 | typedef struct _ScreenCastClasscxx . . $ _ScreenCastClass# ScreenCastClasscxx . . $ ScreenCastClass#; |
| 50 | |
| 51 | struct _ScreenCastcxx . . $ _ScreenCast# |
| 52 | { |
| 53 | XdpDbusScreenCastSkeletoncxx . . $ XdpDbusScreenCastSkeleton# parent_instancecxx . . $ _ScreenCast#parent_instance.; |
| 54 | |
| 55 | XdpContextcxx . . $ XdpContext# *contextcxx . . $ _ScreenCast#context.; |
| 56 | XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *implcxx . . $ _ScreenCast#impl.; |
| 57 | }; |
| 58 | |
| 59 | struct _ScreenCastClasscxx . . $ _ScreenCastClass# |
| 60 | { |
| 61 | XdpDbusScreenCastSkeletonClasscxx . . $ XdpDbusScreenCastSkeletonClass# parent_classcxx . . $ _ScreenCastClass#parent_class.; |
| 62 | }; |
| 63 | |
| 64 | GTypecxx . . $ GType# screen_cast_get_typecxx . . $ screen_cast_get_type(f708dce9a8856c70). (void); |
| 65 | static void screen_cast_iface_initcxx . . $ screen_cast_iface_init(b05585cbe7d1f075). (XdpDbusScreenCastIfacecxx . . $ XdpDbusScreenCastIface# *iface); |
| 66 | |
| 67 | static GQuarkcxx . . $ GQuark# quark_request_sessioncxx . . $ quark_request_session.; |
| 68 | |
| 69 | struct _ScreenCastStreamcxx . . $ _ScreenCastStream# |
| 70 | { |
| 71 | uint32_tcxx . . $ uint32_t# idcxx . . $ _ScreenCastStream#id.; |
| 72 | int32_tcxx . . $ int32_t# widthcxx . . $ _ScreenCastStream#width.; |
| 73 | int32_tcxx . . $ int32_t# heightcxx . . $ _ScreenCastStream#height.; |
| 74 | uint64_tcxx . . $ uint64_t# pipewire_serialcxx . . $ _ScreenCastStream#pipewire_serial.; |
| 75 | gbooleancxx . . $ gboolean# has_pipewire_serialcxx . . $ _ScreenCastStream#has_pipewire_serial.; |
| 76 | }; |
| 77 | |
| 78 | G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (ScreenCast, screen_cast, |
| 79 | XDP_DBUS_TYPE_SCREEN_CAST_SKELETONcxx . . $ `build/src/xdp-dbus.h:7265:9`!, |
| 80 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (XDP_DBUS_TYPE_SCREEN_CASTcxx . . $ `build/src/xdp-dbus.h:7006:9`!, |
| 81 | screen_cast_iface_init)); |
| 82 | |
| 83 | G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (ScreenCast, g_object_unref) |
| 84 | |
| 85 | typedef enum _ScreenCastSessionStatecxx . . $ _ScreenCastSessionState# |
| 86 | { |
| 87 | SCREEN_CAST_SESSION_STATE_INITcxx . . $ SCREEN_CAST_SESSION_STATE_INIT., |
| 88 | SCREEN_CAST_SESSION_STATE_SELECTING_SOURCEScxx . . $ SCREEN_CAST_SESSION_STATE_SELECTING_SOURCES., |
| 89 | SCREEN_CAST_SESSION_STATE_SOURCES_SELECTEDcxx . . $ SCREEN_CAST_SESSION_STATE_SOURCES_SELECTED., |
| 90 | SCREEN_CAST_SESSION_STATE_STARTINGcxx . . $ SCREEN_CAST_SESSION_STATE_STARTING., |
| 91 | SCREEN_CAST_SESSION_STATE_STARTEDcxx . . $ SCREEN_CAST_SESSION_STATE_STARTED., |
| 92 | SCREEN_CAST_SESSION_STATE_CLOSEDcxx . . $ SCREEN_CAST_SESSION_STATE_CLOSED. |
| 93 | } ScreenCastSessionStatecxx . . $ ScreenCastSessionState#; |
| 94 | |
| 95 | typedef struct _ScreenCastSessioncxx . . $ _ScreenCastSession# |
| 96 | { |
| 97 | XdpSessioncxx . . $ XdpSession# parentcxx . . $ _ScreenCastSession#parent.; |
| 98 | |
| 99 | ScreenCastSessionStatecxx . . $ ScreenCastSessionState# statecxx . . $ _ScreenCastSession#state.; |
| 100 | |
| 101 | GListcxx . . $ GList# *streamscxx . . $ _ScreenCastSession#streams.; |
| 102 | char *restore_tokencxx . . $ _ScreenCastSession#restore_token.; |
| 103 | XdpSessionPersistenceModecxx . . $ XdpSessionPersistenceMode# persist_modecxx . . $ _ScreenCastSession#persist_mode.; |
| 104 | GVariantcxx . . $ GVariant# *restore_datacxx . . $ _ScreenCastSession#restore_data.; |
| 105 | } ScreenCastSessioncxx . . $ ScreenCastSession#; |
| 106 | |
| 107 | typedef struct _ScreenCastSessionClasscxx . . $ _ScreenCastSessionClass# |
| 108 | { |
| 109 | XdpSessionClasscxx . . $ XdpSessionClass# parent_classcxx . . $ _ScreenCastSessionClass#parent_class.; |
| 110 | } ScreenCastSessionClasscxx . . $ ScreenCastSessionClass#; |
| 111 | |
| 112 | GTypecxx . . $ GType# screen_cast_session_get_typecxx . . $ screen_cast_session_get_type(f708dce9a8856c70). (void); |
| 113 | |
| 114 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (ScreenCastSession, screen_cast_session, xdp_session_get_type ()) |
| 115 | |
| 116 | G_DEFINE_AUTOPTR_CLEANUP_FUNCcxx . . $ `<external>/12741050725406041920/gmacros.h:1414:9`! (ScreenCastSession, g_object_unref); |
| 117 | |
| 118 | G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! static inline ScreenCastSessioncxx . . $ ScreenCastSession# * |
| 119 | SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (gpointercxx . . $ gpointer# ptr) |
| 120 | { |
| 121 | return G_TYPE_CHECK_INSTANCE_CASTcxx . . $ `<external>/9567554376676449156/gtype.h:528:9`! (ptr, screen_cast_session_get_type (), ScreenCastSession); |
| 122 | } |
| 123 | |
| 124 | G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! static inline gbooleancxx . . $ gboolean# |
| 125 | IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (gpointercxx . . $ gpointer# ptr) |
| 126 | { |
| 127 | return G_TYPE_CHECK_INSTANCE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:541:9`! (ptr, screen_cast_session_get_type ()); |
| 128 | } |
| 129 | |
| 130 | static void |
| 131 | screen_cast_session_closecxx . . $ screen_cast_session_close(ac695378ab375fe8). (XdpSessioncxx . . $ XdpSession# *session) |
| 132 | { |
| 133 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 134 | |
| 135 | screen_cast_session->statecxx . . $ _ScreenCastSession#state. = SCREEN_CAST_SESSION_STATE_CLOSEDcxx . . $ SCREEN_CAST_SESSION_STATE_CLOSED.; |
| 136 | |
| 137 | xdp_session_persistence_generate_and_save_restore_tokencxx . . $ xdp_session_persistence_generate_and_save_restore_token(2087e7161d3dc2ca). (session, |
| 138 | SCREEN_CAST_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:125:9`!, |
| 139 | screen_cast_session->persist_modecxx . . $ _ScreenCastSession#persist_mode., |
| 140 | &screen_cast_session->restore_tokencxx . . $ _ScreenCastSession#restore_token., |
| 141 | &screen_cast_session->restore_datacxx . . $ _ScreenCastSession#restore_data.); |
| 142 | |
| 143 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("screen cast session owned by '%s' closed", session->sender); |
| 144 | } |
| 145 | |
| 146 | static void |
| 147 | screen_cast_session_finalizecxx . . $ screen_cast_session_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 148 | { |
| 149 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (object); |
| 150 | |
| 151 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&screen_cast_session->restore_token, g_free); |
| 152 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&screen_cast_session->restore_data, g_variant_unref); |
| 153 | |
| 154 | g_list_free_fullcxx . . $ g_list_free_full(5ba5b0738c7ed753). (screen_cast_session->streamscxx . . $ _ScreenCastSession#streams., |
| 155 | (GDestroyNotifycxx . . $ GDestroyNotify#)screen_cast_stream_freecxx . . $ screen_cast_stream_free(6f144c91b7a728b0).); |
| 156 | |
| 157 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (screen_cast_session_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 158 | } |
| 159 | |
| 160 | static void |
| 161 | screen_cast_session_initcxx . . $ screen_cast_session_init(801da160860b872a). (ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session) |
| 162 | { |
| 163 | } |
| 164 | |
| 165 | static void |
| 166 | screen_cast_session_class_initcxx . . $ screen_cast_session_class_init(11552f3536b760d6). (ScreenCastSessionClasscxx . . $ ScreenCastSessionClass# *klass) |
| 167 | { |
| 168 | GObjectClasscxx . . $ GObjectClass# *object_class; |
| 169 | XdpSessionClasscxx . . $ XdpSessionClass# *session_class; |
| 170 | |
| 171 | object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 172 | object_class->finalizecxx . . $ _GObjectClass#finalize. = screen_cast_session_finalizecxx . . $ screen_cast_session_finalize(6087475fa43034d3).; |
| 173 | |
| 174 | session_class = (XdpSessionClasscxx . . $ XdpSessionClass# *)klass; |
| 175 | session_class->closecxx . . $ _XdpSessionClass#close. = screen_cast_session_closecxx . . $ screen_cast_session_close(ac695378ab375fe8).; |
| 176 | } |
| 177 | |
| 178 | static ScreenCastSessioncxx . . $ ScreenCastSession# * |
| 179 | screen_cast_session_newcxx . . $ screen_cast_session_new(350abe410ff0427b). (ScreenCastcxx . . $ ScreenCast# *screen_cast, |
| 180 | GVariantcxx . . $ GVariant# *options, |
| 181 | XdpRequestcxx . . $ XdpRequest# *request, |
| 182 | GErrorcxx . . $ GError# **error) |
| 183 | { |
| 184 | XdpSessioncxx . . $ XdpSession# *session; |
| 185 | GDBusInterfaceSkeletoncxx . . $ GDBusInterfaceSkeleton# *interface_skeleton = |
| 186 | G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (request); |
| 187 | const char *session_token; |
| 188 | GDBusConnectioncxx . . $ GDBusConnection# *connection = |
| 189 | g_dbus_interface_skeleton_get_connectioncxx . . $ g_dbus_interface_skeleton_get_connection(b3e1a9aea5de7a42). (interface_skeleton); |
| 190 | GDBusConnectioncxx . . $ GDBusConnection# *impl_connection = |
| 191 | g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)); |
| 192 | const char *impl_dbus_name = |
| 193 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)); |
| 194 | |
| 195 | session_token = lookup_session_tokencxx . . $ lookup_session_token(d2704f6d4d26effc). (options); |
| 196 | session = g_initable_newcxx . . $ g_initable_new(a8cb3f520296c554). (screen_cast_session_get_typecxx . . $ screen_cast_session_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, error, |
| 197 | "context", screen_cast->contextcxx . . $ _ScreenCast#context., |
| 198 | "sender", request->sendercxx . . $ _XdpRequest#sender., |
| 199 | "app-id", xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), |
| 200 | "token", session_token, |
| 201 | "connection", connection, |
| 202 | "impl-connection", impl_connection, |
| 203 | "impl-dbus-name", impl_dbus_name, |
| 204 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 205 | |
| 206 | if (session) |
| 207 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("screen cast session owned by '%s' created", session->sender); |
| 208 | |
| 209 | return (ScreenCastSessioncxx . . $ ScreenCastSession#*)session; |
| 210 | } |
| 211 | |
| 212 | static void |
| 213 | create_session_donecxx . . $ create_session_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source_object, |
| 214 | GAsyncResultcxx . . $ GAsyncResult# *res, |
| 215 | gpointercxx . . $ gpointer# data) |
| 216 | { |
| 217 | XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *impl = (XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *) source_object; |
| 218 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 219 | XdpSessioncxx . . $ XdpSession# *session; |
| 220 | guintcxx . . $ guint# response = 2; |
| 221 | gbooleancxx . . $ gboolean# should_close_session; |
| 222 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) results_builder = |
| 223 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 224 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 225 | |
| 226 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 227 | |
| 228 | session = g_object_get_qdatacxx . . $ g_object_get_qdata(b02fb2b4fc775a4). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session.); |
| 229 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session)); |
| 230 | g_object_set_qdatacxx . . $ g_object_set_qdata(d7e2e719dfad0cc9). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 231 | |
| 232 | if (!xdp_dbus_impl_screen_cast_call_create_session_finishcxx . . $ xdp_dbus_impl_screen_cast_call_create_session_finish(5828a69a9383c9eb). (impl, |
| 233 | &response, |
| 234 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 235 | res, |
| 236 | &error)) |
| 237 | { |
| 238 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 239 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message); |
| 240 | should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 241 | goto out; |
| 242 | } |
| 243 | |
| 244 | if (request->exportedcxx . . $ _XdpRequest#exported. && response == 0) |
| 245 | { |
| 246 | if (!xdp_session_exportcxx . . $ xdp_session_export(3c2cf3f1073dc4c7). (session, &error)) |
| 247 | { |
| 248 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to export session: %s", error->message); |
| 249 | response = 2; |
| 250 | should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 251 | goto out; |
| 252 | } |
| 253 | |
| 254 | should_close_session = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 255 | xdp_session_registercxx . . $ xdp_session_register(ac695378ab375fe8). (session); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 260 | } |
| 261 | |
| 262 | g_variant_builder_addcxx . . $ g_variant_builder_add(a422658e2ec2035a). (&results_builder, "{sv}", |
| 263 | "session_handle", g_variant_new_stringcxx . . $ g_variant_new_string(8d35775da1697fc2). (session->idcxx . . $ _XdpSession#id.)); |
| 264 | |
| 265 | out: |
| 266 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 267 | { |
| 268 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request), |
| 269 | response, |
| 270 | g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&results_builder)); |
| 271 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 272 | } |
| 273 | |
| 274 | if (should_close_session) |
| 275 | xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 276 | } |
| 277 | |
| 278 | static gbooleancxx . . $ gboolean# |
| 279 | handle_create_sessioncxx . . $ handle_create_session(a765910a66dfd28d). (XdpDbusScreenCastcxx . . $ XdpDbusScreenCast# *object, |
| 280 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 281 | GVariantcxx . . $ GVariant# *arg_options) |
| 282 | { |
| 283 | ScreenCastcxx . . $ ScreenCast# *screen_cast = (ScreenCastcxx . . $ ScreenCast# *) object; |
| 284 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 285 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 286 | 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`!; |
| 287 | XdpSessioncxx . . $ XdpSession# *session; |
| 288 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) options_builder = |
| 289 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 290 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 291 | |
| 292 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 293 | |
| 294 | impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). ( |
| 295 | g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 296 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 297 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 298 | request->idcxx . . $ _XdpRequest#id., |
| 299 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 300 | |
| 301 | if (!impl_request) |
| 302 | { |
| 303 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 304 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 305 | } |
| 306 | |
| 307 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 308 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 309 | |
| 310 | session = XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (screen_cast_session_newcxx . . $ screen_cast_session_new(350abe410ff0427b). (screen_cast, |
| 311 | arg_options, |
| 312 | request, |
| 313 | &error)); |
| 314 | if (!session) |
| 315 | { |
| 316 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 317 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 318 | } |
| 319 | |
| 320 | options = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&options_builder)); |
| 321 | |
| 322 | g_object_set_qdata_fullcxx . . $ g_object_set_qdata_full(65a765778c030710). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), |
| 323 | quark_request_sessioncxx . . $ quark_request_session., |
| 324 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session), |
| 325 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 326 | |
| 327 | xdp_dbus_impl_screen_cast_call_create_sessioncxx . . $ xdp_dbus_impl_screen_cast_call_create_session(b0149c26f3691655). (screen_cast->implcxx . . $ _ScreenCast#impl., |
| 328 | request->idcxx . . $ _XdpRequest#id., |
| 329 | session->idcxx . . $ _XdpSession#id., |
| 330 | xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), |
| 331 | options, |
| 332 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 333 | create_session_donecxx . . $ create_session_done(aa1d200d824d915d)., |
| 334 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 335 | |
| 336 | xdp_dbus_screen_cast_complete_create_sessioncxx . . $ xdp_dbus_screen_cast_complete_create_session(861177f24bec6f0a). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 337 | |
| 338 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 339 | } |
| 340 | |
| 341 | static void |
| 342 | select_sources_donecxx . . $ select_sources_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source_object, |
| 343 | GAsyncResultcxx . . $ GAsyncResult# *res, |
| 344 | gpointercxx . . $ gpointer# data) |
| 345 | { |
| 346 | XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *impl = (XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *) source_object; |
| 347 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 348 | XdpSessioncxx . . $ XdpSession# *session; |
| 349 | guintcxx . . $ guint# response = 2; |
| 350 | gbooleancxx . . $ gboolean# should_close_session; |
| 351 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 352 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) results = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 353 | |
| 354 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 355 | |
| 356 | session = g_object_get_qdatacxx . . $ g_object_get_qdata(b02fb2b4fc775a4). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session.); |
| 357 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session)); |
| 358 | g_object_set_qdatacxx . . $ g_object_set_qdata(d7e2e719dfad0cc9). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 359 | |
| 360 | if (!xdp_dbus_impl_screen_cast_call_select_sources_finishcxx . . $ xdp_dbus_impl_screen_cast_call_select_sources_finish(5828a69a9383c9eb). (impl, |
| 361 | &response, |
| 362 | &results, |
| 363 | res, |
| 364 | &error)) |
| 365 | { |
| 366 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 367 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message); |
| 368 | } |
| 369 | |
| 370 | should_close_session = !request->exportedcxx . . $ _XdpRequest#exported. || response != 0; |
| 371 | |
| 372 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 373 | { |
| 374 | if (!results) |
| 375 | { |
| 376 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) results_builder = |
| 377 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 378 | |
| 379 | results = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&results_builder)); |
| 380 | } |
| 381 | |
| 382 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request), response, results); |
| 383 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 384 | } |
| 385 | |
| 386 | if (should_close_session) |
| 387 | { |
| 388 | xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 389 | } |
| 390 | else if (!session->closedcxx . . $ _XdpSession#closed.) |
| 391 | { |
| 392 | if (IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (session)) |
| 393 | { |
| 394 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 395 | |
| 396 | g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:72:9`! (screen_cast_session->state, |
| 397 | ==, |
| 398 | SCREEN_CAST_SESSION_STATE_SELECTING_SOURCES); |
| 399 | screen_cast_session->statecxx . . $ _ScreenCastSession#state. = SCREEN_CAST_SESSION_STATE_SOURCES_SELECTEDcxx . . $ SCREEN_CAST_SESSION_STATE_SOURCES_SELECTED.; |
| 400 | } |
| 401 | else if (IS_REMOTE_DESKTOP_SESSIONcxx . . $ IS_REMOTE_DESKTOP_SESSION(dedf1e9b1c614a07). (session)) |
| 402 | { |
| 403 | RemoteDesktopSessioncxx . . $ RemoteDesktopSession# *remote_desktop_session = |
| 404 | REMOTE_DESKTOP_SESSIONcxx . . $ REMOTE_DESKTOP_SESSION(288c4d99424a6019). (session); |
| 405 | |
| 406 | remote_desktop_session_sources_selectedcxx . . $ remote_desktop_session_sources_selected(514f1520aeba67af). (remote_desktop_session); |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | static gbooleancxx . . $ gboolean# |
| 412 | validate_source_typescxx . . $ validate_source_types(c4684b9d3da33c87). (const char *key, |
| 413 | GVariantcxx . . $ GVariant# *value, |
| 414 | GVariantcxx . . $ GVariant# *options, |
| 415 | gpointercxx . . $ gpointer# user_data, |
| 416 | GErrorcxx . . $ GError# **error) |
| 417 | { |
| 418 | guint32cxx . . $ guint32# types = g_variant_get_uint32cxx . . $ g_variant_get_uint32(59fb6aaaf011986f). (value); |
| 419 | |
| 420 | if ((types & ~(1 | 2 | 4)) != 0) |
| 421 | { |
| 422 | 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., |
| 423 | "Unsupported device type: %x", types & ~(1 | 2 | 4)); |
| 424 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 425 | } |
| 426 | |
| 427 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 428 | } |
| 429 | |
| 430 | static gbooleancxx . . $ gboolean# |
| 431 | validate_cursor_modecxx . . $ validate_cursor_mode(c4684b9d3da33c87). (const char *key, |
| 432 | GVariantcxx . . $ GVariant# *value, |
| 433 | GVariantcxx . . $ GVariant# *options, |
| 434 | gpointercxx . . $ gpointer# user_data, |
| 435 | GErrorcxx . . $ GError# **error) |
| 436 | { |
| 437 | ScreenCastcxx . . $ ScreenCast# *screen_cast = user_data; |
| 438 | uint32_tcxx . . $ uint32_t# available_cursor_modes = |
| 439 | xdp_dbus_screen_cast_get_available_cursor_modescxx . . $ xdp_dbus_screen_cast_get_available_cursor_modes(64dbd341d0376bdb). (XDP_DBUS_SCREEN_CASTcxx . . $ `build/src/xdp-dbus.h:7007:9`! (screen_cast)); |
| 440 | uint32_tcxx . . $ uint32_t# mode = g_variant_get_uint32cxx . . $ g_variant_get_uint32(59fb6aaaf011986f). (value); |
| 441 | |
| 442 | if (__builtin_popcountcxx . . $ __builtin_popcount(4c679297bf94b9eb). (mode) != 1) |
| 443 | { |
| 444 | 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., |
| 445 | "Invalid cursor mode %x", mode); |
| 446 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 447 | } |
| 448 | |
| 449 | if (!(available_cursor_modes & mode)) |
| 450 | { |
| 451 | 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., |
| 452 | "Unavailable cursor mode %x", mode); |
| 453 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 454 | } |
| 455 | |
| 456 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 457 | } |
| 458 | |
| 459 | static gbooleancxx . . $ gboolean# |
| 460 | validate_restore_tokencxx . . $ validate_restore_token(c4684b9d3da33c87). (const char *key, |
| 461 | GVariantcxx . . $ GVariant# *value, |
| 462 | GVariantcxx . . $ GVariant# *options, |
| 463 | gpointercxx . . $ gpointer# user_data, |
| 464 | GErrorcxx . . $ GError# **error) |
| 465 | { |
| 466 | const char *restore_token = g_variant_get_stringcxx . . $ g_variant_get_string(5d5cac9792ea78b8). (value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 467 | return xdp_session_persistence_validate_restore_tokencxx . . $ xdp_session_persistence_validate_restore_token(5dde6684fab02cd7). (restore_token, error); |
| 468 | } |
| 469 | |
| 470 | static gbooleancxx . . $ gboolean# |
| 471 | validate_persist_modecxx . . $ validate_persist_mode(c4684b9d3da33c87). (const char *key, |
| 472 | GVariantcxx . . $ GVariant# *value, |
| 473 | GVariantcxx . . $ GVariant# *options, |
| 474 | gpointercxx . . $ gpointer# user_data, |
| 475 | GErrorcxx . . $ GError# **error) |
| 476 | { |
| 477 | return xdp_session_persistence_validate_persist_modecxx . . $ xdp_session_persistence_validate_persist_mode(4307366c3e94ee1c). (g_variant_get_uint32cxx . . $ g_variant_get_uint32(59fb6aaaf011986f). (value), |
| 478 | error); |
| 479 | } |
| 480 | |
| 481 | |
| 482 | static XdpOptionKeycxx . . $ XdpOptionKey# screen_cast_select_sources_optionscxx . . $ screen_cast_select_sources_options.[] = { |
| 483 | { "types", G_VARIANT_TYPE_UINT32cxx . . $ `<external>/14064154155447831270/gvarianttype.h:81:9`!, validate_source_typescxx . . $ validate_source_types(c4684b9d3da33c87). }, |
| 484 | { "multiple", G_VARIANT_TYPE_BOOLEANcxx . . $ `<external>/14064154155447831270/gvarianttype.h:41:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }, |
| 485 | { "cursor_mode", G_VARIANT_TYPE_UINT32cxx . . $ `<external>/14064154155447831270/gvarianttype.h:81:9`!, validate_cursor_modecxx . . $ validate_cursor_mode(c4684b9d3da33c87). }, |
| 486 | { "restore_token", G_VARIANT_TYPE_STRINGcxx . . $ `<external>/14064154155447831270/gvarianttype.h:122:9`!, validate_restore_tokencxx . . $ validate_restore_token(c4684b9d3da33c87). }, |
| 487 | { "persist_mode", G_VARIANT_TYPE_UINT32cxx . . $ `<external>/14064154155447831270/gvarianttype.h:81:9`!, validate_persist_modecxx . . $ validate_persist_mode(c4684b9d3da33c87). }, |
| 488 | }; |
| 489 | |
| 490 | static gbooleancxx . . $ gboolean# |
| 491 | replace_screen_cast_restore_token_with_datacxx . . $ replace_screen_cast_restore_token_with_data(bf2d3316eec98cc9). (XdpSessioncxx . . $ XdpSession# *session, |
| 492 | GVariantcxx . . $ GVariant# **in_out_options, |
| 493 | GErrorcxx . . $ GError# **error) |
| 494 | { |
| 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 | XdpSessionPersistenceModecxx . . $ XdpSessionPersistenceMode# persist_mode; |
| 497 | |
| 498 | options = *in_out_options; |
| 499 | |
| 500 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (options, "persist_mode", "u", &persist_mode)) |
| 501 | persist_mode = XDP_SESSION_PERSISTENCE_MODE_NONEcxx . . $ XDP_SESSION_PERSISTENCE_MODE_NONE.; |
| 502 | |
| 503 | if (IS_REMOTE_DESKTOP_SESSIONcxx . . $ IS_REMOTE_DESKTOP_SESSION(dedf1e9b1c614a07). (session)) |
| 504 | { |
| 505 | if (persist_mode != XDP_SESSION_PERSISTENCE_MODE_NONEcxx . . $ XDP_SESSION_PERSISTENCE_MODE_NONE. || |
| 506 | xdp_variant_contains_keycxx . . $ xdp_variant_contains_key(3acb228297ef692c). (options, "restore_token")) |
| 507 | { |
| 508 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 509 | XDG_DESKTOP_PORTAL_ERRORcxx . . $ `src/xdp-utils.h:115:9`!, |
| 510 | XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENTcxx . . $ XDG_DESKTOP_PORTAL_ERROR_INVALID_ARGUMENT., |
| 511 | "Remote desktop sessions cannot persist"); |
| 512 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | if (IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (session)) |
| 517 | { |
| 518 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 519 | |
| 520 | screen_cast_session->persist_modecxx . . $ _ScreenCastSession#persist_mode. = persist_mode; |
| 521 | xdp_session_persistence_replace_restore_token_with_datacxx . . $ xdp_session_persistence_replace_restore_token_with_data(6fd49f6574b5027b). (session, |
| 522 | SCREEN_CAST_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:125:9`!, |
| 523 | in_out_options, |
| 524 | &screen_cast_session->restore_tokencxx . . $ _ScreenCastSession#restore_token.); |
| 525 | } |
| 526 | else |
| 527 | { |
| 528 | *in_out_options = g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&options); |
| 529 | } |
| 530 | |
| 531 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 532 | } |
| 533 | |
| 534 | static gbooleancxx . . $ gboolean# |
| 535 | handle_select_sourcescxx . . $ handle_select_sources(953bc2dbf00a1a9e). (XdpDbusScreenCastcxx . . $ XdpDbusScreenCast# *object, |
| 536 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 537 | const char *arg_session_handle, |
| 538 | GVariantcxx . . $ GVariant# *arg_options) |
| 539 | { |
| 540 | ScreenCastcxx . . $ ScreenCast# *screen_cast = (ScreenCastcxx . . $ ScreenCast# *) object; |
| 541 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 542 | XdpSessioncxx . . $ XdpSession# *session; |
| 543 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 544 | 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`!; |
| 545 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) options_builder = |
| 546 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 547 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 548 | |
| 549 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 550 | |
| 551 | session = xdp_session_from_requestcxx . . $ xdp_session_from_request(b20d0b7552200bd). (arg_session_handle, request); |
| 552 | if (!session) |
| 553 | { |
| 554 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 555 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 556 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 557 | "Invalid session"); |
| 558 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 559 | } |
| 560 | |
| 561 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (session); |
| 562 | |
| 563 | if (IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (session)) |
| 564 | { |
| 565 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 566 | |
| 567 | switch (screen_cast_session->statecxx . . $ _ScreenCastSession#state.) |
| 568 | { |
| 569 | case SCREEN_CAST_SESSION_STATE_INITcxx . . $ SCREEN_CAST_SESSION_STATE_INIT.: |
| 570 | break; |
| 571 | case SCREEN_CAST_SESSION_STATE_SELECTING_SOURCEScxx . . $ SCREEN_CAST_SESSION_STATE_SELECTING_SOURCES.: |
| 572 | case SCREEN_CAST_SESSION_STATE_SOURCES_SELECTEDcxx . . $ SCREEN_CAST_SESSION_STATE_SOURCES_SELECTED.: |
| 573 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 574 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 575 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 576 | "Sources already selected"); |
| 577 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 578 | case SCREEN_CAST_SESSION_STATE_STARTINGcxx . . $ SCREEN_CAST_SESSION_STATE_STARTING.: |
| 579 | case SCREEN_CAST_SESSION_STATE_STARTEDcxx . . $ SCREEN_CAST_SESSION_STATE_STARTED.: |
| 580 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 581 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 582 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 583 | "Can only select sources before starting"); |
| 584 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 585 | case SCREEN_CAST_SESSION_STATE_CLOSEDcxx . . $ SCREEN_CAST_SESSION_STATE_CLOSED.: |
| 586 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 587 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 588 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 589 | "Invalid session"); |
| 590 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 591 | } |
| 592 | } |
| 593 | else if (IS_REMOTE_DESKTOP_SESSIONcxx . . $ IS_REMOTE_DESKTOP_SESSION(dedf1e9b1c614a07). (session)) |
| 594 | { |
| 595 | RemoteDesktopSessioncxx . . $ RemoteDesktopSession# *remote_desktop_session = |
| 596 | REMOTE_DESKTOP_SESSIONcxx . . $ REMOTE_DESKTOP_SESSION(288c4d99424a6019). (session); |
| 597 | |
| 598 | if (!remote_desktop_session_can_select_sourcescxx . . $ remote_desktop_session_can_select_sources(dd48ac39560d1f95). (remote_desktop_session)) |
| 599 | { |
| 600 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 601 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 602 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 603 | "Invalid state"); |
| 604 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 605 | } |
| 606 | } |
| 607 | else |
| 608 | { |
| 609 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 610 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 611 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 612 | "Invalid session"); |
| 613 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 614 | } |
| 615 | |
| 616 | impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). ( |
| 617 | g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 618 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 619 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 620 | request->idcxx . . $ _XdpRequest#id., |
| 621 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 622 | |
| 623 | if (!impl_request) |
| 624 | { |
| 625 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 626 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 627 | } |
| 628 | |
| 629 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 630 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 631 | |
| 632 | if (!xdp_filter_optionscxx . . $ xdp_filter_options(e9350dfce557ba5e). (arg_options, &options_builder, |
| 633 | screen_cast_select_sources_optionscxx . . $ screen_cast_select_sources_options., |
| 634 | G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (screen_cast_select_sources_options), |
| 635 | screen_cast, &error)) |
| 636 | { |
| 637 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 638 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 639 | } |
| 640 | |
| 641 | options = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&options_builder)); |
| 642 | |
| 643 | /* If 'restore_token' is passed, lookup the corresponding data in the |
| 644 | * permission store and / or the GHashTable with transient permissions. |
| 645 | * Portal implementations do not have access to the restore token. |
| 646 | */ |
| 647 | if (!replace_screen_cast_restore_token_with_datacxx . . $ replace_screen_cast_restore_token_with_data(bf2d3316eec98cc9). (session, &options, &error)) |
| 648 | { |
| 649 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 650 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 651 | } |
| 652 | |
| 653 | g_object_set_qdata_fullcxx . . $ g_object_set_qdata_full(65a765778c030710). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), |
| 654 | quark_request_sessioncxx . . $ quark_request_session., |
| 655 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session), |
| 656 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 657 | if (IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (session)) |
| 658 | { |
| 659 | SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session)->statecxx . . $ _ScreenCastSession#state. = |
| 660 | SCREEN_CAST_SESSION_STATE_SELECTING_SOURCEScxx . . $ SCREEN_CAST_SESSION_STATE_SELECTING_SOURCES.; |
| 661 | } |
| 662 | |
| 663 | xdp_dbus_impl_screen_cast_call_select_sourcescxx . . $ xdp_dbus_impl_screen_cast_call_select_sources(b0149c26f3691655). (screen_cast->implcxx . . $ _ScreenCast#impl., |
| 664 | request->idcxx . . $ _XdpRequest#id., |
| 665 | arg_session_handle, |
| 666 | xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), |
| 667 | options, |
| 668 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 669 | select_sources_donecxx . . $ select_sources_done(aa1d200d824d915d)., |
| 670 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 671 | |
| 672 | xdp_dbus_screen_cast_complete_select_sourcescxx . . $ xdp_dbus_screen_cast_complete_select_sources(861177f24bec6f0a). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 673 | |
| 674 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 675 | } |
| 676 | |
| 677 | uint32_tcxx . . $ uint32_t# |
| 678 | screen_cast_stream_get_pipewire_node_idcxx . . $ screen_cast_stream_get_pipewire_node_id(f81c752b0fadbc8). (ScreenCastStreamcxx . . $ ScreenCastStream# *stream) |
| 679 | { |
| 680 | return stream->idcxx . . $ _ScreenCastStream#id.; |
| 681 | } |
| 682 | |
| 683 | static void |
| 684 | append_stream_permissionscxx . . $ append_stream_permissions(5ebd28daafd6c507). (PipeWireRemotecxx . . $ PipeWireRemote# *remote, |
| 685 | GArraycxx . . $ GArray# *permission_items, |
| 686 | GListcxx . . $ GList# *streams) |
| 687 | { |
| 688 | GListcxx . . $ GList# *l; |
| 689 | |
| 690 | for (l = streams; l; l = l->nextcxx . . $ _GList#next.) |
| 691 | { |
| 692 | ScreenCastStreamcxx . . $ ScreenCastStream# *stream = l->datacxx . . $ _GList#data.; |
| 693 | uint32_tcxx . . $ uint32_t# stream_id; |
| 694 | |
| 695 | stream_id = screen_cast_stream_get_pipewire_node_idcxx . . $ screen_cast_stream_get_pipewire_node_id(f81c752b0fadbc8). (stream); |
| 696 | g_array_append_valcxx . . $ `<external>/13165152102340786875/garray.h:66:9`! (permission_items, |
| 697 | PERMISSION_ITEMcxx . . $ `src/screen-cast.c:42:9`! (stream_id, PW_PERM_RWXcxx . . $ `<external>/7939413062154060509/permission.h:36:9`!)); |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | static PipeWireRemotecxx . . $ PipeWireRemote# * |
| 702 | open_pipewire_screen_cast_remotecxx . . $ open_pipewire_screen_cast_remote(e80a5606d57dd297). (const char *app_id, |
| 703 | GListcxx . . $ GList# *streams, |
| 704 | GErrorcxx . . $ GError# **error) |
| 705 | { |
| 706 | struct pw_propertiescxx . . $ pw_properties# *pipewire_properties; |
| 707 | PipeWireRemotecxx . . $ PipeWireRemote# *remote; |
| 708 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GArray) permission_items = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 709 | |
| 710 | pipewire_properties = pw_properties_newcxx . . $ pw_properties_new(e0c80577246ac4c6). ("pipewire.access.portal.app_id", app_id, |
| 711 | "pipewire.access.portal.media_roles", "", |
| 712 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 713 | remote = pipewire_remote_new_synccxx . . $ pipewire_remote_new_sync(a02fe799c62322c5). (pipewire_properties, |
| 714 | 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`!, |
| 715 | error); |
| 716 | if (!remote) |
| 717 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 718 | |
| 719 | permission_items = g_array_newcxx . . $ g_array_new(fe898421933afc00). (FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, sizeof (struct pw_permissioncxx . . $ pw_permission#)); |
| 720 | |
| 721 | /* |
| 722 | * PipeWire:Interface:Core |
| 723 | * Needs rwx to be able create the sink node using the create-object method |
| 724 | */ |
| 725 | g_array_append_valcxx . . $ `<external>/13165152102340786875/garray.h:66:9`! (permission_items, |
| 726 | PERMISSION_ITEMcxx . . $ `src/screen-cast.c:42:9`! (PW_ID_COREcxx . . $ `<external>/5234708268892715328/core.h:57:9`!, PW_PERM_RWXcxx . . $ `<external>/7939413062154060509/permission.h:36:9`!)); |
| 727 | |
| 728 | /* |
| 729 | * PipeWire:Interface:NodeFactory |
| 730 | * Needs r-- so it can be passed to create-object when creating the sink node. |
| 731 | */ |
| 732 | g_array_append_valcxx . . $ `<external>/13165152102340786875/garray.h:66:9`! (permission_items, |
| 733 | PERMISSION_ITEMcxx . . $ `src/screen-cast.c:42:9`! (remote->node_factory_id, PW_PERM_Rcxx . . $ `<external>/7939413062154060509/permission.h:27:9`!)); |
| 734 | |
| 735 | append_stream_permissionscxx . . $ append_stream_permissions(5ebd28daafd6c507). (remote, permission_items, streams); |
| 736 | |
| 737 | /* |
| 738 | * Hide all existing and future nodes (except the ones we explicitly list above). |
| 739 | */ |
| 740 | g_array_append_valcxx . . $ `<external>/13165152102340786875/garray.h:66:9`! (permission_items, |
| 741 | PERMISSION_ITEMcxx . . $ `src/screen-cast.c:42:9`! (PW_ID_ANYcxx . . $ `<external>/5234708268892715328/core.h:60:9`!, 0)); |
| 742 | |
| 743 | pw_client_update_permissionscxx . . $ pw_client_update_permissions(c924fdb834f35c5). (pw_core_get_clientcxx . . $ pw_core_get_client(4a7da86c87678949).(remote->corecxx . . $ _PipeWireRemote#core.), |
| 744 | permission_items->lencxx . . $ _GArray#len., |
| 745 | (const struct pw_permissioncxx . . $ pw_permission# *)permission_items->datacxx . . $ _GArray#data.); |
| 746 | |
| 747 | pipewire_remote_roundtripcxx . . $ pipewire_remote_roundtrip(79f2a9067a520604). (remote); |
| 748 | |
| 749 | return remote; |
| 750 | } |
| 751 | |
| 752 | void |
| 753 | screen_cast_stream_get_sizecxx . . $ screen_cast_stream_get_size(44d6a6f91e5a4c4b). (ScreenCastStreamcxx . . $ ScreenCastStream# *stream, |
| 754 | int32_tcxx . . $ int32_t# *width, |
| 755 | int32_tcxx . . $ int32_t# *height) |
| 756 | { |
| 757 | *width = stream->widthcxx . . $ _ScreenCastStream#width.; |
| 758 | *height = stream->heightcxx . . $ _ScreenCastStream#height.; |
| 759 | } |
| 760 | |
| 761 | void |
| 762 | screen_cast_stream_freecxx . . $ screen_cast_stream_free(6f144c91b7a728b0). (ScreenCastStreamcxx . . $ ScreenCastStream# *stream) |
| 763 | { |
| 764 | g_freecxx . . $ g_free(5d22bdacc48458e8). (stream); |
| 765 | } |
| 766 | |
| 767 | GListcxx . . $ GList# * |
| 768 | collect_screen_cast_stream_datacxx . . $ collect_screen_cast_stream_data(859a85f4252c91d7). (GVariantItercxx . . $ GVariantIter# *streams_iter) |
| 769 | { |
| 770 | GListcxx . . $ GList# *streams = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 771 | uint32_tcxx . . $ uint32_t# stream_id; |
| 772 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) stream_options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 773 | |
| 774 | while (g_variant_iter_nextcxx . . $ g_variant_iter_next(eaf615a8ce2e43df). (streams_iter, "(u@a{sv})", |
| 775 | &stream_id, &stream_options)) |
| 776 | { |
| 777 | ScreenCastStreamcxx . . $ ScreenCastStream# *stream; |
| 778 | |
| 779 | stream = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (ScreenCastStream, 1); |
| 780 | stream->idcxx . . $ _ScreenCastStream#id. = stream_id; |
| 781 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (stream_options, "size", "(ii)", |
| 782 | &stream->widthcxx . . $ _ScreenCastStream#width., &stream->heightcxx . . $ _ScreenCastStream#height.); |
| 783 | stream->has_pipewire_serialcxx . . $ _ScreenCastStream#has_pipewire_serial. = |
| 784 | g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (stream_options, "pipewire-serial", "t", |
| 785 | &stream->pipewire_serialcxx . . $ _ScreenCastStream#pipewire_serial.); |
| 786 | |
| 787 | streams = g_list_prependcxx . . $ g_list_prepend(35007086a6b2ba1c). (streams, stream); |
| 788 | } |
| 789 | |
| 790 | return streams; |
| 791 | } |
| 792 | |
| 793 | static void |
| 794 | replace_restore_screen_cast_data_with_tokencxx . . $ replace_restore_screen_cast_data_with_token(957b640badae0437). (ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session, |
| 795 | GVariantcxx . . $ GVariant# **in_out_results) |
| 796 | { |
| 797 | xdp_session_persistence_replace_restore_data_with_tokencxx . . $ xdp_session_persistence_replace_restore_data_with_token(97c9ce3fc2c5d9dc). (XDP_SESSIONcxx . . $ XDP_SESSION(a424cc90118498e6). (screen_cast_session), |
| 798 | SCREEN_CAST_PERMISSION_TABLEcxx . . $ `src/xdp-types.h:125:9`!, |
| 799 | in_out_results, |
| 800 | &screen_cast_session->persist_modecxx . . $ _ScreenCastSession#persist_mode., |
| 801 | &screen_cast_session->restore_tokencxx . . $ _ScreenCastSession#restore_token., |
| 802 | &screen_cast_session->restore_datacxx . . $ _ScreenCastSession#restore_data.); |
| 803 | } |
| 804 | |
| 805 | static gbooleancxx . . $ gboolean# |
| 806 | process_resultscxx . . $ process_results(1c9630d36887db2). (ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session, |
| 807 | GVariantcxx . . $ GVariant# **in_out_results, |
| 808 | GErrorcxx . . $ GError# **error) |
| 809 | { |
| 810 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariantIter) streams_iter = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 811 | GVariantcxx . . $ GVariant# *results = *in_out_results; |
| 812 | |
| 813 | if (!g_variant_lookupcxx . . $ g_variant_lookup(7f27c6838ade8909). (results, "streams", "a(ua{sv})", &streams_iter)) |
| 814 | { |
| 815 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., "No streams"); |
| 816 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 817 | } |
| 818 | |
| 819 | screen_cast_session->streamscxx . . $ _ScreenCastSession#streams. = collect_screen_cast_stream_datacxx . . $ collect_screen_cast_stream_data(859a85f4252c91d7). (streams_iter); |
| 820 | replace_restore_screen_cast_data_with_tokencxx . . $ replace_restore_screen_cast_data_with_token(957b640badae0437). (screen_cast_session, |
| 821 | in_out_results); |
| 822 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 823 | } |
| 824 | |
| 825 | static void |
| 826 | start_donecxx . . $ start_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source_object, |
| 827 | GAsyncResultcxx . . $ GAsyncResult# *res, |
| 828 | gpointercxx . . $ gpointer# data) |
| 829 | { |
| 830 | XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *impl = (XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *) source_object; |
| 831 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpRequest) request = data; |
| 832 | XdpSessioncxx . . $ XdpSession# *session; |
| 833 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session; |
| 834 | guintcxx . . $ guint# response = 2; |
| 835 | gbooleancxx . . $ gboolean# should_close_session; |
| 836 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) results = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 837 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 838 | |
| 839 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 840 | |
| 841 | session = g_object_get_qdatacxx . . $ g_object_get_qdata(b02fb2b4fc775a4). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session.); |
| 842 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session)); |
| 843 | g_object_set_qdatacxx . . $ g_object_set_qdata(d7e2e719dfad0cc9). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), quark_request_sessioncxx . . $ quark_request_session., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 844 | |
| 845 | if (!xdp_dbus_impl_screen_cast_call_start_finishcxx . . $ xdp_dbus_impl_screen_cast_call_start_finish(5828a69a9383c9eb). (impl, |
| 846 | &response, |
| 847 | &results, |
| 848 | res, |
| 849 | &error)) |
| 850 | { |
| 851 | g_dbus_error_strip_remote_errorcxx . . $ g_dbus_error_strip_remote_error(425e103a815b829). (error); |
| 852 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("A backend call failed: %s", error->message); |
| 853 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 854 | } |
| 855 | |
| 856 | should_close_session = !request->exportedcxx . . $ _XdpRequest#exported. || response != 0; |
| 857 | |
| 858 | screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 859 | |
| 860 | if (request->exportedcxx . . $ _XdpRequest#exported.) |
| 861 | { |
| 862 | if (response == 0) |
| 863 | { |
| 864 | if (!process_resultscxx . . $ process_results(1c9630d36887db2). (screen_cast_session, &results, &error)) |
| 865 | { |
| 866 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to process results: %s", error->message); |
| 867 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 868 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&results, g_variant_unref); |
| 869 | response = 2; |
| 870 | should_close_session = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | if (!results) |
| 875 | { |
| 876 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) results_builder = |
| 877 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 878 | |
| 879 | results = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&results_builder)); |
| 880 | } |
| 881 | |
| 882 | xdp_dbus_request_emit_responsecxx . . $ xdp_dbus_request_emit_response(6deab25eec490adc). (XDP_DBUS_REQUESTcxx . . $ `build/src/xdp-dbus.h:6831:9`! (request), response, results); |
| 883 | xdp_request_unexportcxx . . $ xdp_request_unexport(8bf1d2bcdc4be36d). (request); |
| 884 | } |
| 885 | |
| 886 | if (should_close_session) |
| 887 | { |
| 888 | xdp_session_closecxx . . $ xdp_session_close(e4dd02f38fc14a2). (session, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 889 | } |
| 890 | else if (!session->closedcxx . . $ _XdpSession#closed.) |
| 891 | { |
| 892 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (screen_cast_session->state == |
| 893 | SCREEN_CAST_SESSION_STATE_STARTING); |
| 894 | g_debugcxx . . $ `<external>/5169755362661750954/gmessages.h:371:9`! ("screen cast session owned by '%s' started", session->sender); |
| 895 | screen_cast_session->statecxx . . $ _ScreenCastSession#state. = SCREEN_CAST_SESSION_STATE_STARTEDcxx . . $ SCREEN_CAST_SESSION_STATE_STARTED.; |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | static gbooleancxx . . $ gboolean# |
| 900 | handle_startcxx . . $ handle_start(f80edcaec911f610). (XdpDbusScreenCastcxx . . $ XdpDbusScreenCast# *object, |
| 901 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 902 | const char *arg_session_handle, |
| 903 | const char *arg_parent_window, |
| 904 | GVariantcxx . . $ GVariant# *arg_options) |
| 905 | { |
| 906 | ScreenCastcxx . . $ ScreenCast# *screen_cast = (ScreenCastcxx . . $ ScreenCast# *) object; |
| 907 | XdpRequestcxx . . $ XdpRequest# *request = xdp_request_from_invocationcxx . . $ xdp_request_from_invocation(9583a51810815010). (invocation); |
| 908 | XdpSessioncxx . . $ XdpSession# *session; |
| 909 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session; |
| 910 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 911 | 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`!; |
| 912 | g_autocxx . . $ `<external>/12741050725406041920/gmacros.h:1428:9`!(GVariantBuilder) options_builder = |
| 913 | G_VARIANT_BUILDER_INITcxx . . $ `<external>/10279604295420929244/gvariant.h:369:9`! (G_VARIANT_TYPE_VARDICTcxx . . $ `<external>/14064154155447831270/gvarianttype.h:279:9`!); |
| 914 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GVariant) options = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 915 | |
| 916 | REQUEST_AUTOLOCKcxx . . $ `src/xdp-request.h:56:9`! (request); |
| 917 | |
| 918 | session = xdp_session_from_requestcxx . . $ xdp_session_from_request(b20d0b7552200bd). (arg_session_handle, request); |
| 919 | if (!session) |
| 920 | { |
| 921 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 922 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 923 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 924 | "Invalid session"); |
| 925 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 926 | } |
| 927 | |
| 928 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (session); |
| 929 | |
| 930 | screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 931 | switch (screen_cast_session->statecxx . . $ _ScreenCastSession#state.) |
| 932 | { |
| 933 | case SCREEN_CAST_SESSION_STATE_SOURCES_SELECTEDcxx . . $ SCREEN_CAST_SESSION_STATE_SOURCES_SELECTED.: |
| 934 | break; |
| 935 | case SCREEN_CAST_SESSION_STATE_INITcxx . . $ SCREEN_CAST_SESSION_STATE_INIT.: |
| 936 | case SCREEN_CAST_SESSION_STATE_SELECTING_SOURCEScxx . . $ SCREEN_CAST_SESSION_STATE_SELECTING_SOURCES.: |
| 937 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 938 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 939 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 940 | "Sources not selected"); |
| 941 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 942 | case SCREEN_CAST_SESSION_STATE_STARTINGcxx . . $ SCREEN_CAST_SESSION_STATE_STARTING.: |
| 943 | case SCREEN_CAST_SESSION_STATE_STARTEDcxx . . $ SCREEN_CAST_SESSION_STATE_STARTED.: |
| 944 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 945 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 946 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 947 | "Can only start once"); |
| 948 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 949 | case SCREEN_CAST_SESSION_STATE_CLOSEDcxx . . $ SCREEN_CAST_SESSION_STATE_CLOSED.: |
| 950 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 951 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 952 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 953 | "Invalid session"); |
| 954 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 955 | } |
| 956 | |
| 957 | g_object_set_data_fullcxx . . $ g_object_set_data_full(218df00be1d2a06c). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), |
| 958 | "window", g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (arg_parent_window), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 959 | |
| 960 | impl_request = xdp_dbus_impl_request_proxy_new_synccxx . . $ xdp_dbus_impl_request_proxy_new_sync(b36c38a372f8f089). ( |
| 961 | g_dbus_proxy_get_connectioncxx . . $ g_dbus_proxy_get_connection(fd0690ce15ac5ecf). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 962 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIEScxx . . $ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES., |
| 963 | g_dbus_proxy_get_namecxx . . $ g_dbus_proxy_get_name(c2c3b8a4da378b0d). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl)), |
| 964 | request->idcxx . . $ _XdpRequest#id., |
| 965 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 966 | |
| 967 | if (!impl_request) |
| 968 | { |
| 969 | g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (invocation, error); |
| 970 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 971 | } |
| 972 | |
| 973 | xdp_request_set_impl_requestcxx . . $ xdp_request_set_impl_request(18bd0ab3b325ada4). (request, impl_request); |
| 974 | xdp_request_exportcxx . . $ xdp_request_export(49d11f351a243e17). (request, g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (invocation)); |
| 975 | |
| 976 | options = g_variant_ref_sinkcxx . . $ g_variant_ref_sink(3606eab35379b54a). (g_variant_builder_endcxx . . $ g_variant_builder_end(6d60952e65fc2b86). (&options_builder)); |
| 977 | |
| 978 | g_object_set_qdata_fullcxx . . $ g_object_set_qdata_full(65a765778c030710). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (request), |
| 979 | quark_request_sessioncxx . . $ quark_request_session., |
| 980 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (session), |
| 981 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 982 | screen_cast_session->statecxx . . $ _ScreenCastSession#state. = SCREEN_CAST_SESSION_STATE_STARTINGcxx . . $ SCREEN_CAST_SESSION_STATE_STARTING.; |
| 983 | |
| 984 | xdp_dbus_impl_screen_cast_call_startcxx . . $ xdp_dbus_impl_screen_cast_call_start(1b506b74e2492820). (screen_cast->implcxx . . $ _ScreenCast#impl., |
| 985 | request->idcxx . . $ _XdpRequest#id., |
| 986 | arg_session_handle, |
| 987 | xdp_app_info_get_idcxx . . $ xdp_app_info_get_id(b9a768ac644c9329). (request->app_infocxx . . $ _XdpRequest#app_info.), |
| 988 | arg_parent_window, |
| 989 | options, |
| 990 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 991 | start_donecxx . . $ start_done(aa1d200d824d915d)., |
| 992 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (request)); |
| 993 | |
| 994 | xdp_dbus_screen_cast_complete_startcxx . . $ xdp_dbus_screen_cast_complete_start(861177f24bec6f0a). (object, invocation, request->idcxx . . $ _XdpRequest#id.); |
| 995 | |
| 996 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 997 | } |
| 998 | |
| 999 | static gbooleancxx . . $ gboolean# |
| 1000 | handle_open_pipewire_remotecxx . . $ handle_open_pipewire_remote(8e12eafb3c09a86). (XdpDbusScreenCastcxx . . $ XdpDbusScreenCast# *object, |
| 1001 | GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *invocation, |
| 1002 | GUnixFDListcxx . . $ GUnixFDList# *in_fd_list, |
| 1003 | const char *arg_session_handle, |
| 1004 | GVariantcxx . . $ GVariant# *arg_options) |
| 1005 | { |
| 1006 | XdpAppInfocxx . . $ XdpAppInfo# *app_info = xdp_invocation_get_app_infocxx . . $ xdp_invocation_get_app_info(36d3606d1003be6). (invocation); |
| 1007 | XdpSessioncxx . . $ XdpSession# *session; |
| 1008 | GListcxx . . $ GList# *streams; |
| 1009 | PipeWireRemotecxx . . $ PipeWireRemote# *remote; |
| 1010 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GUnixFDList) out_fd_list = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1011 | int fd; |
| 1012 | int fd_id; |
| 1013 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1014 | |
| 1015 | session = xdp_session_from_app_infocxx . . $ xdp_session_from_app_info(8bac21a832d9196). (arg_session_handle, app_info); |
| 1016 | if (!session) |
| 1017 | { |
| 1018 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1019 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 1020 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 1021 | "Invalid session"); |
| 1022 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1023 | } |
| 1024 | |
| 1025 | SESSION_AUTOLOCK_UNREFcxx . . $ `src/xdp-session.h:81:9`! (session); |
| 1026 | |
| 1027 | if (IS_SCREEN_CAST_SESSIONcxx . . $ IS_SCREEN_CAST_SESSION(dedf1e9b1c614a07). (session)) |
| 1028 | { |
| 1029 | ScreenCastSessioncxx . . $ ScreenCastSession# *screen_cast_session = SCREEN_CAST_SESSIONcxx . . $ SCREEN_CAST_SESSION(bb494f4eac1ba585). (session); |
| 1030 | |
| 1031 | streams = screen_cast_session->streamscxx . . $ _ScreenCastSession#streams.; |
| 1032 | } |
| 1033 | else if (IS_REMOTE_DESKTOP_SESSIONcxx . . $ IS_REMOTE_DESKTOP_SESSION(dedf1e9b1c614a07). (session)) |
| 1034 | { |
| 1035 | RemoteDesktopSessioncxx . . $ RemoteDesktopSession# *remote_desktop_session = |
| 1036 | REMOTE_DESKTOP_SESSIONcxx . . $ REMOTE_DESKTOP_SESSION(288c4d99424a6019). (session); |
| 1037 | |
| 1038 | streams = remote_desktop_session_get_streamscxx . . $ remote_desktop_session_get_streams(ea983a36440a98d3). (remote_desktop_session); |
| 1039 | } |
| 1040 | else |
| 1041 | { |
| 1042 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1043 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 1044 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 1045 | "Invalid session"); |
| 1046 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1047 | } |
| 1048 | |
| 1049 | if (!streams) |
| 1050 | { |
| 1051 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1052 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 1053 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 1054 | "No streams available"); |
| 1055 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1056 | } |
| 1057 | |
| 1058 | remote = open_pipewire_screen_cast_remotecxx . . $ open_pipewire_screen_cast_remote(e80a5606d57dd297). (session->app_idcxx . . $ _XdpSession#app_id., streams, &error); |
| 1059 | if (!remote) |
| 1060 | { |
| 1061 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1062 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 1063 | G_DBUS_ERROR_FAILEDcxx . . $ G_DBUS_ERROR_FAILED., |
| 1064 | "%s", error->messagecxx . . $ _GError#message.); |
| 1065 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1066 | } |
| 1067 | |
| 1068 | out_fd_list = g_unix_fd_list_newcxx . . $ g_unix_fd_list_new(2f03ba904a9d4e55). (); |
| 1069 | fd = pw_core_steal_fdcxx . . $ pw_core_steal_fd(363b6018a5147cb). (remote->corecxx . . $ _PipeWireRemote#core.); |
| 1070 | fd_id = g_unix_fd_list_appendcxx . . $ g_unix_fd_list_append(57b895fb290201ec). (out_fd_list, fd, &error); |
| 1071 | closecxx . . $ close(7864480464b09eea). (fd); |
| 1072 | pipewire_remote_destroycxx . . $ pipewire_remote_destroy(79f2a9067a520604). (remote); |
| 1073 | |
| 1074 | if (fd_id == -1) |
| 1075 | { |
| 1076 | g_dbus_method_invocation_return_errorcxx . . $ g_dbus_method_invocation_return_error(2860f9a06c72d77e). (invocation, |
| 1077 | G_DBUS_ERRORcxx . . $ `<external>/517763016858796244/gdbuserror.h:49:9`!, |
| 1078 | G_DBUS_ERROR_ACCESS_DENIEDcxx . . $ G_DBUS_ERROR_ACCESS_DENIED., |
| 1079 | "Failed to append fd: %s", |
| 1080 | error->messagecxx . . $ _GError#message.); |
| 1081 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1082 | } |
| 1083 | |
| 1084 | xdp_dbus_screen_cast_complete_open_pipewire_remotecxx . . $ xdp_dbus_screen_cast_complete_open_pipewire_remote(8d942dcec83607c0). (object, invocation, |
| 1085 | out_fd_list, |
| 1086 | g_variant_new_handlecxx . . $ g_variant_new_handle(d662e1c280be90d3). (fd_id)); |
| 1087 | return G_DBUS_METHOD_INVOCATION_HANDLEDcxx . . $ `<external>/7877694576918326146/gdbusmethodinvocation.h:56:9`!; |
| 1088 | } |
| 1089 | |
| 1090 | static void |
| 1091 | screen_cast_iface_initcxx . . $ screen_cast_iface_init(b05585cbe7d1f075). (XdpDbusScreenCastIfacecxx . . $ XdpDbusScreenCastIface# *iface) |
| 1092 | { |
| 1093 | iface->handle_create_sessioncxx . . $ _XdpDbusScreenCastIface#handle_create_session. = handle_create_sessioncxx . . $ handle_create_session(a765910a66dfd28d).; |
| 1094 | iface->handle_select_sourcescxx . . $ _XdpDbusScreenCastIface#handle_select_sources. = handle_select_sourcescxx . . $ handle_select_sources(953bc2dbf00a1a9e).; |
| 1095 | iface->handle_startcxx . . $ _XdpDbusScreenCastIface#handle_start. = handle_startcxx . . $ handle_start(f80edcaec911f610).; |
| 1096 | iface->handle_open_pipewire_remotecxx . . $ _XdpDbusScreenCastIface#handle_open_pipewire_remote. = handle_open_pipewire_remotecxx . . $ handle_open_pipewire_remote(8e12eafb3c09a86).; |
| 1097 | } |
| 1098 | |
| 1099 | static void |
| 1100 | screen_cast_disposecxx . . $ screen_cast_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 1101 | { |
| 1102 | ScreenCastcxx . . $ ScreenCast# *screen_cast = (ScreenCastcxx . . $ ScreenCast# *) object; |
| 1103 | |
| 1104 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&screen_cast->impl); |
| 1105 | |
| 1106 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (screen_cast_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object); |
| 1107 | } |
| 1108 | |
| 1109 | static void |
| 1110 | screen_cast_initcxx . . $ screen_cast_init(ed06544c3fd67da2). (ScreenCastcxx . . $ ScreenCast# *screen_cast) |
| 1111 | { |
| 1112 | } |
| 1113 | |
| 1114 | static void |
| 1115 | screen_cast_class_initcxx . . $ screen_cast_class_init(c6d5f75298190799). (ScreenCastClasscxx . . $ ScreenCastClass# *klass) |
| 1116 | { |
| 1117 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 1118 | |
| 1119 | object_class->disposecxx . . $ _GObjectClass#dispose. = screen_cast_disposecxx . . $ screen_cast_dispose(6087475fa43034d3).; |
| 1120 | |
| 1121 | quark_request_sessioncxx . . $ quark_request_session. = |
| 1122 | g_quark_from_static_stringcxx . . $ g_quark_from_static_string(c61c63047ce273de). ("-xdp-request-screen-cast-session"); |
| 1123 | } |
| 1124 | |
| 1125 | static ScreenCastcxx . . $ ScreenCast# * |
| 1126 | screen_cast_newcxx . . $ screen_cast_new(75f4d41b094dd6fc). (XdpContextcxx . . $ XdpContext# *context, |
| 1127 | XdpDbusImplScreenCastcxx . . $ XdpDbusImplScreenCast# *impl) |
| 1128 | { |
| 1129 | ScreenCastcxx . . $ ScreenCast# *screen_cast; |
| 1130 | |
| 1131 | screen_cast = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (screen_cast_get_typecxx . . $ screen_cast_get_type(f708dce9a8856c70). (), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1132 | screen_cast->contextcxx . . $ _ScreenCast#context. = context; |
| 1133 | screen_cast->implcxx . . $ _ScreenCast#impl. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (impl); |
| 1134 | |
| 1135 | g_dbus_proxy_set_default_timeoutcxx . . $ g_dbus_proxy_set_default_timeout(c68bf28eca88e1d4). (G_DBUS_PROXYcxx . . $ `<external>/4635717660623816082/gdbusproxy.h:36:9`! (screen_cast->impl), G_MAXINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:39:9`!); |
| 1136 | |
| 1137 | xdp_dbus_screen_cast_set_versioncxx . . $ xdp_dbus_screen_cast_set_version(d39954e436961140). (XDP_DBUS_SCREEN_CASTcxx . . $ `build/src/xdp-dbus.h:7007:9`! (screen_cast), |
| 1138 | MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (xdp_dbus_impl_screen_cast_get_version (screen_cast->impl), 6)); |
| 1139 | |
| 1140 | g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screen_cast->impl), "available-source-types", |
| 1141 | G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screen_cast), "available-source-types", |
| 1142 | G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.); |
| 1143 | |
| 1144 | if (xdp_dbus_impl_screen_cast_get_versioncxx . . $ xdp_dbus_impl_screen_cast_get_version(67410daabf090b4d). (screen_cast->implcxx . . $ _ScreenCast#impl.) >= 2) |
| 1145 | { |
| 1146 | g_object_bind_propertycxx . . $ g_object_bind_property(c97799d956973899). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screen_cast->impl), "available-cursor-modes", |
| 1147 | G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (screen_cast), "available-cursor-modes", |
| 1148 | G_BINDING_SYNC_CREATEcxx . . $ G_BINDING_SYNC_CREATE.); |
| 1149 | } |
| 1150 | |
| 1151 | return screen_cast; |
| 1152 | } |
| 1153 | |
| 1154 | void |
| 1155 | init_screen_castcxx . . $ init_screen_cast(7d190a42f72e5c4f). (XdpContextcxx . . $ XdpContext# *context) |
| 1156 | { |
| 1157 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(ScreenCast) screen_cast = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1158 | GDBusConnectioncxx . . $ GDBusConnection# *connection = xdp_context_get_connectioncxx . . $ xdp_context_get_connection(a09559f10e8590c5). (context); |
| 1159 | XdpPortalConfigcxx . . $ XdpPortalConfig# *config = xdp_context_get_configcxx . . $ xdp_context_get_config(3deea62d2e42aa7). (context); |
| 1160 | XdpImplConfigcxx . . $ XdpImplConfig# *impl_config; |
| 1161 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(XdpDbusImplScreenCast) impl = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1162 | g_autoptrcxx . . $ `<external>/12741050725406041920/gmacros.h:1424:9`!(GError) error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1163 | |
| 1164 | impl_config = xdp_portal_config_findcxx . . $ xdp_portal_config_find(5212eece2399491d). (config, SCREEN_CAST_DBUS_IMPL_IFACEcxx . . $ `src/xdp-types.h:124:9`!); |
| 1165 | if (impl_config == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1166 | return; |
| 1167 | |
| 1168 | impl = xdp_dbus_impl_screen_cast_proxy_new_synccxx . . $ xdp_dbus_impl_screen_cast_proxy_new_sync(ea79020cee53bbf). (connection, |
| 1169 | G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE., |
| 1170 | impl_config->dbus_namecxx . . $ $anonymous_type_accd296e72675a4a_0#dbus_name., |
| 1171 | DESKTOP_DBUS_PATHcxx . . $ `src/xdp-types.h:47:9`!, |
| 1172 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1173 | &error); |
| 1174 | if (impl == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1175 | { |
| 1176 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Failed to create screen cast proxy: %s", error->message); |
| 1177 | return; |
| 1178 | } |
| 1179 | |
| 1180 | screen_cast = screen_cast_newcxx . . $ screen_cast_new(75f4d41b094dd6fc). (context, impl); |
| 1181 | |
| 1182 | xdp_context_take_and_export_portalcxx . . $ xdp_context_take_and_export_portal(54303e2939dd494f). (context, |
| 1183 | G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (g_steal_pointercxx . . $ `<external>/1123956534522462559/gmem.h:250:9`! (&screen_cast)), |
| 1184 | XDP_CONTEXT_EXPORT_FLAGS_NONEcxx . . $ XDP_CONTEXT_EXPORT_FLAGS_NONE.); |
| 1185 | } |