wayland.xml 14.9 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
2
<protocol name="wayland">
3

4
5
  <!-- The core global object. This is a special singleton object.
       It is used for internal wayland protocol features. -->
6
  <interface name="display" version="1">
7
8
9
10
11
    <!-- sync is an just an echo, which will reply with a sync event.
         Since requests are handled in-order, this can be used as a
         barrier to ensure all previous requests have ben handled.
         The key argument can be used to correlate between multiple
         sync invocations. -->
12
13
14
15
    <request name="sync">
      <arg name="key" type="uint"/>
    </request>

16
17
18
19
    <!-- Request notification when the next frame is displayed.
         Useful for throttling redrawing operations, and driving
         animations.  The notification will only be posted for one
         frame unless requested again. -->
20
21
22
23
    <request name="frame">
      <arg name="key" type="uint"/>
    </request>

24
25
    <!-- A request addressed a non-existent object id. This is
         tyipcally a fatal error. -->
26
27
28
29
    <event name="invalid_object">
      <arg name="object_id" type="uint"/>
    </event>

30
31
    <!-- A request tried to invoke an opcode out of range.  This is
         typically a fatal error. -->
32
33
34
35
36
    <event name="invalid_method">
      <arg name="object_id" type="uint"/>
      <arg name="opcode" type="uint"/>
    </event>

37
    <!-- A request has failed due to an out of memory error. -->
38
39
    <event name="no_memory"/>

40
41
42
43
44
45
    <!-- Notify the client of global objects. These are objects that
         are created by the server. Globals are published on the
         initial client connection sequence, upon device hotplugs,
         device disconnects, reconfiguration or other events.  The
         server will always announce an object before the object sends
         out events. -->
46
    <event name="global">
47
      <arg name="id" type="new_id" interface="object"/>
48
49
50
51
      <arg name="name" type="string"/>
      <arg name="version" type="uint"/>
    </event>

52
53
54
55
56
    <!-- Internal, deprecated, and will be changed.  This is an object
         IDs range that is used by the client to allocate object IDs
         in "new_id" type arguments.  The server sends range
         allocations to the client before the next range is about to
         be depleted. -->
57
58
59
60
    <event name="range">
      <arg name="base" type="uint"/>
    </event>

61
62
63
64
65
66
    <!-- A reply to the frame or sync request.  The key is the one
         used in the request.  time is in millisecond units, and
         denotes the time when the frame was posted on the
         display. time can be used to estimaate frame rate, determine
         how much to advance animations and compensate for jitter. -->
    <event name="key">
67
68
      <arg name="key" type="uint"/>
      <arg name="time" type="uint"/>
69
70
71
    </event>
  </interface>

72
73
74
75

  <!-- A compositor. This object is a global.  The compositor is in
       charge of combining the contents of multiple surfaces into one
       displayable output. -->
76
  <interface name="compositor" version="1">
77
78
    <!-- Factory request for a surface objects. A surface is akin to a
         window. -->
79
80
81
82
83
    <request name="create_surface">
      <arg name="id" type="new_id" interface="surface"/>
    </request>
  </interface>

84
85
86

  <!-- drm support. This object is created by the server and published
       using the display's global event. -->
87
  <interface name="drm" version="1">
88
89
90
91
    <!-- Call this request with the magic received from drmGetMagic().
         It will be passed on to the drmAuthMagic() or
         DRIAuthConnection() call.  This authentication must be
         completed before create_buffer could be used. -->
92
93
94
95
    <request name="authenticate">
      <arg name="id" type="uint"/>
    </request>

96
97
    <!-- Create a wayland buffer for the named DRM buffer.  The DRM
         surface must have a name using the flink ioctl -->
98
    <request name="create_buffer">
99
      <arg name="id" type="new_id" interface="buffer"/>
100
101
102
103
      <arg name="name" type="uint"/>
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
      <arg name="stride" type="uint"/>
104
      <arg name="visual" type="object" interface="visual"/>
105
106
    </request>

107
108
109
110
111
    <!-- Notification of the path of the drm device which is used by
         the server.  The client should use this device for creating
         local buffers.  Only buffers created from this device should
         be be passed to the server using this drm object's
         create_buffer request. -->
112
113
114
115
    <event name="device">
      <arg name="name" type="string"/>
    </event>

116
    <!-- Raised if the authenticate request succeeded -->
117
118
119
    <event name="authenticated"/>
  </interface>

120
121

  <!-- Shared memory support -->
122
  <interface name="shm" version="1">
123
124
125
126
127
128
    <!-- Transfer a shm buffer to the server.  The allocated buffer
         would include at least stride * height bytes starting at the
         beginning of fd.  The file descriptor is transferred over the
         socket using AF_UNIX magical features. width, height, stride
         and visual describe the respective properties of the pixel
         data contained in the buffer. -->
