gio: update dbus interfaces from xdg-desktop-portal tree

This removes the need to manually specify org.gtk.GDBus.C.UnixFD
annotations in the gdbus-codegen invocations.
This commit is contained in:
James Henstridge
2019-12-06 15:56:16 +08:00
parent c597b0e552
commit 457d4c9fe0
4 changed files with 154 additions and 29 deletions

View File

@@ -8,7 +8,7 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -45,6 +45,12 @@
The permissions that the application has for a document store entry
(see org.freedesktop.portal.Documents.GrantPermissions()) are reflected
in the POSIX mode bits in the fuse filesystem.
The D-Bus interface for the document portal is available under the
bus name org.freedesktop.portal.Documents and the object path
/org/freedesktop/portal/documents.
This documentation describes version 3 of this interface.
-->
<interface name='org.freedesktop.portal.Documents'>
<property name="version" type="u" access="read"/>
@@ -72,6 +78,7 @@
access to the file.
-->
<method name="Add">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type='h' name='o_path_fd' direction='in'/>
<arg type='b' name='reuse_existing' direction='in'/>
<arg type='b' name='persistent' direction='in'/>
@@ -89,6 +96,7 @@
Creates an entry in the document store for writing a new file.
-->
<method name="AddNamed">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type='h' name='o_path_parent_fd' direction='in'/>
<arg type='ay' name='filename' direction='in'/>
<arg type='b' name='reuse_existing' direction='in'/>
@@ -99,7 +107,7 @@
<!--
AddFull:
@o_path_fds: open file descriptors for the files to export
@flags: flags, 1 == reuse_existing, 2 == persistent
@flags: flags, 1 == reuse_existing, 2 == persistent, 4 == as-needed-by-app
@app_id: an application ID, or empty string
@permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
@doc_ids: the IDs of the files in the document store
@@ -109,6 +117,11 @@
form of an open file descriptor to prove that the caller has
access to the file.
If the as-needed-by-app flag is given, files will only be added to
the document store if the application does not already have access to them.
For files that are not added to the document store, the doc_ids array will
contain an empty string.
Additionally, if app_id is specified, it will be given the permissions
listed in GrantPermission.
@@ -119,6 +132,7 @@
This method was added in version 2 of the org.freedesktop.portal.Documents interface.
-->
<method name="AddFull">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type='ah' name='o_path_fds' direction='in'/>
<arg type='u' name='flags' direction='in'/>
<arg type='s' name='app_id' direction='in'/>
@@ -127,6 +141,43 @@
<arg type='a{sv}' name='extra_out' direction='out'/>
</method>
<!--
AddNamedFull:
@o_path_fds: open file descriptor for the parent directory
@filename: the basename for the file
@flags: flags, 1 == reuse_existing, 2 == persistent, 4 == as-needed-by-app
@app_id: an application ID, or empty string
@permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
@doc_id: the ID of the file in the document store
@extra_info: Extra info returned
Creates an entry in the document store for writing a new file.
If the as-needed-by-app flag is given, file will only be added to
the document store if the application does not already have access to it.
For file that is not added to the document store, the doc_id will
contain an empty string.
Additionally, if app_id is specified, it will be given the permissions
listed in GrantPermission.
The method also returns some extra info that can be used to avoid
multiple roundtrips. For now it only contains as "mountpoint", the
fuse mountpoint of the document portal.
This method was added in version 3 of the org.freedesktop.portal.Documents interface.
-->
<method name="AddNamedFull">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type='h' name='o_path_fd' direction='in'/>
<arg type='ay' name='filename' direction='in'/>
<arg type='u' name='flags' direction='in'/>
<arg type='s' name='app_id' direction='in'/>
<arg type='as' name='permissions' direction='in'/>
<arg type='s' name='doc_id' direction='out'/>
<arg type='a{sv}' name='extra_out' direction='out'/>
</method>
<!--
GrantPermissions:
@doc_id: the ID of the file in the document store
@@ -148,8 +199,8 @@
<!--
RevokePermissions:
@doc_id: the ID of the file in the document store
@app_id: the ID of the application to which permissions are granted
@permissions: the permissions to grant, possible values are 'read', 'write', 'grant-permissions' and 'delete'
@app_id: the ID of the application from which permissions are revoked
@permissions: the permissions to revoke, possible values are 'read', 'write', 'grant-permissions' and 'delete'
Revokes access permissions for a file in the document store
from an application.
@@ -184,7 +235,7 @@
Looks up the document ID for a file.
This call is no not available inside the sandbox.
This call is not available inside the sandbox.
-->
<method name="Lookup">
<arg type='ay' name='filename' direction='in'/>