]> git.sesse.net Git - vlc/blob - modules/video_filter/remoteosd_rfbproto.h
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_filter / remoteosd_rfbproto.h
1 /*
2  *  Copyright (C) 2002 RealVNC Ltd.  All Rights Reserved.
3  *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
4  *
5  *  This is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This software is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this software; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
18  *  USA.
19  */
20
21 /*
22  * rfbproto.h - header file for the RFB protocol version 3.3
23  *
24  * Uses types CARD<n> for an n-bit unsigned integer, INT<n> for an n-bit signed
25  * integer (for n = 8, 16 and 32).
26  *
27  * All multiple byte integers are in big endian (network) order (most
28  * significant byte first).  Unless noted otherwise there is no special
29  * alignment of protocol structures.
30  *
31  *
32  * Once the initial handshaking is done, all messages start with a type byte,
33  * (usually) followed by message-specific data.  The order of definitions in
34  * this file is as follows:
35  *
36  *  (1) Structures used in several types of message.
37  *  (2) Structures used in the initial handshaking.
38  *  (3) Message types.
39  *  (4) Encoding types.
40  *  (5) For each message type, the form of the data following the type byte.
41  *      Sometimes this is defined by a single structure but the more complex
42  *      messages have to be explained by comments.
43  */
44
45 /*****************************************************************************
46  *
47  * Structures used in several messages
48  *
49  *****************************************************************************/
50
51 #include "inttypes.h"
52 #define CARD8  uint8_t
53 #define CARD16 uint16_t
54 #define CARD32 uint32_t
55
56 /*-----------------------------------------------------------------------------
57  * Structure used to specify a rectangle.  This structure is a multiple of 4
58  * bytes so that it can be interspersed with 32-bit pixel data without
59  * affecting alignment.
60  */
61 typedef struct {
62     CARD16 x;
63     CARD16 y;
64     CARD16 w;
65     CARD16 h;
66 } rfbRectangle;
67
68 #define sz_rfbRectangle 8
69
70
71 /*-----------------------------------------------------------------------------
72  * Structure used to specify pixel format.
73  */
74
75 typedef struct {
76
77     CARD8 bitsPerPixel;         /* 8,16,32 only */
78
79     CARD8 depth;                /* 8 to 32 */
80
81     CARD8 bigEndian;            /* True if multi-byte pixels are interpreted
82                                    as big endian, or if single-bit-per-pixel
83                                    has most significant bit of the byte
84                                    corresponding to first (leftmost) pixel. Of
85                                    course this is meaningless for 8 bits/pix */
86
87     CARD8 trueColour;           /* If false then we need a "colour map" to
88                                    convert pixels to RGB.  If true, xxxMax and
89                                    xxxShift specify bits used for red, green
90                                    and blue */
91
92     /* the following fields are only meaningful if trueColour is true */
93
94     CARD16 redMax;              /* maximum red value (= 2^n - 1 where n is the
95                                    number of bits used for red). Note this
96                                    value is always in big endian order. */
97
98     CARD16 greenMax;            /* similar for green */
99
100     CARD16 blueMax;             /* and blue */
101
102     CARD8 redShift;             /* number of shifts needed to get the red
103                                    value in a pixel to the least significant
104                                    bit. To find the red value from a given
105                                    pixel, do the following:
106                                    1) Swap pixel value according to bigEndian
107                                       (e.g. if bigEndian is false and host byte
108                                       order is big endian, then swap).
109                                    2) Shift right by redShift.
110                                    3) AND with redMax (in host byte order).
111                                    4) You now have the red value between 0 and
112                                       redMax. */
113
114     CARD8 greenShift;           /* similar for green */
115
116     CARD8 blueShift;            /* and blue */
117
118     CARD8 pad1;
119     CARD16 pad2;
120
121 } rfbPixelFormat;
122
123 #define sz_rfbPixelFormat 16
124
125
126
127 /*****************************************************************************
128  *
129  * Initial handshaking messages
130  *
131  *****************************************************************************/
132
133 /*-----------------------------------------------------------------------------
134  * Protocol Version
135  *
136  * The server always sends 12 bytes to start which identifies the latest RFB
137  * protocol version number which it supports.  These bytes are interpreted
138  * as a string of 12 ASCII characters in the format "RFB xxx.yyy\n" where
139  * xxx and yyy are the major and minor version numbers (for version 3.3
140  * this is "RFB 003.003\n").
141  *
142  * The client then replies with a similar 12-byte message giving the version
143  * number of the protocol which should actually be used (which may be different
144  * to that quoted by the server).
145  *
146  * It is intended that both clients and servers may provide some level of
147  * backwards compatibility by this mechanism.  Servers in particular should
148  * attempt to provide backwards compatibility, and even forwards compatibility
149  * to some extent.  For example if a client demands version 3.1 of the
150  * protocol, a 3.0 server can probably assume that by ignoring requests for
151  * encoding types it doesn't understand, everything will still work OK.  This
152  * will probably not be the case for changes in the major version number.
153  *
154  * The format string below can be used in sprintf or sscanf to generate or
155  * decode the version string respectively.
156  */
157
158 #define rfbProtocolVersionFormat "RFB %03d.%03d\n"
159 #define rfbProtocolMajorVersion 3
160 #define rfbProtocolMinorVersion 3
161
162 typedef char rfbProtocolVersionMsg[13]; /* allow extra byte for null */
163
164 #define sz_rfbProtocolVersionMsg 12
165
166
167 /*-----------------------------------------------------------------------------
168  * Authentication
169  *
170  * Once the protocol version has been decided, the server then sends a 32-bit
171  * word indicating whether any authentication is needed on the connection.
172  * The value of this word determines the authentication scheme in use.  For
173  * version 3.0 of the protocol this may have one of the following values:
174  */
175
176 #define rfbConnFailed 0
177 #define rfbNoAuth 1
178 #define rfbVncAuth 2
179
180 /*
181  * rfbConnFailed:       For some reason the connection failed (e.g. the server
182  *                      cannot support the desired protocol version).  This is
183  *                      followed by a string describing the reason (where a
184  *                      string is specified as a 32-bit length followed by that
185  *                      many ASCII characters).
186  *
187  * rfbNoAuth:           No authentication is needed.
188  *
189  * rfbVncAuth:          The VNC authentication scheme is to be used.  A 16-byte
190  *                      challenge follows, which the client encrypts as
191  *                      appropriate using the password and sends the resulting
192  *                      16-byte response.  If the response is correct, the
193  *                      server sends the 32-bit word rfbVncAuthOK.  If a simple
194  *                      failure happens, the server sends rfbVncAuthFailed and
195  *                      closes the connection. If the server decides that too
196  *                      many failures have occurred, it sends rfbVncAuthTooMany
197  *                      and closes the connection.  In the latter case, the
198  *                      server should not allow an immediate reconnection by
199  *                      the client.
200  */
201
202 #define rfbVncAuthOK 0
203 #define rfbVncAuthFailed 1
204 #define rfbVncAuthTooMany 2
205
206
207 /*-----------------------------------------------------------------------------
208  * Client Initialisation Message
209  *
210  * Once the client and server are sure that they're happy to talk to one
211  * another, the client sends an initialisation message.  At present this
212  * message only consists of a boolean indicating whether the server should try
213  * to share the desktop by leaving other clients connected, or give exclusive
214  * access to this client by disconnecting all other clients.
215  */
216
217 typedef struct {
218     CARD8 shared;
219 } rfbClientInitMsg;
220
221 #define sz_rfbClientInitMsg 1
222
223
224 /*-----------------------------------------------------------------------------
225  * Server Initialisation Message
226  *
227  * After the client initialisation message, the server sends one of its own.
228  * This tells the client the width and height of the server's framebuffer,
229  * its pixel format and the name associated with the desktop.
230  */
231
232 typedef struct {
233     CARD16 framebufferWidth;
234     CARD16 framebufferHeight;
235     rfbPixelFormat format;      /* the server's preferred pixel format */
236     CARD32 nameLength;
237     /* followed by char name[nameLength] */
238 } rfbServerInitMsg;
239
240 #define sz_rfbServerInitMsg (8 + sz_rfbPixelFormat)
241
242
243 /*
244  * Following the server initialisation message it's up to the client to send
245  * whichever protocol messages it wants.  Typically it will send a
246  * SetPixelFormat message and a SetEncodings message, followed by a
247  * FramebufferUpdateRequest.  From then on the server will send
248  * FramebufferUpdate messages in response to the client's
249  * FramebufferUpdateRequest messages.  The client should send
250  * FramebufferUpdateRequest messages with incremental set to true when it has
251  * finished processing one FramebufferUpdate and is ready to process another.
252  * With a fast client, the rate at which FramebufferUpdateRequests are sent
253  * should be regulated to avoid hogging the network.
254  */
255
256
257
258 /*****************************************************************************
259  *
260  * Message types
261  *
262  *****************************************************************************/
263
264 /* server -> client */
265
266 #define rfbFramebufferUpdate 0
267 #define rfbSetColourMapEntries 1
268 #define rfbBell 2
269 #define rfbServerCutText 3
270 #define rfbReSizeFrameBuffer 0xF
271
272
273 /* client -> server */
274
275 #define rfbSetPixelFormat 0
276 #define rfbFixColourMapEntries 1        /* not currently supported */
277 #define rfbSetEncodings 2
278 #define rfbFramebufferUpdateRequest 3
279 #define rfbKeyEvent 4
280 #define rfbPointerEvent 5
281 #define rfbClientCutText 6
282 #define rfbSetScaleFactor 0xF
283
284
285
286
287 /*****************************************************************************
288  *
289  * Encoding types
290  *
291  *****************************************************************************/
292
293 #define rfbEncodingRaw 0
294 #define rfbEncodingCopyRect 1
295 #define rfbEncodingRRE 2
296 #define rfbEncodingCoRRE 4
297 #define rfbEncodingHextile 5
298 #define rfbEncodingZRLE 16
299
300
301
302 /*****************************************************************************
303  *
304  * Server -> client message definitions
305  *
306  *****************************************************************************/
307
308
309 /*-----------------------------------------------------------------------------
310  * FramebufferUpdate - a block of rectangles to be copied to the framebuffer.
311  *
312  * This message consists of a header giving the number of rectangles of pixel
313  * data followed by the rectangles themselves.  The header is padded so that
314  * together with the type byte it is an exact multiple of 4 bytes (to help
315  * with alignment of 32-bit pixels):
316  */
317
318 typedef struct {
319     CARD8 type;                 /* always rfbFramebufferUpdate */
320     CARD8 pad;
321     CARD16 nRects;
322     /* followed by nRects rectangles */
323 } rfbFramebufferUpdateMsg;
324
325 #define sz_rfbFramebufferUpdateMsg 4
326
327 /*
328  * Each rectangle of pixel data consists of a header describing the position
329  * and size of the rectangle and a type word describing the encoding of the
330  * pixel data, followed finally by the pixel data.  Note that if the client has
331  * not sent a SetEncodings message then it will only receive raw pixel data.
332  * Also note again that this structure is a multiple of 4 bytes.
333  */
334
335 typedef struct {
336     rfbRectangle r;
337     CARD32 encoding;    /* one of the encoding types rfbEncoding... */
338 } rfbFramebufferUpdateRectHeader;
339
340 #define sz_rfbFramebufferUpdateRectHeader (sz_rfbRectangle + 4)
341
342
343 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
344  * Raw Encoding.  Pixels are sent in top-to-bottom scanline order,
345  * left-to-right within a scanline with no padding in between.
346  */
347
348
349 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
350  * CopyRect Encoding.  The pixels are specified simply by the x and y position
351  * of the source rectangle.
352  */
353
354 typedef struct {
355     CARD16 srcX;
356     CARD16 srcY;
357 } rfbCopyRect;
358
359 #define sz_rfbCopyRect 4
360
361
362 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
363  * RRE - Rise-and-Run-length Encoding.  We have an rfbRREHeader structure
364  * giving the number of subrectangles following.  Finally the data follows in
365  * the form [<bgpixel><subrect><subrect>...] where each <subrect> is
366  * [<pixel><rfbRectangle>].
367  */
368
369 typedef struct {
370     CARD32 nSubrects;
371 } rfbRREHeader;
372
373 #define sz_rfbRREHeader 4
374
375
376 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
377  * CoRRE - Compact RRE Encoding.  We have an rfbRREHeader structure giving
378  * the number of subrectangles following.  Finally the data follows in the form
379  * [<bgpixel><subrect><subrect>...] where each <subrect> is
380  * [<pixel><rfbCoRRERectangle>].  This means that
381  * the whole rectangle must be at most 255x255 pixels.
382  */
383
384 typedef struct {
385     CARD8 x;
386     CARD8 y;
387     CARD8 w;
388     CARD8 h;
389 } rfbCoRRERectangle;
390
391 #define sz_rfbCoRRERectangle 4
392
393
394 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
395  * Hextile Encoding.  The rectangle is divided up into "tiles" of 16x16 pixels,
396  * starting at the top left going in left-to-right, top-to-bottom order.  If
397  * the width of the rectangle is not an exact multiple of 16 then the width of
398  * the last tile in each row will be correspondingly smaller.  Similarly if the
399  * height is not an exact multiple of 16 then the height of each tile in the
400  * final row will also be smaller.  Each tile begins with a "subencoding" type
401  * byte, which is a mask made up of a number of bits.  If the Raw bit is set
402  * then the other bits are irrelevant; w*h pixel values follow (where w and h
403  * are the width and height of the tile).  Otherwise the tile is encoded in a
404  * similar way to RRE, except that the position and size of each subrectangle
405  * can be specified in just two bytes.  The other bits in the mask are as
406  * follows:
407  *
408  * BackgroundSpecified - if set, a pixel value follows which specifies
409  *    the background colour for this tile.  The first non-raw tile in a
410  *    rectangle must have this bit set.  If this bit isn't set then the
411  *    background is the same as the last tile.
412  *
413  * ForegroundSpecified - if set, a pixel value follows which specifies
414  *    the foreground colour to be used for all subrectangles in this tile.
415  *    If this bit is set then the SubrectsColoured bit must be zero.
416  *
417  * AnySubrects - if set, a single byte follows giving the number of
418  *    subrectangles following.  If not set, there are no subrectangles (i.e.
419  *    the whole tile is just solid background colour).
420  *
421  * SubrectsColoured - if set then each subrectangle is preceded by a pixel
422  *    value giving the colour of that subrectangle.  If not set, all
423  *    subrectangles are the same colour, the foreground colour;  if the
424  *    ForegroundSpecified bit wasn't set then the foreground is the same as
425  *    the last tile.
426  *
427  * The position and size of each subrectangle is specified in two bytes.  The
428  * Pack macros below can be used to generate the two bytes from x, y, w, h,
429  * and the Extract macros can be used to extract the x, y, w, h values from
430  * the two bytes.
431  */
432
433 #define rfbHextileRaw                   (1 << 0)
434 #define rfbHextileBackgroundSpecified   (1 << 1)
435 #define rfbHextileForegroundSpecified   (1 << 2)
436 #define rfbHextileAnySubrects           (1 << 3)
437 #define rfbHextileSubrectsColoured      (1 << 4)
438
439 #define rfbHextilePackXY(x,y) (((x) << 4) | (y))
440 #define rfbHextilePackWH(w,h) ((((w)-1) << 4) | ((h)-1))
441 #define rfbHextileExtractX(byte) ((byte) >> 4)
442 #define rfbHextileExtractY(byte) ((byte) & 0xf)
443 #define rfbHextileExtractW(byte) (((byte) >> 4) + 1)
444 #define rfbHextileExtractH(byte) (((byte) & 0xf) + 1)
445
446
447 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
448  * ZRLE - encoding combining Zlib compression, tiling, palettisation and
449  * run-length encoding.
450  */
451
452 typedef struct {
453     CARD32 length;
454 } rfbZRLEHeader;
455
456 #define sz_rfbZRLEHeader 4
457
458 #define rfbZRLETileWidth 64
459 #define rfbZRLETileHeight 64
460
461
462 /*-----------------------------------------------------------------------------
463  * SetColourMapEntries - these messages are only sent if the pixel
464  * format uses a "colour map" (i.e. trueColour false) and the client has not
465  * fixed the entire colour map using FixColourMapEntries.  In addition they
466  * will only start being sent after the client has sent its first
467  * FramebufferUpdateRequest.  So if the client always tells the server to use
468  * trueColour then it never needs to process this type of message.
469  */
470
471 typedef struct {
472     CARD8 type;                 /* always rfbSetColourMapEntries */
473     CARD8 pad;
474     CARD16 firstColour;
475     CARD16 nColours;
476
477     /* Followed by nColours * 3 * CARD16
478        r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */
479
480 } rfbSetColourMapEntriesMsg;
481
482 #define sz_rfbSetColourMapEntriesMsg 6
483
484
485
486 /*-----------------------------------------------------------------------------
487  * Bell - ring a bell on the client if it has one.
488  */
489
490 typedef struct {
491     CARD8 type;                 /* always rfbBell */
492 } rfbBellMsg;
493
494 #define sz_rfbBellMsg 1
495
496
497
498 /*-----------------------------------------------------------------------------
499  * ServerCutText - the server has new text in its cut buffer.
500  */
501
502 typedef struct {
503     CARD8 type;                 /* always rfbServerCutText */
504     CARD8 pad1;
505     CARD16 pad2;
506     CARD32 length;
507     /* followed by char text[length] */
508 } rfbServerCutTextMsg;
509
510 #define sz_rfbServerCutTextMsg 8
511
512 /*-----------------------------------------------------------------------------
513  * ReSizeFrameBuffer - tell the RFB client to alter its framebuffer, either
514  * due to a resize of the server desktop or a client-requested scaling factor.
515  * The pixel format remains unchanged.
516  */
517
518 typedef struct {
519     CARD8 type;                 /* always rfbReSizeFrameBuffer */
520         CARD8 pad1;
521         CARD16 desktop_w;       /* Desktop width */
522         CARD16 desktop_h;       /* Desktop height */
523         CARD16 buffer_w;        /* FrameBuffer width */
524         CARD16 buffer_h;        /* Framebuffer height */
525     CARD16 pad2;
526
527 } rfbReSizeFrameBufferMsg;
528
529 #define sz_rfbReSizeFrameBufferMsg (12)
530
531
532
533 /*-----------------------------------------------------------------------------
534  * Union of all server->client messages.
535  */
536
537 typedef union {
538     CARD8 type;
539     rfbFramebufferUpdateMsg fu;
540     rfbSetColourMapEntriesMsg scme;
541     rfbBellMsg b;
542     rfbServerCutTextMsg sct;
543     rfbReSizeFrameBufferMsg rsfb;
544 } rfbServerToClientMsg;
545
546
547
548 /*****************************************************************************
549  *
550  * Message definitions (client -> server)
551  *
552  *****************************************************************************/
553
554
555 /*-----------------------------------------------------------------------------
556  * SetPixelFormat - tell the RFB server the format in which the client wants
557  * pixels sent.
558  */
559
560 typedef struct {
561     CARD8 type;                 /* always rfbSetPixelFormat */
562     CARD8 pad1;
563     CARD16 pad2;
564     rfbPixelFormat format;
565 } rfbSetPixelFormatMsg;
566
567 #define sz_rfbSetPixelFormatMsg (sz_rfbPixelFormat + 4)
568
569
570 /*-----------------------------------------------------------------------------
571  * FixColourMapEntries - when the pixel format uses a "colour map", fix
572  * read-only colour map entries.
573  *
574  *    ***************** NOT CURRENTLY SUPPORTED *****************
575  */
576
577 typedef struct {
578     CARD8 type;                 /* always rfbFixColourMapEntries */
579     CARD8 pad;
580     CARD16 firstColour;
581     CARD16 nColours;
582
583     /* Followed by nColours * 3 * CARD16
584        r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */
585
586 } rfbFixColourMapEntriesMsg;
587
588 #define sz_rfbFixColourMapEntriesMsg 6
589
590
591 /*-----------------------------------------------------------------------------
592  * SetEncodings - tell the RFB server which encoding types we accept.  Put them
593  * in order of preference, if we have any.  We may always receive raw
594  * encoding, even if we don't specify it here.
595  */
596
597 typedef struct {
598     CARD8 type;                 /* always rfbSetEncodings */
599     CARD8 pad;
600     CARD16 nEncodings;
601     /* followed by nEncodings * CARD32 encoding types */
602 } rfbSetEncodingsMsg;
603
604 #define sz_rfbSetEncodingsMsg 4
605
606 /*-----------------------------------------------------------------------------
607  * SetScaleFactor - tell the RFB server to alter the scale factor for the
608  * client buffer.
609  */
610
611 typedef struct {
612         CARD8 type;                 /* always rfbSetScaleFactor */
613         CARD8 scale;                /* Scale factor (positive non-zero integer) */
614         CARD16 pad2;
615 } rfbSetScaleFactorMsg;
616
617 #define sz_rfbSetScaleFactorMsg (4)
618
619 /*-----------------------------------------------------------------------------
620  * FramebufferUpdateRequest - request for a framebuffer update.  If incremental
621  * is true then the client just wants the changes since the last update.  If
622  * false then it wants the whole of the specified rectangle.
623  */
624
625 typedef struct {
626     CARD8 type;                 /* always rfbFramebufferUpdateRequest */
627     CARD8 incremental;
628     CARD16 x;
629     CARD16 y;
630     CARD16 w;
631     CARD16 h;
632 } rfbFramebufferUpdateRequestMsg;
633
634 #define sz_rfbFramebufferUpdateRequestMsg 10
635
636
637 /*-----------------------------------------------------------------------------
638  * KeyEvent - key press or release
639  *
640  * Keys are specified using the "keysym" values defined by the X Window System.
641  * For most ordinary keys, the keysym is the same as the corresponding ASCII
642  * value.  Other common keys are:
643  *
644  * BackSpace            0xff08
645  * Tab                  0xff09
646  * Return or Enter      0xff0d
647  * Escape               0xff1b
648  * Insert               0xff63
649  * Delete               0xffff
650  * Home                 0xff50
651  * End                  0xff57
652  * Page Up              0xff55
653  * Page Down            0xff56
654  * Left                 0xff51
655  * Up                   0xff52
656  * Right                0xff53
657  * Down                 0xff54
658  * F1                   0xffbe
659  * F2                   0xffbf
660  * ...                  ...
661  * F12                  0xffc9
662  * Shift                0xffe1
663  * Control              0xffe3
664  * Meta                 0xffe7
665  * Alt                  0xffe9
666  */
667
668 typedef struct {
669     CARD8 type;                 /* always rfbKeyEvent */
670     CARD8 down;                 /* true if down (press), false if up */
671     CARD16 pad;
672     CARD32 key;                 /* key is specified as an X keysym */
673 } rfbKeyEventMsg;
674
675 #define sz_rfbKeyEventMsg 8
676
677
678 /*-----------------------------------------------------------------------------
679  * PointerEvent - mouse/pen move and/or button press.
680  */
681
682 typedef struct {
683     CARD8 type;                 /* always rfbPointerEvent */
684     CARD8 buttonMask;           /* bits 0-7 are buttons 1-8, 0=up, 1=down */
685     CARD16 x;
686     CARD16 y;
687 } rfbPointerEventMsg;
688
689 #define rfbButton1Mask 1
690 #define rfbButton2Mask 2
691 #define rfbButton3Mask 4
692 #define rfbButton4Mask 8
693 #define rfbButton5Mask 16
694 #define rfbWheelUpMask rfbButton4Mask
695 #define rfbWheelDownMask rfbButton5Mask
696
697 #define sz_rfbPointerEventMsg 6
698
699
700
701 /*-----------------------------------------------------------------------------
702  * ClientCutText - the client has new text in its cut buffer.
703  */
704
705 typedef struct {
706     CARD8 type;                 /* always rfbClientCutText */
707     CARD8 pad1;
708     CARD16 pad2;
709     CARD32 length;
710     /* followed by char text[length] */
711 } rfbClientCutTextMsg;
712
713 #define sz_rfbClientCutTextMsg 8
714
715 /*-----------------------------------------------------------------------------
716  * Union of all client->server messages.
717  */
718
719 typedef union {
720     CARD8 type;
721     rfbSetPixelFormatMsg spf;
722     rfbSetScaleFactorMsg ssf;
723     rfbFixColourMapEntriesMsg fcme;
724     rfbSetEncodingsMsg se;
725     rfbFramebufferUpdateRequestMsg fur;
726     rfbKeyEventMsg ke;
727     rfbPointerEventMsg pe;
728     rfbClientCutTextMsg cct;
729 } rfbClientToServerMsg;