diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/xquartz/pseudoramiX.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/hw/xquartz/pseudoramiX.c')
-rw-r--r-- | xorg-server/hw/xquartz/pseudoramiX.c | 270 |
1 files changed, 133 insertions, 137 deletions
diff --git a/xorg-server/hw/xquartz/pseudoramiX.c b/xorg-server/hw/xquartz/pseudoramiX.c index 5a5b9c2e7..f5375039b 100644 --- a/xorg-server/hw/xquartz/pseudoramiX.c +++ b/xorg-server/hw/xquartz/pseudoramiX.c @@ -47,9 +47,9 @@ Equipment Corporation. Bool noPseudoramiXExtension = FALSE; -extern int ProcPanoramiXQueryVersion (ClientPtr client); +extern int ProcPanoramiXQueryVersion(ClientPtr client); -static void PseudoramiXResetProc(ExtensionEntry *extEntry); +static void PseudoramiXResetProc(ExtensionEntry * extEntry); static int ProcPseudoramiXQueryVersion(ClientPtr client); static int ProcPseudoramiXGetState(ClientPtr client); @@ -67,7 +67,6 @@ static int SProcPseudoramiXIsActive(ClientPtr client); static int SProcPseudoramiXQueryScreens(ClientPtr client); static int SProcPseudoramiXDispatch(ClientPtr client); - typedef struct { int x; int y; @@ -80,7 +79,6 @@ static int pseudoramiXScreensAllocated = 0; static int pseudoramiXNumScreens = 0; static unsigned long pseudoramiXGeneration = 0; - // Add a PseudoramiX screen. // The rest of the X server will know nothing about this screen. // Can be called before or after extension init. @@ -90,13 +88,14 @@ PseudoramiXAddScreen(int x, int y, int w, int h) { PseudoramiXScreenRec *s; - if (noPseudoramiXExtension) return; + if (noPseudoramiXExtension) + return; if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) { pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1; pseudoramiXScreens = realloc(pseudoramiXScreens, - pseudoramiXScreensAllocated * - sizeof(PseudoramiXScreenRec)); + pseudoramiXScreensAllocated * + sizeof(PseudoramiXScreenRec)); } DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h); @@ -108,15 +107,16 @@ PseudoramiXAddScreen(int x, int y, int w, int h) s->h = h; } - // Initialize PseudoramiX. // Copied from PanoramiXExtensionInit -void PseudoramiXExtensionInit(int argc, char *argv[]) +void +PseudoramiXExtensionInit(int argc, char *argv[]) { - Bool success = FALSE; - ExtensionEntry *extEntry; + Bool success = FALSE; + ExtensionEntry *extEntry; - if (noPseudoramiXExtension) return; + if (noPseudoramiXExtension) + return; TRACE(); @@ -134,11 +134,11 @@ void PseudoramiXExtensionInit(int argc, char *argv[]) extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0, ProcPseudoramiXDispatch, SProcPseudoramiXDispatch, - PseudoramiXResetProc, - StandardMinorOpcode); + PseudoramiXResetProc, StandardMinorOpcode); if (!extEntry) { ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n"); - } else { + } + else { pseudoramiXGeneration = serverGeneration; success = TRUE; } @@ -151,34 +151,34 @@ void PseudoramiXExtensionInit(int argc, char *argv[]) } } - -void PseudoramiXResetScreens(void) +void +PseudoramiXResetScreens(void) { TRACE(); pseudoramiXNumScreens = 0; } - -static void PseudoramiXResetProc(ExtensionEntry *extEntry) +static void +PseudoramiXResetProc(ExtensionEntry * extEntry) { TRACE(); PseudoramiXResetScreens(); } - // was PanoramiX -static int ProcPseudoramiXQueryVersion(ClientPtr client) +static int +ProcPseudoramiXQueryVersion(ClientPtr client) { TRACE(); return ProcPanoramiXQueryVersion(client); } - // was PanoramiX -static int ProcPseudoramiXGetState(ClientPtr client) +static int +ProcPseudoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; @@ -186,11 +186,11 @@ static int ProcPseudoramiXGetState(ClientPtr client) register int rc; TRACE(); - + REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) - return rc; + return rc; rep.type = X_Reply; rep.length = 0; @@ -201,13 +201,13 @@ static int ProcPseudoramiXGetState(ClientPtr client) swapl(&rep.length); swaps(&rep.state); } - WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); return Success; } - // was PanoramiX -static int ProcPseudoramiXGetScreenCount(ClientPtr client) +static int +ProcPseudoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; @@ -215,11 +215,11 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) register int rc; TRACE(); - + REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) - return rc; + return rc; rep.type = X_Reply; rep.length = 0; @@ -230,31 +230,31 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) swapl(&rep.length); swaps(&rep.ScreenCount); } - WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); return Success; } - // was PanoramiX -static int ProcPseudoramiXGetScreenSize(ClientPtr client) +static int +ProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); - WindowPtr pWin; - xPanoramiXGetScreenSizeReply rep; - register int n, rc; + WindowPtr pWin; + xPanoramiXGetScreenSizeReply rep; + register int n, rc; TRACE(); - + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) - return rc; + return rc; rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; /* screen dimensions */ - rep.width = pseudoramiXScreens[stuff->screen].w; + rep.width = pseudoramiXScreens[stuff->screen].w; // was screenInfo.screens[stuff->screen]->width; rep.height = pseudoramiXScreens[stuff->screen].h; // was screenInfo.screens[stuff->screen]->height; @@ -264,19 +264,19 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client) swaps(&rep.width); swaps(&rep.height); } - WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); return Success; } - // was Xinerama -static int ProcPseudoramiXIsActive(ClientPtr client) +static int +ProcPseudoramiXIsActive(ClientPtr client) { /* REQUEST(xXineramaIsActiveReq); */ - xXineramaIsActiveReply rep; + xXineramaIsActiveReply rep; TRACE(); - + REQUEST_SIZE_MATCH(xXineramaIsActiveReq); rep.type = X_Reply; @@ -284,23 +284,24 @@ static int ProcPseudoramiXIsActive(ClientPtr client) rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - swapl(&rep.state); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.state); } - WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); return Success; } - // was Xinerama -static int ProcPseudoramiXQueryScreens(ClientPtr client) +static int +ProcPseudoramiXQueryScreens(ClientPtr client) { /* REQUEST(xXineramaQueryScreensReq); */ - xXineramaQueryScreensReply rep; + xXineramaQueryScreensReply rep; + + DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", + noPseudoramiXExtension, pseudoramiXNumScreens); - DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens); - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); rep.type = X_Reply; @@ -308,155 +309,150 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens; rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { - swaps(&rep.sequenceNumber); - swapl(&rep.length); - swapl(&rep.number); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.number); } - WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); if (!noPseudoramiXExtension) { - xXineramaScreenInfo scratch; - int i; - - for(i = 0; i < pseudoramiXNumScreens; i++) { - scratch.x_org = pseudoramiXScreens[i].x; - scratch.y_org = pseudoramiXScreens[i].y; - scratch.width = pseudoramiXScreens[i].w; - scratch.height = pseudoramiXScreens[i].h; - - if(client->swapped) { - swaps(&scratch.x_org); - swaps(&scratch.y_org); - swaps(&scratch.width); - swaps(&scratch.height); - } - WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); - } + xXineramaScreenInfo scratch; + int i; + + for (i = 0; i < pseudoramiXNumScreens; i++) { + scratch.x_org = pseudoramiXScreens[i].x; + scratch.y_org = pseudoramiXScreens[i].y; + scratch.width = pseudoramiXScreens[i].w; + scratch.height = pseudoramiXScreens[i].h; + + if (client->swapped) { + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); + } + WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch); + } } return Success; } - // was PanoramiX -static int ProcPseudoramiXDispatch (ClientPtr client) -{ REQUEST(xReq); +static int +ProcPseudoramiXDispatch(ClientPtr client) +{ + REQUEST(xReq); TRACE(); - switch (stuff->data) - { - case X_PanoramiXQueryVersion: - return ProcPseudoramiXQueryVersion(client); - case X_PanoramiXGetState: - return ProcPseudoramiXGetState(client); - case X_PanoramiXGetScreenCount: - return ProcPseudoramiXGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return ProcPseudoramiXGetScreenSize(client); - case X_XineramaIsActive: - return ProcPseudoramiXIsActive(client); - case X_XineramaQueryScreens: - return ProcPseudoramiXQueryScreens(client); + switch (stuff->data) { + case X_PanoramiXQueryVersion: + return ProcPseudoramiXQueryVersion(client); + case X_PanoramiXGetState: + return ProcPseudoramiXGetState(client); + case X_PanoramiXGetScreenCount: + return ProcPseudoramiXGetScreenCount(client); + case X_PanoramiXGetScreenSize: + return ProcPseudoramiXGetScreenSize(client); + case X_XineramaIsActive: + return ProcPseudoramiXIsActive(client); + case X_XineramaQueryScreens: + return ProcPseudoramiXQueryScreens(client); } return BadRequest; } - - static int -SProcPseudoramiXQueryVersion (ClientPtr client) +SProcPseudoramiXQueryVersion(ClientPtr client) { - REQUEST(xPanoramiXQueryVersionReq); + REQUEST(xPanoramiXQueryVersionReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); - return ProcPseudoramiXQueryVersion(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); + return ProcPseudoramiXQueryVersion(client); } static int SProcPseudoramiXGetState(ClientPtr client) { - REQUEST(xPanoramiXGetStateReq); + REQUEST(xPanoramiXGetStateReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - return ProcPseudoramiXGetState(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); + return ProcPseudoramiXGetState(client); } static int SProcPseudoramiXGetScreenCount(ClientPtr client) { - REQUEST(xPanoramiXGetScreenCountReq); + REQUEST(xPanoramiXGetScreenCountReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - return ProcPseudoramiXGetScreenCount(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); + return ProcPseudoramiXGetScreenCount(client); } static int SProcPseudoramiXGetScreenSize(ClientPtr client) { - REQUEST(xPanoramiXGetScreenSizeReq); + REQUEST(xPanoramiXGetScreenSizeReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - return ProcPseudoramiXGetScreenSize(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); + return ProcPseudoramiXGetScreenSize(client); } - static int SProcPseudoramiXIsActive(ClientPtr client) { - REQUEST(xXineramaIsActiveReq); + REQUEST(xXineramaIsActiveReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - return ProcPseudoramiXIsActive(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXineramaIsActiveReq); + return ProcPseudoramiXIsActive(client); } - static int SProcPseudoramiXQueryScreens(ClientPtr client) { - REQUEST(xXineramaQueryScreensReq); + REQUEST(xXineramaQueryScreensReq); TRACE(); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - return ProcPseudoramiXQueryScreens(client); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); + return ProcPseudoramiXQueryScreens(client); } - static int -SProcPseudoramiXDispatch (ClientPtr client) -{ REQUEST(xReq); +SProcPseudoramiXDispatch(ClientPtr client) +{ + REQUEST(xReq); TRACE(); - switch (stuff->data) - { - case X_PanoramiXQueryVersion: - return SProcPseudoramiXQueryVersion(client); - case X_PanoramiXGetState: - return SProcPseudoramiXGetState(client); - case X_PanoramiXGetScreenCount: - return SProcPseudoramiXGetScreenCount(client); - case X_PanoramiXGetScreenSize: - return SProcPseudoramiXGetScreenSize(client); - case X_XineramaIsActive: - return SProcPseudoramiXIsActive(client); - case X_XineramaQueryScreens: - return SProcPseudoramiXQueryScreens(client); + switch (stuff->data) { + case X_PanoramiXQueryVersion: + return SProcPseudoramiXQueryVersion(client); + case X_PanoramiXGetState: + return SProcPseudoramiXGetState(client); + case X_PanoramiXGetScreenCount: + return SProcPseudoramiXGetScreenCount(client); + case X_PanoramiXGetScreenSize: + return SProcPseudoramiXGetScreenSize(client); + case X_XineramaIsActive: + return SProcPseudoramiXIsActive(client); + case X_XineramaQueryScreens: + return SProcPseudoramiXQueryScreens(client); } return BadRequest; } |