xdg-foreign-unstable-v2.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <protocol name="xdg_foreign_unstable_v2">
  3. <copyright>
  4. Copyright © 2015-2016 Red Hat Inc.
  5. Permission is hereby granted, free of charge, to any person obtaining a
  6. copy of this software and associated documentation files (the "Software"),
  7. to deal in the Software without restriction, including without limitation
  8. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. and/or sell copies of the Software, and to permit persons to whom the
  10. Software is furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice (including the next
  12. paragraph) shall be included in all copies or substantial portions of the
  13. Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. DEALINGS IN THE SOFTWARE.
  21. </copyright>
  22. <description summary="Protocol for exporting xdg surface handles">
  23. This protocol specifies a way for making it possible to reference a surface
  24. of a different client. With such a reference, a client can, by using the
  25. interfaces provided by this protocol, manipulate the relationship between
  26. its own surfaces and the surface of some other client. For example, stack
  27. some of its own surface above the other clients surface.
  28. In order for a client A to get a reference of a surface of client B, client
  29. B must first export its surface using xdg_exporter.export_toplevel. Upon
  30. doing this, client B will receive a handle (a unique string) that it may
  31. share with client A in some way (for example D-Bus). After client A has
  32. received the handle from client B, it may use xdg_importer.import_toplevel
  33. to create a reference to the surface client B just exported. See the
  34. corresponding requests for details.
  35. A possible use case for this is out-of-process dialogs. For example when a
  36. sandboxed client without file system access needs the user to select a file
  37. on the file system, given sandbox environment support, it can export its
  38. surface, passing the exported surface handle to an unsandboxed process that
  39. can show a file browser dialog and stack it above the sandboxed client's
  40. surface.
  41. Warning! The protocol described in this file is experimental and backward
  42. incompatible changes may be made. Backward compatible changes may be added
  43. together with the corresponding interface version bump. Backward
  44. incompatible changes are done by bumping the version number in the protocol
  45. and interface names and resetting the interface version. Once the protocol
  46. is to be declared stable, the 'z' prefix and the version number in the
  47. protocol and interface names are removed and the interface version number is
  48. reset.
  49. </description>
  50. <interface name="zxdg_exporter_v2" version="1">
  51. <description summary="interface for exporting surfaces">
  52. A global interface used for exporting surfaces that can later be imported
  53. using xdg_importer.
  54. </description>
  55. <request name="destroy" type="destructor">
  56. <description summary="destroy the xdg_exporter object">
  57. Notify the compositor that the xdg_exporter object will no longer be
  58. used.
  59. </description>
  60. </request>
  61. <enum name="error">
  62. <description summary="error values">
  63. These errors can be emitted in response to invalid xdg_exporter
  64. requests.
  65. </description>
  66. <entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
  67. </enum>
  68. <request name="export_toplevel">
  69. <description summary="export a toplevel surface">
  70. The export_toplevel request exports the passed surface so that it can later be
  71. imported via xdg_importer. When called, a new xdg_exported object will
  72. be created and xdg_exported.handle will be sent immediately. See the
  73. corresponding interface and event for details.
  74. A surface may be exported multiple times, and each exported handle may
  75. be used to create an xdg_imported multiple times. Only xdg_toplevel
  76. equivalent surfaces may be exported, otherwise an invalid_surface
  77. protocol error is sent.
  78. </description>
  79. <arg name="id" type="new_id" interface="zxdg_exported_v2"
  80. summary="the new xdg_exported object"/>
  81. <arg name="surface" type="object" interface="wl_surface"
  82. summary="the surface to export"/>
  83. </request>
  84. </interface>
  85. <interface name="zxdg_importer_v2" version="1">
  86. <description summary="interface for importing surfaces">
  87. A global interface used for importing surfaces exported by xdg_exporter.
  88. With this interface, a client can create a reference to a surface of
  89. another client.
  90. </description>
  91. <request name="destroy" type="destructor">
  92. <description summary="destroy the xdg_importer object">
  93. Notify the compositor that the xdg_importer object will no longer be
  94. used.
  95. </description>
  96. </request>
  97. <request name="import_toplevel">
  98. <description summary="import a toplevel surface">
  99. The import_toplevel request imports a surface from any client given a handle
  100. retrieved by exporting said surface using xdg_exporter.export_toplevel.
  101. When called, a new xdg_imported object will be created. This new object
  102. represents the imported surface, and the importing client can
  103. manipulate its relationship using it. See xdg_imported for details.
  104. </description>
  105. <arg name="id" type="new_id" interface="zxdg_imported_v2"
  106. summary="the new xdg_imported object"/>
  107. <arg name="handle" type="string"
  108. summary="the exported surface handle"/>
  109. </request>
  110. </interface>
  111. <interface name="zxdg_exported_v2" version="1">
  112. <description summary="an exported surface handle">
  113. An xdg_exported object represents an exported reference to a surface. The
  114. exported surface may be referenced as long as the xdg_exported object not
  115. destroyed. Destroying the xdg_exported invalidates any relationship the
  116. importer may have established using xdg_imported.
  117. </description>
  118. <request name="destroy" type="destructor">
  119. <description summary="unexport the exported surface">
  120. Revoke the previously exported surface. This invalidates any
  121. relationship the importer may have set up using the xdg_imported created
  122. given the handle sent via xdg_exported.handle.
  123. </description>
  124. </request>
  125. <event name="handle">
  126. <description summary="the exported surface handle">
  127. The handle event contains the unique handle of this exported surface
  128. reference. It may be shared with any client, which then can use it to
  129. import the surface by calling xdg_importer.import_toplevel. A handle
  130. may be used to import the surface multiple times.
  131. </description>
  132. <arg name="handle" type="string" summary="the exported surface handle"/>
  133. </event>
  134. </interface>
  135. <interface name="zxdg_imported_v2" version="1">
  136. <description summary="an imported surface handle">
  137. An xdg_imported object represents an imported reference to surface exported
  138. by some client. A client can use this interface to manipulate
  139. relationships between its own surfaces and the imported surface.
  140. </description>
  141. <enum name="error">
  142. <description summary="error values">
  143. These errors can be emitted in response to invalid xdg_imported
  144. requests.
  145. </description>
  146. <entry name="invalid_surface" value="0" summary="surface is not an xdg_toplevel"/>
  147. </enum>
  148. <request name="destroy" type="destructor">
  149. <description summary="destroy the xdg_imported object">
  150. Notify the compositor that it will no longer use the xdg_imported
  151. object. Any relationship that may have been set up will at this point
  152. be invalidated.
  153. </description>
  154. </request>
  155. <request name="set_parent_of">
  156. <description summary="set as the parent of some surface">
  157. Set the imported surface as the parent of some surface of the client.
  158. The passed surface must be an xdg_toplevel equivalent, otherwise an
  159. invalid_surface protocol error is sent. Calling this function sets up
  160. a surface to surface relation with the same stacking and positioning
  161. semantics as xdg_toplevel.set_parent.
  162. </description>
  163. <arg name="surface" type="object" interface="wl_surface"
  164. summary="the child surface"/>
  165. </request>
  166. <event name="destroyed">
  167. <description summary="the imported surface handle has been destroyed">
  168. The imported surface handle has been destroyed and any relationship set
  169. up has been invalidated. This may happen for various reasons, for
  170. example if the exported surface or the exported surface handle has been
  171. destroyed, if the handle used for importing was invalid.
  172. </description>
  173. </event>
  174. </interface>
  175. </protocol>