Home | History | Annotate | Download | only in extensions
      1 /*
      2  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
      3  * Copyright 2010 Red Hat, Inc.
      4  *
      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  *
     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  *
     16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     22  * DEALINGS IN THE SOFTWARE.
     23  */
     24 /*
     25  * Copyright  2002 Keith Packard, member of The XFree86 Project, Inc.
     26  *
     27  * Permission to use, copy, modify, distribute, and sell this software and its
     28  * documentation for any purpose is hereby granted without fee, provided that
     29  * the above copyright notice appear in all copies and that both that
     30  * copyright notice and this permission notice appear in supporting
     31  * documentation, and that the name of Keith Packard not be used in
     32  * advertising or publicity pertaining to distribution of the software without
     33  * specific, written prior permission.  Keith Packard makes no
     34  * representations about the suitability of this software for any purpose.  It
     35  * is provided "as is" without express or implied warranty.
     36  *
     37  * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
     38  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
     39  * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
     40  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
     41  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
     42  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
     43  * PERFORMANCE OF THIS SOFTWARE.
     44  */
     45 
     46 #ifndef _XFIXESPROTO_H_
     47 #define _XFIXESPROTO_H_
     48 
     49 #include <X11/Xmd.h>
     50 #include <X11/extensions/xfixeswire.h>
     51 #include <X11/extensions/shapeconst.h>
     52 
     53 #define Window CARD32
     54 #define Drawable CARD32
     55 #define Font CARD32
     56 #define Pixmap CARD32
     57 #define Cursor CARD32
     58 #define Colormap CARD32
     59 #define GContext CARD32
     60 #define Atom CARD32
     61 #define VisualID CARD32
     62 #define Time CARD32
     63 #define KeyCode CARD8
     64 #define KeySym CARD32
     65 #define Picture CARD32
     66 
     67 /*************** Version 1 ******************/
     68 
     69 typedef struct {
     70     CARD8   reqType;
     71     CARD8   xfixesReqType;
     72     CARD16  length B16;
     73 } xXFixesReq;
     74 
     75 /*
     76  * requests and replies
     77  */
     78 typedef struct {
     79     CARD8   reqType;
     80     CARD8   xfixesReqType;
     81     CARD16  length B16;
     82     CARD32  majorVersion B32;
     83     CARD32  minorVersion B32;
     84 } xXFixesQueryVersionReq;
     85 
     86 #define sz_xXFixesQueryVersionReq   12
     87 
     88 typedef struct {
     89     BYTE    type;   /* X_Reply */
     90     BYTE    pad1;
     91     CARD16  sequenceNumber B16;
     92     CARD32  length B32;
     93     CARD32  majorVersion B32;
     94     CARD32  minorVersion B32;
     95     CARD32  pad2 B32;
     96     CARD32  pad3 B32;
     97     CARD32  pad4 B32;
     98     CARD32  pad5 B32;
     99 } xXFixesQueryVersionReply;
    100 
    101 #define sz_xXFixesQueryVersionReply	32
    102 
    103 typedef struct {
    104     CARD8   reqType;
    105     CARD8   xfixesReqType;
    106     CARD16  length B16;
    107     BYTE    mode;	    /* SetModeInsert/SetModeDelete*/
    108     BYTE    target;	    /* SaveSetNearest/SaveSetRoot*/
    109     BYTE    map;	    /* SaveSetMap/SaveSetUnmap */
    110     BYTE    pad1;
    111     Window  window;
    112 } xXFixesChangeSaveSetReq;
    113 
    114 #define sz_xXFixesChangeSaveSetReq	12
    115 
    116 typedef struct {
    117     CARD8   reqType;
    118     CARD8   xfixesReqType;
    119     CARD16  length B16;
    120     Window  window  B32;
    121     Atom    selection B32;
    122     CARD32  eventMask B32;
    123 } xXFixesSelectSelectionInputReq;
    124 
    125 #define sz_xXFixesSelectSelectionInputReq   16
    126 
    127 typedef struct {
    128     CARD8   type;
    129     CARD8   subtype;
    130     CARD16  sequenceNumber B16;
    131     Window  window B32;
    132     Window  owner B32;
    133     Atom    selection B32;
    134     Time    timestamp B32;
    135     Time    selectionTimestamp B32;
    136     CARD32  pad2 B32;
    137     CARD32  pad3 B32;
    138 } xXFixesSelectionNotifyEvent;
    139 
    140 typedef struct {
    141     CARD8   reqType;
    142     CARD8   xfixesReqType;
    143     CARD16  length B16;
    144     Window  window B32;
    145     CARD32  eventMask B32;
    146 } xXFixesSelectCursorInputReq;
    147 
    148 #define sz_xXFixesSelectCursorInputReq	12
    149 
    150 typedef struct {
    151     CARD8   type;
    152     CARD8   subtype;
    153     CARD16  sequenceNumber B16;
    154     Window  window B32;
    155     CARD32  cursorSerial B32;
    156     Time    timestamp;
    157     Atom    name B32;	    /* Version 2 */
    158     CARD32  pad1 B32;
    159     CARD32  pad2 B32;
    160     CARD32  pad3 B32;
    161 } xXFixesCursorNotifyEvent;
    162 
    163 typedef struct {
    164     CARD8   reqType;
    165     CARD8   xfixesReqType;
    166     CARD16  length B16;
    167 } xXFixesGetCursorImageReq;
    168 
    169 #define sz_xXFixesGetCursorImageReq 4
    170 
    171 typedef struct {
    172     BYTE    type;   /* X_Reply */
    173     BYTE    pad1;
    174     CARD16  sequenceNumber B16;
    175     CARD32  length B32;
    176     INT16   x B16;
    177     INT16   y B16;
    178     CARD16  width B16;
    179     CARD16  height B16;
    180     CARD16  xhot B16;
    181     CARD16  yhot B16;
    182     CARD32  cursorSerial B32;
    183     CARD32  pad2 B32;
    184     CARD32  pad3 B32;
    185 } xXFixesGetCursorImageReply;
    186 
    187 #define sz_xXFixesGetCursorImageReply	32
    188 
    189 /*************** Version 2 ******************/
    190 
    191 #define Region CARD32
    192 
    193 typedef struct {
    194     CARD8   reqType;
    195     CARD8   xfixesReqType;
    196     CARD16  length B16;
    197     Region  region B32;
    198     /* LISTofRECTANGLE */
    199 } xXFixesCreateRegionReq;
    200 
    201 #define sz_xXFixesCreateRegionReq	8
    202 
    203 typedef struct {
    204     CARD8   reqType;
    205     CARD8   xfixesReqType;
    206     CARD16  length B16;
    207     Region  region B32;
    208     Pixmap  bitmap B32;
    209 } xXFixesCreateRegionFromBitmapReq;
    210 
    211 #define sz_xXFixesCreateRegionFromBitmapReq	12
    212 
    213 typedef struct {
    214     CARD8   reqType;
    215     CARD8   xfixesReqType;
    216     CARD16  length B16;
    217     Region  region B32;
    218     Window  window B32;
    219     CARD8   kind;
    220     CARD8   pad1;
    221     CARD16  pad2 B16;
    222 } xXFixesCreateRegionFromWindowReq;
    223 
    224 #define sz_xXFixesCreateRegionFromWindowReq	16
    225 
    226 typedef struct {
    227     CARD8   reqType;
    228     CARD8   xfixesReqType;
    229     CARD16  length B16;
    230     Region  region B32;
    231     GContext gc B32;
    232 } xXFixesCreateRegionFromGCReq;
    233 
    234 #define sz_xXFixesCreateRegionFromGCReq	12
    235 
    236 typedef struct {
    237     CARD8   reqType;
    238     CARD8   xfixesReqType;
    239     CARD16  length B16;
    240     Region  region B32;
    241     Picture picture B32;
    242 } xXFixesCreateRegionFromPictureReq;
    243 
    244 #define sz_xXFixesCreateRegionFromPictureReq	12
    245 
    246 typedef struct {
    247     CARD8   reqType;
    248     CARD8   xfixesReqType;
    249     CARD16  length B16;
    250     Region  region B32;
    251 } xXFixesDestroyRegionReq;
    252 
    253 #define sz_xXFixesDestroyRegionReq	8
    254 
    255 typedef struct {
    256     CARD8   reqType;
    257     CARD8   xfixesReqType;
    258     CARD16  length B16;
    259     Region  region B32;
    260     /* LISTofRECTANGLE */
    261 } xXFixesSetRegionReq;
    262 
    263 #define sz_xXFixesSetRegionReq		8
    264 
    265 typedef struct {
    266     CARD8   reqType;
    267     CARD8   xfixesReqType;
    268     CARD16  length B16;
    269     Region  source B32;
    270     Region  destination B32;
    271 } xXFixesCopyRegionReq;
    272 
    273 #define sz_xXFixesCopyRegionReq		12
    274 
    275 typedef struct {
    276     CARD8   reqType;
    277     CARD8   xfixesReqType;
    278     CARD16  length B16;
    279     Region  source1 B32;
    280     Region  source2 B32;
    281     Region  destination B32;
    282 } xXFixesCombineRegionReq,
    283   xXFixesUnionRegionReq,
    284   xXFixesIntersectRegionReq,
    285   xXFixesSubtractRegionReq;
    286 
    287 #define sz_xXFixesCombineRegionReq	16
    288 #define sz_xXFixesUnionRegionReq	sz_xXFixesCombineRegionReq
    289 #define sz_xXFixesIntersectRegionReq	sz_xXFixesCombineRegionReq
    290 #define sz_xXFixesSubtractRegionReq	sz_xXFixesCombineRegionReq
    291 
    292 typedef struct {
    293     CARD8   reqType;
    294     CARD8   xfixesReqType;
    295     CARD16  length B16;
    296     Region  source B32;
    297     INT16   x B16, y B16;
    298     CARD16  width B16, height B16;
    299     Region  destination B32;
    300 } xXFixesInvertRegionReq;
    301 
    302 #define sz_xXFixesInvertRegionReq	20
    303 
    304 typedef struct {
    305     CARD8   reqType;
    306     CARD8   xfixesReqType;
    307     CARD16  length B16;
    308     Region  region B32;
    309     INT16   dx B16, dy B16;
    310 } xXFixesTranslateRegionReq;
    311 
    312 #define sz_xXFixesTranslateRegionReq	12
    313 
    314 typedef struct {
    315     CARD8   reqType;
    316     CARD8   xfixesReqType;
    317     CARD16  length B16;
    318     Region  source B32;
    319     Region  destination B32;
    320 } xXFixesRegionExtentsReq;
    321 
    322 #define sz_xXFixesRegionExtentsReq	12
    323 
    324 typedef struct {
    325     CARD8   reqType;
    326     CARD8   xfixesReqType;
    327     CARD16  length B16;
    328     Region  region B32;
    329 } xXFixesFetchRegionReq;
    330 
    331 #define sz_xXFixesFetchRegionReq	8
    332 
    333 typedef struct {
    334     BYTE    type;   /* X_Reply */
    335     BYTE    pad1;
    336     CARD16  sequenceNumber B16;
    337     CARD32  length B32;
    338     INT16   x B16, y B16;
    339     CARD16  width B16, height B16;
    340     CARD32  pad2 B32;
    341     CARD32  pad3 B32;
    342     CARD32  pad4 B32;
    343     CARD32  pad5 B32;
    344 } xXFixesFetchRegionReply;
    345 
    346 #define sz_xXFixesFetchRegionReply	32
    347 
    348 typedef struct {
    349     CARD8   reqType;
    350     CARD8   xfixesReqType;
    351     CARD16  length B16;
    352     GContext	gc B32;
    353     Region  region B32;
    354     INT16   xOrigin B16, yOrigin B16;
    355 } xXFixesSetGCClipRegionReq;
    356 
    357 #define sz_xXFixesSetGCClipRegionReq	16
    358 
    359 typedef struct {
    360     CARD8   reqType;
    361     CARD8   xfixesReqType;
    362     CARD16  length B16;
    363     Window  dest;
    364     BYTE    destKind;
    365     CARD8   pad1;
    366     CARD16  pad2 B16;
    367     INT16   xOff B16, yOff B16;
    368     Region  region;
    369 } xXFixesSetWindowShapeRegionReq;
    370 
    371 #define sz_xXFixesSetWindowShapeRegionReq	20
    372 
    373 typedef struct {
    374     CARD8   reqType;
    375     CARD8   xfixesReqType;
    376     CARD16  length B16;
    377     Picture picture B32;
    378     Region  region B32;
    379     INT16   xOrigin B16, yOrigin B16;
    380 } xXFixesSetPictureClipRegionReq;
    381 
    382 #define sz_xXFixesSetPictureClipRegionReq   16
    383 
    384 typedef struct {
    385     CARD8   reqType;
    386     CARD8   xfixesReqType;
    387     CARD16  length B16;
    388     Cursor  cursor B32;
    389     CARD16  nbytes B16;
    390     CARD16  pad B16;
    391 } xXFixesSetCursorNameReq;
    392 
    393 #define sz_xXFixesSetCursorNameReq	    12
    394 
    395 typedef struct {
    396     CARD8   reqType;
    397     CARD8   xfixesReqType;
    398     CARD16  length B16;
    399     Cursor  cursor B32;
    400 } xXFixesGetCursorNameReq;
    401 
    402 #define sz_xXFixesGetCursorNameReq	    8
    403 
    404 typedef struct {
    405     BYTE    type;   /* X_Reply */
    406     BYTE    pad1;
    407     CARD16  sequenceNumber B16;
    408     CARD32  length B32;
    409     Atom    atom B32;
    410     CARD16  nbytes B16;
    411     CARD16  pad2 B16;
    412     CARD32  pad3 B32;
    413     CARD32  pad4 B32;
    414     CARD32  pad5 B32;
    415     CARD32  pad6 B32;
    416 } xXFixesGetCursorNameReply;
    417 
    418 #define sz_xXFixesGetCursorNameReply	    32
    419 
    420 typedef struct {
    421     CARD8   reqType;
    422     CARD8   xfixesReqType;
    423     CARD16  length B16;
    424 } xXFixesGetCursorImageAndNameReq;
    425 
    426 #define sz_xXFixesGetCursorImageAndNameReq  4
    427 
    428 typedef struct {
    429     BYTE    type;   /* X_Reply */
    430     BYTE    pad1;
    431     CARD16  sequenceNumber B16;
    432     CARD32  length B32;
    433     INT16   x B16;
    434     INT16   y B16;
    435     CARD16  width B16;
    436     CARD16  height B16;
    437     CARD16  xhot B16;
    438     CARD16  yhot B16;
    439     CARD32  cursorSerial B32;
    440     Atom    cursorName B32;
    441     CARD16  nbytes B16;
    442     CARD16  pad B16;
    443 } xXFixesGetCursorImageAndNameReply;
    444 
    445 #define sz_xXFixesGetCursorImageAndNameReply	32
    446 
    447 typedef struct {
    448     CARD8   reqType;
    449     CARD8   xfixesReqType;
    450     CARD16  length B16;
    451     Cursor  source B32;
    452     Cursor  destination B32;
    453 } xXFixesChangeCursorReq;
    454 
    455 #define sz_xXFixesChangeCursorReq	12
    456 
    457 typedef struct {
    458     CARD8   reqType;
    459     CARD8   xfixesReqType;
    460     CARD16  length B16;
    461     Cursor  source B32;
    462     CARD16  nbytes;
    463     CARD16  pad;
    464 } xXFixesChangeCursorByNameReq;
    465 
    466 #define sz_xXFixesChangeCursorByNameReq	12
    467 
    468 /*************** Version 3 ******************/
    469 
    470 typedef struct {
    471     CARD8   reqType;
    472     CARD8   xfixesReqType;
    473     CARD16  length B16;
    474     Region  source B32;
    475     Region  destination B32;
    476     CARD16  left B16;
    477     CARD16  right B16;
    478     CARD16  top B16;
    479     CARD16  bottom B16;
    480 } xXFixesExpandRegionReq;
    481 
    482 #define sz_xXFixesExpandRegionReq	20
    483 
    484 /*************** Version 4.0 ******************/
    485 
    486 typedef struct {
    487     CARD8   reqType;
    488     CARD8   xfixesReqType;
    489     CARD16  length B16;
    490     Window  window B32;
    491 } xXFixesHideCursorReq;
    492 
    493 #define sz_xXFixesHideCursorReq	sizeof(xXFixesHideCursorReq)
    494 
    495 typedef struct {
    496     CARD8   reqType;
    497     CARD8   xfixesReqType;
    498     CARD16  length B16;
    499     Window  window B32;
    500 } xXFixesShowCursorReq;
    501 
    502 #define sz_xXFixesShowCursorReq	sizeof(xXFixesShowCursorReq)
    503 
    504 /*************** Version 5.0 ******************/
    505 
    506 #define Barrier CARD32
    507 
    508 typedef struct {
    509     CARD8   reqType;
    510     CARD8   xfixesReqType;
    511     CARD16  length B16;
    512     Barrier barrier B32;
    513     Window  window B32;
    514     INT16   x1 B16;
    515     INT16   y1 B16;
    516     INT16   x2 B16;
    517     INT16   y2 B16;
    518     CARD32  directions;
    519     CARD16  pad B16;
    520     CARD16  num_devices B16;
    521     /* array of CARD16 devices */
    522 } xXFixesCreatePointerBarrierReq;
    523 
    524 #define sz_xXFixesCreatePointerBarrierReq 28
    525 
    526 typedef struct {
    527     CARD8   reqType;
    528     CARD8   xfixesReqType;
    529     CARD16  length B16;
    530     Barrier barrier B32;
    531 } xXFixesDestroyPointerBarrierReq;
    532 
    533 #define sz_xXFixesDestroyPointerBarrierReq 8
    534 
    535 #undef Barrier
    536 #undef Region
    537 #undef Picture
    538 #undef Window
    539 #undef Drawable
    540 #undef Font
    541 #undef Pixmap
    542 #undef Cursor
    543 #undef Colormap
    544 #undef GContext
    545 #undef Atom
    546 #undef VisualID
    547 #undef Time
    548 #undef KeyCode
    549 #undef KeySym
    550 
    551 #endif /* _XFIXESPROTO_H_ */
    552