-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's designed so that applications can register actions that can be triggered globally (i.e. regarless of the system's state, like focus).
- Loading branch information
Showing
6 changed files
with
805 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Copyright (C) 2022 Aleix Pol Gonzalez <[email protected]> | ||
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 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 | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
Author: Aleix Pol Gonzalez <[email protected]> | ||
--> | ||
|
||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
<!-- | ||
org.freedesktop.impl.portal.GlobalShortcut: | ||
@short_description: GlobalShortcut portal backend interface | ||
This this portal lets applications register global shortcuts so they can | ||
act regardless of the system state upon an input event. | ||
--> | ||
<interface name="org.freedesktop.impl.portal.GlobalShortcuts"> | ||
<!-- | ||
CreateSession: | ||
@handle: Object path for the #org.freedesktop.impl.portal.Request object representing this call | ||
@session_handle: Object path for the #org.freedesktop.impl.portal.Session object representing the session being created | ||
@app_id: App id of the application | ||
@results: Vardict with the results of the call | ||
Create a global shortcuts session. | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>session_id s</term> | ||
<listitem><para> | ||
The session id. A string representing the created global shortcuts session. | ||
</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>shortcuts a{sv}</term> | ||
<listitem><para> | ||
The ids of the supported shortcuts mapped to a user-readable | ||
description of what it does. | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="CreateSession"> | ||
<arg type="o" name="handle" direction="in"/> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="app_id" direction="in"/> | ||
<arg type="a{sv}" name="results" direction="out"/> | ||
</method> | ||
|
||
<!-- | ||
ListShortcuts: | ||
@handle: Object path for the #org.freedesktop.impl.portal.Request object representing this call | ||
@session_handle: Object path for the #org.freedesktop.impl.portal.Session object representing the session | ||
@results: Vardict with the results of the call | ||
List the shortcuts registered in the @p handle session. | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>names a{sv}</term> | ||
<listitem><para> | ||
The different shortcut ids that have been registered mapped to user-readable descriptions for the app to present that describes the shortcut. | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="ListShortcuts"> | ||
<arg type="o" name="handle" direction="in"/> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="a{sv}" name="results" direction="out"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> | ||
</method> | ||
|
||
<!-- | ||
Bind: | ||
@handle: Object path for the #org.freedesktop.impl.portal.Request object representing this call | ||
@session_handle: Object path for the #org.freedesktop.impl.portal.Session object representing the session | ||
@shortcut_id: The identifier of the shortcut we intend to register | ||
@results: Vardict with the results of the call | ||
Allows to configure the binding the global shortcut named @p shortcut_id within the @session_handle session to a new shortcut. | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>description</term> | ||
<listitem><para> | ||
The user-readable description of the registered binding. This is intended for the app to be able to render the shortcut into the UI, allowing the user to learn the shortcut | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="Bind"> | ||
<arg type="o" name="handle" direction="in"/> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
<arg type="a{sv}" name="results" direction="out"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> | ||
</method> | ||
|
||
<!-- | ||
Activated: | ||
Notifies about a shortcut becoming active. | ||
@session_handle: Session that requested the shortcut | ||
@shortcut_id: the application-provided ID for the notification | ||
@timestamp: When the event happened in ms | ||
--> | ||
<signal name="Activated"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
<arg type="t" name="timestamp" direction="in"/> | ||
</signal> | ||
|
||
<!-- | ||
Deactivated: | ||
Notifies that a shortcut is not active anymore. | ||
@session_handle: Session that requested the shortcut | ||
@shortcut_id: the application-provided ID for the notification | ||
@timestamp: When the event happened in ms | ||
--> | ||
<signal name="Deactivated"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
<arg type="t" name="timestamp" direction="in"/> | ||
</signal> | ||
|
||
<!-- | ||
ShortcutsChanged: | ||
@session_handle: Session that requested the shortcut | ||
Indicates that the information associated with some of the shortcuts has changed. | ||
--> | ||
<signal name="ShortcutsChanged"> | ||
<arg type="o" name="session_handle" direction="out"/> | ||
</signal> | ||
|
||
<property name="version" type="u" access="read"/> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Copyright (C) 2022 Aleix Pol Gonzalez <[email protected]> | ||
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 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 | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
Author: Aleix Pol Gonzalez <[email protected]> | ||
--> | ||
|
||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
<!-- | ||
org.freedesktop.portal.GlobalShortcut: | ||
@short_description: GlobalShortcut portal backend interface | ||
This this portal lets applications register global shortcuts. These shortcuts can be | ||
used by apps to react to the user input, regardless of the input focus state. | ||
To use this, an app has to create a session under which its actions | ||
will be collected. Then shortcuts can be bound (see Bind), listed (see ListShortcuts). | ||
The portal implementation performs the registration and tracks the shortcuts throughout | ||
the session's lifespan. | ||
When a shortcut triggers, Activated is emitted. When it is not triggered anymore, then | ||
Deactivated is issued. | ||
--> | ||
<interface name="org.freedesktop.portal.GlobalShortcuts"> | ||
<!-- | ||
CreateSession: | ||
@options: Vardict with optional further information | ||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call | ||
Creates a global shortcuts session. | ||
Supported keys in the @options vardict include: | ||
<variablelist> | ||
<varlistentry> | ||
<term>handle_token s</term> | ||
<listitem><para> | ||
A string that will be used as the last element of the @handle. Must be a valid | ||
object path element. See the #org.freedesktop.portal.Request documentation for | ||
more information about the @handle. | ||
</para></listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term>session_handle_token s</term> | ||
<listitem><para> | ||
A string that will be used as the last element of the session handle. Must be a valid | ||
object path element. See the #org.freedesktop.portal.Session documentation for | ||
more information about the session handle. | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>session_handle o</term> | ||
<listitem><para> | ||
The session handle. An object path for the | ||
#org.freedesktop.portal.Session object representing the created | ||
session. | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="CreateSession"> | ||
<arg type="a{sv}" name="options" direction="in"/> | ||
<arg type="o" name="handle" direction="out"/> | ||
</method> | ||
|
||
<!-- | ||
ListShortcuts: | ||
@session_handle: Object path for the #org.freedesktop.impl.portal.Session object representing the session | ||
@options: Unused so far | ||
List all the shortcuts with their invocation descriptions. | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>shortcut_ids a{sv}</term> | ||
<listitem><para> | ||
The different shortcut ids that have been registered mapped to user-readable descriptions for the app to present that describes how the shortcut can be invoked. | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="ListShortcuts"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="o" name="request_handle" direction="out"/> | ||
</method> | ||
|
||
<!-- | ||
Bind: | ||
@session_handle: Object path for the #org.freedesktop.impl.portal.Session object representing the session | ||
@shortcut_id: The identifier of the shortcut we intend to register | ||
@request_handle: Object path for the #org.freedesktop.portal.Request object representing this call | ||
Allows to configure the binding the global shortcut named @shortcut_id within the @session_handle session to a new shortcut. | ||
The following results get returned via the #org.freedesktop.portal.Request::Response signal: | ||
<variablelist> | ||
<varlistentry> | ||
<term>description</term> | ||
<listitem><para> | ||
The user-readable description of the registered binding. This is intended for the app to be able to render the shortcut into the UI, allowing the user to learn the shortcut | ||
</para></listitem> | ||
</varlistentry> | ||
</variablelist> | ||
--> | ||
<method name="Bind"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
<arg type="o" name="request_handle" direction="out"/> | ||
</method> | ||
|
||
|
||
<!-- | ||
Activated: | ||
Notifies about a shortcut becoming active. | ||
@session_handle: Session that requested the shortcut | ||
@shortcut_id: the application-provided ID for the notification | ||
--> | ||
<signal name="Activated"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
</signal> | ||
|
||
<!-- | ||
Deactivated: | ||
Notifies that a shortcut is not active anymore. | ||
@session_handle: Session that requested the shortcut | ||
@shortcut_id: the application-provided ID for the notification | ||
--> | ||
<signal name="Deactivated"> | ||
<arg type="o" name="session_handle" direction="in"/> | ||
<arg type="s" name="shortcut_id" direction="in"/> | ||
</signal> | ||
|
||
<!-- | ||
ShortcutsChanged: | ||
@session_handle: Session that requested the shortcut | ||
Indicates that the information associated with some of the shortcuts has changed. | ||
--> | ||
<signal name="ShortcutsChanged"> | ||
<arg type="o" name="session_handle" direction="out"/> | ||
</signal> | ||
|
||
<property name="version" type="u" access="read"/> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.