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