1b877906bSopenharmony_ci<?xml version="1.0" encoding="UTF-8"?> 2b877906bSopenharmony_ci<protocol name="pointer_constraints_unstable_v1"> 3b877906bSopenharmony_ci 4b877906bSopenharmony_ci <copyright> 5b877906bSopenharmony_ci Copyright © 2014 Jonas Ådahl 6b877906bSopenharmony_ci Copyright © 2015 Red Hat Inc. 7b877906bSopenharmony_ci 8b877906bSopenharmony_ci Permission is hereby granted, free of charge, to any person obtaining a 9b877906bSopenharmony_ci copy of this software and associated documentation files (the "Software"), 10b877906bSopenharmony_ci to deal in the Software without restriction, including without limitation 11b877906bSopenharmony_ci the rights to use, copy, modify, merge, publish, distribute, sublicense, 12b877906bSopenharmony_ci and/or sell copies of the Software, and to permit persons to whom the 13b877906bSopenharmony_ci Software is furnished to do so, subject to the following conditions: 14b877906bSopenharmony_ci 15b877906bSopenharmony_ci The above copyright notice and this permission notice (including the next 16b877906bSopenharmony_ci paragraph) shall be included in all copies or substantial portions of the 17b877906bSopenharmony_ci Software. 18b877906bSopenharmony_ci 19b877906bSopenharmony_ci THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20b877906bSopenharmony_ci IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21b877906bSopenharmony_ci FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22b877906bSopenharmony_ci THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23b877906bSopenharmony_ci LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24b877906bSopenharmony_ci FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25b877906bSopenharmony_ci DEALINGS IN THE SOFTWARE. 26b877906bSopenharmony_ci </copyright> 27b877906bSopenharmony_ci 28b877906bSopenharmony_ci <description summary="protocol for constraining pointer motions"> 29b877906bSopenharmony_ci This protocol specifies a set of interfaces used for adding constraints to 30b877906bSopenharmony_ci the motion of a pointer. Possible constraints include confining pointer 31b877906bSopenharmony_ci motions to a given region, or locking it to its current position. 32b877906bSopenharmony_ci 33b877906bSopenharmony_ci In order to constrain the pointer, a client must first bind the global 34b877906bSopenharmony_ci interface "wp_pointer_constraints" which, if a compositor supports pointer 35b877906bSopenharmony_ci constraints, is exposed by the registry. Using the bound global object, the 36b877906bSopenharmony_ci client uses the request that corresponds to the type of constraint it wants 37b877906bSopenharmony_ci to make. See wp_pointer_constraints for more details. 38b877906bSopenharmony_ci 39b877906bSopenharmony_ci Warning! The protocol described in this file is experimental and backward 40b877906bSopenharmony_ci incompatible changes may be made. Backward compatible changes may be added 41b877906bSopenharmony_ci together with the corresponding interface version bump. Backward 42b877906bSopenharmony_ci incompatible changes are done by bumping the version number in the protocol 43b877906bSopenharmony_ci and interface names and resetting the interface version. Once the protocol 44b877906bSopenharmony_ci is to be declared stable, the 'z' prefix and the version number in the 45b877906bSopenharmony_ci protocol and interface names are removed and the interface version number is 46b877906bSopenharmony_ci reset. 47b877906bSopenharmony_ci </description> 48b877906bSopenharmony_ci 49b877906bSopenharmony_ci <interface name="zwp_pointer_constraints_v1" version="1"> 50b877906bSopenharmony_ci <description summary="constrain the movement of a pointer"> 51b877906bSopenharmony_ci The global interface exposing pointer constraining functionality. It 52b877906bSopenharmony_ci exposes two requests: lock_pointer for locking the pointer to its 53b877906bSopenharmony_ci position, and confine_pointer for locking the pointer to a region. 54b877906bSopenharmony_ci 55b877906bSopenharmony_ci The lock_pointer and confine_pointer requests create the objects 56b877906bSopenharmony_ci wp_locked_pointer and wp_confined_pointer respectively, and the client can 57b877906bSopenharmony_ci use these objects to interact with the lock. 58b877906bSopenharmony_ci 59b877906bSopenharmony_ci For any surface, only one lock or confinement may be active across all 60b877906bSopenharmony_ci wl_pointer objects of the same seat. If a lock or confinement is requested 61b877906bSopenharmony_ci when another lock or confinement is active or requested on the same surface 62b877906bSopenharmony_ci and with any of the wl_pointer objects of the same seat, an 63b877906bSopenharmony_ci 'already_constrained' error will be raised. 64b877906bSopenharmony_ci </description> 65b877906bSopenharmony_ci 66b877906bSopenharmony_ci <enum name="error"> 67b877906bSopenharmony_ci <description summary="wp_pointer_constraints error values"> 68b877906bSopenharmony_ci These errors can be emitted in response to wp_pointer_constraints 69b877906bSopenharmony_ci requests. 70b877906bSopenharmony_ci </description> 71b877906bSopenharmony_ci <entry name="already_constrained" value="1" 72b877906bSopenharmony_ci summary="pointer constraint already requested on that surface"/> 73b877906bSopenharmony_ci </enum> 74b877906bSopenharmony_ci 75b877906bSopenharmony_ci <enum name="lifetime"> 76b877906bSopenharmony_ci <description summary="constraint lifetime"> 77b877906bSopenharmony_ci These values represent different lifetime semantics. They are passed 78b877906bSopenharmony_ci as arguments to the factory requests to specify how the constraint 79b877906bSopenharmony_ci lifetimes should be managed. 80b877906bSopenharmony_ci </description> 81b877906bSopenharmony_ci <entry name="oneshot" value="1"> 82b877906bSopenharmony_ci <description summary="the pointer constraint is defunct once deactivated"> 83b877906bSopenharmony_ci A oneshot pointer constraint will never reactivate once it has been 84b877906bSopenharmony_ci deactivated. See the corresponding deactivation event 85b877906bSopenharmony_ci (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for 86b877906bSopenharmony_ci details. 87b877906bSopenharmony_ci </description> 88b877906bSopenharmony_ci </entry> 89b877906bSopenharmony_ci <entry name="persistent" value="2"> 90b877906bSopenharmony_ci <description summary="the pointer constraint may reactivate"> 91b877906bSopenharmony_ci A persistent pointer constraint may again reactivate once it has 92b877906bSopenharmony_ci been deactivated. See the corresponding deactivation event 93b877906bSopenharmony_ci (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for 94b877906bSopenharmony_ci details. 95b877906bSopenharmony_ci </description> 96b877906bSopenharmony_ci </entry> 97b877906bSopenharmony_ci </enum> 98b877906bSopenharmony_ci 99b877906bSopenharmony_ci <request name="destroy" type="destructor"> 100b877906bSopenharmony_ci <description summary="destroy the pointer constraints manager object"> 101b877906bSopenharmony_ci Used by the client to notify the server that it will no longer use this 102b877906bSopenharmony_ci pointer constraints object. 103b877906bSopenharmony_ci </description> 104b877906bSopenharmony_ci </request> 105b877906bSopenharmony_ci 106b877906bSopenharmony_ci <request name="lock_pointer"> 107b877906bSopenharmony_ci <description summary="lock pointer to a position"> 108b877906bSopenharmony_ci The lock_pointer request lets the client request to disable movements of 109b877906bSopenharmony_ci the virtual pointer (i.e. the cursor), effectively locking the pointer 110b877906bSopenharmony_ci to a position. This request may not take effect immediately; in the 111b877906bSopenharmony_ci future, when the compositor deems implementation-specific constraints 112b877906bSopenharmony_ci are satisfied, the pointer lock will be activated and the compositor 113b877906bSopenharmony_ci sends a locked event. 114b877906bSopenharmony_ci 115b877906bSopenharmony_ci The protocol provides no guarantee that the constraints are ever 116b877906bSopenharmony_ci satisfied, and does not require the compositor to send an error if the 117b877906bSopenharmony_ci constraints cannot ever be satisfied. It is thus possible to request a 118b877906bSopenharmony_ci lock that will never activate. 119b877906bSopenharmony_ci 120b877906bSopenharmony_ci There may not be another pointer constraint of any kind requested or 121b877906bSopenharmony_ci active on the surface for any of the wl_pointer objects of the seat of 122b877906bSopenharmony_ci the passed pointer when requesting a lock. If there is, an error will be 123b877906bSopenharmony_ci raised. See general pointer lock documentation for more details. 124b877906bSopenharmony_ci 125b877906bSopenharmony_ci The intersection of the region passed with this request and the input 126b877906bSopenharmony_ci region of the surface is used to determine where the pointer must be 127b877906bSopenharmony_ci in order for the lock to activate. It is up to the compositor whether to 128b877906bSopenharmony_ci warp the pointer or require some kind of user interaction for the lock 129b877906bSopenharmony_ci to activate. If the region is null the surface input region is used. 130b877906bSopenharmony_ci 131b877906bSopenharmony_ci A surface may receive pointer focus without the lock being activated. 132b877906bSopenharmony_ci 133b877906bSopenharmony_ci The request creates a new object wp_locked_pointer which is used to 134b877906bSopenharmony_ci interact with the lock as well as receive updates about its state. See 135b877906bSopenharmony_ci the the description of wp_locked_pointer for further information. 136b877906bSopenharmony_ci 137b877906bSopenharmony_ci Note that while a pointer is locked, the wl_pointer objects of the 138b877906bSopenharmony_ci corresponding seat will not emit any wl_pointer.motion events, but 139b877906bSopenharmony_ci relative motion events will still be emitted via wp_relative_pointer 140b877906bSopenharmony_ci objects of the same seat. wl_pointer.axis and wl_pointer.button events 141b877906bSopenharmony_ci are unaffected. 142b877906bSopenharmony_ci </description> 143b877906bSopenharmony_ci <arg name="id" type="new_id" interface="zwp_locked_pointer_v1"/> 144b877906bSopenharmony_ci <arg name="surface" type="object" interface="wl_surface" 145b877906bSopenharmony_ci summary="surface to lock pointer to"/> 146b877906bSopenharmony_ci <arg name="pointer" type="object" interface="wl_pointer" 147b877906bSopenharmony_ci summary="the pointer that should be locked"/> 148b877906bSopenharmony_ci <arg name="region" type="object" interface="wl_region" allow-null="true" 149b877906bSopenharmony_ci summary="region of surface"/> 150b877906bSopenharmony_ci <arg name="lifetime" type="uint" enum="lifetime" summary="lock lifetime"/> 151b877906bSopenharmony_ci </request> 152b877906bSopenharmony_ci 153b877906bSopenharmony_ci <request name="confine_pointer"> 154b877906bSopenharmony_ci <description summary="confine pointer to a region"> 155b877906bSopenharmony_ci The confine_pointer request lets the client request to confine the 156b877906bSopenharmony_ci pointer cursor to a given region. This request may not take effect 157b877906bSopenharmony_ci immediately; in the future, when the compositor deems implementation- 158b877906bSopenharmony_ci specific constraints are satisfied, the pointer confinement will be 159b877906bSopenharmony_ci activated and the compositor sends a confined event. 160b877906bSopenharmony_ci 161b877906bSopenharmony_ci The intersection of the region passed with this request and the input 162b877906bSopenharmony_ci region of the surface is used to determine where the pointer must be 163b877906bSopenharmony_ci in order for the confinement to activate. It is up to the compositor 164b877906bSopenharmony_ci whether to warp the pointer or require some kind of user interaction for 165b877906bSopenharmony_ci the confinement to activate. If the region is null the surface input 166b877906bSopenharmony_ci region is used. 167b877906bSopenharmony_ci 168b877906bSopenharmony_ci The request will create a new object wp_confined_pointer which is used 169b877906bSopenharmony_ci to interact with the confinement as well as receive updates about its 170b877906bSopenharmony_ci state. See the the description of wp_confined_pointer for further 171b877906bSopenharmony_ci information. 172b877906bSopenharmony_ci </description> 173b877906bSopenharmony_ci <arg name="id" type="new_id" interface="zwp_confined_pointer_v1"/> 174b877906bSopenharmony_ci <arg name="surface" type="object" interface="wl_surface" 175b877906bSopenharmony_ci summary="surface to lock pointer to"/> 176b877906bSopenharmony_ci <arg name="pointer" type="object" interface="wl_pointer" 177b877906bSopenharmony_ci summary="the pointer that should be confined"/> 178b877906bSopenharmony_ci <arg name="region" type="object" interface="wl_region" allow-null="true" 179b877906bSopenharmony_ci summary="region of surface"/> 180b877906bSopenharmony_ci <arg name="lifetime" type="uint" enum="lifetime" summary="confinement lifetime"/> 181b877906bSopenharmony_ci </request> 182b877906bSopenharmony_ci </interface> 183b877906bSopenharmony_ci 184b877906bSopenharmony_ci <interface name="zwp_locked_pointer_v1" version="1"> 185b877906bSopenharmony_ci <description summary="receive relative pointer motion events"> 186b877906bSopenharmony_ci The wp_locked_pointer interface represents a locked pointer state. 187b877906bSopenharmony_ci 188b877906bSopenharmony_ci While the lock of this object is active, the wl_pointer objects of the 189b877906bSopenharmony_ci associated seat will not emit any wl_pointer.motion events. 190b877906bSopenharmony_ci 191b877906bSopenharmony_ci This object will send the event 'locked' when the lock is activated. 192b877906bSopenharmony_ci Whenever the lock is activated, it is guaranteed that the locked surface 193b877906bSopenharmony_ci will already have received pointer focus and that the pointer will be 194b877906bSopenharmony_ci within the region passed to the request creating this object. 195b877906bSopenharmony_ci 196b877906bSopenharmony_ci To unlock the pointer, send the destroy request. This will also destroy 197b877906bSopenharmony_ci the wp_locked_pointer object. 198b877906bSopenharmony_ci 199b877906bSopenharmony_ci If the compositor decides to unlock the pointer the unlocked event is 200b877906bSopenharmony_ci sent. See wp_locked_pointer.unlock for details. 201b877906bSopenharmony_ci 202b877906bSopenharmony_ci When unlocking, the compositor may warp the cursor position to the set 203b877906bSopenharmony_ci cursor position hint. If it does, it will not result in any relative 204b877906bSopenharmony_ci motion events emitted via wp_relative_pointer. 205b877906bSopenharmony_ci 206b877906bSopenharmony_ci If the surface the lock was requested on is destroyed and the lock is not 207b877906bSopenharmony_ci yet activated, the wp_locked_pointer object is now defunct and must be 208b877906bSopenharmony_ci destroyed. 209b877906bSopenharmony_ci </description> 210b877906bSopenharmony_ci 211b877906bSopenharmony_ci <request name="destroy" type="destructor"> 212b877906bSopenharmony_ci <description summary="destroy the locked pointer object"> 213b877906bSopenharmony_ci Destroy the locked pointer object. If applicable, the compositor will 214b877906bSopenharmony_ci unlock the pointer. 215b877906bSopenharmony_ci </description> 216b877906bSopenharmony_ci </request> 217b877906bSopenharmony_ci 218b877906bSopenharmony_ci <request name="set_cursor_position_hint"> 219b877906bSopenharmony_ci <description summary="set the pointer cursor position hint"> 220b877906bSopenharmony_ci Set the cursor position hint relative to the top left corner of the 221b877906bSopenharmony_ci surface. 222b877906bSopenharmony_ci 223b877906bSopenharmony_ci If the client is drawing its own cursor, it should update the position 224b877906bSopenharmony_ci hint to the position of its own cursor. A compositor may use this 225b877906bSopenharmony_ci information to warp the pointer upon unlock in order to avoid pointer 226b877906bSopenharmony_ci jumps. 227b877906bSopenharmony_ci 228b877906bSopenharmony_ci The cursor position hint is double buffered. The new hint will only take 229b877906bSopenharmony_ci effect when the associated surface gets it pending state applied. See 230b877906bSopenharmony_ci wl_surface.commit for details. 231b877906bSopenharmony_ci </description> 232b877906bSopenharmony_ci <arg name="surface_x" type="fixed" 233b877906bSopenharmony_ci summary="surface-local x coordinate"/> 234b877906bSopenharmony_ci <arg name="surface_y" type="fixed" 235b877906bSopenharmony_ci summary="surface-local y coordinate"/> 236b877906bSopenharmony_ci </request> 237b877906bSopenharmony_ci 238b877906bSopenharmony_ci <request name="set_region"> 239b877906bSopenharmony_ci <description summary="set a new lock region"> 240b877906bSopenharmony_ci Set a new region used to lock the pointer. 241b877906bSopenharmony_ci 242b877906bSopenharmony_ci The new lock region is double-buffered. The new lock region will 243b877906bSopenharmony_ci only take effect when the associated surface gets its pending state 244b877906bSopenharmony_ci applied. See wl_surface.commit for details. 245b877906bSopenharmony_ci 246b877906bSopenharmony_ci For details about the lock region, see wp_locked_pointer. 247b877906bSopenharmony_ci </description> 248b877906bSopenharmony_ci <arg name="region" type="object" interface="wl_region" allow-null="true" 249b877906bSopenharmony_ci summary="region of surface"/> 250b877906bSopenharmony_ci </request> 251b877906bSopenharmony_ci 252b877906bSopenharmony_ci <event name="locked"> 253b877906bSopenharmony_ci <description summary="lock activation event"> 254b877906bSopenharmony_ci Notification that the pointer lock of the seat's pointer is activated. 255b877906bSopenharmony_ci </description> 256b877906bSopenharmony_ci </event> 257b877906bSopenharmony_ci 258b877906bSopenharmony_ci <event name="unlocked"> 259b877906bSopenharmony_ci <description summary="lock deactivation event"> 260b877906bSopenharmony_ci Notification that the pointer lock of the seat's pointer is no longer 261b877906bSopenharmony_ci active. If this is a oneshot pointer lock (see 262b877906bSopenharmony_ci wp_pointer_constraints.lifetime) this object is now defunct and should 263b877906bSopenharmony_ci be destroyed. If this is a persistent pointer lock (see 264b877906bSopenharmony_ci wp_pointer_constraints.lifetime) this pointer lock may again 265b877906bSopenharmony_ci reactivate in the future. 266b877906bSopenharmony_ci </description> 267b877906bSopenharmony_ci </event> 268b877906bSopenharmony_ci </interface> 269b877906bSopenharmony_ci 270b877906bSopenharmony_ci <interface name="zwp_confined_pointer_v1" version="1"> 271b877906bSopenharmony_ci <description summary="confined pointer object"> 272b877906bSopenharmony_ci The wp_confined_pointer interface represents a confined pointer state. 273b877906bSopenharmony_ci 274b877906bSopenharmony_ci This object will send the event 'confined' when the confinement is 275b877906bSopenharmony_ci activated. Whenever the confinement is activated, it is guaranteed that 276b877906bSopenharmony_ci the surface the pointer is confined to will already have received pointer 277b877906bSopenharmony_ci focus and that the pointer will be within the region passed to the request 278b877906bSopenharmony_ci creating this object. It is up to the compositor to decide whether this 279b877906bSopenharmony_ci requires some user interaction and if the pointer will warp to within the 280b877906bSopenharmony_ci passed region if outside. 281b877906bSopenharmony_ci 282b877906bSopenharmony_ci To unconfine the pointer, send the destroy request. This will also destroy 283b877906bSopenharmony_ci the wp_confined_pointer object. 284b877906bSopenharmony_ci 285b877906bSopenharmony_ci If the compositor decides to unconfine the pointer the unconfined event is 286b877906bSopenharmony_ci sent. The wp_confined_pointer object is at this point defunct and should 287b877906bSopenharmony_ci be destroyed. 288b877906bSopenharmony_ci </description> 289b877906bSopenharmony_ci 290b877906bSopenharmony_ci <request name="destroy" type="destructor"> 291b877906bSopenharmony_ci <description summary="destroy the confined pointer object"> 292b877906bSopenharmony_ci Destroy the confined pointer object. If applicable, the compositor will 293b877906bSopenharmony_ci unconfine the pointer. 294b877906bSopenharmony_ci </description> 295b877906bSopenharmony_ci </request> 296b877906bSopenharmony_ci 297b877906bSopenharmony_ci <request name="set_region"> 298b877906bSopenharmony_ci <description summary="set a new confine region"> 299b877906bSopenharmony_ci Set a new region used to confine the pointer. 300b877906bSopenharmony_ci 301b877906bSopenharmony_ci The new confine region is double-buffered. The new confine region will 302b877906bSopenharmony_ci only take effect when the associated surface gets its pending state 303b877906bSopenharmony_ci applied. See wl_surface.commit for details. 304b877906bSopenharmony_ci 305b877906bSopenharmony_ci If the confinement is active when the new confinement region is applied 306b877906bSopenharmony_ci and the pointer ends up outside of newly applied region, the pointer may 307b877906bSopenharmony_ci warped to a position within the new confinement region. If warped, a 308b877906bSopenharmony_ci wl_pointer.motion event will be emitted, but no 309b877906bSopenharmony_ci wp_relative_pointer.relative_motion event. 310b877906bSopenharmony_ci 311b877906bSopenharmony_ci The compositor may also, instead of using the new region, unconfine the 312b877906bSopenharmony_ci pointer. 313b877906bSopenharmony_ci 314b877906bSopenharmony_ci For details about the confine region, see wp_confined_pointer. 315b877906bSopenharmony_ci </description> 316b877906bSopenharmony_ci <arg name="region" type="object" interface="wl_region" allow-null="true" 317b877906bSopenharmony_ci summary="region of surface"/> 318b877906bSopenharmony_ci </request> 319b877906bSopenharmony_ci 320b877906bSopenharmony_ci <event name="confined"> 321b877906bSopenharmony_ci <description summary="pointer confined"> 322b877906bSopenharmony_ci Notification that the pointer confinement of the seat's pointer is 323b877906bSopenharmony_ci activated. 324b877906bSopenharmony_ci </description> 325b877906bSopenharmony_ci </event> 326b877906bSopenharmony_ci 327b877906bSopenharmony_ci <event name="unconfined"> 328b877906bSopenharmony_ci <description summary="pointer unconfined"> 329b877906bSopenharmony_ci Notification that the pointer confinement of the seat's pointer is no 330b877906bSopenharmony_ci longer active. If this is a oneshot pointer confinement (see 331b877906bSopenharmony_ci wp_pointer_constraints.lifetime) this object is now defunct and should 332b877906bSopenharmony_ci be destroyed. If this is a persistent pointer confinement (see 333b877906bSopenharmony_ci wp_pointer_constraints.lifetime) this pointer confinement may again 334b877906bSopenharmony_ci reactivate in the future. 335b877906bSopenharmony_ci </description> 336b877906bSopenharmony_ci </event> 337b877906bSopenharmony_ci </interface> 338b877906bSopenharmony_ci 339b877906bSopenharmony_ci</protocol> 340