Warning, /plasma/kwin/src/wayland/protocols/xdg-toplevel-drag-v1.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <protocol name="xdg_toplevel_drag_v1">
0003 
0004   <copyright>
0005     Copyright 2023 David Redondo
0006 
0007     Permission is hereby granted, free of charge, to any person obtaining a
0008     copy of this software and associated documentation files (the "Software"),
0009     to deal in the Software without restriction, including without limitation
0010     the rights to use, copy, modify, merge, publish, distribute, sublicense,
0011     and/or sell copies of the Software, and to permit persons to whom the
0012     Software is furnished to do so, subject to the following conditions:
0013 
0014     The above copyright notice and this permission notice (including the next
0015     paragraph) shall be included in all copies or substantial portions of the
0016     Software.
0017 
0018     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0019     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0020     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0021     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0022     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0023     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
0024     DEALINGS IN THE SOFTWARE.
0025   </copyright>
0026 
0027   <interface name="xdg_toplevel_drag_manager_v1" version="1">
0028     <description summary="Move a window during a drag">
0029       This protocol enhances normal drag and drop with the ability to move a
0030       window at the same time. This allows having detachable parts of a window
0031       that when dragged out of it become a new window and can be dragged over
0032       an existing window to be reattached.
0033 
0034       A typical workflow would be when the user starts dragging on top of a
0035       detachable part of a window, the client would create a wl_data_source and
0036       a xdg_toplevel_drag_v1 object and start the drag as normal via
0037       wl_data_device.start_drag. Once the client determines that the detachable
0038       window contents should be detached from the originating window, it creates
0039       a new xdg_toplevel with these contents and issues a
0040       xdg_toplevel_drag_v1.attach request before mapping it. From now on the new
0041       window is moved by the compositor during the drag as if the client called
0042       xdg_toplevel.move.
0043 
0044       Dragging an existing window is similar. The client creates a
0045       xdg_toplevel_drag_v1 object and attaches the existing toplevel before
0046       starting the drag.
0047 
0048       Clients use the existing drag and drop mechanism to detect when a window
0049       can be docked or undocked. If the client wants to snap a window into a
0050       parent window it should delete or unmap the dragged top-level. If the
0051       contents should be detached again it attaches a new toplevel as described
0052       above. If a drag operation is cancelled without being dropped, clients
0053       should revert to the previous state, deleting any newly created windows
0054       as appropriate. When a drag operation ends as indicated by
0055       wl_data_source.dnd_drop_performed the dragged toplevel window's final
0056       position is determined as if a xdg_toplevel_move operation ended.
0057 
0058       Warning! The protocol described in this file is currently in the testing
0059       phase. Backward compatible changes may be added together with the
0060       corresponding interface version bump. Backward incompatible changes can
0061       only be done by creating a new major version of the extension.
0062     </description>
0063 
0064     <enum name="error">
0065       <entry name="invalid_source" value="0"
0066              summary="data_source already used for toplevel drag"/>
0067     </enum>
0068 
0069     <request name="destroy" type="destructor">
0070       <description summary="destroy the xdg_toplevel_drag_manager_v1 object">
0071         Destroy this xdg_toplevel_drag_manager_v1 object. Other objects,
0072         including xdg_toplevel_drag_v1 objects created by this factory, are not
0073         affected by this request.
0074       </description>
0075     </request>
0076 
0077     <request name="get_xdg_toplevel_drag">
0078       <description summary="get an xdg_toplevel_drag for a wl_data_source">
0079         Create an xdg_toplevel_drag for a drag and drop operation that is going
0080         to be started with data_source.
0081 
0082         This request can only be made on sources used in drag-and-drop, so it
0083         must be performed before wl_data_device.start_drag. Attempting to use
0084         the source other than for drag-and-drop such as in
0085         wl_data_device.set_selection will raise an invalid_source error.
0086 
0087         Destroying data_source while a toplevel is attached to the
0088         xdg_toplevel_drag is undefined.
0089       </description>
0090 
0091       <arg name="id" type="new_id" interface="xdg_toplevel_drag_v1"/>
0092       <arg name="data_source" type="object" interface="wl_data_source"/>
0093     </request>
0094   </interface>
0095 
0096   <interface name="xdg_toplevel_drag_v1" version="1">
0097     <description summary="Object representing a toplevel move during a drag">
0098     </description>
0099 
0100     <enum name="error">
0101       <entry name="toplevel_attached" value="0"
0102              summary="valid toplevel already attached"/>
0103       <entry name="ongoing_drag" value="1"
0104              summary="drag has not ended" />
0105     </enum>
0106 
0107     <request name="destroy" type="destructor">
0108       <description summary="destroy an xdg_toplevel_drag_v1 object">
0109         Destroy this xdg_toplevel_drag_v1 object. This request must only be
0110         called after the underlying wl_data_source drag has ended, as indicated
0111         by the dnd_drop_performed or cancelled events. In any other case an
0112         ongoing_drag error is raised.
0113       </description>
0114     </request>
0115 
0116     <request name="attach">
0117       <description summary="Move a toplevel with the drag operation">
0118         Request that the window will be moved with the cursor during the drag
0119         operation. The offset is a hint to the compositor how the toplevel
0120         should be positioned relative to the cursor hotspot in surface local
0121         coordinates. For example it might only be used when an unmapped window
0122         is attached. The attached window does not participate in the selection
0123         of the drag target.
0124 
0125         If the toplevel is unmapped while it is attached, it is automatically
0126         detached from the drag. In this case this request has to be called again
0127         if the window should be attached after it is remapped.
0128 
0129         This request can be called multiple times but issuing it while a
0130         toplevel with an active role is attached raises a toplevel_attached
0131         error.
0132       </description>
0133 
0134       <arg name="toplevel" type="object" interface="xdg_toplevel"/>
0135       <arg name="x_offset" type="int" summary="dragged surface x offset"/>
0136       <arg name="y_offset" type="int" summary="dragged surface y offset"/>
0137     </request>
0138 
0139   </interface>
0140 </protocol>