<?xml version="1.0"?>
<!--
 Copyright (C) 2016 Red Hat, Inc.

 SPDX-License-Identifier: LGPL-2.1-or-later

 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.

 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: Matthias Clasen <mclasen@redhat.com>
-->

<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
  <!--
      org.freedesktop.portal.Screenshot:
      @short_description: Portal for taking screenshots

      This simple portal lets sandboxed applications request a screenshot.

      The screenshot will be made accessible to the application (which
      may involve adding it to the :ref:`Documents
      portal<org.freedesktop.portal.Documents>`).

      This documentation describes **version 3** of this interface.
  -->
  <interface name="org.freedesktop.portal.Screenshot">
    <!--
        Screenshot:
        @parent_window: Identifier for the application window, see :doc:`window-identifiers`
        @options: Vardict with optional further information
        @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call

        Takes a screenshot.

        Supported keys in the @options vardict include:

        * ``handle_token`` (``s``)

          A string that will be used as the last element of the @handle. Must be a valid
          object path element. See the :ref:`org.freedesktop.portal.Request` documentation for
          more information about the @handle.

        * ``modal`` (``b``)

          Whether the dialog should be modal. Default is yes.

        * ``interactive`` (``b``)

          Hint whether the dialog should offer customization before taking a screenshot.
          Default is no.  **Since version 2.**

        * ``target`` (``u``)

          The screenshot target. It is a single target value, not a bitmask, and
          must be one of the targets advertised in
          :ref:`org.freedesktop.portal.Screenshot:AvailableTargets`. If this
          option is omitted, the portal preserves the previous Screenshot
          behavior. Available targets are:

          - ``1``: Screen: The entire screen.
          - ``2``: Window: A window selected by the user.
          - ``4``: Area: An area selected by the user.
          - ``8``: Active Window: The currently active window.

          This option was added in version 3 of this interface.

        The following results get returned via the :ref:`org.freedesktop.portal.Request::Response`
        signal:

        * ``uri`` (``s``)

          String containing the uri of the screenshot.
    -->
    <method name="Screenshot">
      <arg type="s" name="parent_window" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="in"/>
      <arg type="o" name="handle" direction="out"/>
    </method>
    <!--
        PickColor:
        @parent_window: Identifier for the application window, see :doc:`window-identifiers`
        @options: Vardict with optional further information
        @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call

        Obtains the color of a single pixel.

        Supported keys in the @options vardict include:

        * ``handle_token`` (``s``)

          A string that will be used as the last element of the @handle. Must be a valid
          object path element. See the :ref:`org.freedesktop.portal.Request` documentation for
          more information about the @handle.

        The following results get returned via the :ref:`org.freedesktop.portal.Request::Response` signal:

        * ``color`` (``(ddd)``)

          The color, RGB values in the range [0,1], in the sRGB color space.
      -->
    <method name="PickColor">
      <arg type="s" name="parent_window" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="in"/>
      <arg type="o" name="handle" direction="out"/>
    </method>
    <!--
        AvailableTargets:

        A bitmask of available screenshot targets. Available targets are:

        - ``1``: Screen: The entire screen.
        - ``2``: Window: A window selected by the user.
        - ``4``: Area: An area selected by the user.
        - ``8``: Active Window: The currently active window.

        This property was added in version 3 of this interface.
    -->
    <property name="AvailableTargets" type="u" access="read"/>
    <property name="version" type="u" access="read"/>
  </interface>
</node>
