Debian Codegraph @

data/org.freedesktop.portal.ScreenCast.xml

raw
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 5 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 The array will contain a single stream if 'multiple' (see
189 org.freedesktop.portal.ScreenCast.SelectSources())
190 was set to 'false', or at least one stream if
191 'multiple' was set to 'true' as part of the
192 org.freedesktop.portal.ScreenCast.SelectSources() method.
193
194 Each stream contains the following properties:
195
196 * ``id`` (``s``)
197
198 Opaque identifier. Will be unique for this stream and local to this
199 session. Will persist with future sessions, if they are restored
200 using a restore token. This property was added in version 4 of this
201 interface. Optional.
202
203 * ``position`` (``(ii)``)
204
205 A tuple consisting of the position (x, y) in the compositor
206 coordinate space. Note that the position may not be equivalent to a
207 position in a pixel coordinate space. Only available for monitor
208 streams. Optional.
209
210 * ``size`` (``(ii)``)
211
212 A tuple consisting of (width, height). The size represents the size
213 of the stream as it is displayed in the compositor coordinate
214 space. Note that this size may not be equivalent to a size in a
215 pixel coordinate space. The size may differ from the size of the
216 stream. Optional.
217
218 * ``source_type`` (``u``)
219
220 The type of the content which is being screen casted.
221 For available source types, see the AvailableSourceTypes property.
222 This property was added in version 3 of this interface.
223
224 * ``mapping_id`` (``s``)
225
226 An optional identifier used to map different aspects of the
227 resource this stream corresponds to.
228
229 When used in a remote desktop session, the mapping_id can be used to
230 match a libei region of absolute libei devices. There may be
231 multiple absolute libei devices, and each device may have multiple
232 regions, but a mapping_id will only match one of these regions per
233 device.
234
235 This property was added in version 5 of this interface.
236
237 * ``restore_token`` (``s``)
238
239 The restore token. This token is a single use token that can later
240 be used to restore a session. See
241 org.freedesktop.portal.ScreenCast.SelectSources() for details.
242
243 This response option was added in version 4 of this interface.
244 -->
245 <method name="Start">
246 <arg type="o" name="session_handle" direction="in"/>
247 <arg type="s" name="parent_window" direction="in"/>
248 <annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
249 <arg type="a{sv}" name="options" direction="in"/>
250 <arg type="o" name="handle" direction="out"/>
251 </method>
252 <!--
253 OpenPipeWireRemote:
254 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
255 @options: Vardict with optional further information
256 @fd: File descriptor of an open PipeWire remote.
257
258 Open a file descriptor to the PipeWire remote where the screen cast
259 streams are available. The file descriptor should be used to create a
260 <classname>pw_core</classname> object, by using
261 <function>pw_context_connect_fd</function>. Only the screen cast stream
262 nodes will be available from this PipeWire node.
263 -->
264 <method name="OpenPipeWireRemote">
265 <annotation name="org.gtk.GDBus.C.Name" value="open_pipewire_remote"/>
266 <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
267 <arg type="o" name="session_handle" direction="in"/>
268 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
269 <arg type="a{sv}" name="options" direction="in"/>
270 <arg type="h" name="fd" direction="out"/>
271 </method>
272 <!--
273 AvailableSourceTypes:
274
275 A bitmask of available source types. Currently defined types are:
276
277 - ``1``: MONITOR: Share existing monitors
278 - ``2``: WINDOW: Share application windows
279 - ``4``: VIRTUAL: Extend with new virtual monitor
280 -->
281 <property name="AvailableSourceTypes" type="u" access="read"/>
282 <!--
283 AvailableCursorModes:
284
285 A bitmask of available cursor modes.
286
287 Available cursor mode values:
288
289 - ``1``: Hidden. The cursor is not part of the screen cast stream.
290 - ``2``: Embedded: The cursor is embedded as part of the stream buffers.
291 - ``4``: Metadata: The cursor is not part of the screen cast stream, but sent as PipeWire stream metadata.
292
293 This property was added in version 2 of this interface.
294 -->
295 <property name="AvailableCursorModes" type="u" access="read"/>
296 <property name="version" type="u" access="read"/>
297 </interface>
298 </node>