panoramiXSwap.c revision 05b261ec
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#if 0
4505b261ecSmrg#include <sys/workstation.h>
4605b261ecSmrg#include <X11/Xserver/ws.h>
4705b261ecSmrg#endif
4805b261ecSmrg#include "panoramiX.h"
4905b261ecSmrg#include <X11/extensions/panoramiXproto.h>
5005b261ecSmrg#include "panoramiXsrv.h"
5105b261ecSmrg#include "globals.h"
5205b261ecSmrg#include "panoramiXh.h"
5305b261ecSmrg
5405b261ecSmrgstatic int
5505b261ecSmrgSProcPanoramiXQueryVersion (ClientPtr client)
5605b261ecSmrg{
5705b261ecSmrg	REQUEST(xPanoramiXQueryVersionReq);
5805b261ecSmrg	register int n;
5905b261ecSmrg
6005b261ecSmrg	swaps(&stuff->length,n);
6105b261ecSmrg	REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
6205b261ecSmrg	return ProcPanoramiXQueryVersion(client);
6305b261ecSmrg}
6405b261ecSmrg
6505b261ecSmrgstatic int
6605b261ecSmrgSProcPanoramiXGetState(ClientPtr client)
6705b261ecSmrg{
6805b261ecSmrg	REQUEST(xPanoramiXGetStateReq);
6905b261ecSmrg	register int n;
7005b261ecSmrg
7105b261ecSmrg 	swaps (&stuff->length, n);
7205b261ecSmrg	REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
7305b261ecSmrg	swapl (&stuff->window, n);
7405b261ecSmrg	return ProcPanoramiXGetState(client);
7505b261ecSmrg}
7605b261ecSmrg
7705b261ecSmrgstatic int
7805b261ecSmrgSProcPanoramiXGetScreenCount(ClientPtr client)
7905b261ecSmrg{
8005b261ecSmrg	REQUEST(xPanoramiXGetScreenCountReq);
8105b261ecSmrg	register int n;
8205b261ecSmrg
8305b261ecSmrg	swaps (&stuff->length, n);
8405b261ecSmrg	REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
8505b261ecSmrg	swapl (&stuff->window, n);
8605b261ecSmrg	return ProcPanoramiXGetScreenCount(client);
8705b261ecSmrg}
8805b261ecSmrg
8905b261ecSmrgstatic int
9005b261ecSmrgSProcPanoramiXGetScreenSize(ClientPtr client)
9105b261ecSmrg{
9205b261ecSmrg	REQUEST(xPanoramiXGetScreenSizeReq);
9305b261ecSmrg	register int n;
9405b261ecSmrg
9505b261ecSmrg	swaps (&stuff->length, n);
9605b261ecSmrg	REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
9705b261ecSmrg	swapl (&stuff->window, n);
9805b261ecSmrg	swapl (&stuff->screen, n);
9905b261ecSmrg	return ProcPanoramiXGetScreenSize(client);
10005b261ecSmrg}
10105b261ecSmrg
10205b261ecSmrg
10305b261ecSmrgstatic int
10405b261ecSmrgSProcXineramaIsActive(ClientPtr client)
10505b261ecSmrg{
10605b261ecSmrg	REQUEST(xXineramaIsActiveReq);
10705b261ecSmrg	register int n;
10805b261ecSmrg
10905b261ecSmrg	swaps (&stuff->length, n);
11005b261ecSmrg	REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
11105b261ecSmrg	return ProcXineramaIsActive(client);
11205b261ecSmrg}
11305b261ecSmrg
11405b261ecSmrg
11505b261ecSmrgstatic int
11605b261ecSmrgSProcXineramaQueryScreens(ClientPtr client)
11705b261ecSmrg{
11805b261ecSmrg	REQUEST(xXineramaQueryScreensReq);
11905b261ecSmrg	register int n;
12005b261ecSmrg
12105b261ecSmrg	swaps (&stuff->length, n);
12205b261ecSmrg	REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
12305b261ecSmrg	return ProcXineramaQueryScreens(client);
12405b261ecSmrg}
12505b261ecSmrg
12605b261ecSmrg
12705b261ecSmrgint
12805b261ecSmrgSProcPanoramiXDispatch (ClientPtr client)
12905b261ecSmrg{   REQUEST(xReq);
13005b261ecSmrg    switch (stuff->data)
13105b261ecSmrg    {
13205b261ecSmrg	case X_PanoramiXQueryVersion:
13305b261ecSmrg	     return SProcPanoramiXQueryVersion(client);
13405b261ecSmrg	case X_PanoramiXGetState:
13505b261ecSmrg	     return SProcPanoramiXGetState(client);
13605b261ecSmrg	case X_PanoramiXGetScreenCount:
13705b261ecSmrg	     return SProcPanoramiXGetScreenCount(client);
13805b261ecSmrg	case X_PanoramiXGetScreenSize:
13905b261ecSmrg	     return SProcPanoramiXGetScreenSize(client);
14005b261ecSmrg	case X_XineramaIsActive:
14105b261ecSmrg	     return SProcXineramaIsActive(client);
14205b261ecSmrg	case X_XineramaQueryScreens:
14305b261ecSmrg	     return SProcXineramaQueryScreens(client);
14405b261ecSmrg    }
14505b261ecSmrg    return BadRequest;
14605b261ecSmrg}
147