panoramiXSwap.c revision 1b5d61b8
105b261ecSmrg/*****************************************************************
205b261ecSmrgCopyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
305b261ecSmrgPermission is hereby granted, free of charge, to any person obtaining a copy
405b261ecSmrgof this software and associated documentation files (the "Software"), to deal
505b261ecSmrgin the Software without restriction, including without limitation the rights
605b261ecSmrgto use, copy, modify, merge, publish, distribute, sublicense, and/or sell
705b261ecSmrgcopies of the Software.
805b261ecSmrg
905b261ecSmrgThe above copyright notice and this permission notice shall be included in
1005b261ecSmrgall copies or substantial portions of the Software.
1105b261ecSmrg
1205b261ecSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1305b261ecSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1405b261ecSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1505b261ecSmrgDIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
1605b261ecSmrgBUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
1705b261ecSmrgWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
1805b261ecSmrgIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1905b261ecSmrg
2005b261ecSmrgExcept as contained in this notice, the name of Digital Equipment Corporation
2105b261ecSmrgshall not be used in advertising or otherwise to promote the sale, use or other
2205b261ecSmrgdealings in this Software without prior written authorization from Digital
2305b261ecSmrgEquipment Corporation.
2405b261ecSmrg******************************************************************/
2505b261ecSmrg
2605b261ecSmrg#ifdef HAVE_DIX_CONFIG_H
2705b261ecSmrg#include <dix-config.h>
2805b261ecSmrg#endif
2905b261ecSmrg
3005b261ecSmrg#include <stdio.h>
3105b261ecSmrg#include <X11/X.h>
3205b261ecSmrg#include <X11/Xproto.h>
3305b261ecSmrg#include "misc.h"
3405b261ecSmrg#include "cursor.h"
3505b261ecSmrg#include "cursorstr.h"
3605b261ecSmrg#include "extnsionst.h"
3705b261ecSmrg#include "dixstruct.h"
3805b261ecSmrg#include "gc.h"
3905b261ecSmrg#include "gcstruct.h"
4005b261ecSmrg#include "scrnintstr.h"
4105b261ecSmrg#include "window.h"
4205b261ecSmrg#include "windowstr.h"
4305b261ecSmrg#include "pixmapstr.h"
4405b261ecSmrg#include "panoramiX.h"
4505b261ecSmrg#include <X11/extensions/panoramiXproto.h>
4605b261ecSmrg#include "panoramiXsrv.h"
4705b261ecSmrg#include "globals.h"
4805b261ecSmrg#include "panoramiXh.h"
4905b261ecSmrg
501b5d61b8Smrgstatic int _X_COLD
5135c4bbdfSmrgSProcPanoramiXQueryVersion(ClientPtr client)
5205b261ecSmrg{
5335c4bbdfSmrg    REQUEST(xPanoramiXQueryVersionReq);
5405b261ecSmrg
5535c4bbdfSmrg    swaps(&stuff->length);
5635c4bbdfSmrg    REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
5735c4bbdfSmrg    return ProcPanoramiXQueryVersion(client);
5805b261ecSmrg}
5905b261ecSmrg
601b5d61b8Smrgstatic int _X_COLD
6105b261ecSmrgSProcPanoramiXGetState(ClientPtr client)
6205b261ecSmrg{
6335c4bbdfSmrg    REQUEST(xPanoramiXGetStateReq);
6405b261ecSmrg
6535c4bbdfSmrg    swaps(&stuff->length);
6635c4bbdfSmrg    REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
6735c4bbdfSmrg    swapl(&stuff->window);
6835c4bbdfSmrg    return ProcPanoramiXGetState(client);
6905b261ecSmrg}
7005b261ecSmrg
711b5d61b8Smrgstatic int _X_COLD
7205b261ecSmrgSProcPanoramiXGetScreenCount(ClientPtr client)
7305b261ecSmrg{
7435c4bbdfSmrg    REQUEST(xPanoramiXGetScreenCountReq);
7505b261ecSmrg
7635c4bbdfSmrg    swaps(&stuff->length);
7735c4bbdfSmrg    REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
7835c4bbdfSmrg    swapl(&stuff->window);
7935c4bbdfSmrg    return ProcPanoramiXGetScreenCount(client);
8005b261ecSmrg}
8105b261ecSmrg
821b5d61b8Smrgstatic int _X_COLD
8305b261ecSmrgSProcPanoramiXGetScreenSize(ClientPtr client)
8405b261ecSmrg{
8535c4bbdfSmrg    REQUEST(xPanoramiXGetScreenSizeReq);
8605b261ecSmrg
8735c4bbdfSmrg    swaps(&stuff->length);
8835c4bbdfSmrg    REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
8935c4bbdfSmrg    swapl(&stuff->window);
9035c4bbdfSmrg    swapl(&stuff->screen);
9135c4bbdfSmrg    return ProcPanoramiXGetScreenSize(client);
9235c4bbdfSmrg}
9305b261ecSmrg
941b5d61b8Smrgstatic int _X_COLD
9505b261ecSmrgSProcXineramaIsActive(ClientPtr client)
9605b261ecSmrg{
9735c4bbdfSmrg    REQUEST(xXineramaIsActiveReq);
9805b261ecSmrg
9935c4bbdfSmrg    swaps(&stuff->length);
10035c4bbdfSmrg    REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
10135c4bbdfSmrg    return ProcXineramaIsActive(client);
10205b261ecSmrg}
10305b261ecSmrg
1041b5d61b8Smrgstatic int _X_COLD
10505b261ecSmrgSProcXineramaQueryScreens(ClientPtr client)
10605b261ecSmrg{
10735c4bbdfSmrg    REQUEST(xXineramaQueryScreensReq);
10805b261ecSmrg
10935c4bbdfSmrg    swaps(&stuff->length);
11035c4bbdfSmrg    REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
11135c4bbdfSmrg    return ProcXineramaQueryScreens(client);
11205b261ecSmrg}
11305b261ecSmrg
1141b5d61b8Smrgint _X_COLD
11535c4bbdfSmrgSProcPanoramiXDispatch(ClientPtr client)
11635c4bbdfSmrg{
11735c4bbdfSmrg    REQUEST(xReq);
11835c4bbdfSmrg    switch (stuff->data) {
11935c4bbdfSmrg    case X_PanoramiXQueryVersion:
12035c4bbdfSmrg        return SProcPanoramiXQueryVersion(client);
12135c4bbdfSmrg    case X_PanoramiXGetState:
12235c4bbdfSmrg        return SProcPanoramiXGetState(client);
12335c4bbdfSmrg    case X_PanoramiXGetScreenCount:
12435c4bbdfSmrg        return SProcPanoramiXGetScreenCount(client);
12535c4bbdfSmrg    case X_PanoramiXGetScreenSize:
12635c4bbdfSmrg        return SProcPanoramiXGetScreenSize(client);
12735c4bbdfSmrg    case X_XineramaIsActive:
12835c4bbdfSmrg        return SProcXineramaIsActive(client);
12935c4bbdfSmrg    case X_XineramaQueryScreens:
13035c4bbdfSmrg        return SProcXineramaQueryScreens(client);
13105b261ecSmrg    }
13205b261ecSmrg    return BadRequest;
13305b261ecSmrg}
134