129
130
131
132
133
134
135
136
137
138
    <request name="create_buffer">
      <arg name="id" type="new_id" interface="buffer"/>
      <arg name="fd" type="fd"/>
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
      <arg name="stride" type="uint"/>
      <arg name="visual" type="object" interface="visual"/>
    </request>
  </interface>

139
140
141
142

  <!-- A pixel buffer. Created using the drm, shm or similar objects.
       It has a size, visual and contents, but not a location on the
       screen -->
143
  <interface name="buffer" version="1">
144
    <!-- Abandon a buffer.  This will invalidate the object id. -->
145
    <request name="destroy" type="destructor"/>
146
147
  </interface>

148
149
  <interface name="shell" version="1">
    <request name="move">
150
151
      <arg name="surface" type="object" interface="surface"/>
      <arg name="input_device" type="object" interface="input_device"/>
152
153
154
155
      <arg name="time" type="uint"/>
    </request>

    <request name="resize">
156
157
      <arg name="surface" type="object" interface="surface"/>
      <arg name="input_device" type="object" interface="input_device"/>
158
      <arg name="time" type="uint"/>
159
      <!-- edges is an enum, need to get the values in here -->
160
161
162
      <arg name="edges" type="uint"/>
    </request>

163
164
165
166
    <request name="create_drag">
      <arg name="id" type="new_id" interface="drag"/>
    </request>

167
168
169
170
171
172
    <!-- The configure event asks the client to resize its surface.
         The size is a hint, in the sense that the client is free to
         ignore it if it doesn't resize, pick a smaller size (to
         satisfy aspect ration or resize in steps of NxM pixels).  The
         client is free to dismiss all but the last configure event it
         received. -->
173
    <event name="configure">
174
175
176
      <arg name="time" type="uint"/>
      <!-- Same as edges except also move (16) -->
      <arg name="type" type="uint"/>
177
      <arg name="surface" type="object" interface="surface"/>
178
179
180
181
182
183
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
    </event>
  </interface>
184

185

186
187
188
189
190
191
192
  <interface name="drag" version="1">
    <!-- Add an offered mime type.  Can be called several times to
         offer multiple types, but must be called before 'activate'. -->
    <request name="offer">
      <arg name="type" type="string"/>
    </request>

193
194
195
196
197
    <request name="activate">
      <arg name="surface" type="object" interface="surface"/>
      <arg name="input_device" type="object" interface="input_device"/>
      <arg name="time" type="uint"/>
    </request>
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
    <!-- Destroy the drag and cancel the session. -->
    <request name="destroy" type="destructor"/>

    <!-- Sent when a target accepts pointer_focus or motion events.
         If a target does not accept any of the offered types, type is
         NULL -->
    <event name="target">
      <arg name="mime_type" type="string"/>
    </event>

    <!-- Sent when the drag is finished.  The final mime type is that
         of the last target event.  If that was NULL, no drag target
         was valid when the drag finished, fd is undefined and the
         source should not send data.  The event is also sent in case
         a drag source tries to activate a drag after the grab was
         released, in which case mime_type will also be NULL. -->
    <event name="finish">
      <arg name="fd" type="fd"/>
    </event>
218
219

    <event name="reject"/>
220
  </interface>
221

222
223
224

  <interface name="drag_offer" version="1">
    <!-- Call to accept the offer of the given type -->
225
    <request name="accept">
226
      <arg name="time" type="uint"/>
227
228
229
      <arg name="type" type="string"/>
    </request>

230
231
232
    <!-- Called to initiate the drag finish sequence.  Sends the pipe
         fd to the compositor, which forwards it to the source in the
         'finish' event -->
233
234
235
236
    <request name="receive">
      <arg name="fd" type="fd"/>
    </request>

237
238
239
    <!-- Called to reject a drop  -->
    <request name="reject"/>

240
241
242
243
    <!-- Sent before the pointer_focus event to announce the types
         offered.  One event per offered mime type. -->
    <event name="offer">
      <arg name="type" type="string"/>
244
245
    </event>

246
247
248
249
250
    <!-- Similar to device::pointer_focus.  Sent to potential target
         surfaces to offer drag data.  If the device leaves the
         window, the drag stops or the originator cancels the drag,
         this event is sent with the NULL surface, at which point the
         drag object may no longer be valid. -->
251
252
253
254
255
256
257
258
259
260
    <event name="pointer_focus">
      <arg name="time" type="uint"/>
      <arg name="surface" type="object" interface="surface"/>
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="surface_x" type="int"/>
      <arg name="surface_y" type="int"/>
    </event>

    <!-- Similar to device::motion.  Sent to potential target surfaces
261
         as the drag pointer moves around in the surface. -->
