diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-07-27 19:02:39 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-07-27 19:02:39 +0000 |
commit | 269d40cbcc43b41f621ca6d91c182952f60ec48e (patch) | |
tree | 872f2fddd3f2207e57a28595e73886713ce4a77a /xserver/Xext/panoramiX.c | |
parent | 917a2249b787451cad3f9697872aeccfd0da3324 (diff) |
Update to xserver 1.8. Tested by many. Ok oga@, todd@.
Diffstat (limited to 'xserver/Xext/panoramiX.c')
-rw-r--r-- | xserver/Xext/panoramiX.c | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/xserver/Xext/panoramiX.c b/xserver/Xext/panoramiX.c index a1f4ce01e..cfeba017f 100644 --- a/xserver/Xext/panoramiX.c +++ b/xserver/Xext/panoramiX.c @@ -31,7 +31,6 @@ Equipment Corporation. #include <dmx-config.h> #endif -#define NEED_REPLIES #include <stdio.h> #include <X11/X.h> #include <X11/Xproto.h> @@ -57,9 +56,7 @@ Equipment Corporation. #include "picturestr.h" #endif #include "modinit.h" - -#define SERVER_PANORAMIX_MAJOR_VERSION 1 -#define SERVER_PANORAMIX_MINOR_VERSION 1 +#include "protocol-versions.h" #ifdef GLXPROXY extern VisualPtr glxMatchVisual(ScreenPtr pScreen, @@ -73,9 +70,9 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen, int PanoramiXPixWidth = 0; int PanoramiXPixHeight = 0; -_X_EXPORT int PanoramiXNumScreens = 0; +int PanoramiXNumScreens = 0; -_X_EXPORT PanoramiXData *panoramiXdataPtr = NULL; +PanoramiXData *panoramiXdataPtr = NULL; static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL}; static int PanoramiXNumDepths; @@ -83,14 +80,14 @@ static DepthPtr PanoramiXDepths; static int PanoramiXNumVisuals; static VisualPtr PanoramiXVisuals; -_X_EXPORT unsigned long XRC_DRAWABLE; -_X_EXPORT unsigned long XRT_WINDOW; -_X_EXPORT unsigned long XRT_PIXMAP; -_X_EXPORT unsigned long XRT_GC; -_X_EXPORT unsigned long XRT_COLORMAP; +unsigned long XRC_DRAWABLE; +unsigned long XRT_WINDOW; +unsigned long XRT_PIXMAP; +unsigned long XRT_GC; +unsigned long XRT_COLORMAP; static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr); -_X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual; +XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual; /* * Function prototypes @@ -330,7 +327,7 @@ XineramaDestroyClip(GCPtr pGC) Xinerama_GC_FUNC_EPILOGUE (pGC); } -_X_EXPORT int +int XineramaDeleteResource(pointer data, XID id) { xfree(data); @@ -355,9 +352,12 @@ PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen) { PanoramiXSearchData data; + pointer val; - if(!screen) - return LookupIDByType(id, type); + if(!screen) { + dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess); + return val; + } data.screen = screen; data.id = id; @@ -373,7 +373,7 @@ typedef struct _connect_callback_list { static XineramaConnectionCallbackList *ConnectionCallbackList = NULL; -_X_EXPORT Bool +Bool XineramaRegisterConnectionBlockCallback(void (*func)(void)) { XineramaConnectionCallbackList *newlist; @@ -503,15 +503,23 @@ void PanoramiXExtensionInit(int argc, char *argv[]) } XRC_DRAWABLE = CreateNewResourceClass(); - XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource) | - XRC_DRAWABLE; - XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource) | - XRC_DRAWABLE; - XRT_GC = CreateNewResourceType(XineramaDeleteResource); - XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource); - - panoramiXGeneration = serverGeneration; - success = TRUE; + XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource, + "XineramaWindow"); + if (XRT_WINDOW) + XRT_WINDOW |= XRC_DRAWABLE; + XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource, + "XineramaPixmap"); + if (XRT_PIXMAP) + XRT_PIXMAP |= XRC_DRAWABLE; + XRT_GC = CreateNewResourceType(XineramaDeleteResource, + "XineramaGC"); + XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource, + "XineramaColormap"); + + if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) { + panoramiXGeneration = serverGeneration; + success = TRUE; + } } if (!success) { @@ -667,7 +675,7 @@ Bool PanoramiXCreateConnectionBlock(void) length += (depth->nVisuals * sizeof(xVisualType)); } - connSetupPrefix.length = length >> 2; + connSetupPrefix.length = bytes_to_int32(length); for (i = 0; i < PanoramiXNumDepths; i++) xfree(PanoramiXDepths[i].vids); @@ -841,7 +849,7 @@ PanoramiXConsolidate(void) AddResource(defmap->info[0].id, XRT_COLORMAP, defmap); } -_X_EXPORT VisualID +VisualID PanoramiXTranslateVisualID(int screen, VisualID orig) { ScreenPtr pOtherScreen = screenInfo.screens[screen]; @@ -1051,7 +1059,7 @@ ProcXineramaQueryScreens(ClientPtr client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; - rep.length = rep.number * sz_XineramaScreenInfo >> 2; + rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { int n; swaps (&rep.sequenceNumber, n); |