| 1 | /***************************************************************** |
| 2 | Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. |
| 3 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | of this software and associated documentation files (the "Software"), to deal |
| 5 | in the Software without restriction, including without limitation the rights |
| 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | copies of the Software. |
| 8 | |
| 9 | The above copyright notice and this permission notice shall be included in |
| 10 | all copies or substantial portions of the Software. |
| 11 | |
| 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 15 | DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, |
| 16 | BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, |
| 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR |
| 18 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 19 | |
| 20 | Except as contained in this notice, the name of Digital Equipment Corporation |
| 21 | shall not be used in advertising or otherwise to promote the sale, use or other |
| 22 | dealings in this Software without prior written authorization from Digital |
| 23 | Equipment Corporation. |
| 24 | ******************************************************************/ |
| 25 | |
| 26 | #ifdef HAVE_DIX_CONFIG_H |
| 27 | #include <dix-config.h> |
| 28 | #endif |
| 29 | |
| 30 | #include <stdio.h> |
| 31 | #include <X11/X.h> |
| 32 | #include <X11/Xproto.h> |
| 33 | #include "misc.h" |
| 34 | #include "cursor.h" |
| 35 | #include "cursorstr.h" |
| 36 | #include "extnsionst.h" |
| 37 | #include "dixstruct.h" |
| 38 | #include "gc.h" |
| 39 | #include "gcstruct.h" |
| 40 | #include "scrnintstr.h" |
| 41 | #include "window.h" |
| 42 | #include "windowstr.h" |
| 43 | #include "pixmapstr.h" |
| 44 | #include "panoramiX.h" |
| 45 | #include <X11/extensions/panoramiXproto.h> |
| 46 | #include "panoramiXsrv.h" |
| 47 | #include "globals.h" |
| 48 | #include "panoramiXh.h" |
| 49 | |
| 50 | static int |
| 51 | SProcPanoramiXQueryVersion(ClientPtr client) |
| 52 | { |
| 53 | REQUEST(xPanoramiXQueryVersionReq); |
| 54 | |
| 55 | swaps(&stuff->length); |
| 56 | REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); |
| 57 | return ProcPanoramiXQueryVersion(client); |
| 58 | } |
| 59 | |
| 60 | static int |
| 61 | SProcPanoramiXGetState(ClientPtr client) |
| 62 | { |
| 63 | REQUEST(xPanoramiXGetStateReq); |
| 64 | |
| 65 | swaps(&stuff->length); |
| 66 | REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); |
| 67 | swapl(&stuff->window); |
| 68 | return ProcPanoramiXGetState(client); |
| 69 | } |
| 70 | |
| 71 | static int |
| 72 | SProcPanoramiXGetScreenCount(ClientPtr client) |
| 73 | { |
| 74 | REQUEST(xPanoramiXGetScreenCountReq); |
| 75 | |
| 76 | swaps(&stuff->length); |
| 77 | REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); |
| 78 | swapl(&stuff->window); |
| 79 | return ProcPanoramiXGetScreenCount(client); |
| 80 | } |
| 81 | |
| 82 | static int |
| 83 | SProcPanoramiXGetScreenSize(ClientPtr client) |
| 84 | { |
| 85 | REQUEST(xPanoramiXGetScreenSizeReq); |
| 86 | |
| 87 | swaps(&stuff->length); |
| 88 | REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); |
| 89 | swapl(&stuff->window); |
| 90 | swapl(&stuff->screen); |
| 91 | return ProcPanoramiXGetScreenSize(client); |
| 92 | } |
| 93 | |
| 94 | static int |
| 95 | SProcXineramaIsActive(ClientPtr client) |
| 96 | { |
| 97 | REQUEST(xXineramaIsActiveReq); |
| 98 | |
| 99 | swaps(&stuff->length); |
| 100 | REQUEST_SIZE_MATCH(xXineramaIsActiveReq); |
| 101 | return ProcXineramaIsActive(client); |
| 102 | } |
| 103 | |
| 104 | static int |
| 105 | SProcXineramaQueryScreens(ClientPtr client) |
| 106 | { |
| 107 | REQUEST(xXineramaQueryScreensReq); |
| 108 | |
| 109 | swaps(&stuff->length); |
| 110 | REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); |
| 111 | return ProcXineramaQueryScreens(client); |
| 112 | } |
| 113 | |
| 114 | int |
| 115 | SProcPanoramiXDispatch(ClientPtr client) |
| 116 | { |
| 117 | REQUEST(xReq); |
| 118 | switch (stuff->data) { |
| 119 | case X_PanoramiXQueryVersion: |
| 120 | return SProcPanoramiXQueryVersion(client); |
| 121 | case X_PanoramiXGetState: |
| 122 | return SProcPanoramiXGetState(client); |
| 123 | case X_PanoramiXGetScreenCount: |
| 124 | return SProcPanoramiXGetScreenCount(client); |
| 125 | case X_PanoramiXGetScreenSize: |
| 126 | return SProcPanoramiXGetScreenSize(client); |
| 127 | case X_XineramaIsActive: |
| 128 | return SProcXineramaIsActive(client); |
| 129 | case X_XineramaQueryScreens: |
| 130 | return SProcXineramaQueryScreens(client); |
| 131 | } |
| 132 | return BadRequest; |
| 133 | } |