262
263
264
265
266
267
268
269
    <event name="motion">
      <arg name="time" type="uint"/>
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="surface_x" type="int"/>
      <arg name="surface_y" type="int"/>
    </event>

270
271
272
273
    <!-- Sent to indicate that the drag is finishing.  The last
         motion/pointer_focus event gives the location of the drop.
         Target must respond with the 'receive' request, which sends
         an fd to the source for writing the drag data. -->
274
    <event name="drop"/>
275
  </interface>
276

277
278
279

  <!-- A surface. This is an image that is displayed on the screen.
       It has a location, size and pixel contents. Similar to a window. -->
280
  <interface name="surface" version="1">
281
    <!-- Deletes the surface and invalidates its object id. -->
282
    <request name="destroy" type="destructor"/>
283

284
    <!-- Copy the contents of a buffer into this surface. -->
285
    <request name="attach">
286
      <arg name="buffer" type="object" interface="buffer"/>
287
288
    </request>

289
290
    <!-- Set the location on the screen that this surface will
         be displayed. -->
291
292
293
294
295
296
297
    <request name="map">
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
    </request>

298
299
300
301
302
303
    <!-- Notify the server that the attached buffer's contents have
         changed, and request a redraw. The arguments allow you to
         damage only a part of the surface, but the server may ignore
         it and redraw the entire contents of the surface.  To
         describe a more complicated area of damage, use this request
         several times. -->
304
305
306
307
308
309
310
311
    <request name="damage">
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
    </request>
  </interface>

312
313
314
315
316
317

  <!-- A group of keyboards and pointer devices (mice, for
       example). This object is published as a global during start up,
       or when such a device is hot plugged.  A input_device group
       typically has a pointer and maintains a keyboard_focus and a
       pointer_focus.  -->
318
  <interface name="input_device" version="1">
319
320
321
    <!-- Set the pointer's image.  This request only takes effect if
         the pointer focus for this device is one of the requesting
         clients surfaces.  -->
322
    <request name="attach">
323
      <arg name="time" type="uint"/>
324
325
326
327
328
      <arg name="buffer" type="object" interface="buffer"/>
      <arg name="hotspot_x" type="int"/>
      <arg name="hotspot_y" type="int"/>
    </request>

329
330
331
    <!-- Notification of pointer location change.
         x,y are the absolute location on the screen.
         surface_[xy] are the location relative to the focused surface. -->
332
333
334
335
336
337
338
339
    <event name="motion">
      <arg name="time" type="uint"/>
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="surface_x" type="int"/>
      <arg name="surface_y" type="int"/>
    </event>

340
341
342
    <!-- Mouse button click and release notifications.  The location
         of the click is given by the last motion or pointer_focus
         event. -->
343
344
345
346
347
348
    <event name="button">
      <arg name="time" type="uint"/>
      <arg name="button" type="uint"/>
      <arg name="state" type="uint"/>
    </event>

349
    <!-- Keyboard press. -->
350
351
352
353
354
355
    <event name="key">
      <arg name="time" type="uint"/>
      <arg name="key" type="uint"/>
      <arg name="state" type="uint"/>
    </event>

356
357
358
359
    <!-- Notification that this input device's pointer is focused on
         certain surface. When an input_device enters a surface, the
         pointer image is undefined and a client should respond to
         this event by setting an apropriate pointer image. -->
360
361
    <event name="pointer_focus">
      <arg name="time" type="uint"/>
362
      <arg name="surface" type="object" interface="surface"/>
363
364
365
366
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
      <arg name="surface_x" type="int"/>
      <arg name="surface_y" type="int"/>
367
368
369
370
    </event>

    <event name="keyboard_focus">
      <arg name="time" type="uint"/>
371
      <arg name="surface" type="object" interface="surface"/>
372
373
374
375
      <arg name="keys" type="array"/>
    </event>
  </interface>

376
377
378
379
380
381
382
383

  <!-- An output describes part of the compositor geometry.  The
       compositor work in the 'compositor coordinate system' and an
       output corresponds to rectangular area in that space that is
       actually visible.  This typically corresponds to a monitor that
       displays part of the compositor space.  This object is
       published as global during start up, or when a screen is hot
       plugged.  -->
384
  <interface name="output" version="1">
385
    <!-- Notification about the screen size. -->
386
    <event name="geometry">
387
388
      <arg name="x" type="int"/>
      <arg name="y" type="int"/>
389
390
391
392
393
394
      <arg name="width" type="int"/>
      <arg name="height" type="int"/>
    </event>
  </interface>


395
396
397
398
399
400
  <!-- A visual is the pixel format.  The different visuals are
       currently only identified by the order they are advertised by
       the 'global' events.  We need something better.  -->
  <interface name="visual" version="1"/>

</protocol>