🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
15 KiB

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