| 1 |
<?xml version="1.0"?> |
| 2 |
<!-- |
| 3 |
Copyright (C) 2017-2018 Red Hat, Inc. |
| 4 |
|
| 5 |
SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 |
|
| 7 |
This library is free software; you can redistribute it and/or |
| 8 |
modify it under the terms of the GNU Lesser General Public |
| 9 |
License as published by the Free Software Foundation; either |
| 10 |
version 2.1 of the License, or (at your option) any later version. |
| 11 |
|
| 12 |
This library is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
Lesser General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU Lesser General Public |
| 18 |
License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
--> |
| 20 |
|
| 21 |
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> |
| 22 |
<!-- |
| 23 |
org.freedesktop.portal.ScreenCast: |
| 24 |
@short_description: Screen cast portal |
| 25 |
|
| 26 |
The Screen cast portal allows to create screen cast sessions. |
| 27 |
|
| 28 |
This documentation describes version 6 of this interface. |
| 29 |
--> |
| 30 |
<interface name="org.freedesktop.portal.ScreenCast"> |
| 31 |
<!-- |
| 32 |
CreateSession: |
| 33 |
@options: Vardict with optional further information |
| 34 |
@handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 35 |
|
| 36 |
Create a screen cast session. A successfully created session can at |
| 37 |
any time be closed using :ref:`org.freedesktop.portal.Session.Close`, or may |
| 38 |
at any time be closed by the portal implementation, which will be |
| 39 |
signalled via :ref:`org.freedesktop.portal.Session::Closed`. |
| 40 |
|
| 41 |
Supported keys in the @options vardict include: |
| 42 |
|
| 43 |
* ``handle_token`` (``s``) |
| 44 |
|
| 45 |
A string that will be used as the last element of the @handle. Must be a valid |
| 46 |
object path element. See the :ref:`org.freedesktop.portal.Request` documentation for |
| 47 |
more information about the @handle. |
| 48 |
|
| 49 |
* ``session_handle_token`` (``s``) |
| 50 |
|
| 51 |
A string that will be used as the last element of the session handle. Must be a valid |
| 52 |
object path element. See the :ref:`org.freedesktop.portal.Session` documentation for |
| 53 |
more information about the session handle. |
| 54 |
|
| 55 |
The following results get returned via the :ref:`org.freedesktop.portal.Request::Response` signal: |
| 56 |
|
| 57 |
* ``session_handle`` (``s``) |
| 58 |
|
| 59 |
The session handle. An object path for the |
| 60 |
:ref:`org.freedesktop.portal.Session` object representing the created |
| 61 |
session. |
| 62 |
|
| 63 |
.. note:: |
| 64 |
The ``session_handle`` is an object path that was erroneously implemented |
| 65 |
as ``s``. For backwards compatibility it will remain this type. |
| 66 |
--> |
| 67 |
<method name="CreateSession"> |
| 68 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> |
| 69 |
<arg type="a{sv}" name="options" direction="in"/> |
| 70 |
<arg type="o" name="handle" direction="out"/> |
| 71 |
</method> |
| 72 |
<!-- |
| 73 |
SelectSources: |
| 74 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object |
| 75 |
@options: Vardict with optional further information |
| 76 |
@handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 77 |
|
| 78 |
Configure what the screen cast session should record. This method must |
| 79 |
be called before starting the session. |
| 80 |
|
| 81 |
Passing invalid input to this method will cause the session to be |
| 82 |
closed. An application may only attempt to select sources once per |
| 83 |
session. |
| 84 |
|
| 85 |
Supported keys in the @options vardict include: |
| 86 |
|
| 87 |
* ``handle_token`` (``s``) |
| 88 |
|
| 89 |
A string that will be used as the last element of the @handle. Must be a valid |
| 90 |
object path element. See the :ref:`org.freedesktop.portal.Request` documentation for |
| 91 |
more information about the @handle. |
| 92 |
|
| 93 |
* ``types`` (``u``) |
| 94 |
|
| 95 |
Bitmask of what types of content to record. Default is MONITOR. |
| 96 |
|
| 97 |
* ``multiple`` (``b``) |
| 98 |
|
| 99 |
Whether to allow selecting multiple sources. Default is no. |
| 100 |
|
| 101 |
* ``cursor_mode`` (``u``) |
| 102 |
|
| 103 |
Determines how the cursor will be drawn in the screen cast stream. It must be |
| 104 |
one of the cursor modes advertised in |
| 105 |
:ref:`org.freedesktop.portal.ScreenCast:AvailableCursorModes`. Setting a cursor mode |
| 106 |
not advertised will cause the screen cast session to be closed. The default |
| 107 |
cursor mode is 'Hidden'. |
| 108 |
|
| 109 |
This option was added in version 2 of this interface. |
| 110 |
|
| 111 |
* ``restore_token`` (``s``) |
| 112 |
|
| 113 |
The token to restore a previous session. |
| 114 |
|
| 115 |
If the stored session cannot be restored, this value is ignored |
| 116 |
and the user will be prompted normally. This may happen when, for |
| 117 |
example, the session contains a monitor or a window that is not |
| 118 |
available anymore, or when the stored permissions are withdrawn. |
| 119 |
|
| 120 |
The restore token is invalidated after using it once. To restore |
| 121 |
the same session again, use the new restore token sent in response |
| 122 |
to starting this session. |
| 123 |
|
| 124 |
Setting a restore_token is only allowed for screen cast sessions. |
| 125 |
Persistent remote desktop screen cast sessions can only be handled |
| 126 |
via the :ref:`org.freedesktop.portal.RemoteDesktop` interface. |
| 127 |
|
| 128 |
This option was added in version 4 of this interface. |
| 129 |
|
| 130 |
* ``persist_mode`` (``u``) |
| 131 |
|
| 132 |
How this session should persist. Default is 0. Accepted values are: |
| 133 |
|
| 134 |
- ``0``: Do not persist (default) |
| 135 |
- ``1``: Permissions persist as long as the application is running |
| 136 |
- ``2``: Permissions persist until explicitly revoked |
| 137 |
|
| 138 |
Setting persist_mode is only allowed for screen cast sessions. Persistent |
| 139 |
remote desktop screen cast sessions can only be handled via the |
| 140 |
:ref:`org.freedesktop.portal.RemoteDesktop` interface. |
| 141 |
|
| 142 |
If the permission for the session to persist is granted, a restore token will |
| 143 |
be returned via the :ref:`org.freedesktop.portal.Request::Response` signal of the |
| 144 |
:ref:`org.freedesktop.portal.ScreenCast.Start` method. |
| 145 |
|
| 146 |
This option was added in version 4 of this interface. |
| 147 |
|
| 148 |
For available source types, see the AvailableSourceTypes property. |
| 149 |
--> |
| 150 |
<method name="SelectSources"> |
| 151 |
<arg type="o" name="session_handle" direction="in"/> |
| 152 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> |
| 153 |
<arg type="a{sv}" name="options" direction="in"/> |
| 154 |
<arg type="o" name="handle" direction="out"/> |
| 155 |
</method> |
| 156 |
<!-- |
| 157 |
Start: |
| 158 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object |
| 159 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 160 |
@options: Vardict with optional further information |
| 161 |
@handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 162 |
|
| 163 |
Start the screen cast session. This will typically result the portal |
| 164 |
presenting a dialog letting the user do the selection set up by |
| 165 |
org.freedesktop.portal.ScreenCast.SelectSources(). An application can |
| 166 |
only attempt start a session once. |
| 167 |
|
| 168 |
A screen cast session may only be started after having selected sources |
| 169 |
using org.freedesktop.portal.ScreenCast.SelectSources(). |
| 170 |
|
| 171 |
Supported keys in the @options vardict include: |
| 172 |
|
| 173 |
* ``handle_token`` (``s``) |
| 174 |
|
| 175 |
A string that will be used as the last element of the @handle. Must be a valid |
| 176 |
object path element. See the :ref:`org.freedesktop.portal.Request` documentation for |
| 177 |
more information about the @handle. |
| 178 |
|
| 179 |
The following results get returned via the |
| 180 |
:ref:`org.freedesktop.portal.Request::Response` signal: |
| 181 |
|
| 182 |
* ``streams`` (``a(ua{sv})``) |
| 183 |
|
| 184 |
An array of PipeWire streams. Each stream consists of a PipeWire |
| 185 |
node ID (the first element in the tuple, and a Vardict of |
| 186 |
properties. |
| 187 |
|
| 188 |
Since version 6 of this interface, the node ID in the stream |
| 189 |
tuple is deprecated for stream targeting. PipeWire node IDs can |
| 190 |
be reused after node destruction, so active sessions may |
| 191 |
misidentify streams across monitor hotplug, resolution or |
| 192 |
refresh-rate changes, or suspend/resume cycles. Consumers should |
| 193 |
prefer the ``pipewire-serial`` property from the stream |
| 194 |
properties dict and ``PW_KEY_TARGET_OBJECT`` for connecting to |
| 195 |
streams. Backends must continue to populate the node ID for |
| 196 |
compatibility with clients that do not support version 6. |
| 197 |
|
| 198 |
The array will contain a single stream if 'multiple' (see |
| 199 |
org.freedesktop.portal.ScreenCast.SelectSources()) |
| 200 |
was set to 'false', or at least one stream if |
| 201 |
'multiple' was set to 'true' as part of the |
| 202 |
org.freedesktop.portal.ScreenCast.SelectSources() method. |
| 203 |
|
| 204 |
Each stream contains the following properties: |
| 205 |
|
| 206 |
* ``id`` (``s``) |
| 207 |
|
| 208 |
Opaque identifier. Will be unique for this stream and local to this |
| 209 |
session. Will persist with future sessions, if they are restored |
| 210 |
using a restore token. This property was added in version 4 of this |
| 211 |
interface. Optional. |
| 212 |
|
| 213 |
* ``position`` (``(ii)``) |
| 214 |
|
| 215 |
A tuple consisting of the position (x, y) in the compositor |
| 216 |
coordinate space. Note that the position may not be equivalent to a |
| 217 |
position in a pixel coordinate space. Only available for monitor |
| 218 |
streams. Optional. |
| 219 |
|
| 220 |
* ``size`` (``(ii)``) |
| 221 |
|
| 222 |
A tuple consisting of (width, height). The size represents the size |
| 223 |
of the stream as it is displayed in the compositor coordinate |
| 224 |
space. Note that this size may not be equivalent to a size in a |
| 225 |
pixel coordinate space. The size may differ from the size of the |
| 226 |
stream. Optional. |
| 227 |
|
| 228 |
* ``source_type`` (``u``) |
| 229 |
|
| 230 |
The type of the content which is being screen casted. |
| 231 |
For available source types, see the AvailableSourceTypes property. |
| 232 |
This property was added in version 3 of this interface. |
| 233 |
|
| 234 |
* ``mapping_id`` (``s``) |
| 235 |
|
| 236 |
An optional identifier used to map different aspects of the |
| 237 |
resource this stream corresponds to. |
| 238 |
|
| 239 |
When used in a remote desktop session, the mapping_id can be used to |
| 240 |
match a libei region of absolute libei devices. There may be |
| 241 |
multiple absolute libei devices, and each device may have multiple |
| 242 |
regions, but a mapping_id will only match one of these regions per |
| 243 |
device. |
| 244 |
|
| 245 |
This property was added in version 5 of this interface. |
| 246 |
|
| 247 |
* ``pipewire-serial`` (``t``) |
| 248 |
|
| 249 |
The PipeWire ``object.serial`` for this stream's node. Unlike the |
| 250 |
node ID in the stream tuple (which can be reused after node |
| 251 |
destruction), the serial is a monotonically increasing 64-bit |
| 252 |
identifier that is never reused. Consumers should prefer the serial |
| 253 |
for stream targeting via ``PW_KEY_TARGET_OBJECT`` when available. |
| 254 |
|
| 255 |
This property was added in version 6 of this interface. |
| 256 |
|
| 257 |
* ``restore_token`` (``s``) |
| 258 |
|
| 259 |
The restore token. This token is a single use token that can later |
| 260 |
be used to restore a session. See |
| 261 |
org.freedesktop.portal.ScreenCast.SelectSources() for details. |
| 262 |
|
| 263 |
This response option was added in version 4 of this interface. |
| 264 |
--> |
| 265 |
<method name="Start"> |
| 266 |
<arg type="o" name="session_handle" direction="in"/> |
| 267 |
<arg type="s" name="parent_window" direction="in"/> |
| 268 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/> |
| 269 |
<arg type="a{sv}" name="options" direction="in"/> |
| 270 |
<arg type="o" name="handle" direction="out"/> |
| 271 |
</method> |
| 272 |
<!-- |
| 273 |
OpenPipeWireRemote: |
| 274 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object |
| 275 |
@options: Vardict with optional further information |
| 276 |
@fd: File descriptor of an open PipeWire remote. |
| 277 |
|
| 278 |
Open a file descriptor to the PipeWire remote where the screen cast |
| 279 |
streams are available. The file descriptor should be used to create a |
| 280 |
<classname>pw_core</classname> object, by using |
| 281 |
<function>pw_context_connect_fd</function>. Only the screen cast stream |
| 282 |
nodes will be available from this PipeWire node. |
| 283 |
--> |
| 284 |
<method name="OpenPipeWireRemote"> |
| 285 |
<annotation name="org.gtk.GDBus.C.Name" value="open_pipewire_remote"/> |
| 286 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 287 |
<arg type="o" name="session_handle" direction="in"/> |
| 288 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> |
| 289 |
<arg type="a{sv}" name="options" direction="in"/> |
| 290 |
<arg type="h" name="fd" direction="out"/> |
| 291 |
</method> |
| 292 |
<!-- |
| 293 |
AvailableSourceTypes: |
| 294 |
|
| 295 |
A bitmask of available source types. Currently defined types are: |
| 296 |
|
| 297 |
- ``1``: MONITOR: Share existing monitors |
| 298 |
- ``2``: WINDOW: Share application windows |
| 299 |
- ``4``: VIRTUAL: Extend with new virtual monitor |
| 300 |
--> |
| 301 |
<property name="AvailableSourceTypes" type="u" access="read"/> |
| 302 |
<!-- |
| 303 |
AvailableCursorModes: |
| 304 |
|
| 305 |
A bitmask of available cursor modes. |
| 306 |
|
| 307 |
Available cursor mode values: |
| 308 |
|
| 309 |
- ``1``: Hidden. The cursor is not part of the screen cast stream. |
| 310 |
- ``2``: Embedded: The cursor is embedded as part of the stream buffers. |
| 311 |
- ``4``: Metadata: The cursor is not part of the screen cast stream, but sent as PipeWire stream metadata. |
| 312 |
|
| 313 |
This property was added in version 2 of this interface. |
| 314 |
--> |
| 315 |
<property name="AvailableCursorModes" type="u" access="read"/> |
| 316 |
<property name="version" type="u" access="read"/> |
| 317 |
</interface> |
| 318 |
</node> |