diff --git a/.gitignore b/.gitignore index 72390a0c3..94a12fdc2 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,4 @@ core # doltcompile doltlibtool +xserver.ent diff --git a/COPYING b/COPYING index 3fb06b8df..cd9e80a48 100644 --- a/COPYING +++ b/COPYING @@ -14,12 +14,12 @@ Copyright © 2006-2007 Intel Corporation Copyright © 2006 Nokia Corporation Copyright © 2006-2008 Peter Hutterer Copyright © 2006 Adam Jackson -Copyright © 2009 NVIDIA Corporation +Copyright © 2009-2010 NVIDIA Corporation +Copyright © 1987, 2003-2006, 2008-2010 Oracle and/or its affiliates. Copyright © 1999 Keith Packard Copyright © 2007-2009 Red Hat, Inc. Copyright © 2005-2008 Daniel Stone Copyright © 2006-2009 Simon Thum -Copyright © 1987, 2003-2006, 2008-2009 Sun Microsystems, Inc. Copyright © 2006 Luc Verhaegen Permission is hereby granted, free of charge, to any person obtaining a diff --git a/Makefile.am b/Makefile.am index 62c8d9501..75b9c4f6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,6 +19,7 @@ endif SUBDIRS = \ doc \ + man \ include \ dix \ fb \ @@ -38,8 +39,7 @@ SUBDIRS = \ $(GLX_DIR) \ exa \ config \ - hw \ - test + hw if XORG aclocaldir = $(datadir)/aclocal @@ -68,6 +68,7 @@ dist-hook: ChangeLog INSTALL DIST_SUBDIRS = \ doc \ + man \ include \ dix \ fb \ diff --git a/Xext/Makefile.am b/Xext/Makefile.am index e444fd08f..cb432e00e 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -15,7 +15,7 @@ INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod AM_CFLAGS = $(DIX_CFLAGS) if XORG -sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h +sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h syncsdk.h endif # Sources always included in libXextbuiltin.la & libXext.la @@ -26,6 +26,7 @@ BUILTIN_SRCS = \ sleepuntil.c \ sleepuntil.h \ sync.c \ + syncsdk.h \ syncsrv.h \ xcmisc.c \ xtest.c @@ -93,12 +94,6 @@ if XCSECURITY BUILTIN_SRCS += $(XCSECURITY_SRCS) endif -XCALIBRATE_SRCS = xcalibrate.c -if XCALIBRATE -BUILTIN_SRCS += $(XCALIBRATE_SRCS) -# XCalibrate needs tslib -endif - # XF86 Big Font extension BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h if XF86BIGFONT @@ -131,7 +126,6 @@ EXTRA_DIST = \ $(XACE_SRCS) \ $(XCSECURITY_SRCS) \ $(XSELINUX_SRCS) \ - $(XCALIBRATE_SRCS) \ $(XINERAMA_SRCS) \ $(BIGFONT_SRCS) \ $(DPMS_SRCS) \ diff --git a/Xext/geext.c b/Xext/geext.c index 8319c9291..18f8ffeac 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -33,8 +33,6 @@ #include "geext.h" #include "protocol-versions.h" -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - DevPrivateKeyRec GEClientPrivateKeyRec; int RT_GECLIENT = 0; @@ -51,6 +49,7 @@ static const int version_requests[] = { static void SGEGenericEvent(xEvent* from, xEvent* to); #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) +#define EXT_MASK(ext) ((ext) & 0x7F) /************************************************************/ /* request handlers */ @@ -187,14 +186,14 @@ SGEGenericEvent(xEvent* from, xEvent* to) xGenericEvent* gefrom = (xGenericEvent*)from; xGenericEvent* geto = (xGenericEvent*)to; - if (gefrom->extension > MAXEXTENSIONS) + if ((gefrom->extension & 0x7f) > MAXEXTENSIONS) { ErrorF("GE: Invalid extension offset for event.\n"); return; } - if (GEExtensions[gefrom->extension & 0x7F].evswap) - GEExtensions[gefrom->extension & 0x7F].evswap(gefrom, geto); + if (GEExtensions[EXT_MASK(gefrom->extension)].evswap) + GEExtensions[EXT_MASK(gefrom->extension)].evswap(gefrom, geto); } /* Init extension, register at server. @@ -243,11 +242,11 @@ void GERegisterExtension(int extension, void (*ev_swap)(xGenericEvent* from, xGenericEvent* to)) { - if ((extension & 0x7F) >= MAXEXTENSIONS) + if (EXT_MASK(extension) >= MAXEXTENSIONS) FatalError("GE: extension > MAXEXTENSIONS. This should not happen.\n"); /* extension opcodes are > 128, might as well save some space here */ - GEExtensions[extension & 0x7f].evswap = ev_swap; + GEExtensions[EXT_MASK(extension)].evswap = ev_swap; } diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index b73c53f19..00afe94f1 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -53,6 +53,12 @@ Equipment Corporation. #include "servermd.h" #include "resource.h" #include "picturestr.h" +#ifdef XFIXES +#include "xfixesint.h" +#endif +#ifdef COMPOSITE +#include "compint.h" +#endif #include "modinit.h" #include "protocol-versions.h" @@ -77,11 +83,11 @@ static DepthPtr PanoramiXDepths; static int PanoramiXNumVisuals; static VisualPtr PanoramiXVisuals; -unsigned long XRC_DRAWABLE; -unsigned long XRT_WINDOW; -unsigned long XRT_PIXMAP; -unsigned long XRT_GC; -unsigned long XRT_COLORMAP; +RESTYPE XRC_DRAWABLE; +RESTYPE XRT_WINDOW; +RESTYPE XRT_PIXMAP; +RESTYPE XRT_GC; +RESTYPE XRT_COLORMAP; static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr); XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual; @@ -387,7 +393,7 @@ static void XineramaInitData(ScreenPtr pScreen) int i, w, h; RegionNull(&PanoramiXScreenRegion); - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { BoxRec TheBox; RegionRec ScreenRegion; @@ -407,7 +413,7 @@ static void XineramaInitData(ScreenPtr pScreen) PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height; - for (i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { pScreen = screenInfo.screens[i]; w = pScreen->x + pScreen->width; h = pScreen->y + pScreen->height; @@ -472,7 +478,7 @@ void PanoramiXExtensionInit(int argc, char *argv[]) * run in non-PanoramiXeen mode. */ - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { pScreen = screenInfo.screens[i]; pScreenPriv = malloc(sizeof(PanoramiXScreenRec)); dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey, @@ -581,6 +587,13 @@ void PanoramiXExtensionInit(int argc, char *argv[]) ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor; PanoramiXRenderInit (); +#ifdef XFIXES + PanoramiXFixesInit (); +#endif +#ifdef COMPOSITE + PanoramiXCompositeInit (); +#endif + } extern Bool CreateConnectionBlock(void); @@ -727,7 +740,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth) int j, k; Bool found = FALSE; - for (j = 1; j < PanoramiXNumScreens; j++) { + FOR_NSCREENS_FORWARD_SKIP(j) { pScreen = screenInfo.screens[j]; for (k = 0; k < pScreen->numDepths; k++) { if (pScreen->allowedDepths[k].depth == pDepth->depth) { @@ -760,7 +773,7 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual) int j, k; Bool found = FALSE; - for (j = 1; j < PanoramiXNumScreens; j++) { + FOR_NSCREENS_FORWARD_SKIP(j) { pScreen = screenInfo.screens[j]; found = FALSE; @@ -823,7 +836,7 @@ PanoramiXConsolidate(void) saver = malloc(sizeof(PanoramiXRes)); saver->type = XRT_WINDOW; - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { ScreenPtr pScreen = screenInfo.screens[i]; root->info[i].id = pScreen->root->drawable.id; root->u.win.class = InputOutput; @@ -882,6 +895,9 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry) int i; PanoramiXRenderReset (); +#ifdef XFIXES + PanoramiXFixesReset (); +#endif screenInfo.numScreens = PanoramiXNumScreens; for (i = 256; i--; ) ProcVector[i] = SavedProcVector[i]; @@ -1058,7 +1074,7 @@ ProcXineramaQueryScreens(ClientPtr client) xXineramaScreenInfo scratch; int i; - for(i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { scratch.x_org = screenInfo.screens[i]->x; scratch.y_org = screenInfo.screens[i]->y; scratch.width = screenInfo.screens[i]->width; @@ -1163,7 +1179,7 @@ XineramaGetImageData( depth = (format == XYPixmap) ? 1 : pDraw->depth; - for(i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { BoxRec TheBox; ScreenPtr pScreen; pDraw = pDrawables[i]; diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h index a8684f0d2..71651e558 100644 --- a/Xext/panoramiX.h +++ b/Xext/panoramiX.h @@ -44,7 +44,7 @@ Equipment Corporation. #include #undef _PANORAMIX_SERVER #include "gcstruct.h" - +#include "dixstruct.h" typedef struct _PanoramiXInfo { XID id ; @@ -70,9 +70,11 @@ typedef struct { } PanoramiXRes; #define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++) +#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++) #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--) #define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j) #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared) +#define IS_ROOT_DRAWABLE(d) (((d)->type == XRT_WINDOW) && (d)->u.win.root) #endif /* _PANORAMIX_H_ */ diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 67b40304d..9ea461173 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -120,9 +120,7 @@ int PanoramiXCreateWindow(ClientPtr client) newWin->u.win.visibility = VisibilityNotViewable; newWin->u.win.class = stuff->class; newWin->u.win.root = FALSE; - newWin->info[0].id = stuff->wid; - for(j = 1; j < PanoramiXNumScreens; j++) - newWin->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newWin, client, stuff->wid); if (stuff->class == InputOnly) stuff->visual = CopyFromParent; @@ -634,7 +632,7 @@ int PanoramiXTranslateCoords(ClientPtr client) rep.dstX = x - pDst->drawable.x; rep.dstY = y - pDst->drawable.y; if((pDst == screenInfo.screens[0]->root) || - (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) + (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid)) { rep.dstX += screenInfo.screens[0]->x; rep.dstY += screenInfo.screens[0]->y; @@ -663,9 +661,7 @@ int PanoramiXCreatePixmap(ClientPtr client) newPix->type = XRT_PIXMAP; newPix->u.pix.shared = FALSE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newPix, client, stuff->pid); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPix->info[j].id; @@ -767,9 +763,7 @@ int PanoramiXCreateGC(ClientPtr client) return BadAlloc; newGC->type = XRT_GC; - newGC->info[0].id = stuff->gc; - for(j = 1; j < PanoramiXNumScreens; j++) - newGC->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newGC, client, stuff->gc); FOR_NSCREENS_BACKWARD(j) { stuff->gc = newGC->info[j].id; @@ -1334,7 +1328,7 @@ int PanoramiXPolyLine(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq)); if (npoint > 0){ origPts = malloc(npoint * sizeof(xPoint)); @@ -1394,7 +1388,7 @@ int PanoramiXPolySegment(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); if(nsegs & 4) return BadLength; @@ -1457,7 +1451,7 @@ int PanoramiXPolyRectangle(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); if(nrects & 4) return BadLength; @@ -1519,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); narcs = (client->req_len << 2) - sizeof(xPolyArcReq); if(narcs % sizeof(xArc)) return BadLength; @@ -1579,7 +1573,7 @@ int PanoramiXFillPoly(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq)); if (count > 0){ @@ -1640,7 +1634,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); if(things & 4) return BadLength; @@ -1701,7 +1695,7 @@ int PanoramiXPolyFillArc(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); if (narcs % sizeof(xArc)) return BadLength; @@ -1761,7 +1755,7 @@ int PanoramiXPutImage(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->dstX; orig_y = stuff->dstY; @@ -1824,7 +1818,7 @@ int PanoramiXGetImage(ClientPtr client) format = stuff->format; planemask = stuff->planeMask; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); if(isRoot) { if( /* check for being onscreen */ @@ -1846,7 +1840,7 @@ int PanoramiXGetImage(ClientPtr client) } drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, DixGetAttrAccess); if (rc != Success) @@ -1962,7 +1956,7 @@ PanoramiXPolyText8(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; @@ -2003,7 +1997,7 @@ PanoramiXPolyText16(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; @@ -2044,7 +2038,7 @@ int PanoramiXImageText8(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; @@ -2085,7 +2079,7 @@ int PanoramiXImageText16(ClientPtr client) if (result != Success) return result; - isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; + isRoot = IS_ROOT_DRAWABLE(draw); orig_x = stuff->x; orig_y = stuff->y; @@ -2121,9 +2115,7 @@ int PanoramiXCreateColormap(ClientPtr client) return BadAlloc; newCmap->type = XRT_COLORMAP; - newCmap->info[0].id = stuff->mid; - for(j = 1; j < PanoramiXNumScreens; j++) - newCmap->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newCmap, client, stuff->mid); orig_visual = stuff->visual; FOR_NSCREENS_BACKWARD(j){ @@ -2192,11 +2184,9 @@ PanoramiXCopyColormapAndFree(ClientPtr client) return BadAlloc; newCmap->type = XRT_COLORMAP; - newCmap->info[0].id = stuff->mid; - for(j = 1; j < PanoramiXNumScreens; j++) - newCmap->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newCmap, client, stuff->mid); - FOR_NSCREENS_BACKWARD(j){ + FOR_NSCREENS_BACKWARD(j) { stuff->srcCmap = cmap->info[j].id; stuff->mid = newCmap->info[j].id; result = (* SavedProcVector[X_CopyColormapAndFree])(client); diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h index 5b1a3a990..6fc903b88 100644 --- a/Xext/panoramiXsrv.h +++ b/Xext/panoramiXsrv.h @@ -21,11 +21,12 @@ extern _X_EXPORT int XineramaDeleteResource(pointer, XID); extern _X_EXPORT void XineramaReinitData(ScreenPtr); -extern _X_EXPORT unsigned long XRC_DRAWABLE; -extern _X_EXPORT unsigned long XRT_WINDOW; -extern _X_EXPORT unsigned long XRT_PIXMAP; -extern _X_EXPORT unsigned long XRT_GC; -extern _X_EXPORT unsigned long XRT_COLORMAP; +extern _X_EXPORT RESTYPE XRC_DRAWABLE; +extern _X_EXPORT RESTYPE XRT_WINDOW; +extern _X_EXPORT RESTYPE XRT_PIXMAP; +extern _X_EXPORT RESTYPE XRT_GC; +extern _X_EXPORT RESTYPE XRT_COLORMAP; +extern _X_EXPORT RESTYPE XRT_PICTURE; /* * Drivers are allowed to wrap this function. Each wrapper can decide that the @@ -50,4 +51,15 @@ extern _X_EXPORT void XineramaGetImageData( Bool isRoot ); +static inline void panoramix_setup_ids(PanoramiXRes *resource, + ClientPtr client, XID base_id) +{ + int j; + + resource->info[0].id = base_id; + FOR_NSCREENS_FORWARD_SKIP(j) { + resource->info[j].id = FakeClientID(client->index); + } +} + #endif /* _PANORAMIXSRV_H_ */ diff --git a/Xext/security.c b/Xext/security.c index 7eb95de74..8673880d1 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -154,8 +154,6 @@ SecurityLookupRequestName(ClientPtr client) } -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - /* SecurityDeleteAuthorization * * Arguments: diff --git a/Xext/shm.c b/Xext/shm.c index 23afe6b1f..b08af821b 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -848,7 +848,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) return BadAlloc; drawables[0] = pDraw; - for(i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, DixReadAccess); if (rc != Success) @@ -972,9 +972,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) newPix->type = XRT_PIXMAP; newPix->u.pix.shared = TRUE; - newPix->info[0].id = stuff->pid; - for(j = 1; j < PanoramiXNumScreens; j++) - newPix->info[j].id = FakeClientID(client->index); + panoramix_setup_ids(newPix, client, stuff->pid); result = Success; diff --git a/Xext/sync.c b/Xext/sync.c index f23df6cb9..36dd27888 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -59,14 +59,17 @@ PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include "misc.h" +#include "scrnintstr.h" #include "os.h" #include "extnsionst.h" #include "dixstruct.h" +#include "pixmapstr.h" #include "resource.h" #include "opaque.h" #include #include "syncsrv.h" +#include "syncsdk.h" +#include "protocol-versions.h" #include #if !defined(WIN32) @@ -84,11 +87,22 @@ static RESTYPE RTCounter = 0; static RESTYPE RTAwait; static RESTYPE RTAlarm; static RESTYPE RTAlarmClient; +static RESTYPE RTFence; static int SyncNumSystemCounters = 0; static SyncCounter **SysCounterList = NULL; +static int SyncNumInvalidCounterWarnings = 0; +#define MAX_INVALID_COUNTER_WARNINGS 5 + +static const char *WARN_INVALID_COUNTER_COMPARE = +"Warning: Non-counter XSync object using Counter-only\n" +" comparison. Result will never be true.\n"; + +static const char *WARN_INVALID_COUNTER_ALARM = +"Warning: Non-counter XSync object used in alarm. This is\n" +" the result of a programming error in the X server.\n"; #define IsSystemCounter(pCounter) \ - (pCounter && (pCounter->client == NULL)) + (pCounter && (pCounter->sync.client == NULL)) /* these are all the alarm attributes that pertain to the alarm's trigger */ #define XSyncCAAllTrigger \ @@ -100,24 +114,41 @@ static void SyncInitServerTime(void); static void SyncInitIdleTime(void); +static Bool +SyncCheckWarnIsCounter(const SyncObject* pSync, const char *warning) +{ + if (pSync && (SYNC_COUNTER != pSync->type)) + { + if (SyncNumInvalidCounterWarnings++ < MAX_INVALID_COUNTER_WARNINGS) + { + ErrorF("%s", warning); + ErrorF(" Counter type: %d\n", pSync->type); + } + + return FALSE; + } + + return TRUE; +} /* Each counter maintains a simple linked list of triggers that are * interested in the counter. The two functions below are used to * delete and add triggers on this list. */ static void -SyncDeleteTriggerFromCounter(SyncTrigger *pTrigger) +SyncDeleteTriggerFromSyncObject(SyncTrigger *pTrigger) { SyncTriggerList *pCur; SyncTriggerList *pPrev; + SyncCounter *pCounter; - /* pCounter needs to be stored in pTrigger before calling here. */ + /* pSync needs to be stored in pTrigger before calling here. */ - if (!pTrigger->pCounter) + if (!pTrigger->pSync) return; pPrev = NULL; - pCur = pTrigger->pCounter->pTriglist; + pCur = pTrigger->pSync->pTriglist; while (pCur) { @@ -126,7 +157,7 @@ SyncDeleteTriggerFromCounter(SyncTrigger *pTrigger) if (pPrev) pPrev->next = pCur->next; else - pTrigger->pCounter->pTriglist = pCur->next; + pTrigger->pSync->pTriglist = pCur->next; free(pCur); break; @@ -136,21 +167,30 @@ SyncDeleteTriggerFromCounter(SyncTrigger *pTrigger) pCur = pCur->next; } - if (IsSystemCounter(pTrigger->pCounter)) - SyncComputeBracketValues(pTrigger->pCounter); + if (SYNC_COUNTER == pTrigger->pSync->type) + { + pCounter = (SyncCounter *)pTrigger->pSync; + + if (IsSystemCounter(pCounter)) + SyncComputeBracketValues(pCounter); + } else if (SYNC_FENCE == pTrigger->pSync->type) { + SyncFence* pFence = (SyncFence*) pTrigger->pSync; + pFence->funcs.DeleteTrigger(pTrigger); + } } static int -SyncAddTriggerToCounter(SyncTrigger *pTrigger) +SyncAddTriggerToSyncObject(SyncTrigger *pTrigger) { SyncTriggerList *pCur; + SyncCounter *pCounter; - if (!pTrigger->pCounter) + if (!pTrigger->pSync) return Success; /* don't do anything if it's already there */ - for (pCur = pTrigger->pCounter->pTriglist; pCur; pCur = pCur->next) + for (pCur = pTrigger->pSync->pTriglist; pCur; pCur = pCur->next) { if (pCur->pTrigger == pTrigger) return Success; @@ -160,96 +200,153 @@ SyncAddTriggerToCounter(SyncTrigger *pTrigger) return BadAlloc; pCur->pTrigger = pTrigger; - pCur->next = pTrigger->pCounter->pTriglist; - pTrigger->pCounter->pTriglist = pCur; + pCur->next = pTrigger->pSync->pTriglist; + pTrigger->pSync->pTriglist = pCur; - if (IsSystemCounter(pTrigger->pCounter)) - SyncComputeBracketValues(pTrigger->pCounter); + if (SYNC_COUNTER == pTrigger->pSync->type) + { + pCounter = (SyncCounter *)pTrigger->pSync; + + if (IsSystemCounter(pCounter)) + SyncComputeBracketValues(pCounter); + } else if (SYNC_FENCE == pTrigger->pSync->type) { + SyncFence* pFence = (SyncFence*) pTrigger->pSync; + pFence->funcs.AddTrigger(pTrigger); + } return Success; } -/* Below are four possible functions that can be plugged into - * pTrigger->CheckTrigger, corresponding to the four possible - * test-types. These functions are called after the counter's - * value changes but are also passed the old counter value - * so they can inspect both the old and new values. - * (PositiveTransition and NegativeTransition need to see both - * pieces of information.) These functions return the truth value - * of the trigger. +/* Below are five possible functions that can be plugged into + * pTrigger->CheckTrigger for counter sync objects, corresponding to + * the four possible test-types, and the one possible function that + * can be plugged into pTrigger->CheckTrigger for fence sync objects. + * These functions are called after the sync object's state changes + * but are also passed the old state so they can inspect both the old + * and new values. (PositiveTransition and NegativeTransition need to + * see both pieces of information.) These functions return the truth + * value of the trigger. * - * All of them include the condition pTrigger->pCounter == NULL. - * This is because the spec says that a trigger with a counter value + * All of them include the condition pTrigger->pSync == NULL. + * This is because the spec says that a trigger with a sync value * of None is always TRUE. */ static Bool SyncCheckTriggerPositiveComparison(SyncTrigger *pTrigger, CARD64 oldval) { - return (pTrigger->pCounter == NULL || - XSyncValueGreaterOrEqual(pTrigger->pCounter->value, - pTrigger->test_value)); + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *)pTrigger->pSync; + + return (pCounter == NULL || + XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value)); } static Bool SyncCheckTriggerNegativeComparison(SyncTrigger *pTrigger, CARD64 oldval) { - return (pTrigger->pCounter == NULL || - XSyncValueLessOrEqual(pTrigger->pCounter->value, - pTrigger->test_value)); + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *)pTrigger->pSync; + + return (pCounter == NULL || + XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value)); } static Bool SyncCheckTriggerPositiveTransition(SyncTrigger *pTrigger, CARD64 oldval) { - return (pTrigger->pCounter == NULL || + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *)pTrigger->pSync; + + return (pCounter == NULL || (XSyncValueLessThan(oldval, pTrigger->test_value) && - XSyncValueGreaterOrEqual(pTrigger->pCounter->value, - pTrigger->test_value))); + XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value))); } static Bool SyncCheckTriggerNegativeTransition(SyncTrigger *pTrigger, CARD64 oldval) { - return (pTrigger->pCounter == NULL || + SyncCounter *pCounter; + + /* Non-counter sync objects should never get here because they + * never trigger this comparison. */ + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE)) + return FALSE; + + pCounter = (SyncCounter *)pTrigger->pSync; + + return (pCounter == NULL || (XSyncValueGreaterThan(oldval, pTrigger->test_value) && - XSyncValueLessOrEqual(pTrigger->pCounter->value, - pTrigger->test_value))); + XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value))); +} + +static Bool +SyncCheckTriggerFence(SyncTrigger *pTrigger, CARD64 unused) +{ + SyncFence* pFence = (SyncFence*) pTrigger->pSync; + (void)unused; + + return (pFence == NULL || + pFence->funcs.CheckTriggered(pFence)); } static int -SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter, - Mask changes) +SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XID syncObject, + RESTYPE resType, Mask changes) { - SyncCounter *pCounter = pTrigger->pCounter; + SyncObject *pSync = pTrigger->pSync; + SyncCounter *pCounter = NULL; int rc; - Bool newcounter = FALSE; + Bool newSyncObject = FALSE; if (changes & XSyncCACounter) { - if (counter == None) - pCounter = NULL; - else if (Success != (rc = dixLookupResourceByType ((pointer *)&pCounter, - counter, RTCounter, client, DixReadAccess))) + if (syncObject == None) + pSync = NULL; + else if (Success != (rc = dixLookupResourceByType ((pointer *)&pSync, + syncObject, resType, client, DixReadAccess))) { - client->errorValue = counter; + client->errorValue = syncObject; return rc; } - if (pCounter != pTrigger->pCounter) + if (pSync != pTrigger->pSync) { /* new counter for trigger */ - SyncDeleteTriggerFromCounter(pTrigger); - pTrigger->pCounter = pCounter; - newcounter = TRUE; + SyncDeleteTriggerFromSyncObject(pTrigger); + pTrigger->pSync = pSync; + newSyncObject = TRUE; } } /* if system counter, ask it what the current value is */ - if (IsSystemCounter(pCounter)) + if (pSync && SYNC_COUNTER == pSync->type) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, - &pCounter->value); + pCounter = (SyncCounter *)pSync; + + if (IsSystemCounter(pCounter)) + { + (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + &pCounter->value); + } } if (changes & XSyncCAValueType) @@ -264,30 +361,33 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter, if (changes & XSyncCATestType) { - if (pTrigger->test_type != XSyncPositiveTransition && - pTrigger->test_type != XSyncNegativeTransition && - pTrigger->test_type != XSyncPositiveComparison && - pTrigger->test_type != XSyncNegativeComparison) + + if (pSync && SYNC_FENCE == pSync->type) { - client->errorValue = pTrigger->test_type; - return BadValue; + pTrigger->CheckTrigger = SyncCheckTriggerFence; } - /* select appropriate CheckTrigger function */ - - switch (pTrigger->test_type) + else { - case XSyncPositiveTransition: - pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition; - break; - case XSyncNegativeTransition: - pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition; - break; - case XSyncPositiveComparison: - pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison; - break; - case XSyncNegativeComparison: - pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison; - break; + /* select appropriate CheckTrigger function */ + + switch (pTrigger->test_type) + { + case XSyncPositiveTransition: + pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition; + break; + case XSyncNegativeTransition: + pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition; + break; + case XSyncPositiveComparison: + pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison; + break; + case XSyncNegativeComparison: + pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison; + break; + default: + client->errorValue = pTrigger->test_type; + return BadValue; + } } } @@ -314,12 +414,12 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter, /* we wait until we're sure there are no errors before registering * a new counter on a trigger */ - if (newcounter) + if (newSyncObject) { - if ((rc = SyncAddTriggerToCounter(pTrigger)) != Success) + if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success) return rc; } - else if (IsSystemCounter(pCounter)) + else if (pCounter && IsSystemCounter(pCounter)) { SyncComputeBracketValues(pCounter); } @@ -337,16 +437,22 @@ SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm) SyncAlarmClientList *pcl; xSyncAlarmNotifyEvent ane; SyncTrigger *pTrigger = &pAlarm->trigger; + SyncCounter *pCounter; + + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) + return; + + pCounter = (SyncCounter *)pTrigger->pSync; UpdateCurrentTime(); ane.type = SyncEventBase + XSyncAlarmNotify; ane.kind = XSyncAlarmNotify; ane.alarm = pAlarm->alarm_id; - if (pTrigger->pCounter) + if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) { - ane.counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value); - ane.counter_value_lo = XSyncValueLow32(pTrigger->pCounter->value); + ane.counter_value_hi = XSyncValueHigh32(pCounter->value); + ane.counter_value_lo = XSyncValueLow32(pCounter->value); } else { /* XXX what else can we do if there's no counter? */ @@ -389,14 +495,25 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait **ppAwait, SyncTrigger *pTrigger = &(*ppAwait)->trigger; pev->type = SyncEventBase + XSyncCounterNotify; pev->kind = XSyncCounterNotify; - pev->counter = pTrigger->pCounter->id; + pev->counter = pTrigger->pSync->id; pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); - pev->counter_value_lo = XSyncValueLow32(pTrigger->pCounter->value); - pev->counter_value_hi = XSyncValueHigh32(pTrigger->pCounter->value); + if (SYNC_COUNTER == pTrigger->pSync->type) + { + SyncCounter *pCounter = (SyncCounter *)pTrigger->pSync; + + pev->counter_value_lo = XSyncValueLow32(pCounter->value); + pev->counter_value_hi = XSyncValueHigh32(pCounter->value); + } + else + { + pev->counter_value_lo = 0; + pev->counter_value_hi = 0; + } + pev->time = currentTime.milliseconds; pev->count = num_events - i - 1; /* events remaining */ - pev->destroyed = pTrigger->pCounter->beingDestroyed; + pev->destroyed = pTrigger->pSync->beingDestroyed; } /* swapping will be taken care of by this */ WriteEventsToClient(client, num_events, (xEvent *)pEvents); @@ -414,7 +531,7 @@ SyncAlarmCounterDestroyed(SyncTrigger *pTrigger) pAlarm->state = XSyncAlarmInactive; SyncSendAlarmNotifyEvents(pAlarm); - pTrigger->pCounter = NULL; + pTrigger->pSync = NULL; } @@ -425,8 +542,14 @@ static void SyncAlarmTriggerFired(SyncTrigger *pTrigger) { SyncAlarm *pAlarm = (SyncAlarm *)pTrigger; + SyncCounter *pCounter; CARD64 new_test_value; + if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM)) + return; + + pCounter = (SyncCounter *)pTrigger->pSync; + /* no need to check alarm unless it's active */ if (pAlarm->state != XSyncAlarmActive) return; @@ -436,7 +559,7 @@ SyncAlarmTriggerFired(SyncTrigger *pTrigger) * no change is made to value (test-value) and the alarm * state is changed to Inactive before the event is generated." */ - if (pAlarm->trigger.pCounter == NULL + if (pCounter == NULL || (XSyncValueIsZero(pAlarm->delta) && (pAlarm->trigger.test_type == XSyncPositiveComparison || pAlarm->trigger.test_type == XSyncNegativeComparison))) @@ -449,6 +572,13 @@ SyncAlarmTriggerFired(SyncTrigger *pTrigger) Bool overflow; CARD64 oldvalue; SyncTrigger *paTrigger = &pAlarm->trigger; + SyncCounter *paCounter; + + if (!SyncCheckWarnIsCounter(paTrigger->pSync, + WARN_INVALID_COUNTER_ALARM)) + return; + + paCounter = (SyncCounter *)pTrigger->pSync; /* "The alarm is updated by repeatedly adding delta to the * value of the trigger and re-initializing it until it @@ -464,7 +594,7 @@ SyncAlarmTriggerFired(SyncTrigger *pTrigger) pAlarm->delta, &overflow); } while (!overflow && (*paTrigger->CheckTrigger)(paTrigger, - paTrigger->pCounter->value)); + paCounter->value)); new_test_value = paTrigger->test_value; paTrigger->test_value = oldvalue; @@ -531,46 +661,51 @@ SyncAwaitTriggerFired(SyncTrigger *pTrigger) * always generated if the counter for one of the triggers is * destroyed." */ - if (pAwait->trigger.pCounter->beingDestroyed) + if (pAwait->trigger.pSync->beingDestroyed) { ppAwait[num_events++] = pAwait; continue; } + + if (SYNC_COUNTER == pAwait->trigger.pSync->type) + { + SyncCounter *pCounter = (SyncCounter *) pAwait->trigger.pSync; - /* "The difference between the counter and the test value is - * calculated by subtracting the test value from the value of - * the counter." - */ - XSyncValueSubtract(&diff, pAwait->trigger.pCounter->value, - pAwait->trigger.test_value, &overflow); + /* "The difference between the counter and the test value is + * calculated by subtracting the test value from the value of + * the counter." + */ + XSyncValueSubtract(&diff, pCounter->value, + pAwait->trigger.test_value, &overflow); - /* "If the difference lies outside the range for an INT64, an - * event is not generated." - */ - if (overflow) - continue; - diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold); - diffequal = XSyncValueEqual(diff, pAwait->event_threshold); - - /* "If the test-type is PositiveTransition or - * PositiveComparison, a CounterNotify event is generated if - * the difference is at least event-threshold. If the test-type - * is NegativeTransition or NegativeComparison, a CounterNotify - * event is generated if the difference is at most - * event-threshold." - */ + /* "If the difference lies outside the range for an INT64, an + * event is not generated." + */ + if (overflow) + continue; + diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold); + diffequal = XSyncValueEqual(diff, pAwait->event_threshold); + + /* "If the test-type is PositiveTransition or + * PositiveComparison, a CounterNotify event is generated if + * the difference is at least event-threshold. If the test-type + * is NegativeTransition or NegativeComparison, a CounterNotify + * event is generated if the difference is at most + * event-threshold." + */ - if ( ((pAwait->trigger.test_type == XSyncPositiveComparison || - pAwait->trigger.test_type == XSyncPositiveTransition) - && (diffgreater || diffequal)) - || - ((pAwait->trigger.test_type == XSyncNegativeComparison || - pAwait->trigger.test_type == XSyncNegativeTransition) - && (!diffgreater) /* less or equal */ - ) - ) - { - ppAwait[num_events++] = pAwait; + if ( ((pAwait->trigger.test_type == XSyncPositiveComparison || + pAwait->trigger.test_type == XSyncPositiveTransition) + && (diffgreater || diffequal)) + || + ((pAwait->trigger.test_type == XSyncNegativeComparison || + pAwait->trigger.test_type == XSyncNegativeTransition) + && (!diffgreater) /* less or equal */ + ) + ) + { + ppAwait[num_events++] = pAwait; + } } } if (num_events) @@ -599,7 +734,7 @@ SyncChangeCounter(SyncCounter *pCounter, CARD64 newval) pCounter->value = newval; /* run through triggers to see if any become true */ - for (ptl = pCounter->pTriglist; ptl; ptl = pnext) + for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { pnext = ptl->next; if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, oldval)) @@ -666,17 +801,15 @@ SyncEventSelectForAlarm(SyncAlarm *pAlarm, ClientPtr client, Bool wantevents) */ pClients->delete_id = FakeClientID(client->index); - if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm)) - { - free(pClients); - return BadAlloc; - } /* link it into list after we know all the allocations succeed */ - pClients->next = pAlarm->pEventClients; pAlarm->pEventClients = pClients; pClients->client = client; + + if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm)) + return BadAlloc; + return Success; } @@ -691,7 +824,8 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask, XSyncCounter counter; Mask origmask = mask; - counter = pAlarm->trigger.pCounter ? pAlarm->trigger.pCounter->id : None; + counter = + pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None; while (mask) { @@ -771,7 +905,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask, } /* postpone this until now, when we're sure nothing else can go wrong */ - if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, + if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter, origmask & XSyncCAAllTrigger)) != Success) return status; @@ -780,27 +914,52 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask, return Success; } +static SyncObject * +SyncCreate(ClientPtr client, XID id, unsigned char type) +{ + SyncObject *pSync; + + switch (type) { + case SYNC_COUNTER: + pSync = malloc(sizeof(SyncCounter)); + break; + case SYNC_FENCE: + pSync = (SyncObject*)dixAllocateObjectWithPrivates(SyncFence, + PRIVATE_SYNC_FENCE); + break; + default: + return NULL; + } + + if (!pSync) + return NULL; + + pSync->client = client; + pSync->id = id; + pSync->pTriglist = NULL; + pSync->beingDestroyed = FALSE; + pSync->type = type; + + return pSync; +} + static SyncCounter * SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue) { SyncCounter *pCounter; - if (!(pCounter = malloc(sizeof(SyncCounter)))) + if (!(pCounter = (SyncCounter *)SyncCreate(client, + id, + SYNC_COUNTER))) return NULL; + pCounter->value = initialvalue; + pCounter->pSysCounterInfo = NULL; + if (!AddResource(id, RTCounter, (pointer) pCounter)) - { - free(pCounter); return NULL; - } - pCounter->client = client; - pCounter->id = id; - pCounter->value = initialvalue; - pCounter->pTriglist = NULL; - pCounter->beingDestroyed = FALSE; - pCounter->pSysCounterInfo = NULL; return pCounter; } @@ -851,7 +1010,7 @@ SyncCreateSystemCounter( psci = malloc(sizeof(SysCounterInfo)); if (!psci) { - FreeResource(pCounter->id, RT_NONE); + FreeResource(pCounter->sync.id, RT_NONE); return pCounter; } pCounter->pSysCounterInfo = psci; @@ -871,7 +1030,7 @@ void SyncDestroySystemCounter(pointer pSysCounter) { SyncCounter *pCounter = (SyncCounter *)pSysCounter; - FreeResource(pCounter->id, RT_NONE); + FreeResource(pCounter->sync.id, RT_NONE); } static void @@ -895,7 +1054,7 @@ SyncComputeBracketValues(SyncCounter *pCounter) XSyncMaxValue(&psci->bracket_greater); XSyncMinValue(&psci->bracket_less); - for (pCur = pCounter->pTriglist; pCur; pCur = pCur->next) + for (pCur = pCounter->sync.pTriglist; pCur; pCur = pCur->next) { pTrigger = pCur->pTrigger; @@ -929,6 +1088,17 @@ SyncComputeBracketValues(SyncCounter *pCounter) { psci->bracket_less = pTrigger->test_value; pnewltval = &psci->bracket_less; + } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && + XSyncValueLessThan(pTrigger->test_value, + psci->bracket_greater)) + { + /* + * The value is exactly equal to our threshold. We want one + * more event in the positive direction to ensure we pick up + * when the value *exceeds* this threshold. + */ + psci->bracket_greater = pTrigger->test_value; + pnewgtval = &psci->bracket_greater; } } else if (pTrigger->test_type == XSyncPositiveTransition && @@ -939,6 +1109,17 @@ SyncComputeBracketValues(SyncCounter *pCounter) { psci->bracket_greater = pTrigger->test_value; pnewgtval = &psci->bracket_greater; + } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && + XSyncValueGreaterThan(pTrigger->test_value, + psci->bracket_less)) + { + /* + * The value is exactly equal to our threshold. We want one + * more event in the negative direction to ensure we pick up + * when the value is less than this threshold. + */ + psci->bracket_less = pTrigger->test_value; + pnewltval = &psci->bracket_less; } } } /* end for each trigger */ @@ -968,7 +1149,7 @@ FreeAlarm(void *addr, XID id) while (pAlarm->pEventClients) FreeResource(pAlarm->pEventClients->delete_id, RT_NONE); - SyncDeleteTriggerFromCounter(&pAlarm->trigger); + SyncDeleteTriggerFromSyncObject(&pAlarm->trigger); free(pAlarm); return Success; @@ -985,9 +1166,9 @@ FreeCounter(void *env, XID id) SyncCounter *pCounter = (SyncCounter *) env; SyncTriggerList *ptl, *pnext; - pCounter->beingDestroyed = TRUE; + pCounter->sync.beingDestroyed = TRUE; /* tell all the counter's triggers that the counter has been destroyed */ - for (ptl = pCounter->pTriglist; ptl; ptl = pnext) + for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) { (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger); pnext = ptl->next; @@ -1046,9 +1227,9 @@ FreeAwait(void *addr, XID id) /* If the counter is being destroyed, FreeCounter will delete * the trigger list itself, so don't do it here. */ - SyncCounter *pCounter = pAwait->trigger.pCounter; - if (pCounter && !pCounter->beingDestroyed) - SyncDeleteTriggerFromCounter(&pAwait->trigger); + SyncObject *pSync = pAwait->trigger.pSync; + if (pSync && !pSync->beingDestroyed) + SyncDeleteTriggerFromSyncObject(&pAwait->trigger); } free(pAwaitUnion); return Success; @@ -1099,8 +1280,8 @@ ProcSyncInitialize(ClientPtr client) memset(&rep, 0, sizeof(xSyncInitializeReply)); rep.type = X_Reply; rep.sequenceNumber = client->sequence; - rep.majorVersion = SYNC_MAJOR_VERSION; - rep.minorVersion = SYNC_MINOR_VERSION; + rep.majorVersion = SERVER_SYNC_MAJOR_VERSION; + rep.minorVersion = SERVER_SYNC_MINOR_VERSION; rep.length = 0; if (client->swapped) @@ -1157,7 +1338,7 @@ ProcSyncListSystemCounters(ClientPtr client) char *pname_in_reply; SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo; - walklist->counter = SysCounterList[i]->id; + walklist->counter = SysCounterList[i]->sync.id; walklist->resolution_hi = XSyncValueHigh32(psci->resolution); walklist->resolution_lo = XSyncValueLow32(psci->resolution); namelen = strlen(psci->name); @@ -1370,10 +1551,67 @@ ProcSyncDestroyCounter(ClientPtr client) client->errorValue = stuff->counter; return BadAccess; } - FreeResource(pCounter->id, RT_NONE); + FreeResource(pCounter->sync.id, RT_NONE); return Success; } +static SyncAwaitUnion* +SyncAwaitPrologue(ClientPtr client, int items) +{ + SyncAwaitUnion *pAwaitUnion; + + /* all the memory for the entire await list is allocated + * here in one chunk + */ + pAwaitUnion = malloc((items+1) * sizeof(SyncAwaitUnion)); + if (!pAwaitUnion) + return NULL; + + /* first item is the header, remainder are real wait conditions */ + + pAwaitUnion->header.delete_id = FakeClientID(client->index); + pAwaitUnion->header.client = client; + pAwaitUnion->header.num_waitconditions = 0; + + if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion)) + return NULL; + + return pAwaitUnion; +} + +static void +SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion *pAwaitUnion) +{ + SyncAwait *pAwait; + int i; + + IgnoreClient(client); + + /* see if any of the triggers are already true */ + + pAwait = &(pAwaitUnion+1)->await; /* skip over header */ + for (i = 0; i < items; i++, pAwait++) + { + CARD64 value; + + /* don't have to worry about NULL counters because the request + * errors before we get here out if they occur + */ + switch (pAwait->trigger.pSync->type) { + case SYNC_COUNTER: + value = ((SyncCounter *)pAwait->trigger.pSync)->value; + break; + default: + XSyncIntToValue(&value, 0); + } + + if ((*pAwait->trigger.CheckTrigger)(&pAwait->trigger, value)) + { + (*pAwait->trigger.TriggerFired)(&pAwait->trigger); + break; /* once is enough */ + } + } +} /* * ** Await @@ -1405,28 +1643,12 @@ ProcSyncAwait(ClientPtr client) return BadValue; } - pProtocolWaitConds = (xSyncWaitCondition *) & stuff[1]; - - /* all the memory for the entire await list is allocated - * here in one chunk - */ - pAwaitUnion = malloc((items+1) * sizeof(SyncAwaitUnion)); - if (!pAwaitUnion) - return BadAlloc; - - /* first item is the header, remainder are real wait conditions */ - - pAwaitUnion->header.delete_id = FakeClientID(client->index); - if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion)) - { - free(pAwaitUnion); + if (!(pAwaitUnion = SyncAwaitPrologue(client, items))) return BadAlloc; - } /* don't need to do any more memory allocation for this request! */ - pAwaitUnion->header.client = client; - pAwaitUnion->header.num_waitconditions = 0; + pProtocolWaitConds = (xSyncWaitCondition *) & stuff[1]; pAwait = &(pAwaitUnion+1)->await; /* skip over header */ for (i = 0; i < items; i++, pProtocolWaitConds++, pAwait++) @@ -1434,7 +1656,7 @@ ProcSyncAwait(ClientPtr client) if (pProtocolWaitConds->counter == None) /* XXX protocol change */ { /* this should take care of removing any triggers created by - * this request that have already been registered on counters + * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); client->errorValue = pProtocolWaitConds->counter; @@ -1442,7 +1664,7 @@ ProcSyncAwait(ClientPtr client) } /* sanity checks are in SyncInitTrigger */ - pAwait->trigger.pCounter = NULL; + pAwait->trigger.pSync = NULL; pAwait->trigger.value_type = pProtocolWaitConds->value_type; XSyncIntsToValue(&pAwait->trigger.wait_value, pProtocolWaitConds->wait_value_lo, @@ -1450,11 +1672,12 @@ ProcSyncAwait(ClientPtr client) pAwait->trigger.test_type = pProtocolWaitConds->test_type; status = SyncInitTrigger(client, &pAwait->trigger, - pProtocolWaitConds->counter, XSyncCAAllTrigger); + pProtocolWaitConds->counter, RTCounter, + XSyncCAAllTrigger); if (status != Success) { /* this should take care of removing any triggers created by - * this request that have already been registered on counters + * this request that have already been registered on sync objects */ FreeResource(pAwaitUnion->header.delete_id, RT_NONE); return status; @@ -1469,23 +1692,8 @@ ProcSyncAwait(ClientPtr client) pAwaitUnion->header.num_waitconditions++; } - IgnoreClient(client); - - /* see if any of the triggers are already true */ + SyncAwaitEpilogue(client, items, pAwaitUnion); - pAwait = &(pAwaitUnion+1)->await; /* skip over header */ - for (i = 0; i < items; i++, pAwait++) - { - /* don't have to worry about NULL counters because the request - * errors before we get here out if they occur - */ - if ((*pAwait->trigger.CheckTrigger)(&pAwait->trigger, - pAwait->trigger.pCounter->value)) - { - (*pAwait->trigger.TriggerFired)(&pAwait->trigger); - break; /* once is enough */ - } - } return Success; } @@ -1565,13 +1773,14 @@ ProcSyncCreateAlarm(ClientPtr client) /* set up defaults */ pTrigger = &pAlarm->trigger; - pTrigger->pCounter = NULL; + pTrigger->pSync = NULL; pTrigger->value_type = XSyncAbsolute; XSyncIntToValue(&pTrigger->wait_value, 0L); pTrigger->test_type = XSyncPositiveComparison; pTrigger->TriggerFired = SyncAlarmTriggerFired; pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed; - status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger); + status = SyncInitTrigger(client, pTrigger, None, RTCounter, + XSyncCAAllTrigger); if (status != Success) { free(pAlarm); @@ -1593,22 +1802,31 @@ ProcSyncCreateAlarm(ClientPtr client) } if (!AddResource(stuff->id, RTAlarm, pAlarm)) - { - free(pAlarm); return BadAlloc; - } /* see if alarm already triggered. NULL counter will not trigger * in CreateAlarm and sets alarm state to Inactive. */ - if (!pTrigger->pCounter) + if (!pTrigger->pSync) { pAlarm->state = XSyncAlarmInactive; /* XXX protocol change */ } - else if ((*pTrigger->CheckTrigger)(pTrigger, pTrigger->pCounter->value)) + else { - (*pTrigger->TriggerFired)(pTrigger); + SyncCounter *pCounter; + + if (!SyncCheckWarnIsCounter(pTrigger->pSync, + WARN_INVALID_COUNTER_ALARM)) + { + FreeResource(stuff->id, RT_NONE); + return BadAlloc; + } + + pCounter = (SyncCounter *)pTrigger->pSync; + + if ((*pTrigger->CheckTrigger)(pTrigger, pCounter->value)) + (*pTrigger->TriggerFired)(pTrigger); } return Success; @@ -1622,6 +1840,7 @@ ProcSyncChangeAlarm(ClientPtr client) { REQUEST(xSyncChangeAlarmReq); SyncAlarm *pAlarm; + SyncCounter *pCounter = NULL; long vmask; int len, status; @@ -1642,13 +1861,16 @@ ProcSyncChangeAlarm(ClientPtr client) (CARD32 *)&stuff[1])) != Success) return status; + if (SyncCheckWarnIsCounter(pAlarm->trigger.pSync, + WARN_INVALID_COUNTER_ALARM)) + pCounter = (SyncCounter *)pAlarm->trigger.pSync; + /* see if alarm already triggered. NULL counter WILL trigger * in ChangeAlarm. */ - if (!pAlarm->trigger.pCounter || - (*pAlarm->trigger.CheckTrigger)(&pAlarm->trigger, - pAlarm->trigger.pCounter->value)) + if (!pCounter || + (*pAlarm->trigger.CheckTrigger)(&pAlarm->trigger, pCounter->value)) { (*pAlarm->trigger.TriggerFired)(&pAlarm->trigger); } @@ -1676,7 +1898,7 @@ ProcSyncQueryAlarm(ClientPtr client) rep.sequenceNumber = client->sequence; pTrigger = &pAlarm->trigger; - rep.counter = (pTrigger->pCounter) ? pTrigger->pCounter->id : None; + rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None; #if 0 /* XXX unclear what to do, depends on whether relative value-types * are "consumed" immediately and are considered absolute from then @@ -1732,6 +1954,231 @@ ProcSyncDestroyAlarm(ClientPtr client) return Success; } +static int +ProcSyncCreateFence(ClientPtr client) +{ + REQUEST(xSyncCreateFenceReq); + DrawablePtr pDraw; + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncCreateFenceReq); + + rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess); + if (rc != Success) + return rc; + + LEGAL_NEW_RESOURCE(stuff->fid, client); + + if (!(pFence = (SyncFence *)SyncCreate(client, + stuff->fid, + SYNC_FENCE))) + return BadAlloc; + + miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered); + + if (!AddResource(stuff->fid, RTFence, (pointer) pFence)) + return BadAlloc; + + return client->noClientException; +} + +static int +FreeFence(void *obj, XID id) +{ + SyncFence *pFence = (SyncFence *) obj; + + miSyncDestroyFence(pFence); + + return Success; +} + +int SyncVerifyFence(SyncFence **ppSyncFence, XID fid, + ClientPtr client, Mask mode) +{ + int rc = dixLookupResourceByType((pointer *)ppSyncFence, fid, RTFence, + client, mode); + + if (rc != Success) + client->errorValue = fid; + + return rc; +} + +static int +ProcSyncTriggerFence(ClientPtr client) +{ + REQUEST(xSyncTriggerFenceReq); + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncTriggerFenceReq); + + rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence, + client, DixWriteAccess); + if (rc != Success) + return rc; + + miSyncTriggerFence(pFence); + + return client->noClientException; +} + +static int +ProcSyncResetFence(ClientPtr client) +{ + REQUEST(xSyncResetFenceReq); + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncResetFenceReq); + + rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence, + client, DixWriteAccess); + if (rc != Success) + return rc; + + if (pFence->funcs.CheckTriggered(pFence) != TRUE) + return BadMatch; + + pFence->funcs.Reset(pFence); + + return client->noClientException; +} + +static int +ProcSyncDestroyFence(ClientPtr client) +{ + REQUEST(xSyncDestroyFenceReq); + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncDestroyFenceReq); + + rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence, + client, DixDestroyAccess); + if (rc != Success) + return rc; + + FreeResource(stuff->fid, RT_NONE); + return client->noClientException; +} + +static int +ProcSyncQueryFence(ClientPtr client) +{ + REQUEST(xSyncQueryFenceReq); + xSyncQueryFenceReply rep; + SyncFence *pFence; + int rc; + + REQUEST_SIZE_MATCH(xSyncQueryFenceReq); + + rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, + RTFence, client, DixReadAccess); + if (rc != Success) + return rc; + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.triggered = pFence->funcs.CheckTriggered(pFence); + + if (client->swapped) + { + char n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + + WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep); + return client->noClientException; +} + +static int +ProcSyncAwaitFence(ClientPtr client) +{ + REQUEST(xSyncAwaitFenceReq); + SyncAwaitUnion *pAwaitUnion; + SyncAwait *pAwait; + /* Use CARD32 rather than XSyncFence because XIDs are hard-coded to + * CARD32 in protocol definitions */ + CARD32 *pProtocolFences; + int status; + int len; + int items; + int i; + + REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); + + len = client->req_len << 2; + len -= sz_xSyncAwaitFenceReq; + items = len / sizeof(CARD32); + + if (items * sizeof(CARD32) != len) + { + return BadLength; + } + if (items == 0) + { + client->errorValue = items; + return BadValue; + } + + if (!(pAwaitUnion = SyncAwaitPrologue(client, items))) + return BadAlloc; + + /* don't need to do any more memory allocation for this request! */ + + pProtocolFences = (CARD32 *) & stuff[1]; + + pAwait = &(pAwaitUnion+1)->await; /* skip over header */ + for (i = 0; i < items; i++, pProtocolFences++, pAwait++) + { + if (*pProtocolFences == None) + { + /* this should take care of removing any triggers created by + * this request that have already been registered on sync objects + */ + FreeResource(pAwaitUnion->header.delete_id, RT_NONE); + client->errorValue = *pProtocolFences; + return SyncErrorBase + XSyncBadFence; + } + + pAwait->trigger.pSync = NULL; + /* Provide acceptable values for these unused fields to + * satisfy SyncInitTrigger's validation logic + */ + pAwait->trigger.value_type = XSyncAbsolute; + XSyncIntToValue(&pAwait->trigger.wait_value, 0); + pAwait->trigger.test_type = 0; + + status = SyncInitTrigger(client, &pAwait->trigger, + *pProtocolFences, RTFence, + XSyncCAAllTrigger); + if (status != Success) + { + /* this should take care of removing any triggers created by + * this request that have already been registered on sync objects + */ + FreeResource(pAwaitUnion->header.delete_id, RT_NONE); + return status; + } + /* this is not a mistake -- same function works for both cases */ + pAwait->trigger.TriggerFired = SyncAwaitTriggerFired; + pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired; + /* event_threshold is unused for fence syncs */ + XSyncIntToValue(&pAwait->event_threshold, 0); + pAwait->pHeader = &pAwaitUnion->header; + pAwaitUnion->header.num_waitconditions++; + } + + SyncAwaitEpilogue(client, items, pAwaitUnion); + + return client->noClientException; +} + /* * ** Given an extension request, call the appropriate request procedure */ @@ -1770,6 +2217,18 @@ ProcSyncDispatch(ClientPtr client) return ProcSyncSetPriority(client); case X_SyncGetPriority: return ProcSyncGetPriority(client); + case X_SyncCreateFence: + return ProcSyncCreateFence(client); + case X_SyncTriggerFence: + return ProcSyncTriggerFence(client); + case X_SyncResetFence: + return ProcSyncResetFence(client); + case X_SyncDestroyFence: + return ProcSyncDestroyFence(client); + case X_SyncQueryFence: + return ProcSyncQueryFence(client); + case X_SyncAwaitFence: + return ProcSyncAwaitFence(client); default: return BadRequest; } @@ -1969,6 +2428,83 @@ SProcSyncGetPriority(ClientPtr client) return ProcSyncGetPriority(client); } +static int +SProcSyncCreateFence(ClientPtr client) +{ + REQUEST(xSyncCreateFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncCreateFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncCreateFence(client); +} + +static int +SProcSyncTriggerFence(ClientPtr client) +{ + REQUEST(xSyncTriggerFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncTriggerFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncTriggerFence(client); +} + +static int +SProcSyncResetFence(ClientPtr client) +{ + REQUEST(xSyncResetFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncResetFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncResetFence(client); +} + +static int +SProcSyncDestroyFence(ClientPtr client) +{ + REQUEST(xSyncDestroyFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncDestroyFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncDestroyFence(client); +} + +static int +SProcSyncQueryFence(ClientPtr client) +{ + REQUEST(xSyncQueryFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH (xSyncQueryFenceReq); + swapl(&stuff->fid, n); + + return ProcSyncQueryFence(client); +} + +static int +SProcSyncAwaitFence(ClientPtr client) +{ + REQUEST(xSyncAwaitFenceReq); + char n; + + swaps(&stuff->length, n); + REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); + SwapRestL(stuff); + + return ProcSyncAwaitFence(client); +} static int SProcSyncDispatch(ClientPtr client) @@ -2005,6 +2541,18 @@ SProcSyncDispatch(ClientPtr client) return SProcSyncSetPriority(client); case X_SyncGetPriority: return SProcSyncGetPriority(client); + case X_SyncCreateFence: + return SProcSyncCreateFence(client); + case X_SyncTriggerFence: + return SProcSyncTriggerFence(client); + case X_SyncResetFence: + return SProcSyncResetFence(client); + case X_SyncDestroyFence: + return SProcSyncDestroyFence(client); + case X_SyncQueryFence: + return SProcSyncQueryFence(client); + case X_SyncAwaitFence: + return SProcSyncAwaitFence(client); default: return BadRequest; } @@ -2058,7 +2606,6 @@ SyncResetProc(ExtensionEntry *extEntry) RTCounter = 0; } - /* * ** Initialise the extension. */ @@ -2066,6 +2613,10 @@ void SyncExtensionInit(void) { ExtensionEntry *extEntry; + int s; + + for (s = 0; s < screenInfo.numScreens; s++) + miSyncSetup(screenInfo.screens[s]); if (RTCounter == 0) { @@ -2073,6 +2624,7 @@ SyncExtensionInit(void) } RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); + RTFence = CreateNewResourceType(FreeFence, "SyncFence"); if (RTAwait) RTAwait |= RC_NEVERRETAIN; RTAlarmClient = CreateNewResourceType(FreeAlarmClient, "SyncAlarmClient"); @@ -2099,6 +2651,7 @@ SyncExtensionInit(void) SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter); SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm); + SetResourceTypeErrorValue(RTFence, SyncErrorBase + XSyncBadFence); /* * Although SERVERTIME is implemented by the OS layer, we initialise it @@ -2242,7 +2795,7 @@ static void IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) { XSyncValue idle, old_idle; - SyncTriggerList *list = IdleTimeCounter->pTriglist; + SyncTriggerList *list = IdleTimeCounter->sync.pTriglist; SyncTrigger *trig; if (!pIdleTimeValueLess && !pIdleTimeValueGreater) @@ -2263,13 +2816,21 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) * immediately so we can reschedule. */ - for (list = IdleTimeCounter->pTriglist; list; list = list->next) { + for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { AdjustWaitForDelay(wt, 0); break; } } + /* + * We've been called exactly on the idle time, but we have a + * NegativeTransition trigger which requires a transition from an + * idle time greater than this. Schedule a wakeup for the next + * millisecond so we won't miss a transition. + */ + if (XSyncValueEqual (idle, *pIdleTimeValueLess)) + AdjustWaitForDelay(wt, 1); } else if (pIdleTimeValueGreater) { @@ -2289,7 +2850,7 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) idle, &overflow); timeout = min(timeout, XSyncValueLow32 (value)); } else { - for (list = IdleTimeCounter->pTriglist; list; list = list->next) { + for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { timeout = min(timeout, 0); diff --git a/Xext/syncsdk.h b/Xext/syncsdk.h new file mode 100644 index 000000000..a72c58500 --- /dev/null +++ b/Xext/syncsdk.h @@ -0,0 +1,47 @@ +/* + * Copyright © 2010 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef _SYNCSDK_H_ +#define _SYNCSDK_H_ + +#include "misync.h" + +extern _X_EXPORT int +SyncVerifyFence(SyncFence **ppFence, XID fid, ClientPtr client, Mask mode); + +#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \ + do { \ + int rc; \ + rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \ + if (Success != rc) return rc; \ + } while (0) + +#define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \ + do { \ + pFence = 0; \ + if (None != fid) \ + VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \ + } while (0) + +#endif /* _SYNCSDK_H_ */ + diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h index 6d0e3d64a..7ca1fba26 100644 --- a/Xext/syncsrv.h +++ b/Xext/syncsrv.h @@ -51,16 +51,8 @@ PERFORMANCE OF THIS SOFTWARE. #ifndef _SYNCSRV_H_ #define _SYNCSRV_H_ -#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */ - -typedef struct _SyncCounter { - ClientPtr client; /* Owning client. 0 for system counters */ - XSyncCounter id; /* resource ID */ - CARD64 value; /* counter value */ - struct _SyncTriggerList *pTriglist; /* list of triggers */ - Bool beingDestroyed; /* in process of going away */ - struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */ -} SyncCounter; +#include "misync.h" +#include "misyncstr.h" /* * The System Counter interface @@ -92,29 +84,6 @@ typedef struct _SysCounterInfo { -typedef struct _SyncTrigger { - SyncCounter *pCounter; - CARD64 wait_value; /* wait value */ - unsigned int value_type; /* Absolute or Relative */ - unsigned int test_type; /* transition or Comparision type */ - CARD64 test_value; /* trigger event threshold value */ - Bool (*CheckTrigger)( - struct _SyncTrigger * /*pTrigger*/, - CARD64 /*newval*/ - ); - void (*TriggerFired)( - struct _SyncTrigger * /*pTrigger*/ - ); - void (*CounterDestroyed)( - struct _SyncTrigger * /*pTrigger*/ - ); -} SyncTrigger; - -typedef struct _SyncTriggerList { - SyncTrigger *pTrigger; - struct _SyncTriggerList *next; -} SyncTriggerList; - typedef struct _SyncAlarmClientList { ClientPtr client; XID delete_id; @@ -148,7 +117,6 @@ typedef union { SyncAwait await; } SyncAwaitUnion; - extern pointer SyncCreateSystemCounter( char * /* name */, CARD64 /* inital_value */, @@ -171,6 +139,7 @@ extern void SyncChangeCounter( extern void SyncDestroySystemCounter( pointer pCounter ); + extern void InitServertime(void); extern void SyncExtensionInit(void); diff --git a/Xext/xcalibrate.c b/Xext/xcalibrate.c deleted file mode 100644 index bff1c3168..000000000 --- a/Xext/xcalibrate.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright © 2003 Philip Blundell - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Philip Blundell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Philip Blundell makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * PHILIP BLUNDELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL PHILIP BLUNDELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_KDRIVE_CONFIG_H -#include -#endif - - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "swaprep.h" -#include "protocol-versions.h" - -#include -#include - -extern void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure); -extern void *tslib_raw_event_closure; - -static CARD8 XCalibrateReqCode; -int XCalibrateEventBase; -int XCalibrateReqBase; -int XCalibrateErrorBase; - -static ClientPtr xcalibrate_client; - -static void -xcalibrate_event_hook (int x, int y, int pressure, void *closure) -{ - ClientPtr pClient = (ClientPtr) closure; - xXCalibrateRawTouchscreenEvent ev; - - ev.type = XCalibrateEventBase + X_XCalibrateRawTouchscreen; - ev.x = x; - ev.y = y; - ev.pressure = pressure; - - WriteEventsToClient (pClient, 1, (xEvent *) &ev); -} - -static int -ProcXCalibrateQueryVersion (ClientPtr client) -{ - REQUEST(xXCalibrateQueryVersionReq); - xXCalibrateQueryVersionReply rep; - CARD16 client_major, client_minor; /* not used */ - - REQUEST_SIZE_MATCH (xXCalibrateQueryVersionReq); - - client_major = stuff->majorVersion; - client_minor = stuff->minorVersion; - - fprintf(stderr, "%s(): called\n", __func__); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_XCALIBRATE_MAJOR_VERSION; - rep.minorVersion = SERVER_XCALIBRATE_MINOR_VERSION; - if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - WriteToClient(client, sizeof (xXCalibrateQueryVersionReply), (char *)&rep); - return Success; -} - -static int -SProcXCalibrateQueryVersion (ClientPtr client) -{ - REQUEST(xXCalibrateQueryVersionReq); - int n; - - REQUEST_SIZE_MATCH (xXCalibrateQueryVersionReq); - swaps(&stuff->majorVersion,n); - swaps(&stuff->minorVersion,n); - return ProcXCalibrateQueryVersion(client); -} - -static int -ProcXCalibrateSetRawMode (ClientPtr client) -{ - REQUEST(xXCalibrateRawModeReq); - xXCalibrateRawModeReply rep; - - REQUEST_SIZE_MATCH (xXCalibrateRawModeReq); - - memset (&rep, 0, sizeof (rep)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - - if (stuff->on) - { - if (xcalibrate_client == NULL) - { - /* Start calibrating. */ - xcalibrate_client = client; - tslib_raw_event_hook = xcalibrate_event_hook; - tslib_raw_event_closure = client; - rep.status = GrabSuccess; - } - else - { - rep.status = AlreadyGrabbed; - } - } - else - { - if (xcalibrate_client == client) - { - /* Stop calibrating. */ - xcalibrate_client = NULL; - tslib_raw_event_hook = NULL; - tslib_raw_event_closure = NULL; - rep.status = GrabSuccess; - - /* Cycle input off and on to reload configuration. */ - KdDisableInput (); - KdEnableInput (); - } - else - { - rep.status = AlreadyGrabbed; - } - } - - if (client->swapped) - { - int n; - - swaps (&rep.sequenceNumber, n); - swaps (&rep.status, n); - } - WriteToClient(client, sizeof (rep), (char *) &rep); - return Success; -} - -static int -SProcXCalibrateSetRawMode (ClientPtr client) -{ - REQUEST(xXCalibrateRawModeReq); - int n; - - REQUEST_SIZE_MATCH (xXCalibrateRawModeReq); - - swaps(&stuff->on, n); - - return ProcXCalibrateSetRawMode(client); -} - -static int -ProcXCalibrateScreenToCoord (ClientPtr client) -{ - REQUEST(xXCalibrateScreenToCoordReq); - xXCalibrateScreenToCoordReply rep; - - REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); - - memset (&rep, 0, sizeof (rep)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.x = stuff->x; - rep.y = stuff->y; - - KdScreenToPointerCoords(&rep.x, &rep.y); - - if (client->swapped) - { - int n; - - swaps (&rep.x, n); - swaps (&rep.y, n); - } - WriteToClient(client, sizeof (rep), (char *) &rep); - return Success; -} - -static int -SProcXCalibrateScreenToCoord (ClientPtr client) -{ - REQUEST(xXCalibrateScreenToCoordReq); - int n; - - REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); - - swaps(&stuff->x, n); - swaps(&stuff->y, n); - - return ProcXCalibrateScreenToCoord(client); -} - -static int -ProcXCalibrateDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) { - case X_XCalibrateQueryVersion: - return ProcXCalibrateQueryVersion(client); - case X_XCalibrateRawMode: - return ProcXCalibrateSetRawMode(client); - case X_XCalibrateScreenToCoord: - return ProcXCalibrateScreenToCoord(client); - - default: break; - } - - return BadRequest; -} - -static int -SProcXCalibrateDispatch (ClientPtr client) -{ - REQUEST(xReq); - int n; - - swaps(&stuff->length,n); - - switch (stuff->data) { - case X_XCalibrateQueryVersion: - return SProcXCalibrateQueryVersion(client); - case X_XCalibrateRawMode: - return SProcXCalibrateSetRawMode(client); - case X_XCalibrateScreenToCoord: - return SProcXCalibrateScreenToCoord(client); - - default: break; - } - - return BadRequest; -} - -static void -XCalibrateClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - - if (clientinfo->setup == NULL - && xcalibrate_client != NULL - && xcalibrate_client == pClient) - { - /* Stop calibrating. */ - xcalibrate_client = NULL; - tslib_raw_event_hook = NULL; - tslib_raw_event_closure = NULL; - } -} - -void -XCalibrateExtensionInit(void) -{ - ExtensionEntry *extEntry; - - if (!AddCallback (&ClientStateCallback, XCalibrateClientCallback, 0)) - return; - - extEntry = AddExtension(XCALIBRATE_NAME, XCalibrateNumberEvents, XCalibrateNumberErrors, - ProcXCalibrateDispatch, SProcXCalibrateDispatch, - NULL, StandardMinorOpcode); - - if (!extEntry) - return; - - XCalibrateReqCode = (unsigned char)extEntry->base; - XCalibrateEventBase = extEntry->eventBase; - XCalibrateErrorBase = extEntry->errorBase; - - xcalibrate_client = 0; -} diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index f7dde6e17..de8274469 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -50,7 +50,7 @@ #ifdef SVR4 #include #endif -#if defined(__CYGWIN__) || defined(__SCO__) +#if defined(__CYGWIN__) #include #include #endif @@ -137,51 +137,6 @@ CheckForShmSyscall(void) #endif -void -XFree86BigfontExtensionInit(void) -{ - if (AddExtension(XF86BIGFONTNAME, - XF86BigfontNumberEvents, - XF86BigfontNumberErrors, - ProcXF86BigfontDispatch, - SProcXF86BigfontDispatch, - XF86BigfontResetProc, - StandardMinorOpcode)) { -#ifdef HAS_SHM -#ifdef MUST_CHECK_FOR_SHM_SYSCALL - /* - * Note: Local-clients will not be optimized without shared memory - * support. Remote-client optimization does not depend on shared - * memory support. Thus, the extension is still registered even - * when shared memory support is not functional. - */ - if (!CheckForShmSyscall()) { - ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n"); - return; - } -#endif - - srand((unsigned int) time(NULL)); - signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16) - + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand()); - /* fprintf(stderr, "signature = 0x%08X\n", signature); */ - - FontShmdescIndex = AllocateFontPrivateIndex(); - -#if !defined(CSRG_BASED) && !defined(__CYGWIN__) - pagesize = SHMLBA; -#else -# ifdef _SC_PAGESIZE - pagesize = sysconf(_SC_PAGESIZE); -# else - pagesize = getpagesize(); -# endif -#endif -#endif - } -} - - /* ========== Management of shared memory segments ========== */ #ifdef HAS_SHM @@ -749,3 +704,47 @@ SProcXF86BigfontDispatch( return BadRequest; } } + +void +XFree86BigfontExtensionInit(void) +{ + if (AddExtension(XF86BIGFONTNAME, + XF86BigfontNumberEvents, + XF86BigfontNumberErrors, + ProcXF86BigfontDispatch, + SProcXF86BigfontDispatch, + XF86BigfontResetProc, + StandardMinorOpcode)) { +#ifdef HAS_SHM +#ifdef MUST_CHECK_FOR_SHM_SYSCALL + /* + * Note: Local-clients will not be optimized without shared memory + * support. Remote-client optimization does not depend on shared + * memory support. Thus, the extension is still registered even + * when shared memory support is not functional. + */ + if (!CheckForShmSyscall()) { + ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n"); + return; + } +#endif + + srand((unsigned int) time(NULL)); + signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16) + + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand()); + /* fprintf(stderr, "signature = 0x%08X\n", signature); */ + + FontShmdescIndex = AllocateFontPrivateIndex(); + +#if !defined(CSRG_BASED) && !defined(__CYGWIN__) + pagesize = SHMLBA; +#else +# ifdef _SC_PAGESIZE + pagesize = sysconf(_SC_PAGESIZE); +# else + pagesize = getpagesize(); +# endif +#endif +#endif + } +} diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c index 93c1b595f..374571c4b 100644 --- a/Xext/xselinux_ext.c +++ b/Xext/xselinux_ext.c @@ -231,13 +231,11 @@ ProcSELinuxGetDrawableContext(ClientPtr client) REQUEST(SELinuxGetContextReq); REQUEST_SIZE_MATCH(SELinuxGetContextReq); - rc = dixLookupDrawable(&pDraw, stuff->id, client, - M_WINDOW | M_DRAWABLE_PIXMAP, - DixGetAttrAccess); + rc = dixLookupDrawable(&pDraw, stuff->id, client, 0, DixGetAttrAccess); if (rc != Success) return rc; - if (pDraw->type == M_DRAWABLE_PIXMAP) + if (pDraw->type == DRAWABLE_PIXMAP) privatePtr = &((PixmapPtr)pDraw)->devPrivates; else privatePtr = &((WindowPtr)pDraw)->devPrivates; diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c index 560e1e9bf..f1d8e5d2f 100644 --- a/Xext/xselinux_hooks.c +++ b/Xext/xselinux_hooks.c @@ -40,6 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "propertyst.h" #include "extnsionst.h" #include "xacestr.h" +#include "client.h" #include "../os/osdep.h" #define _XSELINUX_NEED_FLASK_MAP #include "xselinuxint.h" @@ -129,26 +130,25 @@ SELinuxLabelClient(ClientPtr client) /* For local clients, try and determine the executable name */ if (XaceIsLocal(client)) { - struct ucred creds; - socklen_t len = sizeof(creds); - char path[PATH_MAX + 1]; - size_t bytes; - - memset(&creds, 0, sizeof(creds)); - if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &creds, &len) < 0) - goto finish; + /* Get cached command name if CLIENTIDS is enabled. */ + const char *cmdname = GetClientCmdName(client); + Bool cached = (cmdname != NULL); + /* If CLIENTIDS is disabled, figure out the command name from + * scratch. */ + if (!cmdname) + { + pid_t pid = DetermineClientPid(client); + if (pid != -1) + DetermineClientCmd(pid, &cmdname, NULL); + } - snprintf(path, PATH_MAX + 1, "/proc/%d/cmdline", creds.pid); - fd = open(path, O_RDONLY); - if (fd < 0) + if (!cmdname) goto finish; - bytes = read(fd, path, PATH_MAX + 1); - close(fd); - if (bytes <= 0) - goto finish; + strncpy(subj->command, cmdname, COMMAND_LEN - 1); - strncpy(subj->command, path, COMMAND_LEN - 1); + if (!cached) + free((void *) cmdname); /* const char * */ } finish: diff --git a/Xext/xtest.c b/Xext/xtest.c index d7d254c18..daa6430f1 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -52,6 +52,8 @@ #include "mipointer.h" #include "xserver-properties.h" #include "exevents.h" +#include "eventstr.h" +#include "inpututils.h" #include "modinit.h" @@ -60,7 +62,7 @@ extern int DeviceValuator; /* XTest events are sent during request processing and may be interruped by * a SIGIO. We need a separate event list to avoid events overwriting each * other's memory */ -static EventListPtr xtest_evlist; +static InternalEvent* xtest_evlist; /** * xtestpointer @@ -153,6 +155,7 @@ ProcXTestFakeInput(ClientPtr client) WindowPtr root; Bool extension = FALSE; deviceValuator *dv = NULL; + ValuatorMask mask; int valuators[MAX_VALUATORS] = {0}; int numValuators = 0; int firstValuator = 0; @@ -372,10 +375,7 @@ ProcXTestFakeInput(ClientPtr client) if (!dev->valuator) return BadDevice; - /* broken lib, XI events have root uninitialized */ - if (extension || ev->u.keyButtonPointer.root == None) - root = GetCurrentRootWindow(dev); - else + if (!(extension || ev->u.keyButtonPointer.root == None)) { rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client, DixGetAttrAccess); @@ -413,23 +413,23 @@ ProcXTestFakeInput(ClientPtr client) switch(type) { case MotionNotify: - nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, - firstValuator, numValuators, valuators); + valuator_mask_set_range(&mask, firstValuator, numValuators, valuators); + nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, &mask); break; case ButtonPress: case ButtonRelease: + valuator_mask_set_range(&mask, firstValuator, numValuators, valuators); nevents = GetPointerEvents(xtest_evlist, dev, type, ev->u.u.detail, - flags, firstValuator, - numValuators, valuators); + flags, &mask); break; case KeyPress: case KeyRelease: - nevents = GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail); + nevents = GetKeyboardEvents(xtest_evlist, dev, type, ev->u.u.detail, NULL); break; } for (i = 0; i < nevents; i++) - mieqProcessDeviceEvent(dev, (InternalEvent*)(xtest_evlist+i)->event, NULL); + mieqProcessDeviceEvent(dev, &xtest_evlist[i], NULL); if (need_ptr_update) miPointerUpdateSprite(dev); diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index deddebd4b..b96843159 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -1918,7 +1918,7 @@ void XineramifyXv(void) MatchingAdaptors[0] = refAdapt; isOverlay = hasOverlay(refAdapt); - for(j = 1; j < PanoramiXNumScreens; j++) + FOR_NSCREENS_FORWARD_SKIP(j) MatchingAdaptors[j] = matchAdaptor(screenInfo.screens[j], refAdapt, isOverlay); /* now create a resource for each port */ @@ -1927,7 +1927,7 @@ void XineramifyXv(void) if(!port) break; - for(k = 0; k < PanoramiXNumScreens; k++) { + FOR_NSCREENS(k) { if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) port->info[k].id = MatchingAdaptors[k]->base_id + j; else diff --git a/Xext/xvdix.h b/Xext/xvdix.h index a2106150e..e9c22bf65 100644 --- a/Xext/xvdix.h +++ b/Xext/xvdix.h @@ -64,12 +64,12 @@ extern _X_EXPORT int XvReqCode; extern _X_EXPORT int XvEventBase; extern _X_EXPORT int XvErrorBase; -extern _X_EXPORT unsigned long XvRTPort; -extern _X_EXPORT unsigned long XvRTEncoding; -extern _X_EXPORT unsigned long XvRTGrab; -extern _X_EXPORT unsigned long XvRTVideoNotify; -extern _X_EXPORT unsigned long XvRTVideoNotifyList; -extern _X_EXPORT unsigned long XvRTPortNotify; +extern _X_EXPORT RESTYPE XvRTPort; +extern _X_EXPORT RESTYPE XvRTEncoding; +extern _X_EXPORT RESTYPE XvRTGrab; +extern _X_EXPORT RESTYPE XvRTVideoNotify; +extern _X_EXPORT RESTYPE XvRTVideoNotifyList; +extern _X_EXPORT RESTYPE XvRTPortNotify; #endif typedef struct { diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 12b4c5184..d21a56c3e 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -115,14 +115,12 @@ int XvReqCode; int XvEventBase; int XvErrorBase; -unsigned long XvRTPort; -unsigned long XvRTEncoding; -unsigned long XvRTGrab; -unsigned long XvRTVideoNotify; -unsigned long XvRTVideoNotifyList; -unsigned long XvRTPortNotify; - - +RESTYPE XvRTPort; +RESTYPE XvRTEncoding; +RESTYPE XvRTGrab; +RESTYPE XvRTVideoNotify; +RESTYPE XvRTVideoNotifyList; +RESTYPE XvRTPortNotify; /* EXTERNAL */ @@ -1112,12 +1110,7 @@ XvdiMatchPort( while (nf--) { - if ((pf->depth == pDraw->depth) -#if 0 - && ((pDraw->type == DRAWABLE_PIXMAP) || - (wVisual(((WindowPtr)pDraw)) == pf->visual)) -#endif - ) + if (pf->depth == pDraw->depth) return Success; pf++; } diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 8fbdfaedd..4d29941ee 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -42,9 +42,9 @@ unsigned long XvMCGeneration = 0; int XvMCReqCode; int XvMCEventBase; -unsigned long XvMCRTContext; -unsigned long XvMCRTSurface; -unsigned long XvMCRTSubpicture; +static RESTYPE XvMCRTContext; +static RESTYPE XvMCRTSurface; +static RESTYPE XvMCRTSubpicture; typedef struct { int num_adaptors; diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 901a0e419..4c4aebac6 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -76,8 +76,6 @@ SProcXChangeDeviceControl(ClientPtr client) { char n; xDeviceCtl *ctl; - xDeviceAbsCalibCtl *calib; - xDeviceAbsAreaCtl *area; REQUEST(xChangeDeviceControlReq); swaps(&stuff->length, n); @@ -88,26 +86,7 @@ SProcXChangeDeviceControl(ClientPtr client) swaps(&ctl->length, n); switch(stuff->control) { case DEVICE_ABS_CALIB: - calib = (xDeviceAbsCalibCtl*)ctl; - swaps(&calib->length, n); - swapl(&calib->min_x, n); - swapl(&calib->max_x, n); - swapl(&calib->min_y, n); - swapl(&calib->max_y, n); - swapl(&calib->flip_x, n); - swapl(&calib->flip_y, n); - swapl(&calib->rotation, n); - swapl(&calib->button_threshold, n); - break; case DEVICE_ABS_AREA: - area = (xDeviceAbsAreaCtl*)ctl; - swapl(&area->offset_x, n); - swapl(&area->offset_y, n); - swapl(&area->width, n); - swapl(&area->height, n); - swapl(&area->screen, n); - swapl(&area->following, n); - break; case DEVICE_CORE: case DEVICE_ENABLE: case DEVICE_RESOLUTION: @@ -134,8 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client) xChangeDeviceControlReply rep; AxisInfoPtr a; CARD32 *resolution; - xDeviceAbsCalibCtl *calib; - xDeviceAbsAreaCtl *area; xDeviceEnableCtl *e; devicePresenceNotify dpn; @@ -193,53 +170,10 @@ ProcXChangeDeviceControl(ClientPtr client) } break; case DEVICE_ABS_CALIB: - calib = (xDeviceAbsCalibCtl *)&stuff[1]; - - if (calib->button_threshold < 0 || calib->button_threshold > 255) { - ret = BadValue; - goto out; - } - - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) calib); - - if (status == Success) { - dev->absolute->min_x = calib->min_x; - dev->absolute->max_x = calib->max_x; - dev->absolute->min_y = calib->min_y; - dev->absolute->max_y = calib->max_y; - dev->absolute->flip_x = calib->flip_x; - dev->absolute->flip_y = calib->flip_y; - dev->absolute->rotation = calib->rotation; - dev->absolute->button_threshold = calib->button_threshold; - ret = Success; - } else if (status == DeviceBusy || status == BadValue) { - rep.status = status; - ret = Success; - } else { - ret = BadMatch; - } - - break; case DEVICE_ABS_AREA: - area = (xDeviceAbsAreaCtl *)&stuff[1]; - - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) area); - - if (status == Success) { - dev->absolute->offset_x = area->offset_x; - dev->absolute->offset_y = area->offset_y; - dev->absolute->width = area->width; - dev->absolute->height = area->height; - dev->absolute->screen = area->screen; - dev->absolute->following = area->following; - ret = Success; - } else if (status == DeviceBusy || status == BadValue) { - rep.status = status; - ret = Success; - } else { - ret = Success; - } - + /* Calibration is now done through properties, and never had any effect + * on anything (in the open-source world). Thus, be honest. */ + ret = BadMatch; break; case DEVICE_CORE: /* Sorry, no device core switching no more. If you want a device to diff --git a/Xi/closedev.c b/Xi/closedev.c index e319c737a..1064be67b 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -162,6 +162,5 @@ ProcXCloseDevice(ClientPtr client) DeleteEventsFromChildren(d, p1, client); } - CloseInputDevice(d, client); return Success; } diff --git a/Xi/exevents.c b/Xi/exevents.c index e19e207fd..c6f9d467f 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -77,6 +77,7 @@ SOFTWARE. #include "xiquerydevice.h" /* For List*Info */ #include "eventconvert.h" #include "eventstr.h" +#include "inpututils.h" #include #include "xkbsrv.h" @@ -111,13 +112,6 @@ XIShouldNotify(ClientPtr client, DeviceIntPtr dev) return 0; } -void -RegisterOtherDevice(DeviceIntPtr device) -{ - device->public.processInputProc = ProcessOtherEvent; - device->public.realInputProc = ProcessOtherEvent; -} - Bool IsPointerEvent(InternalEvent* event) { @@ -542,6 +536,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) if (from->valuator) { ValuatorClassPtr v; + if (!to->valuator) { classes = to->unused_classes; @@ -550,20 +545,15 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->valuator = NULL; } - to->valuator = realloc(to->valuator, sizeof(ValuatorClassRec) + - from->valuator->numAxes * sizeof(AxisInfo) + - from->valuator->numAxes * sizeof(double)); - v = to->valuator; + v = AllocValuatorClass(to->valuator, from->valuator->numAxes); + if (!v) FatalError("[Xi] no memory for class shift.\n"); - v->numAxes = from->valuator->numAxes; - v->axes = (AxisInfoPtr)&v[1]; + to->valuator = v; memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); - v->axisVal = (double*)(v->axes + from->valuator->numAxes); v->sourceid = from->id; - v->mode = from->valuator->mode; } else if (to->valuator && !from->valuator) { ClassesPtr classes; @@ -634,30 +624,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->proximity = to->proximity; to->proximity = NULL; } - - if (from->absolute) - { - if (!to->absolute) - { - classes = to->unused_classes; - to->absolute = classes->absolute; - if (!to->absolute) - { - to->absolute = calloc(1, sizeof(AbsoluteClassRec)); - if (!to->absolute) - FatalError("[Xi] no memory for class shift.\n"); - } else - classes->absolute = NULL; - } - memcpy(to->absolute, from->absolute, sizeof(AbsoluteClassRec)); - to->absolute->sourceid = from->id; - } else if (to->absolute) - { - ClassesPtr classes; - classes = to->unused_classes; - classes->absolute = to->absolute; - to->absolute = NULL; - } } /** @@ -718,10 +684,13 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) if (rc != Success) return; /* Device has disappeared */ - if (!slave->u.master) + if (IsMaster(slave)) + return; + + if (IsFloating(slave)) return; /* set floating since the event */ - if (slave->u.master->id != dce->masterid) + if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid) return; /* not our slave anymore, don't care */ /* FIXME: we probably need to send a DCE for the new slave now */ @@ -874,12 +843,14 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) * event being delivered through the slave first */ for (sd = inputInfo.devices; sd; sd = sd->next) { - if (IsMaster(sd) || sd->u.master != device) + if (IsMaster(sd) || GetMaster(sd, MASTER_POINTER) != device) continue; if (!sd->button) continue; - if (button_is_down(sd, key, BUTTON_PROCESSED)) - return DONT_PROCESS; + for (i = 1; i <= sd->button->numButtons; i++) + if (sd->button->map[i] == key && + button_is_down(sd, i, BUTTON_PROCESSED)) + return DONT_PROCESS; } } set_button_up(device, key, BUTTON_PROCESSED); @@ -898,9 +869,9 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) mask = PointerMotionMask | b->state | b->motionMask; SetMaskForEvent(device->id, mask, MotionNotify); } else if (event->type == ET_ProximityIn) - device->valuator->mode &= ~OutOfProximity; + device->proximity->in_proximity = TRUE; else if (event->type == ET_ProximityOut) - device->valuator->mode |= OutOfProximity; + device->proximity->in_proximity = FALSE; return DEFAULT; } @@ -950,7 +921,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) DeviceIntPtr mouse = NULL, kbd = NULL; DeviceEvent *event = &ev->device_event; - CHECKEVENT(ev); + verify_internal_event(ev); if (ev->any.type == ET_RawKeyPress || ev->any.type == ET_RawKeyRelease || @@ -1012,7 +983,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) b = device->button; k = device->key; - if (IsMaster(device) || !device->u.master) + if (IsMaster(device) || IsFloating(device)) CheckMotion(event, device); switch (event->type) @@ -1053,10 +1024,8 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) switch(event->type) { case ET_KeyPress: - if (!grab && CheckDeviceGrabs(device, event, 0)) { - device->deviceGrab.activatingKey = key; + if (!grab && CheckDeviceGrabs(device, event, 0)) return; - } break; case ET_KeyRelease: if (grab && device->deviceGrab.fromPassiveGrab && @@ -1119,6 +1088,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) if (!proxc) return FALSE; proxc->sourceid = dev->id; + proxc->in_proximity = TRUE; dev->proximity = proxc; return TRUE; } @@ -1134,7 +1104,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) */ void InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, - int resolution, int min_res, int max_res) + int resolution, int min_res, int max_res, int mode) { AxisInfoPtr ax; @@ -1151,6 +1121,10 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int ax->min_resolution = min_res; ax->max_resolution = max_res; ax->label = label; + ax->mode = mode; + + if (mode & OutOfProximity) + dev->proximity->in_proximity = FALSE; } static void @@ -1179,7 +1153,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, int nval = v->numAxes - first; ev->classes_reported |= (1 << ValuatorClass); - ev->classes_reported |= (dev->valuator->mode << ModeBitsShift); + ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift; ev->num_valuators = nval < 3 ? nval : 3; switch (ev->num_valuators) { case 3: @@ -1215,6 +1189,108 @@ FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, first += ev->num_valuators; } +static void +DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) +{ + int evcount = 1; + deviceStateNotify *ev, *sev; + deviceKeyStateNotify *kev; + deviceButtonStateNotify *bev; + + KeyClassPtr k; + ButtonClassPtr b; + ValuatorClassPtr v; + int nval = 0, nkeys = 0, nbuttons = 0, first = 0; + + if (!(wOtherInputMasks(win)) || + !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask)) + return; + + if ((b = dev->button) != NULL) { + nbuttons = b->numButtons; + if (nbuttons > 32) + evcount++; + } + if ((k = dev->key) != NULL) { + nkeys = k->xkbInfo->desc->max_key_code - + k->xkbInfo->desc->min_key_code; + if (nkeys > 32) + evcount++; + if (nbuttons > 0) { + evcount++; + } + } + if ((v = dev->valuator) != NULL) { + nval = v->numAxes; + + if (nval > 3) + evcount++; + if (nval > 6) { + if (!(k && b)) + evcount++; + if (nval > 9) + evcount += ((nval - 7) / 3); + } + } + + sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); + FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); + + if (b != NULL) { + FixDeviceStateNotify(dev, ev++, NULL, b, v, first); + first += 3; + nval -= 3; + if (nbuttons > 32) { + (ev - 1)->deviceid |= MORE_EVENTS; + bev = (deviceButtonStateNotify *) ev++; + bev->type = DeviceButtonStateNotify; + bev->deviceid = dev->id; + memcpy((char*)&bev->buttons[4], (char*)&b->down[4], DOWN_LENGTH - 4); + } + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + if (k != NULL) { + FixDeviceStateNotify(dev, ev++, k, NULL, v, first); + first += 3; + nval -= 3; + if (nkeys > 32) { + (ev - 1)->deviceid |= MORE_EVENTS; + kev = (deviceKeyStateNotify *) ev++; + kev->type = DeviceKeyStateNotify; + kev->deviceid = dev->id; + memmove((char *)&kev->keys[0], (char *)&k->down[4], 28); + } + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + while (nval > 0) { + FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); + first += 3; + nval -= 3; + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, + DeviceStateNotifyMask, NullGrab); + free(sev); +} + void DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) @@ -1224,7 +1300,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeviceIntPtr mouse; int btlen, len, i; - mouse = (IsMaster(dev) || dev->u.master) ? GetMaster(dev, MASTER_POINTER) : dev; + mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); /* XI 2 event */ btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; @@ -1262,7 +1338,8 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, xi2event->group.effective_group = dev->key->xkbInfo->state.group; } - FixUpEventFromWindow(dev, (xEvent*)xi2event, pWin, None, FALSE); + FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent*)xi2event, pWin, + None, FALSE); DeliverEventsToWindow(dev, pWin, (xEvent*)xi2event, 1, GetEventFilter(dev, (xEvent*)xi2event), NullGrab); @@ -1280,104 +1357,8 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeliverEventsToWindow(dev, pWin, (xEvent *) & event, 1, DeviceFocusChangeMask, NullGrab); - if ((type == DeviceFocusIn) && - (wOtherInputMasks(pWin)) && - (wOtherInputMasks(pWin)->inputEvents[dev->id] & DeviceStateNotifyMask)) - { - int evcount = 1; - deviceStateNotify *ev, *sev; - deviceKeyStateNotify *kev; - deviceButtonStateNotify *bev; - - KeyClassPtr k; - ButtonClassPtr b; - ValuatorClassPtr v; - int nval = 0, nkeys = 0, nbuttons = 0, first = 0; - - if ((b = dev->button) != NULL) { - nbuttons = b->numButtons; - if (nbuttons > 32) - evcount++; - } - if ((k = dev->key) != NULL) { - nkeys = k->xkbInfo->desc->max_key_code - - k->xkbInfo->desc->min_key_code; - if (nkeys > 32) - evcount++; - if (nbuttons > 0) { - evcount++; - } - } - if ((v = dev->valuator) != NULL) { - nval = v->numAxes; - - if (nval > 3) - evcount++; - if (nval > 6) { - if (!(k && b)) - evcount++; - if (nval > 9) - evcount += ((nval - 7) / 3); - } - } - - sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); - FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); - - if (b != NULL) { - FixDeviceStateNotify(dev, ev++, NULL, b, v, first); - first += 3; - nval -= 3; - if (nbuttons > 32) { - (ev - 1)->deviceid |= MORE_EVENTS; - bev = (deviceButtonStateNotify *) ev++; - bev->type = DeviceButtonStateNotify; - bev->deviceid = dev->id; - memcpy((char*)&bev->buttons[4], (char*)&b->down[4], DOWN_LENGTH - 4); - } - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - if (k != NULL) { - FixDeviceStateNotify(dev, ev++, k, NULL, v, first); - first += 3; - nval -= 3; - if (nkeys > 32) { - (ev - 1)->deviceid |= MORE_EVENTS; - kev = (deviceKeyStateNotify *) ev++; - kev->type = DeviceKeyStateNotify; - kev->deviceid = dev->id; - memmove((char *)&kev->keys[0], (char *)&k->down[4], 28); - } - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - while (nval > 0) { - FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); - first += 3; - nval -= 3; - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - DeliverEventsToWindow(dev, pWin, (xEvent *) sev, evcount, - DeviceStateNotifyMask, NullGrab); - free(sev); - } + if (event.type == DeviceFocusIn) + DeliverStateNotifyEvent(dev, pWin); } int @@ -1630,14 +1611,18 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) if (!others) return BadAlloc; if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) - return BadAlloc; + goto bail; others->mask[mskidx] = mask; others->resource = FakeClientID(client->index); others->next = pWin->optional->inputMasks->inputClients; pWin->optional->inputMasks->inputClients = others; if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin)) - return BadAlloc; + goto bail; return Success; + +bail: + free(others); + return BadAlloc; } static Bool diff --git a/Xi/exglobals.h b/Xi/exglobals.h index f7557079e..8c5a42e6e 100644 --- a/Xi/exglobals.h +++ b/Xi/exglobals.h @@ -76,7 +76,7 @@ extern int ChangeDeviceNotify; extern int DevicePresenceNotify; extern int DevicePropertyNotify; -extern int RT_INPUTCLIENT; +extern RESTYPE RT_INPUTCLIENT; extern DevPrivateKeyRec XIClientPrivateKeyRec; #define XIClientPrivateKey (&XIClientPrivateKeyRec) diff --git a/Xi/extinit.c b/Xi/extinit.c index 7edadeaf2..0905e1877 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -49,6 +49,7 @@ SOFTWARE. * Dispatch routines and initialization routines for the X input extension. * */ +#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) #define NUMTYPES 15 @@ -83,7 +84,6 @@ SOFTWARE. #include "closedev.h" #include "devbell.h" #include "getbmap.h" -#include "getbmap.h" #include "getdctl.h" #include "getfctl.h" #include "getfocus.h" @@ -92,7 +92,6 @@ SOFTWARE. #include "getprop.h" #include "getselev.h" #include "getvers.h" -#include "getvers.h" #include "grabdev.h" #include "grabdevb.h" #include "grabdevk.h" @@ -358,7 +357,7 @@ int ChangeDeviceNotify; int DevicePresenceNotify; int DevicePropertyNotify; -int RT_INPUTCLIENT; +RESTYPE RT_INPUTCLIENT; /***************************************************************** * @@ -410,7 +409,7 @@ static int ProcIDispatch(ClientPtr client) { REQUEST(xReq); - if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data]) + if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data]) return BadRequest; return (*ProcIVector[stuff->data])(client); @@ -429,7 +428,7 @@ static int SProcIDispatch(ClientPtr client) { REQUEST(xReq); - if (stuff->data > IREQUESTS || !SProcIVector[stuff->data]) + if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data]) return BadRequest; return (*SProcIVector[stuff->data])(client); @@ -510,7 +509,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) SRepXIQueryDevice(client, len, (xXIQueryDeviceReply*)rep); else if (rep->RepType == X_XIGrabDevice) SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep); - else if (rep->RepType == X_XIGrabDevice) + else if (rep->RepType == X_XIPassiveGrabDevice) SRepXIPassiveGrabDevice(client, len, (xXIPassiveGrabDeviceReply *) rep); else if (rep->RepType == X_XIListProperties) SRepXIListProperties(client, len, (xXIListPropertiesReply *) rep); @@ -757,6 +756,7 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to) swapl(&to->mods.latched_mods, n); swapl(&to->mods.locked_mods, n); swapl(&to->mods.effective_mods, n); + swapl(&to->flags, n); ptr = (char*)(&to[1]); ptr += from->buttons_len * 4; @@ -862,6 +862,8 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to) { case XI_Enter: case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to); break; case XI_DeviceChanged: @@ -1120,8 +1122,6 @@ RestoreExtensionEvents(void) static void IResetProc(ExtensionEntry * unused) { - XIResetProperties(); - ReplySwapVector[IReqCode] = ReplyNotSwappd; EventSwapVector[DeviceValuator] = NotImplemented; EventSwapVector[DeviceKeyPress] = NotImplemented; @@ -1301,6 +1301,8 @@ XInputExtensionInit(void) inputInfo.all_devices = &xi_all_devices; inputInfo.all_master_devices = &xi_all_master_devices; + + XIResetProperties(); } else { FatalError("IExtensionInit: AddExtensions failed\n"); } diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 3e81e9479..4e04b8b06 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -118,64 +118,6 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, } } -static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts, - char *buf) -{ - char n; - xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf; - - calib->control = DEVICE_ABS_CALIB; - calib->length = sizeof(xDeviceAbsCalibState); - calib->min_x = dts->min_x; - calib->max_x = dts->max_x; - calib->min_y = dts->min_y; - calib->max_y = dts->max_y; - calib->flip_x = dts->flip_x; - calib->flip_y = dts->flip_y; - calib->rotation = dts->rotation; - calib->button_threshold = dts->button_threshold; - - if (client->swapped) { - swaps(&calib->control, n); - swaps(&calib->length, n); - swapl(&calib->min_x, n); - swapl(&calib->max_x, n); - swapl(&calib->min_y, n); - swapl(&calib->max_y, n); - swapl(&calib->flip_x, n); - swapl(&calib->flip_y, n); - swapl(&calib->rotation, n); - swapl(&calib->button_threshold, n); - } -} - -static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts, - char *buf) -{ - char n; - xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf; - - area->control = DEVICE_ABS_AREA; - area->length = sizeof(xDeviceAbsAreaState); - area->offset_x = dts->offset_x; - area->offset_y = dts->offset_y; - area->width = dts->width; - area->height = dts->height; - area->screen = dts->screen; - area->following = dts->following; - - if (client->swapped) { - swaps(&area->control, n); - swaps(&area->length, n); - swapl(&area->offset_x, n); - swapl(&area->offset_y, n); - swapl(&area->width, n); - swapl(&area->height, n); - swapl(&area->screen, n); - swapl(&area->following, n); - } -} - static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) { char n; @@ -260,17 +202,8 @@ ProcXGetDeviceControl(ClientPtr client) (3 * sizeof(int) * dev->valuator->numAxes); break; case DEVICE_ABS_CALIB: - if (!dev->absolute) - return BadMatch; - - total_length = sizeof(xDeviceAbsCalibState); - break; case DEVICE_ABS_AREA: - if (!dev->absolute) - return BadMatch; - - total_length = sizeof(xDeviceAbsAreaState); - break; + return BadMatch; case DEVICE_CORE: total_length = sizeof(xDeviceCoreState); break; @@ -290,12 +223,6 @@ ProcXGetDeviceControl(ClientPtr client) case DEVICE_RESOLUTION: CopySwapDeviceResolution(client, dev->valuator, buf, total_length); break; - case DEVICE_ABS_CALIB: - CopySwapDeviceAbsCalib(client, dev->absolute, buf); - break; - case DEVICE_ABS_AREA: - CopySwapDeviceAbsArea(client, dev->absolute, buf); - break; case DEVICE_CORE: CopySwapDeviceCore(client, dev, buf); break; diff --git a/Xi/getprop.c b/Xi/getprop.c index ba98fc80f..5e102627d 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -115,7 +115,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) if ((others = wOtherInputMasks(pWin)) != 0) { for (i = 0; i < EMASKSIZE; i++) - tbuf = ClassFromMask(NULL, others->dontPropagateMask[i], i, + ClassFromMask(NULL, others->dontPropagateMask[i], i, &count, COUNT); if (count) { rep.count = count; diff --git a/Xi/getselev.c b/Xi/getselev.c index d63b661cd..7304738b3 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -118,13 +118,13 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) if ((pOthers = wOtherInputMasks(pWin)) != 0) { for (others = pOthers->inputClients; others; others = others->next) for (i = 0; i < EMASKSIZE; i++) - tclient = ClassFromMask(NULL, others->mask[i], i, + ClassFromMask(NULL, others->mask[i], i, &rep.all_clients_count, COUNT); for (others = pOthers->inputClients; others; others = others->next) if (SameClient(others, client)) { for (i = 0; i < EMASKSIZE; i++) - tclient = ClassFromMask(NULL, others->mask[i], i, + ClassFromMask(NULL, others->mask[i], i, &rep.this_client_count, COUNT); break; } @@ -152,8 +152,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) if (total_length) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, total_length, buf); - free(buf); } + free(buf); return Success; } diff --git a/Xi/listdev.c b/Xi/listdev.c index 3b2272bc3..29f0d96e3 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -180,10 +180,10 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, dev->use = IsXKeyboard; else if (IsMaster(d) && IsPointerDevice(d)) dev->use = IsXPointer; - else if (d->key && d->kbdfeed) - dev->use = IsXExtensionKeyboard; else if (d->valuator && d->button) dev->use = IsXExtensionPointer; + else if (d->key && d->kbdfeed) + dev->use = IsXExtensionKeyboard; else dev->use = IsXExtensionDevice; @@ -230,10 +230,11 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) */ static int -CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) +CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) { int i, j, axes, t_axes; char n; + ValuatorClassPtr v = dev->valuator; xValuatorInfoPtr v2; AxisInfo *a; xAxisInfoPtr a2; @@ -247,7 +248,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) v2->class = ValuatorClass; v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo); v2->num_axes = t_axes; - v2->mode = v->mode & DeviceMode; + v2->mode = valuator_get_mode(dev, 0); v2->motion_buffer_size = v->numMotionEvents; if (client && client->swapped) { swapl(&v2->motion_buffer_size, n); @@ -286,7 +287,7 @@ CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes, } if (dev->valuator != NULL) { (*num_classes) += - CopySwapValuatorClass(client, dev->valuator, classbuf); + CopySwapValuatorClass(client, dev, classbuf); } } @@ -356,9 +357,6 @@ ProcXListInputDevices(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; - - AddOtherInputDevices(); - /* allocate space for saving skip value */ skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) diff --git a/Xi/opendev.c b/Xi/opendev.c index e4c02d32a..13841dc4f 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -115,7 +115,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev)) return BadDevice; - OpenInputDevice(dev, client, &status); if (status != Success) return status; diff --git a/Xi/queryst.c b/Xi/queryst.c index 65a43d1d2..73af76d22 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -151,7 +151,8 @@ ProcXQueryDeviceState(ClientPtr client) tv->class = ValuatorClass; tv->length = sizeof(xValuatorState) + v->numAxes * 4; tv->num_valuators = v->numAxes; - tv->mode = v->mode; + tv->mode = valuator_get_mode(dev, 0); + tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0; buf += sizeof(xValuatorState); for (i = 0, values = v->axisVal; i < v->numAxes; i++) { if (rc != BadAccess) diff --git a/Xi/setmode.c b/Xi/setmode.c index ce2ad47c7..42e90f75d 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -110,7 +110,7 @@ ProcXSetDeviceMode(ClientPtr client) rep.status = SetDeviceMode(client, dev, stuff->mode); if (rep.status == Success) - dev->valuator->mode = stuff->mode; + valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode); else if (rep.status != AlreadyGrabbed) { switch(rep.status) { diff --git a/Xi/stubs.c b/Xi/stubs.c index 296a8c4a5..6a4c18158 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -66,96 +66,6 @@ SOFTWARE. #include "XIstubs.h" #include "xace.h" -/*********************************************************************** - * - * Caller: ProcXCloseDevice - * - * Take care of implementation-dependent details of closing a device. - * Some implementations may actually close the device, others may just - * remove this clients interest in that device. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * - */ - -void -CloseInputDevice(DeviceIntPtr d, ClientPtr client) -{ -} - -/*********************************************************************** - * - * Caller: ProcXListInputDevices - * - * This is the implementation-dependent routine to initialize an input - * device to the point that information about it can be listed. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. If some other process has the device open, the - * server may not be able to get information about the device to list it. - * - * This procedure should be used by implementations that do not initialize - * all input devices at server startup. It should do device-dependent - * initialization for any devices not previously initialized, and call - * AddInputDevice for each of those devices so that a DeviceIntRec will be - * created for them. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * The commented-out sample code shows what you might do if you don't want - * the default. - * - */ - -void -AddOtherInputDevices(void) -{ - /********************************************************************** - for each uninitialized device, do something like: - - DeviceIntPtr dev; - DeviceProc deviceProc; - pointer private; - - dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); - dev->public.devicePrivate = private; - RegisterOtherDevice(dev); - dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); - ************************************************************************/ - -} - -/*********************************************************************** - * - * Caller: ProcXOpenDevice - * - * This is the implementation-dependent routine to open an input device. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. This entry point is for the latter type of - * implementation. - * - * If the physical device is not already open, do it here. In this case, - * you need to keep track of the fact that one or more clients has the - * device open, and physically close it when the last client that has - * it open does an XCloseDevice. - * - * The default implementation is to do nothing (assume all input devices - * are opened during X server initialization and kept open). - * - */ - -void -OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) -{ - *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess); -} - /**************************************************************************** * * Caller: ProcXSetDeviceMode @@ -205,17 +115,7 @@ int ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, xDeviceCtl * control) { - switch (control->control) { - case DEVICE_RESOLUTION: - return BadMatch; - case DEVICE_ABS_CALIB: - case DEVICE_ABS_AREA: - return BadMatch; - case DEVICE_CORE: - return BadMatch; - default: - return BadMatch; - } + return BadMatch; } diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index c1899e109..96ead6fcd 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -70,6 +70,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) ev = calloc(1, sizeof(xXIHierarchyEvent) + MAXDEVICES * sizeof(xXIHierarchyInfo)); + if (!ev) + return; ev->type = GenericEvent; ev->extension = IReqCode; ev->evtype = XI_HierarchyChanged; @@ -114,7 +116,9 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) ev->length = bytes_to_int32(ev->num_info * sizeof(xXIHierarchyInfo)); + memset(&dummyDev, 0, sizeof(dummyDev)); dummyDev.id = XIAllDevices; + dummyDev.type = SLAVE; SendEventToAllWindows(&dummyDev, (XI_HierarchyChangedMask >> 8), (xEvent*)ev, 1); free(ev); } @@ -136,12 +140,288 @@ int SProcXIChangeHierarchy(ClientPtr client) return (ProcXIChangeHierarchy(client)); } +static int +add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + char* name; + int rc; + + name = calloc(c->name_len + 1, sizeof(char)); + strncpy(name, (char*)&c[1], c->name_len); + + rc = AllocDevicePair(client, name, &ptr, &keybd, + CorePointerProc, CoreKeyboardProc, TRUE); + if (rc != Success) + goto unwind; + + if (!c->send_core) + ptr->coreEvents = keybd->coreEvents = FALSE; + + /* Allocate virtual slave devices for xtest events */ + rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd); + if (rc != Success) + { + DeleteInputDeviceRequest(ptr); + DeleteInputDeviceRequest(keybd); + goto unwind; + } + + ActivateDevice(ptr, FALSE); + ActivateDevice(keybd, FALSE); + flags[ptr->id] |= XIMasterAdded; + flags[keybd->id] |= XIMasterAdded; + + ActivateDevice(XTestptr, FALSE); + ActivateDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XISlaveAdded; + flags[XTestkeybd->id] |= XISlaveAdded; + + if (c->enable) + { + EnableDevice(ptr, FALSE); + EnableDevice(keybd, FALSE); + flags[ptr->id] |= XIDeviceEnabled; + flags[keybd->id] |= XIDeviceEnabled; + + EnableDevice(XTestptr, FALSE); + EnableDevice(XTestkeybd, FALSE); + flags[XTestptr->id] |= XIDeviceEnabled; + flags[XTestkeybd->id] |= XIDeviceEnabled; + } + + /* Attach the XTest virtual devices to the newly + created master device */ + AttachDevice(NULL, XTestptr, ptr); + AttachDevice(NULL, XTestkeybd, keybd); + flags[XTestptr->id] |= XISlaveAttached; + flags[XTestkeybd->id] |= XISlaveAttached; + +unwind: + free(name); + return rc; +} + +static int +remove_master(ClientPtr client, xXIRemoveMasterInfo *r, + int flags[MAXDEVICES]) +{ + DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; + int rc = Success; + + if (r->return_mode != XIAttachToMaster && + r->return_mode != XIFloating) + return BadValue; + + rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(ptr)) + { + client->errorValue = r->deviceid; + rc = BadDevice; + goto unwind; + } + + /* XXX: For now, don't allow removal of VCP, VCK */ + if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard) + { + rc = BadDevice; + goto unwind; + } + + + ptr = GetMaster(ptr, MASTER_POINTER); + rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + keybd = GetMaster(ptr, MASTER_KEYBOARD); + rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestptr = GetXTestDevice(ptr); + rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); + if (rc != Success) + goto unwind; + + XTestkeybd = GetXTestDevice(keybd); + rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, + DixDestroyAccess); + if (rc != Success) + goto unwind; + + /* Disabling sends the devices floating, reattach them if + * desired. */ + if (r->return_mode == XIAttachToMaster) + { + DeviceIntPtr attached, + newptr, + newkeybd; + + rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newptr)) + { + client->errorValue = r->return_pointer; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newkeybd, r->return_keyboard, + client, DixAddAccess); + if (rc != Success) + goto unwind; + + if (!IsMaster(newkeybd)) + { + client->errorValue = r->return_keyboard; + rc = BadDevice; + goto unwind; + } + + for (attached = inputInfo.devices; attached; attached = attached->next) + { + if (!IsMaster(attached)) { + if (GetMaster(attached, MASTER_ATTACHED) == ptr) + { + AttachDevice(client, attached, newptr); + flags[attached->id] |= XISlaveAttached; + } + if (GetMaster(attached, MASTER_ATTACHED) == keybd) + { + AttachDevice(client, attached, newkeybd); + flags[attached->id] |= XISlaveAttached; + } + } + } + } + + /* can't disable until we removed pairing */ + keybd->spriteInfo->paired = NULL; + ptr->spriteInfo->paired = NULL; + XTestptr->spriteInfo->paired = NULL; + XTestkeybd->spriteInfo->paired = NULL; + + /* disable the remove the devices, XTest devices must be done first + else the sprites they rely on will be destroyed */ + DisableDevice(XTestptr, FALSE); + DisableDevice(XTestkeybd, FALSE); + DisableDevice(keybd, FALSE); + DisableDevice(ptr, FALSE); + flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; + flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; + flags[keybd->id] |= XIDeviceDisabled; + flags[ptr->id] |= XIDeviceDisabled; + + RemoveDevice(XTestptr, FALSE); + RemoveDevice(XTestkeybd, FALSE); + RemoveDevice(keybd, FALSE); + RemoveDevice(ptr, FALSE); + flags[XTestptr->id] |= XISlaveRemoved; + flags[XTestkeybd->id] |= XISlaveRemoved; + flags[keybd->id] |= XIMasterRemoved; + flags[ptr->id] |= XIMasterRemoved; + +unwind: + return rc; +} + +static int +detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES]) +{ + DeviceIntPtr dev; + int rc; + + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(dev)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(dev, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + ReleaseButtonsAndKeys(dev); + AttachDevice(client, dev, NULL); + flags[dev->id] |= XISlaveDetached; + +unwind: + return rc; +} + +static int +attach_slave(ClientPtr client, xXIAttachSlaveInfo *c, + int flags[MAXDEVICES]) +{ + DeviceIntPtr dev; + DeviceIntPtr newmaster; + int rc; + + rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess); + if (rc != Success) + goto unwind; + + if (IsMaster(dev)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + /* Don't allow changes to XTest Devices, these are fixed */ + if (IsXTestDevice(dev, NULL)) + { + client->errorValue = c->deviceid; + rc = BadDevice; + goto unwind; + } + + rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess); + if (rc != Success) + goto unwind; + if (!IsMaster(newmaster)) + { + client->errorValue = c->new_master; + rc = BadDevice; + goto unwind; + } + + if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) || + (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev)))) + { + rc = BadDevice; + goto unwind; + } + + ReleaseButtonsAndKeys(dev); + AttachDevice(client, dev, newmaster); + flags[dev->id] |= XISlaveAttached; + +unwind: + return rc; +} + + + #define SWAPIF(cmd) if (client->swapped) { cmd; } int ProcXIChangeHierarchy(ClientPtr client) { - DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd; xXIAnyHierarchyChangeInfo *any; int required_len = sizeof(xXIChangeHierarchyReq); char n; @@ -169,276 +449,38 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster: { xXIAddMasterInfo* c = (xXIAddMasterInfo*)any; - char* name; - SWAPIF(swaps(&c->name_len, n)); - name = calloc(c->name_len + 1, sizeof(char)); - strncpy(name, (char*)&c[1], c->name_len); - - rc = AllocDevicePair(client, name, &ptr, &keybd, - CorePointerProc, CoreKeyboardProc, - TRUE); + rc = add_master(client, c, flags); if (rc != Success) - { - free(name); goto unwind; - } - - if (!c->send_core) - ptr->coreEvents = keybd->coreEvents = FALSE; - - /* Allocate virtual slave devices for xtest events */ - rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, - ptr, keybd); - if (rc != Success) - { - - free(name); - goto unwind; - } - - ActivateDevice(ptr, FALSE); - ActivateDevice(keybd, FALSE); - flags[ptr->id] |= XIMasterAdded; - flags[keybd->id] |= XIMasterAdded; - - ActivateDevice(XTestptr, FALSE); - ActivateDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XISlaveAdded; - flags[XTestkeybd->id] |= XISlaveAdded; - - if (c->enable) - { - EnableDevice(ptr, FALSE); - EnableDevice(keybd, FALSE); - flags[ptr->id] |= XIDeviceEnabled; - flags[keybd->id] |= XIDeviceEnabled; - - EnableDevice(XTestptr, FALSE); - EnableDevice(XTestkeybd, FALSE); - flags[XTestptr->id] |= XIDeviceEnabled; - flags[XTestkeybd->id] |= XIDeviceEnabled; - } - - /* Attach the XTest virtual devices to the newly - created master device */ - AttachDevice(NULL, XTestptr, ptr); - AttachDevice(NULL, XTestkeybd, keybd); - flags[XTestptr->id] |= XISlaveAttached; - flags[XTestkeybd->id] |= XISlaveAttached; - - free(name); } break; case XIRemoveMaster: { xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any; - if (r->return_mode != XIAttachToMaster && - r->return_mode != XIFloating) - return BadValue; - - rc = dixLookupDevice(&ptr, r->deviceid, client, - DixDestroyAccess); + rc = remove_master(client, r, flags); if (rc != Success) goto unwind; - - if (!IsMaster(ptr)) - { - client->errorValue = r->deviceid; - rc = BadDevice; - goto unwind; - } - - /* XXX: For now, don't allow removal of VCP, VCK */ - if (ptr == inputInfo.pointer || - ptr == inputInfo.keyboard) - { - rc = BadDevice; - goto unwind; - } - - - ptr = GetMaster(ptr, MASTER_POINTER); - rc = dixLookupDevice(&ptr, - ptr->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - keybd = GetMaster(ptr, MASTER_KEYBOARD); - rc = dixLookupDevice(&keybd, - keybd->id, - client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestptr = GetXTestDevice(ptr); - rc = dixLookupDevice(&XTestptr, XTestptr->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - XTestkeybd = GetXTestDevice(keybd); - rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, - DixDestroyAccess); - if (rc != Success) - goto unwind; - - /* Disabling sends the devices floating, reattach them if - * desired. */ - if (r->return_mode == XIAttachToMaster) - { - DeviceIntPtr attached, - newptr, - newkeybd; - - rc = dixLookupDevice(&newptr, r->return_pointer, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newptr)) - { - client->errorValue = r->return_pointer; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newkeybd, r->return_keyboard, - client, DixAddAccess); - if (rc != Success) - goto unwind; - - if (!IsMaster(newkeybd)) - { - client->errorValue = r->return_keyboard; - rc = BadDevice; - goto unwind; - } - - for (attached = inputInfo.devices; - attached; - attached = attached->next) - { - if (!IsMaster(attached)) { - if (attached->u.master == ptr) - { - AttachDevice(client, attached, newptr); - flags[attached->id] |= XISlaveAttached; - } - if (attached->u.master == keybd) - { - AttachDevice(client, attached, newkeybd); - flags[attached->id] |= XISlaveAttached; - } - } - } - } - - /* can't disable until we removed pairing */ - keybd->spriteInfo->paired = NULL; - ptr->spriteInfo->paired = NULL; - XTestptr->spriteInfo->paired = NULL; - XTestkeybd->spriteInfo->paired = NULL; - - /* disable the remove the devices, XTest devices must be done first - else the sprites they rely on will be destroyed */ - DisableDevice(XTestptr, FALSE); - DisableDevice(XTestkeybd, FALSE); - DisableDevice(keybd, FALSE); - DisableDevice(ptr, FALSE); - flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached; - flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached; - flags[keybd->id] |= XIDeviceDisabled; - flags[ptr->id] |= XIDeviceDisabled; - - RemoveDevice(XTestptr, FALSE); - RemoveDevice(XTestkeybd, FALSE); - RemoveDevice(keybd, FALSE); - RemoveDevice(ptr, FALSE); - flags[XTestptr->id] |= XISlaveRemoved; - flags[XTestkeybd->id] |= XISlaveRemoved; - flags[keybd->id] |= XIMasterRemoved; - flags[ptr->id] |= XIMasterRemoved; } break; case XIDetachSlave: { xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = detach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - AttachDevice(client, ptr, NULL); - flags[ptr->id] |= XISlaveDetached; } break; case XIAttachSlave: { xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any; - DeviceIntPtr newmaster; - rc = dixLookupDevice(&ptr, c->deviceid, client, - DixManageAccess); + rc = attach_slave(client, c, flags); if (rc != Success) goto unwind; - - if (IsMaster(ptr)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - /* Don't allow changes to XTest Devices, these are fixed */ - if (IsXTestDevice(ptr, NULL)) - { - client->errorValue = c->deviceid; - rc = BadDevice; - goto unwind; - } - - rc = dixLookupDevice(&newmaster, c->new_master, - client, DixAddAccess); - if (rc != Success) - goto unwind; - if (!IsMaster(newmaster)) - { - client->errorValue = c->new_master; - rc = BadDevice; - goto unwind; - } - - if (!((IsPointerDevice(newmaster) && - IsPointerDevice(ptr)) || - (IsKeyboardDevice(newmaster) && - IsKeyboardDevice(ptr)))) - { - rc = BadDevice; - goto unwind; - } - AttachDevice(client, ptr, newmaster); - flags[ptr->id] |= XISlaveAttached; } break; } diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 24ededcb1..0adc8787d 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -79,7 +79,7 @@ ProcXIGrabDevice(ClientPtr client) if (!IsMaster(dev)) stuff->paired_device_mode = GrabModeAsync; - if (XICheckInvalidMaskBits((unsigned char*)&stuff[1], + if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1], stuff->mask_len * 4) != Success) return BadValue; diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 296614510..ae4343344 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -43,6 +43,7 @@ #include "exevents.h" #include "xipassivegrab.h" #include "dixgrabs.h" +#include "misc.h" int SProcXIPassiveGrabDevice(ClientPtr client) @@ -87,6 +88,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) GrabParameters param; void *tmp; int mask_len; + int n; REQUEST(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); @@ -99,7 +101,10 @@ ProcXIPassiveGrabDevice(ClientPtr client) { ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (ret != Success) + { + client->errorValue = stuff->deviceid; return ret; + } } if (stuff->grab_type != XIGrabtypeButton && @@ -118,7 +123,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) return BadValue; } - if (XICheckInvalidMaskBits((unsigned char*)&stuff[1], + if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1], stuff->mask_len * 4) != Success) return BadValue; @@ -156,16 +161,15 @@ ProcXIPassiveGrabDevice(ClientPtr client) return status; status = CheckGrabValues(client, ¶m); + if (status != Success) + return status; modifiers = (uint32_t*)&stuff[1] + stuff->mask_len; modifiers_failed = calloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); if (!modifiers_failed) return BadAlloc; - if (!IsMaster(dev) && dev->u.master) - mod_dev = GetMaster(dev, MASTER_KEYBOARD); - else - mod_dev = dev; + mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); for (i = 0; i < stuff->num_modifiers; i++, modifiers++) { @@ -193,17 +197,18 @@ ProcXIPassiveGrabDevice(ClientPtr client) info->status = status; info->modifiers = *modifiers; + if (client->swapped) + swapl(&info->modifiers, n); + rep.num_modifiers++; - rep.length++; + rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo)); } } WriteReplyToClient(client, sizeof(rep), &rep); if (rep.num_modifiers) - { - client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed); - } + WriteToClient(client, rep.length * 4, (char*)modifiers_failed); + free(modifiers_failed); return ret; } @@ -280,10 +285,7 @@ ProcXIPassiveUngrabDevice(ClientPtr client) if (rc != Success) return rc; - if (!IsMaster(dev) && dev->u.master) - mod_dev = GetMaster(dev, MASTER_KEYBOARD); - else - mod_dev = dev; + mod_dev = (IsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD); tempGrab.resource = client->clientAsMask; tempGrab.device = dev; diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index b9f53f7dc..83ce93014 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -701,7 +701,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient) int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent) + const pointer value, Bool sendevent) { XIPropertyPtr prop; int size_in_bytes; @@ -1051,11 +1051,11 @@ SProcXChangeDeviceProperty (ClientPtr client) char n; REQUEST(xChangeDevicePropertyReq); + REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); swaps(&stuff->length, n); swapl(&stuff->property, n); swapl(&stuff->type, n); swapl(&stuff->nUnits, n); - REQUEST_SIZE_MATCH(xChangeDevicePropertyReq); return (ProcXChangeDeviceProperty(client)); } @@ -1295,12 +1295,12 @@ SProcXIChangeProperty(ClientPtr client) char n; REQUEST(xXIChangePropertyReq); + REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); swaps(&stuff->length, n); swaps(&stuff->deviceid, n); swapl(&stuff->property, n); swapl(&stuff->type, n); swapl(&stuff->num_items, n); - REQUEST_SIZE_MATCH(xXIChangePropertyReq); return (ProcXIChangeProperty(client)); } diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 303c8b27d..a768d499c 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -107,8 +107,10 @@ ProcXIQueryDevice(ClientPtr client) } info = calloc(1, len); - if (!info) + if (!info) { + free(skip); return BadAlloc; + } memset(&rep, 0, sizeof(xXIQueryDeviceReply)); rep.repType = X_Reply; @@ -153,8 +155,9 @@ ProcXIQueryDevice(ClientPtr client) } } + len = rep.length * 4; WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); - WriteToClient(client, rep.length * 4, ptr); + WriteToClient(client, len, ptr); free(ptr); free(skip); return rc; @@ -349,7 +352,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber, info->value.frac = (int)(v->axisVal[axisnumber] * (1 << 16) * (1 << 16)); info->resolution = v->axes[axisnumber].resolution; info->number = axisnumber; - info->mode = v->mode; /* Server doesn't have per-axis mode yet */ + info->mode = valuator_get_mode(dev, axisnumber); info->sourceid = v->sourceid; if (!reportState) @@ -375,7 +378,7 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info) int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) { - DeviceIntPtr master = dev->u.master; + DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED); int use; if (IsMaster(dev)) @@ -383,7 +386,7 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) DeviceIntPtr paired = GetPairedDevice(dev); use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard; *attachment = (paired ? paired->id : 0); - } else if (master) + } else if (!IsFloating(dev)) { use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard; *attachment = master->id; diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index b521c48ef..51317994b 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -93,7 +93,7 @@ ProcXIQueryPointer(ClientPtr client) } if (pDev->valuator == NULL || IsKeyboardDevice(pDev) || - (!IsMaster(pDev) && pDev->u.master)) /* no attached devices */ + (!IsMaster(pDev) && !IsFloating(pDev))) /* no attached devices */ { client->errorValue = stuff->deviceid; return BadDevice; @@ -129,7 +129,7 @@ ProcXIQueryPointer(ClientPtr client) if (kbd) { - state = &kbd->key->xkbInfo->prev_state; + state = &kbd->key->xkbInfo->state; rep.mods.base_mods = state->base_mods; rep.mods.latched_mods = state->latched_mods; rep.mods.locked_mods = state->locked_mods; diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index ae63297da..f647f9872 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -58,7 +58,6 @@ ProcXIQueryVersion(ClientPtr client) xXIQueryVersionReply rep; XIClientPtr pXIClient; int major, minor; - unsigned int sversion, cversion; REQUEST(xXIQueryVersionReq); REQUEST_SIZE_MATCH(xXIQueryVersionReq); @@ -72,10 +71,8 @@ ProcXIQueryVersion(ClientPtr client) pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); - sversion = XIVersion.major_version * 1000 + XIVersion.minor_version; - cversion = stuff->major_version * 1000 + stuff->minor_version; - - if (sversion > cversion) + if (version_compare(XIVersion.major_version, XIVersion.minor_version, + stuff->major_version, stuff->minor_version) > 0) { major = stuff->major_version; minor = stuff->minor_version; diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 7aa3f0ab6..22fbaf5e7 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -42,14 +42,19 @@ * * @return BadValue if at least one invalid bit is set or Success otherwise. */ -int XICheckInvalidMaskBits(unsigned char *mask, int len) +int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) { if (len >= XIMaskLen(XI2LASTEVENT)) { int i; for (i = XI2LASTEVENT + 1; i < len * 8; i++) + { if (BitIsOn(mask, i)) + { + client->errorValue = i; return BadValue; + } + } } return Success; @@ -126,7 +131,10 @@ ProcXISelectEvents(ClientPtr client) { unsigned char *bits = (unsigned char*)&evmask[1]; if (BitIsOn(bits, XI_HierarchyChanged)) + { + client->errorValue = XI_HierarchyChanged; return BadValue; + } } /* Raw events may only be selected on root windows */ @@ -138,10 +146,13 @@ ProcXISelectEvents(ClientPtr client) BitIsOn(bits, XI_RawButtonPress) || BitIsOn(bits, XI_RawButtonRelease) || BitIsOn(bits, XI_RawMotion)) + { + client->errorValue = XI_RawKeyPress; return BadValue; + } } - if (XICheckInvalidMaskBits((unsigned char*)&evmask[1], + if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1], evmask->mask_len * 4) != Success) return BadValue; diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index 7276e6faf..a463ab94d 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -97,7 +97,7 @@ ProcXIWarpPointer(ClientPtr client) return rc; } - if ((!IsMaster(pDev) && pDev->u.master) || + if ((!IsMaster(pDev) && !IsFloating(pDev)) || (IsMaster(pDev) && !IsPointerDevice(pDev))) { client->errorValue = stuff->deviceid; @@ -192,6 +192,8 @@ ProcXIWarpPointer(ClientPtr client) /* if we don't update the device, we get a jump next time it moves */ pDev->last.valuators[0] = x; pDev->last.valuators[1] = y; + pDev->last.remainder[0] = 0; + pDev->last.remainder[1] = 0; miPointerUpdateSprite(pDev); /* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it diff --git a/android/README b/android/README deleted file mode 100644 index 34cbfb9e5..000000000 --- a/android/README +++ /dev/null @@ -1 +0,0 @@ -PKG_CONFIG_PATH=/opt/androix/lib/pkgconfig CC=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc LD=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-ld CFLAGS="-W -Wall -O -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -nostdlib" LDFLAGS="-L/opt/androix/usr/lib -lc -ldl" ./configure --host x86_64-linux-gnu --prefix=/opt/androix diff --git a/android/build.sh b/android/build.sh deleted file mode 100755 index 48769dceb..000000000 --- a/android/build.sh +++ /dev/null @@ -1 +0,0 @@ -CC="/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc" CFLAGS="-W -Wall -O -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__" LDFLAGS="-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -ldl -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc" PKG_CONFIG_PATH="/opt/androix/usr/lib/pkgconfig" ./configure --host arm-eabi --prefix=/opt/androix/usr --disable-glx --disable-xvfb --disable-xinerama --disable-xnest --enable-kdrive --enable-xfakelib --disable-xfbdev --disable-xephyr --with-xkb-path="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb" --with-xkb-output="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb/compiled" --with-default-font-path="/data/data/net.homeip.ofn.androix/usr/share/fonts/X11" --with-xkb-bin-directory="/data/data/net.homeip.ofn.androix/usr/bin" --prefix=/opt/androix/usr diff --git a/android/jni/androix.c b/android/jni/androix.c deleted file mode 100644 index 179e15e19..000000000 --- a/android/jni/androix.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -//include -#include - -#include - -#include "android/log.h" - -#define LOG_TAG "AndroiX" -//define LOG(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) -#define LOG(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) - -/* This is a trivial JNI example where we use a native method - * to return a new VM String. See the corresponding Java source - * file located at: - * - * apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java - */ -/* -jstring -Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, - jobject thiz ) -{ - return (*env)->NewStringUTF(env, "Hello from JNI !"); -} -*/ - -void -Java_net_homeip_ofn_androix_AndroiXFakeLib_init( JNIEnv* env, jobject thiz ) -{ - struct stat stats; - int mode = 0666; - - char *argv[] = {":1"}; - char *envp[] = {}; - - LOG("fixing up /data/data/net.homeip.ofn.androix/usr/bin/xkbcomp"); - - chmod("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", 0775); - - LOG("done."); - - stat("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", &stats); - - LOG("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp mode: " + stats.st_mode); - - LOG("starting DIX"); - dix_main(1, argv, envp); - LOG("returning from DIX (this shouldn't happen)"); -} diff --git a/android/jni/fakejni.c b/android/jni/fakejni.c deleted file mode 100644 index 7d4e73e99..000000000 --- a/android/jni/fakejni.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -//include -#include - -/* This is a trivial JNI example where we use a native method - * to return a new VM String. See the corresponding Java source - * file located at: - * - * apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java - */ -/* -jstring -Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, - jobject thiz ) -{ - return (*env)->NewStringUTF(env, "Hello from JNI !"); -} -*/ diff --git a/android/jni/hello-jni.c b/android/jni/hello-jni.c deleted file mode 100644 index 0f959d8c5..000000000 --- a/android/jni/hello-jni.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include - -/* This is a trivial JNI example where we use a native method - * to return a new VM String. See the corresponding Java source - * file located at: - * - * apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java - */ -/* -jstring -Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, - jobject thiz ) -{ - return (*env)->NewStringUTF(env, "Hello from JNI !"); -} -*/ diff --git a/android/libs/armeabi/gdb.setup b/android/libs/armeabi/gdb.setup deleted file mode 100644 index 9404c78c7..000000000 --- a/android/libs/armeabi/gdb.setup +++ /dev/null @@ -1,3 +0,0 @@ -set solib-search-path /home/tmzt/src/xorg/xorg/xserver/android/obj/local/armeabi -directory /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include -directory /home/tmzt/src/xorg/xorg/xserver/android/jni diff --git a/android/libs/armeabi/gdbserver b/android/libs/armeabi/gdbserver deleted file mode 100755 index ea79a000f..000000000 Binary files a/android/libs/armeabi/gdbserver and /dev/null differ diff --git a/android/obj/local/armeabi/objs/androix/androix.o.d b/android/obj/local/armeabi/objs/androix/androix.o.d deleted file mode 100644 index d1b173cdc..000000000 --- a/android/obj/local/armeabi/objs/androix/androix.o.d +++ /dev/null @@ -1,68 +0,0 @@ -/home/tmzt/src/xorg/xorg/xserver/android/obj/local/armeabi/objs/androix/androix.o: \ - /home/tmzt/src/xorg/xorg/xserver/android/jni/androix.c \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/jni.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/stat.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/stdint.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/_types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/machine/_types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/asm/types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/types.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/time.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/time.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/stat.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/endian.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/endian.h \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/android/log.h - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/jni.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/stat.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/cdefs.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/cdefs_elf.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/stdint.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/_types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/machine/_types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/posix_types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/stddef.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/compiler.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/asm/posix_types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/asm/types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/types.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/machine/kernel.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/sysmacros.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/time.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/time.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/linux/stat.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/endian.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/sys/endian.h: - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/android/log.h: diff --git a/android/obj/local/armeabi/objs/fakedix/fakejni.o.d b/android/obj/local/armeabi/objs/fakedix/fakejni.o.d deleted file mode 100644 index 52840e4e8..000000000 --- a/android/obj/local/armeabi/objs/fakedix/fakejni.o.d +++ /dev/null @@ -1,5 +0,0 @@ -/home/tmzt/src/xorg/xorg/xserver/xserver-android-1/obj/local/armeabi/objs/fakedix/fakejni.o: \ - /home/tmzt/src/xorg/xorg/xserver/xserver-android-1/jni/fakejni.c \ - /home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/jni.h - -/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include/jni.h: diff --git a/android/old-build.sh b/android/old-build.sh deleted file mode 100755 index 4195b8387..000000000 --- a/android/old-build.sh +++ /dev/null @@ -1,22 +0,0 @@ - -#PLATFORM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm -PREBUILT="/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0" \ -PLATFORM="/opt/androix" \ -CC="$PREBUILT/bin/arm-eabi-gcc" \ -NM="$PREBUILT/bin/arm-eabi-nm" \ -PKG_CONFIG_PATH="/opt/androix/usr/lib/pkgconfig" \ -CFLAGS="-W -Wall -O -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib" \ -CFLAGS="$CFLAGS -fPIC -DANDROID -I$PLATFORM/usr/include -Dbionic -Dlinux -D__arm__" \ -LDFLAGS="-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl" \ -LDFLAGS="$LDFLAGS -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc" \ -./configure \ ---host arm-eabi \ ---prefix=/opt/androix/usr \ ---disable-glx \ ---disable-xvfb \ ---disable-xinerama \ ---disable-xnest \ ---enable-kdrive \ ---enable-xfakelib \ ---disable-xfbdev \ ---disable-xephyr \ diff --git a/android/src/net/ofn/homeip/androix/AndroiX.java b/android/src/net/ofn/homeip/androix/AndroiX.java deleted file mode 100644 index 84c9887db..000000000 --- a/android/src/net/ofn/homeip/androix/AndroiX.java +++ /dev/null @@ -1,37 +0,0 @@ - -package net.homeip.ofn.androix; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.ViewGroup; -import android.view.Window; -import android.view.WindowManager; - -import android.widget.TextView; - - -public class AndroiX extends Activity -{ - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - TextView tv = new TextView(this); - tv.setText( "no string from jni" ); - setContentView(tv); - - final Intent intent = new Intent(this, AndroiXService.class); - startService(intent); - } - - @Override - public void onDestroy() - { - Log.d("AndroiX", "destroyed"); - } - -} diff --git a/android/src/net/ofn/homeip/androix/AndroiXDixMain.java b/android/src/net/ofn/homeip/androix/AndroiXDixMain.java deleted file mode 100644 index f47278505..000000000 --- a/android/src/net/ofn/homeip/androix/AndroiXDixMain.java +++ /dev/null @@ -1,13 +0,0 @@ - -package net.homeip.ofn.androix; - -import android.util.Log; - -public class AndroiXDixMain implements Runnable -{ - public void run() { - Log.i("AndroiX","in AndroiXDixMain java"); - AndroiXLib lib = new AndroiXLib(); - lib.init(); - } -} diff --git a/android/src/net/ofn/homeip/androix/AndroiXLib.java b/android/src/net/ofn/homeip/androix/AndroiXLib.java deleted file mode 100644 index f4188b0fa..000000000 --- a/android/src/net/ofn/homeip/androix/AndroiXLib.java +++ /dev/null @@ -1,11 +0,0 @@ - -package net.homeip.ofn.androix; - -public class AndroiXLib { - public native void init(); - - static - { - System.loadLibrary("androix"); - } -} diff --git a/android/tests/local.properties b/android/tests/local.properties deleted file mode 100644 index f4e78dced..000000000 --- a/android/tests/local.properties +++ /dev/null @@ -1,10 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked in Version Control Systems, -# as it contains information specific to your local configuration. - -# location of the SDK. This is only used by Ant -# For customization when using a Version Control System, please read the -# header note. -sdk.dir=/home/tmzt/src/android-sdk/android-sdk-linux_86 diff --git a/android/usrdata.zip b/android/usrdata.zip deleted file mode 100644 index 8c5d09331..000000000 Binary files a/android/usrdata.zip and /dev/null differ diff --git a/android/xfakelib/.gitignore b/android/xfakelib/.gitignore deleted file mode 100644 index c0bb17be2..000000000 --- a/android/xfakelib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xfakelibdynamic diff --git a/android/xfakelib/xfakelibdynamic b/android/xfakelib/xfakelibdynamic deleted file mode 100755 index df118f958..000000000 Binary files a/android/xfakelib/xfakelibdynamic and /dev/null differ diff --git a/autogen.sh b/autogen.sh index 4e8b11ba9..7f9163dae 100755 --- a/autogen.sh +++ b/autogen.sh @@ -6,7 +6,7 @@ test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir -autoreconf --force -v --install || exit 1 +autoreconf -I /ndk/androix/usr/share/aclocal --force -v --install || exit 1 cd $ORIGDIR || exit $? $srcdir/configure --enable-maintainer-mode "$@" diff --git a/composite/compalloc.c b/composite/compalloc.c index 47d5c0a3c..5c27631e1 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -47,6 +47,30 @@ #include "compint.h" +static void +compScreenUpdate (ScreenPtr pScreen) +{ + compCheckTree (pScreen); + compPaintChildrenToWindow (pScreen->root); +} + +static void +compBlockHandler (int i, + pointer blockData, + pointer pTimeout, + pointer pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + CompScreenPtr cs = GetCompScreen (pScreen); + + pScreen->BlockHandler = cs->BlockHandler; + compScreenUpdate (pScreen); + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + + /* Next damage will restore the block handler */ + cs->BlockHandler = NULL; +} + static void compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) { @@ -55,8 +79,20 @@ compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) CompScreenPtr cs = GetCompScreen (pScreen); CompWindowPtr cw = GetCompWindow (pWin); - cs->damaged = TRUE; + if (!cs->BlockHandler) { + cs->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = compBlockHandler; + } cw->damaged = TRUE; + + /* Mark the ancestors */ + pWin = pWin->parent; + while (pWin) { + if (pWin->damagedDescendants) + break; + pWin->damagedDescendants = TRUE; + pWin = pWin->parent; + } } static void @@ -68,6 +104,35 @@ compDestroyDamage (DamagePtr pDamage, void *closure) cw->damage = 0; } +static Bool +compMarkWindows(WindowPtr pWin, + WindowPtr *ppLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pLayerWin = pWin; + + if (!pWin->viewable) + return FALSE; + + (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); + (*pScreen->MarkWindow)(pLayerWin->parent); + + *ppLayerWin = pLayerWin; + + return TRUE; +} + +static void +compHandleMarkedWindows(WindowPtr pWin, WindowPtr pLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); + (*pScreen->HandleExposures)(pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTOther); +} + /* * Redirect one window for one client */ @@ -76,8 +141,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) { CompWindowPtr cw = GetCompWindow (pWin); CompClientWindowPtr ccw; - Bool wasMapped = pWin->mapped; CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen); + WindowPtr pLayerWin; + Bool anyMarked = FALSE; if (pWin == cs->pOverlayWin) { return Success; @@ -127,16 +193,14 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) free(cw); return BadAlloc; } - if (wasMapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + anyMarked = compMarkWindows (pWin, &pLayerWin); + + /* Make sure our borderClip is correct for ValidateTree */ RegionNull(&cw->borderClip); - cw->borderClipX = 0; - cw->borderClipY = 0; + RegionCopy(&cw->borderClip, &pWin->borderClip); + cw->borderClipX = pWin->drawable.x; + cw->borderClipY = pWin->drawable.y; cw->update = CompositeRedirectAutomatic; cw->clients = 0; cw->oldx = COMP_ORIGIN_INVALID; @@ -152,16 +216,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) return BadAlloc; if (ccw->update == CompositeRedirectManual) { - /* If the window was CompositeRedirectAutomatic, then - * unmap the window so that the parent clip list will - * be correctly recomputed. - */ - if (pWin->mapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + if (!anyMarked) + anyMarked = compMarkWindows (pWin, &pLayerWin); + if (cw->damageRegistered) { DamageUnregister (&pWin->drawable, cw->damage); @@ -169,25 +226,51 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) } cw->update = CompositeRedirectManual; } + else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered) { + if (!anyMarked) + anyMarked = compMarkWindows (pWin, &pLayerWin); + } if (!compCheckRedirect (pWin)) { FreeResource (ccw->id, RT_NONE); return BadAlloc; } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - DisableMapUnmapEvents (pWin); - MapWindow (pWin, pClient); - EnableMapUnmapEvents (pWin); - pWin->overrideRedirect = overrideRedirect; - } + + if (anyMarked) + compHandleMarkedWindows (pWin, pLayerWin); return Success; } +void +compRestoreWindow (WindowPtr pWin, PixmapPtr pPixmap) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pParent = pWin->parent; + + if (pParent->drawable.depth == pWin->drawable.depth) { + GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); + int bw = (int) pWin->borderWidth; + int x = bw; + int y = bw; + int w = pWin->drawable.width; + int h = pWin->drawable.height; + + if (pGC) { + ChangeGCVal val; + val.val = IncludeInferiors; + ChangeGC (NullClient, pGC, GCSubwindowMode, &val); + ValidateGC(&pWin->drawable, pGC); + (*pGC->ops->CopyArea) (&pPixmap->drawable, + &pWin->drawable, + pGC, + x, y, w, h, 0, 0); + FreeScratchGC (pGC); + } + } +} + /* * Free one of the per-client per-window resources, clearing * redirect and the per-window pointer as appropriate @@ -195,9 +278,12 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) void compFreeClientWindow (WindowPtr pWin, XID id) { + ScreenPtr pScreen = pWin->drawable.pScreen; CompWindowPtr cw = GetCompWindow (pWin); CompClientWindowPtr ccw, *prev; - Bool wasMapped = pWin->mapped; + Bool anyMarked = FALSE; + WindowPtr pLayerWin; + PixmapPtr pPixmap = NULL; if (!cw) return; @@ -214,15 +300,12 @@ compFreeClientWindow (WindowPtr pWin, XID id) } if (!cw->clients) { - if (wasMapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + anyMarked = compMarkWindows (pWin, &pLayerWin); - if (pWin->redirectDraw != RedirectDrawNone) - compFreePixmap (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { + pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + } if (cw->damage) DamageDestroy (cw->damage); @@ -235,19 +318,20 @@ compFreeClientWindow (WindowPtr pWin, XID id) else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone) { + anyMarked = compMarkWindows (pWin, &pLayerWin); + DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; pWin->redirectDraw = RedirectDrawAutomatic; - DamageRegionAppend(&pWin->drawable, &pWin->borderSize); + DamageDamageRegion(&pWin->drawable, &pWin->borderSize); } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - DisableMapUnmapEvents (pWin); - MapWindow (pWin, clients[CLIENT_ID(id)]); - EnableMapUnmapEvents (pWin); - pWin->overrideRedirect = overrideRedirect; + + if (anyMarked) + compHandleMarkedWindows (pWin, pLayerWin); + + if (pPixmap) { + compRestoreWindow (pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); } } @@ -472,17 +556,6 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin) return Success; } -static int -bgNoneVisitWindow(WindowPtr pWin, void *null) -{ - if (pWin->backgroundState != BackgroundPixmap) - return WT_WALKCHILDREN; - if (pWin->background.pixmap != None) - return WT_WALKCHILDREN; - - return WT_STOPWALKING; -} - static PixmapPtr compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map) { @@ -503,21 +576,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map) if (!map) return pPixmap; - /* - * If there's no bg=None in the tree, we're done. - * - * We could optimize this more by collection the regions of all the - * bg=None subwindows and feeding that in as the clip for the - * CopyArea below, but since window trees are shallow these days it - * might not be worth the effort. - */ - if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH) - return pPixmap; - - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ if (pParent->drawable.depth == pWin->drawable.depth) { GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); @@ -526,9 +584,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map) { ChangeGCVal val; val.val = IncludeInferiors; - + ChangeGC (NullClient, pGC, GCSubwindowMode, &val); ValidateGC(&pPixmap->drawable, pGC); - ChangeGC (serverClient, pGC, GCSubwindowMode, &val); (*pGC->ops->CopyArea) (&pParent->drawable, &pPixmap->drawable, pGC, @@ -607,10 +664,10 @@ compAllocPixmap (WindowPtr pWin) } void -compFreePixmap (WindowPtr pWin) +compSetParentPixmap (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; - PixmapPtr pRedirectPixmap, pParentPixmap; + PixmapPtr pParentPixmap; CompWindowPtr cw = GetCompWindow (pWin); if (cw->damageRegistered) @@ -626,11 +683,9 @@ compFreePixmap (WindowPtr pWin) * parent exposed area; regions beyond the parent cause crashes */ RegionCopy(&pWin->borderClip, &cw->borderClip); - pRedirectPixmap = (*pScreen->GetWindowPixmap) (pWin); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = RedirectDrawNone; compSetPixmap (pWin, pParentPixmap); - (*pScreen->DestroyPixmap) (pRedirectPixmap); } /* diff --git a/composite/compext.c b/composite/compext.c index 30d9dc2b6..e0d8e75e4 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -535,13 +535,6 @@ CompositeExtensionInit (void) if (GetPictureScreenIfSet(pScreen) == NULL) return; } -#ifdef PANORAMIX - /* Xinerama's rewriting of window drawing before Composite gets to it - * breaks Composite. - */ - if (!noPanoramiXExtension) - return; -#endif CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow, "CompositeClientWindow"); @@ -582,3 +575,355 @@ CompositeExtensionInit (void) /* Initialization succeeded */ noCompositeExtension = FALSE; } + +#ifdef PANORAMIX +#include "panoramiXsrv.h" + +int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr); + +static int +PanoramiXCompositeRedirectWindow (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeRedirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeRedirectSubwindows (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeRedirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectWindow (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeUnredirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectSubwindows (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeUnredirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeNameWindowPixmap (ClientPtr client) +{ + WindowPtr pWin; + CompWindowPtr cw; + PixmapPtr pPixmap; + int rc; + PanoramiXRes *win, *newPix; + int i; + REQUEST(xCompositeNameWindowPixmapReq); + + REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + LEGAL_NEW_RESOURCE (stuff->pixmap, client); + + if(!(newPix = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + newPix->type = XRT_PIXMAP; + newPix->u.pix.shared = FALSE; + panoramix_setup_ids(newPix, client, stuff->pixmap); + + FOR_NSCREENS(i) { + rc = dixLookupResourceByType ((void **) &pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) + { + client->errorValue = stuff->window; + free (newPix); + return rc; + } + + if (!pWin->viewable) + { + free (newPix); + return BadMatch; + } + + cw = GetCompWindow (pWin); + if (!cw) + { + free (newPix); + return BadMatch; + } + + pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); + if (!pPixmap) + { + free (newPix); + return BadMatch; + } + + if (!AddResource (newPix->info[i].id, RT_PIXMAP, + (pointer) pPixmap)) + return BadAlloc; + + ++pPixmap->refcnt; + } + + if (!AddResource (stuff->pixmap, XRT_PIXMAP, (pointer) newPix)) + return BadAlloc; + + return Success; +} + + +static int +PanoramiXCompositeGetOverlayWindow (ClientPtr client) +{ + REQUEST(xCompositeGetOverlayWindowReq); + xCompositeGetOverlayWindowReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + CompScreenPtr cs; + CompOverlayClientPtr pOc; + int rc; + PanoramiXRes *win, *overlayWin = NULL; + int i; + + REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + cs = GetCompScreen(screenInfo.screens[0]); + if (!cs->pOverlayWin) + { + if(!(overlayWin = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + overlayWin->type = XRT_WINDOW; + overlayWin->u.win.root = FALSE; + } + + FOR_NSCREENS_BACKWARD(i) { + rc = dixLookupResourceByType((pointer *)&pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) + { + client->errorValue = stuff->window; + return rc; + } + pScreen = pWin->drawable.pScreen; + + /* + * Create an OverlayClient structure to mark this client's + * interest in the overlay window + */ + pOc = compCreateOverlayClient(pScreen, client); + if (pOc == NULL) + return BadAlloc; + + /* + * Make sure the overlay window exists + */ + cs = GetCompScreen(pScreen); + if (cs->pOverlayWin == NULL) + if (!compCreateOverlayWindow(pScreen)) + { + FreeResource (pOc->resource, RT_NONE); + return BadAlloc; + } + + rc = XaceHook(XACE_RESOURCE_ACCESS, client, + cs->pOverlayWin->drawable.id, + RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, + DixGetAttrAccess); + if (rc != Success) + { + FreeResource (pOc->resource, RT_NONE); + return rc; + } + } + + if (overlayWin) + { + FOR_NSCREENS(i) { + cs = GetCompScreen(screenInfo.screens[i]); + overlayWin->info[i].id = cs->pOverlayWin->drawable.id; + } + + AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin); + } + + cs = GetCompScreen(screenInfo.screens[0]); + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.overlayWin = cs->pOverlayWin->drawable.id; + + if (client->swapped) + { + int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.overlayWin, n); + } + (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); + + return Success; +} + +static int +PanoramiXCompositeReleaseOverlayWindow (ClientPtr client) +{ + REQUEST(xCompositeReleaseOverlayWindowReq); + WindowPtr pWin; + ScreenPtr pScreen; + CompOverlayClientPtr pOc; + PanoramiXRes *win; + int i, rc; + + REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_BACKWARD(i) { + if ((rc = dixLookupResourceByType((void **)&pWin, win->info[i].id, + XRT_WINDOW, client, + DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + pScreen = pWin->drawable.pScreen; + + /* + * Has client queried a reference to the overlay window + * on this screen? If not, generate an error. + */ + pOc = compFindOverlayClient (pWin->drawable.pScreen, client); + if (pOc == NULL) + return BadMatch; + + /* The delete function will free the client structure */ + FreeResource (pOc->resource, RT_NONE); + } + + return Success; +} + +void +PanoramiXCompositeInit (void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + PanoramiXSaveCompositeVector[i] = ProcCompositeVector[i]; + /* + * Stuff in Xinerama aware request processing hooks + */ + ProcCompositeVector[X_CompositeRedirectWindow] = + PanoramiXCompositeRedirectWindow; + ProcCompositeVector[X_CompositeRedirectSubwindows] = + PanoramiXCompositeRedirectSubwindows; + ProcCompositeVector[X_CompositeUnredirectWindow] = + PanoramiXCompositeUnredirectWindow; + ProcCompositeVector[X_CompositeUnredirectSubwindows] = + PanoramiXCompositeUnredirectSubwindows; + ProcCompositeVector[X_CompositeNameWindowPixmap] = + PanoramiXCompositeNameWindowPixmap; + ProcCompositeVector[X_CompositeGetOverlayWindow] = + PanoramiXCompositeGetOverlayWindow; + ProcCompositeVector[X_CompositeReleaseOverlayWindow] = + PanoramiXCompositeReleaseOverlayWindow; +} + +void +PanoramiXCompositeReset (void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + ProcCompositeVector[i] = PanoramiXSaveCompositeVector[i]; +} + +#endif diff --git a/composite/compinit.c b/composite/compinit.c index 5db9f0282..90ee66c88 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -61,7 +61,6 @@ compCloseScreen (int index, ScreenPtr pScreen) free(cs->alternateVisuals); pScreen->CloseScreen = cs->CloseScreen; - pScreen->BlockHandler = cs->BlockHandler; pScreen->InstallColormap = cs->InstallColormap; pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; pScreen->ReparentWindow = cs->ReparentWindow; @@ -78,6 +77,9 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->CopyWindow = cs->CopyWindow; pScreen->PositionWindow = cs->PositionWindow; + pScreen->GetImage = cs->GetImage; + pScreen->SourceValidate = cs->SourceValidate; + free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); ret = (*pScreen->CloseScreen) (index, pScreen); @@ -131,32 +133,40 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) } static void -compScreenUpdate (ScreenPtr pScreen) +compGetImage (DrawablePtr pDrawable, + int sx, int sy, + int w, int h, + unsigned int format, + unsigned long planemask, + char *pdstLine) { - CompScreenPtr cs = GetCompScreen (pScreen); + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen (pScreen); - compCheckTree (pScreen); - if (cs->damaged) - { - compWindowUpdate (pScreen->root); - cs->damaged = FALSE; - } + pScreen->GetImage = cs->GetImage; + if (pDrawable->type == DRAWABLE_WINDOW) + compPaintChildrenToWindow ((WindowPtr) pDrawable); + (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; } -static void -compBlockHandler (int i, - pointer blockData, - pointer pTimeout, - pointer pReadmask) +static void compSourceValidate(DrawablePtr pDrawable, + int x, int y, + int width, int height, + unsigned int subWindowMode) { - ScreenPtr pScreen = screenInfo.screens[i]; - CompScreenPtr cs = GetCompScreen (pScreen); + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen (pScreen); - pScreen->BlockHandler = cs->BlockHandler; - compScreenUpdate (pScreen); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + pScreen->SourceValidate = cs->SourceValidate; + if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors) + compPaintChildrenToWindow ((WindowPtr) pDrawable); + if (pScreen->SourceValidate) + (*pScreen->SourceValidate) (pDrawable, x, y, width, height, + subWindowMode); + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; } /* @@ -331,7 +341,6 @@ compScreenInit (ScreenPtr pScreen) if (!cs) return FALSE; - cs->damaged = FALSE; cs->overlayWid = FakeClientID(0); cs->pOverlayWin = NULL; cs->pOverlayClients = NULL; @@ -387,12 +396,17 @@ compScreenInit (ScreenPtr pScreen) cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; pScreen->ChangeWindowAttributes = compChangeWindowAttributes; - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + cs->BlockHandler = NULL; cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; + + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; + dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs); RegisterRealChildHeadProc(CompositeRealChildHead); diff --git a/composite/compint.h b/composite/compint.h index 80083b01d..bb5335d70 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -152,7 +152,6 @@ typedef struct _CompScreen { ScreenBlockHandlerProcPtr BlockHandler; CloseScreenProcPtr CloseScreen; - Bool damaged; int numAlternateVisuals; VisualID *alternateVisuals; @@ -160,6 +159,8 @@ typedef struct _CompScreen { Window overlayWid; CompOverlayClientPtr pOverlayClients; + GetImageProcPtr GetImage; + SourceValidateProcPtr SourceValidate; } CompScreenRec, *CompScreenPtr; extern DevPrivateKeyRec CompScreenPrivateKeyRec; @@ -214,7 +215,10 @@ Bool compAllocPixmap (WindowPtr pWin); void -compFreePixmap (WindowPtr pWin); +compSetParentPixmap (WindowPtr pWin); + +void +compRestoreWindow (WindowPtr pWin, PixmapPtr pPixmap); Bool compReallocPixmap (WindowPtr pWin, int x, int y, @@ -314,7 +318,7 @@ void compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); void -compWindowUpdate (WindowPtr pWin); +compPaintChildrenToWindow (WindowPtr pWin); WindowPtr CompositeRealChildHead (WindowPtr pWin); @@ -326,4 +330,7 @@ int compConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw, WindowPtr pSib); +void PanoramiXCompositeInit (void); +void PanoramiXCompositeReset (void); + #endif /* _COMPINT_H_ */ diff --git a/composite/compoverlay.c b/composite/compoverlay.c index 67b566c7f..047f069ff 100644 --- a/composite/compoverlay.c +++ b/composite/compoverlay.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -48,6 +48,10 @@ #include "compint.h" #include "xace.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + /* * Delete the given overlay client list element from its screen list. */ @@ -128,10 +132,19 @@ compCreateOverlayWindow (ScreenPtr pScreen) WindowPtr pWin; XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */ int result; + int w = pScreen->width; + int h = pScreen->height; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) + { + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif pWin = cs->pOverlayWin = - CreateWindow (cs->overlayWid, pRoot, - 0, 0, pScreen->width, pScreen->height, 0, + CreateWindow (cs->overlayWid, pRoot, 0, 0, w, h, 0, InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0], pRoot->drawable.depth, serverClient, pScreen->rootVisual, &result); diff --git a/composite/compwindow.c b/composite/compwindow.c index 8849dc317..d2a866d6f 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -47,6 +47,10 @@ #include "compint.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + #ifdef COMPOSITE_DEBUG static int compCheckWindow (WindowPtr pWin, pointer data) @@ -160,8 +164,18 @@ compCheckRedirect (WindowPtr pWin) { if (should) return compAllocPixmap (pWin); + else { + ScreenPtr pScreen = pWin->drawable.pScreen; + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + compRestoreWindow (pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); + } + } else if (should) { + if (cw->update == CompositeRedirectAutomatic) + pWin->redirectDraw = RedirectDrawAutomatic; else - compFreePixmap (pWin); + pWin->redirectDraw = RedirectDrawManual; } return TRUE; } @@ -172,16 +186,26 @@ updateOverlayWindow(ScreenPtr pScreen) CompScreenPtr cs; WindowPtr pWin; /* overlay window */ XID vlist[2]; + int w = pScreen->width; + int h = pScreen->height; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) + { + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif cs = GetCompScreen(pScreen); if ((pWin = cs->pOverlayWin) != NULL) { - if ((pWin->drawable.width == pScreen->width) && - (pWin->drawable.height == pScreen->height)) + if ((pWin->drawable.width == w) && + (pWin->drawable.height == h)) return Success; /* Let's resize the overlay window. */ - vlist[0] = pScreen->width; - vlist[1] = pScreen->height; + vlist[0] = w; + vlist[1] = h; return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin)); } @@ -519,7 +543,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionTranslate(prgnSrc, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); - DamageRegionAppend(&pWin->drawable, prgnSrc); + DamageDamageRegion(&pWin->drawable, prgnSrc); } cs->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = compCopyWindow; @@ -569,8 +593,11 @@ compDestroyWindow (WindowPtr pWin) while ((csw = GetCompSubwindows (pWin))) FreeResource (csw->clients->id, RT_NONE); - if (pWin->redirectDraw != RedirectDrawNone) - compFreePixmap (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + (*pScreen->DestroyPixmap) (pPixmap); + } ret = (*pScreen->DestroyWindow) (pWin); cs->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = compDestroyWindow; @@ -598,7 +625,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) /* * Report that as damaged so it will be redrawn */ - DamageRegionAppend(&pWin->drawable, &damage); + DamageDamageRegion(&pWin->drawable, &damage); RegionUninit(&damage); /* * Save the new border clip region @@ -639,9 +666,10 @@ compWindowFormat (WindowPtr pWin) } static void -compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen) +compWindowUpdateAutomatic (WindowPtr pWin) { CompWindowPtr cw = GetCompWindow (pWin); + ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin); PictFormatPtr pSrcFormat = compWindowFormat (pWin); @@ -664,7 +692,8 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen) /* * First move the region from window to screen coordinates */ - RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y); + RegionTranslate(pRegion, + pWin->drawable.x, pWin->drawable.y); /* * Clip against the "real" border clip @@ -674,7 +703,8 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen) /* * Now translate from screen to dest coordinates */ - RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y); + RegionTranslate(pRegion, + -pParent->drawable.x, -pParent->drawable.y); /* * Clip the picture @@ -703,26 +733,35 @@ compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen) DamageEmpty (cw->damage); } -static int -compWindowUpdateVisit(WindowPtr pWin, void *data) +static void +compPaintWindowToParent (WindowPtr pWin) { + compPaintChildrenToWindow (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { - CompWindowPtr cw = GetCompWindow(pWin); + CompWindowPtr cw = GetCompWindow(pWin); + if (cw->damaged) { - compWindowUpdateAutomatic(pWin, data); + compWindowUpdateAutomatic (pWin); cw->damaged = FALSE; } } - - return WT_WALKCHILDREN; } void -compWindowUpdate (WindowPtr pWin) +compPaintChildrenToWindow (WindowPtr pWin) { - TraverseTree(pWin, compWindowUpdateVisit, pWin->drawable.pScreen); + WindowPtr pChild; + + if (!pWin->damagedDescendants) + return; + + for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) + compPaintWindowToParent (pChild); + + pWin->damagedDescendants = FALSE; } WindowPtr diff --git a/config/Makefile.am b/config/Makefile.am index e1f1c4e16..4a2e873db 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -9,8 +9,10 @@ AM_CFLAGS += $(UDEV_CFLAGS) libconfig_la_SOURCES += udev.c libconfig_la_LIBADD = $(UDEV_LIBS) +if XORG xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR) xorgconfd_DATA = 10-evdev.conf +endif else diff --git a/config/hal.c b/config/hal.c index b70488bf3..297520aa6 100644 --- a/config/hal.c +++ b/config/hal.c @@ -63,10 +63,8 @@ device_removed(LibHalContext *ctx, const char *udi) { char *value; - value = malloc(strlen(udi) + 5); /* "hal:" + NULL */ - if (!value) + if (asprintf (&value, "hal:%s", udi) == -1) return; - sprintf(value, "hal:%s", udi); remove_devices("hal", value); @@ -200,7 +198,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) "config/hal: getting usb.product_id on %s " "returned %04x\n", parent, usb_product); if (usb_vendor && usb_product) - attrs.usb_id = Xprintf("%04x:%04x", usb_vendor, usb_product); + if (asprintf(&attrs.usb_id, "%04x:%04x", usb_vendor, usb_product) + == -1) + attrs.usb_id = NULL; free(parent); } @@ -226,12 +226,11 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(&options, "driver", driver); add_option(&options, "name", name); - config_info = malloc(strlen(udi) + 5); /* "hal:" and NULL */ - if (!config_info) { + if (asprintf (&config_info, "hal:%s", udi) == -1) { + config_info = NULL; LogMessage(X_ERROR, "config/hal: couldn't allocate name\n"); goto unwind; } - sprintf(config_info, "hal:%s", udi); /* Check for duplicate devices */ if (device_is_duplicate(config_info)) @@ -376,6 +375,7 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(&options, "xkb_model", xkb_opts.model); if (xkb_opts.options) add_option(&options, "xkb_options", xkb_opts.options); + add_option(&options, "config_info", config_info); /* this isn't an error, but how else do you output something that the user can see? */ LogMessage(X_INFO, "config/hal: Adding input device %s\n", name); @@ -385,11 +385,6 @@ device_added(LibHalContext *hal_ctx, const char *udi) goto unwind; } - for (; dev; dev = dev->next){ - free(dev->config_info); - dev->config_info = strdup(config_info); - } - unwind: if (set) libhal_free_property_set(set); @@ -397,10 +392,10 @@ device_added(LibHalContext *hal_ctx, const char *udi) free(driver); free(name); free(config_info); - while (!dev && (tmpo = options)) { + while ((tmpo = options)) { options = tmpo->next; - free(tmpo->key); - free(tmpo->value); + free(tmpo->key); /* NULL if dev != NULL */ + free(tmpo->value); /* NULL if dev != NULL */ free(tmpo); } diff --git a/config/udev.c b/config/udev.c index b7717c96d..9ac34ee50 100644 --- a/config/udev.c +++ b/config/udev.c @@ -94,6 +94,7 @@ device_added(struct udev_device *udev_device) if (parent) { const char *ppath = udev_device_get_devnode(parent); const char *product = udev_device_get_property_value(parent, "PRODUCT"); + const char *pnp_id = udev_device_get_sysattr_value(parent, "id"); unsigned int usb_vendor, usb_model; name = udev_device_get_sysattr_value(parent, "name"); @@ -103,33 +104,38 @@ device_added(struct udev_device *udev_device) LOG_PROPERTY(ppath, "NAME", name); } - attrs.pnp_id = udev_device_get_sysattr_value(parent, "id"); - LOG_SYSATTR(ppath, "id", attrs.pnp_id); + if (pnp_id) + attrs.pnp_id = strdup(pnp_id); + LOG_SYSATTR(ppath, "id", pnp_id); /* construct USB ID in lowercase hex - "0000:ffff" */ if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) { - attrs.usb_id = Xprintf("%04x:%04x", usb_vendor, usb_model); - if (attrs.usb_id) + if (asprintf(&attrs.usb_id, "%04x:%04x", usb_vendor, usb_model) + == -1) + attrs.usb_id = NULL; + else LOG_PROPERTY(path, "PRODUCT", product); } } if (!name) name = "(unnamed)"; else - attrs.product = name; + attrs.product = strdup(name); add_option(&options, "name", name); add_option(&options, "path", path); add_option(&options, "device", path); - attrs.device = path; + if (path) + attrs.device = strdup(path); tags_prop = udev_device_get_property_value(udev_device, "ID_INPUT.tags"); LOG_PROPERTY(path, "ID_INPUT.tags", tags_prop); attrs.tags = xstrtokenize(tags_prop, ","); - config_info = Xprintf("udev:%s", syspath); - if (!config_info) + if (asprintf(&config_info, "udev:%s", syspath) == -1) { + config_info = NULL; goto unwind; + } if (device_is_duplicate(config_info)) { LogMessage(X_WARNING, "config/udev: device %s already added. " @@ -159,7 +165,7 @@ device_added(struct udev_device *udev_device) add_option(&options, "xkb_options", value); } else if (!strcmp(key, "ID_VENDOR")) { LOG_PROPERTY(path, key, value); - attrs.vendor = value; + attrs.vendor = strdup(value); } else if (!strcmp(key, "ID_INPUT_KEY")) { LOG_PROPERTY(path, key, value); attrs.flags |= ATTR_KEYBOARD; @@ -181,27 +187,28 @@ device_added(struct udev_device *udev_device) } } + add_option(&options, "config_info", config_info); + LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n", name, path); rc = NewInputDeviceRequest(options, &attrs, &dev); if (rc != Success) goto unwind; - for (; dev; dev = dev->next) { - free(dev->config_info); - dev->config_info = strdup(config_info); - } - unwind: free(config_info); - while (!dev && (tmpo = options)) { + while ((tmpo = options)) { options = tmpo->next; - free(tmpo->key); - free(tmpo->value); + free(tmpo->key); /* NULL if dev != NULL */ + free(tmpo->value); /* NULL if dev != NULL */ free(tmpo); } free(attrs.usb_id); + free(attrs.pnp_id); + free(attrs.product); + free(attrs.device); + free(attrs.vendor); if (attrs.tags) { char **tag = attrs.tags; while (*tag) { @@ -220,8 +227,7 @@ device_removed(struct udev_device *device) char *value; const char *syspath = udev_device_get_syspath(device); - value = Xprintf("udev:%s", syspath); - if (!value) + if (asprintf(&value, "udev:%s", syspath) == -1) return; remove_devices("udev", value); @@ -249,6 +255,10 @@ wakeup_handler(pointer data, int err, pointer read_mask) device_added(udev_device); else if (!strcmp(action, "remove")) device_removed(udev_device); + else if (!strcmp(action, "change")) { + device_removed(udev_device); + device_added(udev_device); + } } udev_device_unref(udev_device); } @@ -308,7 +318,7 @@ config_udev_fini(void) udev = udev_monitor_get_udev(udev_monitor); RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor)); - RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, udev_monitor); + RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_unref(udev); diff --git a/config/x11-input.fdi b/config/x11-input.fdi index 9e629cbd0..b263f36cb 100644 --- a/config/x11-input.fdi +++ b/config/x11-input.fdi @@ -45,11 +45,6 @@ See the evdev documentation for more information. - You will probably want to add the following option to the ServerFlags of - your xorg.conf: - - Option "AllowEmptyInput" "True" - FIXME: Support tablets too. TODO: I think its fixed, can't test diff --git a/configure.ac b/configure.ac index d4908d54f..8e8057637 100644 --- a/configure.ac +++ b/configure.ac @@ -26,19 +26,26 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.9.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2010-10-01" +AC_INIT([xorg-server], 1.10.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2011-06-01" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -# Require xorg-macros minimum of 1.10 for XORG_CHECK_SGML_DOCTOOLS +# Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.10) + [m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.14) XORG_DEFAULT_OPTIONS XORG_WITH_DOXYGEN(1.6.1) -XORG_CHECK_SGML_DOCTOOLS(1.5) +XORG_CHECK_SGML_DOCTOOLS(1.7) +XORG_ENABLE_DOCS +XORG_ENABLE_DEVEL_DOCS +XORG_WITH_XMLTO(0.0.20) +XORG_WITH_FOP +XORG_WITH_XSLTPROC +XORG_ENABLE_UNIT_TESTS +XORG_LD_WRAP m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])]) XORG_FONT_MACROS_VERSION(1.1) @@ -64,9 +71,7 @@ dnl version-config.h covers the version numbers so they can be bumped without dnl forcing an entire recompile.x AC_CONFIG_HEADERS(include/version-config.h) -AC_PROG_CC AM_PROG_AS -AC_PROG_INSTALL AC_PROG_LN_S AC_LIBTOOL_WIN32_DLL AC_DISABLE_STATIC @@ -77,7 +82,6 @@ AC_PROG_LEX AC_PROG_YACC AC_SYS_LARGEFILE XORG_PROG_RAWCPP -AC_PROG_SED # Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow # easier overrides at build time. @@ -206,7 +210,7 @@ dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ strtol getopt getopt_long vsnprintf walkcontext backtrace \ - getisax getzoneid shmctl64 strcasestr ffs]) + getisax getzoneid shmctl64 strcasestr ffs vasprintf]) AC_FUNC_ALLOCA dnl Old HAS_* names used in os/*.c. AC_CHECK_FUNC([getdtablesize], @@ -315,19 +319,6 @@ AC_CHECK_HEADER([execinfo.h],[ ])] ) -dnl ARM needs additional compiler flags for proper backtraces if GCC is -dnl used. Compile a dummy program with the -mapcs-frame option. If it -dnl succeeds, we know that we are building for ARM with GCC. -old_CFLAGS="$CFLAGS" -CFLAGS="-mapcs-frame" -AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[ ]]), - ARM_BACKTRACE_CFLAGS="$CFLAGS", - ARM_BACKTRACE_CFLAGS="" -) -CFLAGS="$old_CFLAGS" -AC_SUBST(ARM_BACKTRACE_CFLAGS) - dnl --------------------------------------------------------------------------- dnl Bus options and CPU capabilities. Replaces logic in dnl hw/xfree86/os-support/bus/Makefile.am, among others. @@ -470,9 +461,6 @@ AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debugging (default: disabled)]), [DEBUGGING=$enableval], [DEBUGGING=no]) -AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], - [Enable unit-tests (default: auto)]), - [UNITTESTS=$enableval], [UNITTESTS=auto]) AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), [USE_SIGIO_BY_DEFAULT=$enableval], []) @@ -575,18 +563,17 @@ AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name [ APPLE_APPLICATION_NAME="${withval}" ], [ APPLE_APPLICATION_NAME="X11" ]) AC_SUBST([APPLE_APPLICATION_NAME]) -AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]), - [ LAUNCHD_ID_PREFIX="${withval}" ], - [ LAUNCHD_ID_PREFIX="org.x" ]) -AC_SUBST([LAUNCHD_ID_PREFIX]) -AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers]) +AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]), + [ BUNDLE_ID_PREFIX="${withval}" ], + [ BUNDLE_ID_PREFIX="org.x" ]) +AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]), + [ BUNDLE_ID_PREFIX="${withval}" ]) +AC_SUBST([BUNDLE_ID_PREFIX]) +AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers]) AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]), [ XQUARTZ_SPARKLE="${enableval}" ], [ XQUARTZ_SPARKLE="no" ]) AC_SUBST([XQUARTZ_SPARKLE]) -AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]), - [BUILDDOCS=$enableval], - [BUILDDOCS=no]) AC_ARG_ENABLE(install-libxf86config, AS_HELP_STRING([--enable-install-libxf86config], [Install libxf86config (default: disabled)]), @@ -603,9 +590,20 @@ dnl GLX build options AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), [AIGLX=$enableval], [AIGLX=yes]) -AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]), - [GLX_USE_TLS=$enableval], - [GLX_USE_TLS=no]) +XORG_TLS +AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]), + [GLX_USE_TLS=$enableval + if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then + AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.]) + fi], + [GLX_USE_TLS=no + if test "${ac_cv_tls}" != "none" ; then + GLX_USE_TLS=yes + fi]) +AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) +AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]), + [KHRONOS_SPEC_DIR="${withval}"], + [KHRONOS_SPEC_DIR=auto]) dnl Extensions. AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes]) @@ -627,7 +625,6 @@ AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF8 AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) -AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no]) AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) @@ -642,6 +639,7 @@ AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VB AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) +AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes]) dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) @@ -655,7 +653,7 @@ dnl kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) -AC_ARG_ENABLE(xfakelib, AS_HELP_STRING([--enable-xfakelib], [Build the kdrive-based fakelib (default: auto)]), [XFAKELIB=$enableval], [XFAKELIB=auto]) +AC_ARG_ENABLE(android, AS_HELP_STRING([--enable-android], [Build the Android DDX]), [DDXANDROID=$enableval], [DDXANDROID=auto]) AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) dnl kdrive options AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) @@ -713,12 +711,6 @@ if test "x$INT10" = xyes; then AC_CHECK_HEADERS([sys/vm86.h sys/io.h]) fi -dnl Handle building documentation -AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes) -XORG_ENABLE_DEVEL_DOCS -XORG_WITH_XMLTO(0.0.20) -XORG_WITH_FOP - dnl Handle installing libxf86config AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) @@ -740,9 +732,9 @@ case $host_os in save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -framework Carbon" AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}], - [xorg_cv_Carbon_framework=yes], - [xorg_cv_Carbon_framework=no]) - LDFLAGS=$save_LDFLAGS]) + [xorg_cv_Carbon_framework=yes], + [xorg_cv_Carbon_framework=no]) + LDFLAGS=$save_LDFLAGS]) if test "X$xorg_cv_Carbon_framework" = Xyes; then XQUARTZ=yes @@ -751,6 +743,10 @@ case $host_os in fi fi + AC_CHECK_FUNC(dispatch_async, + AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]), + []) + if test "x$XQUARTZ" = xyes ; then XQUARTZ=yes XVFB=no @@ -782,7 +778,6 @@ DRIPROTO="xf86driproto >= 2.1.0" DRI2PROTO="dri2proto >= 2.3" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" -XCALIBRATEPROTO="xcalibrateproto" DGAPROTO="xf86dgaproto >= 2.0.99.1" GLPROTO="glproto >= 1.4.10" DMXPROTO="dmxproto >= 2.2.99.1" @@ -791,7 +786,7 @@ WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" dnl Core modules for most extensions, et al. -SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.0.99.3] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" +SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc AC_SUBST(SDK_REQUIRED_MODULES) @@ -806,18 +801,17 @@ LIBXFONT="xfont >= 1.4.2" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.8.0" -LIBGLIB="glib-2.0 >= 2.16" LIBUDEV="libudev >= 143" LIBSELINUX="libselinux >= 2.0.86" LIBDBUS="dbus-1 >= 1.0" -LIBPIXMAN="pixman-1 >= 0.15.20" +LIBPIXMAN="pixman-1 >= 0.21.8" dnl Pixman is always required, but we separate it out so we can link dnl specific modules against it PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN) REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau" -REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES" +REQUIRED_MODULES="[fixesproto >= 5.0] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES" if test "x$CONFIG_UDEV" = xyes && { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then @@ -972,7 +966,6 @@ if test "x$COMPOSITE" = xyes; then COMPOSITE_INC='-I$(top_srcdir)/composite' fi -MITSHM=no # test if this is Android until we can fix shm AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) if test "x$MITSHM" = xyes; then AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) @@ -998,6 +991,18 @@ if test "x$RES" = xyes; then REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" fi +# The XRes extension may support client ID tracking only if it has +# been specifically enabled. Client ID tracking is implicitly not +# supported if XRes extension is disabled. +AC_MSG_CHECKING([whether to track client ids]) +if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then + AC_DEFINE(CLIENTIDS, 1, [Support client ID tracking]) +else + CLIENTIDS=no +fi +AC_MSG_RESULT([$CLIENTIDS]) +AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes]) + if test "x$GLX" = xyes; then PKG_CHECK_MODULES([XLIB], [x11]) PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) @@ -1010,14 +1015,16 @@ else fi AM_CONDITIONAL(GLX, test "x$GLX" = xyes) -if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then +if test "x$GLX" = xno; then + AIGLX=no +fi + +if test "x$AIGLX" = xyes -a \( "x$DRI" = xyes -o "x$DRI2" = xyes \); then AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) -else - AIGLX=no fi -AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) +AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI" = xyes || test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes) -if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then +if test "x$GLX_USE_TLS" = xyes ; then GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi @@ -1124,14 +1131,6 @@ if test "x$DPMSExtension" = xyes; then AC_DEFINE(DPMSExtension, 1, [Support DPMS extension]) fi -if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then - AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $XCALIBRATEPROTO" -else - XCALIBRATE=no -fi -AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes]) - AC_DEFINE(RENDER, 1, [Support RENDER extension]) RENDER_LIB='$(top_builddir)/render/librender.la' RENDER_INC='-I$(top_srcdir)/render' @@ -1285,50 +1284,6 @@ if test "x$DEBUGGING" = xyes; then fi AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) -# If unittests aren't explicitly disabled, check for required support -if test "x$UNITTESTS" != xno ; then - PKG_CHECK_MODULES([GLIB], $LIBGLIB, - [HAVE_GLIB=yes], [HAVE_GLIB=no]) - - # Check if linker supports -wrap, passed via compiler flags - # When cross-compiling, reports no, since unit tests run from - # "make check", so would be running on build machine, not target - AC_MSG_CHECKING([whether the linker supports -wrap]) - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,-wrap,exit" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ - void __wrap_exit (int s) - { - __real_exit (0); - }]], - [[exit (1);]])], - [linker_can_wrap="yes"], - [linker_can_wrap="no"], - [linker_can_wrap="no"]) - AC_MSG_RESULT([$linker_can_wrap]) - LDFLAGS="$save_LDFLAGS" -fi - -if test "x$UNITTESTS" = xauto; then - if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then - UNITTESTS=yes - else - UNITTESTS=no - fi -fi -if test "x$UNITTESTS" = xyes; then - if test "x$HAVE_GLIB" = xno; then - AC_MSG_ERROR([glib required to build unit tests]) - fi - if test "x$linker_can_wrap" = xno; then - AC_MSG_ERROR([ld -wrap support required to build unit tests]) - fi - AC_DEFINE(UNITTESTS, 1, [Enable unit tests]) - AC_SUBST([GLIB_LIBS]) - AC_SUBST([GLIB_CFLAGS]) -fi -AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes]) - AC_DEFINE(XTEST, 1, [Support XTest extension]) AC_DEFINE(XSYNC, 1, [Support XSync extension]) AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) @@ -1336,7 +1291,7 @@ AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then DIX_LIB='$(top_builddir)/dix/dix.O' - OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS)' + OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)' else DIX_LIB='$(top_builddir)/dix/libdix.la' OS_LIB='$(top_builddir)/os/libos.la' @@ -1354,6 +1309,8 @@ FB_LIB='$(top_builddir)/fb/libfb.la' FB_INC='-I$(top_srcdir)/fb' MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' +MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync' +MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la' CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' # SHA1 hashing @@ -1493,7 +1450,7 @@ AC_EGREP_CPP([I_AM_SVR4],[ AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4]) AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])) -XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" +XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" dnl --------------------------------------------------------------------------- dnl DDX section. @@ -1506,7 +1463,7 @@ AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" + XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XVFB_LIBS]) AC_SUBST([XVFB_SYS_LIBS]) @@ -1527,7 +1484,7 @@ if test "x$XNEST" = xyes; then if test "x$have_xnest" = xno; then AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) fi - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XNEST_LIBS]) AC_SUBST([XNEST_SYS_LIBS]) @@ -1539,8 +1496,6 @@ dnl Xorg DDX AC_MSG_CHECKING([whether to build Xorg DDX]) if test "x$XORG" = xauto; then XORG="yes" - #FIXME check for android somehow - XORG="no" case $host_os in cygwin*) XORG="no" ;; darwin*) XORG="no" ;; @@ -1557,7 +1512,7 @@ if test "x$XORG" = xyes; then XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB" dnl ================================================================== dnl symbol visibility @@ -1568,7 +1523,6 @@ if test "x$XORG" = xyes; then if test x$GCC = xyes; then VISIBILITY_CFLAGS="-fvisibility=hidden" else - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) if test x$SUNCC = xyes; then VISIBILITY_CFLAGS="-xldscope=hidden" else @@ -1677,7 +1631,6 @@ if test "x$XORG" = xyes; then if test "${OS_MINOR}" -lt 8 ; then AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) fi - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) if test "x$SUNCC" = "xyes"; then solaris_asm_inline="yes" fi @@ -1892,7 +1845,7 @@ if test "x$XWIN" = xyes; then XWIN_SYS_LIBS=-lwinsock2 ;; esac - XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" AC_SUBST(XWIN_LIBS) AC_SUBST(XWIN_SERVER_NAME) @@ -1906,14 +1859,24 @@ if test "x$XWIN" = xyes; then AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) + +dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions + if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then + if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then + PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry]) + KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir` + fi + AC_SUBST(KHRONOS_SPEC_DIR) + fi + fi AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes && false]) +AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes]) +AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) @@ -1922,12 +1885,12 @@ if test "x$XQUARTZ" = xyes; then AC_DEFINE(XQUARTZ,1,[Have Quartz]) AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" + DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" AC_SUBST([DARWIN_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) - CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA" + CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA" PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11) @@ -1955,6 +1918,20 @@ AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) +dnl Android DDX + +AC_MSG_CHECKING([whether to build Android DDX]) +AC_MSG_RESULT([$DDXANDROID]) + +if test "x$DDXANDROID" = xyes; then + AC_DEFINE(DDXANDROID, 1, [Build the Android DDX]) + MITSHM=no # test if this is Android until we can fix shm + + DDXANDROID_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB" + AC_SUBST([DDXANDROID_LIBS]) +fi +AM_CONDITIONAL(DDXANDROID, [test "x$DDXANDROID" = xyes]) + dnl DMX DDX PKG_CHECK_MODULES( [DMXMODULES], @@ -1983,7 +1960,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $OS_LIB $FIXES_LIB" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) @@ -2035,12 +2012,6 @@ if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) fi - if test "x$XFAKELIB" = xyes; then - XFAKELIB=yes - AC_DEFINE(XFAKELIB, 1, [Build kdrive-based fakelib server library]) - AC_DEFINE(DDXOSVERRORF, 1, [Use Android logging facility]) - fi - PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) if test "x$HAVE_TSLIB" = xno; then @@ -2094,13 +2065,13 @@ if test "$KDRIVE" = yes; then # damage shadow extension glx (NOTYET) fb mi KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' - KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" + KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" + KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' case $host_os in *linux*) @@ -2131,14 +2102,8 @@ if test "$KDRIVE" = yes; then KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" - KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB" - - XFAKELIB_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $KDRIVE_PURE_LIBS" - + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" - XFAKELIB_LIBS="$XFAKELIB_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS -llog" - - XFAKELIB_CFLAGS="$CWARNFLAGS $XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" AC_SUBST([XEPHYR_LIBS]) AC_SUBST([XEPHYR_INCS]) @@ -2148,10 +2113,7 @@ AC_SUBST([KDRIVE_PURE_INCS]) AC_SUBST([KDRIVE_CFLAGS]) AC_SUBST([KDRIVE_PURE_LIBS]) AC_SUBST([KDRIVE_LOCAL_LIBS]) -AC_SUBST([XFAKELIB_LOCAL_LIBS]) AC_SUBST([KDRIVE_LIBS]) -AC_SUBST([XFAKELIB_LIBS]) -AC_SUBST([XFAKELIB_CFLAGS]) AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) @@ -2161,7 +2123,6 @@ AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) -AM_CONDITIONAL(XFAKELIB, [test "x$KDRIVE" = xyes && test "x$XFAKELIB" = xyes]) dnl and the rest of these are generic, so they're in config.h dnl @@ -2193,6 +2154,8 @@ AC_SUBST([libdir]) AC_SUBST([exec_prefix]) AC_SUBST([prefix]) +AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/loader/sdksyms.dep]) + AC_OUTPUT([ Makefile glx/Makefile @@ -2202,14 +2165,14 @@ damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile -doc/xml/Makefile -doc/xml/dtrace/Makefile -doc/xml/xserver.ent +doc/dtrace/Makefile +man/Makefile fb/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile +miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/cw/Makefile @@ -2230,16 +2193,16 @@ hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/dixmods/extmod/Makefile hw/xfree86/doc/Makefile -hw/xfree86/doc/devel/Makefile -hw/xfree86/doc/man/Makefile -hw/xfree86/doc/sgml/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/exa/Makefile +hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile +hw/xfree86/fbdevhw/man/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile +hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile @@ -2247,9 +2210,7 @@ hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile -hw/xfree86/os-support/sco/Makefile hw/xfree86/os-support/solaris/Makefile -hw/xfree86/os-support/sysv/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile @@ -2257,35 +2218,44 @@ hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xaa/Makefile -hw/xfree86/xf8_16bpp/Makefile hw/xfree86/utils/Makefile +hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile +hw/dmx/config/man/Makefile hw/dmx/doc/Makefile +hw/dmx/doxygen/doxygen.conf +hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile +hw/dmx/man/Makefile hw/vfb/Makefile +hw/vfb/man/Makefile hw/xnest/Makefile +hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile +hw/xwin/man/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile -hw/xquartz/doc/Makefile +hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile +hw/android/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile +hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile -hw/kdrive/fakelib/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile test/Makefile test/xi2/Makefile +xserver.ent xorg-server.pc ]) diff --git a/cpprules.in b/cpprules.in deleted file mode 100644 index 6e435785a..000000000 --- a/cpprules.in +++ /dev/null @@ -1,49 +0,0 @@ -# -*- Makefile -*- -# Rules for generating files using the C pre-processor -# (Replaces CppFileTarget from Imake) - -SUFFIXES = .pre .man .man.pre - -# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM -# to cpp, because that trick does not work on all ANSI C preprocessors. -# Delete line numbers from the cpp output (-P is not portable, I guess). -# Allow XCOMM to be preceded by whitespace and provide a means of generating -# output lines with trailing backslashes. -# Allow XHASH to always be substituted, even in cases where XCOMM isn't. - -CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \ - -e '/^\#line *[0-9][0-9]* *.*$$/d' \ - -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \ - -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \ - -e '/^[ ]*XHASH/s/XHASH/\#/' \ - -e '/\@\@$$/s/\@\@$$/\\/' - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - XSERVERNAME = Xorg - -MANDEFS = \ - -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ - -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ - -D__appmansuffix__=$(APP_MAN_SUFFIX) \ - -D__filemansuffix__=$(FILE_MAN_SUFFIX) \ - -D__libmansuffix__=$(LIB_MAN_SUFFIX) \ - -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \ - -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \ - -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \ - -D__mandir__=$(mandir) \ - -D__projectroot__=$(prefix) \ - -D__sysconfdir__=$(sysconfdir) \ - -D__datadir__=$(datadir) \ - -D__xconfigfile__=$(__XCONFIGFILE__) \ - -D__xconfigdir__=$(__XCONFIGDIR__) \ - -D__xkbdir__=$(XKB_BASE_DIRECTORY) \ - -D__modulepath__="$(DEFAULT_MODULE_PATH)" \ - -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) - -.pre: - $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ - -.man.pre.man: - $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ diff --git a/damageext/damageext.c b/damageext/damageext.c index f5265ddfc..02db88a8e 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -217,12 +217,13 @@ ProcDamageCreate (ClientPtr client) if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt)) return BadAlloc; + DamageSetReportAfterOp (pDamageExt->pDamage, TRUE); DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage); if (pDrawable->type == DRAWABLE_WINDOW) { pRegion = &((WindowPtr) pDrawable)->borderClip; - DamageRegionAppend(pDrawable, pRegion); + DamageReportDamage(pDamageExt->pDamage, pRegion); } return Success; @@ -292,7 +293,7 @@ ProcDamageAdd (ClientPtr client) * screen coordinates like damage expects. */ RegionTranslate(pRegion, pDrawable->x, pDrawable->y); - DamageRegionAppend(pDrawable, pRegion); + DamageDamageRegion(pDrawable, pRegion); RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); return Success; diff --git a/dbe/dbe.c b/dbe/dbe.c index 77b616b6a..51bbdc6c9 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -690,8 +690,7 @@ ProcDbeGetVisualInfo(ClientPtr client) } count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n; - if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count * - sizeof(XdbeScreenVisualInfo)))) + if (!(pScrVisInfo = calloc(count, sizeof(XdbeScreenVisualInfo)))) { free(pDrawables); @@ -707,21 +706,16 @@ ProcDbeGetVisualInfo(ClientPtr client) pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); - if ((rc != Success) || - !(*pDbeScreenPriv->GetVisualInfo)(pScreen, &pScrVisInfo[i])) + if (rc != Success) + goto freeScrVisInfo; + + if (!(*pDbeScreenPriv->GetVisualInfo)(pScreen, &pScrVisInfo[i])) { /* We failed to alloc pScrVisInfo[i].visinfo. */ + rc = BadAlloc; /* Free visinfos that we allocated for previous screen infos.*/ - for (j = 0; j < i; j++) - { - free(pScrVisInfo[j].visinfo); - } - - /* Free pDrawables if we needed to allocate it above. */ - free(pDrawables); - - return (rc == Success) ? BadAlloc : rc; + goto freeScrVisInfo; } /* Account for n, number of xDbeVisInfo items in list. */ @@ -790,6 +784,9 @@ ProcDbeGetVisualInfo(ClientPtr client) } } + rc = Success; + + freeScrVisInfo: /* Clean up memory. */ for (i = 0; i < count; i++) { @@ -799,7 +796,7 @@ ProcDbeGetVisualInfo(ClientPtr client) free(pDrawables); - return Success; + return rc; } /* ProcDbeGetVisualInfo() */ diff --git a/devbook.am b/devbook.am new file mode 100644 index 000000000..4e23bb78e --- /dev/null +++ b/devbook.am @@ -0,0 +1,62 @@ +# +# Generate output formats for a single DocBook/XML with/without chapters +# +# Variables set by the calling Makefile: +# noinst_DATA: developers docs are not installed +# docbook: the main DocBook/XML file, no chapters, appendix or image files +# chapters: all files pulled in by an XInclude statement and images. +# + +# +# This makefile is intended for Developers Documentation and is not installed. +# Do not use for Users docs or Specs which need to be installed and require olink support +# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 +# for an explanation on documents classification. +# + +# Developers documnetation is not installed +noinst_DATA = + +# DocBook/XML file with chapters, appendix and images it includes +dist_noinst_DATA = $(docbook) $(chapters) + +# +# Generate DocBook/XML output formats with or without stylesheets +# + +# Stylesheets are available if the package xorg-sgml-doctools is installed +if HAVE_STYLESHEETS + +# The location where all cross reference databases are installed +XMLTO_FLAGS = \ + --searchpath "$(XORG_SGML_PATH)/X11" \ + --searchpath "$(abs_top_builddir)" \ + --stringparam current.docid="$(<:.xml=)" + +XMLTO_XHTML_FLAGS = \ + -m $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \ + --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css + +XMLTO_FO_FLAGS = \ + -m $(STYLESHEET_SRCDIR)/xorg-fo.xsl +endif HAVE_STYLESHEETS + +noinst_DATA += $(docbook:.xml=.html) +%.html: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $< + +if HAVE_FOP +noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) +%.pdf: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $< +%.ps: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $< +endif HAVE_FOP + +if HAVE_XMLTO_TEXT +noinst_DATA += $(docbook:.xml=.txt) +%.txt: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $< +endif HAVE_XMLTO_TEXT + +CLEANFILES = $(noinst_DATA) diff --git a/dix/Makefile.am b/dix/Makefile.am index 5e2dad7d3..543554669 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -1,5 +1,6 @@ noinst_LTLIBRARIES = libdix.la libmain.la +AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = $(DIX_CFLAGS) libmain_la_SOURCES = \ @@ -9,7 +10,6 @@ libdix_la_SOURCES = \ atom.c \ colormap.c \ cursor.c \ - deprecated.c \ devices.c \ dispatch.c \ dispatch.h \ diff --git a/dix/Xserver-dtrace.h.in b/dix/Xserver-dtrace.h.in index fce28362a..daf3faf1d 100644 --- a/dix/Xserver-dtrace.h.in +++ b/dix/Xserver-dtrace.h.in @@ -1,4 +1,4 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/dix/Xserver.d b/dix/Xserver.d index 4bc0b9a84..2ad337351 100644 --- a/dix/Xserver.d +++ b/dix/Xserver.d @@ -1,4 +1,4 @@ -/* Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2005-2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/dix/colormap.c b/dix/colormap.c index 2e9a80647..0e1feb6c4 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -1879,6 +1879,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, { for (p = ppixTemp; p < ppixTemp + npix; p++) pmap->red[*p].refcnt = 0; + free(ppixTemp); return BadAlloc; } pmap->clientPixelsRed[client] = ppix; @@ -2104,6 +2105,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, { for (z++ ; z < npixShared; z++) free(ppshared[z]); + free(psharedList); return FALSE; } } diff --git a/dix/cursor.c b/dix/cursor.c index 72a7609dc..c191c1e88 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -241,11 +241,8 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits, *ppCurs = NULL; pCurs = (CursorPtr)calloc(CURSOR_REC_SIZE + CURSOR_BITS_SIZE, 1); if (!pCurs) - { - free(psrcbits); - free(pmaskbits); return BadAlloc; - } + bits = (CursorBitsPtr)((char *)pCurs + CURSOR_REC_SIZE); dixInitPrivates(pCurs, pCurs + 1, PRIVATE_CURSOR); dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS) diff --git a/dix/deprecated.c b/dix/deprecated.c deleted file mode 100644 index 21d0f574d..000000000 --- a/dix/deprecated.c +++ /dev/null @@ -1,165 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "dix.h" -#include "misc.h" -#include "dixstruct.h" - -/* - * These are deprecated compatibility functions and will be marked as such - * and removed soon! - * - * Please use the noted replacements instead. - */ - -/* replaced by dixLookupWindow */ -WindowPtr -SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode) -{ - WindowPtr pWin; - int i = dixLookupWindow(&pWin, id, client, access_mode); - static int warn = 1; - if (warn > 0 && --warn) - ErrorF("Warning: LookupWindow()/SecurityLookupWindow() " - "are deprecated. Please convert your driver/module " - "to use dixLookupWindow().\n"); - return (i == Success) ? pWin : NULL; -} - -/* replaced by dixLookupWindow */ -WindowPtr -LookupWindow(XID id, ClientPtr client) -{ - return SecurityLookupWindow(id, client, DixUnknownAccess); -} - -/* replaced by dixLookupDrawable */ -pointer -SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode) -{ - DrawablePtr pDraw; - int i = dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode); - static int warn = 1; - if (warn > 0 && --warn) - ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() " - "are deprecated. Please convert your driver/module " - "to use dixLookupDrawable().\n"); - return (i == Success) ? pDraw : NULL; -} - -/* replaced by dixLookupDrawable */ -pointer -LookupDrawable(XID id, ClientPtr client) -{ - return SecurityLookupDrawable(id, client, DixUnknownAccess); -} - -/* replaced by dixLookupClient */ -ClientPtr -LookupClient(XID id, ClientPtr client) -{ - ClientPtr pClient; - int i = dixLookupClient(&pClient, id, client, DixUnknownAccess); - static int warn = 1; - if (warn > 0 && --warn) - ErrorF("Warning: LookupClient() is deprecated. Please convert your " - "driver/module to use dixLookupClient().\n"); - return (i == Success) ? pClient : NULL; -} - -/* replaced by dixLookupResourceByType */ -pointer -SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, - Mask access_mode) -{ - pointer retval; - int i = dixLookupResourceByType(&retval, id, rtype, client, access_mode); - static int warn = 1; - if (warn > 0 && --warn) - ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() " - "are deprecated. Please convert your driver/module " - "to use dixLookupResourceByType().\n"); - return (i == Success) ? retval : NULL; -} - -pointer -SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, - Mask access_mode) -{ - pointer retval; - int i = dixLookupResourceByClass(&retval, id, classes, client, access_mode); - static int warn = 1; - if (warn > 0 && --warn) - ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() " - "are deprecated. Please convert your driver/module " - "to use dixLookupResourceByClass().\n"); - return (i == Success) ? retval : NULL; -} - -/* replaced by dixLookupResourceByType */ -pointer -LookupIDByType(XID id, RESTYPE rtype) -{ - pointer val; - dixLookupResourceByType(&val, id, rtype, NullClient, DixUnknownAccess); - return val; -} - -/* replaced by dixLookupResourceByClass */ -pointer -LookupIDByClass(XID id, RESTYPE classes) -{ - pointer val; - dixLookupResourceByClass(&val, id, classes, NullClient, DixUnknownAccess); - return val; -} - -/* end deprecated functions */ diff --git a/dix/devices.c b/dix/devices.c index 7a7bbdf79..0b7809ca8 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -261,8 +261,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) if (!dev) return (DeviceIntPtr)NULL; dev->id = devid; - dev->public.processInputProc = (ProcessInputProc)NoopDDA; - dev->public.realInputProc = (ProcessInputProc)NoopDDA; + dev->public.processInputProc = ProcessOtherEvent; + dev->public.realInputProc = ProcessOtherEvent; dev->public.enqueueInputProc = EnqueueEvent; dev->deviceProc = deviceProc; dev->startup = autoStart; @@ -272,6 +272,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; + XkbSetExtension(dev, ProcessKeyboardEvent); + dev->coreEvents = TRUE; /* sprite defaults */ @@ -444,7 +446,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) { for (other = inputInfo.devices; other; other = other->next) { - if (other->u.master == dev) + if (!IsMaster(other) && GetMaster(other, MASTER_ATTACHED) == dev) { AttachDevice(NULL, other, NULL); flags[other->id] |= XISlaveDetached; @@ -455,8 +457,8 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) { for (other = inputInfo.devices; other; other = other->next) { - if (IsMaster(other) && other->u.lastSlave == dev) - other->u.lastSlave = NULL; + if (IsMaster(other) && other->lastSlave == dev) + other->lastSlave = NULL; } } @@ -664,11 +666,13 @@ CorePointerProc(DeviceIntPtr pDev, int what) void InitCoreDevices(void) { + LogMessage(X_DEFAULT, "[devices] InitCoreDevices"); if (AllocDevicePair(serverClient, "Virtual core", &inputInfo.pointer, &inputInfo.keyboard, CorePointerProc, CoreKeyboardProc, TRUE) != Success) FatalError("Failed to allocate core devices"); + LogMessage(X_DEFAULT, "[devices] InitCoreDevices: %lx", inputInfo.keyboard); if (ActivateDevice(inputInfo.pointer, TRUE) != Success || ActivateDevice(inputInfo.keyboard, TRUE) != Success) @@ -936,6 +940,8 @@ CloseDevice(DeviceIntPtr dev) } free(dev->deviceGrab.sync.event); + free(dev->config_info); /* Allocated in xf86ActivateDevice. */ + dev->config_info = NULL; dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE); } @@ -985,8 +991,8 @@ CloseDownDevices(void) */ for (dev = inputInfo.devices; dev; dev = dev->next) { - if (!IsMaster(dev) && dev->u.master) - dev->u.master = NULL; + if (!IsMaster(dev) && !IsFloating(dev)) + dev->master = NULL; } CloseDeviceList(&inputInfo.devices); @@ -1106,18 +1112,6 @@ NumMotionEvents(void) return inputInfo.pointer->valuator->numMotionEvents; } -void -RegisterPointerDevice(DeviceIntPtr device) -{ - RegisterOtherDevice(device); -} - -void -RegisterKeyboardDevice(DeviceIntPtr device) -{ - RegisterOtherDevice(device); -} - int dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode) { @@ -1229,6 +1223,40 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom* labels, return TRUE; } +/** + * Allocate a valuator class and set up the pointers for the axis values + * appropriately. + * + * @param src If non-NULL, the memory is reallocated from src. If NULL, the + * memory is calloc'd. + * @parma numAxes Number of axes to allocate. + * @return The allocated valuator struct. + */ +ValuatorClassPtr +AllocValuatorClass(ValuatorClassPtr src, int numAxes) +{ + ValuatorClassPtr v; + /* force alignment with double */ + union align_u { ValuatorClassRec valc; double d; } *align; + int size; + + size = sizeof(union align_u) + numAxes * (sizeof(double) + sizeof(AxisInfo)); + align = (union align_u *) realloc(src, size); + + if (!align) + return NULL; + + if (!src) + memset(align, 0, size); + + v = &align->valc; + v->numAxes = numAxes; + v->axisVal = (double*)(align + 1); + v->axes = (AxisInfoPtr)(v->axisVal + numAxes); + + return v; +} + Bool InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, int numMotionEvents, int mode) @@ -1247,11 +1275,9 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, numAxes = MAX_VALUATORS; } - valc = (ValuatorClassPtr)calloc(1, sizeof(ValuatorClassRec) + - numAxes * sizeof(AxisInfo) + - numAxes * sizeof(double)); + valc = AllocValuatorClass(NULL, numAxes); if (!valc) - return FALSE; + return FALSE; valc->sourceid = dev->id; valc->motion = NULL; @@ -1260,17 +1286,17 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, valc->numMotionEvents = numMotionEvents; valc->motionHintWindow = NullWindow; - valc->numAxes = numAxes; - valc->mode = mode; - valc->axes = (AxisInfoPtr)(valc + 1); - valc->axisVal = (double *)(valc->axes + numAxes); + + if (mode & OutOfProximity) + InitProximityClassDeviceStruct(dev); + dev->valuator = valc; AllocateMotionHistory(dev); for (i=0; iaxisVal[i]=0; } @@ -1286,10 +1312,11 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, /* global list of acceleration schemes */ ValuatorAccelerationRec pointerAccelerationScheme[] = { - {PtrAccelNoOp, NULL, NULL, NULL}, - {PtrAccelPredictable, acceleratePointerPredictable, NULL, AccelerationDefaultCleanup}, - {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL}, - {-1, NULL, NULL, NULL} /* terminator */ + {PtrAccelNoOp, NULL, NULL, NULL, NULL}, + {PtrAccelPredictable, acceleratePointerPredictable, NULL, + InitPredictableAccelerationScheme, AccelerationDefaultCleanup}, + {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL}, + {-1, NULL, NULL, NULL, NULL} /* terminator */ }; /** @@ -1301,92 +1328,37 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme) { int x, i = -1; - void* data = NULL; ValuatorClassPtr val; val = dev->valuator; - if(!val) - return FALSE; + if (!val) + return FALSE; - if(IsMaster(dev) && scheme != PtrAccelNoOp) + if (IsMaster(dev) && scheme != PtrAccelNoOp) return FALSE; - for(x = 0; pointerAccelerationScheme[x].number >= 0; x++) { + for (x = 0; pointerAccelerationScheme[x].number >= 0; x++) { if(pointerAccelerationScheme[x].number == scheme){ i = x; break; } } - if(-1 == i) + if (-1 == i) return FALSE; if (val->accelScheme.AccelCleanupProc) val->accelScheme.AccelCleanupProc(dev); - /* init scheme-specific data */ - switch(scheme){ - case PtrAccelPredictable: - { - DeviceVelocityPtr s; - s = malloc(sizeof(DeviceVelocityRec)); - if(!s) - return FALSE; - InitVelocityData(s); - data = s; - break; + if (pointerAccelerationScheme[i].AccelInitProc) { + if (!pointerAccelerationScheme[i].AccelInitProc(dev, + &pointerAccelerationScheme[i])) { + return FALSE; } - default: - break; + } else { + val->accelScheme = pointerAccelerationScheme[i]; } - - val->accelScheme = pointerAccelerationScheme[i]; - val->accelScheme.accelData = data; - - /* post-init scheme */ - switch(scheme){ - case PtrAccelPredictable: - InitializePredictableAccelerationProperties(dev); - break; - - default: - break; - } - - return TRUE; -} - -Bool -InitAbsoluteClassDeviceStruct(DeviceIntPtr dev) -{ - AbsoluteClassPtr abs; - - abs = malloc(sizeof(AbsoluteClassRec)); - if (!abs) - return FALSE; - - /* we don't do anything sensible with these, but should */ - abs->min_x = NO_AXIS_LIMITS; - abs->min_y = NO_AXIS_LIMITS; - abs->max_x = NO_AXIS_LIMITS; - abs->max_y = NO_AXIS_LIMITS; - abs->flip_x = 0; - abs->flip_y = 0; - abs->rotation = 0; - abs->button_threshold = 0; - - abs->offset_x = 0; - abs->offset_y = 0; - abs->width = NO_AXIS_LIMITS; - abs->height = NO_AXIS_LIMITS; - abs->following = 0; - abs->screen = 0; - - abs->sourceid = dev->id; - - dev->absolute = abs; - return TRUE; } @@ -1671,7 +1643,7 @@ ProcChangeKeyboardMapping(ClientPtr client) stuff->keyCodes, NULL, client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if (IsMaster(tmp) || tmp->u.master != pDev) + if (IsMaster(tmp) || GetMaster(tmp, MASTER_KEYBOARD) != pDev) continue; if (!tmp->key) continue; @@ -2334,7 +2306,7 @@ RecalculateMasterButtons(DeviceIntPtr slave) for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsMaster(dev) || - dev->u.master != master || + GetMaster(dev, MASTER_ATTACHED) != master || !dev->button) continue; @@ -2367,8 +2339,7 @@ RecalculateMasterButtons(DeviceIntPtr slave) event.valuators[i].min = master->valuator->axes[i].min_value; event.valuators[i].max = master->valuator->axes[i].max_value; event.valuators[i].resolution = master->valuator->axes[i].resolution; - /* This should, eventually, be a per-axis mode */ - event.valuators[i].mode = master->valuator->mode; + event.valuators[i].mode = master->valuator->axes[i].mode; event.valuators[i].name = master->valuator->axes[i].label; } } @@ -2383,6 +2354,46 @@ RecalculateMasterButtons(DeviceIntPtr slave) } } +/** + * Generate release events for all keys/button currently down on this + * device. + */ +void +ReleaseButtonsAndKeys(DeviceIntPtr dev) +{ + InternalEvent* eventlist = InitEventList(GetMaximumEventsNum()); + ButtonClassPtr b = dev->button; + KeyClassPtr k = dev->key; + int i, j, nevents; + + if (!eventlist) /* no release events for you */ + return; + + /* Release all buttons */ + for (i = 0; b && i < b->numButtons; i++) + { + if (BitIsOn(b->down, i)) + { + nevents = GetPointerEvents(eventlist, dev, ButtonRelease, i, 0, NULL); + for (j = 0; j < nevents; j++) + mieqProcessDeviceEvent(dev, &eventlist[j], NULL); + } + } + + /* Release all keys */ + for (i = 0; k && i < MAP_LENGTH; i++) + { + if (BitIsOn(k->down, i)) + { + nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i, NULL); + for (j = 0; j < nevents; j++) + mieqProcessDeviceEvent(dev, &eventlist[j], NULL); + } + } + + FreeEventList(eventlist, GetMaximumEventsNum()); +} + /** * Attach device 'dev' to device 'master'. * Client is set to the client that issued the request, or NULL if it comes @@ -2405,19 +2416,19 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) return BadDevice; /* set from floating to floating? */ - if (!dev->u.master && !master && dev->enabled) + if (IsFloating(dev) && !master && dev->enabled) return Success; /* free the existing sprite. */ - if (!dev->u.master && dev->spriteInfo->paired == dev) + if (IsFloating(dev) && dev->spriteInfo->paired == dev) { screen = miPointerGetScreen(dev); screen->DeviceCursorCleanup(dev, screen); free(dev->spriteInfo->sprite); } - oldmaster = dev->u.master; - dev->u.master = master; + oldmaster = GetMaster(dev, MASTER_ATTACHED); + dev->master = master; /* If device is set to floating, we need to create a sprite for it, * otherwise things go bad. However, we don't want to render the cursor, @@ -2467,8 +2478,8 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) DeviceIntPtr GetPairedDevice(DeviceIntPtr dev) { - if (!IsMaster(dev) && dev->u.master) - dev = dev->u.master; + if (!IsMaster(dev) && !IsFloating(dev)) + dev = GetMaster(dev, MASTER_ATTACHED); return dev->spriteInfo->paired; } @@ -2481,7 +2492,10 @@ GetPairedDevice(DeviceIntPtr dev) * returned master is either the device itself or the paired master device. * If dev is a floating slave device, NULL is returned. * - * @type ::MASTER_KEYBOARD or ::MASTER_POINTER + * @type ::MASTER_KEYBOARD or ::MASTER_POINTER or ::MASTER_ATTACHED + * @return The requested master device. In the case of MASTER_ATTACHED, this + * is the directly attached master to this device, regardless of the type. + * Otherwise, it is either the master keyboard or pointer for this device. */ DeviceIntPtr GetMaster(DeviceIntPtr dev, int which) @@ -2491,9 +2505,9 @@ GetMaster(DeviceIntPtr dev, int which) if (IsMaster(dev)) master = dev; else - master = dev->u.master; + master = dev->master; - if (master) + if (master && which != MASTER_ATTACHED) { if (which == MASTER_KEYBOARD) { @@ -2532,9 +2546,11 @@ AllocDevicePair (ClientPtr client, char* name, if (!pointer) return BadAlloc; - pointer->name = calloc(strlen(name) + strlen(" pointer") + 1, sizeof(char)); - strcpy(pointer->name, name); - strcat(pointer->name, " pointer"); + if (asprintf(&pointer->name, "%s pointer", name) == -1) { + pointer->name = NULL; + RemoveDevice(pointer, FALSE); + return BadAlloc; + } pointer->public.processInputProc = ProcessOtherEvent; pointer->public.realInputProc = ProcessOtherEvent; @@ -2544,7 +2560,7 @@ AllocDevicePair (ClientPtr client, char* name, pointer->coreEvents = TRUE; pointer->spriteInfo->spriteOwner = TRUE; - pointer->u.lastSlave = NULL; + pointer->lastSlave = NULL; pointer->last.slave = NULL; pointer->type = (master) ? MASTER_POINTER : SLAVE; @@ -2555,9 +2571,12 @@ AllocDevicePair (ClientPtr client, char* name, return BadAlloc; } - keyboard->name = calloc(strlen(name) + strlen(" keyboard") + 1, sizeof(char)); - strcpy(keyboard->name, name); - strcat(keyboard->name, " keyboard"); + if (asprintf(&keyboard->name, "%s keyboard", name) == -1) { + keyboard->name = NULL; + RemoveDevice(keyboard, FALSE); + RemoveDevice(pointer, FALSE); + return BadAlloc; + } keyboard->public.processInputProc = ProcessOtherEvent; keyboard->public.realInputProc = ProcessOtherEvent; @@ -2567,7 +2586,7 @@ AllocDevicePair (ClientPtr client, char* name, keyboard->coreEvents = TRUE; keyboard->spriteInfo->spriteOwner = FALSE; - keyboard->u.lastSlave = NULL; + keyboard->lastSlave = NULL; keyboard->last.slave = NULL; keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE; @@ -2581,3 +2600,25 @@ AllocDevicePair (ClientPtr client, char* name, return Success; } +/** + * Return Relative or Absolute for the device. + */ +int valuator_get_mode(DeviceIntPtr dev, int axis) +{ + return (dev->valuator->axes[axis].mode & DeviceMode); +} + +/** + * Set the given mode for the axis. If axis is VALUATOR_MODE_ALL_AXES, then + * set the mode for all axes. + */ +void valuator_set_mode(DeviceIntPtr dev, int axis, int mode) +{ + if (axis != VALUATOR_MODE_ALL_AXES) + dev->valuator->axes[axis].mode = mode; + else { + int i; + for (i = 0; i < dev->valuator->numAxes; i++) + dev->valuator->axes[i].mode = mode; + } +} diff --git a/dix/dispatch.c b/dix/dispatch.c index b66861f78..192c8c34e 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -75,7 +75,7 @@ Equipment Corporation. ******************************************************************/ /* XSERVER_DTRACE additions: - * Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2005-2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -130,6 +130,7 @@ int ProcInitialConnection(); #include "inputstr.h" #include "xkbsrv.h" #include "site.h" +#include "client.h" #ifdef XSERVER_DTRACE #include "registry.h" @@ -2975,11 +2976,17 @@ ProcCreateCursor (ClientPtr client) &pCursor, client, stuff->cid); if (rc != Success) - return rc; - if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return BadAlloc; + goto bail; + if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) { + rc = BadAlloc; + goto bail; + } return Success; +bail: + free(srcbits); + free(mskbits); + return rc; } int @@ -3459,6 +3466,9 @@ CloseDownClient(ClientPtr client) CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); } FreeClientResources(client); + /* Disable client ID tracking. This must be done after + * ClientStateCallback. */ + ReleaseClientIds(client); #ifdef XSERVER_DTRACE XSERVER_CLIENT_DISCONNECT(client->index); #endif @@ -3496,6 +3506,7 @@ void InitClient(ClientPtr client, int i, pointer ospriv) client->smart_start_tick = SmartScheduleTime; client->smart_stop_tick = SmartScheduleTime; client->smart_check_tick = SmartScheduleTime; + client->clientIds = NULL; } /************************ @@ -3535,6 +3546,11 @@ ClientPtr NextAvailableClient(pointer ospriv) currentMaxClients++; while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) nextFreeClientID++; + + /* Enable client ID tracking. This must be done before + * ClientStateCallback. */ + ReserveClientIds(client); + if (ClientStateCallback) { NewClientInfoRec clientinfo; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index ccb462794..fbac124da 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -66,16 +66,10 @@ Equipment Corporation. #include "dixfont.h" #include "xace.h" -#ifdef DEBUG -#include -#endif - #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" #endif -#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics - extern pointer fosNaturalParams; extern FontPtr defaultFont; @@ -391,14 +385,6 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna int i; FontPtr cached = (FontPtr)0; -#ifdef FONTDEBUG - char *f; - f = malloc(lenfname + 1); - memmove(f, pfontname, lenfname); - f[lenfname] = '\0'; - ErrorF("[dix] OpenFont: fontname is \"%s\"\n", f); - free(f); -#endif if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) return BadName; if (patternCache) @@ -667,7 +653,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ((pointer) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { - if (ClientIsAsleep(client)) + if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr)doListFontsAndAliases, c); @@ -1817,7 +1803,9 @@ SetDefaultFontPath(char *path) start = end; } if (!start) { - temp_path = Xprintf("%s%sbuilt-ins", path, *path ? "," : ""); + if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "") + == -1) + temp_path = NULL; } else { temp_path = strdup(path); } @@ -1827,8 +1815,10 @@ SetDefaultFontPath(char *path) /* get enough for string, plus values -- use up commas */ len = strlen(temp_path) + 1; nump = cp = newpath = malloc(len); - if (!newpath) + if (!newpath) { + free(temp_path); return BadAlloc; + } pp = (unsigned char *) temp_path; cp++; while (*pp) { diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 0f747c1a0..024f2e833 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -97,8 +97,12 @@ EventIsKeyRepeat(xEvent *event) * @return Success or the matching error code. */ int -EventToCore(InternalEvent *event, xEvent *core) +EventToCore(InternalEvent *event, xEvent **core_out, int *count_out) { + xEvent *core = NULL; + int count = 0; + int ret = BadImplementation; + switch(event->any.type) { case ET_Motion: @@ -108,7 +112,10 @@ EventToCore(InternalEvent *event, xEvent *core) * present */ if (!BitIsOn(e->valuators.mask, 0) && !BitIsOn(e->valuators.mask, 1)) - return BadMatch; + { + ret = BadMatch; + goto out; + } } /* fallthrough */ case ET_ButtonPress: @@ -119,9 +126,15 @@ EventToCore(InternalEvent *event, xEvent *core) DeviceEvent *e = &event->device_event; if (e->detail.key > 0xFF) - return BadMatch; - - memset(core, 0, sizeof(xEvent)); + { + ret = BadMatch; + goto out; + } + + core = calloc(1, sizeof(*core)); + if (!core) + return BadAlloc; + count = 1; core->u.u.type = e->type - ET_KeyPress + KeyPress; core->u.u.detail = e->detail.key & 0xFF; core->u.keyButtonPointer.time = e->time; @@ -129,7 +142,10 @@ EventToCore(InternalEvent *event, xEvent *core) core->u.keyButtonPointer.rootY = e->root_y; core->u.keyButtonPointer.state = e->corestate; core->u.keyButtonPointer.root = e->root; - EventSetKeyRepeatFlag(core, (e->type == ET_KeyPress && e->key_repeat)); + EventSetKeyRepeatFlag(core, + (e->type == ET_KeyPress && + e->key_repeat)); + ret = Success; } break; case ET_ProximityIn: @@ -139,13 +155,18 @@ EventToCore(InternalEvent *event, xEvent *core) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: - return BadMatch; + ret = BadMatch; + break; default: /* XXX: */ ErrorF("[dix] EventToCore: Not implemented yet \n"); - return BadImplementation; + ret = BadImplementation; } - return Success; + +out: + *core_out = core; + *count_out = count; + return ret; } /** @@ -261,6 +282,27 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count) } num_events = (countValuators(ev, &first) + 5)/6; /* valuator ev */ + if (num_events <= 0) + { + switch (ev->type) + { + case ET_KeyPress: + case ET_KeyRelease: + case ET_ButtonPress: + case ET_ButtonRelease: + /* no axes is ok */ + break; + case ET_Motion: + case ET_ProximityIn: + case ET_ProximityOut: + *count = 0; + return BadMatch; + default: + *count = 0; + return BadImplementation; + } + } + num_events++; /* the actual event event */ *xi = calloc(num_events, sizeof(xEvent)); @@ -353,27 +395,20 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv) state |= (dev && dev->button) ? (dev->button->state) : 0; } - /* FIXME: non-continuous valuator data in internal events*/ for (i = 0; i < num_valuators; i += 6, xv++) { + INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array + int j; + xv->type = DeviceValuator; xv->first_valuator = first_valuator + i; xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i); xv->deviceid = ev->deviceid; xv->device_state = state; - switch (xv->num_valuators) { - case 6: - xv->valuator5 = ev->valuators.data[xv->first_valuator + 5]; - case 5: - xv->valuator4 = ev->valuators.data[xv->first_valuator + 4]; - case 4: - xv->valuator3 = ev->valuators.data[xv->first_valuator + 3]; - case 3: - xv->valuator2 = ev->valuators.data[xv->first_valuator + 2]; - case 2: - xv->valuator1 = ev->valuators.data[xv->first_valuator + 1]; - case 1: - xv->valuator0 = ev->valuators.data[xv->first_valuator + 0]; - } + + /* Unset valuators in masked valuator events have the proper data values + * in the case of an absolute axis in between two set valuators. */ + for (j = 0; j < xv->num_valuators; j++) + valuators[j] = ev->valuators.data[xv->first_valuator + j]; if (i + 6 < num_valuators) xv->deviceid |= MORE_EVENTS; @@ -440,7 +475,7 @@ appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo *info, int axisnumbe info->value.frac = 0; info->resolution = dce->valuators[axisnumber].resolution; info->number = axisnumber; - info->mode = dce->valuators[axisnumber].mode; /* Server doesn't have per-axis mode yet */ + info->mode = dce->valuators[axisnumber].mode; info->sourceid = dce->sourceid; return info->length * 4; diff --git a/dix/events.c b/dix/events.c index e8cf8d417..b60c29952 100644 --- a/dix/events.c +++ b/dix/events.c @@ -75,7 +75,7 @@ Equipment Corporation. ******************************************************************/ /* - * Copyright © 2003-2005 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2003-2005, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -112,6 +112,7 @@ Equipment Corporation. #include #include "windowstr.h" #include "inputstr.h" +#include "inpututils.h" #include "scrnintstr.h" #include "cursorstr.h" @@ -138,7 +139,6 @@ typedef const char *string; #include #include "exglobals.h" #include "exevents.h" -#include "exglobals.h" #include "extnsionst.h" #include "dixevents.h" @@ -177,12 +177,23 @@ typedef const char *string; #define AllEventMasks (LastEventMask|(LastEventMask-1)) -#define CORE_EVENT(event) \ - (!((event)->u.u.type & EXTENSION_EVENT_BASE) && \ - (event)->u.u.type != GenericEvent) -#define XI2_EVENT(event) \ - (((event)->u.u.type == GenericEvent) && \ - ((xGenericEvent*)(event))->extension == IReqCode) +/* @return the core event type or 0 if the event is not a core event */ +static inline int +core_get_type(const xEvent *event) +{ + int type = event->u.u.type; + + return ((type & EXTENSION_EVENT_BASE) || type == GenericEvent) ? 0 : type; +} + +/* @return the XI2 event type or 0 if the event is not a XI2 event */ +static inline int +xi2_get_type(const xEvent *event) +{ + xGenericEvent* e = (xGenericEvent*)event; + + return (e->type != GenericEvent || e->extension != IReqCode) ? 0 : e->evtype; +} /** * Used to indicate a implicit passive grab created by a ButtonPress event. @@ -195,8 +206,6 @@ typedef const char *string; #define XE_KBPTR (xE->u.keyButtonPointer) -#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) - CallbackListPtr EventCallback; CallbackListPtr DeviceEventCallback; @@ -211,10 +220,6 @@ static void CheckPhysLimits(DeviceIntPtr pDev, Bool generateEvents, Bool confineToScreen, ScreenPtr pScreen); -static Bool CheckPassiveGrabsOnWindow(WindowPtr pWin, - DeviceIntPtr device, - DeviceEvent *event, - BOOL checkCore); /** Key repeat hack. Do not use but in TryClientEvents */ extern BOOL EventIsKeyRepeat(xEvent *event); @@ -258,7 +263,7 @@ EventSyncInfoRec syncEvents; /** * The root window the given device is currently on. */ -#define RootWindow(dev) dev->spriteInfo->sprite->spriteTrace[0] +#define RootWindow(sprite) sprite->spriteTrace[0] static xEvent* swapEvent = NULL; static int swapEventLen = 0; @@ -334,11 +339,12 @@ IsMaster(DeviceIntPtr dev) return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD; } -static WindowPtr XYToWindow( - DeviceIntPtr pDev, - int x, - int y -); +Bool +IsFloating(DeviceIntPtr dev) +{ + return GetMaster(dev, MASTER_KEYBOARD) == NULL; +} + /** * Max event opcode. @@ -351,8 +357,8 @@ extern int DeviceMotionNotify; /** * Event masks for each event type. * - * One set of filters for each device, but only the first layer - * is initialized. The rest is memcpy'd in InitEvents. + * One set of filters for each device, initialized by memcpy of + * default_filter in InitEvents. * * Filters are used whether a given event may be delivered to a client, * usually in the form of if (window-event-mask & filter); then deliver event. @@ -361,7 +367,9 @@ extern int DeviceMotionNotify; * time a button is pressed, the filter is modified to also contain the * matching ButtonXMotion mask. */ -static Mask filters[MAXDEVICES][128] = { +static Mask filters[MAXDEVICES][128]; + +static const Mask default_filter[128] = { NoSuchEvent, /* 0 */ NoSuchEvent, /* 1 */ @@ -398,7 +406,7 @@ static Mask filters[MAXDEVICES][128] = { ColormapChangeMask, /* ColormapNotify */ CantBeFiltered, /* ClientMessage */ CantBeFiltered /* MappingNotify */ -}}; +}; /** * For the given event, return the matching event filter. This filter may then @@ -418,10 +426,12 @@ static Mask filters[MAXDEVICES][128] = { Mask GetEventFilter(DeviceIntPtr dev, xEvent *event) { + int evtype = 0; + if (event->u.u.type != GenericEvent) return filters[dev ? dev->id : 0][event->u.u.type]; - else if (XI2_EVENT(event)) - return (1 << (((xXIDeviceEvent*)event)->evtype % 8)); + else if ((evtype = xi2_get_type(event))) + return (1 << (evtype % 8)); ErrorF("[dix] Unknown device type %d. No filter\n", event->u.u.type); return 0; } @@ -436,7 +446,7 @@ GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev) int filter; int evtype; - if (!inputMasks || !XI2_EVENT(ev)) + if (!inputMasks || xi2_get_type(ev) == 0) return 0; evtype = ((xGenericEvent*)ev)->evtype; @@ -447,17 +457,19 @@ GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev) (inputMasks->xi2mask[XIAllMasterDevices][evtype/8] && IsMaster(dev))); } -static Mask +Mask GetEventMask(DeviceIntPtr dev, xEvent *event, InputClients* other) { + int evtype; + /* XI2 filters are only ever 8 bit, so let's return a 8 bit mask */ - if (XI2_EVENT(event)) + if ((evtype = xi2_get_type(event))) { - int byte = ((xGenericEvent*)event)->evtype / 8; + int byte = evtype / 8; return (other->xi2mask[dev->id][byte] | other->xi2mask[XIAllDevices][byte] | (IsMaster(dev)? other->xi2mask[XIAllMasterDevices][byte] : 0)); - } else if (CORE_EVENT(event)) + } else if (core_get_type(event) != 0) return other->mask[XIAllDevices]; else return other->mask[dev->id]; @@ -563,7 +575,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) if(pWin == screenInfo.screens[0]->root) { int i; - for (i = 0; i < PanoramiXNumScreens; i++) + FOR_NSCREENS(i) pSprite->windows[i] = screenInfo.screens[i]->root; } else { PanoramiXRes *win; @@ -574,7 +586,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) if (rc != Success) return FALSE; - for(i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { rc = dixLookupWindow(pSprite->windows + i, win->info[i].id, serverClient, DixReadAccess); if (rc != Success) /* window is being unmapped */ @@ -881,7 +893,7 @@ CheckVirtualMotion( #ifdef PANORAMIX if (noPanoramiXExtension) /* No typo. Only set the root win if disabled */ #endif - RootWindow(pDev) = pSprite->hot.pScreen->root; + RootWindow(pDev->spriteInfo->sprite) = pSprite->hot.pScreen->root; } static void @@ -1014,7 +1026,7 @@ PostNewCursor(DeviceIntPtr pDev) WindowPtr GetCurrentRootWindow(DeviceIntPtr dev) { - return RootWindow(dev); + return RootWindow(dev->spriteInfo->sprite); } /** @@ -1292,7 +1304,8 @@ ComputeFreezes(void) syncEvents.replayDev = (DeviceIntPtr)NULL; - w = XYToWindow(replayDev, event->root_x, event->root_y); + w = XYToWindow(replayDev->spriteInfo->sprite, + event->root_x, event->root_y); if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin)) { if (replayDev->focus && !IsPointerEvent((InternalEvent*)event)) @@ -1408,10 +1421,10 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) static void DetachFromMaster(DeviceIntPtr dev) { - if (!dev->u.master) + if (!IsFloating(dev)) return; - dev->saved_master_id = dev->u.master->id; + dev->saved_master_id = GetMaster(dev, MASTER_ATTACHED)->id; AttachDevice(NULL, dev, NULL); } @@ -1513,7 +1526,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse) DoEnterLeaveEvents(mouse, mouse->id, grab->window, mouse->spriteInfo->sprite->win, NotifyUngrab); if (grab->confineTo) - ConfineCursorToWindow(mouse, RootWindow(mouse), FALSE, FALSE); + ConfineCursorToWindow(mouse, GetCurrentRootWindow(mouse), FALSE, FALSE); PostNewCursor(mouse); if (grab->cursor) FreeCursor(grab->cursor, (Cursor)0); @@ -1942,6 +1955,159 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, return 1; } +static BOOL +ActivateImplicitGrab(DeviceIntPtr dev, ClientPtr client, WindowPtr win, + xEvent *event, Mask deliveryMask) +{ + GrabRec tempGrab; + OtherInputMasks *inputMasks; + CARD8 type = event->u.u.type; + GrabType grabtype; + + if (type == ButtonPress) + grabtype = GRABTYPE_CORE; + else if (type == DeviceButtonPress) + grabtype = GRABTYPE_XI; + else if ((type = xi2_get_type(event)) == XI_ButtonPress) + grabtype = GRABTYPE_XI2; + else + return FALSE; + + memset(&tempGrab, 0, sizeof(GrabRec)); + tempGrab.next = NULL; + tempGrab.device = dev; + tempGrab.resource = client->clientAsMask; + tempGrab.window = win; + tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; + tempGrab.eventMask = deliveryMask; + tempGrab.keyboardMode = GrabModeAsync; + tempGrab.pointerMode = GrabModeAsync; + tempGrab.confineTo = NullWindow; + tempGrab.cursor = NullCursor; + tempGrab.type = type; + tempGrab.grabtype = grabtype; + + /* get the XI and XI2 device mask */ + inputMasks = wOtherInputMasks(win); + tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[dev->id]: 0; + + if (inputMasks) + memcpy(tempGrab.xi2mask, inputMasks->xi2mask, + sizeof(tempGrab.xi2mask)); + + (*dev->deviceGrab.ActivateGrab)(dev, &tempGrab, + currentTime, TRUE | ImplicitGrabMask); + return TRUE; +} + +enum EventDeliveryState { + EVENT_DELIVERED, /**< Event has been delivered to a client */ + EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */ + EVENT_SKIP, /**< Event can be discarded by the caller */ + EVENT_REJECTED, /**< Event was rejected for delivery to the client */ +}; + +/** + * Attempt event delivery to the client owning the window. + */ +static enum EventDeliveryState +DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win, + xEvent *events, int count, Mask filter, + GrabPtr grab) +{ + /* if nobody ever wants to see this event, skip some work */ + if (filter != CantBeFiltered && + !((wOtherEventMasks(win)|win->eventMask) & filter)) + return EVENT_SKIP; + + if (IsInterferingGrab(wClient(win), dev, events)) + return EVENT_SKIP; + + if (!XaceHook(XACE_RECEIVE_ACCESS, wClient(win), win, events, count)) + { + int attempt = TryClientEvents(wClient(win), dev, events, + count, win->eventMask, + filter, grab); + if (attempt > 0) + return EVENT_DELIVERED; + if (attempt < 0) + return EVENT_REJECTED; + } + + return EVENT_NOT_DELIVERED; +} + +/** + * Deliver events to clients registered on the window. + * + * @param client_return On successful delivery, set to the recipient. + * @param mask_return On successful delivery, set to the recipient's event + * mask for this event. + */ +static enum EventDeliveryState +DeliverEventToClients(DeviceIntPtr dev, WindowPtr win, xEvent *events, + int count, Mask filter, GrabPtr grab, + ClientPtr *client_return, Mask *mask_return) +{ + int attempt; + enum EventDeliveryState rc = EVENT_SKIP; + InputClients *other; + + if (core_get_type(events) != 0) + other = (InputClients *)wOtherClients(win); + else if (xi2_get_type(events) != 0) + { + OtherInputMasks *inputMasks = wOtherInputMasks(win); + /* Has any client selected for the event? */ + if (!GetWindowXI2Mask(dev, win, events)) + goto out; + other = inputMasks->inputClients; + } else { + OtherInputMasks *inputMasks = wOtherInputMasks(win); + /* Has any client selected for the event? */ + if (!inputMasks || + !(inputMasks->inputEvents[dev->id] & filter)) + goto out; + + other = inputMasks->inputClients; + } + + rc = EVENT_NOT_DELIVERED; + + for (; other; other = other->next) + { + Mask mask; + ClientPtr client = rClient(other); + + if (IsInterferingGrab(client, dev, events)) + continue; + + mask = GetEventMask(dev, events, other); + + if (XaceHook(XACE_RECEIVE_ACCESS, client, win, + events, count)) + /* do nothing */; + else if ( (attempt = TryClientEvents(client, dev, + events, count, + mask, filter, grab)) ) + { + if (attempt > 0) + { + rc = EVENT_DELIVERED; + *client_return = client; + *mask_return = mask; + /* Success overrides non-success, so if we've been + * successful on one client, return that */ + } else if (rc == EVENT_NOT_DELIVERED) + rc = EVENT_REJECTED; + } + } + +out: + return rc; +} + + /** * Deliver events to a window. At this point, we do not yet know if the event * actually needs to be delivered. May activate a grab if the event is a @@ -1960,152 +2126,84 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, * @param filter Mask based on event type. * @param grab Possible grab on the device that caused the event. * - * @return Number of events delivered to various clients. + * @return a positive number if at least one successful delivery has been + * made, 0 if no events were delivered, or a negative number if the event + * has not been delivered _and_ rejected by at least one client. */ int DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent *pEvents, int count, Mask filter, GrabPtr grab) { int deliveries = 0, nondeliveries = 0; - int attempt; - InputClients *other; ClientPtr client = NullClient; Mask deliveryMask = 0; /* If a grab occurs due to a button press, then this mask is the mask of the grab. */ int type = pEvents->u.u.type; - /* Deliver to window owner */ - if ((filter == CantBeFiltered) || CORE_EVENT(pEvents)) + if ((filter == CantBeFiltered) || core_get_type(pEvents) != 0) { - /* if nobody ever wants to see this event, skip some work */ - if (filter != CantBeFiltered && - !((wOtherEventMasks(pWin)|pWin->eventMask) & filter)) - return 0; + enum EventDeliveryState rc; - if (IsInterferingGrab(wClient(pWin), pDev, pEvents)) - return 0; + rc = DeliverToWindowOwner(pDev, pWin, pEvents, count, filter, grab); - if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count)) - /* do nothing */; - else if ( (attempt = TryClientEvents(wClient(pWin), pDev, pEvents, - count, pWin->eventMask, - filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = wClient(pWin); - deliveryMask = pWin->eventMask; - } else - nondeliveries--; - } + switch(rc) + { + case EVENT_SKIP: + return 0; + case EVENT_REJECTED: + nondeliveries--; + break; + case EVENT_DELIVERED: + /* We delivered to the owner, with our event mask */ + deliveries++; + client = wClient(pWin); + deliveryMask = pWin->eventMask; + break; + case EVENT_NOT_DELIVERED: + break; + } } /* CantBeFiltered means only window owner gets the event */ if (filter != CantBeFiltered) { - if (CORE_EVENT(pEvents)) - other = (InputClients *)wOtherClients(pWin); - else if (XI2_EVENT(pEvents)) - { - OtherInputMasks *inputMasks = wOtherInputMasks(pWin); - /* Has any client selected for the event? */ - if (!GetWindowXI2Mask(pDev, pWin, pEvents)) - return 0; - other = inputMasks->inputClients; - } else { - OtherInputMasks *inputMasks = wOtherInputMasks(pWin); - /* Has any client selected for the event? */ - if (!inputMasks || - !(inputMasks->inputEvents[pDev->id] & filter)) - return 0; + enum EventDeliveryState rc; - other = inputMasks->inputClients; - } + rc = DeliverEventToClients(pDev, pWin, pEvents, count, filter, grab, + &client, &deliveryMask); - for (; other; other = other->next) + switch(rc) { - Mask mask; - if (IsInterferingGrab(rClient(other), pDev, pEvents)) - continue; - - mask = GetEventMask(pDev, pEvents, other); - - if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, - pEvents, count)) - /* do nothing */; - else if ( (attempt = TryClientEvents(rClient(other), pDev, - pEvents, count, - mask, filter, grab)) ) - { - if (attempt > 0) - { - deliveries++; - client = rClient(other); - deliveryMask = mask; - } else - nondeliveries--; - } + case EVENT_SKIP: + return 0; + case EVENT_REJECTED: + nondeliveries--; + break; + case EVENT_DELIVERED: + deliveries++; + break; + case EVENT_NOT_DELIVERED: + break; } } - /* - * Note that since core events are delivered first, an implicit grab may - * be activated on a core grab, stopping the XI events. - */ - if ((type == DeviceButtonPress || type == ButtonPress || - ((XI2_EVENT(pEvents) && ((xGenericEvent*)pEvents)->evtype == XI_ButtonPress))) - && deliveries - && (!grab)) - { - GrabRec tempGrab; - OtherInputMasks *inputMasks; - - memset(&tempGrab, 0, sizeof(GrabRec)); - tempGrab.next = NULL; - tempGrab.device = pDev; - tempGrab.resource = client->clientAsMask; - tempGrab.window = pWin; - tempGrab.ownerEvents = (deliveryMask & OwnerGrabButtonMask) ? TRUE : FALSE; - tempGrab.eventMask = deliveryMask; - tempGrab.keyboardMode = GrabModeAsync; - tempGrab.pointerMode = GrabModeAsync; - tempGrab.confineTo = NullWindow; - tempGrab.cursor = NullCursor; - tempGrab.type = type; - if (type == ButtonPress) - tempGrab.grabtype = GRABTYPE_CORE; - else if (type == DeviceButtonPress) - tempGrab.grabtype = GRABTYPE_XI; - else - { - tempGrab.type = ((xGenericEvent*)pEvents)->evtype; - tempGrab.grabtype = GRABTYPE_XI2; - } - /* get the XI and XI2 device mask */ - inputMasks = wOtherInputMasks(pWin); - tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0; - - if (inputMasks) - memcpy(tempGrab.xi2mask, inputMasks->xi2mask, - sizeof(tempGrab.xi2mask)); - - (*pDev->deviceGrab.ActivateGrab)(pDev, &tempGrab, - currentTime, TRUE | ImplicitGrabMask); - } - else if ((type == MotionNotify) && deliveries) - pDev->valuator->motionHintWindow = pWin; - else - { - if ((type == DeviceMotionNotify || type == DeviceButtonPress) && - deliveries) - CheckDeviceGrabAndHintWindow (pWin, type, - (deviceKeyButtonPointer*) pEvents, - grab, client, deliveryMask); - } if (deliveries) + { + /* + * Note that since core events are delivered first, an implicit grab may + * be activated on a core grab, stopping the XI events. + */ + if (!grab && ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask)) + /* grab activated */; + else if (type == MotionNotify) + pDev->valuator->motionHintWindow = pWin; + else if (type == DeviceMotionNotify || type == DeviceButtonPress) + CheckDeviceGrabAndHintWindow (pWin, type, + (deviceKeyButtonPointer*) pEvents, + grab, client, deliveryMask); return deliveries; + } return nondeliveries; } @@ -2183,10 +2281,9 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, return 2; } -static Window FindChildForEvent(DeviceIntPtr dev, WindowPtr event) +static Window FindChildForEvent(SpritePtr pSprite, WindowPtr event) { - SpritePtr pSprite = dev->spriteInfo->sprite; - WindowPtr w = pSprite->spriteTrace[pSprite->spriteTraceGood-1]; + WindowPtr w = DeepestSpriteWin(pSprite); Window child = None; /* If the search ends up past the root should the child field be @@ -2224,32 +2321,37 @@ static Window FindChildForEvent(DeviceIntPtr dev, WindowPtr event) */ void FixUpEventFromWindow( - DeviceIntPtr pDev, + SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild) { - SpritePtr pSprite = pDev->spriteInfo->sprite; + int evtype; if (calcChild) - child = FindChildForEvent(pDev, pWin); + child = FindChildForEvent(pSprite, pWin); - if (XI2_EVENT(xE)) + if ((evtype = xi2_get_type(xE))) { xXIDeviceEvent* event = (xXIDeviceEvent*)xE; - if (event->evtype == XI_RawKeyPress || - event->evtype == XI_RawKeyRelease || - event->evtype == XI_RawButtonPress || - event->evtype == XI_RawButtonRelease || - event->evtype == XI_RawMotion || - event->evtype == XI_DeviceChanged || - event->evtype == XI_HierarchyChanged || - event->evtype == XI_PropertyEvent) - return; + switch (evtype) + { + case XI_RawKeyPress: + case XI_RawKeyRelease: + case XI_RawButtonPress: + case XI_RawButtonRelease: + case XI_RawMotion: + case XI_DeviceChanged: + case XI_HierarchyChanged: + case XI_PropertyEvent: + return; + default: + break; + } - event->root = RootWindow(pDev)->drawable.id; + event->root = RootWindow(pSprite)->drawable.id; event->event = pWin->drawable.id; if (pSprite->hot.pScreen == pWin->drawable.pScreen) { @@ -2270,7 +2372,7 @@ FixUpEventFromWindow( } else { - XE_KBPTR.root = RootWindow(pDev)->drawable.id; + XE_KBPTR.root = RootWindow(pSprite)->drawable.id; XE_KBPTR.event = pWin->drawable.id; if (pSprite->hot.pScreen == pWin->drawable.pScreen) { @@ -2291,17 +2393,6 @@ FixUpEventFromWindow( } } -/** - * Return masks for EventIsDeliverable. - * @defgroup EventIsDeliverable return flags - * @{ - */ -#define XI_MASK (1 << 0) /**< XI mask set on window */ -#define CORE_MASK (1 << 1) /**< Core mask set on window */ -#define DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set on window */ -#define XI2_MASK (1 << 3) /**< XI2 mask set on window */ -/* @} */ - /** * Check if a given event is deliverable at all on a given window. * @@ -2312,10 +2403,10 @@ FixUpEventFromWindow( * @param[in] event The event that is to be sent. * @param[in] win The current event window. * - * @return Bitmask of ::XI2_MASK, ::XI_MASK, ::CORE_MASK, and - * ::DONT_PROPAGATE_MASK. + * @return Bitmask of ::EVENT_XI2_MASK, ::EVENT_XI1_MASK, ::EVENT_CORE_MASK, and + * ::EVENT_DONT_PROPAGATE_MASK. */ -static int +int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) { int rc = 0; @@ -2334,7 +2425,7 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) ((inputMasks->xi2mask[XIAllDevices][type/8] & filter) || ((inputMasks->xi2mask[XIAllMasterDevices][type/8] & filter) && IsMaster(dev)) || (inputMasks->xi2mask[dev->id][type/8] & filter))) - rc |= XI2_MASK; + rc |= EVENT_XI2_MASK; type = GetXIType(event); ev.u.u.type = type; @@ -2344,22 +2435,22 @@ EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win) if (type && inputMasks && (inputMasks->deliverableEvents[dev->id] & filter) && (inputMasks->inputEvents[dev->id] & filter)) - rc |= XI_MASK; + rc |= EVENT_XI1_MASK; /* Check for XI DontPropagate mask */ if (type && inputMasks && (inputMasks->dontPropagateMask[dev->id] & filter)) - rc |= DONT_PROPAGATE_MASK; + rc |= EVENT_DONT_PROPAGATE_MASK; /* Check for core mask */ type = GetCoreType(event); if (type && (win->deliverableEvents & filter) && ((wOtherEventMasks(win) | win->eventMask) & filter)) - rc |= CORE_MASK; + rc |= EVENT_CORE_MASK; /* Check for core DontPropagate mask */ if (type && (filter & wDontPropagateMask(win))) - rc |= DONT_PROPAGATE_MASK; + rc |= EVENT_DONT_PROPAGATE_MASK; return rc; } @@ -2387,21 +2478,21 @@ int DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, WindowPtr stopAt, DeviceIntPtr dev) { + SpritePtr pSprite = dev->spriteInfo->sprite; Window child = None; Mask filter; int deliveries = 0; - xEvent core; - xEvent *xE = NULL; + xEvent *xE = NULL, *core = NULL; int rc, mask, count = 0; - CHECKEVENT(event); + verify_internal_event(event); while (pWin) { if ((mask = EventIsDeliverable(dev, event, pWin))) { /* XI2 events first */ - if (mask & XI2_MASK) + if (mask & EVENT_XI2_MASK) { xEvent *xi2 = NULL; rc = EventToXI2(event, &xi2); @@ -2409,7 +2500,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, { /* XXX: XACE */ filter = GetEventFilter(dev, xi2); - FixUpEventFromWindow(dev, xi2, pWin, child, FALSE); + FixUpEventFromWindow(pSprite, xi2, pWin, child, FALSE); deliveries = DeliverEventsToWindow(dev, pWin, xi2, 1, filter, grab); free(xi2); @@ -2421,13 +2512,13 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, } /* XI events */ - if (mask & XI_MASK) + if (mask & EVENT_XI1_MASK) { rc = EventToXI(event, &xE, &count); if (rc == Success) { if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success) { filter = GetEventFilter(dev, xE); - FixUpEventFromWindow(dev, xE, pWin, child, FALSE); + FixUpEventFromWindow(pSprite, xE, pWin, child, FALSE); deliveries = DeliverEventsToWindow(dev, pWin, xE, count, filter, grab); if (deliveries > 0) @@ -2439,15 +2530,15 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, } /* Core event */ - if ((mask & CORE_MASK) && IsMaster(dev) && dev->coreEvents) + if ((mask & EVENT_CORE_MASK) && IsMaster(dev) && dev->coreEvents) { - rc = EventToCore(event, &core); + rc = EventToCore(event, &core, &count); if (rc == Success) { - if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, &core, 1) == Success) { - filter = GetEventFilter(dev, &core); - FixUpEventFromWindow(dev, &core, pWin, child, FALSE); - deliveries = DeliverEventsToWindow(dev, pWin, &core, 1, - filter, grab); + if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, core, count) == Success) { + filter = GetEventFilter(dev, core); + FixUpEventFromWindow(pSprite, core, pWin, child, FALSE); + deliveries = DeliverEventsToWindow(dev, pWin, core, + count, filter, grab); if (deliveries > 0) goto unwind; } @@ -2457,7 +2548,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, } if ((deliveries < 0) || (pWin == stopAt) || - (mask & DONT_PROPAGATE_MASK)) + (mask & EVENT_DONT_PROPAGATE_MASK)) { deliveries = 0; goto unwind; @@ -2469,14 +2560,11 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab, } unwind: + free(core); free(xE); return deliveries; } -#undef XI_MASK -#undef CORE_MASK -#undef DONT_PROPAGATE_MASK - /** * Deliver event to a window and it's immediate parent. Used for most window * events (CreateNotify, ConfigureNotify, etc.). Not useful for events that @@ -2494,9 +2582,8 @@ int DeliverEvents(WindowPtr pWin, xEvent *xE, int count, WindowPtr otherParent) { - Mask filter; - int deliveries; DeviceIntRec dummy; + int deliveries; #ifdef PANORAMIX if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) @@ -2507,11 +2594,42 @@ DeliverEvents(WindowPtr pWin, xEvent *xE, int count, return 0; dummy.id = XIAllDevices; - filter = GetEventFilter(&dummy, xE); - if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) - xE->u.destroyNotify.event = pWin->drawable.id; - if (filter != StructureAndSubMask) - return DeliverEventsToWindow(&dummy, pWin, xE, count, filter, NullGrab); + + switch (xE->u.u.type) + { + case DestroyNotify: + case UnmapNotify: + case MapNotify: + case MapRequest: + case ReparentNotify: + case ConfigureNotify: + case ConfigureRequest: + case GravityNotify: + case CirculateNotify: + case CirculateRequest: + xE->u.destroyNotify.event = pWin->drawable.id; + break; + } + + switch (xE->u.u.type) + { + case DestroyNotify: + case UnmapNotify: + case MapNotify: + case ReparentNotify: + case ConfigureNotify: + case GravityNotify: + case CirculateNotify: + break; + default: + { + Mask filter; + filter = GetEventFilter(&dummy, xE); + return DeliverEventsToWindow(&dummy, pWin, xE, count, filter, + NullGrab); + } + } + deliveries = DeliverEventsToWindow(&dummy, pWin, xE, count, StructureNotifyMask, NullGrab); if (pWin->parent) @@ -2545,7 +2663,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite; int i; - for(i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { if(RegionContainsPoint(&pSprite->windows[i]->borderSize, x + screenInfo.screens[0]->x - screenInfo.screens[i]->x, y + screenInfo.screens[0]->y - screenInfo.screens[i]->y, @@ -2568,16 +2686,14 @@ PointInBorderSize(WindowPtr pWin, int x, int y) * * @returns the window at the given coordinates. */ -static WindowPtr -XYToWindow(DeviceIntPtr pDev, int x, int y) +WindowPtr +XYToWindow(SpritePtr pSprite, int x, int y) { WindowPtr pWin; BoxRec box; - SpritePtr pSprite; - pSprite = pDev->spriteInfo->sprite; pSprite->spriteTraceGood = 1; /* root window still there */ - pWin = RootWindow(pDev)->firstChild; + pWin = RootWindow(pSprite)->firstChild; while (pWin) { if ((pWin->mapped) && @@ -2617,7 +2733,7 @@ XYToWindow(DeviceIntPtr pDev, int x, int y) else pWin = pWin->nextSib; } - return pSprite->spriteTrace[pSprite->spriteTraceGood-1]; + return DeepestSpriteWin(pSprite); } /** @@ -2655,7 +2771,8 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) event.deviceid = dev->id; event.sourceid = dev->id; event.detail.button = 0; - rc = CheckPassiveGrabsOnWindow(win, dev, &event, FALSE); + rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, + TRUE) != NULL); if (rc) DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab); return rc; @@ -2692,10 +2809,10 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) event.deviceid = dev->id; event.sourceid = dev->id; event.detail.button = 0; - rc = CheckPassiveGrabsOnWindow(win, dev, &event, FALSE); + rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, + TRUE) != NULL); if (rc) DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab); - return rc; } @@ -2716,7 +2833,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) WindowPtr prevSpriteWin, newSpriteWin; SpritePtr pSprite = pDev->spriteInfo->sprite; - CHECKEVENT(ev); + verify_internal_event((InternalEvent *)ev); prevSpriteWin = pSprite->win; @@ -2750,7 +2867,8 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen) { pSprite->hot.pScreen = pSprite->hotPhys.pScreen; - RootWindow(pDev) = pSprite->hot.pScreen->root; + RootWindow(pDev->spriteInfo->sprite) = + pSprite->hot.pScreen->root; } } @@ -2789,7 +2907,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) ev->root_y = pSprite->hot.y; } - newSpriteWin = XYToWindow(pDev, pSprite->hot.x, pSprite->hot.y); + newSpriteWin = XYToWindow(pSprite, pSprite->hot.x, pSprite->hot.y); if (newSpriteWin != prevSpriteWin) { @@ -2825,7 +2943,7 @@ WindowsRestructured(void) DeviceIntPtr pDev = inputInfo.devices; while(pDev) { - if (IsMaster(pDev) || !pDev->u.master) + if (IsMaster(pDev) || IsFloating(pDev)) CheckMotion(NULL, pDev); pDev = pDev->next; } @@ -2955,7 +3073,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) FatalError("Failed to allocate spriteTrace"); pSprite->spriteTraceSize = 32; - RootWindow(pDev) = pWin; + RootWindow(pDev->spriteInfo->sprite) = pWin; pSprite->spriteTraceGood = 1; pSprite->pEnqueueScreen = pScreen; @@ -3146,7 +3264,7 @@ XineramaPointInWindowIsVisible( xoff = x + screenInfo.screens[0]->x; yoff = y + screenInfo.screens[0]->y; - for(i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { pWin = inputInfo.pointer->spriteInfo->sprite->windows[i]; x = xoff - screenInfo.screens[i]->x; y = yoff - screenInfo.screens[i]->y; @@ -3256,15 +3374,15 @@ ProcWarpPointer(ClientPtr client) dev = PickPointer(client); for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if ((tmp == dev) || (!IsMaster(tmp) && tmp->u.master == dev)) { + if (GetMaster(tmp, MASTER_ATTACHED) == dev) { rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess); if (rc != Success) return rc; } } - if (dev->u.lastSlave) - dev = dev->u.lastSlave; + if (dev->lastSlave) + dev = dev->lastSlave; pSprite = dev->spriteInfo->sprite; #ifdef PANORAMIX @@ -3353,7 +3471,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) if(!noPanoramiXExtension && XineramaSetWindowPntrs(pDev, pWin)) { int i; - for(i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize)) return TRUE; } @@ -3365,21 +3483,25 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) /** * "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a * passive grab set on the window to be activated. - * If a passive grab is activated, the event will be delivered to the client. + * If activate is true and a passive grab is found, it will be activated, + * and the event will be delivered to the client. * * @param pWin The window that may be subject to a passive grab. * @param device Device that caused the event. * @param event The current device event. * @param checkCore Check for core grabs too. + * @param activate If a grab is found, activate it and deliver the event. */ -static Bool +GrabPtr CheckPassiveGrabsOnWindow( WindowPtr pWin, DeviceIntPtr device, - DeviceEvent *event, - BOOL checkCore) + InternalEvent *event, + BOOL checkCore, + BOOL activate) { + SpritePtr pSprite = device->spriteInfo->sprite; GrabPtr grab = wPassiveGrabs(pWin); GrabRec tempGrab; GrabInfoPtr grabinfo; @@ -3389,12 +3511,25 @@ CheckPassiveGrabsOnWindow( int match = 0; if (!grab) - return FALSE; + return NULL; /* Fill out the grab details, but leave the type for later before * comparing */ + switch (event->any.type) + { + case ET_KeyPress: + case ET_KeyRelease: + tempGrab.detail.exact = event->device_event.detail.key; + break; + case ET_ButtonPress: + case ET_ButtonRelease: + tempGrab.detail.exact = event->device_event.detail.button; + break; + default: + tempGrab.detail.exact = 0; + break; + } tempGrab.window = pWin; tempGrab.device = device; - tempGrab.detail.exact = event->detail.key; tempGrab.detail.pMask = NULL; tempGrab.modifiersDetail.pMask = NULL; tempGrab.next = NULL; @@ -3402,6 +3537,8 @@ CheckPassiveGrabsOnWindow( { DeviceIntPtr gdev; XkbSrvInfoPtr xkbi = NULL; + xEvent *xE = NULL; + int count, rc; gdev= grab->modifierDevice; if (grab->grabtype == GRABTYPE_CORE) @@ -3416,7 +3553,7 @@ CheckPassiveGrabsOnWindow( * attached master keyboard. Since the slave may have been * reattached after the grab, the modifier device may not be the * same. */ - if (!IsMaster(grab->device) && device->u.master) + if (!IsMaster(grab->device) && !IsFloating(device)) gdev = GetMaster(device, MASTER_KEYBOARD); } @@ -3427,17 +3564,16 @@ CheckPassiveGrabsOnWindow( tempGrab.modifiersDetail.exact = xkbi ? xkbi->state.grab_mods : 0; /* Check for XI2 and XI grabs first */ - tempGrab.type = GetXI2Type((InternalEvent*)event); + tempGrab.type = GetXI2Type(event); tempGrab.grabtype = GRABTYPE_XI2; if (GrabMatchesSecond(&tempGrab, grab, FALSE)) match = XI2_MATCH; - tempGrab.detail.exact = event->detail.key; if (!match) { - tempGrab.type = GetXIType((InternalEvent*)event); tempGrab.grabtype = GRABTYPE_XI; - if (GrabMatchesSecond(&tempGrab, grab, FALSE)) + if ((tempGrab.type = GetXIType(event)) && + (GrabMatchesSecond(&tempGrab, grab, FALSE))) match = XI_MATCH; } @@ -3445,125 +3581,136 @@ CheckPassiveGrabsOnWindow( if (!match && checkCore) { tempGrab.grabtype = GRABTYPE_CORE; - if ((tempGrab.type = GetCoreType((InternalEvent*)event)) && + if ((tempGrab.type = GetCoreType(event)) && (GrabMatchesSecond(&tempGrab, grab, TRUE))) match = CORE_MATCH; } - if (match && (!grab->confineTo || - (grab->confineTo->realized && - BorderSizeNotEmpty(device, grab->confineTo)))) - { - int rc, count = 0; - xEvent *xE = NULL; - xEvent core; - - event->corestate &= 0x1f00; - event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00); - grabinfo = &device->deviceGrab; - /* In some cases a passive core grab may exist, but the client - * already has a core grab on some other device. In this case we - * must not get the grab, otherwise we may never ungrab the - * device. - */ - - if (grab->grabtype == GRABTYPE_CORE) + if (!match || (grab->confineTo && + (!grab->confineTo->realized || + !BorderSizeNotEmpty(device, grab->confineTo)))) + continue; + + grabinfo = &device->deviceGrab; + /* In some cases a passive core grab may exist, but the client + * already has a core grab on some other device. In this case we + * must not get the grab, otherwise we may never ungrab the + * device. + */ + + if (grab->grabtype == GRABTYPE_CORE) + { + DeviceIntPtr other; + BOOL interfering = FALSE; + + /* A passive grab may have been created for a different device + than it is assigned to at this point in time. + Update the grab's device and modifier device to reflect the + current state. + Since XGrabDeviceButton requires to specify the + modifierDevice explicitly, we don't override this choice. + */ + if (tempGrab.type < GenericEvent) { - DeviceIntPtr other; - BOOL interfering = FALSE; - - /* A passive grab may have been created for a different device - than it is assigned to at this point in time. - Update the grab's device and modifier device to reflect the - current state. - Since XGrabDeviceButton requires to specify the - modifierDevice explicitly, we don't override this choice. - */ - if (tempGrab.type < GenericEvent) - { - grab->device = device; - grab->modifierDevice = GetPairedDevice(device); - } + grab->device = device; + grab->modifierDevice = GetPairedDevice(device); + } - for (other = inputInfo.devices; other; other = other->next) + for (other = inputInfo.devices; other; other = other->next) + { + GrabPtr othergrab = other->deviceGrab.grab; + if (othergrab && othergrab->grabtype == GRABTYPE_CORE && + SameClient(grab, rClient(othergrab)) && + ((IsPointerDevice(grab->device) && + IsPointerDevice(othergrab->device)) || + (IsKeyboardDevice(grab->device) && + IsKeyboardDevice(othergrab->device)))) { - GrabPtr othergrab = other->deviceGrab.grab; - if (othergrab && othergrab->grabtype == GRABTYPE_CORE && - SameClient(grab, rClient(othergrab)) && - ((IsPointerDevice(grab->device) && - IsPointerDevice(othergrab->device)) || - (IsKeyboardDevice(grab->device) && - IsKeyboardDevice(othergrab->device)))) - { - interfering = TRUE; - break; - } + interfering = TRUE; + break; } - if (interfering) - continue; } + if (interfering) + continue; + } + if (!activate) + { + return grab; + } + else if (!GetXIType(event) && !GetCoreType(event)) + { + ErrorF("Event type %d in CheckPassiveGrabsOnWindow is neither" + " XI 1.x nor core\n", event->any.type); + return NULL; + } + + /* The only consumers of corestate are Xi 1.x and core events, which + * are guaranteed to come from DeviceEvents. */ + if (match & (XI_MATCH | CORE_MATCH)) + { + event->device_event.corestate &= 0x1f00; + event->device_event.corestate |= tempGrab.modifiersDetail.exact & + (~0x1f00); + } - if (match & CORE_MATCH) + if (match & CORE_MATCH) + { + rc = EventToCore(event, &xE, &count); + if (rc != Success) { - rc = EventToCore((InternalEvent*)event, &core); - if (rc != Success) - { - if (rc != BadMatch) - ErrorF("[dix] %s: core conversion failed in CPGFW " - "(%d, %d).\n", device->name, event->type, rc); - continue; - } - xE = &core; - count = 1; - } else if (match & XI2_MATCH) + if (rc != BadMatch) + ErrorF("[dix] %s: core conversion failed in CPGFW " + "(%d, %d).\n", device->name, event->any.type, rc); + continue; + } + } else if (match & XI2_MATCH) + { + rc = EventToXI2(event, &xE); + if (rc != Success) { - rc = EventToXI2((InternalEvent*)event, &xE); - if (rc != Success) - { - if (rc != BadMatch) - ErrorF("[dix] %s: XI2 conversion failed in CPGFW " - "(%d, %d).\n", device->name, event->type, rc); - continue; - } - count = 1; - } else + if (rc != BadMatch) + ErrorF("[dix] %s: XI2 conversion failed in CPGFW " + "(%d, %d).\n", device->name, event->any.type, rc); + continue; + } + count = 1; + } else + { + rc = EventToXI(event, &xE, &count); + if (rc != Success) { - rc = EventToXI((InternalEvent*)event, &xE, &count); - if (rc != Success) - { - if (rc != BadMatch) - ErrorF("[dix] %s: XI conversion failed in CPGFW " - "(%d, %d).\n", device->name, event->type, rc); - continue; - } + if (rc != BadMatch) + ErrorF("[dix] %s: XI conversion failed in CPGFW " + "(%d, %d).\n", device->name, event->any.type, rc); + continue; } + } - (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE); + (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE); - if (xE) - { - FixUpEventFromWindow(device, xE, grab->window, None, TRUE); + if (xE) + { + FixUpEventFromWindow(pSprite, xE, grab->window, None, TRUE); - TryClientEvents(rClient(grab), device, xE, count, - GetEventFilter(device, xE), - GetEventFilter(device, xE), grab); - } + /* XXX: XACE? */ + TryClientEvents(rClient(grab), device, xE, count, + GetEventFilter(device, xE), + GetEventFilter(device, xE), grab); + } - if (grabinfo->sync.state == FROZEN_NO_EVENT) - { - if (!grabinfo->sync.event) - grabinfo->sync.event = calloc(1, sizeof(InternalEvent)); - *grabinfo->sync.event = *event; - grabinfo->sync.state = FROZEN_WITH_EVENT; - } + if (grabinfo->sync.state == FROZEN_NO_EVENT) + { + if (!grabinfo->sync.event) + grabinfo->sync.event = calloc(1, sizeof(DeviceEvent)); + *grabinfo->sync.event = event->device_event; + grabinfo->sync.state = FROZEN_WITH_EVENT; + } - if (match & (XI_MATCH | XI2_MATCH)) - free(xE); /* on core match xE == &core */ - return TRUE; - } + free(xE); + return grab; } - return FALSE; + return NULL; #undef CORE_MATCH #undef XI_MATCH #undef XI2_MATCH @@ -3602,6 +3749,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor) WindowPtr pWin = NULL; FocusClassPtr focus = IsPointerEvent((InternalEvent*)event) ? NULL : device->focus; BOOL sendCore = (IsMaster(device) && device->coreEvents); + Bool ret = FALSE; if (event->type != ET_ButtonPress && event->type != ET_KeyPress) @@ -3621,7 +3769,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor) if (device->spriteInfo->sprite->spriteTrace[i++] == ancestor) break; if (i == device->spriteInfo->sprite->spriteTraceGood) - return FALSE; + goto out; } if (focus) @@ -3629,24 +3777,35 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor) for (; i < focus->traceGood; i++) { pWin = focus->trace[i]; - if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore)) - return TRUE; + if (CheckPassiveGrabsOnWindow(pWin, device, (InternalEvent *) event, + sendCore, TRUE)) + { + ret = TRUE; + goto out; + } } if ((focus->win == NoneWin) || (i >= device->spriteInfo->sprite->spriteTraceGood) || (pWin && pWin != device->spriteInfo->sprite->spriteTrace[i-1])) - return FALSE; + goto out; } for (; i < device->spriteInfo->sprite->spriteTraceGood; i++) { pWin = device->spriteInfo->sprite->spriteTrace[i]; - if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore)) - return TRUE; + if (CheckPassiveGrabsOnWindow(pWin, device, (InternalEvent *) event, + sendCore, TRUE)) + { + ret = TRUE; + goto out; + } } - return FALSE; +out: + if (ret == TRUE && event->type == ET_KeyPress) + device->deviceGrab.activatingKey = event->detail.key; + return ret; } /** @@ -3666,8 +3825,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) DeviceIntPtr ptr; WindowPtr focus = keybd->focus->win; BOOL sendCore = (IsMaster(keybd) && keybd->coreEvents); - xEvent core; - xEvent *xE = NULL, *xi2 = NULL; + xEvent *core = NULL, *xE = NULL, *xi2 = NULL; int count, rc; int deliveries = 0; @@ -3695,7 +3853,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) { /* XXX: XACE */ int filter = GetEventFilter(keybd, xi2); - FixUpEventFromWindow(ptr, xi2, focus, None, FALSE); + FixUpEventFromWindow(ptr->spriteInfo->sprite, xi2, focus, None, FALSE); deliveries = DeliverEventsToWindow(keybd, focus, xi2, 1, filter, NullGrab); if (deliveries > 0) @@ -3708,7 +3866,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) if (rc == Success && XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, xE, count) == Success) { - FixUpEventFromWindow(ptr, xE, focus, None, FALSE); + FixUpEventFromWindow(ptr->spriteInfo->sprite, xE, focus, None, FALSE); deliveries = DeliverEventsToWindow(keybd, focus, xE, count, GetEventFilter(keybd, xE), NullGrab); @@ -3721,12 +3879,13 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) if (sendCore) { - rc = EventToCore(event, &core); + rc = EventToCore(event, &core, &count); if (rc == Success) { - if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, &core, 1) == Success) { - FixUpEventFromWindow(keybd, &core, focus, None, FALSE); - deliveries = DeliverEventsToWindow(keybd, focus, &core, 1, - GetEventFilter(keybd, &core), + if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, core, count) == Success) { + FixUpEventFromWindow(keybd->spriteInfo->sprite, core, focus, + None, FALSE); + deliveries = DeliverEventsToWindow(keybd, focus, core, count, + GetEventFilter(keybd, core), NullGrab); } } else if (rc != BadMatch) @@ -3735,6 +3894,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) } unwind: + free(core); free(xE); free(xi2); return; @@ -3746,8 +3906,10 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window) * grab. If not, TryClientEvents() is used. * * @param deactivateGrab True if the device's grab should be deactivated. + * + * @return The number of events delivered. */ -void +int DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, Bool deactivateGrab) { @@ -3760,6 +3922,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, int rc, count = 0; xEvent *xi = NULL; xEvent *xi2 = NULL; + xEvent *core = NULL; grabinfo = &thisDev->deviceGrab; grab = grabinfo->grab; @@ -3809,23 +3972,20 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, /* try core event */ if (sendCore && grab->grabtype == GRABTYPE_CORE) { - xEvent core; - - rc = EventToCore(event, &core); + rc = EventToCore(event, &core, &count); if (rc == Success) { - FixUpEventFromWindow(thisDev, &core, grab->window, - None, TRUE); + FixUpEventFromWindow(pSprite, core, grab->window, None, TRUE); if (XaceHook(XACE_SEND_ACCESS, 0, thisDev, - grab->window, &core, 1) || + grab->window, core, count) || XaceHook(XACE_RECEIVE_ACCESS, rClient(grab), - grab->window, &core, 1)) + grab->window, core, count)) deliveries = 1; /* don't send, but pretend we did */ - else if (!IsInterferingGrab(rClient(grab), thisDev, &core)) + else if (!IsInterferingGrab(rClient(grab), thisDev, core)) { deliveries = TryClientEvents(rClient(grab), thisDev, - &core, 1, mask, - GetEventFilter(thisDev, &core), + core, count, mask, + GetEventFilter(thisDev, core), grab); } } else if (rc != BadMatch) @@ -3842,7 +4002,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, grab->xi2mask[XIAllMasterDevices][evtype/8] | grab->xi2mask[thisDev->id][evtype/8]; /* try XI2 event */ - FixUpEventFromWindow(thisDev, xi2, grab->window, None, TRUE); + FixUpEventFromWindow(pSprite, xi2, grab->window, None, TRUE); /* XXX: XACE */ deliveries = TryClientEvents(rClient(grab), thisDev, xi2, 1, mask, GetEventFilter(thisDev, xi2), grab); @@ -3863,8 +4023,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, else mask = grab->eventMask; - FixUpEventFromWindow(thisDev, xi, grab->window, - None, TRUE); + FixUpEventFromWindow(pSprite, xi, grab->window, None, TRUE); if (XaceHook(XACE_SEND_ACCESS, 0, thisDev, grab->window, xi, count) || @@ -3893,10 +4052,9 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, switch (grabinfo->sync.state) { case FREEZE_BOTH_NEXT_EVENT: - for (dev = inputInfo.devices; dev; dev = dev->next) + dev = GetPairedDevice(thisDev); + if (dev) { - if (dev == thisDev) - continue; FreezeThaw(dev, TRUE); if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) && (CLIENT_BITS(grab->resource) == @@ -3916,8 +4074,11 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, } } + free(core); free(xi); free(xi2); + + return deliveries; } /* This function is used to set the key pressed or key released state - @@ -4210,7 +4371,7 @@ CoreEnterLeaveEvent( event.u.enterLeave.rootX = mouse->spriteInfo->sprite->hot.x; event.u.enterLeave.rootY = mouse->spriteInfo->sprite->hot.y; /* Counts on the same initial structure of crossing & button events! */ - FixUpEventFromWindow(mouse, &event, pWin, None, FALSE); + FixUpEventFromWindow(mouse->spriteInfo->sprite, &event, pWin, None, FALSE); /* Enter/Leave events always set child */ event.u.enterLeave.child = child; event.u.enterLeave.flags = event.u.keyButtonPointer.sameScreen ? @@ -4298,7 +4459,7 @@ DeviceEnterLeaveEvent( if (BitIsOn(mouse->button->down, i)) SetBit(&event[1], i); - kbd = (IsMaster(mouse) || mouse->u.master) ? GetPairedDevice(mouse) : NULL; + kbd = GetMaster(mouse, MASTER_KEYBOARD); if (kbd && kbd->key) { event->mods.base_mods = kbd->key->xkbInfo->state.base_mods; @@ -4310,7 +4471,8 @@ DeviceEnterLeaveEvent( event->group.locked_group = kbd->key->xkbInfo->state.locked_group; } - FixUpEventFromWindow(mouse, (xEvent*)event, pWin, None, FALSE); + FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent*)event, pWin, + None, FALSE); filter = GetEventFilter(mouse, (xEvent*)event); @@ -4567,7 +4729,8 @@ ProcGrabPointer(ClientPtr client) if (grab) { if (grab->confineTo && !confineTo) - ConfineCursorToWindow(device, RootWindow(device), FALSE, FALSE); + ConfineCursorToWindow(device, GetCurrentRootWindow(device), FALSE, + FALSE); oldCursor = grab->cursor; } @@ -4896,7 +5059,7 @@ ProcQueryPointer(ClientPtr client) rep.mask = mouse->button ? (mouse->button->state) : 0; rep.mask |= XkbStateFieldFromRec(&keyboard->key->xkbInfo->state); rep.length = 0; - rep.root = (RootWindow(mouse))->drawable.id; + rep.root = (GetCurrentRootWindow(mouse))->drawable.id; rep.rootX = pSprite->hot.x; rep.rootY = pSprite->hot.y; rep.child = None; @@ -4958,12 +5121,9 @@ InitEvents(void) inputInfo.off_devices = (DeviceIntPtr)NULL; inputInfo.keyboard = (DeviceIntPtr)NULL; inputInfo.pointer = (DeviceIntPtr)NULL; - /* The mask for pointer motion events may have changed in the last server - * generation. See comment above definition of filters. */ - filters[0][PointerMotionMask] = MotionNotify; - for (i = 1; i < MAXDEVICES; i++) + for (i = 0; i < MAXDEVICES; i++) { - memcpy(&filters[i], filters[0], sizeof(filters[0])); + memcpy(&filters[i], default_filter, sizeof(default_filter)); } syncEvents.replayDev = (DeviceIntPtr)NULL; @@ -4987,8 +5147,7 @@ InitEvents(void) DontPropagateRefCnts[i] = 0; } - InputEventListLen = GetMaximumEventsNum(); - InputEventList = InitEventList(InputEventListLen); + InputEventList = InitEventList(GetMaximumEventsNum()); if (!InputEventList) FatalError("[dix] Failed to allocate input event list.\n"); } @@ -4996,8 +5155,7 @@ InitEvents(void) void CloseDownEvents(void) { - FreeEventList(InputEventList, InputEventListLen); - InputEventListLen = 0; + FreeEventList(InputEventList, GetMaximumEventsNum()); InputEventList = NULL; } @@ -5055,7 +5213,7 @@ ProcSendEvent(ClientPtr client) /* If the input focus is PointerRootWin, send the event to where the pointer is if possible, then perhaps propogate up to root. */ if (inputFocus == PointerRootWin) - inputFocus = RootWindow(dev); + inputFocus = GetCurrentRootWindow(dev); if (IsParent(inputFocus, pSprite->win)) { @@ -5749,7 +5907,7 @@ PickPointer(ClientPtr client) if (!client->clientPtr) { - DeviceIntPtr it = inputInfo.devices; + it = inputInfo.devices; while (it) { if (IsMaster(it) && it->spriteInfo->spriteOwner) diff --git a/dix/extension.c b/dix/extension.c index 6540b64b0..c7bbac5ff 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -353,9 +353,8 @@ ProcListExtensions(ClientPtr client) } WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); if (reply.length) - { WriteToClient(client, total_length, buffer); - free(buffer); - } + + free(buffer); return Success; } diff --git a/dix/getevents.c b/dix/getevents.c index 3731a4a38..13789f6a2 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -46,6 +46,8 @@ #include "mipointer.h" #include "eventstr.h" #include "eventconvert.h" +#include "inpututils.h" +#include "mi.h" #include #include "xkbsrv.h" @@ -60,26 +62,18 @@ #include #include "exglobals.h" #include "exevents.h" -#include "exglobals.h" #include "extnsionst.h" #include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ /* Number of motion history events to store. */ #define MOTION_HISTORY_SIZE 256 -/* InputEventList is the container list for all input events generated by the - * DDX. The DDX is expected to call GetEventList() and then pass the list into - * Get{Pointer|Keyboard}Events. +/** + * InputEventList is the storage for input events generated by + * QueuePointerEvents, QueueKeyboardEvents, and QueueProximityEvents. + * This list is allocated on startup by the DIX. */ -EventListPtr InputEventList = NULL; -int InputEventListLen = 0; - -int -GetEventList(EventListPtr* list) -{ - *list = InputEventList; - return InputEventListLen; -} +InternalEvent* InputEventList = NULL; /** * Pick some arbitrary size for Xi motion history. @@ -111,12 +105,12 @@ set_button_up(DeviceIntPtr pDev, int button, int type) Bool button_is_down(DeviceIntPtr pDev, int button, int type) { - int ret = 0; + Bool ret = FALSE; if (type & BUTTON_PROCESSED) - ret |= !!BitIsOn(pDev->button->down, button); + ret = ret || BitIsOn(pDev->button->down, button); if (type & BUTTON_POSTED) - ret |= !!BitIsOn(pDev->button->postdown, button); + ret = ret || BitIsOn(pDev->button->postdown, button); return ret; } @@ -142,12 +136,12 @@ set_key_up(DeviceIntPtr pDev, int key_code, int type) Bool key_is_down(DeviceIntPtr pDev, int key_code, int type) { - int ret = 0; + Bool ret = FALSE; if (type & KEY_PROCESSED) - ret |= !!BitIsOn(pDev->key->down, key_code); + ret = ret || BitIsOn(pDev->key->down, key_code); if (type & KEY_POSTED) - ret |= !!BitIsOn(pDev->key->postdown, key_code); + ret = ret || BitIsOn(pDev->key->postdown, key_code); return ret; } @@ -184,38 +178,46 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail) } static void -set_raw_valuators(RawDeviceEvent *event, int first, int num, int *valuators, int32_t* data) +set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, int32_t* data) { int i; - for (i = first; i < first + num; i++) - SetBit(event->valuators.mask, i); - memcpy(&data[first], valuators, num * sizeof(uint32_t)); + for (i = 0; i < valuator_mask_size(mask); i++) + { + if (valuator_mask_isset(mask, i)) + { + SetBit(event->valuators.mask, i); + data[i] = valuator_mask_get(mask, i); + } + } } static void -set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator, - int num_valuators, int *valuators) +set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask) { int i; - for (i = first_valuator; i < first_valuator + num_valuators; i++) + /* Set the data to the previous value for unset absolute axes. The values + * may be used when sent as part of an XI 1.x valuator event. */ + for (i = 0; i < valuator_mask_size(mask); i++) { - SetBit(event->valuators.mask, i); - if (dev->valuator->mode == Absolute) - SetBit(event->valuators.mode, i); - event->valuators.data_frac[i] = - dev->last.remainder[i] * (1 << 16) * (1 << 16); + if (valuator_mask_isset(mask, i)) + { + SetBit(event->valuators.mask, i); + if (valuator_get_mode(dev, i) == Absolute) + SetBit(event->valuators.mode, i); + event->valuators.data[i] = valuator_mask_get(mask, i); + event->valuators.data_frac[i] = + dev->last.remainder[i] * (1 << 16) * (1 << 16); + } + else if (valuator_get_mode(dev, i) == Absolute) + event->valuators.data[i] = dev->valuator->axisVal[i]; } - - memcpy(&event->valuators.data[first_valuator], - valuators, num_valuators * sizeof(int32_t)); - } void -CreateClassesChangedEvent(EventList* event, +CreateClassesChangedEvent(InternalEvent* event, DeviceIntPtr master, DeviceIntPtr slave, int type) @@ -224,7 +226,7 @@ CreateClassesChangedEvent(EventList* event, DeviceChangedEvent *dce; CARD32 ms = GetTimeInMillis(); - dce = (DeviceChangedEvent*)event->event; + dce = &event->changed_event; memset(dce, 0, sizeof(DeviceChangedEvent)); dce->deviceid = slave->id; dce->masterid = master->id; @@ -250,8 +252,7 @@ CreateClassesChangedEvent(EventList* event, dce->valuators[i].min = slave->valuator->axes[i].min_value; dce->valuators[i].max = slave->valuator->axes[i].max_value; dce->valuators[i].resolution = slave->valuator->axes[i].resolution; - /* This should, eventually, be a per-axis mode */ - dce->valuators[i].mode = slave->valuator->mode; + dce->valuators[i].mode = slave->valuator->axes[i].mode; dce->valuators[i].name = slave->valuator->axes[i].label; } } @@ -369,8 +370,15 @@ AllocateMotionHistory(DeviceIntPtr pDev) */ if (IsMaster(pDev)) size = sizeof(INT32) * 3 * MAX_VALUATORS; - else - size = sizeof(INT32) * pDev->valuator->numAxes; + else { + ValuatorClassPtr v = pDev->valuator; + int numAxes; + /* XI1 doesn't understand mixed mode devices */ + for (numAxes = 0; numAxes < v->numAxes; numAxes++) + if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0)) + break; + size = sizeof(INT32) * numAxes; + } size += sizeof(Time); @@ -524,12 +532,12 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, * for SDs: [time] [val0] [val1] ... [valn] * for MDs: [time] [min_val0] [max_val0] [val0] [min_val1] ... [valn] * - * For events that have some valuators unset (first_valuator > 0): + * For events that have some valuators unset: * min_val == max_val == val == 0. */ static void -updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, - int num_valuators, int *valuators) +updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask, + int *valuators) { char *buff = (char *) pDev->valuator->motion; ValuatorClassPtr v; @@ -548,17 +556,22 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time); memset(buff, 0, sizeof(INT32) * 3 * MAX_VALUATORS); - buff += 3 * sizeof(INT32) * first_valuator; - for (i = first_valuator; i < first_valuator + num_valuators; i++) + for (i = 0; i < v->numAxes; i++) { - if (i >= v->numAxes) + /* XI1 doesn't support mixed mode devices */ + if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0)) break; + if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) + { + buff += 3 * sizeof(INT32); + continue; + } memcpy(buff, &v->axes[i].min_value, sizeof(INT32)); buff += sizeof(INT32); memcpy(buff, &v->axes[i].max_value, sizeof(INT32)); buff += sizeof(INT32); - memcpy(buff, &valuators[i - first_valuator], sizeof(INT32)); + memcpy(buff, &valuators[i], sizeof(INT32)); buff += sizeof(INT32); } } else @@ -571,9 +584,17 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time); memset(buff, 0, sizeof(INT32) * pDev->valuator->numAxes); - buff += sizeof(INT32) * first_valuator; - memcpy(buff, valuators, sizeof(INT32) * num_valuators); + for (i = 0; i < MAX_VALUATORS; i++) + { + if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i)) + { + buff += sizeof(INT32); + continue; + } + memcpy(buff, &valuators[i], sizeof(INT32)); + buff += sizeof(INT32); + } } pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) % @@ -588,8 +609,8 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, /** - * Returns the maximum number of events GetKeyboardEvents, - * GetKeyboardValuatorEvents, and GetPointerEvents will ever return. + * Returns the maximum number of events GetKeyboardEvents + * and GetPointerEvents will ever return. * * This MUST be absolutely constant, from init until exit. */ @@ -631,13 +652,17 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val) * Clip every axis in the list of valuators to its bounds. */ static void -clipValuators(DeviceIntPtr pDev, int first_valuator, int num_valuators, - int *valuators) +clipValuators(DeviceIntPtr pDev, ValuatorMask *mask) { int i; - for (i = 0; i < num_valuators; i++) - clipAxis(pDev, i + first_valuator, &(valuators[i])); + for (i = 0; i < valuator_mask_size(mask); i++) + if (valuator_mask_isset(mask, i)) + { + int val = valuator_mask_get(mask, i); + clipAxis(pDev, i, &val); + valuator_mask_set(mask, i, val); + } } /** @@ -645,15 +670,15 @@ clipValuators(DeviceIntPtr pDev, int first_valuator, int num_valuators, * is done in the event processing). * Pull in the coordinates from the MD if necessary. * - * @param events Pointer to a pre-allocated event list. + * @param events Pointer to a pre-allocated event array. * @param dev The slave device that generated an event. * @param type Either DEVCHANGE_POINTER_EVENT and/or DEVCHANGE_KEYBOARD_EVENT * @param num_events The current number of events, returns the number of * events if a DCCE was generated. * @return The updated @events pointer. */ -EventListPtr -UpdateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_events) +InternalEvent* +UpdateFromMaster(InternalEvent* events, DeviceIntPtr dev, int type, int *num_events) { DeviceIntPtr master; @@ -680,36 +705,35 @@ UpdateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_event * @param dev The device which's pointer is to be moved. * @param x Returns the x position of the pointer after the move. * @param y Returns the y position of the pointer after the move. - * @param first The first valuator in @valuators - * @param num Total number of valuators in @valuators. + * @param mask Bit mask of valid valuators. * @param valuators Valuator data for each axis between @first and * @first+@num. */ static void -moveAbsolute(DeviceIntPtr dev, int *x, int *y, - int first, int num, int *valuators) +moveAbsolute(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask) { int i; - - if (num >= 1 && first == 0) - *x = *(valuators + 0); + if (valuator_mask_isset(mask, 0)) + *x = valuator_mask_get(mask, 0); else *x = dev->last.valuators[0]; - if (first <= 1 && num >= (2 - first)) - *y = *(valuators + 1 - first); + if (valuator_mask_isset(mask, 1)) + *y = valuator_mask_get(mask, 1); else *y = dev->last.valuators[1]; clipAxis(dev, 0, x); clipAxis(dev, 1, y); - i = (first > 2) ? 0 : 2; - for (; i < num; i++) + for (i = 2; i < valuator_mask_size(mask); i++) { - dev->last.valuators[i + first] = valuators[i]; - clipAxis(dev, i, &dev->last.valuators[i + first]); + if (valuator_mask_isset(mask, i)) + { + dev->last.valuators[i] = valuator_mask_get(mask, i); + clipAxis(dev, i, &dev->last.valuators[i]); + } } } @@ -719,42 +743,44 @@ moveAbsolute(DeviceIntPtr dev, int *x, int *y, * @param dev The device which's pointer is to be moved. * @param x Returns the x position of the pointer after the move. * @param y Returns the y position of the pointer after the move. - * @param first The first valuator in @valuators - * @param num Total number of valuators in @valuators. + * @param mask Bit mask of valid valuators. * @param valuators Valuator data for each axis between @first and * @first+@num. */ static void -moveRelative(DeviceIntPtr dev, int *x, int *y, - int first, int num, int *valuators) +moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask) { int i; *x = dev->last.valuators[0]; *y = dev->last.valuators[1]; - if (num >= 1 && first == 0) - *x += *(valuators +0); + if (valuator_mask_isset(mask, 0)) + *x += valuator_mask_get(mask, 0); - if (first <= 1 && num >= (2 - first)) - *y += *(valuators + 1 - first); + if (valuator_mask_isset(mask, 1)) + *y += valuator_mask_get(mask, 1); /* if attached, clip both x and y to the defined limits (usually * co-ord space limit). If it is attached, we need x/y to go over the * limits to be able to change screens. */ - if(dev->u.master && dev->valuator->mode == Absolute) { - clipAxis(dev, 0, x); - clipAxis(dev, 1, y); + if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) { + if (valuator_get_mode(dev, 0) == Absolute) + clipAxis(dev, 0, x); + if (valuator_get_mode(dev, 1) == Absolute) + clipAxis(dev, 1, y); } /* calc other axes, clip, drop back into valuators */ - i = (first > 2) ? 0 : 2; - for (; i < num; i++) + for (i = 2; i < valuator_mask_size(mask); i++) { - dev->last.valuators[i + first] += valuators[i]; - if (dev->valuator->mode == Absolute) - clipAxis(dev, i, &dev->last.valuators[i + first]); - valuators[i] = dev->last.valuators[i + first]; + if (valuator_mask_isset(mask, i)) + { + dev->last.valuators[i] += valuator_mask_get(mask, i); + if (valuator_get_mode(dev, i) == Absolute) + clipAxis(dev, i, &dev->last.valuators[i]); + valuator_mask_set(mask, i, dev->last.valuators[i]); + } } } @@ -762,17 +788,14 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, * Accelerate the data in valuators based on the device's acceleration scheme. * * @param dev The device which's pointer is to be moved. - * @param first The first valuator in @valuators - * @param num Total number of valuators in @valuators. - * @param valuators Valuator data for each axis between @first and - * @first+@num. + * @param valuators Valuator mask * @param ms Current time. */ static void -accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms) +accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, CARD32 ms) { if (dev->valuator->accelScheme.AccelSchemeProc) - dev->valuator->accelScheme.AccelSchemeProc(dev, first, num, valuators, ms); + dev->valuator->accelScheme.AccelSchemeProc(dev, valuators, ms); } /** @@ -783,7 +806,11 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms) * miPointerSetPosition() and then scale back into device coordinates (if * needed). miPSP will change x/y if the screen was crossed. * + * The coordinates provided are always absolute. The parameter mode whether + * it was relative or absolute movement that landed us at those coordinates. + * * @param dev The device to be moved. + * @param mode Movement mode (Absolute or Relative) * @param x Pointer to current x-axis value, may be modified. * @param y Pointer to current y-axis value, may be modified. * @param x_frac Fractional part of current x-axis value, may be modified. @@ -795,13 +822,14 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms) * @param screeny_frac Fractional part of screen y coordinate, as above. */ static void -positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, +positionSprite(DeviceIntPtr dev, int mode, + int *x, int *y, float x_frac, float y_frac, ScreenPtr scr, int *screenx, int *screeny, float *screenx_frac, float *screeny_frac) { int old_screenx, old_screeny; /* scale x&y to screen */ - if (dev->valuator->numAxes > 0) { + if (dev->valuator && dev->valuator->numAxes > 0) { *screenx = rescaleValuatorAxis(*x, x_frac, screenx_frac, dev->valuator->axes + 0, NULL, scr->width); } else { @@ -809,7 +837,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, *screenx_frac = dev->last.remainder[0]; } - if (dev->valuator->numAxes > 1) { + if (dev->valuator && dev->valuator->numAxes > 1) { *screeny = rescaleValuatorAxis(*y, y_frac, screeny_frac, dev->valuator->axes + 1, NULL, scr->height); } else { @@ -834,27 +862,31 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, old_screeny = *screeny; /* This takes care of crossing screens for us, as well as clipping * to the current screen. */ - miPointerSetPosition(dev, screenx, screeny); + miPointerSetPosition(dev, mode, screenx, screeny); - if (dev->u.master) { - dev->u.master->last.valuators[0] = *screenx; - dev->u.master->last.valuators[1] = *screeny; - dev->u.master->last.remainder[0] = *screenx_frac; - dev->u.master->last.remainder[1] = *screeny_frac; + if(!IsMaster(dev) || !IsFloating(dev)) { + DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); + master->last.valuators[0] = *screenx; + master->last.valuators[1] = *screeny; + master->last.remainder[0] = *screenx_frac; + master->last.remainder[1] = *screeny_frac; } - /* Crossed screen? Scale back to device coordiantes */ - if(*screenx != old_screenx) + if (dev->valuator) { - scr = miPointerGetScreen(dev); - *x = rescaleValuatorAxis(*screenx, *screenx_frac, &x_frac, NULL, - dev->valuator->axes + 0, scr->width); - } - if(*screeny != old_screeny) - { - scr = miPointerGetScreen(dev); - *y = rescaleValuatorAxis(*screeny, *screeny_frac, &y_frac, NULL, - dev->valuator->axes + 1, scr->height); + /* Crossed screen? Scale back to device coordiantes */ + if(*screenx != old_screenx) + { + scr = miPointerGetScreen(dev); + *x = rescaleValuatorAxis(*screenx, *screenx_frac, &x_frac, NULL, + dev->valuator->axes + 0, scr->width); + } + if(*screeny != old_screeny) + { + scr = miPointerGetScreen(dev); + *y = rescaleValuatorAxis(*screeny, *screeny_frac, &y_frac, NULL, + dev->valuator->axes + 1, scr->height); + } } /* dropy x/y (device coordinates) back into valuators for next event */ @@ -868,55 +900,79 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, * Update the motion history for the device and (if appropriate) for its * master device. * @param dev Slave device to update. - * @param first First valuator to append to history. + * @param mask Bit mask of valid valuators to append to history. * @param num Total number of valuators to append to history. * @param ms Current time */ static void -updateHistory(DeviceIntPtr dev, int first, int num, CARD32 ms) +updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms) { - updateMotionHistory(dev, ms, first, num, &dev->last.valuators[first]); - if (dev->u.master) + if (!dev->valuator) + return; + + updateMotionHistory(dev, ms, mask, dev->last.valuators); + if(!IsMaster(dev) || !IsFloating(dev)) { DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); - updateMotionHistory(master, ms, first, num, &dev->last.valuators[first]); + updateMotionHistory(master, ms, mask, dev->last.valuators); } } +static void +queueEventList(DeviceIntPtr device, InternalEvent *events, int nevents) +{ + int i; + for (i = 0; i < nevents; i++) + mieqEnqueue(device, &events[i]); +} + /** - * Convenience wrapper around GetKeyboardValuatorEvents, that takes no - * valuators. + * Generate internal events representing this keyboard event and enqueue + * them on the event queue. + * + * This function is not reentrant. Disable signals before calling. + * + * FIXME: flags for relative/abs motion? + * + * @param device The device to generate the event for + * @param type Event type, one of KeyPress or KeyRelease + * @param keycode Key code of the pressed/released key + * @param mask Valuator mask for valuators present for this event. + * */ -int -GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) { - return GetKeyboardValuatorEvents(events, pDev, type, key_code, 0, 0, NULL); -} +void +QueueKeyboardEvents(DeviceIntPtr device, int type, + int keycode, const ValuatorMask *mask) +{ + int nevents; + nevents = GetKeyboardEvents(InputEventList, device, type, keycode, mask); + queueEventList(device, InputEventList, nevents); +} /** * Returns a set of InternalEvents for KeyPress/KeyRelease, optionally * also with valuator events. * - * events is not NULL-terminated; the return value is the number of events. - * The DDX is responsible for allocating the event structure in the first - * place via GetMaximumEventsNum(), and for freeing it. + * The DDX is responsible for allocating the event list in the first + * place via InitEventList(), and for freeing it. + * + * @return the number of events written into events. */ int -GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, - int key_code, int first_valuator, - int num_valuators, int *valuators_in) { +GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, + int key_code, const ValuatorMask *mask_in) { int num_events = 0; CARD32 ms = 0; DeviceEvent *event; RawDeviceEvent *raw; - int valuators[MAX_VALUATORS]; + ValuatorMask mask; /* refuse events from disabled devices */ if (!pDev->enabled) return 0; if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed || - num_valuators > MAX_VALUATORS || (type != KeyPress && type != KeyRelease) || (key_code < 8 || key_code > 255)) return 0; @@ -937,23 +993,20 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, ms = GetTimeInMillis(); - raw = (RawDeviceEvent*)events->event; + raw = &events->raw_event; events++; num_events++; - memcpy(valuators, valuators_in, num_valuators * sizeof(int)); + valuator_mask_copy(&mask, mask_in); init_raw(pDev, raw, ms, type, key_code); - set_raw_valuators(raw, first_valuator, num_valuators, valuators, - raw->valuators.data_raw); + set_raw_valuators(raw, &mask, raw->valuators.data_raw); - if (num_valuators) - clipValuators(pDev, first_valuator, num_valuators, valuators); + clipValuators(pDev, &mask); - set_raw_valuators(raw, first_valuator, num_valuators, valuators, - raw->valuators.data); + set_raw_valuators(raw, &mask, raw->valuators.data); - event = (DeviceEvent*) events->event; + event = &events->device_event; init_event(pDev, event, ms); event->detail.key = key_code; @@ -966,46 +1019,24 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, set_key_up(pDev, key_code, KEY_POSTED); } - if (num_valuators) - clipValuators(pDev, first_valuator, num_valuators, valuators); + clipValuators(pDev, &mask); - set_valuators(pDev, event, first_valuator, num_valuators, valuators); + set_valuators(pDev, event, &mask); return num_events; } /** - * Initialize an event list and fill with 32 byte sized events. + * Initialize an event array large enough for num_events arrays. * This event list is to be passed into GetPointerEvents() and * GetKeyboardEvents(). * * @param num_events Number of elements in list. */ -EventListPtr +InternalEvent* InitEventList(int num_events) { - EventListPtr events; - int i; - - events = (EventListPtr)calloc(num_events, sizeof(EventList)); - if (!events) - return NULL; - - for (i = 0; i < num_events; i++) - { - events[i].evlen = sizeof(InternalEvent); - events[i].event = calloc(1, sizeof(InternalEvent)); - if (!events[i].event) - { - /* rollback */ - while(i--) - free(events[i].event); - free(events); - events = NULL; - break; - } - } - + InternalEvent *events = calloc(num_events, sizeof(InternalEvent)); return events; } @@ -1016,37 +1047,50 @@ InitEventList(int num_events) * @param num_events Number of elements in list. */ void -FreeEventList(EventListPtr list, int num_events) +FreeEventList(InternalEvent *list, int num_events) { - if (!list) - return; - while(num_events--) - free(list[num_events].event); free(list); } static void -transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS]) +transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask, int *x, int *y) { - struct pixman_f_vector p; - - /* p' = M * p in homogeneous coordinates */ - p.v[0] = v[0]; - p.v[1] = v[1]; - p.v[2] = 1.0; + struct pixman_f_vector p = {.v = {*x, *y, 1}}; pixman_f_transform_point(&dev->transform, &p); - v[0] = lround(p.v[0]); - v[1] = lround(p.v[1]); + *x = lround(p.v[0]); + *y = lround(p.v[1]); } /** - * Generate a series of InternalEvents (filled into the EventList) - * representing pointer motion, or button presses. + * Generate internal events representing this pointer event and enqueue them + * on the event queue. + * + * This function is not reentrant. Disable signals before calling. * - * events is not NULL-terminated; the return value is the number of events. - * The DDX is responsible for allocating the event structure in the first + * @param device The device to generate the event for + * @param type Event type, one of ButtonPress, ButtonRelease, MotionNotify + * @param buttons Button number of the buttons modified. Must be 0 for + * MotionNotify + * @param flags Event modification flags + * @param mask Valuator mask for valuators present for this event. + */ +void +QueuePointerEvents(DeviceIntPtr device, int type, + int buttons, int flags, const ValuatorMask *mask) +{ + int nevents; + + nevents = GetPointerEvents(InputEventList, device, type, buttons, flags, mask); + queueEventList(device, InputEventList, nevents); +} + +/** + * Generate a series of InternalEvents representing pointer motion, or + * button presses. + * + * The DDX is responsible for allocating the events in the first * place via InitEventList() and GetMaximumEventsNum(), and for freeing it. * * In the generated events rootX/Y will be in absolute screen coords and @@ -1056,11 +1100,12 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS]) * last.valuators[x] of the master device is in absolute screen coords. * * master->last.valuators[x] for x > 2 is undefined. + * + * @return the number of events written into events. */ int -GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, - int flags, int first_valuator, int num_valuators, - int *valuators_in) { +GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, + int flags, const ValuatorMask *mask_in) { int num_events = 1; CARD32 ms; DeviceEvent *event; @@ -1069,79 +1114,104 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, cx, cy; /* only screen coordinates */ float x_frac = 0.0, y_frac = 0.0, cx_frac, cy_frac; ScreenPtr scr = miPointerGetScreen(pDev); - int valuators[MAX_VALUATORS]; + ValuatorMask mask; /* refuse events from disabled devices */ if (!pDev->enabled) return 0; - ms = GetTimeInMillis(); /* before pointer update to help precision */ - - if (!scr || !pDev->valuator || first_valuator < 0 || - num_valuators > MAX_VALUATORS || - ((num_valuators + first_valuator) > pDev->valuator->numAxes) || - (type != MotionNotify && type != ButtonPress && type != ButtonRelease) || - (type != MotionNotify && !pDev->button) || - ((type == ButtonPress || type == ButtonRelease) && !buttons) || - (type == MotionNotify && num_valuators <= 0)) + if (!scr) return 0; + switch (type) + { + case MotionNotify: + if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0) + return 0; + break; + case ButtonPress: + case ButtonRelease: + if (!pDev->button || !buttons) + return 0; + break; + default: + return 0; + } + + ms = GetTimeInMillis(); /* before pointer update to help precision */ + events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); - raw = (RawDeviceEvent*)events->event; + raw = &events->raw_event; events++; num_events++; - memcpy(valuators, valuators_in, num_valuators * sizeof(int)); + valuator_mask_copy(&mask, mask_in); init_raw(pDev, raw, ms, type, buttons); - set_raw_valuators(raw, first_valuator, num_valuators, valuators, - raw->valuators.data_raw); + set_raw_valuators(raw, &mask, raw->valuators.data_raw); if (flags & POINTER_ABSOLUTE) { if (flags & POINTER_SCREEN) /* valuators are in screen coords */ { + int scaled; - if (num_valuators >= 1 && first_valuator == 0) - valuators[0] = rescaleValuatorAxis(valuators[0], 0.0, &x_frac, NULL, - pDev->valuator->axes + 0, - scr->width); - if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) - valuators[1 - first_valuator] = rescaleValuatorAxis(valuators[1 - first_valuator], 0.0, &y_frac, NULL, - pDev->valuator->axes + 1, - scr->height); + if (valuator_mask_isset(&mask, 0)) + { + scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0), + 0.0, &x_frac, NULL, + pDev->valuator->axes + 0, + scr->width); + valuator_mask_set(&mask, 0, scaled); + } + if (valuator_mask_isset(&mask, 1)) + { + scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 1), + 0.0, &y_frac, NULL, + pDev->valuator->axes + 1, + scr->height); + valuator_mask_set(&mask, 1, scaled); + } } - transformAbsolute(pDev, valuators); - moveAbsolute(pDev, &x, &y, first_valuator, num_valuators, valuators); + x = (valuator_mask_isset(&mask, 0) ? valuator_mask_get(&mask, 0) : + pDev->last.valuators[0]); + y = (valuator_mask_isset(&mask, 1) ? valuator_mask_get(&mask, 1) : + pDev->last.valuators[1]); + transformAbsolute(pDev, &mask, &x, &y); + if (valuator_mask_isset(&mask, 0)) + valuator_mask_set(&mask, 0, x); + if (valuator_mask_isset(&mask, 1)) + valuator_mask_set(&mask, 1, y); + + moveAbsolute(pDev, &x, &y, &mask); } else { if (flags & POINTER_ACCELERATE) { - accelPointer(pDev, first_valuator, num_valuators, valuators, ms); + accelPointer(pDev, &mask, ms); /* The pointer acceleration code modifies the fractional part * in-place, so we need to extract this information first */ x_frac = pDev->last.remainder[0]; y_frac = pDev->last.remainder[1]; } - moveRelative(pDev, &x, &y, first_valuator, num_valuators, valuators); + moveRelative(pDev, &x, &y, &mask); } - set_raw_valuators(raw, first_valuator, num_valuators, valuators, - raw->valuators.data); + set_raw_valuators(raw, &mask, raw->valuators.data); - positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac); - updateHistory(pDev, first_valuator, num_valuators, ms); + positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative, + &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac); + updateHistory(pDev, &mask, ms); /* Update the valuators with the true value sent to the client*/ - if (num_valuators >= 1 && first_valuator == 0) - valuators[0] = x; - if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) - valuators[1 - first_valuator] = y; + if (valuator_mask_isset(&mask, 0)) + valuator_mask_set(&mask, 0, x); + if (valuator_mask_isset(&mask, 1)) + valuator_mask_set(&mask, 1, y); - if (num_valuators) - clipValuators(pDev, first_valuator, num_valuators, valuators); + clipValuators(pDev, &mask); - event = (DeviceEvent*) events->event; + event = &events->device_event; init_event(pDev, event, ms); if (type == MotionNotify) { @@ -1165,58 +1235,82 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, event->root_x_frac = cx_frac; event->root_y_frac = cy_frac; - set_valuators(pDev, event, first_valuator, num_valuators, valuators); + set_valuators(pDev, event, &mask); return num_events; } +/** + * Generate internal events representing this proximity event and enqueue + * them on the event queue. + * + * This function is not reentrant. Disable signals before calling. + * + * @param device The device to generate the event for + * @param type Event type, one of ProximityIn or ProximityOut + * @param keycode Key code of the pressed/released key + * @param mask Valuator mask for valuators present for this event. + * + */ +void +QueueProximityEvents(DeviceIntPtr device, int type, + const ValuatorMask *mask) +{ + int nevents; + + nevents = GetProximityEvents(InputEventList, device, type, mask); + queueEventList(device, InputEventList, nevents); +} /** * Generate ProximityIn/ProximityOut InternalEvents, accompanied by * valuators. * - * events is not NULL-terminated; the return value is the number of events. - * The DDX is responsible for allocating the event structure in the first - * place via GetMaximumEventsNum(), and for freeing it. + * The DDX is responsible for allocating the events in the first place via + * InitEventList(), and for freeing it. + * + * @return the number of events written into events. */ int -GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, - int first_valuator, int num_valuators, int *valuators_in) +GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask_in) { - int num_events = 1; + int num_events = 1, i; DeviceEvent *event; - int valuators[MAX_VALUATORS]; + ValuatorMask mask; /* refuse events from disabled devices */ if (!pDev->enabled) return 0; /* Sanity checks. */ - if (type != ProximityIn && type != ProximityOut) + if ((type != ProximityIn && type != ProximityOut) || !mask_in) return 0; if (!pDev->valuator) return 0; - /* Do we need to send a DeviceValuator event? */ - if ((pDev->valuator->mode & 1) == Relative) - num_valuators = 0; - /* You fail. */ - if (first_valuator < 0 || num_valuators > MAX_VALUATORS || - (num_valuators + first_valuator) > pDev->valuator->numAxes) - return 0; + valuator_mask_copy(&mask, mask_in); + + /* ignore relative axes for proximity. */ + for (i = 0; i < valuator_mask_size(&mask); i++) + { + if (valuator_mask_isset(&mask, i) && + valuator_get_mode(pDev, i) == Relative) + valuator_mask_unset(&mask, i); + } + + /* FIXME: posting proximity events with relative valuators only results + * in an empty event, EventToXI() will fail to convert → no event sent + * to client. */ events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events); - event = (DeviceEvent *) events->event; + event = &events->device_event; init_event(pDev, event, GetTimeInMillis()); event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut; - if (num_valuators) { - memcpy(valuators, valuators_in, num_valuators * sizeof(int)); - clipValuators(pDev, first_valuator, num_valuators, valuators); - } + clipValuators(pDev, &mask); - set_valuators(pDev, event, first_valuator, num_valuators, valuators); + set_valuators(pDev, event, &mask); return num_events; } diff --git a/dix/globals.c b/dix/globals.c index b12856994..0a6b17085 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -106,10 +106,6 @@ CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL; int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING; int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES; -#ifndef NOLOGOHACK -int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER; -#endif - #ifdef SCREENSAVER Bool screenSaverSuspended = FALSE; #endif diff --git a/dix/grabs.c b/dix/grabs.c index f850e3d84..69c58dff9 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -117,11 +117,8 @@ CreateGrab( static void FreeGrab(GrabPtr pGrab) { - if (pGrab->modifiersDetail.pMask != NULL) - free(pGrab->modifiersDetail.pMask); - - if (pGrab->detail.pMask != NULL) - free(pGrab->detail.pMask); + free(pGrab->modifiersDetail.pMask); + free(pGrab->detail.pMask); if (pGrab->cursor) FreeCursor(pGrab->cursor, (Cursor)0); diff --git a/dix/inpututils.c b/dix/inpututils.c index 6693c67b3..49e175822 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -35,6 +35,8 @@ #include "xace.h" #include "xkbsrv.h" #include "xkbstr.h" +#include "inpututils.h" +#include "eventstr.h" /* Check if a button map change is okay with the device. * Returns -1 for BadValue, as it collides with MappingBusy. */ @@ -267,15 +269,15 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap, /* Change any attached masters/slaves. */ if (IsMaster(dev)) { for (tmp = inputInfo.devices; tmp; tmp = tmp->next) { - if (!IsMaster(tmp) && tmp->u.master == dev) + if (!IsMaster(tmp) && GetMaster(tmp, MASTER_KEYBOARD) == dev) if (check_modmap_change_slave(client, dev, tmp, modmap)) do_modmap_change(client, tmp, modmap); } } - else if (dev->u.master && dev->u.master->u.lastSlave == dev) { + else if (!IsFloating(dev) && GetMaster(dev, MASTER_KEYBOARD)->lastSlave == dev) { /* If this fails, expect the results to be weird. */ - if (check_modmap_change(client, dev->u.master, modmap)) - do_modmap_change(client, dev->u.master, modmap); + if (check_modmap_change(client, dev->master, modmap)) + do_modmap_change(client, dev->master, modmap); } return Success; @@ -418,3 +420,167 @@ FreeInputAttributes(InputAttributes *attrs) free(attrs); } +/** + * Alloc a valuator mask large enough for num_valuators. + */ +ValuatorMask* +valuator_mask_new(int num_valuators) +{ + /* alloc a fixed size mask for now and ignore num_valuators. in the + * flying-car future, when we can dynamically alloc the masks and are + * not constrained by signals, we can start using num_valuators */ + ValuatorMask *mask = calloc(1, sizeof(ValuatorMask)); + mask->last_bit = -1; + return mask; +} + +void +valuator_mask_free(ValuatorMask **mask) +{ + free(*mask); + *mask = NULL; +} + + +/** + * Sets a range of valuators between first_valuator and num_valuators with + * the data in the valuators array. All other values are set to 0. + */ +void +valuator_mask_set_range(ValuatorMask *mask, int first_valuator, int num_valuators, + const int* valuators) +{ + int i; + + valuator_mask_zero(mask); + + for (i = first_valuator; i < min(first_valuator + num_valuators, MAX_VALUATORS); i++) + valuator_mask_set(mask, i, valuators[i - first_valuator]); +} + +/** + * Reset mask to zero. + */ +void +valuator_mask_zero(ValuatorMask *mask) +{ + memset(mask, 0, sizeof(*mask)); + mask->last_bit = -1; +} + +/** + * Returns the current size of the mask (i.e. the highest number of + * valuators currently set + 1). + */ +int +valuator_mask_size(const ValuatorMask *mask) +{ + return mask->last_bit + 1; +} + +/** + * Returns the number of valuators set in the given mask. + */ +int +valuator_mask_num_valuators(const ValuatorMask *mask) +{ + return CountBits(mask->mask, min(mask->last_bit + 1, MAX_VALUATORS)); +} + +/** + * Return true if the valuator is set in the mask, or false otherwise. + */ +int +valuator_mask_isset(const ValuatorMask *mask, int valuator) +{ + return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator); +} + +/** + * Set the valuator to the given data. + */ +void +valuator_mask_set(ValuatorMask *mask, int valuator, int data) +{ + mask->last_bit = max(valuator, mask->last_bit); + SetBit(mask->mask, valuator); + mask->valuators[valuator] = data; +} + +/** + * Return the requested valuator value. If the mask bit is not set for the + * given valuator, the returned value is undefined. + */ +int +valuator_mask_get(const ValuatorMask *mask, int valuator) +{ + return mask->valuators[valuator]; +} + +/** + * Remove the valuator from the mask. + */ +void +valuator_mask_unset(ValuatorMask *mask, int valuator) +{ + if (mask->last_bit >= valuator) { + int i, lastbit = -1; + + ClearBit(mask->mask, valuator); + mask->valuators[valuator] = 0; + + for (i = 0; i <= mask->last_bit; i++) + if (valuator_mask_isset(mask, i)) + lastbit = max(lastbit, i); + mask->last_bit = lastbit; + } +} + +void +valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src) +{ + if (src) + memcpy(dest, src, sizeof(*dest)); + else + valuator_mask_zero(dest); +} + +int +CountBits(const uint8_t *mask, int len) +{ + int i; + int ret = 0; + + for (i = 0; i < len; i++) + if (BitIsOn(mask, i)) + ret++; + + return ret; +} + +/** + * Verifies sanity of the event. If the event is not an internal event, + * memdumps the first 32 bytes of event to the log, a backtrace, then kill + * the server. + */ +void verify_internal_event(const InternalEvent *ev) +{ + if (ev && ev->any.header != ET_Internal) + { + int i; + unsigned char *data = (unsigned char*)ev; + + ErrorF("dix: invalid event type %d\n", ev->any.header); + + for (i = 0; i < sizeof(xEvent); i++, data++) + { + ErrorF("%02hhx ", *data); + + if ((i % 8) == 7) + ErrorF("\n"); + } + + xorg_backtrace(); + FatalError("Wrong event type %d. Aborting server\n", ev->any.header); + } +} diff --git a/dix/main.c b/dix/main.c index 21ebc2019..09f057726 100644 --- a/dix/main.c +++ b/dix/main.c @@ -104,6 +104,7 @@ Equipment Corporation. #include "extnsionst.h" #include "privates.h" #include "registry.h" +#include "client.h" #ifdef PANORAMIX #include "panoramiXsrv.h" #else @@ -117,12 +118,12 @@ Equipment Corporation. extern void Dispatch(void); -#if defined(XQUARTZ)||defined(XFAKELIB) +#if defined(XQUARTZ) || defined(DDXANDROID) #include -BOOL serverInitComplete = FALSE; -pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER; +BOOL serverRunning = FALSE; +pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; int dix_main(int argc, char *argv[], char *envp[]); @@ -138,8 +139,6 @@ int main(int argc, char *argv[], char *envp[]) InitRegions(); - pixman_disable_out_of_bounds_workaround(); - CheckUserParameters(argc, argv, envp); CheckUserAuthorization(); @@ -258,6 +257,7 @@ int main(int argc, char *argv[], char *envp[]) InitCoreDevices(); InitInput(argc, argv); InitAndStartDevices(); + ReserveClientIds(serverClient); dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); @@ -274,19 +274,26 @@ int main(int argc, char *argv[], char *envp[]) } } -#ifdef XQUARTZ - /* Let the other threads know the server is done with its init */ - pthread_mutex_lock(&serverInitCompleteMutex); - serverInitComplete = TRUE; - pthread_cond_broadcast(&serverInitCompleteCond); - pthread_mutex_unlock(&serverInitCompleteMutex); +#if defined(XQUARTZ) || defined(DDXANDROID) + /* Let the other threads know the server is done with its init */ + pthread_mutex_lock(&serverRunningMutex); + serverRunning = TRUE; + pthread_cond_broadcast(&serverRunningCond); + pthread_mutex_unlock(&serverRunningMutex); #endif NotifyParentProcess(); Dispatch(); - UndisplayDevices(); +#if defined(XQUARTZ) || defined(DDXANDROID) + /* Let the other threads know the server is no longer running */ + pthread_mutex_lock(&serverRunningMutex); + serverRunning = FALSE; + pthread_mutex_unlock(&serverRunningMutex); +#endif + + UndisplayDevices(); /* Now free up whatever must be freed */ if (screenIsSaved == SCREEN_SAVER_ON) @@ -323,6 +330,7 @@ int main(int argc, char *argv[], char *envp[]) screenInfo.numScreens = i; } + ReleaseClientIds(serverClient); dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT); serverClient->devPrivates = NULL; diff --git a/dix/privates.c b/dix/privates.c index 687fa7aa0..d651258f6 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -447,6 +447,7 @@ static const char *key_names[PRIVATE_LAST] = { [PRIVATE_GLYPH] = "GLYPH", [PRIVATE_GLYPHSET] = "GLYPHSET", [PRIVATE_PICTURE] = "PICTURE", + [PRIVATE_SYNC_FENCE] = "SYNC_FENCE", }; void diff --git a/dix/property.c b/dix/property.c index 1d4332a58..a1ae5305d 100644 --- a/dix/property.c +++ b/dix/property.c @@ -424,6 +424,9 @@ DeleteAllWindowProperties(WindowPtr pWin) dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); pProp = pNextProp; } + + if (pWin->optional) + pWin->optional->userProps = NULL; } static int diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index 30e14b17e..dfccf1581 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -67,6 +68,13 @@ SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, float velocity, float threshold, float acc); static PointerAccelerationProfileFunc GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); +static BOOL +InitializePredictableAccelerationProperties(DeviceIntPtr, + DeviceVelocityPtr, + PredictableAccelSchemePtr); +static BOOL +DeletePredictableAccelerationProperties(DeviceIntPtr, + PredictableAccelSchemePtr); /*#define PTRACCEL_DEBUGGING*/ @@ -83,9 +91,8 @@ GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); /* some int which is not a profile number */ #define PROFILE_UNINITIALIZE (-100) - /** - * Init struct so it should match the average case + * Init DeviceVelocity struct so it should match the average case */ void InitVelocityData(DeviceVelocityPtr vel) @@ -107,7 +114,7 @@ InitVelocityData(DeviceVelocityPtr vel) /** - * Clean up + * Clean up DeviceVelocityRec */ void FreeVelocityData(DeviceVelocityPtr vel){ @@ -116,20 +123,52 @@ FreeVelocityData(DeviceVelocityPtr vel){ } -/* - * dix uninit helper, called through scheme +/** + * Init predictable scheme + */ +Bool +InitPredictableAccelerationScheme(DeviceIntPtr dev, + ValuatorAccelerationPtr protoScheme) { + DeviceVelocityPtr vel; + ValuatorAccelerationRec scheme; + PredictableAccelSchemePtr schemeData; + scheme = *protoScheme; + vel = calloc(1, sizeof(DeviceVelocityRec)); + schemeData = calloc(1, sizeof(PredictableAccelSchemeRec)); + if (!vel || !schemeData) + return FALSE; + InitVelocityData(vel); + schemeData->vel = vel; + scheme.accelData = schemeData; + if (!InitializePredictableAccelerationProperties(dev, vel, schemeData)) + return FALSE; + /* all fine, assign scheme to device */ + dev->valuator->accelScheme = scheme; + return TRUE; +} + + +/** + * Uninit scheme */ void AccelerationDefaultCleanup(DeviceIntPtr dev) { - /*sanity check*/ - if( dev->valuator->accelScheme.AccelSchemeProc == acceleratePointerPredictable - && dev->valuator->accelScheme.accelData != NULL){ + DeviceVelocityPtr vel = GetDevicePredictableAccelData(dev); + if (vel) { + /* the proper guarantee would be that we're not inside of + * AccelSchemeProc(), but that seems impossible. Schemes don't get + * switched often anyway. + */ + OsBlockSignals(); dev->valuator->accelScheme.AccelSchemeProc = NULL; - FreeVelocityData(dev->valuator->accelScheme.accelData); + FreeVelocityData(vel); + free(vel); + DeletePredictableAccelerationProperties(dev, + (PredictableAccelSchemePtr) dev->valuator->accelScheme.accelData); free(dev->valuator->accelScheme.accelData); dev->valuator->accelScheme.accelData = NULL; - DeletePredictableAccelerationProperties(dev); + OsReleaseSignals(); } } @@ -321,26 +360,34 @@ AccelInitScaleProperty(DeviceIntPtr dev, DeviceVelocityPtr vel) return XIRegisterPropertyHandler(dev, AccelSetScaleProperty, NULL, NULL); } -BOOL -InitializePredictableAccelerationProperties(DeviceIntPtr dev) +static BOOL +InitializePredictableAccelerationProperties( + DeviceIntPtr dev, + DeviceVelocityPtr vel, + PredictableAccelSchemePtr schemeData) { - DeviceVelocityPtr vel = GetDevicePredictableAccelData(dev); - + int num_handlers = 4; if(!vel) - return FALSE; + return FALSE; - vel->prop_handlers[0] = AccelInitProfileProperty(dev, vel); - vel->prop_handlers[1] = AccelInitDecelProperty(dev, vel); - vel->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel); - vel->prop_handlers[3] = AccelInitScaleProperty(dev, vel); + schemeData->prop_handlers = calloc(num_handlers, sizeof(long)); + if (!schemeData->prop_handlers) + return FALSE; + schemeData->num_prop_handlers = num_handlers; + schemeData->prop_handlers[0] = AccelInitProfileProperty(dev, vel); + schemeData->prop_handlers[1] = AccelInitDecelProperty(dev, vel); + schemeData->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel); + schemeData->prop_handlers[3] = AccelInitScaleProperty(dev, vel); return TRUE; } BOOL -DeletePredictableAccelerationProperties(DeviceIntPtr dev) +DeletePredictableAccelerationProperties( + DeviceIntPtr dev, + PredictableAccelSchemePtr scheme) { - DeviceVelocityPtr vel; + DeviceVelocityPtr vel; Atom prop; int i; @@ -354,10 +401,15 @@ DeletePredictableAccelerationProperties(DeviceIntPtr dev) XIDeleteDeviceProperty(dev, prop, FALSE); vel = GetDevicePredictableAccelData(dev); - for (i = 0; vel && i < NPROPS_PREDICTABLE_ACCEL; i++) - if (vel->prop_handlers[i]) - XIUnregisterPropertyHandler(dev, vel->prop_handlers[i]); + if (vel) { + for (i = 0; i < scheme->num_prop_handlers; i++) + if (scheme->prop_handlers[i]) + XIUnregisterPropertyHandler(dev, scheme->prop_handlers[i]); + } + free(scheme->prop_handlers); + scheme->prop_handlers = NULL; + scheme->num_prop_handlers = 0; return TRUE; } @@ -373,87 +425,119 @@ InitTrackers(DeviceVelocityPtr vel, int ntracker) return; } free(vel->tracker); - vel->tracker = (MotionTrackerPtr)malloc(ntracker * sizeof(MotionTracker)); - memset(vel->tracker, 0, ntracker * sizeof(MotionTracker)); + vel->tracker = (MotionTrackerPtr)calloc(ntracker, sizeof(MotionTracker)); vel->num_tracker = ntracker; } +enum directions { + N = (1 << 0), + NE = (1 << 1), + E = (1 << 2), + SE = (1 << 3), + S = (1 << 4), + SW = (1 << 5), + W = (1 << 6), + NW = (1 << 7), + UNDEFINED = 0xFF +}; /** * return a bit field of possible directions. - * 0 = N, 2 = E, 4 = S, 6 = W, in-between is as you guess. * There's no reason against widening to more precise directions (<45 degrees), * should it not perform well. All this is needed for is sort out non-linear * motion, so precision isn't paramount. However, one should not flag direction * too narrow, since it would then cut the linear segment to zero size way too * often. + * + * @return A bitmask for N, NE, S, SE, etc. indicating the directions for + * this movement. */ static int DoGetDirection(int dx, int dy){ - float r; - int i1, i2; + int dir = 0; + /* on insignificant mickeys, flag 135 degrees */ - if(abs(dx) < 2 && abs(dy < 2)){ - /* first check diagonal cases */ - if(dx > 0 && dy > 0) - return 4+8+16; - if(dx > 0 && dy < 0) - return 1+2+4; - if(dx < 0 && dy < 0) - return 1+128+64; - if(dx < 0 && dy > 0) - return 16+32+64; + if(abs(dx) < 2 && abs(dy) < 2){ + /* first check diagonal cases */ + if(dx > 0 && dy > 0) + dir = E | SE | S; + else if(dx > 0 && dy < 0) + dir = N | NE | E; + else if(dx < 0 && dy < 0) + dir = W | NW | N; + else if(dx < 0 && dy > 0) + dir = W | SW | S; /* check axis-aligned directions */ - if(dx > 0) - return 2+4+8; /*E*/ - if(dx < 0) - return 128+64+32; /*W*/ - if(dy > 0) - return 32+16+8; /*S*/ - if(dy < 0) - return 128+1+2; /*N*/ - return 255; /* shouldn't happen */ - } - /* else, compute angle and set appropriate flags */ + else if(dx > 0) + dir = NE | E | SE; + else if(dx < 0) + dir = NW | W | SW; + else if(dy > 0) + dir = SE | S | SW; + else if(dy < 0) + dir = NE | N | NW; + else + dir = UNDEFINED; /* shouldn't happen */ + } else { /* compute angle and set appropriate flags */ + float r; + int i1, i2; + #ifdef _ISOC99_SOURCE - r = atan2f(dy, dx); + r = atan2f(dy, dx); #else - r = atan2(dy, dx); + r = atan2(dy, dx); #endif - /* find direction. We avoid r to become negative, - * since C has no well-defined modulo for such cases. */ - r = (r+(M_PI*2.5))/(M_PI/4); - /* this intends to flag 2 directions (90 degrees), - * except on very well-aligned mickeys. */ - i1 = (int)(r+0.1) % 8; - i2 = (int)(r+0.9) % 8; - if(i1 < 0 || i1 > 7 || i2 < 0 || i2 > 7) - return 255; /* shouldn't happen */ - return 1 << i1 | 1 << i2; + /* find direction. + * + * Add 360° to avoid r become negative since C has no well-defined + * modulo for such cases. Then divide by 45° to get the octant + * number, e.g. + * 0 <= r <= 1 is [0-45]° + * 1 <= r <= 2 is [45-90]° + * etc. + * But we add extra 90° to match up with our N, S, etc. defines up + * there, rest stays the same. + */ + r = (r+(M_PI*2.5))/(M_PI/4); + /* this intends to flag 2 directions (45 degrees), + * except on very well-aligned mickeys. */ + i1 = (int)(r+0.1) % 8; + i2 = (int)(r+0.9) % 8; + if(i1 < 0 || i1 > 7 || i2 < 0 || i2 > 7) + dir = UNDEFINED; /* shouldn't happen */ + else + dir = (1 << i1 | 1 << i2); + } + return dir; } #define DIRECTION_CACHE_RANGE 5 #define DIRECTION_CACHE_SIZE (DIRECTION_CACHE_RANGE*2+1) -/* cache DoGetDirection(). */ +/* cache DoGetDirection(). + * To avoid excessive use of direction calculation, cache the values for + * [-5..5] for both x/y. Anything outside of that is calcualted on the fly. + * + * @return A bitmask for N, NE, S, SE, etc. indicating the directions for + * this movement. + */ static int GetDirection(int dx, int dy){ static int cache[DIRECTION_CACHE_SIZE][DIRECTION_CACHE_SIZE]; - int i; + int dir; if (abs(dx) <= DIRECTION_CACHE_RANGE && abs(dy) <= DIRECTION_CACHE_RANGE) { /* cacheable */ - i = cache[DIRECTION_CACHE_RANGE+dx][DIRECTION_CACHE_RANGE+dy]; - if(i != 0){ - return i; - }else{ - i = DoGetDirection(dx, dy); - cache[DIRECTION_CACHE_RANGE+dx][DIRECTION_CACHE_RANGE+dy] = i; - return i; + dir = cache[DIRECTION_CACHE_RANGE+dx][DIRECTION_CACHE_RANGE+dy]; + if(dir == 0) { + dir = DoGetDirection(dx, dy); + cache[DIRECTION_CACHE_RANGE+dx][DIRECTION_CACHE_RANGE+dy] = dir; } }else{ /* non-cacheable */ - return DoGetDirection(dx, dy); + dir = DoGetDirection(dx, dy); } + + return dir; } #undef DIRECTION_CACHE_RANGE @@ -462,7 +546,12 @@ GetDirection(int dx, int dy){ /* convert offset (age) to array index */ #define TRACKER_INDEX(s, d) (((s)->num_tracker + (s)->cur_tracker - (d)) % (s)->num_tracker) +#define TRACKER(s, d) &(s)->tracker[TRACKER_INDEX(s,d)] +/** + * Add the delta motion to each tracker, then reset the latest tracker to + * 0/0 and set it as the current one. + */ static inline void FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t) { @@ -488,11 +577,9 @@ FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t) * This assumes linear motion. */ static float -CalcTracker(DeviceVelocityPtr vel, int offset, int cur_t){ - int index = TRACKER_INDEX(vel, offset); - float dist = sqrt( vel->tracker[index].dx * vel->tracker[index].dx - + vel->tracker[index].dy * vel->tracker[index].dy); - int dtime = cur_t - vel->tracker[index].time; +CalcTracker(const MotionTracker *tracker, int cur_t){ + float dist = sqrt(tracker->dx * tracker->dx + tracker->dy * tracker->dy); + int dtime = cur_t - tracker->time; if(dtime > 0) return dist / dtime; else @@ -500,22 +587,24 @@ CalcTracker(DeviceVelocityPtr vel, int offset, int cur_t){ } /* find the most plausible velocity. That is, the most distant - * (in time) tracker which isn't too old, beyond a linear partition, - * or simply too much off initial velocity. + * (in time) tracker which isn't too old, the movement vector was + * in the same octant, and where the velocity is within an + * acceptable range to the inital velocity. * - * May return 0. + * @return The tracker's velocity or 0 if the above conditions are unmet */ static float QueryTrackers(DeviceVelocityPtr vel, int cur_t){ - int n, offset, dir = 255, i = -1, age_ms; + int offset, dir = UNDEFINED, used_offset = -1, age_ms; /* initial velocity: a low-offset, valid velocity */ - float iveloc = 0, res = 0, tmp, vdiff; - float vfac = vel->corr_mul * vel->const_acceleration; /* premultiply */ + float initial_velocity = 0, result = 0, velocity_diff; + float velocity_factor = vel->corr_mul * vel->const_acceleration; /* premultiply */ /* loop from current to older data */ for(offset = 1; offset < vel->num_tracker; offset++){ - n = TRACKER_INDEX(vel, offset); + MotionTracker *tracker = TRACKER(vel, offset); + float tracker_velocity; - age_ms = cur_t - vel->tracker[n].time; + age_ms = cur_t - tracker->time; /* bail out if data is too old and protect from overrun */ if (age_ms >= vel->reset_time || age_ms < 0) { @@ -529,60 +618,60 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){ * even more precision we could subdivide as a final step, so possible * non-linearities are accounted for. */ - dir &= vel->tracker[n].dir; - if(dir == 0){ + dir &= tracker->dir; + if(dir == 0){ /* we've changed octant of movement (e.g. NE → NW) */ DebugAccelF("(dix prtacc) query: no longer linear\n"); /* instead of breaking it we might also inspect the partition after, * but actual improvement with this is probably rare. */ break; } - tmp = CalcTracker(vel, offset, cur_t) * vfac; + tracker_velocity = CalcTracker(tracker, cur_t) * velocity_factor; - if ((iveloc == 0 || offset <= vel->initial_range) && tmp != 0) { + if ((initial_velocity == 0 || offset <= vel->initial_range) && tracker_velocity != 0) { /* set initial velocity and result */ - res = iveloc = tmp; - i = offset; - } else if (iveloc != 0 && tmp != 0) { - vdiff = fabs(iveloc - tmp); - if (vdiff <= vel->max_diff || - vdiff/(iveloc + tmp) < vel->max_rel_diff) { - /* we're in range with the initial velocity, - * so this result is likely better - * (it contains more information). */ - res = tmp; - i = offset; - }else{ + result = initial_velocity = tracker_velocity; + used_offset = offset; + } else if (initial_velocity != 0 && tracker_velocity != 0) { + velocity_diff = fabs(initial_velocity - tracker_velocity); + + if (velocity_diff > vel->max_diff && + velocity_diff/(initial_velocity + tracker_velocity) >= vel->max_rel_diff) { /* we're not in range, quit - it won't get better. */ DebugAccelF("(dix prtacc) query: tracker too different:" " old %2.2f initial %2.2f diff: %2.2f\n", - tmp, iveloc, vdiff); + tracker_velocity, initial_velocity, velocity_diff); break; } + /* we're in range with the initial velocity, + * so this result is likely better + * (it contains more information). */ + result = tracker_velocity; + used_offset = offset; } } if(offset == vel->num_tracker){ DebugAccelF("(dix prtacc) query: last tracker in effect\n"); - i = vel->num_tracker-1; + used_offset = vel->num_tracker-1; } - if(i>=0){ - n = TRACKER_INDEX(vel, i); +#ifdef PTRACCEL_DEBUGGING + if(used_offset >= 0){ + MotionTracker *tracker = TRACKER(vel, used_offset); DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n", - i, - vel->tracker[n].dx, - vel->tracker[n].dy, - cur_t - vel->tracker[n].time); + used_offset, tracker->dx, tracker->dy, cur_t - tracker->time); } - return res; +#endif + return result; } #undef TRACKER_INDEX +#undef TRACKER /** * Perform velocity approximation based on 2D 'mickeys' (mouse motion delta). * return true if non-visible state reset is suggested */ -short +BOOL ProcessVelocityData2D( DeviceVelocityPtr vel, int dx, @@ -606,36 +695,41 @@ ProcessVelocityData2D( * constant-velocity response */ static inline float -ApplySimpleSoftening(int od, int d) +ApplySimpleSoftening(int prev_delta, int delta) { - float res = d; - if (d <= 1 && d >= -1) - return res; - if (d > od) - res -= 0.5; - else if (d < od) - res += 0.5; - return res; + float result = delta; + + if (delta < -1 || delta > 1) { + if (delta > prev_delta) + result -= 0.5; + else if (delta < prev_delta) + result += 0.5; + } + return result; } +/** + * Soften the delta based on previous deltas stored in vel. + * + * @param[in,out] fdx Delta X, modified in-place. + * @param[in,out] fdx Delta Y, modified in-place. + */ static void -ApplySofteningAndConstantDeceleration( +ApplySoftening( DeviceVelocityPtr vel, - int dx, - int dy, float* fdx, - float* fdy, - short do_soften) + float* fdy) { - if (do_soften && vel->use_softening) { - *fdx = ApplySimpleSoftening(vel->last_dx, dx); - *fdy = ApplySimpleSoftening(vel->last_dy, dy); - } else { - *fdx = dx; - *fdy = dy; + if (vel->use_softening) { + *fdx = ApplySimpleSoftening(vel->last_dx, *fdx); + *fdy = ApplySimpleSoftening(vel->last_dy, *fdy); } +} +static void +ApplyConstantDeceleration(DeviceVelocityPtr vel, float *fdx, float *fdy) +{ *fdx *= vel->const_acceleration; *fdy *= vel->const_acceleration; } @@ -662,6 +756,8 @@ BasicComputeAcceleration( /** * Compute acceleration. Takes into account averaging, nv-reset, etc. + * If the velocity has changed, an average is taken of 6 velocity factors: + * current velocity, last velocity and 4 times the average between the two. */ static float ComputeAcceleration( @@ -669,7 +765,7 @@ ComputeAcceleration( DeviceVelocityPtr vel, float threshold, float acc){ - float res; + float result; if(vel->velocity <= 0){ DebugAccelF("(dix ptracc) profile skipped\n"); @@ -684,24 +780,24 @@ ComputeAcceleration( * current and previous velocity. * Though being the more natural choice, it causes a minor delay * in comparison, so it can be disabled. */ - res = BasicComputeAcceleration( + result = BasicComputeAcceleration( dev, vel, vel->velocity, threshold, acc); - res += BasicComputeAcceleration( + result += BasicComputeAcceleration( dev, vel, vel->last_velocity, threshold, acc); - res += 4.0f * BasicComputeAcceleration(dev, vel, + result += 4.0f * BasicComputeAcceleration(dev, vel, (vel->last_velocity + vel->velocity) / 2, threshold, acc); - res /= 6.0f; + result /= 6.0f; DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n", - vel->velocity, vel->last_velocity, res); - return res; + vel->velocity, vel->last_velocity, result); }else{ - res = BasicComputeAcceleration(dev, vel, - vel->velocity, threshold, acc); + result = BasicComputeAcceleration(dev, vel, + vel->velocity, threshold, acc); DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n", vel->velocity, res); - return res; } + + return result; } @@ -952,11 +1048,9 @@ SetAccelerationProfile( if(profile == NULL && profile_num != PROFILE_UNINITIALIZE) return FALSE; - if(vel->profile_private != NULL){ - /* Here one could free old profile-private data */ - free(vel->profile_private); - vel->profile_private = NULL; - } + /* Here one could free old profile-private data */ + free(vel->profile_private); + vel->profile_private = NULL; /* Here one could init profile-private data */ vel->Profile = profile; vel->statistics.profile_number = profile_num; @@ -1004,7 +1098,8 @@ GetDevicePredictableAccelData( acceleratePointerPredictable && dev->valuator->accelScheme.accelData != NULL){ - return (DeviceVelocityPtr)dev->valuator->accelScheme.accelData; + return ((PredictableAccelSchemePtr) + dev->valuator->accelScheme.accelData)->vel; } return NULL; } @@ -1021,34 +1116,27 @@ GetDevicePredictableAccelData( void acceleratePointerPredictable( DeviceIntPtr dev, - int first_valuator, - int num_valuators, - int *valuators, - int evtime) + ValuatorMask* val, + CARD32 evtime) { - float mult = 0.0; - int dx = 0, dy = 0; - int *px = NULL, *py = NULL; - DeviceVelocityPtr velocitydata = - (DeviceVelocityPtr) dev->valuator->accelScheme.accelData; - float fdx, fdy, tmp; /* no need to init */ + int dx = 0, dy = 0, tmpi; + DeviceVelocityPtr velocitydata = GetDevicePredictableAccelData(dev); Bool soften = TRUE; - if (!num_valuators || !valuators || !velocitydata) + if (!velocitydata) return; if (velocitydata->statistics.profile_number == AccelProfileNone && - velocitydata->const_acceleration == 1.0f) { - return; /*we're inactive anyway, so skip the whole thing.*/ + velocitydata->const_acceleration == 1.0f) { + return; /*we're inactive anyway, so skip the whole thing.*/ } - if (first_valuator == 0) { - dx = valuators[0]; - px = &valuators[0]; + if (valuator_mask_isset(val, 0)) { + dx = valuator_mask_get(val, 0); } - if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) { - dy = valuators[1 - first_valuator]; - py = &valuators[1 - first_valuator]; + + if (valuator_mask_isset(val, 1)) { + dy = valuator_mask_get(val, 1); } if (dx || dy){ @@ -1058,32 +1146,42 @@ acceleratePointerPredictable( } if (dev->ptrfeed && dev->ptrfeed->ctrl.num) { + float mult; + /* invoke acceleration profile to determine acceleration */ mult = ComputeAcceleration (dev, velocitydata, - dev->ptrfeed->ctrl.threshold, - (float)dev->ptrfeed->ctrl.num / - (float)dev->ptrfeed->ctrl.den); + dev->ptrfeed->ctrl.threshold, + (float)dev->ptrfeed->ctrl.num / + (float)dev->ptrfeed->ctrl.den); + + if(mult != 1.0f || velocitydata->const_acceleration != 1.0f) { + float fdx = dx, + fdy = dy; - if(mult != 1.0 || velocitydata->const_acceleration != 1.0) { - ApplySofteningAndConstantDeceleration( velocitydata, - dx, dy, - &fdx, &fdy, - (mult > 1.0) && soften); + if (mult > 1.0f && soften) + ApplySoftening(velocitydata, &fdx, &fdy); + ApplyConstantDeceleration(velocitydata, &fdx, &fdy); + /* Calculate the new delta (with accel) and drop it back + * into the valuator masks */ if (dx) { + float tmp; tmp = mult * fdx + dev->last.remainder[0]; /* Since it may not be apparent: lrintf() does not offer * strong statements about rounding; however because we * process each axis conditionally, there's no danger * of a toggling remainder. Its lack of guarantees likely * makes it faster on the average target. */ - *px = lrintf(tmp); - dev->last.remainder[0] = tmp - (float)*px; + tmpi = lrintf(tmp); + valuator_mask_set(val, 0, tmpi); + dev->last.remainder[0] = tmp - (float)tmpi; } if (dy) { + float tmp; tmp = mult * fdy + dev->last.remainder[1]; - *py = lrintf(tmp); - dev->last.remainder[1] = tmp - (float)*py; + tmpi = lrintf(tmp); + valuator_mask_set(val, 1, tmpi); + dev->last.remainder[1] = tmp - (float)tmpi; } DebugAccelF("pos (%i | %i) remainders x: %.3f y: %.3f delta x:%.3f y:%.3f\n", *px, *py, dev->last.remainder[0], dev->last.remainder[1], fdx, fdy); @@ -1104,25 +1202,18 @@ acceleratePointerPredictable( void acceleratePointerLightweight( DeviceIntPtr dev, - int first_valuator, - int num_valuators, - int *valuators, - int ignored) + ValuatorMask* val, + CARD32 ignored) { - float mult = 0.0; - int dx = 0, dy = 0; - int *px = NULL, *py = NULL; - - if (!num_valuators || !valuators) - return; + float mult = 0.0, tmpf; + int dx = 0, dy = 0, tmpi; - if (first_valuator == 0) { - dx = valuators[0]; - px = &valuators[0]; + if (valuator_mask_isset(val, 0)) { + dx = valuator_mask_get(val, 0); } - if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) { - dy = valuators[1 - first_valuator]; - py = &valuators[1 - first_valuator]; + + if (valuator_mask_isset(val, 1)) { + dy = valuator_mask_get(val, 1); } if (!dx && !dy) @@ -1132,45 +1223,45 @@ acceleratePointerLightweight( /* modeled from xf86Events.c */ if (dev->ptrfeed->ctrl.threshold) { if ((abs(dx) + abs(dy)) >= dev->ptrfeed->ctrl.threshold) { - dev->last.remainder[0] = ((float)dx * - (float)(dev->ptrfeed->ctrl.num)) / - (float)(dev->ptrfeed->ctrl.den) + - dev->last.remainder[0]; - if (px) { - *px = (int)dev->last.remainder[0]; - dev->last.remainder[0] = dev->last.remainder[0] - - (float)(*px); + tmpf = ((float)dx * + (float)(dev->ptrfeed->ctrl.num)) / + (float)(dev->ptrfeed->ctrl.den) + + dev->last.remainder[0]; + if (dx) { + tmpi = (int) tmpf; + valuator_mask_set(val, 0, tmpi); + dev->last.remainder[0] = tmpf - (float)tmpi; } - dev->last.remainder[1] = ((float)dy * - (float)(dev->ptrfeed->ctrl.num)) / - (float)(dev->ptrfeed->ctrl.den) + - dev->last.remainder[1]; - if (py) { - *py = (int)dev->last.remainder[1]; - dev->last.remainder[1] = dev->last.remainder[1] - - (float)(*py); + tmpf = ((float)dy * + (float)(dev->ptrfeed->ctrl.num)) / + (float)(dev->ptrfeed->ctrl.den) + + dev->last.remainder[1]; + if (dy) { + tmpi = (int) tmpf; + valuator_mask_set(val, 1, tmpi); + dev->last.remainder[1] = tmpf - (float)tmpi; } } } else { - mult = pow((float)dx * (float)dx + (float)dy * (float)dy, + mult = pow((float)dx * (float)dx + (float)dy * (float)dy, ((float)(dev->ptrfeed->ctrl.num) / (float)(dev->ptrfeed->ctrl.den) - 1.0) / 2.0) / 2.0; if (dx) { - dev->last.remainder[0] = mult * (float)dx + - dev->last.remainder[0]; - *px = (int)dev->last.remainder[0]; - dev->last.remainder[0] = dev->last.remainder[0] - - (float)(*px); + tmpf = mult * (float)dx + + dev->last.remainder[0]; + tmpi = (int) tmpf; + valuator_mask_set(val, 0, tmpi); + dev->last.remainder[0] = tmpf - (float)tmpi; } if (dy) { - dev->last.remainder[1] = mult * (float)dy + - dev->last.remainder[1]; - *py = (int)dev->last.remainder[1]; - dev->last.remainder[1] = dev->last.remainder[1] - - (float)(*py); + tmpf = mult * (float)dy + + dev->last.remainder[1]; + tmpi = (int)tmpf; + valuator_mask_set(val, 1, tmpi); + dev->last.remainder[1] = tmpf - (float)tmpi; } } } diff --git a/dix/region.c b/dix/region.c index 5ba345773..6820c1eac 100644 --- a/dix/region.c +++ b/dix/region.c @@ -1423,237 +1423,3 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype) } return pRgn; } - -#define ExchangeSpans(a, b) \ -{ \ - DDXPointRec tpt; \ - int tw; \ - \ - tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \ - tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ -} - -/* ||| I should apply the merge sort code to rectangle sorting above, and see - if mapping time can be improved. But right now I've been at work 12 hours, - so forget it. -*/ - -static void QuickSortSpans( - DDXPointRec spans[], - int widths[], - int numSpans) -{ - int y; - int i, j, m; - DDXPointPtr r; - - /* Always called with numSpans > 1 */ - /* Sorts only by y, doesn't bother to sort by x */ - - do - { - if (numSpans < 9) - { - /* Do insertion sort */ - int yprev; - - yprev = spans[0].y; - i = 1; - do - { /* while i != numSpans */ - y = spans[i].y; - if (yprev > y) - { - /* spans[i] is out of order. Move into proper location. */ - DDXPointRec tpt; - int tw, k; - - for (j = 0; y >= spans[j].y; j++) {} - tpt = spans[i]; - tw = widths[i]; - for (k = i; k != j; k--) - { - spans[k] = spans[k-1]; - widths[k] = widths[k-1]; - } - spans[j] = tpt; - widths[j] = tw; - y = spans[i].y; - } /* if out of order */ - yprev = y; - i++; - } while (i != numSpans); - return; - } - - /* Choose partition element, stick in location 0 */ - m = numSpans / 2; - if (spans[m].y > spans[0].y) ExchangeSpans(m, 0); - if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1); - if (spans[m].y > spans[0].y) ExchangeSpans(m, 0); - y = spans[0].y; - - /* Partition array */ - i = 0; - j = numSpans; - do - { - r = &(spans[i]); - do - { - r++; - i++; - } while (i != numSpans && r->y < y); - r = &(spans[j]); - do - { - r--; - j--; - } while (y < r->y); - if (i < j) - ExchangeSpans(i, j); - } while (i < j); - - /* Move partition element back to middle */ - ExchangeSpans(0, j); - - /* Recurse */ - if (numSpans-j-1 > 1) - QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1); - numSpans = j; - } while (numSpans > 1); -} - -#define NextBand() \ -{ \ - clipy1 = pboxBandStart->y1; \ - clipy2 = pboxBandStart->y2; \ - pboxBandEnd = pboxBandStart + 1; \ - while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \ - pboxBandEnd++; \ - } \ - for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \ -} - -/* - Clip a list of scanlines to a region. The caller has allocated the - space. FSorted is non-zero if the scanline origins are in ascending - order. - returns the number of new, clipped scanlines. -*/ - -int -RegionClipSpans( - RegionPtr prgnDst, - DDXPointPtr ppt, - int *pwidth, - int nspans, - DDXPointPtr pptNew, - int *pwidthNew, - int fSorted) -{ - DDXPointPtr pptLast; - int *pwidthNewStart; /* the vengeance of Xerox! */ - int y, x1, x2; - int numRects; - - good(prgnDst); - pptLast = ppt + nspans; - pwidthNewStart = pwidthNew; - - if (!prgnDst->data) - { - /* Do special fast code with clip boundaries in registers(?) */ - /* It doesn't pay much to make use of fSorted in this case, - so we lump everything together. */ - - int clipx1, clipx2, clipy1, clipy2; - - clipx1 = prgnDst->extents.x1; - clipy1 = prgnDst->extents.y1; - clipx2 = prgnDst->extents.x2; - clipy2 = prgnDst->extents.y2; - - for (; ppt != pptLast; ppt++, pwidth++) - { - y = ppt->y; - x1 = ppt->x; - if (clipy1 <= y && y < clipy2) - { - x2 = x1 + *pwidth; - if (x1 < clipx1) x1 = clipx1; - if (x2 > clipx2) x2 = clipx2; - if (x1 < x2) - { - /* part of span in clip rectangle */ - pptNew->x = x1; - pptNew->y = y; - *pwidthNew = x2 - x1; - pptNew++; - pwidthNew++; - } - } - } /* end for */ - - } - else if ((numRects = prgnDst->data->numRects)) - { - /* Have to clip against many boxes */ - BoxPtr pboxBandStart, pboxBandEnd; - BoxPtr pbox; - BoxPtr pboxLast; - int clipy1, clipy2; - - /* In this case, taking advantage of sorted spans gains more than - the sorting costs. */ - if ((! fSorted) && (nspans > 1)) - QuickSortSpans(ppt, pwidth, nspans); - - pboxBandStart = RegionBoxptr(prgnDst); - pboxLast = pboxBandStart + numRects; - - NextBand(); - - for (; ppt != pptLast; ) - { - y = ppt->y; - if (y < clipy2) - { - /* span is in the current band */ - pbox = pboxBandStart; - x1 = ppt->x; - x2 = x1 + *pwidth; - do - { /* For each box in band */ - int newx1, newx2; - - newx1 = x1; - newx2 = x2; - if (newx1 < pbox->x1) newx1 = pbox->x1; - if (newx2 > pbox->x2) newx2 = pbox->x2; - if (newx1 < newx2) - { - /* Part of span in clip rectangle */ - pptNew->x = newx1; - pptNew->y = y; - *pwidthNew = newx2 - newx1; - pptNew++; - pwidthNew++; - } - pbox++; - } while (pbox != pboxBandEnd); - ppt++; - pwidth++; - } - else - { - /* Move to next band, adjust ppt as needed */ - pboxBandStart = pboxBandEnd; - if (pboxBandStart == pboxLast) - break; /* We're completely done */ - NextBand(); - } - } - } - return pwidthNew - pwidthNewStart; -} diff --git a/dix/resource.c b/dix/resource.c index a0fe719de..eb9f0492a 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -73,7 +73,7 @@ Equipment Corporation. ******************************************************************/ /* XSERVER_DTRACE additions: - * Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2005-2006, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -167,7 +167,6 @@ typedef struct _Resource { RESTYPE type; pointer value; } ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) typedef struct _ClientResource { ResourcePtr *resources; @@ -176,7 +175,6 @@ typedef struct _ClientResource { int hashsize; /* log(2)(buckets) */ XID fakeID; XID endFakeID; - XID expectID; } ClientResourceRec; RESTYPE lastResourceType; @@ -323,10 +321,9 @@ InitClientResources(ClientPtr client) clientTable[i].fakeID = client->clientAsMask | (client->index ? SERVER_BIT : SERVER_MINID); clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; for (j=0; jbuckets) { - ErrorF("[dix] AddResource(%lx, %lx, %lx), client=%d \n", + ErrorF("[dix] AddResource(%lx, %x, %lx), client=%d \n", (unsigned long)id, type, (unsigned long)value, client); FatalError("client not in use\n"); } @@ -512,8 +509,6 @@ AddResource(XID id, RESTYPE type, pointer value) res->value = value; *head = res; rrec->elements++; - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; CallResourceStateCallback(ResourceStateAdding, res); return TRUE; } @@ -543,7 +538,7 @@ RebuildTable(int client) } for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) { - *rptr = NullResource; + *rptr = NULL; *tptr = rptr; } clientTable[client].hashsize++; @@ -555,7 +550,7 @@ RebuildTable(int client) for (res = *rptr; res; res = next) { next = res->next; - res->next = NullResource; + res->next = NULL; tptr = &tails[Hash(client, res->id)]; **tptr = res; *tptr = &res->next; @@ -567,6 +562,17 @@ RebuildTable(int client) clientTable[client].resources = resources; } +static void +doFreeResource(ResourcePtr res, Bool skip) +{ + CallResourceStateCallback(ResourceStateFreeing, res); + + if (!skip) + resourceTypes[res->type & TypeMask].deleteFunc(res->value, res->id); + + free(res); +} + void FreeResource(XID id, RESTYPE skipDeleteFuncType) { @@ -595,11 +601,8 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) *prev = res->next; elements = --*eltptr; - CallResourceStateCallback(ResourceStateFreeing, res); + doFreeResource(res, rtype == skipDeleteFuncType); - if (rtype != skipDeleteFuncType) - (*resourceTypes[rtype & TypeMask].deleteFunc)(res->value, res->id); - free(res); if (*eltptr != elements) prev = head; /* prev may no longer be valid */ } @@ -609,7 +612,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) } } - void FreeResourceByType(XID id, RESTYPE type, Bool skipFree) { @@ -632,11 +634,8 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) *prev = res->next; clientTable[cid].elements--; - CallResourceStateCallback(ResourceStateFreeing, res); + doFreeResource(res, skipFree); - if (!skipFree) - (*resourceTypes[type & TypeMask].deleteFunc)(res->value, res->id); - free(res); break; } else @@ -798,12 +797,10 @@ FreeClientNeverRetainResources(ClientPtr client) #endif *prev = this->next; clientTable[client->index].elements--; + elements = *eltptr; - CallResourceStateCallback(ResourceStateFreeing, this); + doFreeResource(this, FALSE); - elements = *eltptr; - (*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id); - free(this); if (*eltptr != elements) prev = &resources[j]; /* prev may no longer be valid */ } @@ -846,7 +843,6 @@ FreeClientResources(ClientPtr client) for (this = *head; this; this = *head) { - RESTYPE rtype = this->type; #ifdef XSERVER_DTRACE XSERVER_RESOURCE_FREE(this->id, this->type, this->value, TypeNameString(this->type)); @@ -854,10 +850,7 @@ FreeClientResources(ClientPtr client) *head = this->next; clientTable[client->index].elements--; - CallResourceStateCallback(ResourceStateFreeing, this); - - (*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id); - free(this); + doFreeResource(this, FALSE); } } free(clientTable[client->index].resources); @@ -886,24 +879,21 @@ LegalNewID(XID id, ClientPtr client) #ifdef PANORAMIX XID minid, maxid; - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } + if (!noPanoramiXExtension) { + minid = client->clientAsMask | (client->index ? + SERVER_BIT : SERVER_MINID); + maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; + if ((id >= minid) && (id <= maxid)) + return TRUE; + } #endif /* PANORAMIX */ - if (client->clientAsMask == (id & ~RESOURCE_ID_MASK)) - { - if (clientTable[client->index].expectID <= id) - return TRUE; - - rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, - DixGetAttrAccess); - return rc == BadValue; - } - return FALSE; + if (client->clientAsMask == (id & ~RESOURCE_ID_MASK)) + { + rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, + DixGetAttrAccess); + return rc == BadValue; + } + return FALSE; } int diff --git a/dix/window.c b/dix/window.c index 1913030cf..5defe5849 100644 --- a/dix/window.c +++ b/dix/window.c @@ -116,6 +116,7 @@ Equipment Corporation. #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" +#include "mivalidate.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" @@ -137,6 +138,8 @@ Equipment Corporation. * ChangeWindowDeviceCursor ******/ +Bool bgNoneRoot = FALSE; + static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11}; static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88}; @@ -296,6 +299,10 @@ SetWindowToDefaults(WindowPtr pWin) #ifdef ROOTLESS pWin->rootlessUnhittable = FALSE; #endif + +#ifdef COMPOSITE + pWin->damagedDescendants = FALSE; +#endif } static void @@ -463,7 +470,12 @@ InitRootWindow(WindowPtr pWin) if (party_like_its_1989) { MakeRootTile(pWin); backFlag |= CWBackPixmap; + } else if (pScreen->canDoBGNoneRoot && bgNoneRoot) { + pWin->backgroundState = XaceBackgroundNoneState(pWin); + pWin->background.pixel = pScreen->whitePixel; + backFlag |= CWBackPixmap; } else { + pWin->backgroundState = BackgroundPixel; if (whiteRoot) pWin->background.pixel = pScreen->whitePixel; else @@ -950,6 +962,27 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client) return Success; } +static void +SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2) +{ + /* following the protocol: "Changing the background of a root window to + * None or ParentRelative restores the default background pixmap" */ + if (bgNoneRoot) { + pWin->backgroundState = XaceBackgroundNoneState(pWin); + pWin->background.pixel = pScreen->whitePixel; + } + else if (party_like_its_1989) + MakeRootTile(pWin); + else { + pWin->backgroundState = BackgroundPixel; + if (whiteRoot) + pWin->background.pixel = pScreen->whitePixel; + else + pWin->background.pixel = pScreen->blackPixel; + *index2 = CWBackPixel; + } +} + /***** * ChangeWindowAttributes * @@ -999,7 +1032,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap)(pWin->background.pixmap); if (!pWin->parent) - MakeRootTile(pWin); + SetRootWindowBackground(pWin, pScreen, &index2); else { pWin->backgroundState = XaceBackgroundNoneState(pWin); pWin->background.pixel = pScreen->whitePixel; @@ -1016,7 +1049,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap) (*pScreen->DestroyPixmap)(pWin->background.pixmap); if (!pWin->parent) - MakeRootTile(pWin); + SetRootWindowBackground(pWin, pScreen, &index2); else pWin->backgroundState = ParentRelative; borderRelative = TRUE; @@ -3037,7 +3070,7 @@ SendVisibilityNotify(WindowPtr pWin) switch(visibility) { case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { if(i == Scrnum) continue; rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient, @@ -3059,7 +3092,7 @@ SendVisibilityNotify(WindowPtr pWin) } break; case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { if(i == Scrnum) continue; rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient, @@ -3087,13 +3120,6 @@ SendVisibilityNotify(WindowPtr pWin) } #define RANDOM_WIDTH 32 - -#ifndef NOLOGOHACK -static void DrawLogo( - WindowPtr pWin -); -#endif - int dixSaveScreens(ClientPtr client, int on, int mode) { @@ -3155,18 +3181,10 @@ dixSaveScreens(ClientPtr client, int on, int mode) * for the root window, so miPaintWindow works */ screenIsSaved = SCREEN_SAVER_OFF; -#ifndef NOLOGOHACK - if (logoScreenSaver) - (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE); -#endif (*pWin->drawable.pScreen->MoveWindow)(pWin, (short)(-(rand() % RANDOM_WIDTH)), (short)(-(rand() % RANDOM_WIDTH)), pWin->nextSib, VTMove); -#ifndef NOLOGOHACK - if (logoScreenSaver) - DrawLogo(pWin); -#endif screenIsSaved = SCREEN_SAVER_ON; } /* @@ -3324,10 +3342,6 @@ TileScreenSaver(ScreenPtr pScreen, int kind) (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap); } MapWindow(pWin, serverClient); -#ifndef NOLOGOHACK - if (kind == SCREEN_IS_TILED && logoScreenSaver) - DrawLogo(pWin); -#endif return TRUE; } @@ -3660,9 +3674,9 @@ WindowParentHasDeviceCursor(WindowPtr pWin, &pParentNode, &pParentPrev)) { /* if there is a node in the list, the win has a dev cursor */ - if (!pParentNode->cursor) /* inherited. loop needs to cont. */ - { - } else if (pParentNode->cursor == pCursor) /* inherit */ + if (!pParentNode->cursor) /* inherited. */ + pParent = pParent->parent; + else if (pParentNode->cursor == pCursor) /* inherit */ return TRUE; else /* different cursor */ return FALSE; @@ -3674,183 +3688,104 @@ WindowParentHasDeviceCursor(WindowPtr pWin, return FALSE; } -#ifndef NOLOGOHACK -static void -DrawLogo(WindowPtr pWin) +/* + * SetRootClip -- + * Enable or disable rendering to the screen by + * setting the root clip list and revalidating + * all of the windows + */ +void +SetRootClip(ScreenPtr pScreen, Bool enable) { - DrawablePtr pDraw; - ScreenPtr pScreen; - int x, y; - unsigned int width, height, size; - GC *pGC; - int rc, thin, gap, d31; - DDXPointRec poly[4]; - ChangeGCVal fore[2], back[2]; - xrgb rgb[2]; - BITS32 fmask, bmask; - ColormapPtr cmap; - - pDraw = (DrawablePtr)pWin; - pScreen = pDraw->pScreen; - x = -pWin->origin.x; - y = -pWin->origin.y; - width = pScreen->width; - height = pScreen->height; - pGC = GetScratchGC(pScreen->rootDepth, pScreen); - if (!pGC) + WindowPtr pWin = pScreen->root; + WindowPtr pChild; + Bool WasViewable; + Bool anyMarked = FALSE; + WindowPtr pLayerWin; + BoxRec box; + + if (!pWin) return; + WasViewable = (Bool)(pWin->viewable); + if (WasViewable) + { + for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) + { + (void) (*pScreen->MarkOverlappedWindows)(pChild, + pChild, + &pLayerWin); + } + (*pScreen->MarkWindow) (pWin); + anyMarked = TRUE; + if (pWin->valdata) + { + if (HasBorder (pWin)) + { + RegionPtr borderVisible; - if ((rand() % 100) <= 17) /* make the probability for white fairly low */ - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; - if (pWin->backgroundState == BackgroundPixel) { - rc = dixLookupResourceByType((pointer *)&cmap, wColormap(pWin), - RT_COLORMAP, serverClient, DixReadAccess); - if (rc == Success) { - Pixel querypixels[2]; - - querypixels[0] = fore[0].val; - querypixels[1] = pWin->background.pixel; - QueryColors(cmap, 2, querypixels, rgb, serverClient); - if ((rgb[0].red == rgb[1].red) && - (rgb[0].green == rgb[1].green) && - (rgb[0].blue == rgb[1].blue)) { - if (fore[0].val == pScreen->blackPixel) - fore[0].val = pScreen->whitePixel; - else - fore[0].val = pScreen->blackPixel; + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, + &pWin->borderClip, &pWin->winSize); + pWin->valdata->before.borderVisible = borderVisible; } + pWin->valdata->before.resized = TRUE; } } - fore[1].val = FillSolid; - fmask = GCForeground|GCFillStyle; - if (pWin->backgroundState == BackgroundPixel) { - back[0].val = pWin->background.pixel; - back[1].val = FillSolid; - bmask = GCForeground|GCFillStyle; - } else { - back[0].val = 0; - back[1].val = 0; - ChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back); - back[0].val = FillTiled; - back[1].ptr = pWin->background.pixmap; - bmask = GCFillStyle|GCTile; - } - /* should be the same as the reference function XmuDrawLogo() */ - - size = width; - if (height < width) - size = height; - size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH); - size &= ~1; - x += rand() % (width - size); - y += rand() % (height - size); - -/* - * Draw what will be the thin strokes. - * - * ----- - * / / - * / / - * / / - * / / - * /____/ - * d - * - * Point d is 9/44 (~1/5) of the way across. - */ - - thin = (size / 11); - if (thin < 1) thin = 1; - gap = (thin+3) / 4; - d31 = thin + thin + gap; - poly[0].x = x + size; poly[0].y = y; - poly[1].x = x + size-d31; poly[1].y = y; - poly[2].x = x + 0; poly[2].y = y + size; - poly[3].x = x + d31; poly[3].y = y + size; - ChangeGC(NullClient, pGC, fmask, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for lower thin stroke. - * - * ------ - * / / - * / __ / - * / / / - * / / / - * /__/__/ - */ - - poly[0].x = x + d31/2; poly[0].y = y + size; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + d31; poly[3].y = y + size; - ChangeGC(NullClient, pGC, bmask, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); - -/* - * Erase area not needed for upper thin stroke. - * - * ------ - * / / / - * /--/ / - * / / - * / / - * /_____/ - */ - - poly[0].x = x + size - d31/2; poly[0].y = y; - poly[1].x = x + size / 2; poly[1].y = y + size/2; - poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2; - poly[3].x = x + size - d31; poly[3].y = y; - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); + /* + * Use REGION_BREAK to avoid optimizations in ValidateTree + * that assume the root borderClip can't change well, normally + * it doesn't...) + */ + if (enable) + { + box.x1 = 0; + box.y1 = 0; + box.x2 = pScreen->width; + box.y2 = pScreen->height; + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); + if (WasViewable) + RegionReset(&pWin->borderClip, &box); + pWin->drawable.width = pScreen->width; + pWin->drawable.height = pScreen->height; + RegionBreak(&pWin->clipList); + } + else + { + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); + } -/* - * Draw thick stroke. - * Point b is 1/4 of the way across. - * - * b - * ----- - * \ \ - * \ \ - * \ \ - * \ \ - * \____\ - */ + ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - poly[0].x = x; poly[0].y = y; - poly[1].x = x + size/4; poly[1].y = y; - poly[2].x = x + size; poly[2].y = y + size; - poly[3].x = x + size - size/4; poly[3].y = y + size; - ChangeGC(NullClient, pGC, fmask, fore); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); + if (WasViewable) + { + if (pWin->firstChild) + { + anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, + pWin->firstChild, + (WindowPtr *)NULL); + } + else + { + (*pScreen->MarkWindow) (pWin); + anyMarked = TRUE; + } -/* - * Erase to create gap. - * - * / - * / - * / - * / - * / - */ - poly[0].x = x + size- thin; poly[0].y = y; - poly[1].x = x + size-( thin+gap); poly[1].y = y; - poly[2].x = x + thin; poly[2].y = y + size; - poly[3].x = x + thin + gap; poly[3].y = y + size; - ChangeGC(NullClient, pGC, bmask, back); - ValidateGC(pDraw, pGC); - (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly); + if (anyMarked) + (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); + } - FreeScratchGC(pGC); + if (WasViewable) + { + if (anyMarked) + (*pScreen->HandleExposures)(pWin); + if (anyMarked && pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); + } + if (pWin->realized) + WindowsRestructured (); + FlushAllOutput(); } - -#endif diff --git a/doc/.gitignore b/doc/.gitignore index 952f52857..2ee2ac5b4 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,2 +1,4 @@ -# Add & Override for this directory and it's subdirectories -Xserver.man +*.html +*.pdf +*.ps +*.txt diff --git a/doc/Makefile.am b/doc/Makefile.am index 43606a3f6..e6974fef1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,26 +1,15 @@ +SUBDIRS = dtrace -# Xserver.man covers options generic to all X servers built in this tree -# (i.e. those handled in the os/utils.c options processing instead of in -# the DDX-level options processing) -appmandir = $(APP_MAN_DIR) -appman_PRE = Xserver.man.pre +if ENABLE_DEVEL_DOCS +if HAVE_XMLTO -appman_PROCESSED = $(appman_PRE:man.pre=man) -appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) +# Main DocBook/XML files (DOCTYPE book) +docbook = Xserver-spec.xml Xinput.xml -BUILT_SOURCES = $(appman_PROCESSED) -CLEANFILES = $(appman_PROCESSED) $(appman_DATA) +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/devbook.am -include $(top_srcdir)/cpprules.in +endif HAVE_XMLTO +endif ENABLE_DEVEL_DOCS -.man.$(APP_MAN_SUFFIX): - $(AM_V_at)cp $< $@ - -EXTRAMANDEFS = -D__default_font_path__="`echo $(COMPILEDDEFAULTFONTPATH) | $(SED) -e 's/,/, /g'`" - -# Docs about X server internals that we ship with source but don't install -DEVEL_DOCS = smartsched - -EXTRA_DIST = $(DEVEL_DOCS) $(appman_PRE) $(fileman_PRE) - -SUBDIRS = xml +EXTRA_DIST = smartsched diff --git a/doc/Xinput.xml b/doc/Xinput.xml new file mode 100644 index 000000000..1ae7afe7b --- /dev/null +++ b/doc/Xinput.xml @@ -0,0 +1,1209 @@ + + + + + + + + + X11 Input Extension Porting Document + X Version 11, Release 6.7 + + + GeorgeSachs + Hewlett-Packard + + + X Consortium Standard + 1989Hewlett-Packard Company + 1990Hewlett-Packard Company + 1991Hewlett-Packard Company + + 1989X Consortium + 1990X Consortium + 1991X Consortium + X Consortium + X Version 11, Release 6.7 + + + + + +Permission to use, copy, modify, and distribute this documentation for any purpose and without fee is +hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +Hewlett-Packard makes no representations about the suitability for any purpose of the information in this +document. It is provided "as is" without express or implied warranty. This document is only a draft stan- +dard of the X Consortium and is therefore subject to change. + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The Open Group. + + + + + +X11 Input Extension Porting Document + + +This document is intended to aid the process of integrating the +X11 Input Extension into an X server. + + + +Most of the functionality provided by the input extension is +device- and implementation-independent, and should require no changes. +The functionality is implemented by +routines that typically reside in the server source tree directory +extensions/server/xinput. +This extension includes functions to enable and disable input extension devices, +select input, grab and focus those device, query and change key +and button mappings, and others. The only input extension requirements +for the device-dependent part of X are that the input devices be +correctly initialized and input events from those devices be correctly +generated. Device-dependent X is responsible for reading input data from +the input device hardware and if necessary, reformatting it into X events. + + + +The process of initializing input extension devices is similar to that used +for the core devices, and is described in the following sections. When +multiple input devices are attached to X server, the choice of which devices +to initially use as the core X pointer and keyboard is left +implementation-dependent. It is also up to each implementation to decide +whether all input devices will be opened by the server during its +initialization and kept open for the life of the server. The alternative is +to open only the X keyboard and X pointer during server initialization, and +open other input devices only when requested by a client to do so. Either +type of implementation is supported by the input extension. + + + +Input extension events generated by the X server use the same 32-byte xEvent +wire event as do core input events. However, additional information must be +sent for input extension devices, requiring that multiple xEvents be generated +each time data is received from an input extension device. These xEvents are +combined into a single client XEvent by the input extension library. A later +section of this document describes the format and generation of input extension +events. + + +Initializing Extension Devices + + +Extension input devices are initialized in the same manner as the core +X input devices. Device-Independent X provides functions that can be +called from DDX to initialize these devices. Which functions are called +and when will vary by implementation, and will depend on whether the +implementation opens all the input devices available to X when X is initialized, +or waits until a client requests that a device be opened. +In the simplest case, DDX will open all input devices as part of its +initialization, when the InitInput routine is called. + + +Summary of Calling Sequence + + + +Device-Independent X | Device-Dependent X +-------------------- | ------------------- + | +InitInput --------------> | - do device-specific initialization + | + | - call AddInputDevice (deviceProc,AutoStart) +AddInputDevice | + - creates DeviceIntRec | + - records deviceProc | + - adds new device to | + list of off_devices. | +sets dev->startup=AutoStart| + | - call one of: + | - RegisterPointerDevice (X pointer) + | - processInputProc = ProcessPointerEvents + | - RegisterKeyboardDevice (X keyboard) + | - processInputProc = ProcessKeyboardEvents + | - RegisterOtherDevice (extension device) + | - processInputProc = ProcessOtherEvents + | + | +InitAndStartDevices -----> | - calls deviceProc with parameters + | (DEVICE_INIT, AutoStart) +sets dev->inited = return | + value from deviceProc | + | + | - in deviceProc, do one of: + | - call InitPointerDeviceStruct (X pointer) + | - call InitKeyboardDeviceStruct (X keybd) + | - init extension device by calling some of: + | - InitKeyClassDeviceStruct + | - InitButtonClassDeviceStruct + | - InitValuatorClassDeviceStruct + | - InitValuatorAxisStruct + | - InitFocusClassDeviceStruct + | - InitProximityClassDeviceStruct + | - InitKbdFeedbackClassDeviceStruct + | - InitPtrFeedbackClassDeviceStruct + | - InitLedFeedbackClassDeviceStruct + | - InitStringFeedbackClassDeviceStruct + | - InitIntegerFeedbackClassDeviceStruct + | - InitBellFeedbackClassDeviceStruct + | - init device name and type by: + | - calling MakeAtom with one of the + | predefined names + | - calling AssignTypeAndName + | + | +for each device added | + by AddInputDevice, | + InitAndStartDevices | + calls EnableDevice if | - EnableDevice calls deviceProc with + dev->startup & | (DEVICE_ON, AutoStart) + dev->inited | + | +If deviceProc returns | - core devices are now enabled, extension + Success, EnableDevice | devices are now available to be accessed + move the device from | through the input extension protocol + inputInfo.off_devices | requests. + to inputInfo.devices | + + + + +Initialization Called From InitInput + + +InitInput is the first DDX input entry point called during X server startup. +This routine is responsible for +device- and implementation- specific initialization, and for calling +AddInputDevice to create and initialize the DeviceIntRec structure for each +input device. AddInputDevice is passed the address of a procedure to be called +by the DIX routine InitAndStartDevices when input devices are enabled. +This procedure is expected to perform X initialization for the input device. + + + +If the device is to be used as the X pointer, DDX should then call +RegisterPointerDevice, passing the DeviceIntRec pointer, +to initialize the device as the X pointer. + + + +If the device is to be used as the X keyboard, DDX should instead call +RegisterKeyboardDevice to initialize the device as the X keyboard. + + + +If the device is to be used as an extension device, DDX should instead +call RegisterOtherDevice, passing the DeviceIntPtr returned by +AddInputDevice. + + + +A sample InitInput implementation is shown below. + + + + +InitInput(argc,argv) + { + int i, numdevs, ReadInput(); + DeviceIntPtr dev; + LocalDevice localdevs[LOCAL_MAX_DEVS]; + DeviceProc kbdproc, ptrproc, extproc; + + /************************************************************** + * Open the appropriate input devices, determine which are + * available, and choose an X pointer and X keyboard device + * in some implementation-dependent manner. + ***************************************************************/ + + open_input_devices (&numdevs, localdevs); + + /************************************************************** + * Register a WakeupHandler to handle input when it is generated. + ***************************************************************/ + + RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL); + + /************************************************************** + * Register the input devices with DIX. + ***************************************************************/ + + for (i=0; i<numdevs; i++) + { + if (localdevs[i].use == IsXKeyboard) + { + dev = AddInputDevice (kbdproc, TRUE); + RegisterKeyboardDevice (dev); + } + else if (localdevs[i].use == IsXPointer) + { + dev = AddInputDevice (ptrproc, TRUE); + RegisterPointerDevice (dev); + } + else + { + dev = AddInputDevice (extproc, FALSE); + RegisterOtherDevice (dev); + } + if (dev == NULL) + FatalError ("Too many input devices."); + dev->devicePrivate = (pointer) &localdevs[i]; + } + + + + +Initialization Called From InitAndStartDevices + + +After InitInput has returned, +InitAndStartDevices is the DIX routine that is called to enable input devices. +It calls the device control routine that was passed to AddInputDevice, +with a mode value of DEVICE_INIT. The action taken by the device control +routine depends on how the device is to be used. If the device is to be +the X pointer, the device control routine should call +InitPointerDeviceStruct to initialize it. If the device is to be the +X keyboard, the device control routine should call +InitKeyboardDeviceStruct. Since input extension devices may support various +combinations of keys, buttons, valuators, and feedbacks, +each class of input that it supports must be initialized. +Entry points are defined by DIX to initialize each of the supported classes of +input, and are described in the following sections. + + + +A sample device control routine called from InitAndStartDevices is +shown below. + + + + +Bool extproc (dev, mode) + DeviceIntPtr dev; + int mode; + { + LocalDevice *localdev = (LocalDevice *) dev->devicePrivate; + + switch (mode) + { + case DEVICE_INIT: + if (strcmp(localdev->name, XI_TABLET) == 0) + { + /**************************************************** + * This device reports proximity, has buttons, + * reports two axes of motion, and can be focused. + * It also supports the same feedbacks as the X pointer + * (acceleration and threshold can be set). + ****************************************************/ + + InitButtonClassDeviceStruct (dev, button_count, button_map); + InitValuatorClassDeviceStruct (dev, localdev->n_axes,); + motionproc, MOTION_BUF_SIZE, Absolute); + for (i=0; i<localdev->n_axes; i++) + InitValuatorAxisStruct (dev, i, min_val, max_val, + resolution); + InitFocusClassDeviceStruct (dev); + InitProximityClassDeviceStruct (dev); + InitPtrFeedbackClassDeviceStruct (dev, p_controlproc); + } + else if (strcmp(localdev->name, XI_BUTTONBOX) == 0) + { + /**************************************************** + * This device has keys and LEDs, and can be focused. + ****************************************************/ + + InitKeyClassDeviceStruct (dev, syms, modmap); + InitFocusClassDeviceStruct (dev); + InitLedFeedbackClassDeviceStruct (dev, ledcontrol); + } + else if (strcmp(localdev->name, XI_KNOBBOX) == 0) + { + /**************************************************** + * This device reports motion. + * It can be focused. + ****************************************************/ + + InitValuatorClassDeviceStruct (dev, localdev->n_axes,); + motionproc, MOTION_BUF_SIZE, Absolute); + for (i=0; i<localdev->n_axes; i++) + InitValuatorAxisStruct (dev, i, min_val, max_val, + resolution); + InitFocusClassDeviceStruct (dev); + } + localdev->atom = + MakeAtom(localdev->name, strlen(localdev->name), FALSE); + AssignTypeAndName (dev, localdev->atom, localdev->name); + break; + case DEVICE_ON: + AddEnabledDevice (localdev->file_ds); + dev->on = TRUE; + break; + case DEVICE_OFF: + dev->on = FALSE; + RemoveEnabledDevice (localdev->file_ds); + break; + case DEVICE_CLOSE: + break; + } + } + + + + +The device control routine is called with a mode value of DEVICE_ON +by the DIX routine EnableDevice, which is called from InitAndStartDevices. +When called with this mode, it should call AddEnabledDevice to cause the +server to begin checking for available input from this device. + + + +>From InitAndStartDevices, EnableDevice is called for all devices that have +the "inited" and "startup" fields in the DeviceIntRec set to TRUE. The +"inited" field is set by InitAndStartDevices to the value returned by +the deviceproc when called with a mode value of DEVICE_INIT. The "startup" +field is set by AddInputDevice to value of the second parameter (autoStart). + + + +When the server is first initialized, it should only be checking for input +from the core X keyboard and pointer. One way to accomplish this is to +call AddInputDevice for the core X keyboard and pointer with an +autoStart value equal to TRUE, while calling AddInputDevice for +input extension devices with an autoStart value equal to FALSE. If this is +done, EnableDevice will skip all input extension devices during server +initialization. In this case, +the OpenInputDevice routine should set the "startup" field to TRUE +when called for input extension devices. This will cause ProcXOpenInputDevice +to call EnableDevice for those devices when a client first does an +XOpenDevice request. + + + +DIX Input Class Initialization Routines + + +DIX routines are defined to initialize each of the defined input classes. +The defined classes are: + + + + + + +KeyClass - the device has keys. + + + + +ButtonClass - the device has buttons. + + + + +ValuatorClass - the device reports motion data or positional data. + + + + +Proximitylass - the device reports proximity information. + + + + +FocusClass - the device can be focused. + + + + +FeedbackClass - the device supports some kind of feedback + + + + + + + +DIX routines are provided to initialize the X pointer and keyboard, as in +previous releases of X. During X initialization, InitPointerDeviceStruct +is called to initialize the X pointer, and InitKeyboardDeviceStruct is +called to initialize the X keyboard. There is no +corresponding routine for extension input devices, since they do not all +support the same classes of input. Instead, DDX is responsible for the +initialization of the input classes supported by extension devices. +A description of the routines provided by DIX to perform that initialization +follows. + + +InitKeyClassDeviceStruct + + +This function is provided to allocate and initialize a KeyClassRec, and +should be called for extension devices that have keys. It is passed a pointer +to the device, and pointers to arrays of keysyms and modifiers reported by +the device. It returns FALSE if the KeyClassRec could not be allocated, +or if the maps for the keysyms and and modifiers could not be allocated. +Its parameters are: + + + + +Bool +InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers) + DeviceIntPtr dev; + KeySymsPtr pKeySyms; + CARD8 pModifiers[]; + + + + +The DIX entry point InitKeyboardDeviceStruct calls this routine for the +core X keyboard. It must be called explicitly for extension devices +that have keys. + + + +InitButtonClassDeviceStruct + + +This function is provided to allocate and initialize a ButtonClassRec, and +should be called for extension devices that have buttons. It is passed a +pointer to the device, the number of buttons supported, and a map of the +reported button codes. It returns FALSE if the ButtonClassRec could not be +allocated. Its parameters are: + + + + +Bool +InitButtonClassDeviceStruct(dev, numButtons, map) + register DeviceIntPtr dev; + int numButtons; + CARD8 *map; + + + + +The DIX entry point InitPointerDeviceStruct calls this routine for the +core X pointer. It must be called explicitly for extension devices that +have buttons. + + + +InitValuatorClassDeviceStruct + + +This function is provided to allocate and initialize a ValuatorClassRec, and +should be called for extension devices that have valuators. It is passed the +number of axes of motion reported by the device, the address of the motion +history procedure for the device, the size of the motion history buffer, +and the mode (Absolute or Relative) of the device. It returns FALSE if +the ValuatorClassRec could not be allocated. Its parameters are: + + + + +Bool +InitValuatorClassDeviceStruct(dev, numAxes, motionProc, numMotionEvents, mode) + DeviceIntPtr dev; + int (*motionProc)(); + int numAxes; + int numMotionEvents; + int mode; + + + + +The DIX entry point InitPointerDeviceStruct calls this routine for the +core X pointer. It must be called explicitly for extension devices that +report motion. + + + +InitValuatorAxisStruct + + +This function is provided to initialize an XAxisInfoRec, and +should be called for core and extension devices that have valuators. +The space for the XAxisInfoRec is allocated by +the InitValuatorClassDeviceStruct function, but is not initialized. + + + +InitValuatorAxisStruct should be called once for each axis of motion +reported by the device. Each +invocation should be passed the axis number (starting with 0), the +minimum value for that axis, the maximum value for that axis, and the +resolution of the device in counts per meter. If the device reports +relative motion, 0 should be reported as the minimum and maximum values. +InitValuatorAxisStruct has the following parameters: + +InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution) + DeviceIntPtr dev; + int axnum; + int minval; + int maxval; + int resolution; + + + + +This routine is not called by InitPointerDeviceStruct for the +core X pointer. It must be called explicitly for core and extension devices +that report motion. + + + +InitFocusClassDeviceStruct + + +This function is provided to allocate and initialize a FocusClassRec, and +should be called for extension devices that can be focused. It is passed a +pointer to the device, and returns FALSE if the allocation fails. +It has the following parameter: + +Bool +InitFocusClassDeviceStruct(dev) + DeviceIntPtr dev; + + + + +The DIX entry point InitKeyboardDeviceStruct calls this routine for the +core X keyboard. It must be called explicitly for extension devices +that can be focused. Whether or not a particular device can be focused +is left implementation-dependent. + + + +InitProximityClassDeviceStruct + + +This function is provided to allocate and initialize a ProximityClassRec, and +should be called for extension absolute pointing devices that report proximity. +It is passed a pointer to the device, and returns FALSE if the allocation fails. +It has the following parameter: + +Bool +InitProximityClassDeviceStruct(dev) + DeviceIntPtr dev; + + + + +Initializing Feedbacks + + + + +InitKbdFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize a KbdFeedbackClassRec, and +may be called for extension devices that support some or all of the +feedbacks that the core keyboard supports. It is passed a +pointer to the device, a pointer to the procedure that sounds the bell, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc) + DeviceIntPtr dev; + void (*bellProc)(); + void (*controlProc)(); + +The DIX entry point InitKeyboardDeviceStruct calls this routine for the +core X keyboard. It must be called explicitly for extension devices +that have the same feedbacks as a keyboard. Some feedbacks, such as LEDs and +bell, can be supported either with a KbdFeedbackClass or with BellFeedbackClass +and LedFeedbackClass feedbacks. + + + +InitPtrFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize a PtrFeedbackClassRec, and +should be called for extension devices that allow the setting of acceleration +and threshold. It is passed a pointer to the device, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitPtrFeedbackClassDeviceStruct(dev, controlProc) + DeviceIntPtr dev; + void (*controlProc)(); + + + + +The DIX entry point InitPointerDeviceStruct calls this routine for the +core X pointer. It must be called explicitly for extension devices +that support the setting of acceleration and threshold. + + + +InitLedFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize a LedFeedbackClassRec, and +should be called for extension devices that have LEDs. +It is passed a pointer to the device, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitLedFeedbackClassDeviceStruct(dev, controlProc) + DeviceIntPtr dev; + void (*controlProc)(); + + + + +Up to 32 LEDs per feedback can be supported, and a device may have +multiple feedbacks of the same type. + + + +InitBellFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize a BellFeedbackClassRec, +and should be called for extension devices that have a bell. +It is passed a pointer to the device, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitBellFeedbackClassDeviceStruct(dev, bellProc, controlProc) + DeviceIntPtr dev; + void (*bellProc)(); + void (*controlProc)(); + + + + +InitStringFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize a StringFeedbackClassRec, +and should be called for extension devices that have a display upon which a +string can be displayed. +It is passed a pointer to the device, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitStringFeedbackClassDeviceStruct(dev, controlProc, max_symbols, + num_symbols_supported, symbols) + DeviceIntPtr dev; + void (*controlProc)(); + int max_symbols: + int num_symbols_supported; + KeySym *symbols; + + + + +InitIntegerFeedbackClassDeviceStruct + + +This function is provided to allocate and initialize an +IntegerFeedbackClassRec, +and should be called for extension devices that have a display upon which an +integer can be displayed. +It is passed a pointer to the device, +and a pointer to the device control procedure. +It returns FALSE if the allocation fails, and has the following parameters: + +Bool +InitIntegerFeedbackClassDeviceStruct(dev, controlProc) + DeviceIntPtr dev; + void (*controlProc)(); + + + + + + +Initializing The Device Name And Type + + +The device name and type can be initialized by calling AssignTypeAndName +with the following parameters: + +void +AssignTypeAndName(dev, type, name) + DeviceIntPtr dev; + Atom type; + char *name; + + + + +This will allocate space for the device name and copy the name that was passed. +The device type can be obtained by calling MakeAtom with one of the names +defined for input devices. MakeAtom has the following parameters: + +Atom +MakeAtom(name, len, makeit) + char *name; + int len; + Bool makeit; + + + + +Since the atom was already made when the input extension was initialized, the +value of makeit should be FALSE; + + + + +Closing Extension Devices + + +The DisableDevice entry point is provided by DIX to disable input devices. +It calls the device control routine for the specified +device with a mode value of DEVICE_OFF. The device control routine should +call RemoveEnabledDevice to stop the server from checking for input from +that device. + + + +DisableDevice is not called by any input extension routines. It can be +called from the CloseInputDevice routine, which is called by +ProcXCloseDevice when a client makes an XCloseDevice request. If +DisableDevice is called, it should only be called when the last client +using the extension device has terminated or called XCloseDevice. + + + +Implementation-Dependent Routines + + +Several input extension protocol requests have +implementation-dependent entry points. Default routines +are defined for these entry points and contained in the source +file extensions/server/xinput/xstubs.c. Some implementations may +be able to use the default routines without change. +The following sections describe each of these routines. + + +AddOtherInputDevices + + +AddOtherInputDevice is called from ProcXListInputDevices as a result of +an XListInputDevices protocol request. It may be needed by +implementations that do not open extension input devices until requested +to do so by some client. These implementations may not initialize +all devices when the X server starts up, because some of those devices +may be in use. Since the XListInputDevices +function only lists those devices that have been initialized, +AddOtherInputDevices is called to give DDX a chance to +initialize any previously unavailable input devices. + + + +A sample AddOtherInputDevices routine might look like the following: + +void +AddOtherInputDevices () + { + DeviceIntPtr dev; + int i; + + for (i=0; i<MAX_DEVICES; i++) + { + if (!local_dev[i].initialized && available(local_dev[i])) + { + dev = (DeviceIntPtr) AddInputDevice (local_dev[i].deviceProc, TRUE); + dev->public.devicePrivate = local_dev[i]; + RegisterOtherDevice (dev); + dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); + } + } + } + + + + +The default AddOtherInputDevices routine in xstubs.c does nothing. +If all input extension devices are initialized when the server +starts up, it can be left as a null routine. + + + +OpenInputDevice + + +Some X server implementations open all input devices when the server +is initialized and never close them. Other implementations may open only +the X pointer and keyboard devices during server initialization, +and open other input devices only when some client makes an +XOpenDevice request. This entry point is for the latter type of +implementation. + + + +If the physical device is not already open, it can be done in this routine. +In this case, the server must keep track of the fact that one or more clients +have the device open, and physically close it when the last client that has +it open makes an XCloseDevice request. + + + +The default implementation is to do nothing (assume all input devices +are opened during X server initialization and kept open). + + + +CloseInputDevice + + +Some implementations may close an input device when the last client +using that device requests that it be closed, or terminates. +CloseInputDevice is called from ProcXCloseDevice when a client +makes an XCloseDevice protocol request. + + + +The default implementation is to do nothing (assume all input devices +are opened during X server initialization and kept open). + + + +SetDeviceMode + + +Some implementations support input devices that can report +either absolute positional data or relative motion. The XSetDeviceMode +protocol request is provided to allow DDX to change the current mode of +such a device. + + + +The default implementation is to always return a BadMatch error. If the +implementation does not support any input devices that are capable of +reporting both relative motion and absolute position information, the +default implementation may be left unchanged. + + + +SetDeviceValuators + + +Some implementations support input devices that allow their valuators to be +set to an initial value. The XSetDeviceValuators +protocol request is provided to allow DDX to set the valuators of +such a device. + + + +The default implementation is to always return a BadMatch error. If the +implementation does not support any input devices that are allow their +valuators to be set, the default implementation may be left unchanged. + + + +ChangePointerDevice + + +The XChangePointerDevice protocol request is provided to change which device is +used as the X pointer. Some implementations may maintain information +specific to the X pointer in the private data structure pointed to by +the DeviceIntRec. ChangePointerDevice is called to allow such +implementations to move that information to the new pointer device. +The current location of the X cursor is an example of the type of +information that might be affected. + + + +The DeviceIntRec structure that describes the X pointer device does not +contain a FocusRec. If the device that has been made into the new X pointer +was previously a device that could be focused, ProcXChangePointerDevice will +free the FocusRec associated with that device. + + + +If the server implementation desires to allow clients to focus the old pointer +device (which is now accessible through the input extension), it should call +InitFocusClassDeviceStruct for the old pointer device. + + + +The XChangePointerDevice protocol request also allows the client +to choose which axes of the new pointer device are used to move +the X cursor in the X- and Y- directions. If the axes are different +than the default ones, the server implementation should record that fact. + + + +If the server implementation supports input devices with valuators that +are not allowed to be used as the X pointer, they should be screened out +by this routine and a BadDevice error returned. + + + +The default implementation is to do nothing. + + + +ChangeKeyboardDevice + + +The XChangeKeyboardDevice protocol request is provided to change which device is +used as the X keyboard. Some implementations may maintain information +specific to the X keyboard in the private data structure pointed to by +the DeviceIntRec. ChangeKeyboardDevice is called to allow such +implementations to move that information to the new keyboard device. + + + +The X keyboard device can be focused, and the DeviceIntRec that describes +that device has a FocusRec. If the device that has been made into the new X +keyboard did not previously have a FocusRec, +ProcXChangeKeyboardDevice will allocate one for it. + + + +If the implementation does not want clients to be able to focus the old X +keyboard (which has now become available as an input extension device) +it should call DeleteFocusClassDeviceStruct to free the FocusRec. + + + +If the implementation supports input devices with keys that are not allowed +to be used as the X keyboard, they should be checked for here, and a +BadDevice error returned. + + + +The default implementation is to do nothing. + + + + +Input Extension Events + + +Events accessed through the input extension are analogous to the core input +events, but have different event types. They are of types +DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, +DeviceButtonRelease, DeviceDeviceMotionNotify, +DeviceProximityIn, DeviceProximityOut, and DeviceValuator. +These event types are not constants. Instead, they are external integers +defined by the input extension. Their actual values will depend on which +extensions are supported by a server, and the order in which they are +initialized. + + + +The data structures that define these +events are defined in the file extensions/include/XIproto.h. Other +input extension constants needed by DDX are defined in the file +extensions/include/XI.h. + + + +Some events defined by the input extension contain more information than can +be contained in the 32-byte xEvent data structure. To send this information +to clients, DDX must generate two or more 32-byte wire events. The following +sections describe the contents of these events. + + +Device Key Events + + +DeviceKeyPresss events contain all the information that is contained in +a core KeyPress event, and also the following additional information: + + + + + + + + + +deviceid - the identifier of the device that generated the event. + + + + +device_state - the state of any modifiers on the device that generated the event + + + + +num_valuators - the number of valuators reported in this event. + + + + +first_valuator - the first valuator reported in this event. + + + + +valuator0 through valuator5 - the values of the valuators. + + + + + + + +In order to pass this information to the input extension library, two 32-byte +wire events must be generated by DDX. The first has an event type of +DeviceKeyPress, and the second has an event type of \fPDeviceValuator\fP. + + + +The following code fragment shows how the two wire events could be initialized: + + + + + extern int DeviceKeyPress; + DeviceIntPtr dev; + xEvent xE[2]; + CARD8 id, num_valuators; + INT16 x, y, pointerx, pointery; + Time timestamp; + deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE; + deviceValuator *xv; + + xev->type = DeviceKeyPress; /* defined by input extension */ + xev->detail = keycode; /* key pressed on this device */ + xev->time = timestamp; /* same as for core events */ + xev->rootX = pointerx; /* x location of core pointer */ + xev->rootY = pointery; /* y location of core pointer */ + + /******************************************************************/ + /* */ + /* The following field does not exist for core input events. */ + /* It contains the device id for the device that generated the */ + /* event, and also indicates whether more than one 32-byte wire */ + /* event is being sent. */ + /* */ + /******************************************************************/ + + xev->deviceid = dev->id | MORE_EVENTS; /* sending more than 1*/ + + /******************************************************************/ + /* Fields in the second 32-byte wire event: */ + /******************************************************************/ + + xv = (deviceValuator *) ++xev; + xv->type = DeviceValuator; /* event type of second event */ + xv->deviceid = dev->id; /* id of this device */ + xv->num_valuators = 0; /* no valuators being sent */ + xv->device_state = 0; /* will be filled in by DIX */ + + + + +Device Button Events + + +DeviceButton events contain all the information that is contained in +a core button event, and also the same additional information that a +DeviceKey event contains. + + + +Device Motion Events + + +DeviceMotion events contain all the information that is contained in +a core motion event, and also additional valuator information. At least +two wire events are required to contain this information. +The following code fragment shows how the two wire events could be initialized: + + + + + extern int DeviceMotionNotify; + DeviceIntPtr dev; + xEvent xE[2]; + CARD8 id, num_valuators; + INT16 x, y, pointerx, pointery; + Time timestamp; + deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE; + deviceValuator *xv; + + xev->type = DeviceMotionNotify; /* defined by input extension */ + xev->detail = keycode; /* key pressed on this device */ + xev->time = timestamp; /* same as for core events */ + xev->rootX = pointerx; /* x location of core pointer */ + xev->rootY = pointery; /* y location of core pointer */ + + /******************************************************************/ + /* */ + /* The following field does not exist for core input events. */ + /* It contains the device id for the device that generated the */ + /* event, and also indicates whether more than one 32-byte wire */ + /* event is being sent. */ + /* */ + /******************************************************************/ + + xev->deviceid = dev->id | MORE_EVENTS; /* sending more than 1*/ + + /******************************************************************/ + /* Fields in the second 32-byte wire event: */ + /******************************************************************/ + + xv = (deviceValuator *) ++xev; + xv->type = DeviceValuator; /* event type of second event */ + xv->deviceid = dev->id; /* id of this device */ + xv->num_valuators = 2; /* 2 valuators being sent */ + xv->first_valuator = 0; /* first valuator being sent */ + xv->device_state = 0; /* will be filled in by DIX */ + xv->valuator0 = x; /* first axis of this device */ + xv->valuator1 = y; /* second axis of this device */ + + + + +Up to six axes can be reported in the deviceValuator event. If the device +is reporting more than 6 axes, additional pairs of DeviceMotionNotify and +DeviceValuator events should be sent, with the first_valuator field +set correctly. + + + +Device Proximity Events + + +Some input devices that report absolute positional information, such as +graphics tablets and touchscreens, may report proximity events. +ProximityIn +events are generated when a pointing device like a stylus, or in the case +of a touchscreen, the user's finger, comes into close proximity with the +surface of the input device. ProximityOut events are generated when +the stylus or finger leaves the proximity of the input devices surface. + + + +Proximity events contain almost the same information as button events. +The event type is ProximityIn or ProximityOut, and there is no +detail information. + + + + + + + + diff --git a/doc/xml/Xserver-spec.xml b/doc/Xserver-spec.xml similarity index 97% rename from doc/xml/Xserver-spec.xml rename to doc/Xserver-spec.xml index 4811a30a4..7d7f9152c 100644 --- a/doc/xml/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -442,18 +442,29 @@ and type; if skipFree is true, then the deleteFunc is not called. To look up a resource, use one of the following.
- pointer LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; - - pointer LookupIDByClass(id, classes) - XID id; - RESTYPE classes; - -
-LookupIDByType finds a resource with the given id and exact type. -LookupIDByClass finds a resource with the given id whose type is -included in any one of the specified classes. + int dixLookupResourceByType( + pointer *result, + XID id, + RESTYPE rtype, + ClientPtr client, + Mask access_mode); + + int dixLookupResourceByClass( + pointer *result, + XID id, + RESTYPE rclass, + ClientPtr client, + Mask access_mode); + + +dixLookupResourceByType finds a resource with the given id and exact type. +dixLookupResourceByClass finds a resource with the given id whose type is +included in any one of the specified classes. +The client and access_mode must be provided to allow security extensions to +check if the client has the right privileges for the requested access. +The bitmask values defined in the dixaccess.h header are or'ed together +to define the requested access_mode. +
@@ -469,7 +480,7 @@ these operations. Before getting bogged down in the interface details, an typical usage example should establish the framework. Let's look at the ClientStateCallback in dix/dispatch.c. The purpose of this particular -callback is to notify intereseted parties when a client's state +callback is to notify interested parties when a client's state (initial, running, gone) changes. The callback is "created" in this case by simply declaring a variable:
@@ -478,7 +489,7 @@ case by simply declaring a variable: Whenever the client's state changes, the following code appears, which notifies -all intereseted parties of the change: +all interested parties of the change:
if (ClientStateCallback) CallCallbacks(&ClientStateCallback, (pointer)client);
@@ -497,24 +508,6 @@ When CallCallbacks is invoked on the list, func will be called thusly:
Now for the details. -
- - Bool CreateCallbackList(pcbl, cbfuncs) - CallbackListPtr *pcbl; - CallbackFuncsPtr cbfuncs; - -
-CreateCallbackList creates a callback list. We envision that this -function will be rarely used because the callback list is created -automatically (if it doesn't already exist) when the first call to -AddCallback is made on the list. The only reason to explicitly create -the callback list with this function is if you want to override the -implementation of some of the other operations on the list by passing -your own cbfuncs. You also lose something by explicit creation: you -introduce an order dependency during server startup because the list -must be created before any modules subscribe to it. Returns TRUE if -successful.
-
Bool AddCallback(pcbl, callback, subscriber_data) @@ -595,8 +588,9 @@ used here which takes the minor opcode from the normal place in the request There are a number of macros in Xserver/include/dix.h which are useful to the extension writer. Ones of particular interest are: REQUEST, REQUEST_SIZE_MATCH, REQUEST_AT_LEAST_SIZE, -REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, LOOKUP_DRAWABLE, VERIFY_GC, and +REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, and VALIDATE_DRAWABLE_AND_GC. Useful byte swapping macros can be found +in Xserver/include/dix.h: WriteReplyToClient and WriteSwappedDataToClient; and in Xserver/include/misc.h: lswapl, lswaps, LengthRestB, LengthRestS, LengthRestL, SwapRestS, SwapRestL, swapl, swaps, cpswapl, and cpswaps.
@@ -765,7 +759,7 @@ These registered block handlers are called after the per-screen handlers: void (*BlockHandler) (blockData, pptv, pReadmask) pointer blockData; - OSTimePtr pptv; + OsTimerPtr pptv; pointer pReadmask; @@ -776,7 +770,7 @@ which on UNIX family systems is generally represented by a struct timeval consisting of seconds and microseconds in 32 bit values. As a convenience to reduce error prone struct timeval computations which require modulus arithmetic and correct overflow behavior in the face of -millisecond wrapping throrugh 32 bits, +millisecond wrapping through 32 bits,
void AdjustWaitForDelay(pointer /*waitTime*, unsigned long /* newdelay */) @@ -881,7 +875,7 @@ and RemoveEnabledDevice are in Xserver/os/connection.c. Similarly, the X server or an extension may need to wait for some timeout. Early X releases implemented this functionality using block and wakeup handlers, but this has been rewritten to use a general timer facilty, and the -internal screen saver facilties reimplemented to use Timers. +internal screen saver facilities reimplemented to use Timers. These functions are TimerInit, TimerForce, TimerSet, TimerCheck, TimerCancel, and TimerFree, as defined in Xserver/include/os.h. A callback function will be called when the timer fires, along with the current time, and a user provided argument. @@ -919,11 +913,11 @@ for the timer entry. void TimerCancel(OsTimerPtr /* pTimer */) - void TimerFree(OSTimerPtr /* pTimer */) + void TimerFree(OsTimerPtr /* pTimer */)
-TimerInit frees any exisiting timer entries. TimerForce forces a call to the timer's +TimerInit frees any existing timer entries. TimerForce forces a call to the timer's callback function and returns true if the timer entry existed, else it returns false and does not call the callback function. TimerCancel will cancel the specified timer. TimerFree calls TimerCancel and frees the specified timer. @@ -1188,7 +1182,8 @@ are requests in that client's input queue. Font Support In the sample server, fonts are encoded in disk files or fetched from the -font server. +font server. The two fonts required by the server, fixed +and cursor are commonly compiled into the font library. For disk fonts, there is one file per font, with a file name like "fixed.pcf". Font server fonts are read over the network using the X Font Server Protocol. The disk directories containing disk fonts and @@ -1202,9 +1197,10 @@ appropriate code in the Font Library, you will automatically export fonts in that format both through the X server and the Font server. -With the incorporation of font-server based fonts and the Speedo donation -from Bitstream, the font interfaces have been moved into a separate -library, now called the Font Library (../fonts/lib). These routines are +The code for processing fonts in different formats, as well as handling the +metadata files for them on disk (such as fonts.dir) is +located in the libXfont library, which is provided as a separately compiled +module. These routines are shared between the X server and the Font server, so instead of this document specifying what you must implement, simply refer to the font library interface specification for the details. All of the interface code to the Font @@ -1215,20 +1211,12 @@ library is contained in dix/dixfonts.c Memory Management Memory management is based on functions in the C runtime library. -Xalloc(), Xrealloc(), and Xfree() work just like malloc(), realloc(), -and free(), except that you can pass a null pointer to Xrealloc() to -have it allocate anew or pass a null pointer to Xfree() and nothing -will happen. The versions in the sample server also do some checking -that is useful for debugging. Consult a C runtime library reference +Xalloc(), Xrealloc(), and Xfree() are deprecated aliases for malloc(), +realloc(), and free(), and you should simply call the C library functions +directly. Consult a C runtime library reference manual for more details. -The macros ALLOCATE_LOCAL and DEALLOCATE_LOCAL are provided in -Xserver/include/os.h. These are useful if your compiler supports -alloca() (or some method of allocating memory from the stack); and are -defined appropriately on systems which support it. - - Treat memory allocation carefully in your implementation. Memory leaks can be very hard to find and are frustrating to a user. An X server could be running for days or weeks without being reset, just @@ -1358,71 +1346,7 @@ terminate the server; it must not return. The sample server implementation for these routines -is in Xserver/os/util.c. - - -
- Idiom Support - -The DBE specification introduces the notion of idioms, which are -groups of X requests which can be executed more efficiently when taken -as a whole compared to being performed individually and sequentially. -This following server internal support to allows DBE -implementations, as well as other parts of the server, -to do idiom processing. - - -
- - xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore) -
-If req is NULL, the return value will be a pointer to the start of the -complete request that follows the one currently being executed for the -client. If req is not NULL, the function assumes that req is a -pointer to a request in the client's request buffer, and the return -value will be a pointer to the the start of the complete request that -follows req. If the complete request is not available, the function -returns NULL; pointers to partial requests will never be returned. If -(and only if) readmore is TRUE, PeekNextRequest should try to read an -additional request from the client if one is not already available in -the client's request buffer. If PeekNextRequest reads more data into -the request buffer, it should not move or change the existing data. -
- -
- - void SkipRequests(xReqPtr req, ClientPtr client, int numskipped) -
-The requests for the client up to and including the one specified by -req will be skipped. numskipped must be the number of requests being -skipped. Normal request processing will resume with the request that -follows req. The caller must not have modified the contents of the -request buffer in any way (e.g., by doing byte swapping in place). -
- -Additionally, two macros in os.h operate on the xReq -pointer returned by PeekNextRequest: -
- - int ReqLen(xReqPtr req, ClientPtr client) -
-The value of ReqLen is the request length in bytes of the given xReq. -
- - otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr) -
-The value of CastxReq is the conversion of the given request pointer -to an otherReqTypePtr (which should be a pointer to a protocol -structure type). Only those fields which come after the length field -of otherReqType may be accessed via the returned pointer. -
- -Thus the first two fields of a request, reqType and data, can be -accessed directly using the xReq * returned by PeekNextRequest. The -next field, the length, can be accessed with ReqLen. Fields beyond -that can be accessed with CastxReq. This complexity was necessary -because of the reencoding of core protocol that can happen due to the -BigRequests extension. +is in Xserver/os/log.c along with other routines for logging messages.
@@ -1710,8 +1634,6 @@ Input initialization is a bit complicated. It all starts with InitInput(), a routine that you write to call AddInputDevice() twice (once for pointing device and once for keyboard.) -You also want to call RegisterKeyboardDevice() and RegisterPointerDevice() -on them.
When you Add the devices, a routine you supply for each device @@ -1731,8 +1653,6 @@ the pointer is the pointer. InitInput is a DDX routine you must write to initialize the input subsystem in DDX. It must call AddInputDevice() for each device that might generate events. -In addition, you must register the main keyboard and pointing devices by -calling RegisterPointerDevice() and RegisterKeyboardDevice().
@@ -1755,25 +1675,6 @@ Note also that except for the main keyboard and pointing device, an extension is needed to provide for a client interface to a device. -
- - void RegisterPointerDevice(device) - DevicePtr device; -
-RegisterPointerDevice is a DIX routine that your DDX code calls that -makes that device the main pointing device. -This routine is called once upon initialization and cannot be called again. -
- -
- - void RegisterKeyboardDevice(device) - DevicePtr device; -
-RegisterKeyboardDevice makes the given device the main keyboard. -This routine is called once upon initialization and cannot be called again. -
- The following DIX procedures return the specified DevicePtr. They may or may not be useful to DDX implementors. @@ -1908,7 +1809,7 @@ printed on each keycap. (See X11/keysym.h) Legal modifier keys must generate both up and down transitions. When a client tries to change a modifier key (for instance, to make "A" the -"Control" key), DIX calls the following routine, which should retuurn +"Control" key), DIX calls the following routine, which should return TRUE if the key can be used as a modifier on the given device:
@@ -2809,7 +2710,7 @@ Xserver/dix/colormap.c.)
-ListInstalledColormaps fills the pCMapList in with the resource ids +ListInstalledColormaps fills the pCmapList in with the resource ids of the installed maps and returns a count of installed maps. pCmapList will point to an array of size MaxInstalledMaps that was allocated by the caller.
@@ -3053,16 +2954,17 @@ The sample server implementation is in Xserver/fb/fbscreen.c.
pScreen->SourceValidate(pDrawable, x, y, width, height) DrawablePtr pDrawable; int x, y, width, height; + unsigned int subWindowMode;
SourceValidate should be called by CopyArea/CopyPlane primitives when -the source drawable is not the same as the destination, and the -SourceValidate function pointer in the screen is non-null. If you know that +the SourceValidate function pointer in the screen is non-null. If you know that you will never need SourceValidate, you can avoid this check. Currently, SourceValidate is used by the mi software cursor code to remove the cursor from the screen when the source rectangle overlaps the cursor position. x,y,width,height describe the source rectangle (source relative, that is) -for the copy operation.
+for the copy operation. subWindowMode comes from the GC or source Picture. +
@@ -3707,7 +3609,7 @@ this screen function. The new border width is given by width.
This function is called for windows that are being unrealized as part of an UnrealizeTree. pChild is the window being unrealized, pWin is an -ancestor, and the fromConfigure value is simply propogated from UnrealizeTree.
+ancestor, and the fromConfigure value is simply propagated from UnrealizeTree. @@ -5112,7 +5014,7 @@ mi and fb implementations. ListInstalledColormapsddxScreen LookupKeyboardDevicedix LookupPointerDevicedix -ModifyPixmapheadermiScreen +ModifyPixmapHeadermiScreen NextAvailableClientdix OsInitos PaintWindowBackgroundmiWindow @@ -5163,8 +5065,6 @@ mi and fb implementations. -RegisterKeyboardDevicedix -RegisterPointerDevicedix RemoveEnabledDeviceos ResetCurrentRequestos SaveScreenddxScreen diff --git a/doc/dtrace/.gitignore b/doc/dtrace/.gitignore new file mode 100644 index 000000000..0d40e0d22 --- /dev/null +++ b/doc/dtrace/.gitignore @@ -0,0 +1,5 @@ +*.html +*.pdf +*.ps +*.txt +*.db diff --git a/doc/dtrace/Makefile.am b/doc/dtrace/Makefile.am new file mode 100644 index 000000000..aaf5a1267 --- /dev/null +++ b/doc/dtrace/Makefile.am @@ -0,0 +1,17 @@ + +if ENABLE_DOCS +if HAVE_XMLTO +if XSERVER_DTRACE + +# Main DocBook/XML files (DOCTYPE book) +docbook = Xserver-DTrace.xml + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir) + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif XSERVER_DTRACE +endif HAVE_XMLTO +endif ENABLE_DOCS diff --git a/doc/xml/dtrace/Xserver-DTrace.xml b/doc/dtrace/Xserver-DTrace.xml similarity index 99% rename from doc/xml/dtrace/Xserver-DTrace.xml rename to doc/dtrace/Xserver-DTrace.xml index 290f0d3eb..69cd30eb0 100644 --- a/doc/xml/dtrace/Xserver-DTrace.xml +++ b/doc/dtrace/Xserver-DTrace.xml @@ -576,4 +576,3 @@ Xserver$1:::client-disconnect - diff --git a/doc/xml/.gitignore b/doc/xml/.gitignore deleted file mode 100644 index 3d050f0d0..000000000 --- a/doc/xml/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Add & Override for this directory and its subdirectories -xserver.ent -Xserver-spec.html -Xserver-spec.pdf -Xserver-spec.txt -xorg.css diff --git a/doc/xml/Makefile.am b/doc/xml/Makefile.am deleted file mode 100644 index e66f192e2..000000000 --- a/doc/xml/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# - -SUBDIRS = dtrace - -XML_FILES = Xserver-spec.xml - -include xmlrules.in - -if ENABLE_DEVEL_DOCS -noinst_DATA = $(BUILT_DOC_FILES) -endif -CLEANFILES = $(CLEAN_DOC_FILES) - -EXTRA_DIST = $(XML_FILES) diff --git a/doc/xml/dtrace/.gitignore b/doc/xml/dtrace/.gitignore deleted file mode 100644 index a43c4e134..000000000 --- a/doc/xml/dtrace/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -Xserver-DTrace.html -Xserver-DTrace.pdf -Xserver-DTrace.txt -xorg.css diff --git a/doc/xml/dtrace/Makefile.am b/doc/xml/dtrace/Makefile.am deleted file mode 100644 index 0e25e5d43..000000000 --- a/doc/xml/dtrace/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# - -XML_FILES = Xserver-DTrace.xml - -include ../xmlrules.in - -if XSERVER_DTRACE -doc_DATA = $(BUILT_DOC_FILES) -else -noinst_DATA = $(BUILT_DOC_FILES) -endif - -CLEANFILES = $(CLEAN_DOC_FILES) - -EXTRA_DIST = $(XML_FILES) diff --git a/doc/xml/xmlrules.in b/doc/xml/xmlrules.in deleted file mode 100644 index b7fda11c0..000000000 --- a/doc/xml/xmlrules.in +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# - -# This file is included by Makefile.am in subdirectories that have -# DocBook XML documentation files. -# -# No files are automatically distributed or installed by this subset of rules -# Any files to be distributed or installed would be listed in the including -# Makefile.am - -TXT_FILES = $(XML_FILES:%.xml=%.txt) -HTML_FILES = $(XML_FILES:%.xml=%.html) -PDF_FILES = $(XML_FILES:%.xml=%.pdf) - -BUILT_DOC_FILES = - -SUFFIXES = .xml .txt .html .pdf - -XML_ENT_DIR = $(abs_top_builddir)/doc/xml -XMLTO_FLAGS = --searchpath $(XML_ENT_DIR) - -if HAVE_STYLESHEETS -XMLTO_FLAGS += -m $(XSL_STYLESHEET) -BUILT_DOC_FILES += xorg.css - -xorg.css: $(STYLESHEET_SRCDIR)/xorg.css - $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@ -endif - -if HAVE_XMLTO -if HAVE_XMLTO_TEXT -BUILT_DOC_FILES += $(TXT_FILES) -.xml.txt: - @rm -f $@ - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $< -endif - -BUILT_DOC_FILES += $(HTML_FILES) -.xml.html: - @rm -f $@ - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< - -if HAVE_FOP -BUILT_DOC_FILES += $(PDF_FILES) -.xml.pdf: - @rm -f $@ - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $< -endif - -endif - -CLEAN_DOC_FILES = $(TXT_FILES) $(HTML_FILES) $(PDF_FILES) xorg.css - -# All the files we build depend on the entities -$(BUILT_DOC_FILES): $(XML_ENT_DIR)/xserver.ent - -$(XML_ENT_DIR)/xserver.ent: - (cd $(XML_ENT_DIR) && $(MAKE) $(AM_MAKEFLAGS) $(@F)) diff --git a/docbook.am b/docbook.am new file mode 100644 index 000000000..7ab7a0050 --- /dev/null +++ b/docbook.am @@ -0,0 +1,96 @@ +# +# Generate output formats for a single DocBook/XML with/without chapters +# +# Variables set by the calling Makefile: +# shelfdir: the location where the docs/specs are installed. Typically $(docdir) +# docbook: the main DocBook/XML file, no chapters, appendix or image files +# chapters: all files pulled in by an XInclude statement and images. +# + +# +# This makefile is intended for Users Documentation and Functional Specifications. +# Do not use for Developer Documentation which is not installed and does not require olink. +# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 +# for an explanation on documents classification. +# + +# DocBook/XML generated output formats to be installed +shelf_DATA = + +# DocBook/XML file with chapters, appendix and images it includes +dist_shelf_DATA = $(docbook) $(chapters) + +# +# Generate DocBook/XML output formats with or without stylesheets +# + +# Stylesheets are available if the package xorg-sgml-doctools is installed +if HAVE_STYLESHEETS + +# The location where all cross reference databases are installed +sgmldbsdir = $(XORG_SGML_PATH)/X11/dbs +masterdb = "$(sgmldbsdir)/masterdb$(suffix $@).xml" +XMLTO_FLAGS = \ + --searchpath "$(XORG_SGML_PATH)/X11" \ + --searchpath "$(abs_top_builddir)" \ + --stringparam target.database.document=$(masterdb) \ + --stringparam current.docid="$(<:.xml=)" \ + --stringparam collect.xref.targets="no" + +XMLTO_XHTML_FLAGS = \ + -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \ + --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css + +XMLTO_FO_FLAGS = \ + -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl +endif HAVE_STYLESHEETS + +shelf_DATA += $(docbook:.xml=.html) +%.html: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $< + +if HAVE_FOP +shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) +%.pdf: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $< +%.ps: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $< +endif HAVE_FOP + +if HAVE_XMLTO_TEXT +shelf_DATA += $(docbook:.xml=.txt) +%.txt: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $< +endif HAVE_XMLTO_TEXT + +# +# Generate documents cross-reference target databases +# + +# This is only possible if the xorg-sgml-doctools package is installed +if HAVE_STYLESHEETS +if HAVE_XSLTPROC + +# DocBook/XML generated document cross-reference database +sgmldbs_DATA = $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db) + +# Generate DocBook/XML document cross-reference database +# Flags for the XSL Transformation processor generating xref target databases +XSLTPROC_FLAGS = \ + --path "$(XORG_SGML_PATH)/X11" \ + --stringparam targets.filename "$@" \ + --stringparam collect.xref.targets "only" \ + --nonet --xinclude + +%.html.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \ + http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl $< + +%.fo.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \ + http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< + +endif HAVE_XSLTPROC +endif HAVE_STYLESHEETS + +CLEANFILES = $(shelf_DATA) $(sgmldbs_DATA) diff --git a/exa/exa.c b/exa/exa.c index fc15c2471..a4e294a71 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) return; RegionInit(®ion, &box, 1); - DamageRegionAppend(&pPix->drawable, ®ion); - DamageRegionProcessPending(&pPix->drawable); + DamageDamageRegion(&pPix->drawable, ®ion); RegionUninit(®ion); } @@ -422,7 +421,8 @@ exaFinishAccess(DrawablePtr pDrawable, int index) /* We always hide the devPrivate.ptr. */ pPixmap->devPrivate.ptr = NULL; - if (!pExaScr->info->FinishAccess || !exaPixmapHasGpuCopy(pPixmap)) + /* Only call FinishAccess if PrepareAccess was called and succeeded. */ + if (!pExaScr->info->FinishAccess || !pExaScr->access[i].retval) return; if (i >= EXA_PREPARE_AUX_DEST && diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 6c677c7a1..b4c0f8351 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1057,6 +1057,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, *(CARD16*)pExaPixmap->sys_ptr = pixel; break; case 8: + case 4: + case 1: *(CARD8*)pExaPixmap->sys_ptr = pixel; } diff --git a/exa/exa_driver.c b/exa/exa_driver.c index a913cfb02..b9903d1bc 100644 --- a/exa/exa_driver.c +++ b/exa/exa_driver.c @@ -115,6 +115,8 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, exaSetAccelBlock(pExaScr, pExaPixmap, w, h, bpp); + pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap); + /* During a fallback we must prepare access. */ if (pExaScr->fallback_counter) exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index ef20eb502..fd1afb246 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -98,7 +98,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, pExaPixmap->use_gpu_copy = FALSE; if (w == 1 && h == 1) { - pExaPixmap->sys_ptr = malloc((pPixmap->drawable.bitsPerPixel + 7) / 8); + pExaPixmap->sys_ptr = malloc(paddedWidth); /* Set up damage tracking */ pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, @@ -175,8 +175,10 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, depth != pPixmap->drawable.depth || bitsPerPixel != pPixmap->drawable.bitsPerPixel) { if (pExaPixmap->driverPriv) { - exaSetFbPitch(pExaScr, pExaPixmap, - width, height, bitsPerPixel); + if (devKind > 0) + pExaPixmap->fb_pitch = devKind; + else + exaSetFbPitch(pExaScr, pExaPixmap, width, height, bitsPerPixel); exaSetAccelBlock(pExaScr, pExaPixmap, width, height, bitsPerPixel); @@ -187,8 +189,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, if (has_gpu_copy && pExaPixmap->sys_ptr) { free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; - pExaPixmap->sys_pitch = devKind > 0 ? devKind : - PixmapBytePad(width, depth); + pExaPixmap->sys_pitch = PixmapBytePad(width, depth); DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index e5d90d468..70de4bd6f 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -228,10 +228,10 @@ extern DevPrivateKeyRec exaPixmapPrivateKeyRec; extern DevPrivateKeyRec exaGCPrivateKeyRec; #define exaGCPrivateKey (&exaGCPrivateKeyRec) -#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey)) +#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey)) #define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s) -#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixLookupPrivate(&(gc)->devPrivates, exaGCPrivateKey)) +#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, exaGCPrivateKey)) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) /* @@ -282,8 +282,7 @@ extern DevPrivateKeyRec exaGCPrivateKeyRec; #define EXA_PIXMAP_SCORE_PINNED 1000 #define EXA_PIXMAP_SCORE_INIT 1001 -#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixLookupPrivate(&(p)->devPrivates, exaPixmapPrivateKey)) -#define ExaSetPixmapPriv(p,a) dixSetPrivate(&(p)->devPrivates, exaPixmapPrivateKey, a) +#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, exaPixmapPrivateKey)) #define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p) #define EXA_RANGE_PITCH (1 << 0) diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index a078cc114..078b91c77 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -127,11 +127,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); - if (pExaScr->prepare_access_reg) { + if (pExaScr->prepare_access_reg && RegionInitBoxes(®, pbox, nbox)) { PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc); exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff); - RegionInit(®, pbox, nbox); RegionTranslate(®, xoff + dx, yoff + dy); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®); RegionUninit(®); @@ -140,11 +139,11 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (pExaScr->prepare_access_reg && !exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle, - pGC->alu, pGC->clientClipType)) { + pGC->alu, pGC->clientClipType) && + RegionInitBoxes (®, pbox, nbox)) { PixmapPtr pPixmap = exaGetDrawablePixmap(pDst); exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff); - RegionInit(®, pbox, nbox); RegionTranslate(®, xoff, yoff); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®); RegionUninit(®); @@ -438,7 +437,8 @@ ExaSrcValidate(DrawablePtr pDrawable, int x, int y, int width, - int height) + int height, + unsigned int subWindowMode) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv(pScreen); @@ -464,7 +464,7 @@ ExaSrcValidate(DrawablePtr pDrawable, if (pExaScr->SavedSourceValidate) { swap(pExaScr, pScreen, SourceValidate); - pScreen->SourceValidate(pDrawable, x, y, width, height); + pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode); swap(pExaScr, pScreen, SourceValidate); } } @@ -748,6 +748,8 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) return pixel; } case 8: + case 4: + case 1: { CARD8 pixel; diff --git a/fb/Makefile.am b/fb/Makefile.am index 2f3073da8..89f3babb1 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -1,9 +1,5 @@ noinst_LTLIBRARIES = libfb.la libwfb.la -INCLUDES = \ - -I$(top_srcdir)/hw/xfree86/os-support \ - -I$(top_srcdir)/hw/xfree86/os-support/bus \ - -I$(top_srcdir)/hw/xfree86/common AM_CFLAGS = $(DIX_CFLAGS) if XORG @@ -55,4 +51,4 @@ libfb_la_SOURCES = \ libwfb_la_SOURCES = $(libfb_la_SOURCES) -EXTRA_DIST = fbcmap.c fbcmap_mi.c +EXTRA_DIST = fbcmap_mi.c diff --git a/fb/fb.h b/fb/fb.h index c290ebff8..eaa21ad75 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -97,21 +97,10 @@ #if GLYPHPADBYTES != 4 #error "GLYPHPADBYTES must be 4" #endif -/* whether to bother to include 24bpp support */ -#ifndef FBNO24BIT -#define FB_24BIT -#endif - -/* - * Unless otherwise instructed, fb includes code to advertise 24bpp - * windows with 32bpp image format for application compatibility - */ -#ifdef FB_24BIT -#ifndef FBNO24_32 +/* for driver compat - intel UXA needs the second one at least */ +#define FB_24BIT #define FB_24_32BIT -#endif -#endif #define FB_STIP_SHIFT LOG2_BITMAP_PAD #define FB_STIP_UNIT (1 << FB_STIP_SHIFT) @@ -234,15 +223,6 @@ extern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data); n >>= FB_SHIFT; \ } -#ifdef FBNOPIXADDR -#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) FbMaskBits(x,w,l,n,r) -#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \ - *dst = FbDoMaskRRop(*dst,and,xor,l); \ -} -#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \ - *dst = FbDoMaskRRop(*dst,and,xor,r); \ -} -#else #define FbByteMaskInvalid 0x10 @@ -454,7 +434,6 @@ extern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data); WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \ } \ } -#endif #define FbMaskStip(x,w,l,n,r) { \ n = (w); \ @@ -612,9 +591,6 @@ fbGetWinPrivateKey (void); extern _X_EXPORT const GCOps fbGCOps; extern _X_EXPORT const GCFuncs fbGCFuncs; -#ifdef FB_24_32BIT -#define FB_SCREEN_PRIVATE -#endif /* Framebuffer access wrapper */ typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size); @@ -642,7 +618,6 @@ typedef void (*FinishWrapProcPtr)(DrawablePtr pDraw); #endif -#ifdef FB_SCREEN_PRIVATE extern _X_EXPORT DevPrivateKey fbGetScreenPrivateKey(void); @@ -658,7 +633,6 @@ typedef struct { #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey())) -#endif /* private field of GC */ typedef struct { @@ -1223,7 +1197,6 @@ fbBltOne (FbStip *src, FbBits bgand, FbBits bgxor); -#ifdef FB_24BIT extern _X_EXPORT void fbBltOne24 (FbStip *src, FbStride srcStride, /* FbStip units per scanline */ @@ -1240,7 +1213,6 @@ fbBltOne24 (FbStip *src, FbBits fgxor, FbBits bgand, FbBits bgxor); -#endif extern _X_EXPORT void fbBltPlane (FbBits *src, @@ -1262,7 +1234,7 @@ fbBltPlane (FbBits *src, Pixel planeMask); /* - * fbcmap.c + * fbcmap_mi.c */ extern _X_EXPORT int fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps); @@ -1868,7 +1840,6 @@ fbSolid (FbBits *dst, FbBits and, FbBits xor); -#ifdef FB_24BIT extern _X_EXPORT void fbSolid24 (FbBits *dst, FbStride dstStride, @@ -1879,7 +1850,6 @@ fbSolid24 (FbBits *dst, FbBits and, FbBits xor); -#endif /* * fbstipple.c diff --git a/fb/fballpriv.c b/fb/fballpriv.c index efeb26880..321903628 100644 --- a/fb/fballpriv.c +++ b/fb/fballpriv.c @@ -26,11 +26,9 @@ #include "fb.h" -#ifdef FB_SCREEN_PRIVATE static DevPrivateKeyRec fbScreenPrivateKeyRec; DevPrivateKey fbGetScreenPrivateKey(void) { return &fbScreenPrivateKeyRec; } -#endif static DevPrivateKeyRec fbGCPrivateKeyRec; DevPrivateKey @@ -48,10 +46,8 @@ fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey) if (!dixRegisterPrivateKey(&fbGCPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec))) return FALSE; -#ifdef FB_SCREEN_PRIVATE if (!dixRegisterPrivateKey(&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof (FbScreenPrivRec))) return FALSE; -#endif if (!dixRegisterPrivateKey(&fbWinPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; diff --git a/fb/fbarc.c b/fb/fbarc.c index 33e44b0c6..a0c5343e0 100644 --- a/fb/fbarc.c +++ b/fb/fbarc.c @@ -47,7 +47,6 @@ fbPolyArc (DrawablePtr pDrawable, if (pGC->lineWidth == 0) { -#ifndef FBNOPIXADDR arc = 0; if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid) { @@ -55,9 +54,7 @@ fbPolyArc (DrawablePtr pDrawable, { case 8: arc = fbArc8; break; case 16: arc = fbArc16; break; -#ifdef FB_24BIT case 24: arc = fbArc24; break; -#endif case 32: arc = fbArc32; break; } } @@ -141,7 +138,6 @@ fbPolyArc (DrawablePtr pDrawable, #endif } else -#endif miZeroPolyArc (pDrawable, pGC, narcs, parcs); } else diff --git a/fb/fbbits.c b/fb/fbbits.c index 808374309..850d1632e 100644 --- a/fb/fbbits.c +++ b/fb/fbbits.c @@ -89,7 +89,6 @@ #undef BITS4 #endif -#ifdef FB_24BIT #define BRESSOLID fbBresSolid24 #define BRESDASH fbBresDash24 #define DOTS fbDots24 @@ -147,7 +146,6 @@ #undef ARC #undef POLYLINE #undef POLYSEGMENT -#endif /* FB_24BIT */ #define BRESSOLID fbBresSolid32 #define BRESDASH fbBresDash32 diff --git a/fb/fbblt.c b/fb/fbblt.c index 38271c0c9..a0402986c 100644 --- a/fb/fbblt.c +++ b/fb/fbblt.c @@ -67,14 +67,12 @@ fbBlt (FbBits *srcLine, int startbyte, endbyte; FbDeclareMergeRop (); -#ifdef FB_24BIT if (bpp == 24 && !FbCheck24Pix (pm)) { fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX, width, height, alu, pm, reverse, upsidedown); return; } -#endif if (alu == GXcopy && pm == FB_ALLONES && !reverse && !(srcX & 7) && !(dstX & 7) && !(width & 7)) { @@ -338,7 +336,6 @@ fbBlt (FbBits *srcLine, } } -#ifdef FB_24BIT #undef DEBUG_BLT24 #ifdef DEBUG_BLT24 @@ -603,7 +600,6 @@ fbBlt24 (FbBits *srcLine, ErrorF ("\n"); #endif } -#endif /* FB_24BIT */ #if FB_SHIFT == FB_STIP_SHIFT + 1 @@ -784,7 +780,6 @@ fbBltOdd (FbBits *srcLine, } } -#ifdef FB_24BIT void fbBltOdd24 (FbBits *srcLine, FbStride srcStrideEven, @@ -826,7 +821,6 @@ fbBltOdd24 (FbBits *srcLine, } } } -#endif #endif @@ -915,7 +909,6 @@ fbBltStip (FbStip *src, &dstStrideEven, &dstStrideOdd, &dstXEven, &dstXOdd); -#ifdef FB_24BIT if (bpp == 24 && !FbCheck24Pix (pm)) { fbBltOdd24 (s, srcStrideEven, srcStrideOdd, @@ -927,7 +920,6 @@ fbBltStip (FbStip *src, width, height, alu, pm); } else -#endif { fbBltOdd (s, srcStrideEven, srcStrideOdd, srcXEven, srcXOdd, diff --git a/fb/fbbltone.c b/fb/fbbltone.c index 5d5d2e6bf..67e7853c6 100644 --- a/fb/fbbltone.c +++ b/fb/fbbltone.c @@ -26,6 +26,11 @@ #include "fb.h" +#ifdef __clang__ +/* shift overflow is intentional */ +#pragma clang diagnostic ignored "-Wshift-overflow" +#endif + /* * Example: srcX = 13 dstX = 8 (FB unit 32 dstBpp 8) * @@ -57,7 +62,6 @@ bits = (src < srcEnd ? READ(src++) : 0); \ } -#ifndef FBNOPIXADDR #define LaneCases1(n,a) case n: FbLaneCase(n,a); break #define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a) @@ -128,7 +132,6 @@ CARD8 *fbLaneTable[33] = { 0, 0, 0, 0, 0, 0, 0, 0, fb32Lane }; -#endif void fbBltOne (FbStip *src, @@ -164,12 +167,9 @@ fbBltOne (FbStip *src, Bool transparent; /* accelerate 0 nop */ int srcinc; /* source units consumed */ Bool endNeedsLoad = FALSE; /* need load for endmask */ -#ifndef FBNOPIXADDR CARD8 *fbLane; -#endif int startbyte, endbyte; -#ifdef FB_24BIT if (dstBpp == 24) { fbBltOne24 (src, srcStride, srcX, @@ -178,7 +178,6 @@ fbBltOne (FbStip *src, fgand, fgxor, bgand, bgxor); return; } -#endif /* * Do not read past the end of the buffer! @@ -238,11 +237,9 @@ fbBltOne (FbStip *src, fbBits = 0; /* unused */ if (pixelsPerDst <= 8) fbBits = fbStippleTable[pixelsPerDst]; -#ifndef FBNOPIXADDR fbLane = 0; if (transparent && fgand == 0 && dstBpp >= 8) fbLane = fbLaneTable[dstBpp]; -#endif /* * Compute total number of destination words written, but @@ -302,13 +299,11 @@ fbBltOne (FbStip *src, else #endif mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)]; -#ifndef FBNOPIXADDR if (fbLane) { fbTransparentSpan (dst, mask & startmask, fgxor, 1); } else -#endif { if (mask || !transparent) FbDoLeftMaskByteStippleRRop (dst, mask, @@ -343,7 +338,6 @@ fbBltOne (FbStip *src, } else { -#ifndef FBNOPIXADDR if (fbLane) { while (bits && n) @@ -358,7 +352,6 @@ fbBltOne (FbStip *src, dst += n; } else -#endif { while (n--) { @@ -400,13 +393,11 @@ fbBltOne (FbStip *src, else #endif mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)]; -#ifndef FBNOPIXADDR if (fbLane) { fbTransparentSpan (dst, mask & endmask, fgxor, 1); } else -#endif { if (mask || !transparent) FbDoRightMaskByteStippleRRop (dst, mask, @@ -419,7 +410,6 @@ fbBltOne (FbStip *src, } } -#ifdef FB_24BIT /* * Crufty macros to initialize the mask array, most of this @@ -438,8 +428,8 @@ fbBltOne (FbStip *src, #define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \ (Mask24Pos(x,r) < 0 ? \ - 0xffffff >> Mask24Neg (x,r) : \ - 0xffffff << Mask24Check(x,r)) : 0) + 0xffffffU >> Mask24Neg (x,r) : \ + 0xffffffU << Mask24Check(x,r)) : 0) #define SelMask24(b,n,r) ((((b) >> n) & 1) * Mask24(n,r)) @@ -747,7 +737,6 @@ fbBltOne24 (FbStip *srcLine, } } } -#endif /* * Not very efficient, but simple -- copy a single plane @@ -801,7 +790,6 @@ fbBltPlane (FbBits *src, w = width / srcBpp; pm = fbReplicatePixel (planeMask, srcBpp); -#ifdef FB_24BIT if (srcBpp == 24) { int w = 24; @@ -812,7 +800,6 @@ fbBltPlane (FbBits *src, srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,w); } else -#endif { rot0 = 0; srcMaskFirst = pm & FbBitsMask(srcX, srcBpp); @@ -828,10 +815,8 @@ fbBltPlane (FbBits *src, src += srcStride; srcMask = srcMaskFirst; -#ifdef FB_24BIT if (srcBpp == 24) srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp); -#endif srcBits = READ(s++); dstMask = dstMaskFirst; @@ -845,10 +830,8 @@ fbBltPlane (FbBits *src, if (!srcMask) { srcBits = READ(s++); -#ifdef FB_24BIT if (srcBpp == 24) srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24); -#endif srcMask = srcMask0; } if (!dstMask) diff --git a/fb/fbcmap.c b/fb/fbcmap.c deleted file mode 100644 index 3251a4caa..000000000 --- a/fb/fbcmap.c +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Copyright © 1987 Sun Microsystems, Inc. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "scrnintstr.h" -#include "colormapst.h" -#include "resource.h" -#include "fb.h" - -#ifdef XFree86Server -#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!" -#endif - -static DevPrivateKeyRec cmapScrPrivateKeyRec; -#define cmapScrPrivateKey (&cmapScrPrivateKeyRec) - -#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey)) -#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c)) - -int -fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) -{ - /* By the time we are processing requests, we can guarantee that there - * is always a colormap installed */ - *pmaps = GetInstalledColormap(pScreen)->mid; - return 1; -} - - -void -fbInstallColormap(ColormapPtr pmap) -{ - ColormapPtr oldpmap = GetInstalledColormap(pmap->pScreen); - - if(pmap != oldpmap) - { - /* Uninstall pInstalledMap. No hardware changes required, just - * notify all interested parties. */ - if(oldpmap != (ColormapPtr)None) - WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid); - /* Install pmap */ - SetInstalledColormap(pmap->pScreen, pmap); - WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid); - } -} - -void -fbUninstallColormap(ColormapPtr pmap) -{ - ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen); - - if(pmap == curpmap) - { - if (pmap->mid != pmap->pScreen->defColormap) - { - dixLookupResourceByType((pointer *)&curpmap, - pmap->pScreen->defColormap, - RT_COLORMAP, - serverClient, DixInstallAccess); - (*pmap->pScreen->InstallColormap)(curpmap); - } - } -} - -void -fbResolveColor(unsigned short *pred, - unsigned short *pgreen, - unsigned short *pblue, - VisualPtr pVisual) -{ - int shift = 16 - pVisual->bitsPerRGBValue; - unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1; - - if ((pVisual->class | DynamicClass) == GrayScale) - { - /* rescale to gray then rgb bits */ - *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100; - *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim; - } - else - { - /* rescale to rgb bits */ - *pred = ((*pred >> shift) * 65535) / lim; - *pgreen = ((*pgreen >> shift) * 65535) / lim; - *pblue = ((*pblue >> shift) * 65535) / lim; - } -} - -Bool -fbInitializeColormap(ColormapPtr pmap) -{ - register unsigned i; - register VisualPtr pVisual; - unsigned lim, maxent, shift; - - pVisual = pmap->pVisual; - lim = (1 << pVisual->bitsPerRGBValue) - 1; - shift = 16 - pVisual->bitsPerRGBValue; - maxent = pVisual->ColormapEntries - 1; - if (pVisual->class == TrueColor) - { - unsigned limr, limg, limb; - - limr = pVisual->redMask >> pVisual->offsetRed; - limg = pVisual->greenMask >> pVisual->offsetGreen; - limb = pVisual->blueMask >> pVisual->offsetBlue; - for(i = 0; i <= maxent; i++) - { - /* rescale to [0..65535] then rgb bits */ - pmap->red[i].co.local.red = - ((((i * 65535) / limr) >> shift) * 65535) / lim; - pmap->green[i].co.local.green = - ((((i * 65535) / limg) >> shift) * 65535) / lim; - pmap->blue[i].co.local.blue = - ((((i * 65535) / limb) >> shift) * 65535) / lim; - } - } - else if (pVisual->class == StaticColor) - { - unsigned n; - unsigned r, g, b; - unsigned red, green, blue; - - for (n = 0; n*n*n < pVisual->ColormapEntries; n++) - ; - n--; - i = 0; - for (r = 0; r < n; r++) - { - red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim; - for (g = 0; g < n; g++) - { - green = (((g * 65535 / (n - 1)) >> shift) * 65535) / lim; - for (b = 0; b < n; b++) - { - blue = (((b * 65535 / (n - 1)) >> shift) * 65535) / lim; - pmap->red[i].co.local.red = red; - pmap->red[i].co.local.green = green; - pmap->red[i].co.local.blue = blue; - i++; - } - } - } - n = pVisual->ColormapEntries - i; - for (r = 0; r < n; r++) - { - red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim; - pmap->red[i].co.local.red = red; - pmap->red[i].co.local.green = red; - pmap->red[i].co.local.blue = red; - i++; - } - } - else if (pVisual->class == StaticGray) - { - for(i = 0; i <= maxent; i++) - { - /* rescale to [0..65535] then rgb bits */ - pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift) - * 65535) / lim; - pmap->red[i].co.local.green = pmap->red[i].co.local.red; - pmap->red[i].co.local.blue = pmap->red[i].co.local.red; - } - } - return TRUE; -} - -/* When simulating DirectColor on PseudoColor hardware, multiple - entries of the colormap must be updated - */ - -#define AddElement(mask) { \ - pixel = red | green | blue; \ - for (i = 0; i < nresult; i++) \ - if (outdefs[i].pixel == pixel) \ - break; \ - if (i == nresult) \ - { \ - nresult++; \ - outdefs[i].pixel = pixel; \ - outdefs[i].flags = 0; \ - } \ - outdefs[i].flags |= (mask); \ - outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \ - outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \ - outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \ -} - -int -fbExpandDirectColors (ColormapPtr pmap, - int ndef, - xColorItem *indefs, - xColorItem *outdefs) -{ - register int red, green, blue; - int maxred, maxgreen, maxblue; - int stepred, stepgreen, stepblue; - VisualPtr pVisual; - register int pixel; - register int nresult; - register int i; - - pVisual = pmap->pVisual; - - stepred = 1 << pVisual->offsetRed; - stepgreen = 1 << pVisual->offsetGreen; - stepblue = 1 << pVisual->offsetBlue; - maxred = pVisual->redMask; - maxgreen = pVisual->greenMask; - maxblue = pVisual->blueMask; - nresult = 0; - for (;ndef--; indefs++) - { - if (indefs->flags & DoRed) - { - red = indefs->pixel & pVisual->redMask; - for (green = 0; green <= maxgreen; green += stepgreen) - { - for (blue = 0; blue <= maxblue; blue += stepblue) - { - AddElement (DoRed) - } - } - } - if (indefs->flags & DoGreen) - { - green = indefs->pixel & pVisual->greenMask; - for (red = 0; red <= maxred; red += stepred) - { - for (blue = 0; blue <= maxblue; blue += stepblue) - { - AddElement (DoGreen) - } - } - } - if (indefs->flags & DoBlue) - { - blue = indefs->pixel & pVisual->blueMask; - for (red = 0; red <= maxred; red += stepred) - { - for (green = 0; green <= maxgreen; green += stepgreen) - { - AddElement (DoBlue) - } - } - } - } - return nresult; -} - -Bool -fbCreateDefColormap(ScreenPtr pScreen) -{ - unsigned short zero = 0, ones = 0xFFFF; - VisualPtr pVisual; - ColormapPtr cmap; - Pixel wp, bp; - - for (pVisual = pScreen->visuals; - pVisual->vid != pScreen->rootVisual; - pVisual++) - ; - - if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap, - (pVisual->class & DynamicClass) ? AllocNone : AllocAll, - 0) - != Success) - return FALSE; - wp = pScreen->whitePixel; - bp = pScreen->blackPixel; - if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) != - Success) || - (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) != - Success)) - return FALSE; - pScreen->whitePixel = wp; - pScreen->blackPixel = bp; - (*pScreen->InstallColormap)(cmap); - return TRUE; -} - -extern int defaultColorVisualClass; - -#define _RZ(d) ((d + 2) / 3) -#define _RS(d) 0 -#define _RM(d) ((1 << _RZ(d)) - 1) -#define _GZ(d) ((d - _RZ(d) + 1) / 2) -#define _GS(d) _RZ(d) -#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d)) -#define _BZ(d) (d - _RZ(d) - _GZ(d)) -#define _BS(d) (_RZ(d) + _GZ(d)) -#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d)) -#define _CE(d) (1 << _RZ(d)) - -#define MAX_PSEUDO_DEPTH 10 /* largest DAC size I know */ - -#define StaticGrayMask (1 << StaticGray) -#define GrayScaleMask (1 << GrayScale) -#define StaticColorMask (1 << StaticColor) -#define PseudoColorMask (1 << PseudoColor) -#define TrueColorMask (1 << TrueColor) -#define DirectColorMask (1 << DirectColor) - -#define ALL_VISUALS (StaticGrayMask|\ - GrayScaleMask|\ - StaticColorMask|\ - PseudoColorMask|\ - TrueColorMask|\ - DirectColorMask) - -#define LARGE_VISUALS (TrueColorMask|\ - DirectColorMask) - -typedef struct _fbVisuals { - struct _fbVisuals *next; - int depth; - int bitsPerRGB; - int visuals; - int count; - Pixel redMask, greenMask, blueMask; -} fbVisualsRec, *fbVisualsPtr; - -static const int fbVisualPriority[] = { - PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray -}; - -#define NUM_PRIORITY 6 - -static fbVisualsPtr fbVisuals; - -static int -popCount (int i) -{ - int count; - - count = (i >> 1) & 033333333333; - count = i - count - ((count >> 1) & 033333333333); - count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */ - return count; -} - -/* - * Distance to least significant one bit - */ -static int -maskShift (Pixel p) -{ - int s; - - if (!p) return 0; - s = 0; - while (!(p & 1)) - { - s++; - p >>= 1; - } - return s; -} - -Bool -fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB, - Pixel redMask, Pixel greenMask, Pixel blueMask) -{ - fbVisualsPtr new, *prev, v; - - new = (fbVisualsPtr) malloc(sizeof *new); - if (!new) - return FALSE; - if (!redMask || !greenMask || !blueMask) - { - redMask = _RM(depth); - greenMask = _GM(depth); - blueMask = _BM(depth); - } - new->next = 0; - new->depth = depth; - new->visuals = visuals; - new->bitsPerRGB = bitsPerRGB; - new->redMask = redMask; - new->greenMask = greenMask; - new->blueMask = blueMask; - new->count = popCount (visuals); - for (prev = &fbVisuals; (v = *prev); prev = &v->next); - *prev = new; - return TRUE; -} - -Bool -fbHasVisualTypes (int depth) -{ - fbVisualsPtr v; - - for (v = fbVisuals; v; v = v->next) - if (v->depth == depth) - return TRUE; - return FALSE; -} - -Bool -fbSetVisualTypes (int depth, int visuals, int bitsPerRGB) -{ - return fbSetVisualTypesAndMasks (depth, visuals, bitsPerRGB, - _RM(depth), _GM(depth), _BM(depth)); -} - -/* - * Given a list of formats for a screen, create a list - * of visuals and depths for the screen which coorespond to - * the set which can be used with this version of fb. - */ - -Bool -fbInitVisuals (VisualPtr *visualp, - DepthPtr *depthp, - int *nvisualp, - int *ndepthp, - int *rootDepthp, - VisualID *defaultVisp, - unsigned long sizes, - int bitsPerRGB) -{ - int i, j = 0, k; - VisualPtr visual; - DepthPtr depth; - VisualID *vid; - int d, b; - int f; - int ndepth, nvisual; - int nvtype; - int vtype; - fbVisualsPtr visuals, nextVisuals; - - /* none specified, we'll guess from pixmap formats */ - if (!fbVisuals) - { - for (f = 0; f < screenInfo.numPixmapFormats; f++) - { - d = screenInfo.formats[f].depth; - b = screenInfo.formats[f].bitsPerPixel; - if (sizes & (1 << (b - 1))) - { - if (d > MAX_PSEUDO_DEPTH) - vtype = LARGE_VISUALS; - else if (d == 1) - vtype = StaticGrayMask; - else - vtype = ALL_VISUALS; - } - else - vtype = 0; - if (!fbSetVisualTypes (d, vtype, bitsPerRGB)) - return FALSE; - } - } - nvisual = 0; - ndepth = 0; - for (visuals = fbVisuals; visuals; visuals = nextVisuals) - { - nextVisuals = visuals->next; - ndepth++; - nvisual += visuals->count; - } - depth = (DepthPtr) malloc(ndepth * sizeof (DepthRec)); - visual = (VisualPtr) malloc(nvisual * sizeof (VisualRec)); - if (!depth || !visual) - { - free(depth); - free(visual); - return FALSE; - } - *depthp = depth; - *visualp = visual; - *ndepthp = ndepth; - *nvisualp = nvisual; - for (visuals = fbVisuals; visuals; visuals = nextVisuals) - { - nextVisuals = visuals->next; - d = visuals->depth; - vtype = visuals->visuals; - nvtype = visuals->count; - vid = NULL; - if (nvtype) - { - vid = (VisualID *) malloc(nvtype * sizeof (VisualID)); - if (!vid) - return FALSE; - } - depth->depth = d; - depth->numVids = nvtype; - depth->vids = vid; - depth++; - for (i = 0; i < NUM_PRIORITY; i++) { - if (! (vtype & (1 << fbVisualPriority[i]))) - continue; - visual->class = fbVisualPriority[i]; - visual->bitsPerRGBValue = visuals->bitsPerRGB; - visual->ColormapEntries = 1 << d; - visual->nplanes = d; - visual->vid = *vid = FakeClientID (0); - switch (visual->class) { - case PseudoColor: - case GrayScale: - case StaticGray: - case StaticColor: - visual->redMask = 0; - visual->greenMask = 0; - visual->blueMask = 0; - visual->offsetRed = 0; - visual->offsetGreen = 0; - visual->offsetBlue = 0; - break; - case DirectColor: - case TrueColor: - visual->ColormapEntries = _CE(d); - visual->redMask = visuals->redMask; - visual->greenMask = visuals->greenMask; - visual->blueMask = visuals->blueMask; - visual->offsetRed = maskShift (visuals->redMask); - visual->offsetGreen = maskShift (visuals->greenMask); - visual->offsetBlue = maskShift (visuals->blueMask); - } - vid++; - visual++; - } - free(visuals); - } - fbVisuals = NULL; - visual = *visualp; - depth = *depthp; - for (i = 0; i < ndepth; i++) - { - if (*rootDepthp && *rootDepthp != depth[i].depth) - continue; - for (j = 0; j < depth[i].numVids; j++) - { - for (k = 0; k < nvisual; k++) - if (visual[k].vid == depth[i].vids[j]) - break; - if (k == nvisual) - continue; - if (defaultColorVisualClass < 0 || - visual[k].class == defaultColorVisualClass) - break; - } - if (j != depth[i].numVids) - break; - } - if (i == ndepth) { - for (i = 0; i < ndepth; i++) - { - if (depth[i].numVids) - break; - } - if (i == ndepth) - return FALSE; - j = 0; - } - *rootDepthp = depth[i].depth; - *defaultVisp = depth[i].vids[j]; - return TRUE; -} diff --git a/fb/fbcmap_mi.c b/fb/fbcmap_mi.c index d75a38fa2..227da3118 100644 --- a/fb/fbcmap_mi.c +++ b/fb/fbcmap_mi.c @@ -1,5 +1,5 @@ /* - * Copyright © 1987 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 1987, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/fb/fbcopy.c b/fb/fbcopy.c index 9a7c49ac3..898320378 100644 --- a/fb/fbcopy.c +++ b/fb/fbcopy.c @@ -335,11 +335,9 @@ fbCopyArea (DrawablePtr pSrcDrawable, { miCopyProc copy; -#ifdef FB_24_32BIT if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel) copy = fb24_32CopyMtoN; else -#endif copy = fbCopyNtoN; return miDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, copy, 0, 0); diff --git a/fb/fbgc.c b/fb/fbgc.c index b27a030c5..cc504c1b8 100644 --- a/fb/fbgc.c +++ b/fb/fbgc.c @@ -206,7 +206,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) miComputeCompositeClip (pGC, pDrawable); } -#ifdef FB_24_32BIT if (pPriv->bpp != pDrawable->bitsPerPixel) { changes |= GCStipple|GCForeground|GCBackground|GCPlaneMask; @@ -240,7 +239,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) } } } -#endif if (changes & GCTile) { if (!pGC->tileIsPixel && diff --git a/fb/fbgetsp.c b/fb/fbgetsp.c index 6402c6c38..bf9f51eb4 100644 --- a/fb/fbgetsp.c +++ b/fb/fbgetsp.c @@ -47,13 +47,11 @@ fbGetSpans(DrawablePtr pDrawable, if (!fbDrawableEnabled(pDrawable)) return; -#ifdef FB_24_32BIT if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { fb24_32GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pchardstStart); return; } -#endif fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); diff --git a/fb/fbglyph.c b/fb/fbglyph.c index 8208081e2..643cf909f 100644 --- a/fb/fbglyph.c +++ b/fb/fbglyph.c @@ -57,8 +57,6 @@ fbGlyphIn (RegionPtr pRegion, return RegionContainsRect(pRegion, &box) == rgnIN; } -#ifdef FB_24BIT -#ifndef FBNOPIXADDR #define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg) #define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg) @@ -248,8 +246,6 @@ fbGlyph24 (FbBits *dstBits, dstLine += dstStride; } } -#endif -#endif void fbPolyGlyphBlt (DrawablePtr pDrawable, @@ -266,7 +262,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, int gx, gy; int gWidth, gHeight; /* width and height of glyph */ FbStride gStride; /* stride of glyph */ -#ifndef FBNOPIXADDR void (*glyph) (FbBits *, FbStride, int, @@ -286,13 +281,10 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, switch (dstBpp) { case 8: glyph = fbGlyph8; break; case 16: glyph = fbGlyph16; break; -#ifdef FB_24BIT case 24: glyph = fbGlyph24; break; -#endif case 32: glyph = fbGlyph32; break; } } -#endif x += pDrawable->x; y += pDrawable->y; @@ -306,7 +298,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, { gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; -#ifndef FBNOPIXADDR if (glyph && gWidth <= sizeof (FbStip) * 8 && fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) { @@ -321,7 +312,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable, fbFinishAccess (pDrawable); } else -#endif { gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); fbPushImage (pDrawable, @@ -359,7 +349,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable, Bool opaque; int n; int gx, gy; -#ifndef FBNOPIXADDR void (*glyph) (FbBits *, FbStride, int, @@ -379,21 +368,16 @@ fbImageGlyphBlt (DrawablePtr pDrawable, switch (dstBpp) { case 8: glyph = fbGlyph8; break; case 16: glyph = fbGlyph16; break; -#ifdef FB_24BIT case 24: glyph = fbGlyph24; break; -#endif case 32: glyph = fbGlyph32; break; } } -#endif x += pDrawable->x; y += pDrawable->y; if (TERMINALFONT (pGC->font) -#ifndef FBNOPIXADDR && !glyph -#endif ) { opaque = TRUE; @@ -439,7 +423,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable, { gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; -#ifndef FBNOPIXADDR if (glyph && gWidth <= sizeof (FbStip) * 8 && fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) { @@ -454,7 +437,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable, fbFinishAccess (pDrawable); } else -#endif { gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); fbPutXYImage (pDrawable, diff --git a/fb/fbimage.c b/fb/fbimage.c index da1e8bcc4..63978cc3b 100644 --- a/fb/fbimage.c +++ b/fb/fbimage.c @@ -86,7 +86,6 @@ fbPutImage (DrawablePtr pDrawable, } break; case ZPixmap: -#ifdef FB_24_32BIT if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { srcStride = PixmapBytePad(w, pDrawable->depth); @@ -99,7 +98,6 @@ fbPutImage (DrawablePtr pDrawable, srcStride); } else -#endif { srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof (FbStip); fbPutZImage (pDrawable, @@ -305,14 +303,12 @@ fbGetImage (DrawablePtr pDrawable, if (!fbDrawableEnabled(pDrawable)) return; -#ifdef FB_24_32BIT if (format == ZPixmap && pDrawable->bitsPerPixel != BitsPerPixel (pDrawable->depth)) { fb24_32GetImage (pDrawable, x, y, w, h, format, planeMask, d); return; } -#endif fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); diff --git a/fb/fbline.c b/fb/fbline.c index fa80573e2..e290bf886 100644 --- a/fb/fbline.c +++ b/fb/fbline.c @@ -114,7 +114,6 @@ fbPolyLine (DrawablePtr pDrawable, if (pGC->lineWidth == 0) { line = fbZeroLine; -#ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && RegionNumRects (fbGetCompositeClip(pGC)) == 1) @@ -122,13 +121,10 @@ fbPolyLine (DrawablePtr pDrawable, switch (pDrawable->bitsPerPixel) { case 8: line = fbPolyline8; break; case 16: line = fbPolyline16; break; -#ifdef FB_24BIT case 24: line = fbPolyline24; break; -#endif case 32: line = fbPolyline32; break; } } -#endif } else { @@ -151,7 +147,6 @@ fbPolySegment (DrawablePtr pDrawable, if (pGC->lineWidth == 0) { seg = fbZeroSegment; -#ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && RegionNumRects (fbGetCompositeClip(pGC)) == 1) @@ -159,13 +154,10 @@ fbPolySegment (DrawablePtr pDrawable, switch (pDrawable->bitsPerPixel) { case 8: seg = fbPolySegment8; break; case 16: seg = fbPolySegment16; break; -#ifdef FB_24BIT case 24: seg = fbPolySegment24; break; -#endif case 32: seg = fbPolySegment32; break; } } -#endif } else { diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 7fca89c44..255cc23c1 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -55,10 +55,8 @@ fbOverlayCreateWindow(WindowPtr pWin) if (pWin->drawable.class != InputOutput) return TRUE; -#ifdef FB_SCREEN_PRIVATE if (pWin->drawable.bitsPerPixel == 32) pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; -#endif for (i = 0; i < pScrPriv->nlayers; i++) { @@ -349,7 +347,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, if (!pScrPriv) return FALSE; -#ifdef FB_24_32BIT if (bpp1 == 32 || bpp2 == 32) bpp = 32; else if (bpp1 == 24 || bpp2 == 24) @@ -374,8 +371,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, } } } -#endif -#ifdef FB_SCREEN_PRIVATE if (imagebpp == 32) { fbGetScreenPrivate(pScreen)->win32bpp = bpp; @@ -386,16 +381,19 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32; } -#endif if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1, &defaultVisual, ((unsigned long)1<<(bpp1-1)) | - ((unsigned long)1<<(bpp2-1)), 8)) + ((unsigned long)1<<(bpp2-1)), 8)) { + free(pScrPriv); return FALSE; + } if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0, depth1, ndepths, depths, - defaultVisual, nvisuals, visuals)) + defaultVisual, nvisuals, visuals)) { + free(pScrPriv); return FALSE; + } /* MI thinks there's no frame buffer */ #ifdef MITSHM ShmRegisterFbFuncs(pScreen); @@ -421,13 +419,11 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->CopyWindow = fbOverlayCopyWindow; -#ifdef FB_24_32BIT if (bpp == 24 && imagebpp == 32) { pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources; } -#endif return TRUE; } diff --git a/fb/fbpict.c b/fb/fbpict.c index f7f120002..d1fd0cbbd 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -35,112 +35,6 @@ #include "mipict.h" #include "fbpict.h" -#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) - -void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect) -{ - RegionRec region; - int n; - BoxPtr pbox; - int w, h, w_this, h_this; - int x_msk, y_msk, x_src, y_src, x_dst, y_dst; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - if (pSrc->pDrawable) - { - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - } - if (pMask && pMask->pDrawable) - { - xMask += pMask->pDrawable->x; - yMask += pMask->pDrawable->y; - } - - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, - xMask, yMask, xDst, yDst, width, height)) - return; - - n = RegionNumRects (®ion); - pbox = RegionRects (®ion); - while (n--) - { - h = pbox->y2 - pbox->y1; - y_src = pbox->y1 - yDst + ySrc; - y_msk = pbox->y1 - yDst + yMask; - y_dst = pbox->y1; - while (h) - { - h_this = h; - w = pbox->x2 - pbox->x1; - x_src = pbox->x1 - xDst + xSrc; - x_msk = pbox->x1 - xDst + xMask; - x_dst = pbox->x1; - if (maskRepeat) - { - y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height); - if (h_this > pMask->pDrawable->height - y_msk) - h_this = pMask->pDrawable->height - y_msk; - y_msk += pMask->pDrawable->y; - } - if (srcRepeat) - { - y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height); - if (h_this > pSrc->pDrawable->height - y_src) - h_this = pSrc->pDrawable->height - y_src; - y_src += pSrc->pDrawable->y; - } - while (w) - { - w_this = w; - if (maskRepeat) - { - x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width); - if (w_this > pMask->pDrawable->width - x_msk) - w_this = pMask->pDrawable->width - x_msk; - x_msk += pMask->pDrawable->x; - } - if (srcRepeat) - { - x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width); - if (w_this > pSrc->pDrawable->width - x_src) - w_this = pSrc->pDrawable->width - x_src; - x_src += pSrc->pDrawable->x; - } - (*compositeRect) (op, pSrc, pMask, pDst, - x_src, y_src, x_msk, y_msk, x_dst, y_dst, - w_this, h_this); - w -= w_this; - x_src += w_this; - x_msk += w_this; - x_dst += w_this; - } - h -= h_this; - y_src += h_this; - y_msk += h_this; - y_dst += h_this; - } - pbox++; - } - RegionUninit(®ion); -} - void fbComposite (CARD8 op, PicturePtr pSrc, @@ -160,9 +54,9 @@ fbComposite (CARD8 op, int msk_xoff, msk_yoff; int dst_xoff, dst_yoff; - miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height); + miCompositeSourceValidate (pSrc); if (pMask) - miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height); + miCompositeSourceValidate (pMask); src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff); mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff); @@ -182,25 +76,6 @@ fbComposite (CARD8 op, free_pixman_pict (pDst, dest); } -void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - fbComposite (op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height); -} - static pixman_image_t * create_solid_fill_image (PicturePtr pict) { @@ -285,7 +160,7 @@ create_bits_picture (PicturePtr pict, fbGetPixmapBitsData(pixmap, bits, stride, bpp); image = pixman_image_create_bits ( - pict->format, + (pixman_format_code_t)pict->format, pixmap->drawable.width, pixmap->drawable.height, (uint32_t *)bits, stride * sizeof (FbStride)); @@ -489,8 +364,10 @@ fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; ps->RasterizeTrapezoid = fbRasterizeTrapezoid; + ps->Trapezoids = fbTrapezoids; ps->AddTraps = fbAddTraps; ps->AddTriangles = fbAddTriangles; + ps->Triangles = fbTriangles; return TRUE; } diff --git a/fb/fbpict.h b/fb/fbpict.h index b89f90ff1..b880ebbe1 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -28,392 +28,6 @@ #ifndef _FBPICT_H_ #define _FBPICT_H_ -#include "renderedge.h" - - -#if defined(__GNUC__) -#define INLINE __inline__ -#else -#define INLINE -#endif - -#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) ) -#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b)) - -#define FbGet8(v,i) ((CARD16) (CARD8) ((v) >> i)) - -/* - * There are two ways of handling alpha -- either as a single unified value or - * a separate value for each component, hence each macro must have two - * versions. The unified alpha version has a 'U' at the end of the name, - * the component version has a 'C'. Similarly, functions which deal with - * this difference will have two versions using the same convention. - */ - -#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i)) - -#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i)) - -#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \ - FbIntMult(FbGet8(x,i),ax,(v))),\ - (CARD32) ((CARD8) ((t) | \ - (0 - ((t) >> 8)))) << (i)) - -#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - - -#define Alpha(x) ((x) >> 24) -#define Red(x) (((x) >> 16) & 0xff) -#define Green(x) (((x) >> 8) & 0xff) -#define Blue(x) ((x) & 0xff) - -/** - * Returns TRUE if the fbComposeGetSolid can be used to get a single solid - * color representing every source sampling location of the picture. - */ -static INLINE Bool -fbCanGetSolid(PicturePtr pict) -{ - if (pict->pDrawable == NULL || - pict->pDrawable->width != 1 || - pict->pDrawable->height != 1) - { - return FALSE; - } - if (pict->repeat != RepeatNormal) - return FALSE; - - switch (pict->format) { - case PICT_a8r8g8b8: - case PICT_x8r8g8b8: - case PICT_a8b8g8r8: - case PICT_x8b8g8r8: - case PICT_b8g8r8a8: - case PICT_b8g8r8x8: - case PICT_r8g8b8: - case PICT_b8g8r8: - case PICT_r5g6b5: - case PICT_b5g6r5: - return TRUE; - default: - return FALSE; - } -} - -#define fbComposeGetSolid(pict, bits, fmt) { \ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - switch (__bpp__) { \ - case 32: \ - (bits) = READ((CARD32 *) __bits__); \ - break; \ - case 24: \ - (bits) = Fetch24 ((CARD8 *) __bits__); \ - break; \ - case 16: \ - (bits) = READ((CARD16 *) __bits__); \ - (bits) = cvt0565to0888(bits); \ - break; \ - case 8: \ - (bits) = READ((CARD8 *) __bits__); \ - (bits) = (bits) << 24; \ - break; \ - case 1: \ - (bits) = READ((CARD32 *) __bits__); \ - (bits) = FbLeftStipBits((bits),1) ? 0xff000000 : 0x00000000;\ - break; \ - default: \ - return; \ - } \ - /* If necessary, convert RGB <--> BGR. */ \ - if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \ - { \ - (bits) = (((bits) & 0xff000000) | \ - (((bits) & 0x00ff0000) >> 16) | \ - (((bits) & 0x0000ff00) >> 0) | \ - (((bits) & 0x000000ff) << 16)); \ - } \ - /* manage missing src alpha */ \ - if ((pict)->pFormat->direct.alphaMask == 0) \ - (bits) |= 0xff000000; \ - fbFinishAccess ((pict)->pDrawable); \ -} - -#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul) * ((x) + __xoff__); \ -} -#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ - (((s) >> 5) & 0x07e0) | \ - (((s) >> 8) & 0xf800)) -#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ - ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \ - ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \ - ((READ((CARD16 *) (a)) << 8) | READ((a)+2))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) ((v) >> 16)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \ - (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \ - WRITE((a)+2, (CARD8) (v)))) -#else -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \ - (READ((CARD16 *) (a)) | (READ((a)+2) << 16))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) (v)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \ - (WRITE((CARD16 *) (a), (CARD16) (v)),\ - WRITE((a)+2, (CARD8) ((v) >> 16)))) -#endif - -/* - The methods below use some tricks to be able to do two color - components at the same time. -*/ - -/* - x_c = (x_c * a) / 255 -*/ -#define FbByteMul(x, a) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)); \ - x &= 0xff00ff00; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAdd(x, a, y) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += y & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)) >> 8; \ - x &= 0xff00ff; \ - x += (y >> 8) & 0xff00ff; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x <<= 8; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a + y_c * b) / 255 -*/ -#define FbByteAddMul(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * a + (y >> 24) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - t = (x & 0xff00) * a + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ -} while (0) - -/* - x_c = (x_c * a + y_c *b) / 256 -*/ -#define FbByteAddMul_256(x, a, y, b) do { \ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \ - t >>= 8; \ - t &= 0xff00ff; \ - \ - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \ - x &= 0xff00ff00; \ - x += t; \ -} while (0) -/* - x_c = (x_c * a_c) / 255 -*/ -#define FbByteMulC(x, a) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = t + ((t >> 8) & 0xff00ff); \ - x = r | (t & 0xff00ff00); \ - \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAddC(x, a, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - r += y & 0xff00ff; \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += (y >> 8) & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - x = r | (t << 8); \ - } while (0) - -/* - x_c = (x_c * a_c + y_c * b) / 255 -*/ -#define FbByteAddMulC(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * (a >> 24) + (y >> 24) * b; \ - r += (r >> 8) + 0x80; \ - r >>= 8; \ - \ - t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ - } while (0) - -/* - x_c = min(x_c + y_c, 255) -*/ -#define FbByteAdd(x, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff00ff) + (y & 0xff00ff); \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - r |= (t & 0xff00ff) << 8; \ - x = r; \ - } while (0) - -#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8) - -#if defined(__i386__) && defined(__GNUC__) -#define FASTCALL __attribute__((regparm(3))) -#else -#define FASTCALL -#endif - -typedef struct _FbComposeData { - CARD8 op; - PicturePtr src; - PicturePtr mask; - PicturePtr dest; - INT16 xSrc; - INT16 ySrc; - INT16 xMask; - INT16 yMask; - INT16 xDest; - INT16 yDest; - CARD16 width; - CARD16 height; -} FbComposeData; - -extern _X_EXPORT void -fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer); - -typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width); -typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width); -typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width); - -typedef struct _FbComposeFunctions { - CombineFuncU *combineU; - CombineFuncC *combineC; - CombineMaskU combineMaskU; -} FbComposeFunctions; - -/* fbcompose.c */ - -extern _X_EXPORT void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - /* fbpict.c */ extern _X_EXPORT void fbComposite (CARD8 op, @@ -429,36 +43,6 @@ fbComposite (CARD8 op, CARD16 width, CARD16 height); -typedef void (*CompositeFunc) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -extern _X_EXPORT void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect); - /* fbtrap.c */ extern _X_EXPORT void @@ -481,4 +65,24 @@ fbAddTriangles (PicturePtr pPicture, int ntri, xTriangle *tris); +extern _X_EXPORT void +fbTrapezoids (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int ntrap, + xTrapezoid *traps); + +extern _X_EXPORT void +fbTriangles (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int ntris, + xTriangle *tris); + #endif /* _FBPICT_H_ */ diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index 41b12cea7..a356c67b6 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c @@ -89,10 +89,8 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth, { int bpp; bpp = BitsPerPixel (depth); -#ifdef FB_SCREEN_PRIVATE if (bpp == 32 && depth <= 24) bpp = fbGetScreenPrivate(pScreen)->pix32bpp; -#endif return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint); } diff --git a/fb/fbpoint.c b/fb/fbpoint.c index f260a69ca..bf617708b 100644 --- a/fb/fbpoint.c +++ b/fb/fbpoint.c @@ -75,7 +75,6 @@ fbDots (FbBits *dstOrig, x = (x + xoff) * dstBpp; d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT); x &= FB_STIP_MASK; -#ifdef FB_24BIT if (dstBpp == 24) { FbStip leftMask, rightMask; @@ -97,7 +96,6 @@ fbDots (FbBits *dstOrig, WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); } else -#endif { FbStip mask; mask = FbStipMask(x, dstBpp); @@ -144,16 +142,12 @@ fbPolyPoint (DrawablePtr pDrawable, and = pPriv->and; xor = pPriv->xor; dots = fbDots; -#ifndef FBNOPIXADDR switch (dstBpp) { case 8: dots = fbDots8; break; case 16: dots = fbDots16; break; -#ifdef FB_24BIT case 24: dots = fbDots24; break; -#endif case 32: dots = fbDots32; break; } -#endif for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, diff --git a/fb/fbscreen.c b/fb/fbscreen.c index 2502efeff..9e6ecf50f 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -185,7 +185,6 @@ fbFinishScreenInit(ScreenPtr pScreen, * pixels. If you want real 24bit images, include a 24bpp * format in the pixmap formats */ -#ifdef FB_24_32BIT if (bpp == 24) { int f; @@ -205,8 +204,6 @@ fbFinishScreenInit(ScreenPtr pScreen, } } } -#endif -#ifdef FB_SCREEN_PRIVATE if (imagebpp == 32) { fbGetScreenPrivate(pScreen)->win32bpp = bpp; @@ -220,29 +217,22 @@ fbFinishScreenInit(ScreenPtr pScreen, #ifdef FB_ACCESS_WRAPPER fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; -#endif #endif rootdepth = 0; if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, &defaultVisual,((unsigned long)1<<(imagebpp-1)), 8)) - { - free(visuals); - free(depths); return FALSE; - } if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootdepth, ndepths, depths, defaultVisual, nvisuals, visuals)) return FALSE; /* overwrite miCloseScreen with our own */ pScreen->CloseScreen = fbCloseScreen; -#ifdef FB_24_32BIT if (bpp == 24 && imagebpp == 32) { pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->CreateScreenResources = fb24_32CreateScreenResources; } -#endif return TRUE; } diff --git a/fb/fbseg.c b/fb/fbseg.c index 7cc38a20c..5a458fe51 100644 --- a/fb/fbseg.c +++ b/fb/fbseg.c @@ -330,7 +330,6 @@ fbBresFillDash (DrawablePtr pDrawable, fbSetFg (pDrawable, pGC, fg); } -#ifdef FB_24BIT static void fbBresSolid24RRop (DrawablePtr pDrawable, GCPtr pGC, @@ -507,7 +506,6 @@ fbBresDash24RRop (DrawablePtr pDrawable, fbFinishAccess (pDrawable); } -#endif /* * For drivers that want to bail drawing some lines, this @@ -529,23 +527,17 @@ fbSelectBres (DrawablePtr pDrawable, if (pGC->fillStyle == FillSolid) { bres = fbBresSolid; -#ifdef FB_24BIT if (dstBpp == 24) bres = fbBresSolid24RRop; -#endif -#ifndef FBNOPIXADDR if (pPriv->and == 0) { switch (dstBpp) { case 8: bres = fbBresSolid8; break; case 16: bres = fbBresSolid16; break; -#ifdef FB_24BIT case 24: bres = fbBresSolid24; break; -#endif case 32: bres = fbBresSolid32; break; } } -#endif } } else @@ -554,24 +546,18 @@ fbSelectBres (DrawablePtr pDrawable, if (pGC->fillStyle == FillSolid) { bres = fbBresDash; -#ifdef FB_24BIT if (dstBpp == 24) bres = fbBresDash24RRop; -#endif -#ifndef FBNOPIXADDR if (pPriv->and == 0 && (pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0)) { switch (dstBpp) { case 8: bres = fbBresDash8; break; case 16: bres = fbBresDash16; break; -#ifdef FB_24BIT case 24: bres = fbBresDash24; break; -#endif case 32: bres = fbBresDash32; break; } } -#endif } } return bres; diff --git a/fb/fbsetsp.c b/fb/fbsetsp.c index 61dc4dc30..65ec8b874 100644 --- a/fb/fbsetsp.c +++ b/fb/fbsetsp.c @@ -46,13 +46,11 @@ fbSetSpans (DrawablePtr pDrawable, int xoff; int x1, x2; -#ifdef FB_24_32BIT if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) { fb24_32SetSpans (pDrawable, pGC, src, ppt, pwidth, nspans, fSorted); return; } -#endif fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); while (nspans--) { diff --git a/fb/fbsolid.c b/fb/fbsolid.c index 53fcae071..414378531 100644 --- a/fb/fbsolid.c +++ b/fb/fbsolid.c @@ -44,13 +44,11 @@ fbSolid (FbBits *dst, int n, nmiddle; int startbyte, endbyte; -#ifdef FB_24BIT if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor))) { fbSolid24 (dst, dstStride, dstX, width, height, and, xor); return; } -#endif dst += dstX >> FB_SHIFT; dstX &= FB_MASK; FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte, @@ -81,7 +79,6 @@ fbSolid (FbBits *dst, } } -#ifdef FB_24BIT void fbSolid24 (FbBits *dst, FbStride dstStride, @@ -210,4 +207,3 @@ fbSolid24 (FbBits *dst, dst += dstStride; } } -#endif diff --git a/fb/fbstipple.c b/fb/fbstipple.c index bc25e462f..dc1fd468f 100644 --- a/fb/fbstipple.c +++ b/fb/fbstipple.c @@ -26,7 +26,6 @@ #include "fb.h" -#ifndef FBNOPIXADDR /* * This is a slight abuse of the preprocessor to generate repetitive * code, the idea is to generate code for each case of a copy-mode @@ -78,7 +77,6 @@ fbTransparentSpan (FbBits *dst, LaneCases(dst); } } -#endif void fbEvenStipple (FbBits *dst, @@ -170,7 +168,6 @@ fbEvenStipple (FbBits *dst, and = (fgand & mask) | (bgand & ~mask); xor = (fgxor & mask) | (bgxor & ~mask); -#ifndef FBNOPIXADDR if (transparent) { if (startmask) @@ -184,7 +181,6 @@ fbEvenStipple (FbBits *dst, fbTransparentSpan(dst, mask&endmask, fgxor, 1); } else -#endif { /* * Fill scanline diff --git a/fb/fbtrap.c b/fb/fbtrap.c index 9f5c39f65..0b5a6382e 100644 --- a/fb/fbtrap.c +++ b/fb/fbtrap.c @@ -28,8 +28,8 @@ #include "picturestr.h" #include "mipict.h" -#include "renderedge.h" #include "fbpict.h" +#include "damage.h" void fbAddTraps (PicturePtr pPicture, @@ -38,13 +38,14 @@ fbAddTraps (PicturePtr pPicture, int ntrap, xTrap *traps) { - int image_xoff, image_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff); + pixman_image_t *image; + int dst_xoff, dst_yoff; - if (!image) + if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff))) return; - pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps); + pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff, + ntrap, (pixman_trap_t *)traps); free_pixman_pict (pPicture, image); } @@ -55,43 +56,19 @@ fbRasterizeTrapezoid (PicturePtr pPicture, int x_off, int y_off) { - int mask_xoff, mask_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff); + pixman_image_t *image; + int dst_xoff, dst_yoff; - if (!image) + if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff))) return; - pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off); + pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, + x_off + dst_xoff, + y_off + dst_yoff); free_pixman_pict (pPicture, image); } -static int -_GreaterY (xPointFixed *a, xPointFixed *b) -{ - if (a->y == b->y) - return a->x > b->x; - return a->y > b->y; -} - -/* - * Note that the definition of this function is a bit odd because - * of the X coordinate space (y increasing downwards). - */ -static int -_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b) -{ - xPointFixed ad, bd; - - ad.x = a->x - ref->x; - ad.y = a->y - ref->y; - bd.x = b->x - ref->x; - bd.y = b->y - ref->y; - - return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0; -} - -/* FIXME -- this could be made more efficient */ void fbAddTriangles (PicturePtr pPicture, INT16 x_off, @@ -99,62 +76,140 @@ fbAddTriangles (PicturePtr pPicture, int ntri, xTriangle *tris) { - xPointFixed *top, *left, *right, *tmp; - xTrapezoid trap; + pixman_image_t *image; + int dst_xoff, dst_yoff; + + if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff))) + return; + + pixman_add_triangles (image, + dst_xoff + x_off, dst_yoff + y_off, + ntri, (pixman_triangle_t *)tris); + + free_pixman_pict (pPicture, image); +} + +typedef void (* CompositeShapesFunc) (pixman_op_t op, + pixman_image_t *src, + pixman_image_t *dst, + pixman_format_code_t mask_format, + int x_src, int y_src, + int x_dst, int y_dst, + int n_shapes, const uint8_t *shapes); + +static void +fbShapes (CompositeShapesFunc composite, + pixman_op_t op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + int16_t xSrc, + int16_t ySrc, + int nshapes, + int shape_size, + const uint8_t * shapes) +{ + pixman_image_t *src, *dst; + int src_xoff, src_yoff; + int dst_xoff, dst_yoff; - for (; ntri; ntri--, tris++) + miCompositeSourceValidate (pSrc); + + src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff); + dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff); + + if (src && dst) { - top = &tris->p1; - left = &tris->p2; - right = &tris->p3; - if (_GreaterY (top, left)) { - tmp = left; left = top; top = tmp; - } - if (_GreaterY (top, right)) { - tmp = right; right = top; top = tmp; - } - if (_Clockwise (top, right, left)) { - tmp = right; right = left; left = tmp; - } - - /* - * Two cases: - * - * + + - * / \ / \ - * / \ / \ - * / + + \ - * / -- -- \ - * / -- -- \ - * / --- --- \ - * +-- --+ - */ - - trap.top = top->y; - trap.left.p1 = *top; - trap.left.p2 = *left; - trap.right.p1 = *top; - trap.right.p2 = *right; - if (right->y < left->y) - trap.bottom = right->y; - else - trap.bottom = left->y; - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - if (right->y < left->y) + pixman_format_code_t format; + + DamageRegionAppend (pDst->pDrawable, pDst->pCompositeClip); + + if (!maskFormat) { - trap.top = right->y; - trap.bottom = left->y; - trap.right.p1 = *right; - trap.right.p2 = *left; + int i; + + if (pDst->polyEdge == PolyEdgeSharp) + format = PIXMAN_a1; + else + format = PIXMAN_a8; + + for (i = 0; i < nshapes; ++i) + { + composite (op, src, dst, format, + xSrc + src_xoff, + ySrc + src_yoff, + dst_xoff, + dst_yoff, + 1, shapes + i * shape_size); + } } else { - trap.top = left->y; - trap.bottom = right->y; - trap.left.p1 = *left; - trap.left.p2 = *right; + switch (PICT_FORMAT_A (maskFormat->format)) + { + case 1: + format = PIXMAN_a1; + break; + + case 4: + format = PIXMAN_a4; + break; + + default: + case 8: + format = PIXMAN_a8; + break; + } + + composite (op, src, dst, format, + xSrc + src_xoff, + ySrc + src_yoff, + dst_xoff, + dst_yoff, + nshapes, shapes); } - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); + + DamageRegionProcessPending (pDst->pDrawable); } + + free_pixman_pict (pSrc, src); + free_pixman_pict (pDst, dst); } +void +fbTrapezoids (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int ntrap, + xTrapezoid *traps) +{ + xSrc -= (traps[0].left.p1.x >> 16); + ySrc -= (traps[0].left.p1.y >> 16); + + fbShapes ((CompositeShapesFunc)pixman_composite_trapezoids, + op, pSrc, pDst, maskFormat, + xSrc, ySrc, + ntrap, sizeof (xTrapezoid), (const uint8_t *)traps); +} + +void +fbTriangles (CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, + int ntris, + xTriangle *tris) +{ + xSrc -= (tris[0].p1.x >> 16); + ySrc -= (tris[0].p1.y >> 16); + + fbShapes ((CompositeShapesFunc)pixman_composite_triangles, + op, pSrc, pDst, maskFormat, + xSrc, ySrc, + ntris, sizeof (xTriangle), (const uint8_t *)tris); +} diff --git a/fb/fbwindow.c b/fb/fbwindow.c index bb0384d91..7906f8dd2 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -33,10 +33,8 @@ fbCreateWindow(WindowPtr pWin) { dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), fbGetScreenPixmap(pWin->drawable.pScreen)); -#ifdef FB_SCREEN_PRIVATE if (pWin->drawable.bitsPerPixel == 32) pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; -#endif return TRUE; } @@ -148,55 +146,36 @@ fbCopyWindow(WindowPtr pWin, fbValidateDrawable (&pWin->drawable); } +static void +fbFixupWindowPixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap) +{ + PixmapPtr pPixmap = *ppPixmap; + + if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel) + { + pPixmap = fb24_32ReformatTile (pPixmap, pDrawable->bitsPerPixel); + if (!pPixmap) + return; + (*pDrawable->pScreen->DestroyPixmap) (*ppPixmap); + *ppPixmap = pPixmap; + } + if (FbEvenTile (pPixmap->drawable.width * + pPixmap->drawable.bitsPerPixel)) + fbPadPixmap (pPixmap); +} + Bool fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - PixmapPtr pPixmap; - if (mask & CWBackPixmap) { if (pWin->backgroundState == BackgroundPixmap) - { - pPixmap = pWin->background.pixmap; -#ifdef FB_24_32BIT - if (pPixmap->drawable.bitsPerPixel != pWin->drawable.bitsPerPixel) - { - pPixmap = fb24_32ReformatTile (pPixmap, - pWin->drawable.bitsPerPixel); - if (pPixmap) - { - (*pWin->drawable.pScreen->DestroyPixmap) (pWin->background.pixmap); - pWin->background.pixmap = pPixmap; - } - } -#endif - if (FbEvenTile (pPixmap->drawable.width * - pPixmap->drawable.bitsPerPixel)) - fbPadPixmap (pPixmap); - } + fbFixupWindowPixmap(&pWin->drawable, &pWin->background.pixmap); } if (mask & CWBorderPixmap) { if (pWin->borderIsPixel == FALSE) - { - pPixmap = pWin->border.pixmap; -#ifdef FB_24_32BIT - if (pPixmap->drawable.bitsPerPixel != - pWin->drawable.bitsPerPixel) - { - pPixmap = fb24_32ReformatTile (pPixmap, - pWin->drawable.bitsPerPixel); - if (pPixmap) - { - (*pWin->drawable.pScreen->DestroyPixmap) (pWin->border.pixmap); - pWin->border.pixmap = pPixmap; - } - } -#endif - if (FbEvenTile (pPixmap->drawable.width * - pPixmap->drawable.bitsPerPixel)) - fbPadPixmap (pPixmap); - } + fbFixupWindowPixmap(&pWin->drawable, &pWin->border.pixmap); } return TRUE; } diff --git a/fb/wfbrename.h b/fb/wfbrename.h index c8e98c85c..e855edd0b 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -39,20 +39,6 @@ #define fbClearVisualTypes wfbClearVisualTypes #define fbCloseScreen wfbCloseScreen #define fbComposite wfbComposite -#define fbCompositeGeneral wfbCompositeGeneral -#define fbCompositeSolidMask_nx1xn wfbCompositeSolidMask_nx1xn -#define fbCompositeSolidMask_nx8888x0565C wfbCompositeSolidMask_nx8888x0565C -#define fbCompositeSolidMask_nx8888x8888C wfbCompositeSolidMask_nx8888x8888C -#define fbCompositeSolidMask_nx8x0565 wfbCompositeSolidMask_nx8x0565 -#define fbCompositeSolidMask_nx8x0888 wfbCompositeSolidMask_nx8x0888 -#define fbCompositeSolidMask_nx8x8888 wfbCompositeSolidMask_nx8x8888 -#define fbCompositeSrc_0565x0565 wfbCompositeSrc_0565x0565 -#define fbCompositeSrc_8888x0565 wfbCompositeSrc_8888x0565 -#define fbCompositeSrc_8888x0888 wfbCompositeSrc_8888x0888 -#define fbCompositeSrc_8888x8888 wfbCompositeSrc_8888x8888 -#define fbCompositeSrcAdd_1000x1000 wfbCompositeSrcAdd_1000x1000 -#define fbCompositeSrcAdd_8000x8000 wfbCompositeSrcAdd_8000x8000 -#define fbCompositeSrcAdd_8888x8888 wfbCompositeSrcAdd_8888x8888 #define fbCopy1toN wfbCopy1toN #define fbCopyArea wfbCopyArea #define fbCopyNto1 wfbCopyNto1 @@ -149,7 +135,6 @@ #define fbPutXYImage wfbPutXYImage #define fbPutZImage wfbPutZImage #define fbQueryBestSize wfbQueryBestSize -#define fbRasterizeEdges wfbRasterizeEdges #define fbRasterizeTrapezoid wfbRasterizeTrapezoid #define fbRealizeFont wfbRealizeFont #define fbReduceRasterOp wfbReduceRasterOp @@ -179,10 +164,8 @@ #define fbUnmapWindow wfbUnmapWindow #define fbUnrealizeFont wfbUnrealizeFont #define fbValidateGC wfbValidateGC -#define fbWalkCompositeRegion wfbWalkCompositeRegion #define fbWinPrivateKeyRec wfbWinPrivateKeyRec #define fbZeroLine wfbZeroLine #define fbZeroSegment wfbZeroSegment #define free_pixman_pict wfb_free_pixman_pict #define image_from_pict wfb_image_from_pict -#define composeFunctions wfbComposeFunctions diff --git a/glx/Makefile.am b/glx/Makefile.am index 9d9fa3c31..5f74ab890 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -1,4 +1,4 @@ -if AIGLX +if AIGLX_DRI_LOADER GLXDRI_LIBRARY = libglxdri.la endif @@ -11,7 +11,6 @@ AM_CFLAGS = \ @XLIB_CFLAGS@ \ @LIBDRM_CFLAGS@ \ @DRIPROTO_CFLAGS@ \ - -DXFree86Server \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ @@ -41,7 +40,6 @@ glapi_sources = \ indirect_table.c \ dispatch.h \ glapitable.h \ - glapitemp.h \ glapi.c \ glapi.h \ glapioffsets.h \ @@ -50,10 +48,13 @@ glapi_sources = \ glthread.h libglxdri_la_SOURCES = \ - glxdri.c \ extension_string.c \ extension_string.h +if DRI +libglxdri_la_SOURCES += glxdri.c +endif + if DRI2_AIGLX libglxdri_la_SOURCES += glxdri2.c endif @@ -68,7 +69,6 @@ libglx_la_SOURCES = \ indirect_program.c \ indirect_table.h \ indirect_texture_compression.c \ - g_disptab.h \ glxbyteorder.h \ glxcmds.c \ glxcmdsswap.c \ diff --git a/glx/g_disptab.h b/glx/g_disptab.h deleted file mode 100644 index 9b4308b57..000000000 --- a/glx/g_disptab.h +++ /dev/null @@ -1,52 +0,0 @@ -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#ifndef _GLX_g_disptab_h_ -#define _GLX_g_disptab_h_ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -extern int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc); -extern int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc); - -extern int __glXDispSwap_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDispSwap_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDispSwap_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDispSwap_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc); -extern int __glXDispSwap_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc); -extern int __glXDispSwap_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc); - -#endif /* _GLX_g_disptab_h_ */ diff --git a/glx/glapi.c b/glx/glapi.c index d6a568e88..9e219f680 100644 --- a/glx/glapi.c +++ b/glx/glapi.c @@ -22,46 +22,21 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - /* - * This file manages the OpenGL API dispatch layer. - * The dispatch table (struct _glapi_table) is basically just a list - * of function pointers. - * There are functions to set/get the current dispatch table for the - * current thread and to manage registration/dispatch of dynamically - * added extension functions. - * - * It's intended that this file and the other glapi*.[ch] files are - * flexible enough to be reused in several places: XFree86, DRI- - * based libGL.so, and perhaps the SGI SI. + * This file manages the OpenGL API dispatch layer. There are functions + * to set/get the current dispatch table for the current thread and to + * manage registration/dispatch of dynamically added extension functions. * - * NOTE: There are no dependencies on Mesa in this code. - * - * Versions (API changes): - * 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0 - * 2001/01/16 - added dispatch override feature for Mesa 3.5 - * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1. - * 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints - * itself (using offset ~0). _glapi_add_entrypoint() can be - * called afterward and it'll fill in the correct dispatch - * offset. This allows DRI libGL to avoid probing for DRI - * drivers! No changes to the public glapi interface. + * This code was originally general enough to be shared with Mesa, but + * they diverged long ago, so this is now just enough support to make + * indirect GLX work. */ - - -#ifdef HAVE_DIX_CONFIG_H - #include #include +#include #define PUBLIC _X_EXPORT -#else - -#include "glheader.h" - -#endif - #include #include #ifdef DEBUG @@ -72,91 +47,10 @@ #include "glapioffsets.h" #include "glapitable.h" -/***** BEGIN NO-OP DISPATCH *****/ - -static GLboolean WarnFlag = GL_FALSE; -static _glapi_warning_func warning_func; - #if defined(PTHREADS) || defined(GLX_USE_TLS) static void init_glapi_relocs(void); #endif -static _glapi_proc generate_entrypoint(GLuint functionOffset); -static void fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); - -/* - * Enable/disable printing of warning messages. - */ -PUBLIC void -_glapi_noop_enable_warnings(GLboolean enable) -{ - WarnFlag = enable; -} - -/* - * Register a callback function for reporting errors. - */ -PUBLIC void -_glapi_set_warning_func( _glapi_warning_func func ) -{ - warning_func = func; -} - -static GLboolean -warn(void) -{ - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - -#if defined(__GNUC__) && (__GNUC__ > 2) -#define possibly_unused __attribute((unused)) -#else -#define possibly_unused -#endif - -#define KEYWORD1 static -#define KEYWORD1_ALT static -#define KEYWORD2 GLAPIENTRY possibly_unused -#define NAME(func) NoOp##func - -#define F NULL - -#define DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } - -#define RETURN_DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } \ - return 0 - -#define DISPATCH_TABLE_NAME __glapi_noop_table -#define UNUSED_TABLE_NAME __unused_noop_functions - -#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name - -static GLint NoOpUnused(void) -{ - if (warn()) { - warning_func(NULL, "GL User Error: calling extension function without a current context\n"); - } - return 0; -} - -#include "glapitemp.h" - -/***** END NO-OP DISPATCH *****/ - - - /** * \name Current dispatch and current context control variables * @@ -175,12 +69,6 @@ static GLint NoOpUnused(void) * static dispatch functions access these variables via \c _glapi_get_dispatch * and \c _glapi_get_context. * - * There is a race condition in setting \c _glapi_Dispatch to \c NULL. It is - * possible for the original thread to be setting it at the same instant a new - * thread, perhaps running on a different processor, is clearing it. Because - * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is - * used to determine whether or not the application is multithreaded. - * * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and @@ -190,12 +78,9 @@ static GLint NoOpUnused(void) /*@{*/ #if defined(GLX_USE_TLS) -PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))) - = (struct _glapi_table *) __glapi_noop_table; +PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch = NULL; -PUBLIC __thread void * _glapi_tls_Context - __attribute__((tls_model("initial-exec"))); +PUBLIC TLS void * _glapi_tls_Context; PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL; PUBLIC const void *_glapi_Context = NULL; @@ -204,7 +89,6 @@ PUBLIC const void *_glapi_Context = NULL; #if defined(THREADS) -static GLboolean ThreadSafe = GL_FALSE; /**< In thread-safe mode? */ _glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ @@ -219,61 +103,20 @@ void FreeAllTSD(void) #endif /* defined(THREADS) */ -PUBLIC struct _glapi_table *_glapi_Dispatch = - (struct _glapi_table *) __glapi_noop_table; +PUBLIC struct _glapi_table *_glapi_Dispatch = NULL; PUBLIC void *_glapi_Context = NULL; #endif /* defined(GLX_USE_TLS) */ /*@}*/ - -/** - * strdup() is actually not a standard ANSI C or POSIX routine. - * Irix will not define it if ANSI mode is in effect. - */ -static char * -str_dup(const char *str) -{ - char *copy; - copy = (char*) malloc(strlen(str) + 1); - if (!copy) - return NULL; - strcpy(copy, str); - return copy; -} - - - -/** - * We should call this periodically from a function such as glXMakeCurrent - * in order to test if multiple threads are being used. +/* + * xserver's gl is not multithreaded, we promise. */ PUBLIC void _glapi_check_multithread(void) { -#if defined(THREADS) && !defined(GLX_USE_TLS) - if (!ThreadSafe) { - static unsigned long knownID; - static GLboolean firstCall = GL_TRUE; - if (firstCall) { - knownID = _glthread_GetID(); - firstCall = GL_FALSE; - } - else if (knownID != _glthread_GetID()) { - ThreadSafe = GL_TRUE; - _glapi_set_dispatch(NULL); - _glapi_set_context(NULL); - } - } - else if (!_glapi_get_dispatch()) { - /* make sure that this thread's dispatch pointer isn't null */ - _glapi_set_dispatch(NULL); - } -#endif } - - /** * Set the current context pointer for this thread. * The context pointer is an opaque type which should be cast to @@ -282,12 +125,11 @@ _glapi_check_multithread(void) PUBLIC void _glapi_set_context(void *context) { - (void) __unused_noop_functions; /* silence a warning */ #if defined(GLX_USE_TLS) _glapi_tls_Context = context; #elif defined(THREADS) _glthread_SetTSD(&ContextTSD, context); - _glapi_Context = (ThreadSafe) ? NULL : context; + _glapi_Context = context; #else _glapi_Context = context; #endif @@ -305,13 +147,6 @@ _glapi_get_context(void) { #if defined(GLX_USE_TLS) return _glapi_tls_Context; -#elif defined(THREADS) - if (ThreadSafe) { - return _glthread_GetTSD(&ContextTSD); - } - else { - return _glapi_Context; - } #else return _glapi_Context; #endif @@ -321,8 +156,6 @@ _glapi_get_context(void) /** * Set the global or per-thread dispatch table pointer. - * If the dispatch parameter is NULL we'll plug in the no-op dispatch - * table (__glapi_noop_table). */ PUBLIC void _glapi_set_dispatch(struct _glapi_table *dispatch) @@ -332,21 +165,11 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) pthread_once( & once_control, init_glapi_relocs ); #endif - if (!dispatch) { - /* use the no-op functions */ - dispatch = (struct _glapi_table *) __glapi_noop_table; - } -#ifdef DEBUG - else { - _glapi_check_table(dispatch); - } -#endif - #if defined(GLX_USE_TLS) _glapi_tls_Dispatch = dispatch; #elif defined(THREADS) _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); - _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch; + _glapi_Dispatch = dispatch; #else /*THREADS*/ _glapi_Dispatch = dispatch; #endif /*THREADS*/ @@ -363,10 +186,6 @@ _glapi_get_dispatch(void) struct _glapi_table * api; #if defined(GLX_USE_TLS) api = _glapi_tls_Dispatch; -#elif defined(THREADS) - api = (ThreadSafe) - ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD) - : _glapi_Dispatch; #else api = _glapi_Dispatch; #endif @@ -390,9 +209,6 @@ _glapi_get_dispatch(void) # endif #endif -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) -# define NEED_FUNCTION_POINTER -#endif /* The code in this file is auto-generated with Python */ #include "glprocs.h" @@ -431,66 +247,6 @@ get_static_proc_offset(const char *funcName) } -#if !defined(XFree86Server) && !defined(XGLServer) -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - -/** - * Return dispatch function address for the named static (built-in) function. - * Return NULL if function not found. - */ -static _glapi_proc -get_static_proc_address(const char *funcName) -{ - const glprocs_table_t * const f = find_entry( funcName ); - if (f) { -#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) - return (f->Address == NULL) - ? (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)) - : f->Address; -#elif defined(DISPATCH_FUNCTION_SIZE) - return (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)); -#else - return f->Address; -#endif - } - else { - return NULL; - } -} - -#endif /* !defined(XFree86Server) && !defined(XGLServer) */ - - - -/** - * Return the name of the function at the given offset in the dispatch - * table. For debugging only. - */ -static const char * -get_static_proc_name( GLuint offset ) -{ - GLuint i; - for (i = 0; static_functions[i].Name_offset >= 0; i++) { - if (static_functions[i].Offset == offset) { - return gl_string_table + static_functions[i].Name_offset; - } - } - return NULL; -} - - /********************************************************************** * Extension function management. @@ -520,7 +276,6 @@ struct _glapi_function { */ const char * name; - /** * Text string that describes the types of the parameters passed to the * named function. Parameter types are converted to characters using the @@ -532,164 +287,17 @@ struct _glapi_function { */ const char * parameter_signature; - /** * Offset in the dispatch table where the pointer to the real function is * located. If the driver has not requested that the named function be * added to the dispatch table, this will have the value ~0. */ unsigned dispatch_offset; - - - /** - * Pointer to the dispatch stub for the named function. - * - * \todo - * The semantic of this field should be changed slightly. Currently, it - * is always expected to be non-\c NULL. However, it would be better to - * only allocate the entry-point stub when the application requests the - * function via \c glXGetProcAddress. This would save memory for all the - * functions that the driver exports but that the application never wants - * to call. - */ - _glapi_proc dispatch_stub; }; - static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; static GLuint NumExtEntryPoints = 0; -#ifdef USE_SPARC_ASM -extern void __glapi_sparc_icache_flush(unsigned int *); -#endif - -/** - * Generate a dispatch function (entrypoint) which jumps through - * the given slot number (offset) in the current dispatch table. - * We need assembly language in order to accomplish this. - */ -static _glapi_proc -generate_entrypoint(GLuint functionOffset) -{ -#if defined(USE_X86_ASM) - /* 32 is chosen as something of a magic offset. For x86, the dispatch - * at offset 32 is the first one where the offset in the - * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. - */ - const GLubyte * const template_func = gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * 32); - GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); - - - if ( code != NULL ) { - (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); - fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); - } - - return (_glapi_proc) code; -#elif defined(USE_SPARC_ASM) - -#ifdef __arch64__ - static const unsigned int insn_template[] = { - 0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */ - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0x8410a000, /* or %g2, %ulo(_glapi_Dispatch), %g2 */ - 0x82106000, /* or %g1, %lo(_glapi_Dispatch), %g1 */ - 0x8528b020, /* sllx %g2, 32, %g2 */ - 0xc2584002, /* ldx [%g1 + %g2], %g1 */ - 0x05000000, /* sethi %hi(8 * glapioffset), %g2 */ - 0x8410a000, /* or %g2, %lo(8 * glapioffset), %g2 */ - 0xc6584002, /* ldx [%g1 + %g2], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#else - static const unsigned int insn_template[] = { - 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ - 0xc2006000, /* ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ - 0xc6006000, /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - 0x81c0c000, /* jmpl %g3, %g0 */ - 0x01000000 /* nop */ - }; -#endif /* __arch64__ */ - unsigned int *code = (unsigned int *) malloc(sizeof(insn_template)); - unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch; - if (code) { - memcpy(code, insn_template, sizeof(insn_template)); - -#ifdef __arch64__ - code[0] |= (glapi_addr >> (32 + 10)); - code[1] |= ((glapi_addr & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1)); - code[3] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[2]); - code[6] |= ((functionOffset * 8) >> 10); - code[7] |= ((functionOffset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else - code[0] |= (glapi_addr >> 10); - code[1] |= (glapi_addr & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[0]); - code[2] |= (functionOffset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - } - return (_glapi_proc) code; -#else - (void) functionOffset; - return NULL; -#endif /* USE_*_ASM */ -} - - -/** - * This function inserts a new dispatch offset into the assembly language - * stub that was generated with the preceeding function. - */ -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) -{ -#if defined(USE_X86_ASM) - GLubyte * const code = (GLubyte *) entrypoint; - -#if DISPATCH_FUNCTION_SIZE == 32 - *((unsigned int *)(code + 11)) = 4 * offset; - *((unsigned int *)(code + 22)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) - *((unsigned int *)(code + 8)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 - *((unsigned int *)(code + 7)) = 4 * offset; -#else -# error Invalid DISPATCH_FUNCTION_SIZE! -#endif - -#elif defined(USE_SPARC_ASM) - - /* XXX this hasn't been tested! */ - unsigned int *code = (unsigned int *) entrypoint; -#ifdef __arch64__ - code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */ - code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */ - code[6] |= ((offset * 8) >> 10); - code[7] |= ((offset * 8) & ((1 << 10) - 1)); - __glapi_sparc_icache_flush(&code[6]); -#else /* __arch64__ */ - code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */ - code[2] |= (offset * 4); - __glapi_sparc_icache_flush(&code[2]); -#endif /* __arch64__ */ - -#else - - /* an unimplemented architecture */ - (void) entrypoint; - (void) offset; - -#endif /* USE_*_ASM */ -} - - /** * Generate new entrypoint * @@ -709,16 +317,12 @@ add_function_name( const char * funcName ) struct _glapi_function * entry = NULL; if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { - _glapi_proc entrypoint = generate_entrypoint(~0); - if (entrypoint != NULL) { - entry = & ExtEntryTable[NumExtEntryPoints]; - - ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); - ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; - ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; - ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; - NumExtEntryPoints++; - } + entry = &ExtEntryTable[NumExtEntryPoints]; + + ExtEntryTable[NumExtEntryPoints].name = strdup(funcName); + ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; + ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; + NumExtEntryPoints++; } return entry; @@ -787,14 +391,13 @@ _glapi_add_dispatch( const char * const * function_names, int new_offset; - (void) memset( is_static, 0, sizeof( is_static ) ); - (void) memset( entry, 0, sizeof( entry ) ); + (void) memset(is_static, 0, sizeof(is_static)); + (void) memset(entry, 0, sizeof(entry)); - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - /* Do some trivial validation on the name of the function. - */ + for (i = 0 ; function_names[i] != NULL ; i++) { + /* Do some trivial validation on the name of the function. */ - if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') + if (function_names[i][0] != 'g' || function_names[i][1] != 'l') return GL_FALSE; /* Determine if the named function already exists. If the function does @@ -808,7 +411,7 @@ _glapi_add_dispatch( const char * const * function_names, * FIXME: the parameter signature for static functions? */ - if ( (offset != ~0) && (new_offset != offset) ) { + if ((offset != ~0) && (new_offset != offset)) { return -1; } @@ -816,20 +419,17 @@ _glapi_add_dispatch( const char * const * function_names, offset = new_offset; } - - for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { + for (j = 0; j < NumExtEntryPoints; j++) { if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { /* The offset may be ~0 if the function name was added by * glXGetProcAddress but never filled in by the driver. */ if (ExtEntryTable[j].dispatch_offset != ~0) { - if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) - != 0) { + if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) != 0) return -1; - } - if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { + if ((offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset)) { return -1; } @@ -847,19 +447,15 @@ _glapi_add_dispatch( const char * const * function_names, next_dynamic_offset++; } - for ( i = 0 ; function_names[i] != NULL ; i++ ) { - if (! is_static[i] ) { + for (i = 0 ; function_names[i] != NULL ; i++) { + if (!is_static[i]) { if (entry[i] == NULL) { - entry[i] = add_function_name( function_names[i] ); - if (entry[i] == NULL) { - /* FIXME: Possible memory leak here. - */ + entry[i] = add_function_name(function_names[i]); + if (entry[i] == NULL) return -1; - } } - entry[i]->parameter_signature = str_dup(real_sig); - fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset); + entry[i]->parameter_signature = strdup(real_sig); entry[i]->dispatch_offset = offset; } } @@ -867,94 +463,17 @@ _glapi_add_dispatch( const char * const * function_names, return offset; } - -/** - * Return offset of entrypoint for named function within dispatch table. - */ -PUBLIC GLint -_glapi_get_proc_offset(const char *funcName) -{ - /* search extension functions first */ - GLuint i; - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_offset; - } - } - /* search static functions */ - return get_static_proc_offset(funcName); -} - - - -/** - * Return pointer to the named function. If the function name isn't found - * in the name of static functions, try generating a new API entrypoint on - * the fly with assembly language. +/* + * glXGetProcAddress doesn't exist in the protocol, the drivers never call + * this themselves, and neither does the server. warn if it happens though. */ -_glapi_proc +PUBLIC _glapi_proc _glapi_get_proc_address(const char *funcName) { - struct _glapi_function * entry; - GLuint i; - -#ifdef MANGLE - if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return NULL; -#else - if (funcName[0] != 'g' || funcName[1] != 'l') - return NULL; -#endif - - /* search extension functions first */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].name, funcName) == 0) { - return ExtEntryTable[i].dispatch_stub; - } - } - -#if !defined( XFree86Server ) && !defined( XGLServer ) - /* search static functions */ - { - const _glapi_proc func = get_static_proc_address(funcName); - if (func) - return func; - } -#endif /* !defined( XFree86Server ) */ - - entry = add_function_name(funcName); - return (entry == NULL) ? NULL : entry->dispatch_stub; -} - - - -/** - * Return the name of the function at the given dispatch offset. - * This is only intended for debugging. - */ -const char * -_glapi_get_proc_name(GLuint offset) -{ - GLuint i; - const char * n; - - /* search built-in functions */ - n = get_static_proc_name(offset); - if ( n != NULL ) { - return n; - } - - /* search added extension functions */ - for (i = 0; i < NumExtEntryPoints; i++) { - if (ExtEntryTable[i].dispatch_offset == offset) { - return ExtEntryTable[i].name; - } - } - return NULL; + ErrorF("_glapi_get_proc_address called!\n"); + return NULL; } - - /** * Return size of dispatch table struct as number of functions (or * slots). @@ -965,88 +484,6 @@ _glapi_get_dispatch_table_size(void) return DISPATCH_TABLE_SIZE; } - - -/** - * Make sure there are no NULL pointers in the given dispatch table. - * Intended for debugging purposes. - */ -void -_glapi_check_table(const struct _glapi_table *table) -{ -#ifdef DEBUG - const GLuint entries = _glapi_get_dispatch_table_size(); - const void **tab = (const void **) table; - GLuint i; - for (i = 1; i < entries; i++) { - assert(tab[i]); - } - - /* Do some spot checks to be sure that the dispatch table - * slots are assigned correctly. - */ - { - GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); - char *BeginFunc = (char*) &table->Begin; - GLuint offset = (BeginFunc - (char *) table) / sizeof(void *); - assert(BeginOffset == _gloffset_Begin); - assert(BeginOffset == offset); - } - { - GLuint viewportOffset = _glapi_get_proc_offset("glViewport"); - char *viewportFunc = (char*) &table->Viewport; - GLuint offset = (viewportFunc - (char *) table) / sizeof(void *); - assert(viewportOffset == _gloffset_Viewport); - assert(viewportOffset == offset); - } - { - GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer"); - char *VertexPointerFunc = (char*) &table->VertexPointer; - GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *); - assert(VertexPointerOffset == _gloffset_VertexPointer); - assert(VertexPointerOffset == offset); - } - { - GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax"); - char *ResetMinMaxFunc = (char*) &table->ResetMinmax; - GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *); - assert(ResetMinMaxOffset == _gloffset_ResetMinmax); - assert(ResetMinMaxOffset == offset); - } - { - GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor"); - char *blendColorFunc = (char*) &table->BlendColor; - GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *); - assert(blendColorOffset == _gloffset_BlendColor); - assert(blendColorOffset == offset); - } - { - GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); - char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; - GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *); - assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT); - assert(secondaryColor3fOffset == offset); - } - { - GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV"); - char *pointParameterivFunc = (char*) &table->PointParameterivNV; - GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *); - assert(pointParameterivOffset == _gloffset_PointParameterivNV); - assert(pointParameterivOffset == offset); - } - { - GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV"); - char *setFenceFunc = (char*) &table->SetFenceNV; - GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *); - assert(setFenceOffset == _gloffset_SetFenceNV); - assert(setFenceOffset == offset); - } -#else - (void) table; -#endif -} - - #if defined(PTHREADS) || defined(GLX_USE_TLS) /** * Perform platform-specific GL API entry-point fixups. diff --git a/glx/glapi.h b/glx/glapi.h index 8f2cf6621..7051c1e3c 100644 --- a/glx/glapi.h +++ b/glx/glapi.h @@ -83,8 +83,7 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); const extern void *_glapi_Context; const extern struct _glapi_table *_glapi_Dispatch; -extern __thread void * _glapi_tls_Context - __attribute__((tls_model("initial-exec"))); +extern TLS void * _glapi_tls_Context; # define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context @@ -106,66 +105,38 @@ extern struct _glapi_table *_glapi_Dispatch; ** GL API public functions **/ -extern void -_glapi_noop_enable_warnings(GLboolean enable); - -extern void -_glapi_set_warning_func(_glapi_warning_func func); - extern void _glapi_check_multithread(void); - extern void _glapi_set_context(void *context); - extern void * _glapi_get_context(void); - extern void _glapi_set_dispatch(struct _glapi_table *dispatch); - extern struct _glapi_table * _glapi_get_dispatch(void); - extern int _glapi_begin_dispatch_override(struct _glapi_table *override); - extern void _glapi_end_dispatch_override(int layer); - struct _glapi_table * _glapi_get_override_dispatch(int layer); - extern GLuint _glapi_get_dispatch_table_size(void); - -extern void -_glapi_check_table(const struct _glapi_table *table); - - extern int _glapi_add_dispatch( const char * const * function_names, const char * parameter_signature ); -extern GLint -_glapi_get_proc_offset(const char *funcName); - - extern _glapi_proc _glapi_get_proc_address(const char *funcName); - -extern const char * -_glapi_get_proc_name(GLuint offset); - - #endif diff --git a/glx/glapitemp.h b/glx/glapitemp.h deleted file mode 100644 index ddd67afec..000000000 --- a/glx/glapitemp.h +++ /dev/null @@ -1,6655 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by gl_apitemp.py (from Mesa) script */ - -/* - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2004 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL, IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) -# define HIDDEN __attribute__((visibility("hidden"))) -# else -# define HIDDEN -# endif - -/* - * This file is a template which generates the OpenGL API entry point - * functions. It should be included by a .c file which first defines - * the following macros: - * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32 - * KEYWORD2 - usually nothing, but might be __stdcall on Win32 - * NAME(n) - builds the final function name (usually add "gl" prefix) - * DISPATCH(func, args, msg) - code to do dispatch of named function. - * msg is a printf-style debug message. - * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value - * - * Here is an example which generates the usual OpenGL functions: - * #define KEYWORD1 - * #define KEYWORD2 - * #define NAME(func) gl##func - * #define DISPATCH(func, args, msg) \ - * struct _glapi_table *dispatch = CurrentDispatch; \ - * (*dispatch->func) args - * #define RETURN DISPATCH(func, args, msg) \ - * struct _glapi_table *dispatch = CurrentDispatch; \ - * return (*dispatch->func) args - * - */ - - -#if defined( NAME ) -#ifndef KEYWORD1 -#define KEYWORD1 -#endif - -#ifndef KEYWORD1_ALT -#define KEYWORD1_ALT HIDDEN -#endif - -#ifndef KEYWORD2 -#define KEYWORD2 -#endif - -#ifndef DISPATCH -#error DISPATCH must be defined -#endif - -#ifndef RETURN_DISPATCH -#error RETURN_DISPATCH must be defined -#endif - - -KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) -{ - DISPATCH(NewList, (list, mode), (F, "glNewList(%d, 0x%x);\n", list, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(EndList)(void) -{ - DISPATCH(EndList, (), (F, "glEndList();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(CallList)(GLuint list) -{ - DISPATCH(CallList, (list), (F, "glCallList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(CallLists)(GLsizei n, GLenum type, const GLvoid * lists) -{ - DISPATCH(CallLists, (n, type, lists), (F, "glCallLists(%d, 0x%x, %p);\n", n, type, (const void *) lists)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteLists)(GLuint list, GLsizei range) -{ - DISPATCH(DeleteLists, (list, range), (F, "glDeleteLists(%d, %d);\n", list, range)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenLists)(GLsizei range) -{ - RETURN_DISPATCH(GenLists, (range), (F, "glGenLists(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(ListBase)(GLuint base) -{ - DISPATCH(ListBase, (base), (F, "glListBase(%d);\n", base)); -} - -KEYWORD1 void KEYWORD2 NAME(Begin)(GLenum mode) -{ - DISPATCH(Begin, (mode), (F, "glBegin(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap) -{ - DISPATCH(Bitmap, (width, height, xorig, yorig, xmove, ymove, bitmap), (F, "glBitmap(%d, %d, %f, %f, %f, %f, %p);\n", width, height, xorig, yorig, xmove, ymove, (const void *) bitmap)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(Color3b, (red, green, blue), (F, "glColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3bv)(const GLbyte * v) -{ - DISPATCH(Color3bv, (v), (F, "glColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(Color3d, (red, green, blue), (F, "glColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3dv)(const GLdouble * v) -{ - DISPATCH(Color3dv, (v), (F, "glColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(Color3f, (red, green, blue), (F, "glColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3fv)(const GLfloat * v) -{ - DISPATCH(Color3fv, (v), (F, "glColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(Color3i, (red, green, blue), (F, "glColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3iv)(const GLint * v) -{ - DISPATCH(Color3iv, (v), (F, "glColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(Color3s, (red, green, blue), (F, "glColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3sv)(const GLshort * v) -{ - DISPATCH(Color3sv, (v), (F, "glColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(Color3ub, (red, green, blue), (F, "glColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ubv)(const GLubyte * v) -{ - DISPATCH(Color3ubv, (v), (F, "glColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(Color3ui, (red, green, blue), (F, "glColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3uiv)(const GLuint * v) -{ - DISPATCH(Color3uiv, (v), (F, "glColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(Color3us, (red, green, blue), (F, "glColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(Color3usv)(const GLushort * v) -{ - DISPATCH(Color3usv, (v), (F, "glColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) -{ - DISPATCH(Color4b, (red, green, blue, alpha), (F, "glColor4b(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4bv)(const GLbyte * v) -{ - DISPATCH(Color4bv, (v), (F, "glColor4bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) -{ - DISPATCH(Color4d, (red, green, blue, alpha), (F, "glColor4d(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4dv)(const GLdouble * v) -{ - DISPATCH(Color4dv, (v), (F, "glColor4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(Color4f, (red, green, blue, alpha), (F, "glColor4f(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4fv)(const GLfloat * v) -{ - DISPATCH(Color4fv, (v), (F, "glColor4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4i)(GLint red, GLint green, GLint blue, GLint alpha) -{ - DISPATCH(Color4i, (red, green, blue, alpha), (F, "glColor4i(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4iv)(const GLint * v) -{ - DISPATCH(Color4iv, (v), (F, "glColor4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha) -{ - DISPATCH(Color4s, (red, green, blue, alpha), (F, "glColor4s(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4sv)(const GLshort * v) -{ - DISPATCH(Color4sv, (v), (F, "glColor4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) -{ - DISPATCH(Color4ub, (red, green, blue, alpha), (F, "glColor4ub(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ubv)(const GLubyte * v) -{ - DISPATCH(Color4ubv, (v), (F, "glColor4ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha) -{ - DISPATCH(Color4ui, (red, green, blue, alpha), (F, "glColor4ui(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4uiv)(const GLuint * v) -{ - DISPATCH(Color4uiv, (v), (F, "glColor4uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha) -{ - DISPATCH(Color4us, (red, green, blue, alpha), (F, "glColor4us(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(Color4usv)(const GLushort * v) -{ - DISPATCH(Color4usv, (v), (F, "glColor4usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlag)(GLboolean flag) -{ - DISPATCH(EdgeFlag, (flag), (F, "glEdgeFlag(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagv)(const GLboolean * flag) -{ - DISPATCH(EdgeFlagv, (flag), (F, "glEdgeFlagv(%p);\n", (const void *) flag)); -} - -KEYWORD1 void KEYWORD2 NAME(End)(void) -{ - DISPATCH(End, (), (F, "glEnd();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Indexd)(GLdouble c) -{ - DISPATCH(Indexd, (c), (F, "glIndexd(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexdv)(const GLdouble * c) -{ - DISPATCH(Indexdv, (c), (F, "glIndexdv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexf)(GLfloat c) -{ - DISPATCH(Indexf, (c), (F, "glIndexf(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexfv)(const GLfloat * c) -{ - DISPATCH(Indexfv, (c), (F, "glIndexfv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexi)(GLint c) -{ - DISPATCH(Indexi, (c), (F, "glIndexi(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexiv)(const GLint * c) -{ - DISPATCH(Indexiv, (c), (F, "glIndexiv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexs)(GLshort c) -{ - DISPATCH(Indexs, (c), (F, "glIndexs(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexsv)(const GLshort * c) -{ - DISPATCH(Indexsv, (c), (F, "glIndexsv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz) -{ - DISPATCH(Normal3b, (nx, ny, nz), (F, "glNormal3b(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3bv)(const GLbyte * v) -{ - DISPATCH(Normal3bv, (v), (F, "glNormal3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz) -{ - DISPATCH(Normal3d, (nx, ny, nz), (F, "glNormal3d(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3dv)(const GLdouble * v) -{ - DISPATCH(Normal3dv, (v), (F, "glNormal3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz) -{ - DISPATCH(Normal3f, (nx, ny, nz), (F, "glNormal3f(%f, %f, %f);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3fv)(const GLfloat * v) -{ - DISPATCH(Normal3fv, (v), (F, "glNormal3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3i)(GLint nx, GLint ny, GLint nz) -{ - DISPATCH(Normal3i, (nx, ny, nz), (F, "glNormal3i(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3iv)(const GLint * v) -{ - DISPATCH(Normal3iv, (v), (F, "glNormal3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3s)(GLshort nx, GLshort ny, GLshort nz) -{ - DISPATCH(Normal3s, (nx, ny, nz), (F, "glNormal3s(%d, %d, %d);\n", nx, ny, nz)); -} - -KEYWORD1 void KEYWORD2 NAME(Normal3sv)(const GLshort * v) -{ - DISPATCH(Normal3sv, (v), (F, "glNormal3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(RasterPos2d, (x, y), (F, "glRasterPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2dv)(const GLdouble * v) -{ - DISPATCH(RasterPos2dv, (v), (F, "glRasterPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(RasterPos2f, (x, y), (F, "glRasterPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2fv)(const GLfloat * v) -{ - DISPATCH(RasterPos2fv, (v), (F, "glRasterPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2i)(GLint x, GLint y) -{ - DISPATCH(RasterPos2i, (x, y), (F, "glRasterPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2iv)(const GLint * v) -{ - DISPATCH(RasterPos2iv, (v), (F, "glRasterPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2s)(GLshort x, GLshort y) -{ - DISPATCH(RasterPos2s, (x, y), (F, "glRasterPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos2sv)(const GLshort * v) -{ - DISPATCH(RasterPos2sv, (v), (F, "glRasterPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(RasterPos3d, (x, y, z), (F, "glRasterPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3dv)(const GLdouble * v) -{ - DISPATCH(RasterPos3dv, (v), (F, "glRasterPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(RasterPos3f, (x, y, z), (F, "glRasterPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3fv)(const GLfloat * v) -{ - DISPATCH(RasterPos3fv, (v), (F, "glRasterPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(RasterPos3i, (x, y, z), (F, "glRasterPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3iv)(const GLint * v) -{ - DISPATCH(RasterPos3iv, (v), (F, "glRasterPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(RasterPos3s, (x, y, z), (F, "glRasterPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos3sv)(const GLshort * v) -{ - DISPATCH(RasterPos3sv, (v), (F, "glRasterPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(RasterPos4d, (x, y, z, w), (F, "glRasterPos4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4dv)(const GLdouble * v) -{ - DISPATCH(RasterPos4dv, (v), (F, "glRasterPos4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(RasterPos4f, (x, y, z, w), (F, "glRasterPos4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4fv)(const GLfloat * v) -{ - DISPATCH(RasterPos4fv, (v), (F, "glRasterPos4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(RasterPos4i, (x, y, z, w), (F, "glRasterPos4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4iv)(const GLint * v) -{ - DISPATCH(RasterPos4iv, (v), (F, "glRasterPos4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(RasterPos4s, (x, y, z, w), (F, "glRasterPos4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(RasterPos4sv)(const GLshort * v) -{ - DISPATCH(RasterPos4sv, (v), (F, "glRasterPos4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) -{ - DISPATCH(Rectd, (x1, y1, x2, y2), (F, "glRectd(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectdv)(const GLdouble * v1, const GLdouble * v2) -{ - DISPATCH(Rectdv, (v1, v2), (F, "glRectdv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - DISPATCH(Rectf, (x1, y1, x2, y2), (F, "glRectf(%f, %f, %f, %f);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectfv)(const GLfloat * v1, const GLfloat * v2) -{ - DISPATCH(Rectfv, (v1, v2), (F, "glRectfv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Recti)(GLint x1, GLint y1, GLint x2, GLint y2) -{ - DISPATCH(Recti, (x1, y1, x2, y2), (F, "glRecti(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectiv)(const GLint * v1, const GLint * v2) -{ - DISPATCH(Rectiv, (v1, v2), (F, "glRectiv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2) -{ - DISPATCH(Rects, (x1, y1, x2, y2), (F, "glRects(%d, %d, %d, %d);\n", x1, y1, x2, y2)); -} - -KEYWORD1 void KEYWORD2 NAME(Rectsv)(const GLshort * v1, const GLshort * v2) -{ - DISPATCH(Rectsv, (v1, v2), (F, "glRectsv(%p, %p);\n", (const void *) v1, (const void *) v2)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1d)(GLdouble s) -{ - DISPATCH(TexCoord1d, (s), (F, "glTexCoord1d(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1dv)(const GLdouble * v) -{ - DISPATCH(TexCoord1dv, (v), (F, "glTexCoord1dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1f)(GLfloat s) -{ - DISPATCH(TexCoord1f, (s), (F, "glTexCoord1f(%f);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1fv)(const GLfloat * v) -{ - DISPATCH(TexCoord1fv, (v), (F, "glTexCoord1fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1i)(GLint s) -{ - DISPATCH(TexCoord1i, (s), (F, "glTexCoord1i(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1iv)(const GLint * v) -{ - DISPATCH(TexCoord1iv, (v), (F, "glTexCoord1iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1s)(GLshort s) -{ - DISPATCH(TexCoord1s, (s), (F, "glTexCoord1s(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord1sv)(const GLshort * v) -{ - DISPATCH(TexCoord1sv, (v), (F, "glTexCoord1sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2d)(GLdouble s, GLdouble t) -{ - DISPATCH(TexCoord2d, (s, t), (F, "glTexCoord2d(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2dv)(const GLdouble * v) -{ - DISPATCH(TexCoord2dv, (v), (F, "glTexCoord2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2f)(GLfloat s, GLfloat t) -{ - DISPATCH(TexCoord2f, (s, t), (F, "glTexCoord2f(%f, %f);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2fv)(const GLfloat * v) -{ - DISPATCH(TexCoord2fv, (v), (F, "glTexCoord2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2i)(GLint s, GLint t) -{ - DISPATCH(TexCoord2i, (s, t), (F, "glTexCoord2i(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2iv)(const GLint * v) -{ - DISPATCH(TexCoord2iv, (v), (F, "glTexCoord2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2s)(GLshort s, GLshort t) -{ - DISPATCH(TexCoord2s, (s, t), (F, "glTexCoord2s(%d, %d);\n", s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord2sv)(const GLshort * v) -{ - DISPATCH(TexCoord2sv, (v), (F, "glTexCoord2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(TexCoord3d, (s, t, r), (F, "glTexCoord3d(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3dv)(const GLdouble * v) -{ - DISPATCH(TexCoord3dv, (v), (F, "glTexCoord3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3f)(GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(TexCoord3f, (s, t, r), (F, "glTexCoord3f(%f, %f, %f);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3fv)(const GLfloat * v) -{ - DISPATCH(TexCoord3fv, (v), (F, "glTexCoord3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3i)(GLint s, GLint t, GLint r) -{ - DISPATCH(TexCoord3i, (s, t, r), (F, "glTexCoord3i(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3iv)(const GLint * v) -{ - DISPATCH(TexCoord3iv, (v), (F, "glTexCoord3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3s)(GLshort s, GLshort t, GLshort r) -{ - DISPATCH(TexCoord3s, (s, t, r), (F, "glTexCoord3s(%d, %d, %d);\n", s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord3sv)(const GLshort * v) -{ - DISPATCH(TexCoord3sv, (v), (F, "glTexCoord3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(TexCoord4d, (s, t, r, q), (F, "glTexCoord4d(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4dv)(const GLdouble * v) -{ - DISPATCH(TexCoord4dv, (v), (F, "glTexCoord4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(TexCoord4f, (s, t, r, q), (F, "glTexCoord4f(%f, %f, %f, %f);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4fv)(const GLfloat * v) -{ - DISPATCH(TexCoord4fv, (v), (F, "glTexCoord4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4i)(GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(TexCoord4i, (s, t, r, q), (F, "glTexCoord4i(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4iv)(const GLint * v) -{ - DISPATCH(TexCoord4iv, (v), (F, "glTexCoord4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(TexCoord4s, (s, t, r, q), (F, "glTexCoord4s(%d, %d, %d, %d);\n", s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoord4sv)(const GLshort * v) -{ - DISPATCH(TexCoord4sv, (v), (F, "glTexCoord4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2d)(GLdouble x, GLdouble y) -{ - DISPATCH(Vertex2d, (x, y), (F, "glVertex2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2dv)(const GLdouble * v) -{ - DISPATCH(Vertex2dv, (v), (F, "glVertex2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2f)(GLfloat x, GLfloat y) -{ - DISPATCH(Vertex2f, (x, y), (F, "glVertex2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2fv)(const GLfloat * v) -{ - DISPATCH(Vertex2fv, (v), (F, "glVertex2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2i)(GLint x, GLint y) -{ - DISPATCH(Vertex2i, (x, y), (F, "glVertex2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2iv)(const GLint * v) -{ - DISPATCH(Vertex2iv, (v), (F, "glVertex2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2s)(GLshort x, GLshort y) -{ - DISPATCH(Vertex2s, (x, y), (F, "glVertex2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex2sv)(const GLshort * v) -{ - DISPATCH(Vertex2sv, (v), (F, "glVertex2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Vertex3d, (x, y, z), (F, "glVertex3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3dv)(const GLdouble * v) -{ - DISPATCH(Vertex3dv, (v), (F, "glVertex3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Vertex3f, (x, y, z), (F, "glVertex3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3fv)(const GLfloat * v) -{ - DISPATCH(Vertex3fv, (v), (F, "glVertex3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(Vertex3i, (x, y, z), (F, "glVertex3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3iv)(const GLint * v) -{ - DISPATCH(Vertex3iv, (v), (F, "glVertex3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(Vertex3s, (x, y, z), (F, "glVertex3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex3sv)(const GLshort * v) -{ - DISPATCH(Vertex3sv, (v), (F, "glVertex3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(Vertex4d, (x, y, z, w), (F, "glVertex4d(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4dv)(const GLdouble * v) -{ - DISPATCH(Vertex4dv, (v), (F, "glVertex4dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(Vertex4f, (x, y, z, w), (F, "glVertex4f(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4fv)(const GLfloat * v) -{ - DISPATCH(Vertex4fv, (v), (F, "glVertex4fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4i)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(Vertex4i, (x, y, z, w), (F, "glVertex4i(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4iv)(const GLint * v) -{ - DISPATCH(Vertex4iv, (v), (F, "glVertex4iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(Vertex4s, (x, y, z, w), (F, "glVertex4s(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(Vertex4sv)(const GLshort * v) -{ - DISPATCH(Vertex4sv, (v), (F, "glVertex4sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ClipPlane)(GLenum plane, const GLdouble * equation) -{ - DISPATCH(ClipPlane, (plane, equation), (F, "glClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMaterial)(GLenum face, GLenum mode) -{ - DISPATCH(ColorMaterial, (face, mode), (F, "glColorMaterial(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CullFace)(GLenum mode) -{ - DISPATCH(CullFace, (mode), (F, "glCullFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogf)(GLenum pname, GLfloat param) -{ - DISPATCH(Fogf, (pname, param), (F, "glFogf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(Fogfv, (pname, params), (F, "glFogfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogi)(GLenum pname, GLint param) -{ - DISPATCH(Fogi, (pname, param), (F, "glFogi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Fogiv)(GLenum pname, const GLint * params) -{ - DISPATCH(Fogiv, (pname, params), (F, "glFogiv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FrontFace)(GLenum mode) -{ - DISPATCH(FrontFace, (mode), (F, "glFrontFace(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Hint)(GLenum target, GLenum mode) -{ - DISPATCH(Hint, (target, mode), (F, "glHint(0x%x, 0x%x);\n", target, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightf)(GLenum light, GLenum pname, GLfloat param) -{ - DISPATCH(Lightf, (light, pname, param), (F, "glLightf(0x%x, 0x%x, %f);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightfv)(GLenum light, GLenum pname, const GLfloat * params) -{ - DISPATCH(Lightfv, (light, pname, params), (F, "glLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Lighti)(GLenum light, GLenum pname, GLint param) -{ - DISPATCH(Lighti, (light, pname, param), (F, "glLighti(0x%x, 0x%x, %d);\n", light, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Lightiv)(GLenum light, GLenum pname, const GLint * params) -{ - DISPATCH(Lightiv, (light, pname, params), (F, "glLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelf)(GLenum pname, GLfloat param) -{ - DISPATCH(LightModelf, (pname, param), (F, "glLightModelf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModelfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(LightModelfv, (pname, params), (F, "glLightModelfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeli)(GLenum pname, GLint param) -{ - DISPATCH(LightModeli, (pname, param), (F, "glLightModeli(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(LightModeliv)(GLenum pname, const GLint * params) -{ - DISPATCH(LightModeliv, (pname, params), (F, "glLightModeliv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LineStipple)(GLint factor, GLushort pattern) -{ - DISPATCH(LineStipple, (factor, pattern), (F, "glLineStipple(%d, %d);\n", factor, pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(LineWidth)(GLfloat width) -{ - DISPATCH(LineWidth, (width), (F, "glLineWidth(%f);\n", width)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialf)(GLenum face, GLenum pname, GLfloat param) -{ - DISPATCH(Materialf, (face, pname, param), (F, "glMaterialf(0x%x, 0x%x, %f);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialfv)(GLenum face, GLenum pname, const GLfloat * params) -{ - DISPATCH(Materialfv, (face, pname, params), (F, "glMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(Materiali)(GLenum face, GLenum pname, GLint param) -{ - DISPATCH(Materiali, (face, pname, param), (F, "glMateriali(0x%x, 0x%x, %d);\n", face, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(Materialiv)(GLenum face, GLenum pname, const GLint * params) -{ - DISPATCH(Materialiv, (face, pname, params), (F, "glMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointSize)(GLfloat size) -{ - DISPATCH(PointSize, (size), (F, "glPointSize(%f);\n", size)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonMode)(GLenum face, GLenum mode) -{ - DISPATCH(PolygonMode, (face, mode), (F, "glPolygonMode(0x%x, 0x%x);\n", face, mode)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonStipple)(const GLubyte * mask) -{ - DISPATCH(PolygonStipple, (mask), (F, "glPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Scissor)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Scissor, (x, y, width, height), (F, "glScissor(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ShadeModel)(GLenum mode) -{ - DISPATCH(ShadeModel, (mode), (F, "glShadeModel(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexParameterf, (target, pname, param), (F, "glTexParameterf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexParameterfv, (target, pname, params), (F, "glTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteri)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexParameteri, (target, pname, param), (F, "glTexParameteri(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexParameteriv, (target, pname, params), (F, "glTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage1D, (target, level, internalformat, width, border, format, type, pixels), (F, "glTexImage1D(0x%x, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage2D, (target, level, internalformat, width, height, border, format, type, pixels), (F, "glTexImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvf)(GLenum target, GLenum pname, GLfloat param) -{ - DISPATCH(TexEnvf, (target, pname, param), (F, "glTexEnvf(0x%x, 0x%x, %f);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexEnvfv, (target, pname, params), (F, "glTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnvi)(GLenum target, GLenum pname, GLint param) -{ - DISPATCH(TexEnvi, (target, pname, param), (F, "glTexEnvi(0x%x, 0x%x, %d);\n", target, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexEnviv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(TexEnviv, (target, pname, params), (F, "glTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGend)(GLenum coord, GLenum pname, GLdouble param) -{ - DISPATCH(TexGend, (coord, pname, param), (F, "glTexGend(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGendv)(GLenum coord, GLenum pname, const GLdouble * params) -{ - DISPATCH(TexGendv, (coord, pname, params), (F, "glTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenf)(GLenum coord, GLenum pname, GLfloat param) -{ - DISPATCH(TexGenf, (coord, pname, param), (F, "glTexGenf(0x%x, 0x%x, %f);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params) -{ - DISPATCH(TexGenfv, (coord, pname, params), (F, "glTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeni)(GLenum coord, GLenum pname, GLint param) -{ - DISPATCH(TexGeni, (coord, pname, param), (F, "glTexGeni(0x%x, 0x%x, %d);\n", coord, pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(TexGeniv)(GLenum coord, GLenum pname, const GLint * params) -{ - DISPATCH(TexGeniv, (coord, pname, params), (F, "glTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer) -{ - DISPATCH(FeedbackBuffer, (size, type, buffer), (F, "glFeedbackBuffer(%d, 0x%x, %p);\n", size, type, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(SelectBuffer)(GLsizei size, GLuint * buffer) -{ - DISPATCH(SelectBuffer, (size, buffer), (F, "glSelectBuffer(%d, %p);\n", size, (const void *) buffer)); -} - -KEYWORD1 GLint KEYWORD2 NAME(RenderMode)(GLenum mode) -{ - RETURN_DISPATCH(RenderMode, (mode), (F, "glRenderMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(InitNames)(void) -{ - DISPATCH(InitNames, (), (F, "glInitNames();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadName)(GLuint name) -{ - DISPATCH(LoadName, (name), (F, "glLoadName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(PassThrough)(GLfloat token) -{ - DISPATCH(PassThrough, (token), (F, "glPassThrough(%f);\n", token)); -} - -KEYWORD1 void KEYWORD2 NAME(PopName)(void) -{ - DISPATCH(PopName, (), (F, "glPopName();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushName)(GLuint name) -{ - DISPATCH(PushName, (name), (F, "glPushName(%d);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffer)(GLenum mode) -{ - DISPATCH(DrawBuffer, (mode), (F, "glDrawBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(Clear)(GLbitfield mask) -{ - DISPATCH(Clear, (mask), (F, "glClear(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - DISPATCH(ClearAccum, (red, green, blue, alpha), (F, "glClearAccum(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearIndex)(GLfloat c) -{ - DISPATCH(ClearIndex, (c), (F, "glClearIndex(%f);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(ClearColor, (red, green, blue, alpha), (F, "glClearColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearStencil)(GLint s) -{ - DISPATCH(ClearStencil, (s), (F, "glClearStencil(%d);\n", s)); -} - -KEYWORD1 void KEYWORD2 NAME(ClearDepth)(GLclampd depth) -{ - DISPATCH(ClearDepth, (depth), (F, "glClearDepth(%f);\n", depth)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMask)(GLuint mask) -{ - DISPATCH(StencilMask, (mask), (F, "glStencilMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -{ - DISPATCH(ColorMask, (red, green, blue, alpha), (F, "glColorMask(%d, %d, %d, %d);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthMask)(GLboolean flag) -{ - DISPATCH(DepthMask, (flag), (F, "glDepthMask(%d);\n", flag)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexMask)(GLuint mask) -{ - DISPATCH(IndexMask, (mask), (F, "glIndexMask(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Accum)(GLenum op, GLfloat value) -{ - DISPATCH(Accum, (op, value), (F, "glAccum(0x%x, %f);\n", op, value)); -} - -KEYWORD1 void KEYWORD2 NAME(Disable)(GLenum cap) -{ - DISPATCH(Disable, (cap), (F, "glDisable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Enable)(GLenum cap) -{ - DISPATCH(Enable, (cap), (F, "glEnable(0x%x);\n", cap)); -} - -KEYWORD1 void KEYWORD2 NAME(Finish)(void) -{ - DISPATCH(Finish, (), (F, "glFinish();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Flush)(void) -{ - DISPATCH(Flush, (), (F, "glFlush();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PopAttrib)(void) -{ - DISPATCH(PopAttrib, (), (F, "glPopAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushAttrib)(GLbitfield mask) -{ - DISPATCH(PushAttrib, (mask), (F, "glPushAttrib(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points) -{ - DISPATCH(Map1d, (target, u1, u2, stride, order, points), (F, "glMap1d(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points) -{ - DISPATCH(Map1f, (target, u1, u2, stride, order, points), (F, "glMap1f(0x%x, %f, %f, %d, %d, %p);\n", target, u1, u2, stride, order, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points) -{ - DISPATCH(Map2d, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2d(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points) -{ - DISPATCH(Map2f, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points), (F, "glMap2f(0x%x, %f, %f, %d, %d, %f, %f, %d, %d, %p);\n", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, (const void *) points)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1d)(GLint un, GLdouble u1, GLdouble u2) -{ - DISPATCH(MapGrid1d, (un, u1, u2), (F, "glMapGrid1d(%d, %f, %f);\n", un, u1, u2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid1f)(GLint un, GLfloat u1, GLfloat u2) -{ - DISPATCH(MapGrid1f, (un, u1, u2), (F, "glMapGrid1f(%d, %f, %f);\n", un, u1, u2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) -{ - DISPATCH(MapGrid2d, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2d(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) -{ - DISPATCH(MapGrid2f, (un, u1, u2, vn, v1, v2), (F, "glMapGrid2f(%d, %f, %f, %d, %f, %f);\n", un, u1, u2, vn, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1d)(GLdouble u) -{ - DISPATCH(EvalCoord1d, (u), (F, "glEvalCoord1d(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord1dv, (u), (F, "glEvalCoord1dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1f)(GLfloat u) -{ - DISPATCH(EvalCoord1f, (u), (F, "glEvalCoord1f(%f);\n", u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord1fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord1fv, (u), (F, "glEvalCoord1fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2d)(GLdouble u, GLdouble v) -{ - DISPATCH(EvalCoord2d, (u, v), (F, "glEvalCoord2d(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2dv)(const GLdouble * u) -{ - DISPATCH(EvalCoord2dv, (u), (F, "glEvalCoord2dv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2f)(GLfloat u, GLfloat v) -{ - DISPATCH(EvalCoord2f, (u, v), (F, "glEvalCoord2f(%f, %f);\n", u, v)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalCoord2fv)(const GLfloat * u) -{ - DISPATCH(EvalCoord2fv, (u), (F, "glEvalCoord2fv(%p);\n", (const void *) u)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh1)(GLenum mode, GLint i1, GLint i2) -{ - DISPATCH(EvalMesh1, (mode, i1, i2), (F, "glEvalMesh1(0x%x, %d, %d);\n", mode, i1, i2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint1)(GLint i) -{ - DISPATCH(EvalPoint1, (i), (F, "glEvalPoint1(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) -{ - DISPATCH(EvalMesh2, (mode, i1, i2, j1, j2), (F, "glEvalMesh2(0x%x, %d, %d, %d, %d);\n", mode, i1, i2, j1, j2)); -} - -KEYWORD1 void KEYWORD2 NAME(EvalPoint2)(GLint i, GLint j) -{ - DISPATCH(EvalPoint2, (i, j), (F, "glEvalPoint2(%d, %d);\n", i, j)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFunc)(GLenum func, GLclampf ref) -{ - DISPATCH(AlphaFunc, (func, ref), (F, "glAlphaFunc(0x%x, %f);\n", func, ref)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFunc)(GLenum sfactor, GLenum dfactor) -{ - DISPATCH(BlendFunc, (sfactor, dfactor), (F, "glBlendFunc(0x%x, 0x%x);\n", sfactor, dfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(LogicOp)(GLenum opcode) -{ - DISPATCH(LogicOp, (opcode), (F, "glLogicOp(0x%x);\n", opcode)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFunc)(GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFunc, (func, ref, mask), (F, "glStencilFunc(0x%x, %d, %d);\n", func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOp)(GLenum fail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOp, (fail, zfail, zpass), (F, "glStencilOp(0x%x, 0x%x, 0x%x);\n", fail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthFunc)(GLenum func) -{ - DISPATCH(DepthFunc, (func), (F, "glDepthFunc(0x%x);\n", func)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelZoom)(GLfloat xfactor, GLfloat yfactor) -{ - DISPATCH(PixelZoom, (xfactor, yfactor), (F, "glPixelZoom(%f, %f);\n", xfactor, yfactor)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferf)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTransferf, (pname, param), (F, "glPixelTransferf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelTransferi)(GLenum pname, GLint param) -{ - DISPATCH(PixelTransferi, (pname, param), (F, "glPixelTransferi(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStoref)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelStoref, (pname, param), (F, "glPixelStoref(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelStorei)(GLenum pname, GLint param) -{ - DISPATCH(PixelStorei, (pname, param), (F, "glPixelStorei(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values) -{ - DISPATCH(PixelMapfv, (map, mapsize, values), (F, "glPixelMapfv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values) -{ - DISPATCH(PixelMapuiv, (map, mapsize, values), (F, "glPixelMapuiv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values) -{ - DISPATCH(PixelMapusv, (map, mapsize, values), (F, "glPixelMapusv(0x%x, %d, %p);\n", map, mapsize, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(ReadBuffer)(GLenum mode) -{ - DISPATCH(ReadBuffer, (mode), (F, "glReadBuffer(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) -{ - DISPATCH(CopyPixels, (x, y, width, height, type), (F, "glCopyPixels(%d, %d, %d, %d, 0x%x);\n", x, y, width, height, type)); -} - -KEYWORD1 void KEYWORD2 NAME(ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) -{ - DISPATCH(ReadPixels, (x, y, width, height, format, type, pixels), (F, "glReadPixels(%d, %d, %d, %d, 0x%x, 0x%x, %p);\n", x, y, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(DrawPixels, (width, height, format, type, pixels), (F, "glDrawPixels(%d, %d, 0x%x, 0x%x, %p);\n", width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBooleanv)(GLenum pname, GLboolean * params) -{ - DISPATCH(GetBooleanv, (pname, params), (F, "glGetBooleanv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetClipPlane)(GLenum plane, GLdouble * equation) -{ - DISPATCH(GetClipPlane, (plane, equation), (F, "glGetClipPlane(0x%x, %p);\n", plane, (const void *) equation)); -} - -KEYWORD1 void KEYWORD2 NAME(GetDoublev)(GLenum pname, GLdouble * params) -{ - DISPATCH(GetDoublev, (pname, params), (F, "glGetDoublev(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(GetError)(void) -{ - RETURN_DISPATCH(GetError, (), (F, "glGetError();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(GetFloatv)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetFloatv, (pname, params), (F, "glGetFloatv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetIntegerv)(GLenum pname, GLint * params) -{ - DISPATCH(GetIntegerv, (pname, params), (F, "glGetIntegerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightfv)(GLenum light, GLenum pname, GLfloat * params) -{ - DISPATCH(GetLightfv, (light, pname, params), (F, "glGetLightfv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetLightiv)(GLenum light, GLenum pname, GLint * params) -{ - DISPATCH(GetLightiv, (light, pname, params), (F, "glGetLightiv(0x%x, 0x%x, %p);\n", light, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapdv)(GLenum target, GLenum query, GLdouble * v) -{ - DISPATCH(GetMapdv, (target, query, v), (F, "glGetMapdv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapfv)(GLenum target, GLenum query, GLfloat * v) -{ - DISPATCH(GetMapfv, (target, query, v), (F, "glGetMapfv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMapiv)(GLenum target, GLenum query, GLint * v) -{ - DISPATCH(GetMapiv, (target, query, v), (F, "glGetMapiv(0x%x, 0x%x, %p);\n", target, query, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMaterialfv, (face, pname, params), (F, "glGetMaterialfv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetMaterialiv)(GLenum face, GLenum pname, GLint * params) -{ - DISPATCH(GetMaterialiv, (face, pname, params), (F, "glGetMaterialiv(0x%x, 0x%x, %p);\n", face, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapfv)(GLenum map, GLfloat * values) -{ - DISPATCH(GetPixelMapfv, (map, values), (F, "glGetPixelMapfv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapuiv)(GLenum map, GLuint * values) -{ - DISPATCH(GetPixelMapuiv, (map, values), (F, "glGetPixelMapuiv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPixelMapusv)(GLenum map, GLushort * values) -{ - DISPATCH(GetPixelMapusv, (map, values), (F, "glGetPixelMapusv(0x%x, %p);\n", map, (const void *) values)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPolygonStipple)(GLubyte * mask) -{ - DISPATCH(GetPolygonStipple, (mask), (F, "glGetPolygonStipple(%p);\n", (const void *) mask)); -} - -KEYWORD1 const GLubyte * KEYWORD2 NAME(GetString)(GLenum name) -{ - RETURN_DISPATCH(GetString, (name), (F, "glGetString(0x%x);\n", name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexEnvfv, (target, pname, params), (F, "glGetTexEnvfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexEnviv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexEnviv, (target, pname, params), (F, "glGetTexEnviv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params) -{ - DISPATCH(GetTexGendv, (coord, pname, params), (F, "glGetTexGendv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexGenfv, (coord, pname, params), (F, "glGetTexGenfv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexGeniv)(GLenum coord, GLenum pname, GLint * params) -{ - DISPATCH(GetTexGeniv, (coord, pname, params), (F, "glGetTexGeniv(0x%x, 0x%x, %p);\n", coord, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) -{ - DISPATCH(GetTexImage, (target, level, format, type, pixels), (F, "glGetTexImage(0x%x, %d, 0x%x, 0x%x, %p);\n", target, level, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexParameterfv, (target, pname, params), (F, "glGetTexParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetTexParameteriv, (target, pname, params), (F, "glGetTexParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params) -{ - DISPATCH(GetTexLevelParameterfv, (target, level, pname, params), (F, "glGetTexLevelParameterfv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params) -{ - DISPATCH(GetTexLevelParameteriv, (target, level, pname, params), (F, "glGetTexLevelParameteriv(0x%x, %d, 0x%x, %p);\n", target, level, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsEnabled)(GLenum cap) -{ - RETURN_DISPATCH(IsEnabled, (cap), (F, "glIsEnabled(0x%x);\n", cap)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsList)(GLuint list) -{ - RETURN_DISPATCH(IsList, (list), (F, "glIsList(%d);\n", list)); -} - -KEYWORD1 void KEYWORD2 NAME(DepthRange)(GLclampd zNear, GLclampd zFar) -{ - DISPATCH(DepthRange, (zNear, zFar), (F, "glDepthRange(%f, %f);\n", zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Frustum, (left, right, bottom, top, zNear, zFar), (F, "glFrustum(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadIdentity)(void) -{ - DISPATCH(LoadIdentity, (), (F, "glLoadIdentity();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadMatrixf, (m), (F, "glLoadMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadMatrixd, (m), (F, "glLoadMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MatrixMode)(GLenum mode) -{ - DISPATCH(MatrixMode, (mode), (F, "glMatrixMode(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixf)(const GLfloat * m) -{ - DISPATCH(MultMatrixf, (m), (F, "glMultMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultMatrixd)(const GLdouble * m) -{ - DISPATCH(MultMatrixd, (m), (F, "glMultMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) -{ - DISPATCH(Ortho, (left, right, bottom, top, zNear, zFar), (F, "glOrtho(%f, %f, %f, %f, %f, %f);\n", left, right, bottom, top, zNear, zFar)); -} - -KEYWORD1 void KEYWORD2 NAME(PopMatrix)(void) -{ - DISPATCH(PopMatrix, (), (F, "glPopMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushMatrix)(void) -{ - DISPATCH(PushMatrix, (), (F, "glPushMatrix();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Rotated, (angle, x, y, z), (F, "glRotated(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Rotatef, (angle, x, y, z), (F, "glRotatef(%f, %f, %f, %f);\n", angle, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scaled)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Scaled, (x, y, z), (F, "glScaled(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Scalef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Scalef, (x, y, z), (F, "glScalef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translated)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(Translated, (x, y, z), (F, "glTranslated(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Translatef)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(Translatef, (x, y, z), (F, "glTranslatef(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(Viewport)(GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(Viewport, (x, y, width, height), (F, "glViewport(%d, %d, %d, %d);\n", x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElement)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElement(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(ArrayElementEXT)(GLint i) -{ - DISPATCH(ArrayElement, (i), (F, "glArrayElementEXT(%d);\n", i)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTexture)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTexture(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(BindTextureEXT)(GLenum target, GLuint texture) -{ - DISPATCH(BindTexture, (target, texture), (F, "glBindTextureEXT(0x%x, %d);\n", target, texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(ColorPointer, (size, type, stride, pointer), (F, "glColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableClientState)(GLenum array) -{ - DISPATCH(DisableClientState, (array), (F, "glDisableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArrays)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArrays(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawArraysEXT)(GLenum mode, GLint first, GLsizei count) -{ - DISPATCH(DrawArrays, (mode, first, count), (F, "glDrawArraysEXT(0x%x, %d, %d);\n", mode, first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawElements, (mode, count, type, indices), (F, "glDrawElements(0x%x, %d, 0x%x, %p);\n", mode, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(EdgeFlagPointer, (stride, pointer), (F, "glEdgeFlagPointer(%d, %p);\n", stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableClientState)(GLenum array) -{ - DISPATCH(EnableClientState, (array), (F, "glEnableClientState(0x%x);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(IndexPointer, (type, stride, pointer), (F, "glIndexPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexub)(GLubyte c) -{ - DISPATCH(Indexub, (c), (F, "glIndexub(%d);\n", c)); -} - -KEYWORD1 void KEYWORD2 NAME(Indexubv)(const GLubyte * c) -{ - DISPATCH(Indexubv, (c), (F, "glIndexubv(%p);\n", (const void *) c)); -} - -KEYWORD1 void KEYWORD2 NAME(InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(InterleavedArrays, (format, stride, pointer), (F, "glInterleavedArrays(0x%x, %d, %p);\n", format, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(NormalPointer, (type, stride, pointer), (F, "glNormalPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffset)(GLfloat factor, GLfloat units) -{ - DISPATCH(PolygonOffset, (factor, units), (F, "glPolygonOffset(%f, %f);\n", factor, units)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointer, (size, type, stride, pointer), (F, "glTexCoordPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexPointer, (size, type, stride, pointer), (F, "glVertexPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResident(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences) -{ - RETURN_DISPATCH(AreTexturesResident, (n, textures, residences), (F, "glAreTexturesResidentEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) residences)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) -{ - DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage1DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) -{ - DISPATCH(CopyTexImage1D, (target, level, internalformat, x, y, width, border), (F, "glCopyTexImage1DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -{ - DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexImage2DEXT)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -{ - DISPATCH(CopyTexImage2D, (target, level, internalformat, x, y, width, height, border), (F, "glCopyTexImage2DEXT(0x%x, %d, 0x%x, %d, %d, %d, %d, %d);\n", target, level, internalformat, x, y, width, height, border)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1D(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyTexSubImage1D, (target, level, xoffset, x, y, width), (F, "glCopyTexSubImage1DEXT(0x%x, %d, %d, %d, %d, %d);\n", target, level, xoffset, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2D(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage2D, (target, level, xoffset, yoffset, x, y, width, height), (F, "glCopyTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteTextures)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(DeleteTexturesEXT)(GLsizei n, const GLuint * textures) -{ - DISPATCH(DeleteTextures, (n, textures), (F, "glDeleteTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GenTextures)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTextures(%d, %p);\n", n, (const void *) textures)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GenTexturesEXT)(GLsizei n, GLuint * textures) -{ - DISPATCH(GenTextures, (n, textures), (F, "glGenTexturesEXT(%d, %p);\n", n, (const void *) textures)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetPointerv)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointerv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetPointervEXT)(GLenum pname, GLvoid ** params) -{ - DISPATCH(GetPointerv, (pname, params), (F, "glGetPointervEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsTexture)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTexture(%d);\n", texture)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 GLboolean KEYWORD2 NAME(IsTextureEXT)(GLuint texture) -{ - RETURN_DISPATCH(IsTexture, (texture), (F, "glIsTextureEXT(%d);\n", texture)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTextures(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -KEYWORD1 void KEYWORD2 NAME(PrioritizeTexturesEXT)(GLsizei n, const GLuint * textures, const GLclampf * priorities) -{ - DISPATCH(PrioritizeTextures, (n, textures, priorities), (F, "glPrioritizeTexturesEXT(%d, %p, %p);\n", n, (const void *) textures, (const void *) priorities)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1D(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage1DEXT)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage1D, (target, level, xoffset, width, format, type, pixels), (F, "glTexSubImage1DEXT(0x%x, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, width, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage2DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage2D, (target, level, xoffset, yoffset, width, height, format, type, pixels), (F, "glTexSubImage2DEXT(0x%x, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, width, height, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(PopClientAttrib)(void) -{ - DISPATCH(PopClientAttrib, (), (F, "glPopClientAttrib();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(PushClientAttrib)(GLbitfield mask) -{ - DISPATCH(PushClientAttrib, (mask), (F, "glPushClientAttrib(%d);\n", mask)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColor(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendColorEXT)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - DISPATCH(BlendColor, (red, green, blue, alpha), (F, "glBlendColorEXT(%f, %f, %f, %f);\n", red, green, blue, alpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquation)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquation(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationEXT)(GLenum mode) -{ - DISPATCH(BlendEquation, (mode), (F, "glBlendEquationEXT(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElements(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) -{ - DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, "glDrawRangeElementsEXT(0x%x, %d, %d, %d, 0x%x, %p);\n", mode, start, end, count, type, (const void *) indices)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTable(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_339)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableSGI(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) -{ - DISPATCH(ColorTable, (target, internalformat, width, format, type, table), (F, "glColorTableEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) table)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_340)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ColorTableParameterfv, (target, pname, params), (F, "glColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_341)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ColorTableParameteriv, (target, pname, params), (F, "glColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTable(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_342)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorTable, (target, internalformat, x, y, width), (F, "glCopyColorTableSGI(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTable(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_343)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableSGI(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * table) -{ - DISPATCH(GetColorTable, (target, format, type, table), (F, "glGetColorTableEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) table)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_344)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetColorTableParameterfv, (target, pname, params), (F, "glGetColorTableParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_345)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivSGI(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1 void KEYWORD2 NAME(GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetColorTableParameteriv, (target, pname, params), (F, "glGetColorTableParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) -{ - DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTable(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_346)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) -{ - DISPATCH(ColorSubTable, (target, start, count, format, type, data), (F, "glColorSubTableEXT(0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, start, count, format, type, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTable(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_347)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyColorSubTable, (target, start, x, y, width), (F, "glCopyColorSubTableEXT(0x%x, %d, %d, %d, %d);\n", target, start, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1D(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_348)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter1D, (target, internalformat, width, format, type, image), (F, "glConvolutionFilter1DEXT(0x%x, 0x%x, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, format, type, (const void *) image)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_349)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) -{ - DISPATCH(ConvolutionFilter2D, (target, internalformat, width, height, format, type, image), (F, "glConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p);\n", target, internalformat, width, height, format, type, (const void *) image)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterf(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_350)(GLenum target, GLenum pname, GLfloat params) -{ - DISPATCH(ConvolutionParameterf, (target, pname, params), (F, "glConvolutionParameterfEXT(0x%x, 0x%x, %f);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_351)(GLenum target, GLenum pname, const GLfloat * params) -{ - DISPATCH(ConvolutionParameterfv, (target, pname, params), (F, "glConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteri)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteri(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_352)(GLenum target, GLenum pname, GLint params) -{ - DISPATCH(ConvolutionParameteri, (target, pname, params), (F, "glConvolutionParameteriEXT(0x%x, 0x%x, %d);\n", target, pname, params)); -} - -KEYWORD1 void KEYWORD2 NAME(ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_353)(GLenum target, GLenum pname, const GLint * params) -{ - DISPATCH(ConvolutionParameteriv, (target, pname, params), (F, "glConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1D(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_354)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) -{ - DISPATCH(CopyConvolutionFilter1D, (target, internalformat, x, y, width), (F, "glCopyConvolutionFilter1DEXT(0x%x, 0x%x, %d, %d, %d);\n", target, internalformat, x, y, width)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2D(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_355)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyConvolutionFilter2D, (target, internalformat, x, y, width, height), (F, "glCopyConvolutionFilter2DEXT(0x%x, 0x%x, %d, %d, %d, %d);\n", target, internalformat, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilter(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_356)(GLenum target, GLenum format, GLenum type, GLvoid * image) -{ - DISPATCH(GetConvolutionFilter, (target, format, type, image), (F, "glGetConvolutionFilterEXT(0x%x, 0x%x, 0x%x, %p);\n", target, format, type, (const void *) image)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_357)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetConvolutionParameterfv, (target, pname, params), (F, "glGetConvolutionParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_358)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetConvolutionParameteriv, (target, pname, params), (F, "glGetConvolutionParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilter(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_359)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) -{ - DISPATCH(GetSeparableFilter, (target, format, type, row, column, span), (F, "glGetSeparableFilterEXT(0x%x, 0x%x, 0x%x, %p, %p, %p);\n", target, format, type, (const void *) row, (const void *) column, (const void *) span)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) -{ - DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2D(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_360)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column) -{ - DISPATCH(SeparableFilter2D, (target, internalformat, width, height, format, type, row, column), (F, "glSeparableFilter2DEXT(0x%x, 0x%x, %d, %d, 0x%x, 0x%x, %p, %p);\n", target, internalformat, width, height, format, type, (const void *) row, (const void *) column)); -} - -KEYWORD1 void KEYWORD2 NAME(GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogram(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_361)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetHistogram, (target, reset, format, type, values), (F, "glGetHistogramEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_362)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetHistogramParameterfv, (target, pname, params), (F, "glGetHistogramParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_363)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetHistogramParameteriv, (target, pname, params), (F, "glGetHistogramParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmax(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_364)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) -{ - DISPATCH(GetMinmax, (target, reset, format, type, values), (F, "glGetMinmaxEXT(0x%x, %d, 0x%x, 0x%x, %p);\n", target, reset, format, type, (const void *) values)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_365)(GLenum target, GLenum pname, GLfloat * params) -{ - DISPATCH(GetMinmaxParameterfv, (target, pname, params), (F, "glGetMinmaxParameterfvEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -#ifndef GLX_INDIRECT_RENDERING -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_366)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetMinmaxParameteriv, (target, pname, params), (F, "glGetMinmaxParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} -#endif /* GLX_INDIRECT_RENDERING */ - -KEYWORD1 void KEYWORD2 NAME(Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogram(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_367)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Histogram, (target, width, internalformat, sink), (F, "glHistogramEXT(0x%x, %d, 0x%x, %d);\n", target, width, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(Minmax)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmax(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_368)(GLenum target, GLenum internalformat, GLboolean sink) -{ - DISPATCH(Minmax, (target, internalformat, sink), (F, "glMinmaxEXT(0x%x, 0x%x, %d);\n", target, internalformat, sink)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetHistogram)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogram(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_369)(GLenum target) -{ - DISPATCH(ResetHistogram, (target), (F, "glResetHistogramEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(ResetMinmax)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmax(0x%x);\n", target)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_370)(GLenum target) -{ - DISPATCH(ResetMinmax, (target), (F, "glResetMinmaxEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3D(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexImage3DEXT)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, "glTexImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, internalformat, width, height, depth, border, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(TexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) -{ - DISPATCH(TexSubImage3D, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), (F, "glTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, 0x%x, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, (const void *) pixels)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(CopyTexSubImage3DEXT)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -{ - DISPATCH(CopyTexSubImage3D, (target, level, xoffset, yoffset, zoffset, x, y, width, height), (F, "glCopyTexSubImage3DEXT(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", target, level, xoffset, yoffset, zoffset, x, y, width, height)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTexture)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ActiveTextureARB)(GLenum texture) -{ - DISPATCH(ActiveTextureARB, (texture), (F, "glActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTexture)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTexture(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(ClientActiveTextureARB)(GLenum texture) -{ - DISPATCH(ClientActiveTextureARB, (texture), (F, "glClientActiveTextureARB(0x%x);\n", texture)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1d)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1d(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dARB)(GLenum target, GLdouble s) -{ - DISPATCH(MultiTexCoord1dARB, (target, s), (F, "glMultiTexCoord1dARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord1dvARB, (target, v), (F, "glMultiTexCoord1dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1f)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1f(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fARB)(GLenum target, GLfloat s) -{ - DISPATCH(MultiTexCoord1fARB, (target, s), (F, "glMultiTexCoord1fARB(0x%x, %f);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord1fvARB, (target, v), (F, "glMultiTexCoord1fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1i)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1i(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iARB)(GLenum target, GLint s) -{ - DISPATCH(MultiTexCoord1iARB, (target, s), (F, "glMultiTexCoord1iARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord1ivARB, (target, v), (F, "glMultiTexCoord1ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1s)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1s(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sARB)(GLenum target, GLshort s) -{ - DISPATCH(MultiTexCoord1sARB, (target, s), (F, "glMultiTexCoord1sARB(0x%x, %d);\n", target, s)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord1svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord1svARB, (target, v), (F, "glMultiTexCoord1svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2d(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t) -{ - DISPATCH(MultiTexCoord2dARB, (target, s, t), (F, "glMultiTexCoord2dARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord2dvARB, (target, v), (F, "glMultiTexCoord2dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2f)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2f(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t) -{ - DISPATCH(MultiTexCoord2fARB, (target, s, t), (F, "glMultiTexCoord2fARB(0x%x, %f, %f);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord2fvARB, (target, v), (F, "glMultiTexCoord2fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2i)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2i(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iARB)(GLenum target, GLint s, GLint t) -{ - DISPATCH(MultiTexCoord2iARB, (target, s, t), (F, "glMultiTexCoord2iARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord2ivARB, (target, v), (F, "glMultiTexCoord2ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2s(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t) -{ - DISPATCH(MultiTexCoord2sARB, (target, s, t), (F, "glMultiTexCoord2sARB(0x%x, %d, %d);\n", target, s, t)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord2svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord2svARB, (target, v), (F, "glMultiTexCoord2svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3d(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r) -{ - DISPATCH(MultiTexCoord3dARB, (target, s, t, r), (F, "glMultiTexCoord3dARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord3dvARB, (target, v), (F, "glMultiTexCoord3dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3f)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3f(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r) -{ - DISPATCH(MultiTexCoord3fARB, (target, s, t, r), (F, "glMultiTexCoord3fARB(0x%x, %f, %f, %f);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord3fvARB, (target, v), (F, "glMultiTexCoord3fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3i(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r) -{ - DISPATCH(MultiTexCoord3iARB, (target, s, t, r), (F, "glMultiTexCoord3iARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord3ivARB, (target, v), (F, "glMultiTexCoord3ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3s(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r) -{ - DISPATCH(MultiTexCoord3sARB, (target, s, t, r), (F, "glMultiTexCoord3sARB(0x%x, %d, %d, %d);\n", target, s, t, r)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord3svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord3svARB, (target, v), (F, "glMultiTexCoord3svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4d(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) -{ - DISPATCH(MultiTexCoord4dARB, (target, s, t, r, q), (F, "glMultiTexCoord4dARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dv)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4dvARB)(GLenum target, const GLdouble * v) -{ - DISPATCH(MultiTexCoord4dvARB, (target, v), (F, "glMultiTexCoord4dvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4f(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -{ - DISPATCH(MultiTexCoord4fARB, (target, s, t, r, q), (F, "glMultiTexCoord4fARB(0x%x, %f, %f, %f, %f);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fv)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4fvARB)(GLenum target, const GLfloat * v) -{ - DISPATCH(MultiTexCoord4fvARB, (target, v), (F, "glMultiTexCoord4fvARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4i(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q) -{ - DISPATCH(MultiTexCoord4iARB, (target, s, t, r, q), (F, "glMultiTexCoord4iARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4iv)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4iv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4ivARB)(GLenum target, const GLint * v) -{ - DISPATCH(MultiTexCoord4ivARB, (target, v), (F, "glMultiTexCoord4ivARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4s(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) -{ - DISPATCH(MultiTexCoord4sARB, (target, s, t, r, q), (F, "glMultiTexCoord4sARB(0x%x, %d, %d, %d, %d);\n", target, s, t, r, q)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4sv)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4sv(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiTexCoord4svARB)(GLenum target, const GLshort * v) -{ - DISPATCH(MultiTexCoord4svARB, (target, v), (F, "glMultiTexCoord4svARB(0x%x, %p);\n", target, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachShader)(GLuint program, GLuint shader) -{ - DISPATCH(AttachShader, (program, shader), (F, "glAttachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateProgram)(void) -{ - RETURN_DISPATCH(CreateProgram, (), (F, "glCreateProgram();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(CreateShader)(GLenum type) -{ - RETURN_DISPATCH(CreateShader, (type), (F, "glCreateShader(0x%x);\n", type)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgram)(GLuint program) -{ - DISPATCH(DeleteProgram, (program), (F, "glDeleteProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteShader)(GLuint program) -{ - DISPATCH(DeleteShader, (program), (F, "glDeleteShader(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachShader)(GLuint program, GLuint shader) -{ - DISPATCH(DetachShader, (program, shader), (F, "glDetachShader(%d, %d);\n", program, shader)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj) -{ - DISPATCH(GetAttachedShaders, (program, maxCount, count, obj), (F, "glGetAttachedShaders(%d, %d, %p, %p);\n", program, maxCount, (const void *) count, (const void *) obj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetProgramInfoLog, (program, bufSize, length, infoLog), (F, "glGetProgramInfoLog(%d, %d, %p, %p);\n", program, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramiv)(GLuint program, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramiv, (program, pname, params), (F, "glGetProgramiv(%d, 0x%x, %p);\n", program, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) -{ - DISPATCH(GetShaderInfoLog, (shader, bufSize, length, infoLog), (F, "glGetShaderInfoLog(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderiv)(GLuint shader, GLenum pname, GLint * params) -{ - DISPATCH(GetShaderiv, (shader, pname, params), (F, "glGetShaderiv(%d, 0x%x, %p);\n", shader, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgram)(GLuint program) -{ - RETURN_DISPATCH(IsProgram, (program), (F, "glIsProgram(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsShader)(GLuint shader) -{ - RETURN_DISPATCH(IsShader, (shader), (F, "glIsShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparate, (face, func, ref, mask), (F, "glStencilFuncSeparate(0x%x, 0x%x, %d, %d);\n", face, func, ref, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask) -{ - DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask)); -} - -KEYWORD1 void KEYWORD2 NAME(StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_423)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - DISPATCH(StencilOpSeparate, (face, sfail, zfail, zpass), (F, "glStencilOpSeparateATI(0x%x, 0x%x, 0x%x, 0x%x);\n", face, sfail, zfail, zpass)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x3fv, (location, count, transpose, value), (F, "glUniformMatrix2x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2x4fv, (location, count, transpose, value), (F, "glUniformMatrix2x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x2fv, (location, count, transpose, value), (F, "glUniformMatrix3x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3x4fv, (location, count, transpose, value), (F, "glUniformMatrix3x4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x2fv, (location, count, transpose, value), (F, "glUniformMatrix4x2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4x3fv, (location, count, transpose, value), (F, "glUniformMatrix4x3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(LoadTransposeMatrixdARB, (m), (F, "glLoadTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(LoadTransposeMatrixfARB, (m), (F, "glLoadTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixd)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixd(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixdARB)(const GLdouble * m) -{ - DISPATCH(MultTransposeMatrixdARB, (m), (F, "glMultTransposeMatrixdARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixf)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixf(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(MultTransposeMatrixfARB)(const GLfloat * m) -{ - DISPATCH(MultTransposeMatrixfARB, (m), (F, "glMultTransposeMatrixfARB(%p);\n", (const void *) m)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverage)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverage(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleCoverageARB)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleCoverageARB, (value, invert), (F, "glSampleCoverageARB(%f, %d);\n", value, invert)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1D(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB(0x%x, %d, 0x%x, %d, %d, %d, %p);\n", target, level, internalformat, width, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2D(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3D(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB(0x%x, %d, 0x%x, %d, %d, %d, %d, %d, %p);\n", target, level, internalformat, width, height, depth, border, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1D(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage1DARB, (target, level, xoffset, width, format, imageSize, data), (F, "glCompressedTexSubImage1DARB(0x%x, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, width, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2D(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage2DARB, (target, level, xoffset, yoffset, width, height, format, imageSize, data), (F, "glCompressedTexSubImage2DARB(0x%x, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, width, height, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3D(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data) -{ - DISPATCH(CompressedTexSubImage3DARB, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), (F, "glCompressedTexSubImage3DARB(0x%x, %d, %d, %d, %d, %d, %d, %d, 0x%x, %d, %p);\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImage)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImage(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img) -{ - DISPATCH(GetCompressedTexImageARB, (target, level, img), (F, "glGetCompressedTexImageARB(0x%x, %d, %p);\n", target, level, (const void *) img)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArray)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(DisableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(DisableVertexAttribArrayARB, (index), (F, "glDisableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArray)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArray(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(EnableVertexAttribArrayARB)(GLuint index) -{ - DISPATCH(EnableVertexAttribArrayARB, (index), (F, "glEnableVertexAttribArrayARB(%d);\n", index)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramEnvParameterdvARB, (target, index, params), (F, "glGetProgramEnvParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramEnvParameterfvARB, (target, index, params), (F, "glGetProgramEnvParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params) -{ - DISPATCH(GetProgramLocalParameterdvARB, (target, index, params), (F, "glGetProgramLocalParameterdvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params) -{ - DISPATCH(GetProgramLocalParameterfvARB, (target, index, params), (F, "glGetProgramLocalParameterfvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string) -{ - DISPATCH(GetProgramStringARB, (target, pname, string), (F, "glGetProgramStringARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivARB, (target, pname, params), (F, "glGetProgramivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdv)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvARB, (index, pname, params), (F, "glGetVertexAttribdvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvARB, (index, pname, params), (F, "glGetVertexAttribfvARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribiv(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivARB, (index, pname, params), (F, "glGetVertexAttribivARB(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramEnvParameter4dARB, (target, index, x, y, z, w), (F, "glProgramParameter4dNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramEnvParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramEnvParameter4dvARB, (target, index, params), (F, "glProgramParameter4dvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramEnvParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramEnvParameter4fARB, (target, index, x, y, z, w), (F, "glProgramParameter4fNV(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramEnvParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameter4fvARB, (target, index, params), (F, "glProgramParameter4fvNV(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramLocalParameter4dARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4dARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params) -{ - DISPATCH(ProgramLocalParameter4dvARB, (target, index, params), (F, "glProgramLocalParameter4dvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramLocalParameter4fARB, (target, index, x, y, z, w), (F, "glProgramLocalParameter4fARB(0x%x, %d, %f, %f, %f, %f);\n", target, index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameter4fvARB, (target, index, params), (F, "glProgramLocalParameter4fvARB(0x%x, %d, %p);\n", target, index, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string) -{ - DISPATCH(ProgramStringARB, (target, format, len, string), (F, "glProgramStringARB(0x%x, 0x%x, %d, %p);\n", target, format, len, (const void *) string)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1d)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1d(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dARB)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dARB, (index, x), (F, "glVertexAttrib1dARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvARB, (index, v), (F, "glVertexAttrib1dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1f)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1f(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fARB)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fARB, (index, x), (F, "glVertexAttrib1fARB(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvARB, (index, v), (F, "glVertexAttrib1fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1s)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1s(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sARB)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sARB, (index, x), (F, "glVertexAttrib1sARB(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svARB, (index, v), (F, "glVertexAttrib1svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2d(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dARB, (index, x, y), (F, "glVertexAttrib2dARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvARB, (index, v), (F, "glVertexAttrib2dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2f(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fARB, (index, x, y), (F, "glVertexAttrib2fARB(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvARB, (index, v), (F, "glVertexAttrib2fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2s)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2s(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sARB, (index, x, y), (F, "glVertexAttrib2sARB(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svARB, (index, v), (F, "glVertexAttrib2svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3d(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dARB, (index, x, y, z), (F, "glVertexAttrib3dARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvARB, (index, v), (F, "glVertexAttrib3dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3f(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fARB, (index, x, y, z), (F, "glVertexAttrib3fARB(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvARB, (index, v), (F, "glVertexAttrib3fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3s(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sARB, (index, x, y, z), (F, "glVertexAttrib3sARB(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svARB, (index, v), (F, "glVertexAttrib3svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nbv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4Nbv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NbvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4NbvARB, (index, v), (F, "glVertexAttrib4NbvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Niv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4Niv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4NivARB, (index, v), (F, "glVertexAttrib4NivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nsv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4Nsv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NsvARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4NsvARB, (index, v), (F, "glVertexAttrib4NsvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4Nub(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4NubARB, (index, x, y, z, w), (F, "glVertexAttrib4NubARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4Nubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4NubvARB, (index, v), (F, "glVertexAttrib4NubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nuiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4Nuiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NuivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4NuivARB, (index, v), (F, "glVertexAttrib4NuivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4Nusv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4Nusv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v) -{ - DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4d(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dARB, (index, x, y, z, w), (F, "glVertexAttrib4dARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dv)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvARB)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvARB, (index, v), (F, "glVertexAttrib4dvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4f(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fARB, (index, x, y, z, w), (F, "glVertexAttrib4fARB(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fv)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v) -{ - DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4s(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sARB, (index, x, y, z, w), (F, "glVertexAttrib4sARB(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sv)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4sv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v) -{ - DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v) -{ - DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointer(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerARB, (index, size, type, normalized, stride, pointer), (F, "glVertexAttribPointerARB(%d, %d, 0x%x, %d, %d, %p);\n", index, size, type, normalized, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBuffer)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBuffer(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindBufferARB)(GLenum target, GLuint buffer) -{ - DISPATCH(BindBufferARB, (target, buffer), (F, "glBindBufferARB(0x%x, %d);\n", target, buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferData(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage) -{ - DISPATCH(BufferDataARB, (target, size, data, usage), (F, "glBufferDataARB(0x%x, %d, %p, 0x%x);\n", target, size, (const void *) data, usage)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data) -{ - DISPATCH(BufferSubDataARB, (target, offset, size, data), (F, "glBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffers)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteBuffersARB)(GLsizei n, const GLuint * buffer) -{ - DISPATCH(DeleteBuffersARB, (n, buffer), (F, "glDeleteBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffers)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffers(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GenBuffersARB)(GLsizei n, GLuint * buffer) -{ - DISPATCH(GenBuffersARB, (n, buffer), (F, "glGenBuffersARB(%d, %p);\n", n, (const void *) buffer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameteriv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetBufferParameterivARB, (target, pname, params), (F, "glGetBufferParameterivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointerv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params) -{ - DISPATCH(GetBufferPointervARB, (target, pname, params), (F, "glGetBufferPointervARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubData(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 void KEYWORD2 NAME(GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data) -{ - DISPATCH(GetBufferSubDataARB, (target, offset, size, data), (F, "glGetBufferSubDataARB(0x%x, %d, %d, %p);\n", target, offset, size, (const void *) data)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBuffer)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBuffer(%d);\n", buffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsBufferARB)(GLuint buffer) -{ - RETURN_DISPATCH(IsBufferARB, (buffer), (F, "glIsBufferARB(%d);\n", buffer)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBuffer)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBuffer(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLvoid * KEYWORD2 NAME(MapBufferARB)(GLenum target, GLenum access) -{ - RETURN_DISPATCH(MapBufferARB, (target, access), (F, "glMapBufferARB(0x%x, 0x%x);\n", target, access)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBuffer)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBuffer(0x%x);\n", target)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(UnmapBufferARB)(GLenum target) -{ - RETURN_DISPATCH(UnmapBufferARB, (target), (F, "glUnmapBufferARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQuery)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQuery(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id) -{ - DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueries)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids) -{ - DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQuery)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQuery(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target) -{ - DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueries)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueries(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids) -{ - DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectiv)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuiv(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params) -{ - DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryiv)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryiv(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQuery)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQuery(%d);\n", id)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id) -{ - RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj) -{ - DISPATCH(AttachObjectARB, (containerObj, obj), (F, "glAttachObjectARB(%d, %d);\n", containerObj, obj)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShader)(GLuint shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShader(%d);\n", shader)); -} - -KEYWORD1 void KEYWORD2 NAME(CompileShaderARB)(GLhandleARB shader) -{ - DISPATCH(CompileShaderARB, (shader), (F, "glCompileShaderARB(%d);\n", shader)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateProgramObjectARB)(void) -{ - RETURN_DISPATCH(CreateProgramObjectARB, (), (F, "glCreateProgramObjectARB();\n")); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(CreateShaderObjectARB)(GLenum shaderType) -{ - RETURN_DISPATCH(CreateShaderObjectARB, (shaderType), (F, "glCreateShaderObjectARB(0x%x);\n", shaderType)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteObjectARB)(GLhandleARB obj) -{ - DISPATCH(DeleteObjectARB, (obj), (F, "glDeleteObjectARB(%d);\n", obj)); -} - -KEYWORD1 void KEYWORD2 NAME(DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj) -{ - DISPATCH(DetachObjectARB, (containerObj, attachedObj), (F, "glDetachObjectARB(%d, %d);\n", containerObj, attachedObj)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniform(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveUniformARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveUniformARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog) -{ - DISPATCH(GetAttachedObjectsARB, (containerObj, maxLength, length, infoLog), (F, "glGetAttachedObjectsARB(%d, %d, %p, %p);\n", containerObj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 GLhandleARB KEYWORD2 NAME(GetHandleARB)(GLenum pname) -{ - RETURN_DISPATCH(GetHandleARB, (pname), (F, "glGetHandleARB(0x%x);\n", pname)); -} - -KEYWORD1 void KEYWORD2 NAME(GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) -{ - DISPATCH(GetInfoLogARB, (obj, maxLength, length, infoLog), (F, "glGetInfoLogARB(%d, %d, %p, %p);\n", obj, maxLength, (const void *) length, (const void *) infoLog)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params) -{ - DISPATCH(GetObjectParameterfvARB, (obj, pname, params), (F, "glGetObjectParameterfvARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params) -{ - DISPATCH(GetObjectParameterivARB, (obj, pname, params), (F, "glGetObjectParameterivARB(%d, 0x%x, %p);\n", obj, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSource(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 void KEYWORD2 NAME(GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source) -{ - DISPATCH(GetShaderSourceARB, (shader, bufSize, length, source), (F, "glGetShaderSourceARB(%d, %d, %p, %p);\n", shader, bufSize, (const void *) length, (const void *) source)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetUniformLocationARB, (program, name), (F, "glGetUniformLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfv)(GLuint program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params) -{ - DISPATCH(GetUniformfvARB, (program, location, params), (F, "glGetUniformfvARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformiv)(GLuint program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformiv(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetUniformivARB)(GLhandleARB program, GLint location, GLint * params) -{ - DISPATCH(GetUniformivARB, (program, location, params), (F, "glGetUniformivARB(%d, %d, %p);\n", program, location, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgram)(GLuint program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LinkProgramARB)(GLhandleARB program) -{ - DISPATCH(LinkProgramARB, (program), (F, "glLinkProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSource(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length) -{ - DISPATCH(ShaderSourceARB, (shader, count, string, length), (F, "glShaderSourceARB(%d, %d, %p, %p);\n", shader, count, (const void *) string, (const void *) length)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1f)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1f(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fARB)(GLint location, GLfloat v0) -{ - DISPATCH(Uniform1fARB, (location, v0), (F, "glUniform1fARB(%d, %f);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform1fvARB, (location, count, value), (F, "glUniform1fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1i)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1i(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iARB)(GLint location, GLint v0) -{ - DISPATCH(Uniform1iARB, (location, v0), (F, "glUniform1iARB(%d, %d);\n", location, v0)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform1ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform1ivARB, (location, count, value), (F, "glUniform1ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2f)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2f(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1) -{ - DISPATCH(Uniform2fARB, (location, v0, v1), (F, "glUniform2fARB(%d, %f, %f);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform2fvARB, (location, count, value), (F, "glUniform2fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2i)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2i(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iARB)(GLint location, GLint v0, GLint v1) -{ - DISPATCH(Uniform2iARB, (location, v0, v1), (F, "glUniform2iARB(%d, %d, %d);\n", location, v0, v1)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform2ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform2ivARB, (location, count, value), (F, "glUniform2ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3f(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) -{ - DISPATCH(Uniform3fARB, (location, v0, v1, v2), (F, "glUniform3fARB(%d, %f, %f, %f);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform3fvARB, (location, count, value), (F, "glUniform3fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3i(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2) -{ - DISPATCH(Uniform3iARB, (location, v0, v1, v2), (F, "glUniform3iARB(%d, %d, %d, %d);\n", location, v0, v1, v2)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform3ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform3ivARB, (location, count, value), (F, "glUniform3ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4f(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) -{ - DISPATCH(Uniform4fARB, (location, v0, v1, v2, v3), (F, "glUniform4fARB(%d, %f, %f, %f, %f);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fv)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value) -{ - DISPATCH(Uniform4fvARB, (location, count, value), (F, "glUniform4fvARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4i(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) -{ - DISPATCH(Uniform4iARB, (location, v0, v1, v2, v3), (F, "glUniform4iARB(%d, %d, %d, %d, %d);\n", location, v0, v1, v2, v3)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4iv)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4iv(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(Uniform4ivARB)(GLint location, GLsizei count, const GLint * value) -{ - DISPATCH(Uniform4ivARB, (location, count, value), (F, "glUniform4ivARB(%d, %d, %p);\n", location, count, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix2fvARB, (location, count, transpose, value), (F, "glUniformMatrix2fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix3fvARB, (location, count, transpose, value), (F, "glUniformMatrix3fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fv(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) -{ - DISPATCH(UniformMatrix4fvARB, (location, count, transpose, value), (F, "glUniformMatrix4fvARB(%d, %d, %d, %p);\n", location, count, transpose, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgram)(GLuint program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(UseProgramObjectARB)(GLhandleARB program) -{ - DISPATCH(UseProgramObjectARB, (program), (F, "glUseProgramObjectARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgram)(GLuint program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgram(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(ValidateProgramARB)(GLhandleARB program) -{ - DISPATCH(ValidateProgramARB, (program), (F, "glValidateProgramARB(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocation)(GLuint program, GLuint index, const GLchar * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocation(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name) -{ - DISPATCH(BindAttribLocationARB, (program, index, name), (F, "glBindAttribLocationARB(%d, %d, %p);\n", program, index, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttrib(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name) -{ - DISPATCH(GetActiveAttribARB, (program, index, bufSize, length, size, type, name), (F, "glGetActiveAttribARB(%d, %d, %d, %p, %p, %p, %p);\n", program, index, bufSize, (const void *) length, (const void *) size, (const void *) type, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocation)(GLuint program, const GLchar * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocation(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 GLint KEYWORD2 NAME(GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name) -{ - RETURN_DISPATCH(GetAttribLocationARB, (program, name), (F, "glGetAttribLocationARB(%d, %p);\n", program, (const void *) name)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffers)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffers(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersARB)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersARB(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs) -{ - DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs)); -} - -KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) -{ - DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_562)(GLenum pname, GLfloat * params) -{ - DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_563)(GLenum pname, GLint * params) -{ - DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_564)(GLenum pname, GLfloat param) -{ - DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_565)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_566)(GLenum pname, GLint param) -{ - DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_567)(GLenum pname, const GLint * params) -{ - DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_568)(GLclampf value, GLboolean invert) -{ - DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_569)(GLenum pattern) -{ - DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(ColorPointerEXT, (size, type, stride, count, pointer), (F, "glColorPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer) -{ - DISPATCH(EdgeFlagPointerEXT, (stride, count, pointer), (F, "glEdgeFlagPointerEXT(%d, %d, %p);\n", stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(IndexPointerEXT, (type, stride, count, pointer), (F, "glIndexPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(NormalPointerEXT, (type, stride, count, pointer), (F, "glNormalPointerEXT(0x%x, %d, %d, %p);\n", type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(TexCoordPointerEXT, (size, type, stride, count, pointer), (F, "glTexCoordPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer) -{ - DISPATCH(VertexPointerEXT, (size, type, stride, count, pointer), (F, "glVertexPointerEXT(%d, 0x%x, %d, %d, %p);\n", size, type, stride, count, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterf)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterf(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfARB)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfARB(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLfloat param) -{ - DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfv)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvARB)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvARB(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, const GLfloat * params) -{ - DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(LockArraysEXT)(GLint first, GLsizei count) -{ - DISPATCH(LockArraysEXT, (first, count), (F, "glLockArraysEXT(%d, %d);\n", first, count)); -} - -KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) -{ - DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLdouble * params) -{ - DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, GLfloat * params) -{ - DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3b(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue) -{ - DISPATCH(SecondaryColor3bEXT, (red, green, blue), (F, "glSecondaryColor3bEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bv)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3bvEXT)(const GLbyte * v) -{ - DISPATCH(SecondaryColor3bvEXT, (v), (F, "glSecondaryColor3bvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3d(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue) -{ - DISPATCH(SecondaryColor3dEXT, (red, green, blue), (F, "glSecondaryColor3dEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dv)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3dvEXT)(const GLdouble * v) -{ - DISPATCH(SecondaryColor3dvEXT, (v), (F, "glSecondaryColor3dvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3f)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3f(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue) -{ - DISPATCH(SecondaryColor3fEXT, (red, green, blue), (F, "glSecondaryColor3fEXT(%f, %f, %f);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fv)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3fvEXT)(const GLfloat * v) -{ - DISPATCH(SecondaryColor3fvEXT, (v), (F, "glSecondaryColor3fvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3i)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3i(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iEXT)(GLint red, GLint green, GLint blue) -{ - DISPATCH(SecondaryColor3iEXT, (red, green, blue), (F, "glSecondaryColor3iEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3iv)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ivEXT)(const GLint * v) -{ - DISPATCH(SecondaryColor3ivEXT, (v), (F, "glSecondaryColor3ivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3s(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue) -{ - DISPATCH(SecondaryColor3sEXT, (red, green, blue), (F, "glSecondaryColor3sEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3sv)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3svEXT)(const GLshort * v) -{ - DISPATCH(SecondaryColor3svEXT, (v), (F, "glSecondaryColor3svEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ub(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue) -{ - DISPATCH(SecondaryColor3ubEXT, (red, green, blue), (F, "glSecondaryColor3ubEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubv)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ubvEXT)(const GLubyte * v) -{ - DISPATCH(SecondaryColor3ubvEXT, (v), (F, "glSecondaryColor3ubvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3ui(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue) -{ - DISPATCH(SecondaryColor3uiEXT, (red, green, blue), (F, "glSecondaryColor3uiEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uiv)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uiv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3uivEXT)(const GLuint * v) -{ - DISPATCH(SecondaryColor3uivEXT, (v), (F, "glSecondaryColor3uivEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3us(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue) -{ - DISPATCH(SecondaryColor3usEXT, (red, green, blue), (F, "glSecondaryColor3usEXT(%d, %d, %d);\n", red, green, blue)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usv)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColor3usvEXT)(const GLushort * v) -{ - DISPATCH(SecondaryColor3usvEXT, (v), (F, "glSecondaryColor3usvEXT(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointer(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(SecondaryColorPointerEXT, (size, type, stride, pointer), (F, "glSecondaryColorPointerEXT(%d, 0x%x, %d, %p);\n", size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArrays)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArrays(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) -{ - DISPATCH(MultiDrawArraysEXT, (mode, first, count, primcount), (F, "glMultiDrawArraysEXT(0x%x, %p, %p, %d);\n", mode, (const void *) first, (const void *) count, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElements)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElements(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) -{ - DISPATCH(MultiDrawElementsEXT, (mode, count, type, indices, primcount), (F, "glMultiDrawElementsEXT(0x%x, %p, 0x%x, %p, %d);\n", mode, (const void *) count, type, (const void *) indices, primcount)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointer)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointer(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(FogCoordPointerEXT, (type, stride, pointer), (F, "glFogCoordPointerEXT(0x%x, %d, %p);\n", type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordd)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoordd(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddEXT)(GLdouble coord) -{ - DISPATCH(FogCoorddEXT, (coord), (F, "glFogCoorddEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddv)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoorddvEXT)(const GLdouble * coord) -{ - DISPATCH(FogCoorddvEXT, (coord), (F, "glFogCoorddvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordf)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordf(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfEXT)(GLfloat coord) -{ - DISPATCH(FogCoordfEXT, (coord), (F, "glFogCoordfEXT(%f);\n", coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfv)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfv(%p);\n", (const void *) coord)); -} - -KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) -{ - DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_606)(GLenum mode) -{ - DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparate(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_607)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) -{ - DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); -} - -KEYWORD1 void KEYWORD2 NAME(FlushVertexArrayRangeNV)(void) -{ - DISPATCH(FlushVertexArrayRangeNV, (), (F, "glFlushVertexArrayRangeNV();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer) -{ - DISPATCH(VertexArrayRangeNV, (length, pointer), (F, "glVertexArrayRangeNV(%d, %p);\n", length, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(CombinerInputNV, (stage, portion, variable, input, mapping, componentUsage), (F, "glCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x);\n", stage, portion, variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) -{ - DISPATCH(CombinerOutputNV, (stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum), (F, "glCombinerOutputNV(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, %d, %d, %d);\n", stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfNV)(GLenum pname, GLfloat param) -{ - DISPATCH(CombinerParameterfNV, (pname, param), (F, "glCombinerParameterfNV(0x%x, %f);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterfvNV)(GLenum pname, const GLfloat * params) -{ - DISPATCH(CombinerParameterfvNV, (pname, params), (F, "glCombinerParameterfvNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(CombinerParameteriNV, (pname, param), (F, "glCombinerParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(CombinerParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(CombinerParameterivNV, (pname, params), (F, "glCombinerParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) -{ - DISPATCH(FinalCombinerInputNV, (variable, input, mapping, componentUsage), (F, "glFinalCombinerInputNV(0x%x, 0x%x, 0x%x, 0x%x);\n", variable, input, mapping, componentUsage)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerInputParameterfvNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterfvNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerInputParameterivNV, (stage, portion, variable, pname, params), (F, "glGetCombinerInputParameterivNV(0x%x, 0x%x, 0x%x, 0x%x, %p);\n", stage, portion, variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params) -{ - DISPATCH(GetCombinerOutputParameterfvNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterfvNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params) -{ - DISPATCH(GetCombinerOutputParameterivNV, (stage, portion, pname, params), (F, "glGetCombinerOutputParameterivNV(0x%x, 0x%x, 0x%x, %p);\n", stage, portion, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params) -{ - DISPATCH(GetFinalCombinerInputParameterfvNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterfvNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params) -{ - DISPATCH(GetFinalCombinerInputParameterivNV, (variable, pname, params), (F, "glGetFinalCombinerInputParameterivNV(0x%x, 0x%x, %p);\n", variable, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ResizeBuffersMESA)(void) -{ - DISPATCH(ResizeBuffersMESA, (), (F, "glResizeBuffersMESA();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2d)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2d(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dARB)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dMESA)(GLdouble x, GLdouble y) -{ - DISPATCH(WindowPos2dMESA, (x, y), (F, "glWindowPos2dMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dv)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos2dvMESA, (v), (F, "glWindowPos2dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2f)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2f(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fARB)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fARB(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fMESA)(GLfloat x, GLfloat y) -{ - DISPATCH(WindowPos2fMESA, (x, y), (F, "glWindowPos2fMESA(%f, %f);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fv)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos2fvMESA, (v), (F, "glWindowPos2fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2i)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2i(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iARB)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iMESA)(GLint x, GLint y) -{ - DISPATCH(WindowPos2iMESA, (x, y), (F, "glWindowPos2iMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2iv)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivARB)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos2ivMESA, (v), (F, "glWindowPos2ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2s)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2s(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sARB)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sARB(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sMESA)(GLshort x, GLshort y) -{ - DISPATCH(WindowPos2sMESA, (x, y), (F, "glWindowPos2sMESA(%d, %d);\n", x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2sv)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svARB)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos2svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos2svMESA, (v), (F, "glWindowPos2svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3d)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3d(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dARB)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(WindowPos3dMESA, (x, y, z), (F, "glWindowPos3dMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dv)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvARB)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos3dvMESA, (v), (F, "glWindowPos3dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3f)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3f(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fARB)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fARB(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(WindowPos3fMESA, (x, y, z), (F, "glWindowPos3fMESA(%f, %f, %f);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fv)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvARB)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos3fvMESA, (v), (F, "glWindowPos3fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3i)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3i(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iARB)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iMESA)(GLint x, GLint y, GLint z) -{ - DISPATCH(WindowPos3iMESA, (x, y, z), (F, "glWindowPos3iMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3iv)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3iv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivARB)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos3ivMESA, (v), (F, "glWindowPos3ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3s)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3s(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sARB)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sARB(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sMESA)(GLshort x, GLshort y, GLshort z) -{ - DISPATCH(WindowPos3sMESA, (x, y, z), (F, "glWindowPos3sMESA(%d, %d, %d);\n", x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3sv)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3sv(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svARB)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svARB(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos3svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos3svMESA, (v), (F, "glWindowPos3svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(WindowPos4dMESA, (x, y, z, w), (F, "glWindowPos4dMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4dvMESA)(const GLdouble * v) -{ - DISPATCH(WindowPos4dvMESA, (v), (F, "glWindowPos4dvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(WindowPos4fMESA, (x, y, z, w), (F, "glWindowPos4fMESA(%f, %f, %f, %f);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4fvMESA)(const GLfloat * v) -{ - DISPATCH(WindowPos4fvMESA, (v), (F, "glWindowPos4fvMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w) -{ - DISPATCH(WindowPos4iMESA, (x, y, z, w), (F, "glWindowPos4iMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4ivMESA)(const GLint * v) -{ - DISPATCH(WindowPos4ivMESA, (v), (F, "glWindowPos4ivMESA(%p);\n", (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(WindowPos4sMESA, (x, y, z, w), (F, "glWindowPos4sMESA(%d, %d, %d, %d);\n", x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) -{ - DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_648)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_649)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_650)(GLsizei n, const GLuint * fences) -{ - DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_651)(GLuint fence) -{ - DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_652)(GLsizei n, GLuint * fences) -{ - DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_653)(GLuint fence, GLenum pname, GLint * params) -{ - DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_654)(GLuint fence) -{ - RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_655)(GLuint fence, GLenum condition) -{ - DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_656)(GLuint fence) -{ - RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences) -{ - RETURN_DISPATCH(AreProgramsResidentNV, (n, ids, residences), (F, "glAreProgramsResidentNV(%d, %p, %p);\n", n, (const void *) ids, (const void *) residences)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramARB)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramARB(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(BindProgramNV)(GLenum target, GLuint program) -{ - DISPATCH(BindProgramNV, (target, program), (F, "glBindProgramNV(0x%x, %d);\n", target, program)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsARB)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteProgramsNV)(GLsizei n, const GLuint * programs) -{ - DISPATCH(DeleteProgramsNV, (n, programs), (F, "glDeleteProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params) -{ - DISPATCH(ExecuteProgramNV, (target, id, params), (F, "glExecuteProgramNV(0x%x, %d, %p);\n", target, id, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsARB)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsARB(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GenProgramsNV)(GLsizei n, GLuint * programs) -{ - DISPATCH(GenProgramsNV, (n, programs), (F, "glGenProgramsNV(%d, %p);\n", n, (const void *) programs)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetProgramParameterdvNV, (target, index, pname, params), (F, "glGetProgramParameterdvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetProgramParameterfvNV, (target, index, pname, params), (F, "glGetProgramParameterfvNV(0x%x, %d, 0x%x, %p);\n", target, index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program) -{ - DISPATCH(GetProgramStringNV, (id, pname, program), (F, "glGetProgramStringNV(%d, 0x%x, %p);\n", id, pname, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramivNV)(GLuint id, GLenum pname, GLint * params) -{ - DISPATCH(GetProgramivNV, (id, pname, params), (F, "glGetProgramivNV(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params) -{ - DISPATCH(GetTrackMatrixivNV, (target, address, pname, params), (F, "glGetTrackMatrixivNV(0x%x, %d, 0x%x, %p);\n", target, address, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointerv(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervARB)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervARB(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer) -{ - DISPATCH(GetVertexAttribPointervNV, (index, pname, pointer), (F, "glGetVertexAttribPointervNV(%d, 0x%x, %p);\n", index, pname, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params) -{ - DISPATCH(GetVertexAttribdvNV, (index, pname, params), (F, "glGetVertexAttribdvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params) -{ - DISPATCH(GetVertexAttribfvNV, (index, pname, params), (F, "glGetVertexAttribfvNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params) -{ - DISPATCH(GetVertexAttribivNV, (index, pname, params), (F, "glGetVertexAttribivNV(%d, 0x%x, %p);\n", index, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramARB)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramARB(%d);\n", program)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsProgramNV)(GLuint program) -{ - RETURN_DISPATCH(IsProgramNV, (program), (F, "glIsProgramNV(%d);\n", program)); -} - -KEYWORD1 void KEYWORD2 NAME(LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program) -{ - DISPATCH(LoadProgramNV, (target, id, len, program), (F, "glLoadProgramNV(0x%x, %d, %d, %p);\n", target, id, len, (const void *) program)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params) -{ - DISPATCH(ProgramParameters4dvNV, (target, index, num, params), (F, "glProgramParameters4dvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params) -{ - DISPATCH(ProgramParameters4fvNV, (target, index, num, params), (F, "glProgramParameters4fvNV(0x%x, %d, %d, %p);\n", target, index, num, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(RequestResidentProgramsNV)(GLsizei n, const GLuint * ids) -{ - DISPATCH(RequestResidentProgramsNV, (n, ids), (F, "glRequestResidentProgramsNV(%d, %p);\n", n, (const void *) ids)); -} - -KEYWORD1 void KEYWORD2 NAME(TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform) -{ - DISPATCH(TrackMatrixNV, (target, address, matrix, transform), (F, "glTrackMatrixNV(0x%x, %d, 0x%x, 0x%x);\n", target, address, matrix, transform)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dNV)(GLuint index, GLdouble x) -{ - DISPATCH(VertexAttrib1dNV, (index, x), (F, "glVertexAttrib1dNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib1dvNV, (index, v), (F, "glVertexAttrib1dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fNV)(GLuint index, GLfloat x) -{ - DISPATCH(VertexAttrib1fNV, (index, x), (F, "glVertexAttrib1fNV(%d, %f);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib1fvNV, (index, v), (F, "glVertexAttrib1fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1sNV)(GLuint index, GLshort x) -{ - DISPATCH(VertexAttrib1sNV, (index, x), (F, "glVertexAttrib1sNV(%d, %d);\n", index, x)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib1svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib1svNV, (index, v), (F, "glVertexAttrib1svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y) -{ - DISPATCH(VertexAttrib2dNV, (index, x, y), (F, "glVertexAttrib2dNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib2dvNV, (index, v), (F, "glVertexAttrib2dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y) -{ - DISPATCH(VertexAttrib2fNV, (index, x, y), (F, "glVertexAttrib2fNV(%d, %f, %f);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib2fvNV, (index, v), (F, "glVertexAttrib2fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y) -{ - DISPATCH(VertexAttrib2sNV, (index, x, y), (F, "glVertexAttrib2sNV(%d, %d, %d);\n", index, x, y)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib2svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib2svNV, (index, v), (F, "glVertexAttrib2svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z) -{ - DISPATCH(VertexAttrib3dNV, (index, x, y, z), (F, "glVertexAttrib3dNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib3dvNV, (index, v), (F, "glVertexAttrib3dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - DISPATCH(VertexAttrib3fNV, (index, x, y, z), (F, "glVertexAttrib3fNV(%d, %f, %f, %f);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib3fvNV, (index, v), (F, "glVertexAttrib3fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z) -{ - DISPATCH(VertexAttrib3sNV, (index, x, y, z), (F, "glVertexAttrib3sNV(%d, %d, %d, %d);\n", index, x, y, z)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib3svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib3svNV, (index, v), (F, "glVertexAttrib3svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(VertexAttrib4dNV, (index, x, y, z, w), (F, "glVertexAttrib4dNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4dvNV)(GLuint index, const GLdouble * v) -{ - DISPATCH(VertexAttrib4dvNV, (index, v), (F, "glVertexAttrib4dvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(VertexAttrib4fNV, (index, x, y, z, w), (F, "glVertexAttrib4fNV(%d, %f, %f, %f, %f);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvNV)(GLuint index, const GLfloat * v) -{ - DISPATCH(VertexAttrib4fvNV, (index, v), (F, "glVertexAttrib4fvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) -{ - DISPATCH(VertexAttrib4sNV, (index, x, y, z, w), (F, "glVertexAttrib4sNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svNV)(GLuint index, const GLshort * v) -{ - DISPATCH(VertexAttrib4svNV, (index, v), (F, "glVertexAttrib4svNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) -{ - DISPATCH(VertexAttrib4ubNV, (index, x, y, z, w), (F, "glVertexAttrib4ubNV(%d, %d, %d, %d, %d);\n", index, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvNV)(GLuint index, const GLubyte * v) -{ - DISPATCH(VertexAttrib4ubvNV, (index, v), (F, "glVertexAttrib4ubvNV(%d, %p);\n", index, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ - DISPATCH(VertexAttribPointerNV, (index, size, type, stride, pointer), (F, "glVertexAttribPointerNV(%d, %d, 0x%x, %d, %p);\n", index, size, type, stride, (const void *) pointer)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs1dvNV, (index, n, v), (F, "glVertexAttribs1dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs1fvNV, (index, n, v), (F, "glVertexAttribs1fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs1svNV, (index, n, v), (F, "glVertexAttribs1svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs2dvNV, (index, n, v), (F, "glVertexAttribs2dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs2fvNV, (index, n, v), (F, "glVertexAttribs2fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs2svNV, (index, n, v), (F, "glVertexAttribs2svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs3dvNV, (index, n, v), (F, "glVertexAttribs3dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs3fvNV, (index, n, v), (F, "glVertexAttribs3fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs3svNV, (index, n, v), (F, "glVertexAttribs3svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v) -{ - DISPATCH(VertexAttribs4dvNV, (index, n, v), (F, "glVertexAttribs4dvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v) -{ - DISPATCH(VertexAttribs4fvNV, (index, n, v), (F, "glVertexAttribs4fvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v) -{ - DISPATCH(VertexAttribs4svNV, (index, n, v), (F, "glVertexAttribs4svNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v) -{ - DISPATCH(VertexAttribs4ubvNV, (index, n, v), (F, "glVertexAttribs4ubvNV(%d, %d, %p);\n", index, n, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(AlphaFragmentOp1ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod), (F, "glAlphaFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(AlphaFragmentOp2ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glAlphaFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(AlphaFragmentOp3ATI, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glAlphaFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(BeginFragmentShaderATI)(void) -{ - DISPATCH(BeginFragmentShaderATI, (), (F, "glBeginFragmentShaderATI();\n")); -} - -KEYWORD1 void KEYWORD2 NAME(BindFragmentShaderATI)(GLuint id) -{ - DISPATCH(BindFragmentShaderATI, (id), (F, "glBindFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) -{ - DISPATCH(ColorFragmentOp1ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod), (F, "glColorFragmentOp1ATI(0x%x, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) -{ - DISPATCH(ColorFragmentOp2ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod), (F, "glColorFragmentOp2ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) -{ - DISPATCH(ColorFragmentOp3ATI, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod), (F, "glColorFragmentOp3ATI(0x%x, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d);\n", op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFragmentShaderATI)(GLuint id) -{ - DISPATCH(DeleteFragmentShaderATI, (id), (F, "glDeleteFragmentShaderATI(%d);\n", id)); -} - -KEYWORD1 void KEYWORD2 NAME(EndFragmentShaderATI)(void) -{ - DISPATCH(EndFragmentShaderATI, (), (F, "glEndFragmentShaderATI();\n")); -} - -KEYWORD1 GLuint KEYWORD2 NAME(GenFragmentShadersATI)(GLuint range) -{ - RETURN_DISPATCH(GenFragmentShadersATI, (range), (F, "glGenFragmentShadersATI(%d);\n", range)); -} - -KEYWORD1 void KEYWORD2 NAME(PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle) -{ - DISPATCH(PassTexCoordATI, (dst, coord, swizzle), (F, "glPassTexCoordATI(%d, %d, 0x%x);\n", dst, coord, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle) -{ - DISPATCH(SampleMapATI, (dst, interp, swizzle), (F, "glSampleMapATI(%d, %d, 0x%x);\n", dst, interp, swizzle)); -} - -KEYWORD1 void KEYWORD2 NAME(SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value) -{ - DISPATCH(SetFragmentShaderConstantATI, (dst, value), (F, "glSetFragmentShaderConstantATI(%d, %p);\n", dst, (const void *) value)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteri)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteri(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriNV)(GLenum pname, GLint param) -{ - DISPATCH(PointParameteriNV, (pname, param), (F, "glPointParameteriNV(0x%x, %d);\n", pname, param)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameteriv)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameteriv(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * params) -{ - DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_733)(GLenum face) -{ - DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_734)(GLuint array) -{ - DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_735)(GLsizei n, const GLuint * arrays) -{ - DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_736)(GLsizei n, GLuint * arrays) -{ - DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); -} - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array); - -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_737)(GLuint array) -{ - RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) -{ - DISPATCH(GetProgramNamedParameterdvNV, (id, len, name, params), (F, "glGetProgramNamedParameterdvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) -{ - DISPATCH(GetProgramNamedParameterfvNV, (id, len, name, params), (F, "glGetProgramNamedParameterfvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - DISPATCH(ProgramNamedParameter4dNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4dNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) -{ - DISPATCH(ProgramNamedParameter4dvNV, (id, len, name, v), (F, "glProgramNamedParameter4dvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - DISPATCH(ProgramNamedParameter4fNV, (id, len, name, x, y, z, w), (F, "glProgramNamedParameter4fNV(%d, %d, %p, %f, %f, %f, %f);\n", id, len, (const void *) name, x, y, z, w)); -} - -KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) -{ - DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_744)(GLclampd zmin, GLclampd zmax) -{ - DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); -} - -KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_745)(GLenum modeRGB, GLenum modeA) -{ - DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); -} - -KEYWORD1 void KEYWORD2 NAME(BindFramebufferEXT)(GLenum target, GLuint framebuffer) -{ - DISPATCH(BindFramebufferEXT, (target, framebuffer), (F, "glBindFramebufferEXT(0x%x, %d);\n", target, framebuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(BindRenderbufferEXT)(GLenum target, GLuint renderbuffer) -{ - DISPATCH(BindRenderbufferEXT, (target, renderbuffer), (F, "glBindRenderbufferEXT(0x%x, %d);\n", target, renderbuffer)); -} - -KEYWORD1 GLenum KEYWORD2 NAME(CheckFramebufferStatusEXT)(GLenum target) -{ - RETURN_DISPATCH(CheckFramebufferStatusEXT, (target), (F, "glCheckFramebufferStatusEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers) -{ - DISPATCH(DeleteFramebuffersEXT, (n, framebuffers), (F, "glDeleteFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers) -{ - DISPATCH(DeleteRenderbuffersEXT, (n, renderbuffers), (F, "glDeleteRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) -{ - DISPATCH(FramebufferRenderbufferEXT, (target, attachment, renderbuffertarget, renderbuffer), (F, "glFramebufferRenderbufferEXT(0x%x, 0x%x, 0x%x, %d);\n", target, attachment, renderbuffertarget, renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture1DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture1DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -{ - DISPATCH(FramebufferTexture2DEXT, (target, attachment, textarget, texture, level), (F, "glFramebufferTexture2DEXT(0x%x, 0x%x, 0x%x, %d, %d);\n", target, attachment, textarget, texture, level)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) -{ - DISPATCH(FramebufferTexture3DEXT, (target, attachment, textarget, texture, level, zoffset), (F, "glFramebufferTexture3DEXT(0x%x, 0x%x, 0x%x, %d, %d, %d);\n", target, attachment, textarget, texture, level, zoffset)); -} - -KEYWORD1 void KEYWORD2 NAME(GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers) -{ - DISPATCH(GenFramebuffersEXT, (n, framebuffers), (F, "glGenFramebuffersEXT(%d, %p);\n", n, (const void *) framebuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers) -{ - DISPATCH(GenRenderbuffersEXT, (n, renderbuffers), (F, "glGenRenderbuffersEXT(%d, %p);\n", n, (const void *) renderbuffers)); -} - -KEYWORD1 void KEYWORD2 NAME(GenerateMipmapEXT)(GLenum target) -{ - DISPATCH(GenerateMipmapEXT, (target), (F, "glGenerateMipmapEXT(0x%x);\n", target)); -} - -KEYWORD1 void KEYWORD2 NAME(GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params) -{ - DISPATCH(GetFramebufferAttachmentParameterivEXT, (target, attachment, pname, params), (F, "glGetFramebufferAttachmentParameterivEXT(0x%x, 0x%x, 0x%x, %p);\n", target, attachment, pname, (const void *) params)); -} - -KEYWORD1 void KEYWORD2 NAME(GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params) -{ - DISPATCH(GetRenderbufferParameterivEXT, (target, pname, params), (F, "glGetRenderbufferParameterivEXT(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsFramebufferEXT)(GLuint framebuffer) -{ - RETURN_DISPATCH(IsFramebufferEXT, (framebuffer), (F, "glIsFramebufferEXT(%d);\n", framebuffer)); -} - -KEYWORD1 GLboolean KEYWORD2 NAME(IsRenderbufferEXT)(GLuint renderbuffer) -{ - RETURN_DISPATCH(IsRenderbufferEXT, (renderbuffer), (F, "glIsRenderbufferEXT(%d);\n", renderbuffer)); -} - -KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) -{ - DISPATCH(RenderbufferStorageEXT, (target, internalformat, width, height), (F, "glRenderbufferStorageEXT(0x%x, 0x%x, %d, %d);\n", target, internalformat, width, height)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_763)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) -{ - DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); -} - -KEYWORD1 void KEYWORD2 NAME(FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) -{ - DISPATCH(FramebufferTextureLayerEXT, (target, attachment, texture, level, layer), (F, "glFramebufferTextureLayerEXT(0x%x, 0x%x, %d, %d, %d);\n", target, attachment, texture, level, layer)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) -{ - DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_766)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_767)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) -{ - DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_768)(GLuint id, GLenum pname, GLint64EXT * params) -{ - DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params); - -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_769)(GLuint id, GLenum pname, GLuint64EXT * params) -{ - DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); -} - - -#endif /* defined( NAME ) */ - -/* - * This is how a dispatch table can be initialized with all the functions - * we generated above. - */ -#ifdef DISPATCH_TABLE_NAME - -#ifndef TABLE_ENTRY -#error TABLE_ENTRY must be defined -#endif - -static _glapi_proc DISPATCH_TABLE_NAME[] = { - TABLE_ENTRY(NewList), - TABLE_ENTRY(EndList), - TABLE_ENTRY(CallList), - TABLE_ENTRY(CallLists), - TABLE_ENTRY(DeleteLists), - TABLE_ENTRY(GenLists), - TABLE_ENTRY(ListBase), - TABLE_ENTRY(Begin), - TABLE_ENTRY(Bitmap), - TABLE_ENTRY(Color3b), - TABLE_ENTRY(Color3bv), - TABLE_ENTRY(Color3d), - TABLE_ENTRY(Color3dv), - TABLE_ENTRY(Color3f), - TABLE_ENTRY(Color3fv), - TABLE_ENTRY(Color3i), - TABLE_ENTRY(Color3iv), - TABLE_ENTRY(Color3s), - TABLE_ENTRY(Color3sv), - TABLE_ENTRY(Color3ub), - TABLE_ENTRY(Color3ubv), - TABLE_ENTRY(Color3ui), - TABLE_ENTRY(Color3uiv), - TABLE_ENTRY(Color3us), - TABLE_ENTRY(Color3usv), - TABLE_ENTRY(Color4b), - TABLE_ENTRY(Color4bv), - TABLE_ENTRY(Color4d), - TABLE_ENTRY(Color4dv), - TABLE_ENTRY(Color4f), - TABLE_ENTRY(Color4fv), - TABLE_ENTRY(Color4i), - TABLE_ENTRY(Color4iv), - TABLE_ENTRY(Color4s), - TABLE_ENTRY(Color4sv), - TABLE_ENTRY(Color4ub), - TABLE_ENTRY(Color4ubv), - TABLE_ENTRY(Color4ui), - TABLE_ENTRY(Color4uiv), - TABLE_ENTRY(Color4us), - TABLE_ENTRY(Color4usv), - TABLE_ENTRY(EdgeFlag), - TABLE_ENTRY(EdgeFlagv), - TABLE_ENTRY(End), - TABLE_ENTRY(Indexd), - TABLE_ENTRY(Indexdv), - TABLE_ENTRY(Indexf), - TABLE_ENTRY(Indexfv), - TABLE_ENTRY(Indexi), - TABLE_ENTRY(Indexiv), - TABLE_ENTRY(Indexs), - TABLE_ENTRY(Indexsv), - TABLE_ENTRY(Normal3b), - TABLE_ENTRY(Normal3bv), - TABLE_ENTRY(Normal3d), - TABLE_ENTRY(Normal3dv), - TABLE_ENTRY(Normal3f), - TABLE_ENTRY(Normal3fv), - TABLE_ENTRY(Normal3i), - TABLE_ENTRY(Normal3iv), - TABLE_ENTRY(Normal3s), - TABLE_ENTRY(Normal3sv), - TABLE_ENTRY(RasterPos2d), - TABLE_ENTRY(RasterPos2dv), - TABLE_ENTRY(RasterPos2f), - TABLE_ENTRY(RasterPos2fv), - TABLE_ENTRY(RasterPos2i), - TABLE_ENTRY(RasterPos2iv), - TABLE_ENTRY(RasterPos2s), - TABLE_ENTRY(RasterPos2sv), - TABLE_ENTRY(RasterPos3d), - TABLE_ENTRY(RasterPos3dv), - TABLE_ENTRY(RasterPos3f), - TABLE_ENTRY(RasterPos3fv), - TABLE_ENTRY(RasterPos3i), - TABLE_ENTRY(RasterPos3iv), - TABLE_ENTRY(RasterPos3s), - TABLE_ENTRY(RasterPos3sv), - TABLE_ENTRY(RasterPos4d), - TABLE_ENTRY(RasterPos4dv), - TABLE_ENTRY(RasterPos4f), - TABLE_ENTRY(RasterPos4fv), - TABLE_ENTRY(RasterPos4i), - TABLE_ENTRY(RasterPos4iv), - TABLE_ENTRY(RasterPos4s), - TABLE_ENTRY(RasterPos4sv), - TABLE_ENTRY(Rectd), - TABLE_ENTRY(Rectdv), - TABLE_ENTRY(Rectf), - TABLE_ENTRY(Rectfv), - TABLE_ENTRY(Recti), - TABLE_ENTRY(Rectiv), - TABLE_ENTRY(Rects), - TABLE_ENTRY(Rectsv), - TABLE_ENTRY(TexCoord1d), - TABLE_ENTRY(TexCoord1dv), - TABLE_ENTRY(TexCoord1f), - TABLE_ENTRY(TexCoord1fv), - TABLE_ENTRY(TexCoord1i), - TABLE_ENTRY(TexCoord1iv), - TABLE_ENTRY(TexCoord1s), - TABLE_ENTRY(TexCoord1sv), - TABLE_ENTRY(TexCoord2d), - TABLE_ENTRY(TexCoord2dv), - TABLE_ENTRY(TexCoord2f), - TABLE_ENTRY(TexCoord2fv), - TABLE_ENTRY(TexCoord2i), - TABLE_ENTRY(TexCoord2iv), - TABLE_ENTRY(TexCoord2s), - TABLE_ENTRY(TexCoord2sv), - TABLE_ENTRY(TexCoord3d), - TABLE_ENTRY(TexCoord3dv), - TABLE_ENTRY(TexCoord3f), - TABLE_ENTRY(TexCoord3fv), - TABLE_ENTRY(TexCoord3i), - TABLE_ENTRY(TexCoord3iv), - TABLE_ENTRY(TexCoord3s), - TABLE_ENTRY(TexCoord3sv), - TABLE_ENTRY(TexCoord4d), - TABLE_ENTRY(TexCoord4dv), - TABLE_ENTRY(TexCoord4f), - TABLE_ENTRY(TexCoord4fv), - TABLE_ENTRY(TexCoord4i), - TABLE_ENTRY(TexCoord4iv), - TABLE_ENTRY(TexCoord4s), - TABLE_ENTRY(TexCoord4sv), - TABLE_ENTRY(Vertex2d), - TABLE_ENTRY(Vertex2dv), - TABLE_ENTRY(Vertex2f), - TABLE_ENTRY(Vertex2fv), - TABLE_ENTRY(Vertex2i), - TABLE_ENTRY(Vertex2iv), - TABLE_ENTRY(Vertex2s), - TABLE_ENTRY(Vertex2sv), - TABLE_ENTRY(Vertex3d), - TABLE_ENTRY(Vertex3dv), - TABLE_ENTRY(Vertex3f), - TABLE_ENTRY(Vertex3fv), - TABLE_ENTRY(Vertex3i), - TABLE_ENTRY(Vertex3iv), - TABLE_ENTRY(Vertex3s), - TABLE_ENTRY(Vertex3sv), - TABLE_ENTRY(Vertex4d), - TABLE_ENTRY(Vertex4dv), - TABLE_ENTRY(Vertex4f), - TABLE_ENTRY(Vertex4fv), - TABLE_ENTRY(Vertex4i), - TABLE_ENTRY(Vertex4iv), - TABLE_ENTRY(Vertex4s), - TABLE_ENTRY(Vertex4sv), - TABLE_ENTRY(ClipPlane), - TABLE_ENTRY(ColorMaterial), - TABLE_ENTRY(CullFace), - TABLE_ENTRY(Fogf), - TABLE_ENTRY(Fogfv), - TABLE_ENTRY(Fogi), - TABLE_ENTRY(Fogiv), - TABLE_ENTRY(FrontFace), - TABLE_ENTRY(Hint), - TABLE_ENTRY(Lightf), - TABLE_ENTRY(Lightfv), - TABLE_ENTRY(Lighti), - TABLE_ENTRY(Lightiv), - TABLE_ENTRY(LightModelf), - TABLE_ENTRY(LightModelfv), - TABLE_ENTRY(LightModeli), - TABLE_ENTRY(LightModeliv), - TABLE_ENTRY(LineStipple), - TABLE_ENTRY(LineWidth), - TABLE_ENTRY(Materialf), - TABLE_ENTRY(Materialfv), - TABLE_ENTRY(Materiali), - TABLE_ENTRY(Materialiv), - TABLE_ENTRY(PointSize), - TABLE_ENTRY(PolygonMode), - TABLE_ENTRY(PolygonStipple), - TABLE_ENTRY(Scissor), - TABLE_ENTRY(ShadeModel), - TABLE_ENTRY(TexParameterf), - TABLE_ENTRY(TexParameterfv), - TABLE_ENTRY(TexParameteri), - TABLE_ENTRY(TexParameteriv), - TABLE_ENTRY(TexImage1D), - TABLE_ENTRY(TexImage2D), - TABLE_ENTRY(TexEnvf), - TABLE_ENTRY(TexEnvfv), - TABLE_ENTRY(TexEnvi), - TABLE_ENTRY(TexEnviv), - TABLE_ENTRY(TexGend), - TABLE_ENTRY(TexGendv), - TABLE_ENTRY(TexGenf), - TABLE_ENTRY(TexGenfv), - TABLE_ENTRY(TexGeni), - TABLE_ENTRY(TexGeniv), - TABLE_ENTRY(FeedbackBuffer), - TABLE_ENTRY(SelectBuffer), - TABLE_ENTRY(RenderMode), - TABLE_ENTRY(InitNames), - TABLE_ENTRY(LoadName), - TABLE_ENTRY(PassThrough), - TABLE_ENTRY(PopName), - TABLE_ENTRY(PushName), - TABLE_ENTRY(DrawBuffer), - TABLE_ENTRY(Clear), - TABLE_ENTRY(ClearAccum), - TABLE_ENTRY(ClearIndex), - TABLE_ENTRY(ClearColor), - TABLE_ENTRY(ClearStencil), - TABLE_ENTRY(ClearDepth), - TABLE_ENTRY(StencilMask), - TABLE_ENTRY(ColorMask), - TABLE_ENTRY(DepthMask), - TABLE_ENTRY(IndexMask), - TABLE_ENTRY(Accum), - TABLE_ENTRY(Disable), - TABLE_ENTRY(Enable), - TABLE_ENTRY(Finish), - TABLE_ENTRY(Flush), - TABLE_ENTRY(PopAttrib), - TABLE_ENTRY(PushAttrib), - TABLE_ENTRY(Map1d), - TABLE_ENTRY(Map1f), - TABLE_ENTRY(Map2d), - TABLE_ENTRY(Map2f), - TABLE_ENTRY(MapGrid1d), - TABLE_ENTRY(MapGrid1f), - TABLE_ENTRY(MapGrid2d), - TABLE_ENTRY(MapGrid2f), - TABLE_ENTRY(EvalCoord1d), - TABLE_ENTRY(EvalCoord1dv), - TABLE_ENTRY(EvalCoord1f), - TABLE_ENTRY(EvalCoord1fv), - TABLE_ENTRY(EvalCoord2d), - TABLE_ENTRY(EvalCoord2dv), - TABLE_ENTRY(EvalCoord2f), - TABLE_ENTRY(EvalCoord2fv), - TABLE_ENTRY(EvalMesh1), - TABLE_ENTRY(EvalPoint1), - TABLE_ENTRY(EvalMesh2), - TABLE_ENTRY(EvalPoint2), - TABLE_ENTRY(AlphaFunc), - TABLE_ENTRY(BlendFunc), - TABLE_ENTRY(LogicOp), - TABLE_ENTRY(StencilFunc), - TABLE_ENTRY(StencilOp), - TABLE_ENTRY(DepthFunc), - TABLE_ENTRY(PixelZoom), - TABLE_ENTRY(PixelTransferf), - TABLE_ENTRY(PixelTransferi), - TABLE_ENTRY(PixelStoref), - TABLE_ENTRY(PixelStorei), - TABLE_ENTRY(PixelMapfv), - TABLE_ENTRY(PixelMapuiv), - TABLE_ENTRY(PixelMapusv), - TABLE_ENTRY(ReadBuffer), - TABLE_ENTRY(CopyPixels), - TABLE_ENTRY(ReadPixels), - TABLE_ENTRY(DrawPixels), - TABLE_ENTRY(GetBooleanv), - TABLE_ENTRY(GetClipPlane), - TABLE_ENTRY(GetDoublev), - TABLE_ENTRY(GetError), - TABLE_ENTRY(GetFloatv), - TABLE_ENTRY(GetIntegerv), - TABLE_ENTRY(GetLightfv), - TABLE_ENTRY(GetLightiv), - TABLE_ENTRY(GetMapdv), - TABLE_ENTRY(GetMapfv), - TABLE_ENTRY(GetMapiv), - TABLE_ENTRY(GetMaterialfv), - TABLE_ENTRY(GetMaterialiv), - TABLE_ENTRY(GetPixelMapfv), - TABLE_ENTRY(GetPixelMapuiv), - TABLE_ENTRY(GetPixelMapusv), - TABLE_ENTRY(GetPolygonStipple), - TABLE_ENTRY(GetString), - TABLE_ENTRY(GetTexEnvfv), - TABLE_ENTRY(GetTexEnviv), - TABLE_ENTRY(GetTexGendv), - TABLE_ENTRY(GetTexGenfv), - TABLE_ENTRY(GetTexGeniv), - TABLE_ENTRY(GetTexImage), - TABLE_ENTRY(GetTexParameterfv), - TABLE_ENTRY(GetTexParameteriv), - TABLE_ENTRY(GetTexLevelParameterfv), - TABLE_ENTRY(GetTexLevelParameteriv), - TABLE_ENTRY(IsEnabled), - TABLE_ENTRY(IsList), - TABLE_ENTRY(DepthRange), - TABLE_ENTRY(Frustum), - TABLE_ENTRY(LoadIdentity), - TABLE_ENTRY(LoadMatrixf), - TABLE_ENTRY(LoadMatrixd), - TABLE_ENTRY(MatrixMode), - TABLE_ENTRY(MultMatrixf), - TABLE_ENTRY(MultMatrixd), - TABLE_ENTRY(Ortho), - TABLE_ENTRY(PopMatrix), - TABLE_ENTRY(PushMatrix), - TABLE_ENTRY(Rotated), - TABLE_ENTRY(Rotatef), - TABLE_ENTRY(Scaled), - TABLE_ENTRY(Scalef), - TABLE_ENTRY(Translated), - TABLE_ENTRY(Translatef), - TABLE_ENTRY(Viewport), - TABLE_ENTRY(ArrayElement), - TABLE_ENTRY(BindTexture), - TABLE_ENTRY(ColorPointer), - TABLE_ENTRY(DisableClientState), - TABLE_ENTRY(DrawArrays), - TABLE_ENTRY(DrawElements), - TABLE_ENTRY(EdgeFlagPointer), - TABLE_ENTRY(EnableClientState), - TABLE_ENTRY(IndexPointer), - TABLE_ENTRY(Indexub), - TABLE_ENTRY(Indexubv), - TABLE_ENTRY(InterleavedArrays), - TABLE_ENTRY(NormalPointer), - TABLE_ENTRY(PolygonOffset), - TABLE_ENTRY(TexCoordPointer), - TABLE_ENTRY(VertexPointer), - TABLE_ENTRY(AreTexturesResident), - TABLE_ENTRY(CopyTexImage1D), - TABLE_ENTRY(CopyTexImage2D), - TABLE_ENTRY(CopyTexSubImage1D), - TABLE_ENTRY(CopyTexSubImage2D), - TABLE_ENTRY(DeleteTextures), - TABLE_ENTRY(GenTextures), - TABLE_ENTRY(GetPointerv), - TABLE_ENTRY(IsTexture), - TABLE_ENTRY(PrioritizeTextures), - TABLE_ENTRY(TexSubImage1D), - TABLE_ENTRY(TexSubImage2D), - TABLE_ENTRY(PopClientAttrib), - TABLE_ENTRY(PushClientAttrib), - TABLE_ENTRY(BlendColor), - TABLE_ENTRY(BlendEquation), - TABLE_ENTRY(DrawRangeElements), - TABLE_ENTRY(ColorTable), - TABLE_ENTRY(ColorTableParameterfv), - TABLE_ENTRY(ColorTableParameteriv), - TABLE_ENTRY(CopyColorTable), - TABLE_ENTRY(GetColorTable), - TABLE_ENTRY(GetColorTableParameterfv), - TABLE_ENTRY(GetColorTableParameteriv), - TABLE_ENTRY(ColorSubTable), - TABLE_ENTRY(CopyColorSubTable), - TABLE_ENTRY(ConvolutionFilter1D), - TABLE_ENTRY(ConvolutionFilter2D), - TABLE_ENTRY(ConvolutionParameterf), - TABLE_ENTRY(ConvolutionParameterfv), - TABLE_ENTRY(ConvolutionParameteri), - TABLE_ENTRY(ConvolutionParameteriv), - TABLE_ENTRY(CopyConvolutionFilter1D), - TABLE_ENTRY(CopyConvolutionFilter2D), - TABLE_ENTRY(GetConvolutionFilter), - TABLE_ENTRY(GetConvolutionParameterfv), - TABLE_ENTRY(GetConvolutionParameteriv), - TABLE_ENTRY(GetSeparableFilter), - TABLE_ENTRY(SeparableFilter2D), - TABLE_ENTRY(GetHistogram), - TABLE_ENTRY(GetHistogramParameterfv), - TABLE_ENTRY(GetHistogramParameteriv), - TABLE_ENTRY(GetMinmax), - TABLE_ENTRY(GetMinmaxParameterfv), - TABLE_ENTRY(GetMinmaxParameteriv), - TABLE_ENTRY(Histogram), - TABLE_ENTRY(Minmax), - TABLE_ENTRY(ResetHistogram), - TABLE_ENTRY(ResetMinmax), - TABLE_ENTRY(TexImage3D), - TABLE_ENTRY(TexSubImage3D), - TABLE_ENTRY(CopyTexSubImage3D), - TABLE_ENTRY(ActiveTextureARB), - TABLE_ENTRY(ClientActiveTextureARB), - TABLE_ENTRY(MultiTexCoord1dARB), - TABLE_ENTRY(MultiTexCoord1dvARB), - TABLE_ENTRY(MultiTexCoord1fARB), - TABLE_ENTRY(MultiTexCoord1fvARB), - TABLE_ENTRY(MultiTexCoord1iARB), - TABLE_ENTRY(MultiTexCoord1ivARB), - TABLE_ENTRY(MultiTexCoord1sARB), - TABLE_ENTRY(MultiTexCoord1svARB), - TABLE_ENTRY(MultiTexCoord2dARB), - TABLE_ENTRY(MultiTexCoord2dvARB), - TABLE_ENTRY(MultiTexCoord2fARB), - TABLE_ENTRY(MultiTexCoord2fvARB), - TABLE_ENTRY(MultiTexCoord2iARB), - TABLE_ENTRY(MultiTexCoord2ivARB), - TABLE_ENTRY(MultiTexCoord2sARB), - TABLE_ENTRY(MultiTexCoord2svARB), - TABLE_ENTRY(MultiTexCoord3dARB), - TABLE_ENTRY(MultiTexCoord3dvARB), - TABLE_ENTRY(MultiTexCoord3fARB), - TABLE_ENTRY(MultiTexCoord3fvARB), - TABLE_ENTRY(MultiTexCoord3iARB), - TABLE_ENTRY(MultiTexCoord3ivARB), - TABLE_ENTRY(MultiTexCoord3sARB), - TABLE_ENTRY(MultiTexCoord3svARB), - TABLE_ENTRY(MultiTexCoord4dARB), - TABLE_ENTRY(MultiTexCoord4dvARB), - TABLE_ENTRY(MultiTexCoord4fARB), - TABLE_ENTRY(MultiTexCoord4fvARB), - TABLE_ENTRY(MultiTexCoord4iARB), - TABLE_ENTRY(MultiTexCoord4ivARB), - TABLE_ENTRY(MultiTexCoord4sARB), - TABLE_ENTRY(MultiTexCoord4svARB), - TABLE_ENTRY(AttachShader), - TABLE_ENTRY(CreateProgram), - TABLE_ENTRY(CreateShader), - TABLE_ENTRY(DeleteProgram), - TABLE_ENTRY(DeleteShader), - TABLE_ENTRY(DetachShader), - TABLE_ENTRY(GetAttachedShaders), - TABLE_ENTRY(GetProgramInfoLog), - TABLE_ENTRY(GetProgramiv), - TABLE_ENTRY(GetShaderInfoLog), - TABLE_ENTRY(GetShaderiv), - TABLE_ENTRY(IsProgram), - TABLE_ENTRY(IsShader), - TABLE_ENTRY(StencilFuncSeparate), - TABLE_ENTRY(StencilMaskSeparate), - TABLE_ENTRY(StencilOpSeparate), - TABLE_ENTRY(UniformMatrix2x3fv), - TABLE_ENTRY(UniformMatrix2x4fv), - TABLE_ENTRY(UniformMatrix3x2fv), - TABLE_ENTRY(UniformMatrix3x4fv), - TABLE_ENTRY(UniformMatrix4x2fv), - TABLE_ENTRY(UniformMatrix4x3fv), - TABLE_ENTRY(LoadTransposeMatrixdARB), - TABLE_ENTRY(LoadTransposeMatrixfARB), - TABLE_ENTRY(MultTransposeMatrixdARB), - TABLE_ENTRY(MultTransposeMatrixfARB), - TABLE_ENTRY(SampleCoverageARB), - TABLE_ENTRY(CompressedTexImage1DARB), - TABLE_ENTRY(CompressedTexImage2DARB), - TABLE_ENTRY(CompressedTexImage3DARB), - TABLE_ENTRY(CompressedTexSubImage1DARB), - TABLE_ENTRY(CompressedTexSubImage2DARB), - TABLE_ENTRY(CompressedTexSubImage3DARB), - TABLE_ENTRY(GetCompressedTexImageARB), - TABLE_ENTRY(DisableVertexAttribArrayARB), - TABLE_ENTRY(EnableVertexAttribArrayARB), - TABLE_ENTRY(GetProgramEnvParameterdvARB), - TABLE_ENTRY(GetProgramEnvParameterfvARB), - TABLE_ENTRY(GetProgramLocalParameterdvARB), - TABLE_ENTRY(GetProgramLocalParameterfvARB), - TABLE_ENTRY(GetProgramStringARB), - TABLE_ENTRY(GetProgramivARB), - TABLE_ENTRY(GetVertexAttribdvARB), - TABLE_ENTRY(GetVertexAttribfvARB), - TABLE_ENTRY(GetVertexAttribivARB), - TABLE_ENTRY(ProgramEnvParameter4dARB), - TABLE_ENTRY(ProgramEnvParameter4dvARB), - TABLE_ENTRY(ProgramEnvParameter4fARB), - TABLE_ENTRY(ProgramEnvParameter4fvARB), - TABLE_ENTRY(ProgramLocalParameter4dARB), - TABLE_ENTRY(ProgramLocalParameter4dvARB), - TABLE_ENTRY(ProgramLocalParameter4fARB), - TABLE_ENTRY(ProgramLocalParameter4fvARB), - TABLE_ENTRY(ProgramStringARB), - TABLE_ENTRY(VertexAttrib1dARB), - TABLE_ENTRY(VertexAttrib1dvARB), - TABLE_ENTRY(VertexAttrib1fARB), - TABLE_ENTRY(VertexAttrib1fvARB), - TABLE_ENTRY(VertexAttrib1sARB), - TABLE_ENTRY(VertexAttrib1svARB), - TABLE_ENTRY(VertexAttrib2dARB), - TABLE_ENTRY(VertexAttrib2dvARB), - TABLE_ENTRY(VertexAttrib2fARB), - TABLE_ENTRY(VertexAttrib2fvARB), - TABLE_ENTRY(VertexAttrib2sARB), - TABLE_ENTRY(VertexAttrib2svARB), - TABLE_ENTRY(VertexAttrib3dARB), - TABLE_ENTRY(VertexAttrib3dvARB), - TABLE_ENTRY(VertexAttrib3fARB), - TABLE_ENTRY(VertexAttrib3fvARB), - TABLE_ENTRY(VertexAttrib3sARB), - TABLE_ENTRY(VertexAttrib3svARB), - TABLE_ENTRY(VertexAttrib4NbvARB), - TABLE_ENTRY(VertexAttrib4NivARB), - TABLE_ENTRY(VertexAttrib4NsvARB), - TABLE_ENTRY(VertexAttrib4NubARB), - TABLE_ENTRY(VertexAttrib4NubvARB), - TABLE_ENTRY(VertexAttrib4NuivARB), - TABLE_ENTRY(VertexAttrib4NusvARB), - TABLE_ENTRY(VertexAttrib4bvARB), - TABLE_ENTRY(VertexAttrib4dARB), - TABLE_ENTRY(VertexAttrib4dvARB), - TABLE_ENTRY(VertexAttrib4fARB), - TABLE_ENTRY(VertexAttrib4fvARB), - TABLE_ENTRY(VertexAttrib4ivARB), - TABLE_ENTRY(VertexAttrib4sARB), - TABLE_ENTRY(VertexAttrib4svARB), - TABLE_ENTRY(VertexAttrib4ubvARB), - TABLE_ENTRY(VertexAttrib4uivARB), - TABLE_ENTRY(VertexAttrib4usvARB), - TABLE_ENTRY(VertexAttribPointerARB), - TABLE_ENTRY(BindBufferARB), - TABLE_ENTRY(BufferDataARB), - TABLE_ENTRY(BufferSubDataARB), - TABLE_ENTRY(DeleteBuffersARB), - TABLE_ENTRY(GenBuffersARB), - TABLE_ENTRY(GetBufferParameterivARB), - TABLE_ENTRY(GetBufferPointervARB), - TABLE_ENTRY(GetBufferSubDataARB), - TABLE_ENTRY(IsBufferARB), - TABLE_ENTRY(MapBufferARB), - TABLE_ENTRY(UnmapBufferARB), - TABLE_ENTRY(BeginQueryARB), - TABLE_ENTRY(DeleteQueriesARB), - TABLE_ENTRY(EndQueryARB), - TABLE_ENTRY(GenQueriesARB), - TABLE_ENTRY(GetQueryObjectivARB), - TABLE_ENTRY(GetQueryObjectuivARB), - TABLE_ENTRY(GetQueryivARB), - TABLE_ENTRY(IsQueryARB), - TABLE_ENTRY(AttachObjectARB), - TABLE_ENTRY(CompileShaderARB), - TABLE_ENTRY(CreateProgramObjectARB), - TABLE_ENTRY(CreateShaderObjectARB), - TABLE_ENTRY(DeleteObjectARB), - TABLE_ENTRY(DetachObjectARB), - TABLE_ENTRY(GetActiveUniformARB), - TABLE_ENTRY(GetAttachedObjectsARB), - TABLE_ENTRY(GetHandleARB), - TABLE_ENTRY(GetInfoLogARB), - TABLE_ENTRY(GetObjectParameterfvARB), - TABLE_ENTRY(GetObjectParameterivARB), - TABLE_ENTRY(GetShaderSourceARB), - TABLE_ENTRY(GetUniformLocationARB), - TABLE_ENTRY(GetUniformfvARB), - TABLE_ENTRY(GetUniformivARB), - TABLE_ENTRY(LinkProgramARB), - TABLE_ENTRY(ShaderSourceARB), - TABLE_ENTRY(Uniform1fARB), - TABLE_ENTRY(Uniform1fvARB), - TABLE_ENTRY(Uniform1iARB), - TABLE_ENTRY(Uniform1ivARB), - TABLE_ENTRY(Uniform2fARB), - TABLE_ENTRY(Uniform2fvARB), - TABLE_ENTRY(Uniform2iARB), - TABLE_ENTRY(Uniform2ivARB), - TABLE_ENTRY(Uniform3fARB), - TABLE_ENTRY(Uniform3fvARB), - TABLE_ENTRY(Uniform3iARB), - TABLE_ENTRY(Uniform3ivARB), - TABLE_ENTRY(Uniform4fARB), - TABLE_ENTRY(Uniform4fvARB), - TABLE_ENTRY(Uniform4iARB), - TABLE_ENTRY(Uniform4ivARB), - TABLE_ENTRY(UniformMatrix2fvARB), - TABLE_ENTRY(UniformMatrix3fvARB), - TABLE_ENTRY(UniformMatrix4fvARB), - TABLE_ENTRY(UseProgramObjectARB), - TABLE_ENTRY(ValidateProgramARB), - TABLE_ENTRY(BindAttribLocationARB), - TABLE_ENTRY(GetActiveAttribARB), - TABLE_ENTRY(GetAttribLocationARB), - TABLE_ENTRY(DrawBuffersARB), - TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_562), - TABLE_ENTRY(_dispatch_stub_563), - TABLE_ENTRY(_dispatch_stub_564), - TABLE_ENTRY(_dispatch_stub_565), - TABLE_ENTRY(_dispatch_stub_566), - TABLE_ENTRY(_dispatch_stub_567), - TABLE_ENTRY(_dispatch_stub_568), - TABLE_ENTRY(_dispatch_stub_569), - TABLE_ENTRY(ColorPointerEXT), - TABLE_ENTRY(EdgeFlagPointerEXT), - TABLE_ENTRY(IndexPointerEXT), - TABLE_ENTRY(NormalPointerEXT), - TABLE_ENTRY(TexCoordPointerEXT), - TABLE_ENTRY(VertexPointerEXT), - TABLE_ENTRY(PointParameterfEXT), - TABLE_ENTRY(PointParameterfvEXT), - TABLE_ENTRY(LockArraysEXT), - TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_580), - TABLE_ENTRY(_dispatch_stub_581), - TABLE_ENTRY(SecondaryColor3bEXT), - TABLE_ENTRY(SecondaryColor3bvEXT), - TABLE_ENTRY(SecondaryColor3dEXT), - TABLE_ENTRY(SecondaryColor3dvEXT), - TABLE_ENTRY(SecondaryColor3fEXT), - TABLE_ENTRY(SecondaryColor3fvEXT), - TABLE_ENTRY(SecondaryColor3iEXT), - TABLE_ENTRY(SecondaryColor3ivEXT), - TABLE_ENTRY(SecondaryColor3sEXT), - TABLE_ENTRY(SecondaryColor3svEXT), - TABLE_ENTRY(SecondaryColor3ubEXT), - TABLE_ENTRY(SecondaryColor3ubvEXT), - TABLE_ENTRY(SecondaryColor3uiEXT), - TABLE_ENTRY(SecondaryColor3uivEXT), - TABLE_ENTRY(SecondaryColor3usEXT), - TABLE_ENTRY(SecondaryColor3usvEXT), - TABLE_ENTRY(SecondaryColorPointerEXT), - TABLE_ENTRY(MultiDrawArraysEXT), - TABLE_ENTRY(MultiDrawElementsEXT), - TABLE_ENTRY(FogCoordPointerEXT), - TABLE_ENTRY(FogCoorddEXT), - TABLE_ENTRY(FogCoorddvEXT), - TABLE_ENTRY(FogCoordfEXT), - TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_606), - TABLE_ENTRY(BlendFuncSeparateEXT), - TABLE_ENTRY(FlushVertexArrayRangeNV), - TABLE_ENTRY(VertexArrayRangeNV), - TABLE_ENTRY(CombinerInputNV), - TABLE_ENTRY(CombinerOutputNV), - TABLE_ENTRY(CombinerParameterfNV), - TABLE_ENTRY(CombinerParameterfvNV), - TABLE_ENTRY(CombinerParameteriNV), - TABLE_ENTRY(CombinerParameterivNV), - TABLE_ENTRY(FinalCombinerInputNV), - TABLE_ENTRY(GetCombinerInputParameterfvNV), - TABLE_ENTRY(GetCombinerInputParameterivNV), - TABLE_ENTRY(GetCombinerOutputParameterfvNV), - TABLE_ENTRY(GetCombinerOutputParameterivNV), - TABLE_ENTRY(GetFinalCombinerInputParameterfvNV), - TABLE_ENTRY(GetFinalCombinerInputParameterivNV), - TABLE_ENTRY(ResizeBuffersMESA), - TABLE_ENTRY(WindowPos2dMESA), - TABLE_ENTRY(WindowPos2dvMESA), - TABLE_ENTRY(WindowPos2fMESA), - TABLE_ENTRY(WindowPos2fvMESA), - TABLE_ENTRY(WindowPos2iMESA), - TABLE_ENTRY(WindowPos2ivMESA), - TABLE_ENTRY(WindowPos2sMESA), - TABLE_ENTRY(WindowPos2svMESA), - TABLE_ENTRY(WindowPos3dMESA), - TABLE_ENTRY(WindowPos3dvMESA), - TABLE_ENTRY(WindowPos3fMESA), - TABLE_ENTRY(WindowPos3fvMESA), - TABLE_ENTRY(WindowPos3iMESA), - TABLE_ENTRY(WindowPos3ivMESA), - TABLE_ENTRY(WindowPos3sMESA), - TABLE_ENTRY(WindowPos3svMESA), - TABLE_ENTRY(WindowPos4dMESA), - TABLE_ENTRY(WindowPos4dvMESA), - TABLE_ENTRY(WindowPos4fMESA), - TABLE_ENTRY(WindowPos4fvMESA), - TABLE_ENTRY(WindowPos4iMESA), - TABLE_ENTRY(WindowPos4ivMESA), - TABLE_ENTRY(WindowPos4sMESA), - TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_648), - TABLE_ENTRY(_dispatch_stub_649), - TABLE_ENTRY(_dispatch_stub_650), - TABLE_ENTRY(_dispatch_stub_651), - TABLE_ENTRY(_dispatch_stub_652), - TABLE_ENTRY(_dispatch_stub_653), - TABLE_ENTRY(_dispatch_stub_654), - TABLE_ENTRY(_dispatch_stub_655), - TABLE_ENTRY(_dispatch_stub_656), - TABLE_ENTRY(AreProgramsResidentNV), - TABLE_ENTRY(BindProgramNV), - TABLE_ENTRY(DeleteProgramsNV), - TABLE_ENTRY(ExecuteProgramNV), - TABLE_ENTRY(GenProgramsNV), - TABLE_ENTRY(GetProgramParameterdvNV), - TABLE_ENTRY(GetProgramParameterfvNV), - TABLE_ENTRY(GetProgramStringNV), - TABLE_ENTRY(GetProgramivNV), - TABLE_ENTRY(GetTrackMatrixivNV), - TABLE_ENTRY(GetVertexAttribPointervNV), - TABLE_ENTRY(GetVertexAttribdvNV), - TABLE_ENTRY(GetVertexAttribfvNV), - TABLE_ENTRY(GetVertexAttribivNV), - TABLE_ENTRY(IsProgramNV), - TABLE_ENTRY(LoadProgramNV), - TABLE_ENTRY(ProgramParameters4dvNV), - TABLE_ENTRY(ProgramParameters4fvNV), - TABLE_ENTRY(RequestResidentProgramsNV), - TABLE_ENTRY(TrackMatrixNV), - TABLE_ENTRY(VertexAttrib1dNV), - TABLE_ENTRY(VertexAttrib1dvNV), - TABLE_ENTRY(VertexAttrib1fNV), - TABLE_ENTRY(VertexAttrib1fvNV), - TABLE_ENTRY(VertexAttrib1sNV), - TABLE_ENTRY(VertexAttrib1svNV), - TABLE_ENTRY(VertexAttrib2dNV), - TABLE_ENTRY(VertexAttrib2dvNV), - TABLE_ENTRY(VertexAttrib2fNV), - TABLE_ENTRY(VertexAttrib2fvNV), - TABLE_ENTRY(VertexAttrib2sNV), - TABLE_ENTRY(VertexAttrib2svNV), - TABLE_ENTRY(VertexAttrib3dNV), - TABLE_ENTRY(VertexAttrib3dvNV), - TABLE_ENTRY(VertexAttrib3fNV), - TABLE_ENTRY(VertexAttrib3fvNV), - TABLE_ENTRY(VertexAttrib3sNV), - TABLE_ENTRY(VertexAttrib3svNV), - TABLE_ENTRY(VertexAttrib4dNV), - TABLE_ENTRY(VertexAttrib4dvNV), - TABLE_ENTRY(VertexAttrib4fNV), - TABLE_ENTRY(VertexAttrib4fvNV), - TABLE_ENTRY(VertexAttrib4sNV), - TABLE_ENTRY(VertexAttrib4svNV), - TABLE_ENTRY(VertexAttrib4ubNV), - TABLE_ENTRY(VertexAttrib4ubvNV), - TABLE_ENTRY(VertexAttribPointerNV), - TABLE_ENTRY(VertexAttribs1dvNV), - TABLE_ENTRY(VertexAttribs1fvNV), - TABLE_ENTRY(VertexAttribs1svNV), - TABLE_ENTRY(VertexAttribs2dvNV), - TABLE_ENTRY(VertexAttribs2fvNV), - TABLE_ENTRY(VertexAttribs2svNV), - TABLE_ENTRY(VertexAttribs3dvNV), - TABLE_ENTRY(VertexAttribs3fvNV), - TABLE_ENTRY(VertexAttribs3svNV), - TABLE_ENTRY(VertexAttribs4dvNV), - TABLE_ENTRY(VertexAttribs4fvNV), - TABLE_ENTRY(VertexAttribs4svNV), - TABLE_ENTRY(VertexAttribs4ubvNV), - TABLE_ENTRY(AlphaFragmentOp1ATI), - TABLE_ENTRY(AlphaFragmentOp2ATI), - TABLE_ENTRY(AlphaFragmentOp3ATI), - TABLE_ENTRY(BeginFragmentShaderATI), - TABLE_ENTRY(BindFragmentShaderATI), - TABLE_ENTRY(ColorFragmentOp1ATI), - TABLE_ENTRY(ColorFragmentOp2ATI), - TABLE_ENTRY(ColorFragmentOp3ATI), - TABLE_ENTRY(DeleteFragmentShaderATI), - TABLE_ENTRY(EndFragmentShaderATI), - TABLE_ENTRY(GenFragmentShadersATI), - TABLE_ENTRY(PassTexCoordATI), - TABLE_ENTRY(SampleMapATI), - TABLE_ENTRY(SetFragmentShaderConstantATI), - TABLE_ENTRY(PointParameteriNV), - TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_733), - TABLE_ENTRY(_dispatch_stub_734), - TABLE_ENTRY(_dispatch_stub_735), - TABLE_ENTRY(_dispatch_stub_736), - TABLE_ENTRY(_dispatch_stub_737), - TABLE_ENTRY(GetProgramNamedParameterdvNV), - TABLE_ENTRY(GetProgramNamedParameterfvNV), - TABLE_ENTRY(ProgramNamedParameter4dNV), - TABLE_ENTRY(ProgramNamedParameter4dvNV), - TABLE_ENTRY(ProgramNamedParameter4fNV), - TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_744), - TABLE_ENTRY(_dispatch_stub_745), - TABLE_ENTRY(BindFramebufferEXT), - TABLE_ENTRY(BindRenderbufferEXT), - TABLE_ENTRY(CheckFramebufferStatusEXT), - TABLE_ENTRY(DeleteFramebuffersEXT), - TABLE_ENTRY(DeleteRenderbuffersEXT), - TABLE_ENTRY(FramebufferRenderbufferEXT), - TABLE_ENTRY(FramebufferTexture1DEXT), - TABLE_ENTRY(FramebufferTexture2DEXT), - TABLE_ENTRY(FramebufferTexture3DEXT), - TABLE_ENTRY(GenFramebuffersEXT), - TABLE_ENTRY(GenRenderbuffersEXT), - TABLE_ENTRY(GenerateMipmapEXT), - TABLE_ENTRY(GetFramebufferAttachmentParameterivEXT), - TABLE_ENTRY(GetRenderbufferParameterivEXT), - TABLE_ENTRY(IsFramebufferEXT), - TABLE_ENTRY(IsRenderbufferEXT), - TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_763), - TABLE_ENTRY(FramebufferTextureLayerEXT), - TABLE_ENTRY(_dispatch_stub_765), - TABLE_ENTRY(_dispatch_stub_766), - TABLE_ENTRY(_dispatch_stub_767), - TABLE_ENTRY(_dispatch_stub_768), - TABLE_ENTRY(_dispatch_stub_769), - /* A whole bunch of no-op functions. These might be called - * when someone tries to call a dynamically-registered - * extension function without a current rendering context. - */ - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), - TABLE_ENTRY(Unused), -}; -#endif /* DISPATCH_TABLE_NAME */ - - -/* - * This is just used to silence compiler warnings. - * We list the functions which are not otherwise used. - */ -#ifdef UNUSED_TABLE_NAME -static _glapi_proc UNUSED_TABLE_NAME[] = { - TABLE_ENTRY(ArrayElementEXT), - TABLE_ENTRY(BindTextureEXT), - TABLE_ENTRY(DrawArraysEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(AreTexturesResidentEXT), -#endif - TABLE_ENTRY(CopyTexImage1DEXT), - TABLE_ENTRY(CopyTexImage2DEXT), - TABLE_ENTRY(CopyTexSubImage1DEXT), - TABLE_ENTRY(CopyTexSubImage2DEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(DeleteTexturesEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GenTexturesEXT), -#endif - TABLE_ENTRY(GetPointervEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(IsTextureEXT), -#endif - TABLE_ENTRY(PrioritizeTexturesEXT), - TABLE_ENTRY(TexSubImage1DEXT), - TABLE_ENTRY(TexSubImage2DEXT), - TABLE_ENTRY(BlendColorEXT), - TABLE_ENTRY(BlendEquationEXT), - TABLE_ENTRY(DrawRangeElementsEXT), - TABLE_ENTRY(ColorTableEXT), -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterfvEXT), -#endif -#ifndef GLX_INDIRECT_RENDERING - TABLE_ENTRY(GetColorTableParameterivEXT), -#endif - TABLE_ENTRY(TexImage3DEXT), - TABLE_ENTRY(TexSubImage3DEXT), - TABLE_ENTRY(CopyTexSubImage3DEXT), - TABLE_ENTRY(ActiveTexture), - TABLE_ENTRY(ClientActiveTexture), - TABLE_ENTRY(MultiTexCoord1d), - TABLE_ENTRY(MultiTexCoord1dv), - TABLE_ENTRY(MultiTexCoord1f), - TABLE_ENTRY(MultiTexCoord1fv), - TABLE_ENTRY(MultiTexCoord1i), - TABLE_ENTRY(MultiTexCoord1iv), - TABLE_ENTRY(MultiTexCoord1s), - TABLE_ENTRY(MultiTexCoord1sv), - TABLE_ENTRY(MultiTexCoord2d), - TABLE_ENTRY(MultiTexCoord2dv), - TABLE_ENTRY(MultiTexCoord2f), - TABLE_ENTRY(MultiTexCoord2fv), - TABLE_ENTRY(MultiTexCoord2i), - TABLE_ENTRY(MultiTexCoord2iv), - TABLE_ENTRY(MultiTexCoord2s), - TABLE_ENTRY(MultiTexCoord2sv), - TABLE_ENTRY(MultiTexCoord3d), - TABLE_ENTRY(MultiTexCoord3dv), - TABLE_ENTRY(MultiTexCoord3f), - TABLE_ENTRY(MultiTexCoord3fv), - TABLE_ENTRY(MultiTexCoord3i), - TABLE_ENTRY(MultiTexCoord3iv), - TABLE_ENTRY(MultiTexCoord3s), - TABLE_ENTRY(MultiTexCoord3sv), - TABLE_ENTRY(MultiTexCoord4d), - TABLE_ENTRY(MultiTexCoord4dv), - TABLE_ENTRY(MultiTexCoord4f), - TABLE_ENTRY(MultiTexCoord4fv), - TABLE_ENTRY(MultiTexCoord4i), - TABLE_ENTRY(MultiTexCoord4iv), - TABLE_ENTRY(MultiTexCoord4s), - TABLE_ENTRY(MultiTexCoord4sv), - TABLE_ENTRY(LoadTransposeMatrixd), - TABLE_ENTRY(LoadTransposeMatrixf), - TABLE_ENTRY(MultTransposeMatrixd), - TABLE_ENTRY(MultTransposeMatrixf), - TABLE_ENTRY(SampleCoverage), - TABLE_ENTRY(CompressedTexImage1D), - TABLE_ENTRY(CompressedTexImage2D), - TABLE_ENTRY(CompressedTexImage3D), - TABLE_ENTRY(CompressedTexSubImage1D), - TABLE_ENTRY(CompressedTexSubImage2D), - TABLE_ENTRY(CompressedTexSubImage3D), - TABLE_ENTRY(GetCompressedTexImage), - TABLE_ENTRY(DisableVertexAttribArray), - TABLE_ENTRY(EnableVertexAttribArray), - TABLE_ENTRY(GetVertexAttribdv), - TABLE_ENTRY(GetVertexAttribfv), - TABLE_ENTRY(GetVertexAttribiv), - TABLE_ENTRY(ProgramParameter4dNV), - TABLE_ENTRY(ProgramParameter4dvNV), - TABLE_ENTRY(ProgramParameter4fNV), - TABLE_ENTRY(ProgramParameter4fvNV), - TABLE_ENTRY(VertexAttrib1d), - TABLE_ENTRY(VertexAttrib1dv), - TABLE_ENTRY(VertexAttrib1f), - TABLE_ENTRY(VertexAttrib1fv), - TABLE_ENTRY(VertexAttrib1s), - TABLE_ENTRY(VertexAttrib1sv), - TABLE_ENTRY(VertexAttrib2d), - TABLE_ENTRY(VertexAttrib2dv), - TABLE_ENTRY(VertexAttrib2f), - TABLE_ENTRY(VertexAttrib2fv), - TABLE_ENTRY(VertexAttrib2s), - TABLE_ENTRY(VertexAttrib2sv), - TABLE_ENTRY(VertexAttrib3d), - TABLE_ENTRY(VertexAttrib3dv), - TABLE_ENTRY(VertexAttrib3f), - TABLE_ENTRY(VertexAttrib3fv), - TABLE_ENTRY(VertexAttrib3s), - TABLE_ENTRY(VertexAttrib3sv), - TABLE_ENTRY(VertexAttrib4Nbv), - TABLE_ENTRY(VertexAttrib4Niv), - TABLE_ENTRY(VertexAttrib4Nsv), - TABLE_ENTRY(VertexAttrib4Nub), - TABLE_ENTRY(VertexAttrib4Nubv), - TABLE_ENTRY(VertexAttrib4Nuiv), - TABLE_ENTRY(VertexAttrib4Nusv), - TABLE_ENTRY(VertexAttrib4bv), - TABLE_ENTRY(VertexAttrib4d), - TABLE_ENTRY(VertexAttrib4dv), - TABLE_ENTRY(VertexAttrib4f), - TABLE_ENTRY(VertexAttrib4fv), - TABLE_ENTRY(VertexAttrib4iv), - TABLE_ENTRY(VertexAttrib4s), - TABLE_ENTRY(VertexAttrib4sv), - TABLE_ENTRY(VertexAttrib4ubv), - TABLE_ENTRY(VertexAttrib4uiv), - TABLE_ENTRY(VertexAttrib4usv), - TABLE_ENTRY(VertexAttribPointer), - TABLE_ENTRY(BindBuffer), - TABLE_ENTRY(BufferData), - TABLE_ENTRY(BufferSubData), - TABLE_ENTRY(DeleteBuffers), - TABLE_ENTRY(GenBuffers), - TABLE_ENTRY(GetBufferParameteriv), - TABLE_ENTRY(GetBufferPointerv), - TABLE_ENTRY(GetBufferSubData), - TABLE_ENTRY(IsBuffer), - TABLE_ENTRY(MapBuffer), - TABLE_ENTRY(UnmapBuffer), - TABLE_ENTRY(BeginQuery), - TABLE_ENTRY(DeleteQueries), - TABLE_ENTRY(EndQuery), - TABLE_ENTRY(GenQueries), - TABLE_ENTRY(GetQueryObjectiv), - TABLE_ENTRY(GetQueryObjectuiv), - TABLE_ENTRY(GetQueryiv), - TABLE_ENTRY(IsQuery), - TABLE_ENTRY(CompileShader), - TABLE_ENTRY(GetActiveUniform), - TABLE_ENTRY(GetShaderSource), - TABLE_ENTRY(GetUniformLocation), - TABLE_ENTRY(GetUniformfv), - TABLE_ENTRY(GetUniformiv), - TABLE_ENTRY(LinkProgram), - TABLE_ENTRY(ShaderSource), - TABLE_ENTRY(Uniform1f), - TABLE_ENTRY(Uniform1fv), - TABLE_ENTRY(Uniform1i), - TABLE_ENTRY(Uniform1iv), - TABLE_ENTRY(Uniform2f), - TABLE_ENTRY(Uniform2fv), - TABLE_ENTRY(Uniform2i), - TABLE_ENTRY(Uniform2iv), - TABLE_ENTRY(Uniform3f), - TABLE_ENTRY(Uniform3fv), - TABLE_ENTRY(Uniform3i), - TABLE_ENTRY(Uniform3iv), - TABLE_ENTRY(Uniform4f), - TABLE_ENTRY(Uniform4fv), - TABLE_ENTRY(Uniform4i), - TABLE_ENTRY(Uniform4iv), - TABLE_ENTRY(UniformMatrix2fv), - TABLE_ENTRY(UniformMatrix3fv), - TABLE_ENTRY(UniformMatrix4fv), - TABLE_ENTRY(UseProgram), - TABLE_ENTRY(ValidateProgram), - TABLE_ENTRY(BindAttribLocation), - TABLE_ENTRY(GetActiveAttrib), - TABLE_ENTRY(GetAttribLocation), - TABLE_ENTRY(DrawBuffers), - TABLE_ENTRY(DrawBuffersATI), - TABLE_ENTRY(PointParameterf), - TABLE_ENTRY(PointParameterfARB), - TABLE_ENTRY(PointParameterfv), - TABLE_ENTRY(PointParameterfvARB), - TABLE_ENTRY(SecondaryColor3b), - TABLE_ENTRY(SecondaryColor3bv), - TABLE_ENTRY(SecondaryColor3d), - TABLE_ENTRY(SecondaryColor3dv), - TABLE_ENTRY(SecondaryColor3f), - TABLE_ENTRY(SecondaryColor3fv), - TABLE_ENTRY(SecondaryColor3i), - TABLE_ENTRY(SecondaryColor3iv), - TABLE_ENTRY(SecondaryColor3s), - TABLE_ENTRY(SecondaryColor3sv), - TABLE_ENTRY(SecondaryColor3ub), - TABLE_ENTRY(SecondaryColor3ubv), - TABLE_ENTRY(SecondaryColor3ui), - TABLE_ENTRY(SecondaryColor3uiv), - TABLE_ENTRY(SecondaryColor3us), - TABLE_ENTRY(SecondaryColor3usv), - TABLE_ENTRY(SecondaryColorPointer), - TABLE_ENTRY(MultiDrawArrays), - TABLE_ENTRY(MultiDrawElements), - TABLE_ENTRY(FogCoordPointer), - TABLE_ENTRY(FogCoordd), - TABLE_ENTRY(FogCoorddv), - TABLE_ENTRY(FogCoordf), - TABLE_ENTRY(FogCoordfv), - TABLE_ENTRY(BlendFuncSeparate), - TABLE_ENTRY(WindowPos2d), - TABLE_ENTRY(WindowPos2dARB), - TABLE_ENTRY(WindowPos2dv), - TABLE_ENTRY(WindowPos2dvARB), - TABLE_ENTRY(WindowPos2f), - TABLE_ENTRY(WindowPos2fARB), - TABLE_ENTRY(WindowPos2fv), - TABLE_ENTRY(WindowPos2fvARB), - TABLE_ENTRY(WindowPos2i), - TABLE_ENTRY(WindowPos2iARB), - TABLE_ENTRY(WindowPos2iv), - TABLE_ENTRY(WindowPos2ivARB), - TABLE_ENTRY(WindowPos2s), - TABLE_ENTRY(WindowPos2sARB), - TABLE_ENTRY(WindowPos2sv), - TABLE_ENTRY(WindowPos2svARB), - TABLE_ENTRY(WindowPos3d), - TABLE_ENTRY(WindowPos3dARB), - TABLE_ENTRY(WindowPos3dv), - TABLE_ENTRY(WindowPos3dvARB), - TABLE_ENTRY(WindowPos3f), - TABLE_ENTRY(WindowPos3fARB), - TABLE_ENTRY(WindowPos3fv), - TABLE_ENTRY(WindowPos3fvARB), - TABLE_ENTRY(WindowPos3i), - TABLE_ENTRY(WindowPos3iARB), - TABLE_ENTRY(WindowPos3iv), - TABLE_ENTRY(WindowPos3ivARB), - TABLE_ENTRY(WindowPos3s), - TABLE_ENTRY(WindowPos3sARB), - TABLE_ENTRY(WindowPos3sv), - TABLE_ENTRY(WindowPos3svARB), - TABLE_ENTRY(BindProgramARB), - TABLE_ENTRY(DeleteProgramsARB), - TABLE_ENTRY(GenProgramsARB), - TABLE_ENTRY(GetVertexAttribPointerv), - TABLE_ENTRY(GetVertexAttribPointervARB), - TABLE_ENTRY(IsProgramARB), - TABLE_ENTRY(PointParameteri), - TABLE_ENTRY(PointParameteriv), - TABLE_ENTRY(BlendEquationSeparate), -}; -#endif /*UNUSED_TABLE_NAME*/ - - -# undef KEYWORD1 -# undef KEYWORD1_ALT -# undef KEYWORD2 -# undef NAME -# undef DISPATCH -# undef RETURN_DISPATCH -# undef DISPATCH_TABLE_NAME -# undef UNUSED_TABLE_NAME -# undef TABLE_ENTRY -# undef HIDDEN diff --git a/glx/glthread.c b/glx/glthread.c index 8b9f61885..5da7e433c 100644 --- a/glx/glthread.c +++ b/glx/glthread.c @@ -114,76 +114,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) #endif /* PTHREADS */ - - -/* - * Solaris/Unix International Threads -- Use only if POSIX threads - * aren't available on your Unix platform. Solaris 2.[34] are examples - * of platforms where this is the case. Be sure to use -mt and/or - * -D_REENTRANT when compiling. - */ -#ifdef SOLARIS_THREADS -#define USE_LOCK_FOR_KEY /* undef this to try a version without - lock for the global key... */ - -_X_EXPORT unsigned long -_glthread_GetID(void) -{ - OsAbort(); /* XXX not implemented yet */ - return (unsigned long) 0; -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 || - (errno = thr_keycreate(&(tsd->key), free)) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void* ret; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } -#ifdef USE_LOCK_FOR_KEY - mutex_lock(&tsd->keylock); - thr_getspecific(tsd->key, &ret); - mutex_unlock(&tsd->keylock); -#else - if ((errno = thr_getspecific(tsd->key, &ret)) != 0) { - perror(GET_TSD_ERROR); - exit(-1); - } -#endif - return ret; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if ((errno = thr_setspecific(tsd->key, ptr)) != 0) { - perror(SET_TSD_ERROR); - exit(-1); - } -} - -#undef USE_LOCK_FOR_KEY -#endif /* SOLARIS_THREADS */ - - - /* * Win32 Threads. The only available option for Windows 95/NT. * Be sure that you compile using the Multithreaded runtime, otherwise @@ -249,100 +179,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) #endif /* WIN32_THREADS */ - - -/* - * XFree86 has its own thread wrapper, Xthreads.h - * We wrap it again for GL. - */ -#ifdef USE_XTHREADS - -_X_EXPORT unsigned long -_glthread_GetID(void) -{ - return (unsigned long) xthread_self(); -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - if (xthread_key_create(&tsd->key, NULL) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void *ptr; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - xthread_get_specific(tsd->key, &ptr); - return ptr; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - xthread_set_specific(tsd->key, ptr); -} - -#endif /* XTHREAD */ - - - -/* - * BeOS threads - */ -#ifdef BEOS_THREADS - -unsigned long -_glthread_GetID(void) -{ - return (unsigned long) find_thread(NULL); -} - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - tsd->key = tls_allocate(); - tsd->initMagic = INIT_MAGIC; -} - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - return tls_get(tsd->key); -} - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != (int) INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - tls_set(tsd->key, ptr); -} - -#endif /* BEOS_THREADS */ - - - #else /* THREADS */ - /* * no-op functions */ diff --git a/glx/glthread.h b/glx/glthread.h index e2765cebb..532401a73 100644 --- a/glx/glthread.h +++ b/glx/glthread.h @@ -68,10 +68,7 @@ #define _glapi_Dispatch _mglapi_Dispatch #endif - - -#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\ - defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \ +#if (defined(PTHREADS) || defined(WIN32_THREADS)) \ && !defined(THREADS) # define THREADS #endif @@ -127,27 +124,6 @@ typedef pthread_mutex_t _glthread_Mutex; * Be sure to compile with -mt on the Solaris compilers, or * use -D_REENTRANT if using gcc. */ -#ifdef SOLARIS_THREADS -#include - -typedef struct { - thread_key_t key; - mutex_t keylock; - int initMagic; -} _glthread_TSD; - -typedef thread_t _glthread_Thread; - -typedef mutex_t _glthread_Mutex; - -/* XXX need to really implement mutex-related macros */ -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 -#define _glthread_INIT_MUTEX(name) (void) name -#define _glthread_DESTROY_MUTEX(name) (void) name -#define _glthread_LOCK_MUTEX(name) (void) name -#define _glthread_UNLOCK_MUTEX(name) (void) name - -#endif /* SOLARIS_THREADS */ @@ -177,49 +153,6 @@ typedef CRITICAL_SECTION _glthread_Mutex; #endif /* WIN32_THREADS */ - - - -/* - * XFree86 has its own thread wrapper, Xthreads.h - * We wrap it again for GL. - */ -#ifdef USE_XTHREADS -#include - -typedef struct { - xthread_key_t key; - int initMagic; -} _glthread_TSD; - -typedef xthread_t _glthread_Thread; - -typedef xmutex_rec _glthread_Mutex; - -#ifdef XMUTEX_INITIALIZER -#define _glthread_DECLARE_STATIC_MUTEX(name) \ - static _glthread_Mutex name = XMUTEX_INITIALIZER -#else -#define _glthread_DECLARE_STATIC_MUTEX(name) \ - static _glthread_Mutex name -#endif - -#define _glthread_INIT_MUTEX(name) \ - xmutex_init(&(name)) - -#define _glthread_DESTROY_MUTEX(name) \ - xmutex_clear(&(name)) - -#define _glthread_LOCK_MUTEX(name) \ - (void) xmutex_lock(&(name)) - -#define _glthread_UNLOCK_MUTEX(name) \ - (void) xmutex_unlock(&(name)) - -#endif /* USE_XTHREADS */ - - - /* * BeOS threads. R5.x required. */ @@ -300,8 +233,7 @@ _glthread_SetTSD(_glthread_TSD *, void *); #if defined(GLX_USE_TLS) -extern __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))); +extern TLS struct _glapi_table * _glapi_tls_Dispatch; #define GET_DISPATCH() _glapi_tls_Dispatch diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 8d13c1509..d5b764fd0 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -38,7 +38,6 @@ #include "glxserver.h" #include #include -#include "g_disptab.h" #include #include #include "glxutil.h" @@ -57,7 +56,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) /* ** Check if screen exists. */ - if (screen >= screenInfo.numScreens) { + if (screen < 0 || screen >= screenInfo.numScreens) { client->errorValue = screen; *err = BadValue; return FALSE; @@ -137,9 +136,9 @@ validGlxContext(ClientPtr client, XID id, int access_mode, { *err = dixLookupResourceByType((pointer *) context, id, __glXContextRes, client, access_mode); - if (*err != Success) { + if (*err != Success || (*context)->idExists == GL_FALSE) { client->errorValue = id; - if (*err == BadValue) + if (*err == BadValue || *err == Success) *err = __glXError(GLXBadContext); return FALSE; } @@ -315,11 +314,14 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId, int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_SIZE_MATCH(xGLXCreateContextReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) @@ -331,11 +333,14 @@ int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc) int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) @@ -347,12 +352,15 @@ int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc) int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) @@ -361,87 +369,45 @@ int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) return DoCreateContext(cl, req->context, req->shareList, config, pGlxScreen, req->isDirect); } + int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLXcontext *glxc; int err; + REQUEST_SIZE_MATCH(xGLXDestroyContextReq); + if (!validGlxContext(cl->client, req->context, DixDestroyAccess, &glxc, &err)) return err; - FreeResourceByType(req->context, __glXContextRes, FALSE); - return Success; -} - -/*****************************************************************************/ - -/* -** For each client, the server keeps a table of all the contexts that are -** current for that client (each thread of a client may have its own current -** context). These routines add, change, and lookup contexts in the table. -*/ - -/* -** Add a current context, and return the tag that will be used to refer to it. -*/ -static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) -{ - int i; - int num = cl->numCurrentContexts; - __GLXcontext **table = cl->currentContexts; + glxc->idExists = GL_FALSE; + if (!glxc->isCurrent) + FreeResourceByType(req->context, __glXContextRes, FALSE); - if (!glxc) return -1; - - /* - ** Try to find an empty slot and use it. - */ - for (i=0; i < num; i++) { - if (!table[i]) { - table[i] = glxc; - return i+1; - } - } - /* - ** Didn't find a free slot, so we'll have to grow the table. - */ - if (!num) { - table = (__GLXcontext **) malloc(sizeof(__GLXcontext *)); - } else { - table = (__GLXcontext **) realloc(table, - (num+1)*sizeof(__GLXcontext *)); - } - table[num] = glxc; - cl->currentContexts = table; - cl->numCurrentContexts++; - return num+1; -} - -/* -** Given a tag, change the current context for the corresponding entry. -*/ -static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, - GLXContextTag tag) -{ - __GLXcontext **table = cl->currentContexts; - table[tag-1] = glxc; + return Success; } /* -** For this implementation we have chosen to simply use the index of the -** context's entry in the table as the context tag. A tag must be greater -** than 0. -*/ + * This will return "deleted" contexts, ie, where idExists is GL_FALSE. + * Contrast validGlxContext, which will not. We're cheating here and + * using the XID as the context tag, which is fine as long as we defer + * actually destroying the context until it's no longer referenced, and + * block clients from trying to MakeCurrent on contexts that are on the + * way to destruction. Notice that DoMakeCurrent calls validGlxContext + * for new contexts but __glXLookupContextByTag for previous contexts. + */ __GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag) { - int num = cl->numCurrentContexts; + __GLXcontext *ret; - if (tag < 1 || tag > num) { - return 0; - } else { - return cl->currentContexts[tag-1]; - } + if (dixLookupResourceByType((void **)&ret, tag, __glXContextRes, + cl->client, DixUseAccess) == Success) + return ret; + + return NULL; } /*****************************************************************************/ @@ -455,7 +421,7 @@ static void StopUsingContext(__GLXcontext *glxc) } glxc->isCurrent = GL_FALSE; if (!glxc->idExists) { - __glXFreeContext(glxc); + FreeResourceByType(glxc->id, __glXContextRes, FALSE); } } } @@ -620,10 +586,10 @@ DoMakeCurrent(__GLXclientState *cl, /* ** Flush the previous context if needed. */ - if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) { + if (prevglxc->hasUnflushedCommands) { if (__glXForceCurrent(cl, tag, (int *)&error)) { CALL_Flush( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(prevglxc); + prevglxc->hasUnflushedCommands = GL_FALSE; } else { return error; } @@ -658,16 +624,11 @@ DoMakeCurrent(__GLXclientState *cl, glxc->isCurrent = GL_TRUE; } - if (prevglxc) { - ChangeCurrentContext(cl, glxc, tag); - StopUsingContext(prevglxc); - } else { - tag = AddCurrentContext(cl, glxc); - } + StopUsingContext(prevglxc); if (glxc) { StartUsingContext(cl, glxc); - reply.contextTag = tag; + reply.contextTag = glxc->id; } else { reply.contextTag = 0; } @@ -686,24 +647,33 @@ DoMakeCurrent(__GLXclientState *cl, int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; + REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); + return DoMakeCurrent( cl, req->drawable, req->drawable, req->context, req->oldContextTag ); } int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; + REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); + return DoMakeCurrent( cl, req->drawable, req->readdrawable, req->context, req->oldContextTag ); } int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; + REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); + return DoMakeCurrent( cl, req->drawable, req->readable, req->context, req->oldContextTag ); } @@ -716,6 +686,8 @@ int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc) __GLXcontext *glxc; int err; + REQUEST_SIZE_MATCH(xGLXIsDirectReq); + if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) return err; @@ -740,6 +712,8 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc) xGLXQueryVersionReply reply; GLuint major, minor; + REQUEST_SIZE_MATCH(xGLXQueryVersionReq); + major = req->majorVersion; minor = req->minorVersion; (void)major; @@ -766,11 +740,15 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc) int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc; - GLXContextTag tag = req->contextTag; + GLXContextTag tag; __GLXcontext *glxc = NULL; int error; + REQUEST_SIZE_MATCH(xGLXWaitGLReq); + + tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) @@ -790,11 +768,15 @@ int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc) int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *)pc; - GLXContextTag tag = req->contextTag; + GLXContextTag tag; __GLXcontext *glxc = NULL; int error; + REQUEST_SIZE_MATCH(xGLXWaitXReq); + + tag = req->contextTag; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) @@ -814,13 +796,19 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc) { ClientPtr client = cl->client; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; - GLXContextID source = req->source; - GLXContextID dest = req->dest; - GLXContextTag tag = req->contextTag; - unsigned long mask = req->mask; + GLXContextID source; + GLXContextID dest; + GLXContextTag tag; + unsigned long mask; __GLXcontext *src, *dst; int error; + REQUEST_SIZE_MATCH(xGLXCopyContextReq); + + source = req->source; + dest = req->dest; + tag = req->contextTag; + mask = req->mask; if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error)) return error; if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error)) @@ -867,7 +855,7 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc) ** in both streams are completed before the copy is executed. */ CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(tagcx); + tagcx->hasUnflushedCommands = GL_FALSE; } else { return error; } @@ -903,6 +891,8 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; @@ -1082,13 +1072,18 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen) int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; + REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); return DoGetFBConfigs(cl, req->screen); } int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; + /* work around mesa bug, don't use REQUEST_SIZE_MATCH */ + REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); return DoGetFBConfigs(cl, req->screen); } @@ -1132,10 +1127,11 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, return BadAlloc; } - /* Add the glx drawable under the XID of the underlying X drawable - * too. That way we'll get a callback in DrawableGone and can - * clean up properly when the drawable is destroyed. */ - if (drawableId != glxDrawableId && + /* + * Windows aren't refcounted, so track both the X and the GLX window + * so we get called regardless of destruction order. + */ + if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW && !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) { pGlxDraw->destroy (pGlxDraw); return BadAlloc; @@ -1166,6 +1162,8 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId, glxDrawableId, GLX_DRAWABLE_PIXMAP); + ((PixmapPtr)pDraw)->refcnt++; + return err; } @@ -1214,11 +1212,14 @@ determineTextureTarget(ClientPtr client, XID glxDrawableID, int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) @@ -1230,11 +1231,19 @@ int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) @@ -1253,12 +1262,15 @@ int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc) int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPixmapWithConfigSGIXReq *req = (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; __GLXconfig *config; __GLXscreen *pGlxScreen; int err; + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) @@ -1285,15 +1297,23 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type) int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; + REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); + return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); } int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc; + /* should be REQUEST_SIZE_MATCH, but mesa's glXDestroyPixmap used to set + * length to 3 instead of 2 */ + REQUEST_AT_LEAST_SIZE(xGLXDestroyPixmapReq); + return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); } @@ -1332,10 +1352,18 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; CARD32 *attrs; int width, height, i; + REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); + attrs = (CARD32 *) (req + 1); width = 0; height = 0; @@ -1361,23 +1389,32 @@ int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; + REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); + return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, req->width, req->height, req->pbuffer); } int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; + REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); + return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); } int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; + REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); + return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); } @@ -1408,18 +1445,40 @@ DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable, int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *) pc; + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } +#if 0 + /* mesa sends an additional 8 bytes */ + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3); +#else + if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) + return BadLength; +#endif + return DoChangeDrawableAttributes(cl->client, req->drawable, req->numAttribs, (CARD32 *) (req + 1)); } int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXChangeDrawableAttributesSGIXReq *req = (xGLXChangeDrawableAttributesSGIXReq *)pc; + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); + return DoChangeDrawableAttributes(cl->client, req->drawable, req->numAttribs, (CARD32 *) (req + 1)); } @@ -1433,6 +1492,13 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) DrawablePtr pDraw; int err; + REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); + LEGAL_NEW_RESOURCE(req->glxwindow, client); if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) @@ -1456,8 +1522,12 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; + /* mesa's glXDestroyWindow used to set length to 3 instead of 2 */ + REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); + return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW); } @@ -1473,12 +1543,16 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc) { ClientPtr client = cl->client; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; - GLXContextTag tag = req->contextTag; - XID drawId = req->drawable; + GLXContextTag tag; + XID drawId; __GLXcontext *glxc = NULL; __GLXdrawable *pGlxDraw; int error; + REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); + + tag = req->contextTag; + drawId = req->drawable; if (tag) { glxc = __glXLookupContextByTag(cl, tag); if (!glxc) { @@ -1495,7 +1569,7 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc) ** in both streams are completed before the swap is executed. */ CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(glxc); + glxc->hasUnflushedCommands = GL_FALSE; } else { return error; } @@ -1559,15 +1633,21 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId) int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; + REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); + return DoQueryContext(cl, req->context); } int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; + REQUEST_SIZE_MATCH(xGLXQueryContextReq); + return DoQueryContext(cl, req->context); } @@ -1580,11 +1660,21 @@ int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) GLXDrawable drawId; int buffer; int error; + CARD32 num_attribs; + + if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) + return BadLength; pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); buffer = *((INT32 *) (pc + 4)); + num_attribs = *((CARD32 *) (pc + 8)); + if (num_attribs > (UINT32_MAX >> 3)) { + client->errorValue = num_attribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 12 + (num_attribs << 3)); if (buffer != GLX_FRONT_LEFT_EXT) return __glXError(GLXBadPixmap); @@ -1615,6 +1705,8 @@ int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) int buffer; int error; + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); + pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); @@ -1650,6 +1742,8 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) (void) client; (void) req; + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); + pc += __GLX_VENDPRIV_HDR_SIZE; drawId = *((CARD32 *) (pc)); @@ -1674,7 +1768,7 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) ** in both streams are completed before the swap is executed. */ CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(glxc); + glxc->hasUnflushedCommands = GL_FALSE; } else { return error; } @@ -1738,16 +1832,23 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; + /* this should be REQUEST_SIZE_MATCH, but mesa sends an additional 4 bytes */ + REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); + return DoGetDrawableAttributes(cl, req->drawable); } int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetDrawableAttributesSGIXReq *req = (xGLXGetDrawableAttributesSGIXReq *)pc; + REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); + return DoGetDrawableAttributes(cl, req->drawable); } @@ -1772,6 +1873,8 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc) __GLXcontext *glxc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXRenderReq); + req = (xGLXRenderReq *) pc; if (client->swapped) { __GLX_SWAP_SHORT(&req->length); @@ -1792,6 +1895,9 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc) __GLXdispatchRenderProcPtr proc; int err; + if (left < sizeof(__GLXrenderHeader)) + return BadLength; + /* ** Verify that the header length and the overall length agree. ** Also, each command must be word aligned. @@ -1849,7 +1955,7 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc) left -= cmdlen; commandsDone++; } - __GLX_NOTE_UNFLUSHED_CMDS(glxc); + glxc->hasUnflushedCommands = GL_TRUE; return Success; } @@ -2046,7 +2152,7 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc) ** Skip over the header and execute the command. */ (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); - __GLX_NOTE_UNFLUSHED_CMDS(glxc); + glxc->hasUnflushedCommands = GL_TRUE; /* ** Reset for the next RenderLarge series. @@ -2061,238 +2167,6 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc) } } -extern RESTYPE __glXSwapBarrierRes; - -int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc; - XID drawable = req->drawable; - int barrier = req->barrier; - DrawablePtr pDraw; - int screen, rc; - __GLXscreen *pGlxScreen; - - rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess); - pGlxScreen = glxGetScreen(pDraw->pScreen); - if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) { - screen = pDraw->pScreen->myNum; - if (pGlxScreen->swapBarrierFuncs) { - int ret = pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, barrier); - if (ret == Success) { - if (barrier) - /* add source for cleanup when drawable is gone */ - AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen); - else - /* delete source */ - FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); - } - return ret; - } - } - client->errorValue = drawable; - return __glXError(GLXBadDrawable); -} - - -int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryMaxSwapBarriersSGIXReq *req = - (xGLXQueryMaxSwapBarriersSGIXReq *) pc; - xGLXQueryMaxSwapBarriersSGIXReply reply; - int screen = req->screen; - __GLXscreen *pGlxScreen; - - pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - if (pGlxScreen->swapBarrierFuncs) - reply.max = pGlxScreen->swapBarrierFuncs->queryMaxSwapBarriersFunc(screen); - else - reply.max = 0; - - - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - } - - WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, - (char *) &reply); - return Success; -} - -#define GLX_BAD_HYPERPIPE_SGIX 92 - -int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc; - xGLXQueryHyperpipeNetworkSGIXReply reply; - int screen = req->screen; - void *rdata = NULL; - - int length=0; - int npipes=0; - - int n= 0; - __GLXscreen *pGlxScreen; - - pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - if (pGlxScreen->hyperpipeFuncs) { - rdata = - (pGlxScreen->hyperpipeFuncs->queryHyperpipeNetworkFunc(screen, &npipes, &n)); - } - length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; - reply.npipes = npipes; - - if (client->swapped) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.n); - __GLX_SWAP_INT(&reply.npipes); - } - WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply, - (char *) &reply); - - WriteToClient(client, length << 2, (char *)rdata); - - return Success; -} - -int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyHyperpipeConfigSGIXReq * req = - (xGLXDestroyHyperpipeConfigSGIXReq *) pc; - xGLXDestroyHyperpipeConfigSGIXReply reply; - int screen = req->screen; - int success = GLX_BAD_HYPERPIPE_SGIX; - int hpId ; - __GLXscreen *pGlxScreen; - - hpId = req->hpId; - - pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - if (pGlxScreen->hyperpipeFuncs) { - success = pGlxScreen->hyperpipeFuncs->destroyHyperpipeConfigFunc(screen, hpId); - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = __GLX_PAD(0) >> 2; - reply.n = 0; - reply.success = success; - - - if (client->swapped) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - } - WriteToClient(client, - sz_xGLXDestroyHyperpipeConfigSGIXReply, - (char *) &reply); - return Success; -} - -int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryHyperpipeConfigSGIXReq * req = - (xGLXQueryHyperpipeConfigSGIXReq *) pc; - xGLXQueryHyperpipeConfigSGIXReply reply; - int screen = req->screen; - void *rdata = NULL; - int length; - int npipes=0; - int n= 0; - int hpId; - __GLXscreen *pGlxScreen; - - hpId = req->hpId; - - pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - if (pGlxScreen->hyperpipeFuncs) { - rdata = pGlxScreen->hyperpipeFuncs->queryHyperpipeConfigFunc(screen, hpId,&npipes, &n); - } - - length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; - reply.npipes = npipes; - - - if (client->swapped) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.n); - __GLX_SWAP_INT(&reply.npipes); - } - - WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply, - (char *) &reply); - - WriteToClient(client, length << 2, (char *)rdata); - - return Success; -} - -int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXHyperpipeConfigSGIXReq * req = - (xGLXHyperpipeConfigSGIXReq *) pc; - xGLXHyperpipeConfigSGIXReply reply; - int screen = req->screen; - void *rdata; - - int npipes=0, networkId; - int hpId=-1; - __GLXscreen *pGlxScreen; - - pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - networkId = (int)req->networkId; - npipes = (int)req->npipes; - rdata = (void *)(req +1); - - if (pGlxScreen->hyperpipeFuncs) { - pGlxScreen->hyperpipeFuncs->hyperpipeConfigFunc(screen,networkId, - &hpId, &npipes, - (void *) rdata); - } - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = __GLX_PAD(0) >> 2; - reply.n = 0; - reply.npipes = npipes; - reply.hpId = hpId; - - if (client->swapped) { - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.npipes); - __GLX_SWAP_INT(&reply.hpId); - } - - WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply, - (char *) &reply); - - return Success; -} - - /************************************************************************/ /* @@ -2302,10 +2176,12 @@ int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc) int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLint vendorcode = req->vendorCode; __GLXdispatchVendorPrivProcPtr proc; + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, @@ -2321,10 +2197,12 @@ int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc) int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLint vendorcode = req->vendorCode; __GLXdispatchVendorPrivProcPtr proc; + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); proc = (__GLXdispatchVendorPrivProcPtr) __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, @@ -2347,6 +2225,8 @@ int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) char *buf; int err; + REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); + if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; @@ -2386,6 +2266,8 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) int err; char ver_str[16]; + REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); + if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; @@ -2433,13 +2315,19 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc; const char *buf; + REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); + + buf = (const char *)(req+1); + if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq))) + return BadLength; + cl->GLClientmajorVersion = req->major; cl->GLClientminorVersion = req->minor; free(cl->GLClientextensions); - buf = (const char *)(req+1); cl->GLClientextensions = strdup(buf); return Success; diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c index c414dc8e2..76e6fb629 100644 --- a/glx/glxcmdsswap.c +++ b/glx/glxcmdsswap.c @@ -37,7 +37,6 @@ #include "glxutil.h" #include #include -#include "g_disptab.h" #include #include #include "glxext.h" @@ -61,9 +60,12 @@ int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCreateContextReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->visual); @@ -75,9 +77,12 @@ int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->fbconfig); @@ -90,10 +95,13 @@ int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->fbconfig); @@ -106,9 +114,12 @@ int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXDestroyContextReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); @@ -117,9 +128,12 @@ int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->context); @@ -130,9 +144,12 @@ int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->readdrawable); @@ -144,9 +161,12 @@ int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->readable); @@ -158,9 +178,12 @@ int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXIsDirectReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); @@ -169,9 +192,12 @@ int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXQueryVersionReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->majorVersion); __GLX_SWAP_INT(&req->minorVersion); @@ -181,9 +207,12 @@ int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXWaitGLReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -192,9 +221,12 @@ int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXWaitXReq *req = (xGLXWaitXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXWaitXReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -203,9 +235,12 @@ int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCopyContextReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->source); __GLX_SWAP_INT(&req->dest); @@ -216,36 +251,48 @@ int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); + __GLX_SWAP_INT(&req->screen); return __glXDisp_GetVisualConfigs(cl, pc); } int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); + __GLX_SWAP_INT(&req->screen); return __glXDisp_GetFBConfigs(cl, pc); } int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); + __GLX_SWAP_INT(&req->screen); return __glXDisp_GetFBConfigsSGIX(cl, pc); } int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->visual); @@ -257,29 +304,41 @@ int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; CARD32 *attribs; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pixmap); __GLX_SWAP_INT(&req->glxpixmap); __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreatePixmap(cl, pc); } int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPixmapWithConfigSGIXReq *req = (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); @@ -291,9 +350,12 @@ int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->glxpixmap); @@ -302,9 +364,12 @@ int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXDestroyGLXPixmapReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->glxpixmap); @@ -313,9 +378,12 @@ int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXQueryContextReq); + __GLX_SWAP_INT(&req->context); return __glXDisp_QueryContext(cl, pc); @@ -323,26 +391,38 @@ int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; + REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); + __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pbuffer); __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreatePbuffer(cl, pc); } int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); + __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->pbuffer); @@ -354,9 +434,12 @@ int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); + __GLX_SWAP_INT(&req->pbuffer); return __glXDisp_DestroyPbuffer(cl, pc); @@ -364,9 +447,12 @@ int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); + __GLX_SWAP_INT(&req->pbuffer); return __glXDisp_DestroyGLXPbufferSGIX(cl, pc); @@ -374,16 +460,27 @@ int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); + __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) + return BadLength; + attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_ChangeDrawableAttributes(cl, pc); } @@ -391,43 +488,64 @@ int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXChangeDrawableAttributesSGIXReq *req = (xGLXChangeDrawableAttributesSGIXReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); + __GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc); } int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_ARRAY_VARIABLES; CARD32 *attribs; + REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); + __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->window); __GLX_SWAP_INT(&req->glxwindow); __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); return __glXDisp_CreateWindow(cl, pc); } int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); + __GLX_SWAP_INT(&req->glxwindow); return __glXDisp_DestroyWindow(cl, pc); @@ -435,9 +553,12 @@ int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->drawable); @@ -447,9 +568,12 @@ int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXUseXFontReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->font); @@ -463,9 +587,12 @@ int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); @@ -474,9 +601,12 @@ int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->name); @@ -486,9 +616,12 @@ int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->major); __GLX_SWAP_INT(&req->minor); @@ -499,9 +632,12 @@ int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); @@ -510,33 +646,41 @@ int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; - + CARD32 *num_attribs; __GLX_DECLARE_SWAP_VARIABLES; + if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) + return BadLength; + pc += __GLX_VENDPRIV_HDR_SIZE; drawId = ((GLXDrawable *) (pc)); buffer = ((int *) (pc + 4)); + num_attribs = ((CARD32 *) (pc + 8)); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(drawId); __GLX_SWAP_INT(buffer); + __GLX_SWAP_INT(num_attribs); return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc); } int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; - __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); + pc += __GLX_VENDPRIV_HDR_SIZE; drawId = ((GLXDrawable *) (pc)); @@ -552,12 +696,14 @@ int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; GLXDrawable *drawId; int *buffer; - __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); + (void) drawId; (void) buffer; @@ -577,11 +723,13 @@ int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc; CARD32 *data; - __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); + data = (CARD32 *) (req + 1); __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->contextTag); @@ -592,10 +740,12 @@ int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) { + ClientPtr client = cl->client; xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; - __GLX_DECLARE_SWAP_VARIABLES; + REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); + __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->drawable); diff --git a/glx/glxcontext.h b/glx/glxcontext.h index 79bc083a8..65d51f507 100644 --- a/glx/glxcontext.h +++ b/glx/glxcontext.h @@ -53,8 +53,6 @@ struct __GLXcontext { int (*copy) (__GLXcontext *dst, __GLXcontext *src, unsigned long mask); - int (*forceCurrent) (__GLXcontext *context); - Bool (*wait) (__GLXcontext *context, __GLXclientState *cl, int *error); diff --git a/glx/glxdri.c b/glx/glxdri.c index 41482c913..244eac6c2 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -56,7 +56,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" @@ -336,19 +335,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, src->driContext, mask); } -static int -__glXDRIcontextForceCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; - __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->bindContext)(context->driContext, - draw->driDrawable, - read->driDrawable); -} - static void glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height) { @@ -642,7 +628,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; - context->base.forceCurrent = __glXDRIcontextForceCurrent; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; /* Find the requested X visual */ @@ -832,12 +817,19 @@ static void __glXReportDamage(__DRIdrawable *driDraw, __glXenterServer(GL_FALSE); - RegionInit(®ion, (BoxPtr) rects, num_rects); - RegionTranslate(®ion, pDraw->x, pDraw->y); - DamageRegionAppend(pDraw, ®ion); - /* This is wrong, this needs a seperate function. */ - DamageRegionProcessPending(pDraw); - RegionUninit(®ion); + if (RegionInitBoxes(®ion, (BoxPtr) rects, num_rects)) { + RegionTranslate(®ion, pDraw->x, pDraw->y); + DamageDamageRegion(pDraw, ®ion); + RegionUninit(®ion); + } + else { + while (num_rects--) { + RegionInit (®ion, (BoxPtr) rects++, 1); + RegionTranslate(®ion, pDraw->x, pDraw->y); + DamageDamageRegion(pDraw, ®ion); + RegionUninit(®ion); + } + } __glXleaveServer(GL_FALSE); } @@ -861,8 +853,6 @@ static const __DRIextension *loader_extensions[] = { -static const char dri_driver_path[] = DRI_DRIVER_PATH; - static Bool glxDRIEnterVT (int index, int flags) { @@ -974,13 +964,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen) drm_handle_t hFB; int junk; __GLXDRIscreen *screen; - char filename[128]; Bool isCapable; size_t buffer_size; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; const __DRIconfig **driConfigs; - const __DRIextension **extensions; - int i; if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") || !DRIQueryDirectRenderingCapable(pScreen, &isCapable) || @@ -1055,42 +1042,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen) goto handle_error; } - snprintf(filename, sizeof filename, "%s/%s_dri.so", - dri_driver_path, driverName); - - screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + screen->driver = glxProbeDriver(driverName, + (void **)&screen->core, + __DRI_CORE, __DRI_CORE_VERSION, + (void **)&screen->legacy, + __DRI_LEGACY, __DRI_LEGACY_VERSION); if (screen->driver == NULL) { - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", - filename, dlerror()); goto handle_error; } - - extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS); - if (extensions == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", - driverName, dlerror()); - goto handle_error; - } - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_CORE) == 0 && - extensions[i]->version >= __DRI_CORE_VERSION) { - screen->core = (__DRIcoreExtension *) extensions[i]; - } - - if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0 && - extensions[i]->version >= __DRI_LEGACY_VERSION) { - screen->legacy = (__DRIlegacyExtension *) extensions[i]; - } - } - - if (screen->core == NULL || screen->legacy == NULL) { - LogMessage(X_ERROR, - "AIGLX error: %s does not export required DRI extension\n", - driverName); - goto handle_error; - } - /* * Get device-specific info. pDevPriv will point to a struct * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that @@ -1160,9 +1120,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, @@ -1177,7 +1135,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) pScrn->LeaveVT = glxDRILeaveVT; LogMessage(X_INFO, - "AIGLX: Loaded and initialized %s\n", filename); + "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c2305ad90..d97971739 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -48,7 +48,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" @@ -185,6 +184,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, break; default: /* unknown swap completion type */ + wire.event_type = 0; break; } wire.drawable = drawable->drawId; @@ -284,19 +284,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, src->driContext, mask); } -static int -__glXDRIcontextForceCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; - __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->bindContext)(context->driContext, - draw->driDrawable, - read->driDrawable); -} - static Bool __glXDRIcontextWait(__GLXcontext *baseContext, __GLXclientState *cl, int *error) @@ -412,7 +399,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; - context->base.forceCurrent = __glXDRIcontextForceCurrent; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.wait = __glXDRIcontextWait; @@ -595,13 +581,11 @@ static const __DRIextension *loader_extensions[] = { &systemTimeExtension.base, &loaderExtension.base, #ifdef __DRI_USE_INVALIDATE - &dri2UseInvalidate, + &dri2UseInvalidate.base, #endif NULL }; -static const char dri_driver_path[] = DRI_DRIVER_PATH; - static Bool glxDRIEnterVT (int index, int flags) { @@ -703,12 +687,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; - char filename[128]; size_t buffer_size; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - const __DRIextension **extensions; const __DRIconfig **driConfigs; - int i; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -730,40 +711,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __glXInitExtensionEnableBits(screen->glx_enable_bits); - snprintf(filename, sizeof filename, - "%s/%s_dri.so", dri_driver_path, driverName); - - screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + screen->driver = glxProbeDriver(driverName, (void **)&screen->core, __DRI_CORE, 1, + (void **)&screen->dri2, __DRI_DRI2, 1); if (screen->driver == NULL) { - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", - filename, dlerror()); goto handle_error; } - - extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS); - if (extensions == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", - driverName, dlerror()); - goto handle_error; - } - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_CORE) == 0 && - extensions[i]->version >= 1) { - screen->core = (const __DRIcoreExtension *) extensions[i]; - } - if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 && - extensions[i]->version >= 1) { - screen->dri2 = (const __DRIdri2Extension *) extensions[i]; - } - } - - if (screen->core == NULL || screen->dri2 == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n", - driverName); - goto handle_error; - } - screen->driScreen = (*screen->dri2->createNewScreen)(pScreen->myNum, screen->fd, @@ -792,9 +745,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); (void) __glXGetExtensionString(screen->glx_enable_bits, @@ -819,7 +770,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) pScrn->LeaveVT = glxDRILeaveVT; LogMessage(X_INFO, - "AIGLX: Loaded and initialized %s\n", filename); + "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index 86797a0ef..9149e0db1 100644 --- a/glx/glxdricommon.c +++ b/glx/glxdricommon.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -204,3 +205,59 @@ glxConvertConfigs(const __DRIcoreExtension *core, return head.next; } + +static const char dri_driver_path[] = DRI_DRIVER_PATH; + +void * +glxProbeDriver(const char *driverName, + void **coreExt, const char *coreName, int coreVersion, + void **renderExt, const char *renderName, int renderVersion) +{ + int i; + void *driver; + char filename[PATH_MAX]; + const __DRIextension **extensions; + + snprintf(filename, sizeof filename, "%s/%s_dri.so", + dri_driver_path, driverName); + + driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + if (driver == NULL) { + LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", + filename, dlerror()); + goto cleanup_failure; + } + + extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); + if (extensions == NULL) { + LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", + driverName, dlerror()); + goto cleanup_failure; + } + + for (i = 0; extensions[i]; i++) { + if (strcmp(extensions[i]->name, coreName) == 0 && + extensions[i]->version >= coreVersion) { + *coreExt = (void *)extensions[i]; + } + + if (strcmp(extensions[i]->name, renderName) == 0 && + extensions[i]->version >= renderVersion) { + *renderExt = (void *)extensions[i]; + } + } + + if (*coreExt == NULL || *renderExt == NULL) { + LogMessage(X_ERROR, + "AIGLX error: %s does not export required DRI extension\n", + driverName); + goto cleanup_failure; + } + return driver; + +cleanup_failure: + if (driver) + dlclose(driver); + *coreExt = *renderExt = NULL; + return NULL; +} diff --git a/glx/glxdricommon.h b/glx/glxdricommon.h index 41e2d2770..2c55e60a6 100644 --- a/glx/glxdricommon.h +++ b/glx/glxdricommon.h @@ -38,4 +38,9 @@ glxConvertConfigs(const __DRIcoreExtension *core, extern const __DRIsystemTimeExtension systemTimeExtension; +void * +glxProbeDriver(const char *name, + void **coreExt, const char *coreName, int coreVersion, + void **renderExt, const char *renderName, int renderVersion); + #endif diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index dc12f5705..ed142c167 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -48,7 +48,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" @@ -175,19 +174,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, src->driContext, mask); } -static int -__glXDRIcontextForceCurrent(__GLXcontext *baseContext) -{ - __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext; - __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv; - __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv; - __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen; - - return (*screen->core->bindContext)(context->driContext, - draw->driDrawable, - read->driDrawable); -} - #ifdef __DRI_TEX_BUFFER static int @@ -202,6 +188,14 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, if (texBuffer == NULL) return Success; +#if __DRI_TEX_BUFFER_VERSION >= 2 + if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) { + (*texBuffer->setTexBuffer2)(context->driContext, + glxPixmap->target, + glxPixmap->format, + drawable->driDrawable); + } else +#endif texBuffer->setTexBuffer(context->driContext, glxPixmap->target, drawable->driDrawable); @@ -282,7 +276,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; - context->base.forceCurrent = __glXDRIcontextForceCurrent; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->driContext = @@ -428,17 +421,12 @@ initializeExtensions(__GLXDRIscreen *screen) } } -static const char dri_driver_path[] = DRI_DRIVER_PATH; - static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; - char filename[128]; - const __DRIextension **extensions; const __DRIconfig **driConfigs; - int i; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -450,40 +438,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = NULL; screen->base.pScreen = pScreen; - snprintf(filename, sizeof filename, - "%s/%s_dri.so", dri_driver_path, driverName); - - screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + screen->driver = glxProbeDriver(driverName, + (void **)&screen->core, + __DRI_CORE, __DRI_CORE_VERSION, + (void **)&screen->swrast, + __DRI_SWRAST, __DRI_SWRAST_VERSION); if (screen->driver == NULL) { - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n", - filename, dlerror()); goto handle_error; } - extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS); - if (extensions == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", - driverName, dlerror()); - goto handle_error; - } - - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_CORE) == 0 && - extensions[i]->version >= __DRI_CORE_VERSION) { - screen->core = (const __DRIcoreExtension *) extensions[i]; - } - if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0 && - extensions[i]->version >= __DRI_SWRAST_VERSION) { - screen->swrast = (const __DRIswrastExtension *) extensions[i]; - } - } - - if (screen->core == NULL || screen->swrast == NULL) { - LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n", - driverName); - goto handle_error; - } - screen->driScreen = (*screen->swrast->createNewScreen)(pScreen->myNum, loader_extensions, @@ -509,7 +472,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.GLXminor = 4; LogMessage(X_INFO, - "AIGLX: Loaded and initialized %s\n", filename); + "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/glx/glxext.c b/glx/glxext.c index f5ebe4f7e..9cfc096c3 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -39,7 +39,6 @@ #include #include "privates.h" #include -#include "g_disptab.h" #include "unpack.h" #include "glxutil.h" #include "glxext.h" @@ -51,14 +50,12 @@ ** from the server's perspective. */ __GLXcontext *__glXLastContext; -__GLXcontext *__glXContextList; /* ** X resources. */ RESTYPE __glXContextRes; RESTYPE __glXDrawableRes; -RESTYPE __glXSwapBarrierRes; /* ** Reply for most singles. @@ -68,11 +65,6 @@ xGLXSingleReply __glXReply; static DevPrivateKeyRec glxClientPrivateKeyRec; #define glxClientPrivateKey (&glxClientPrivateKeyRec) -/* -** Client that called into GLX dispatch. -*/ -ClientPtr __pGlxClient; - /* ** Forward declarations. */ @@ -126,50 +118,35 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { __GLXcontext *c, *next; - /* If this drawable was created using glx 1.3 drawable - * constructors, we added it as a glx drawable resource under both - * its glx drawable ID and it X drawable ID. Remove the other - * resource now so we don't a callback for freed memory. */ - if (glxPriv->drawId != glxPriv->pDraw->id) { - if (xid == glxPriv->drawId) - FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE); - else - FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE); + if (glxPriv->type == GLX_DRAWABLE_WINDOW) { + /* If this was created by glXCreateWindow, free the matching resource */ + if (glxPriv->drawId != glxPriv->pDraw->id) { + if (xid == glxPriv->drawId) + FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE); + else + FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE); + } + /* otherwise this window was implicitly created by MakeCurrent */ } for (c = glxAllContexts; c; c = next) { next = c->next; if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { - int i; - (*c->loseCurrent)(c); c->isCurrent = GL_FALSE; if (c == __glXLastContext) __glXFlushContextCache(); - - for (i = 1; i < currentMaxClients; i++) { - if (clients[i]) { - __GLXclientState *cl = glxGetClient(clients[i]); - - if (cl->inUse) { - int j; - - for (j = 0; j < cl->numCurrentContexts; j++) { - if (cl->currentContexts[j] == c) - cl->currentContexts[j] = NULL; - } - } - } - } } if (c->drawPriv == glxPriv) c->drawPriv = NULL; if (c->readPriv == glxPriv) c->readPriv = NULL; - if (!c->idExists && !c->isCurrent) - __glXFreeContext(c); } + /* drop our reference to any backing pixmap */ + if (glxPriv->type == GLX_DRAWABLE_PIXMAP) + glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr)glxPriv->pDraw); + glxPriv->destroy(glxPriv); return True; @@ -228,19 +205,6 @@ GLboolean __glXFreeContext(__GLXcontext *cx) return GL_TRUE; } -extern RESTYPE __glXSwapBarrierRes; - -static int SwapBarrierGone(int screen, XID drawable) -{ - __GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - - if (pGlxScreen->swapBarrierFuncs) { - pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, 0); - } - FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE); - return True; -} - /************************************************************************/ /* @@ -298,8 +262,6 @@ glxClientCallback (CallbackListPtr *list, NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; __GLXclientState *cl = glxGetClient(pClient); - __GLXcontext *cx; - int i; switch (pClient->clientState) { case ClientStateRunning: @@ -313,18 +275,8 @@ glxClientCallback (CallbackListPtr *list, break; case ClientStateGone: - for (i = 0; i < cl->numCurrentContexts; i++) { - cx = cl->currentContexts[i]; - if (cx) { - cx->isCurrent = GL_FALSE; - if (!cx->idExists) - __glXFreeContext(cx); - } - } - free(cl->returnBuf); free(cl->largeCmdBuf); - free(cl->currentContexts); free(cl->GLClientextensions); break; @@ -358,9 +310,7 @@ void GlxExtensionInit(void) "GLXContext"); __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone, "GLXDrawable"); - __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone, - "GLXSwapBarrier"); - if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes) + if (!__glXContextRes || !__glXDrawableRes) return; if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) @@ -439,7 +389,7 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, ** See if the context tag is legal; it is managed by the extension, ** so if it's invalid, we have an implementation error. */ - cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); + cx = __glXLookupContextByTag(cl, tag); if (!cx) { cl->client->errorValue = tag; *error = __glXError(GLXBadContextTag); @@ -468,7 +418,7 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, /* Make this context the current one for the GL. */ if (!cx->isDirect) { - if (!(*cx->forceCurrent)(cx)) { + if (!(*cx->makeCurrent)(cx)) { /* Bind failed, and set the error code. Bummer */ cl->client->errorValue = cx->id; *error = __glXError(GLXBadContextState); @@ -588,15 +538,12 @@ static int __glXDispatch(ClientPtr client) /* ** Use the opcode to index into the procedure table. */ - proc = (__GLXdispatchSingleProcPtr) __glXGetProtocolDecodeFunction(& Single_dispatch_info, - opcode, - client->swapped); + proc = __glXGetProtocolDecodeFunction(& Single_dispatch_info, opcode, + client->swapped); if (proc != NULL) { GLboolean rendering = opcode <= X_GLXRenderLarge; __glXleaveServer(rendering); - __pGlxClient = client; - retval = (*proc)(cl, (GLbyte *) stuff); __glXenterServer(rendering); diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 8515e14d5..496cf9e14 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -175,8 +175,6 @@ static char GLXServerExtensions[] = "GLX_SGI_make_current_read " #ifndef __APPLE__ "GLX_SGIS_multisample " - "GLX_SGIX_hyperpipe " - "GLX_SGIX_swap_barrier " #endif "GLX_SGIX_fbconfig " "GLX_SGIX_pbuffer " @@ -184,31 +182,6 @@ static char GLXServerExtensions[] = "GLX_INTEL_swap_event" ; -/* - * If your DDX driver wants to register support for swap barriers or hyperpipe - * topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit() - * with a dispatch table of functions to handle the requests. In the XFree86 - * DDX, for example, you would call these near the bottom of the driver's - * ScreenInit method, after DRI has been initialized. - * - * This should be replaced with a better method when we teach the server how - * to load DRI drivers. - */ - -void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs) -{ - __GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - - pGlxScreen->hyperpipeFuncs = funcs; -} - -void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs) -{ - __GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - - pGlxScreen->swapBarrierFuncs = funcs; -} - static Bool glxCloseScreen (int index, ScreenPtr pScreen) { diff --git a/glx/glxscreens.h b/glx/glxscreens.h index 861e03ce8..93b4109e0 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -35,21 +35,6 @@ * Silicon Graphics, Inc. */ -typedef struct { - void * (* queryHyperpipeNetworkFunc)(int, int *, int *); - void * (* queryHyperpipeConfigFunc)(int, int, int *, int *); - int (* destroyHyperpipeConfigFunc)(int, int); - void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *); -} __GLXHyperpipeExtensionFuncs; - -typedef struct { - int (* bindSwapBarrierFunc)(int, XID, int); - int (* queryMaxSwapBarriersFunc)(int); -} __GLXSwapBarrierExtensionFuncs; - -void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs); -void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs); - typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { __GLXconfig *next; @@ -144,9 +129,6 @@ struct __GLXscreen { int (*swapInterval) (__GLXdrawable *drawable, int interval); - __GLXHyperpipeExtensionFuncs *hyperpipeFuncs; - __GLXSwapBarrierExtensionFuncs *swapBarrierFuncs; - ScreenPtr pScreen; /* Linked list of valid fbconfigs for this screen. */ diff --git a/glx/glxserver.h b/glx/glxserver.h index 1daf97758..891315b74 100644 --- a/glx/glxserver.h +++ b/glx/glxserver.h @@ -96,18 +96,8 @@ void __glXScreenInitVisuals(__GLXscreen *screen); extern __GLXcontext *__glXLastContext; extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*); -extern ClientPtr __pGlxClient; - int __glXError(int error); -/* -** Macros to set, unset, and retrieve the flag that says whether a context -** has unflushed commands. -*/ -#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE -#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE -#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands) - /************************************************************************/ typedef struct __GLXprovider __GLXprovider; @@ -158,13 +148,6 @@ struct __GLXclientStateRec { GLbyte *largeCmdBuf; GLint largeCmdBufSize; - /* - ** Keep a list of all the contexts that are current for this client's - ** threads. - */ - __GLXcontext **currentContexts; - GLint numCurrentContexts; - /* Back pointer to X client record */ ClientPtr client; diff --git a/glx/indirect_table.c b/glx/indirect_table.c index cb3202605..01d1da3f8 100644 --- a/glx/indirect_table.c +++ b/glx/indirect_table.c @@ -30,7 +30,6 @@ #include "glxext.h" #include "indirect_dispatch.h" #include "indirect_reqsize.h" -#include "g_disptab.h" #include "indirect_table.h" /*****************************************************************/ diff --git a/glx/single2.c b/glx/single2.c index 56ad86dc6..9884f400f 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -72,7 +72,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) cx->feedbackBufSize = size; } CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) ); - __GLX_NOTE_UNFLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -100,7 +100,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc) cx->selectBufSize = size; } CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) ); - __GLX_NOTE_UNFLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -213,7 +213,7 @@ int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc) } CALL_Flush( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -230,7 +230,7 @@ int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc) /* Do a local glFinish */ CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ client = cl->client; @@ -346,9 +346,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) cl->GLClientextensions); buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); - if (buf1 != NULL) { - free(buf1); - } + free(buf1); string = buf; } else if ( name == GL_VERSION ) { @@ -377,8 +375,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER(); WriteToClient(client, length, (char *) string); - if (buf != NULL) - free(buf); + free(buf); return Success; } diff --git a/glx/single2swap.c b/glx/single2swap.c index 04e50b407..e3afcabbc 100644 --- a/glx/single2swap.c +++ b/glx/single2swap.c @@ -72,7 +72,7 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) cx->feedbackBufSize = size; } CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) ); - __GLX_NOTE_UNFLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -103,7 +103,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc) cx->selectBufSize = size; } CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) ); - __GLX_NOTE_UNFLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_TRUE; return Success; } @@ -229,7 +229,7 @@ int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc) } CALL_Flush( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; return Success; } @@ -248,7 +248,7 @@ int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc) /* Do a local glFinish */ CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; /* Send empty reply packet to indicate finish is finished */ client = cl->client; diff --git a/glx/singlepix.c b/glx/singlepix.c index a0a6a7918..85fc4860d 100644 --- a/glx/singlepix.c +++ b/glx/singlepix.c @@ -91,7 +91,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; return Success; } diff --git a/glx/singlepixswap.c b/glx/singlepixswap.c index a7febc9a6..bef99f606 100644 --- a/glx/singlepixswap.c +++ b/glx/singlepixswap.c @@ -102,7 +102,7 @@ int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc) __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } - __GLX_NOTE_FLUSHED_CMDS(cx); + cx->hasUnflushedCommands = GL_FALSE; return Success; } diff --git a/glx/unpack.h b/glx/unpack.h index a4e6d7e84..738e79dc4 100644 --- a/glx/unpack.h +++ b/glx/unpack.h @@ -47,7 +47,7 @@ ** Fetch a double from potentially unaligned memory. */ #ifdef __GLX_ALIGN64 -#define __GLX_MEM_COPY(dst,src,n) if (src != NULL && dst != NULL) memcpy(dst,src,n) +#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n) #define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8) #else #define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src)) diff --git a/glx/xfont.c b/glx/xfont.c index b4081cfd4..84a301f9b 100644 --- a/glx/xfont.c +++ b/glx/xfont.c @@ -35,7 +35,6 @@ #include "glxserver.h" #include "glxutil.h" #include "unpack.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" @@ -155,6 +154,8 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc) __GLXcontext *cx; int error; + REQUEST_SIZE_MATCH(xGLXUseXFontReq); + req = (xGLXUseXFontReq *) pc; cx = __glXForceCurrent(cl, req->contextTag, &error); if (!cx) { diff --git a/hw/Makefile.am b/hw/Makefile.am index 6c2cc6bd4..9c9721a5c 100644 --- a/hw/Makefile.am +++ b/hw/Makefile.am @@ -26,6 +26,10 @@ if XQUARTZ XQUARTZ_SUBDIRS = xquartz endif +if DDXANDROID +DDXANDROID_SUBDIRS = android +endif + SUBDIRS = \ $(XORG_SUBDIRS) \ $(XWIN_SUBDIRS) \ @@ -33,9 +37,10 @@ SUBDIRS = \ $(XNEST_SUBDIRS) \ $(DMX_SUBDIRS) \ $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) + $(XQUARTZ_SUBDIRS) \ + $(DDXANDROID_SUBDIRS) -DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive +DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz android kdrive relink: $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done diff --git a/hw/android/.classpath b/hw/android/.classpath new file mode 100644 index 000000000..df054a10f --- /dev/null +++ b/hw/android/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/android/.gitignore b/hw/android/.gitignore similarity index 100% rename from android/.gitignore rename to hw/android/.gitignore diff --git a/hw/android/.project b/hw/android/.project new file mode 100644 index 000000000..20e211fc0 --- /dev/null +++ b/hw/android/.project @@ -0,0 +1,33 @@ + + + AndroiX + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/android/AndroidManifest.xml b/hw/android/AndroidManifest.xml similarity index 100% rename from android/AndroidManifest.xml rename to hw/android/AndroidManifest.xml diff --git a/hw/android/Makefile.am b/hw/android/Makefile.am new file mode 100644 index 000000000..b7e5ff521 --- /dev/null +++ b/hw/android/Makefile.am @@ -0,0 +1,39 @@ + +noinst_LTLIBRARIES = libddxandroid.la libfbcmap.la + +lib_LTLIBRARIES = libxandroid.la + +libddxandroid_la_CFLAGS = \ + ${DIX_CFLAGS} \ + -I/opt/androix/usr/include + +libddxandroid_la_SOURCES = \ + startup.c \ + screen.c \ + damage.c \ + callback.c \ + events.c \ + $(top_srcdir)/mi/miinitext.c + +libfbcmap_la_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c +libfbcmap_la_CFLAGS = $(DIX_CFLAGS) + +libxandroid_la_SOURCES = + +libxandroid_la_LIBADD = \ + libfbcmap.la \ + libddxandroid.la \ + ../../miext/sync/libsync.la \ + @DDXANDROID_LIBS@ + +libxandroid_la_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,--shared \ + -Wl,-z,nocopyreloc -llog + +libxandroid_la_DEPENDENCIES = \ + libfbcmap.la \ + libddxandroid.la \ + ../../miext/sync/libsync.la \ + @DDXANDROID_LIBS@ + +relink: + $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) diff --git a/hw/android/android.h b/hw/android/android.h new file mode 100644 index 000000000..af25ecd83 --- /dev/null +++ b/hw/android/android.h @@ -0,0 +1,60 @@ + +#include +#include + +#include "android/log.h" + +#define LOG_TAG "AndroiX" +//define LOG(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) +#define LOG(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) + +typedef struct _androidVars { + pthread_mutex_t *events_lock; + JavaVM *jvm; + + /* Screen size */ + int screenWidth; + int screenHeight; + + /* Event wakeup socket */ + int wakeupFD[2]; + + /* Global references established in androidInitNative */ + jclass AndroiXService_class; + jclass AndroiXBlitView_class; + jobject blitview; + + jmethodID initNativeScreen; + jmethodID initNativeKeyboard; + jmethodID initNativeMouse; + jmethodID initNativeTrackball; + jmethodID initFramebuffer; + jmethodID draw; + +} AndroidVars; + +AndroidVars *Android; + +/* defined in android component */ +int androidRequestInputLock(void); +int androidReleaseInputLock(void); + +void androidInitNative(JavaVM *jvm); +void androidInitNativeScreen(void *screen); +int androidInitNativeKeyboard(void *kbd); +int androidInitNativeMouse(void *mouse); +int androidInitNativeFramebuffer(void *base, void **buf, int width, int height, int depth); +void androidDraw(int x, int y, int w, int h); + +/* callbacks */ +void androidCallbackKeyDown(void *kbd, int keyCode); +void androidCallbackKeyUp(void *kbd, int keyCode); +void androidCallbackTouchDown(void *mouse, int x, int y); +void androidCallbackTouchMove(void *mouse, int x, int y); +void androidCallbackTouchUp(void *mouse, int x, int y); +void androidCallbackTrackballNormalizedMotion(void *ballPtr, double fx, double fy); +void androidCallbackTrackballPress(void *ballPtr); +void androidCallbackTrackballRelease(void *ballPtr); + + + diff --git a/hw/android/androidevents.h b/hw/android/androidevents.h new file mode 100644 index 000000000..24d84abf0 --- /dev/null +++ b/hw/android/androidevents.h @@ -0,0 +1,106 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +/* These event packets are used for the communication between the Android-called dispatch functions and the X server in hw/android/events.c, they are not X events and are not used within X. */ + + +typedef enum _AndroidWireEventType { + ANDROIDWIRESYNCEVENT = 0, + ANDROIDWIREKEYDOWNEVENT, + ANDROIDWIREKEYUPEVENT, + ANDROIDWIRETOUCHDOWNEVENT, + ANDROIDWIRETOUCHMOVEEVENT, + ANDROIDWIRETOUCHUPEVENT, + ANDROIDWIRETRACKBALLNORMALIZEDMOTIONEVENT, + ANDROIDWIRETRACKBALLPRESSEVENT, + ANDROIDWIRETRACKBALLRELEASEEVENT +} AndroidWireEventType; + +typedef struct _AndroidWireEvent { + AndroidWireEventType type; + long ts; + void *dev; + union { + struct { int keyCode; }; + struct { int x, y; }; + struct { double x, y; }; + } u; +} AndroidWireEvent; + +typedef struct _AndroidWireKeyDownEvent { + AndroidWireEventType type; + long ts; + void *dev; + int keyCode; +} AndroidWireKeyDownEvent; + +typedef struct _AndroidWireKeyUpEvent { + AndroidWireEventType type; + long ts; + void *dev; + int keyCode; +} AndroidWireKeyUpEvent; + +typedef struct _AndroidWireTouchDownEvent { + AndroidWireEventType type; + long ts; + void *dev; + double x; + double y; +} AndroidWireTouchDownEvent; + +typedef struct _AndroidWireTouchMoveEvent { + AndroidWireEventType type; + long ts; + void *dev; + double x; + double y; +} AndroidWireTouchMoveEvent; + +typedef struct _AndroidWireTouchUpEvent { + AndroidWireEventType type; + long ts; + void *dev; + double x; + double y; +} AndroidWireTouchUpEvent; + +typedef struct _AndroidWireTrackballNormalizedMotionEvent { + AndroidWireEventType type; + long ts; + void *dev; + double x; + float y; +} AndroidWireTrackballNormalizedMotionEvent; + +typedef struct _AndroidWireTrackballPressEvent { + AndroidWireEventType type; + long ts; + void *dev; +} AndroidWireTrackballPressEvent; + +typedef struct _AndroidWireTrackballReleaseEvent { + AndroidWireEventType type; + long ts; + void *dev; +} AndroidWireTrackballReleaseEvent; + diff --git a/hw/android/build.sh b/hw/android/build.sh new file mode 100755 index 000000000..436af66f0 --- /dev/null +++ b/hw/android/build.sh @@ -0,0 +1 @@ +CC="/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc" CFLAGS="-W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ -DDEBUG" LDFLAGS="-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -ldl -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc" PKG_CONFIG_PATH="/opt/androix/usr/lib/pkgconfig" ./configure --host arm-eabi --prefix=/opt/androix/usr --disable-xorg --disable-glx --disable-xvfb --disable-xinerama --disable-xnest --enable-android --with-xkb-path="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb" --with-xkb-output="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb/compiled" --with-default-font-path="/data/data/net.homeip.ofn.androix/usr/share/fonts/X11" --with-xkb-bin-directory="/data/data/net.homeip.ofn.androix/usr/bin" --prefix=/opt/androix/usr diff --git a/android/build.xml b/hw/android/build.xml similarity index 100% rename from android/build.xml rename to hw/android/build.xml diff --git a/hw/android/callback.c b/hw/android/callback.c new file mode 100644 index 000000000..3cf193032 --- /dev/null +++ b/hw/android/callback.c @@ -0,0 +1,130 @@ + +#include +#include +#include +#include +#include "private.h" + +#define ANDROIDCALLBACKABI 2 /* added trackball events */ + +int androidCallbackGetVersion(void) { + return ANDROIDCALLBACKABI; +} + +void androidCallbackKeyDown(void *kbdPtr, int keyCode) { + LogMessage(X_DEFAULT, "[native] androidCallbackKeyDown: kbd: %.8x keyCode: %d", (unsigned int)kbdPtr, keyCode); + QueueKeyboardEvents(kbdPtr, KeyPress, keyCode, NULL); +} + +void androidCallbackKeyUp(void *kbdPtr, int keyCode) { + LogMessage(X_DEFAULT, "[native] androidCallbackKeyUp: kbd: %p keyCode: %d", kbdPtr, keyCode); + QueueKeyboardEvents(kbdPtr, KeyRelease, keyCode, NULL); +} + +void androidCallbackTouchDown(void *mousePtr, int x, int y) { + int valuators[2]; + ValuatorMask mask; + + LogMessage(X_DEFAULT, "[native] androidCallbackTouchDown: mouse: %p x: %d y: %d", mousePtr, x, y); + /* Press */ + valuators[0] = x; + valuators[1] = y; + valuator_mask_set_range(&mask, 0, 2, valuators); + QueuePointerEvents(mousePtr, ButtonPress, 1, POINTER_ABSOLUTE, &mask); +} + +void androidCallbackTouchMove(void *mousePtr, int x, int y) { + int valuators[2]; + ValuatorMask mask; + + LogMessage(X_DEFAULT, "[native] androidCallbackTouchMove: mouse: %p x: %d y: %d", mousePtr, x, y); + /* Motion notify */ + valuators[0] = x; + valuators[1] = y; + valuator_mask_set_range(&mask, 0, 2, valuators); + QueuePointerEvents(mousePtr, MotionNotify, 0, POINTER_ABSOLUTE, &mask); +} + +void androidCallbackTouchUp(void *mousePtr, int x, int y) { + int valuators[2]; + ValuatorMask mask; + + LogMessage(X_DEFAULT, "[native] androidCallbackTouchUp: mouse: %p x: %d y: %d", mousePtr, x, y); + /* Press */ + /* Press */ + valuators[0] = x; + valuators[1] = y; + valuator_mask_set_range(&mask, 0, 2, valuators); + QueuePointerEvents(mousePtr, ButtonRelease, 1, POINTER_ABSOLUTE, &mask); +} + +void androidCallbackTrackballNormalizedMotion(void *ballPtr, double fx, double fy) { +#ifdef NEVER + int i, n; + int x, y; + +// x = (int)floor(fx * 800) % 800; +// y = (int)floor(fy * 480) % 480; + +// x = (int)(pow((abs(fx) * 6.01), 2.5); +// y = (int)pow((abs(fy) * 6.01), 2.5); + + x = (int)((fx/2.5) * 250); + y = (int)((fy/2.5) * 200); + + int v[3] = {x, y, 0}; + DeviceIntPtr ball = ballPtr; + + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballNormalizedMotion: ball: %p x: %d y: %d", ball, x, y); + + GetEventList(&androidEvents); + n = GetPointerEvents(androidEvents, ball, MotionNotify, 1, POINTER_RELATIVE, 0, 2, v); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballNormalizedMotion ball->enable: %d", ball->enabled); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballNormalizedMotion: n: %d", n); + for (i = 0; i < n; i++) { + mieqEnqueue(ball, (InternalEvent*)(androidEvents + i)->event); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballNormalizedMotion: enqueueing event MotionNotify REL %d %d %d", x, y, 0); + }; +#endif +} + +void androidCallbackTrackballPress(void *ballPtr) { +#ifdef NEVER + int i, n; + + int v[1] = {1}; + DeviceIntPtr ball = ballPtr; + + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballPress: ball: %p", ball); + + GetEventList(&androidEvents); + n = GetPointerEvents(androidEvents, ball, ButtonPress, 1, POINTER_RELATIVE, 0, 1, v); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballPress ball->enable: %d", ball->enabled); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballPress: n: %d", n); + for (i = 0; i < n; i++) { + mieqEnqueue(ball, (InternalEvent*)(androidEvents + i)->event); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballPress: enqueueing event ButtonPress"); + }; +#endif +}; + +void androidCallbackTrackballRelease(void *ballPtr) { +#ifdef NEVER + int i, n; + + int v[1] = {0}; + DeviceIntPtr ball = ballPtr; + + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballRelease: ball: %p", ball); + + GetEventList(&androidEvents); + n = GetPointerEvents(androidEvents, ball, ButtonRelease, 1, POINTER_RELATIVE, 0, 1, v); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballPress ball->enable: %d", ball->enabled); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballRelease: n: %d", n); + for (i = 0; i < n; i++) { + mieqEnqueue(ball, (InternalEvent*)(androidEvents + i)->event); + LogMessage(X_DEFAULT, "[native] androidCallbackTrackballRelease: enqueueing event ButtonRelease"); + }; +#endif +} + diff --git a/hw/android/damage.c b/hw/android/damage.c new file mode 100644 index 000000000..e4efa0211 --- /dev/null +++ b/hw/android/damage.c @@ -0,0 +1,193 @@ + +#include +#include +#include "os.h" +#include "servermd.h" +#include "inputstr.h" +#include "scrnintstr.h" +#include "mibstore.h" // mi backing store implementation +#include "mipointer.h" // mi software cursor +#include "micmap.h" // mi colormap code +#include "fb.h" // fb framebuffer code +#include "site.h" +#include "globals.h" +#include "dix.h" +#include "xkbsrv.h" + +#include "shadow.h" + +#include +#include +#include "exevents.h" +#include "extinit.h" + +//include "xserver-properties.h" + +#include +#include +#include +#include +#include +#include + +#include "android.h" +#include "screen.h" +#include "private.h" + +void * +androidWindowLinear (ScreenPtr pScreen, + CARD32 row, + CARD32 offset, + int mode, + CARD32 *size, + void *closure) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + +// if (!pScreenPriv->enabled) +// return 0; + *size = priv->bytes_per_line; + return priv->base + row * priv->bytes_per_line; +} + + +Bool +androidSetShadow (ScreenPtr pScreen) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + ShadowUpdateProc update; + ShadowWindowProc window; + + window = androidWindowLinear; + update = 0; + if (priv->randr) + update = shadowUpdateRotatePacked; + else + update = shadowUpdatePacked; +// return KdShadowSet (pScreen, scrpriv->randr, update, window); + + if(!shadowAdd(pScreen, pScreen->devPrivate, update, window, 0, 0)) { + LogMessage(X_ERROR, "[screen] AndroidCreateScreenResources: shadowAdd failed"); + } + +} + +/* track damage and update the process */ +/* based on Xephyr */ + +/* TODO convert to shadow if possible or integrate better with upstream */ + +void +AndroidShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + + //LogMessage(X_INFO, "[ddxandroid damage] slow paint"); + + /* FIXME: Slow Rotated/Reflected updates could be much + * much faster efficiently updating via tranforming + * pBuf->pDamage regions + */ + //shadowUpdateRotatePacked(pScreen, pBuf); + + //hostx_paint_rect(screen, 0,0,0,0, screen->width, screen->height); + androidDraw(0, 0, /*?*/ pScreen->width, pScreen->height); +} + +static void +AndroidInternalDamageRedisplay (ScreenPtr pScreen) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + + RegionPtr pRegion; + + if (!priv || !priv->pDamage) + return; + + pRegion = DamageRegion (priv->pDamage); + + if (RegionNotEmpty(pRegion)) + { + int nbox; + BoxPtr pbox; + + nbox = RegionNumRects (pRegion); + pbox = RegionRects (pRegion); + + while (nbox--) + { +/* + hostx_paint_rect(screen, + pbox->x1, pbox->y1, + pbox->x1, pbox->y1, + pbox->x2 - pbox->x1, + pbox->y2 - pbox->y1); +*/ + androidDraw(pbox->x1, pbox->y1, + /* ? */ + pbox->x2 - pbox->x1, + pbox->y2 - pbox->y1); + pbox++; + } + DamageEmpty (priv->pDamage); + } +} + +static void +AndroidInternalDamageBlockHandler (pointer data, + OSTimePtr pTimeout, + pointer pRead) +{ + ScreenPtr pScreen = (ScreenPtr) data; + + AndroidInternalDamageRedisplay (pScreen); +} + +static void +AndroidInternalDamageWakeupHandler (pointer data, int i, pointer LastSelectMask) +{ + /* FIXME: Not needed ? */ +} + +Bool +AndroidSetInternalDamage (ScreenPtr pScreen) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + + PixmapPtr pPixmap = NULL; + + priv->pDamage = DamageCreate ((DamageReportFunc) 0, + (DamageDestroyFunc) 0, + DamageReportNone, + TRUE, + pScreen, + pScreen); + + if (!RegisterBlockAndWakeupHandlers (AndroidInternalDamageBlockHandler, + AndroidInternalDamageWakeupHandler, + (pointer) pScreen)) + return FALSE; + + pPixmap = (*pScreen->GetScreenPixmap) (pScreen); + + DamageRegister (&pPixmap->drawable, priv->pDamage); + + return TRUE; +} + +void +AndroidUnsetInternalDamage (ScreenPtr pScreen) +{ + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + + PixmapPtr pPixmap = NULL; + + pPixmap = (*pScreen->GetScreenPixmap) (pScreen); + DamageUnregister (&pPixmap->drawable, priv->pDamage); + DamageDestroy (priv->pDamage); + + RemoveBlockAndWakeupHandlers (AndroidInternalDamageBlockHandler, + AndroidInternalDamageWakeupHandler, + (pointer) pScreen); +} + diff --git a/android/default.properties b/hw/android/default.properties similarity index 100% rename from android/default.properties rename to hw/android/default.properties diff --git a/hw/android/events.c b/hw/android/events.c new file mode 100644 index 000000000..8bd26600b --- /dev/null +++ b/hw/android/events.c @@ -0,0 +1,323 @@ +/* + +Copyright 1993, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include "mi.h" +#include +#include "scrnintstr.h" +#include "inputstr.h" +#include +#include "mibstore.h" +#include "mipointer.h" +#include "xkbsrv.h" +#include +#include "xserver-properties.h" +#include "exevents.h" +#include "extinit.h" + +#include +#include +#include "XIstubs.h" /* even though we don't use stubs. cute, no? */ +#include "exevents.h" +#include "extinit.h" +#include "exglobals.h" +#include "eventstr.h" +#include "xserver-properties.h" + +#include "android.h" + +Bool +LegalModifier(unsigned int key, DeviceIntPtr pDev) +{ + return TRUE; +} + +void ProcessInputEvents(void) { + char nullbyte; + int x = sizeof(nullbyte); + +// TA_SERVER(); + + LogMessage(X_INFO, "[events] before mieqProcessInputEvents();"); + mieqProcessInputEvents(); + LogMessage(X_INFO, "[events] after mieqProcessInputEvents();"); + +/* + // Empty the signaling pipe + while (x == sizeof(nullbyte)) { + x = read(Android->wakeupFD[0], &nullbyte, sizeof(nullbyte)); + LogMessage(X_INFO, "[events] read %d bytes (nullbyte %c)", x, nullbyte); + } +*/ + + x = read(Android->wakeupFD[0], &nullbyte, 1); + LogMessage(X_INFO, "[events] read %d bytes (nullbyte %c)", x, nullbyte); +} + +void DDXRingBell(int volume, int pitch, int duration) +{ +} + +#define VFB_MIN_KEY 8 +#define VFB_MAX_KEY 255 + +static int +androidKeybdProc(DeviceIntPtr pDevice, int onoff) +{ + DevicePtr pDev = (DevicePtr)pDevice; + + switch (onoff) + { + case DEVICE_INIT: + InitKeyboardDeviceStruct(pDevice, NULL, NULL, NULL); + break; + case DEVICE_ON: + pDev->on = TRUE; + LogMessage(X_DEFAULT, "[events] initNativeKeyboard: pDevice: %p", pDevice); + androidInitNativeKeyboard(pDevice); + break; + case DEVICE_OFF: + pDev->on = FALSE; + break; + case DEVICE_CLOSE: + break; + } + return Success; +} + +static int +androidMouseProc(DeviceIntPtr pDevice, int onoff) +{ +#define NBUTTONS 3 +#define NAXES 2 + + BYTE map[NBUTTONS + 1]; + DevicePtr pDev = (DevicePtr)pDevice; + Atom btn_labels[NBUTTONS] = {0}; + Atom axes_labels[NAXES] = {0}; + + switch (onoff) + { + case DEVICE_INIT: + map[1] = 1; + map[2] = 2; + map[3] = 3; + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + InitPointerDeviceStruct(pDev, map, NBUTTONS, btn_labels, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); + break; + + case DEVICE_ON: + pDev->on = TRUE; + LogMessage(X_DEFAULT, "[events] initNativeMouse: pDevice: %p", pDevice); + androidInitNativeMouse(pDev); + break; + + case DEVICE_OFF: + pDev->on = FALSE; + break; + + case DEVICE_CLOSE: + break; + } + return Success; + +#undef NBUTTONS +#undef NAXES +} + +static int +androidTrackballProc(DeviceIntPtr pDevice, int onoff) +{ +#define NBUTTONS 3 +#define NAXES 2 + + BYTE map[NBUTTONS + 1]; + DevicePtr pDev = (DevicePtr)pDevice; + Atom btn_labels[NBUTTONS] = {0}; + Atom axes_labels[NAXES] = {0}; + + switch (onoff) + { + case DEVICE_INIT: + map[1] = 1; + map[2] = 2; + map[3] = 3; + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + InitPointerDeviceStruct(pDev, map, NBUTTONS, btn_labels, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); + break; + + case DEVICE_ON: + pDev->on = TRUE; + LogMessage(X_DEFAULT, "[events] initNativeTrackball: pDevice: %p", pDevice); + androidInitNativeTrackball(pDev); + break; + + case DEVICE_OFF: + pDev->on = FALSE; + break; + + case DEVICE_CLOSE: + break; + } + return Success; + +#undef NBUTTONS +#undef NAXES +} + +void +InitInput(int argc, char *argv[]) +{ + DeviceIntPtr p, t, k; + Atom xiclass; + int rc; + + LogMessage(X_DEFAULT, "[events] InitInput: adding mouse proc %p (serverClient: %p)", androidMouseProc, serverClient); + p = AddInputDevice(serverClient, androidMouseProc, TRUE); + p->name = strdup("pointer"); + LogMessage(X_DEFAULT, "[events] InitInput: adding trackball proc %p (serverClient: %p)", androidTrackballProc, serverClient); + t = AddInputDevice(serverClient, androidTrackballProc, TRUE); + t->name = strdup("trackball"); + LogMessage(X_DEFAULT, "[events] InitInput: adding keybd proc %p (serverClient: %p)", androidKeybdProc, serverClient); + k = AddInputDevice(serverClient, androidKeybdProc, TRUE); + k->name = strdup("keyboard"); + + LogMessage(X_DEFAULT, "[events] InitInput: registering mouse %p", p); + /* RegisterPointerDevice(p); */ + xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE); + AssignTypeAndName(p, xiclass, "Android mouse"); + LogMessage(X_DEFAULT, "[events] InitInput: registering trackball %p", t); + /* RegisterPointerDevice(t); */ + xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE); + AssignTypeAndName(t, xiclass, "Android trackball"); + LogMessage(X_DEFAULT, "[events] InitInput: registering keyboard %p", k); + /* RegisterKeyboardDevice(k); */ + xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE); + AssignTypeAndName(k, xiclass, "Android keyboard"); + LogMessage(X_DEFAULT, "[events] InitInput: AddEnabledDevice wakeupFD[0]", Android->wakeupFD[0]); + AddEnabledDevice(Android->wakeupFD[0]); + + (void)mieqInit(); + InitEventList(GetMaximumEventsNum());; +} + +void +CloseInput (void) +{ +} + +int +ChangeDeviceControl(register ClientPtr client, DeviceIntPtr pDev, + xDeviceCtl *control) +{ + switch (control->control) { + case DEVICE_RESOLUTION: + /* FIXME do something more intelligent here */ + return BadMatch; + + case DEVICE_ABS_CALIB: + case DEVICE_ABS_AREA: + return Success; + + case DEVICE_CORE: + return BadMatch; + case DEVICE_ENABLE: + return Success; + + default: + return BadMatch; + } + + /* NOTREACHED */ + return BadImplementation; +} + +void +OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status) +{ + if (!pDev) + *status = BadDevice; + else + *status = Success; +} + +void +CloseInputDevice(DeviceIntPtr pDev, ClientPtr client) +{ + return; +} + +/* We initialise all input devices at startup. */ +void +AddOtherInputDevices(void) +{ + return; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr dev) +{ + return; +} + +/* At the moment, absolute/relative is up to the client. */ +int +SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode) +{ + return BadMatch; +} + +int +SetDeviceValuators(register ClientPtr client, DeviceIntPtr pDev, + int *valuators, int first_valuator, int num_valuators) +{ + return BadMatch; +} + + + diff --git a/hw/android/full.sh b/hw/android/full.sh new file mode 100755 index 000000000..4427a79b5 --- /dev/null +++ b/hw/android/full.sh @@ -0,0 +1 @@ +CC="/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc" CFLAGS="-W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ -DDEBUG" LDFLAGS="-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -Bdynamic -L/opt/androix/usr/lib -nostdlib -lc -lm -ldl -llog -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc" PKG_CONFIG_PATH="/opt/androix/usr/lib/pkgconfig" ./configure --host arm-eabi --prefix=/opt/androix/usr --disable-dmx --disable-xinerama --disable-glx --disable-dri --disable-dri2 --enable-android --with-xkb-path="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb" --with-xkb-output="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb/compiled" --with-default-font-path="/data/data/net.homeip.ofn.androix/usr/share/fonts/X11" --with-xkb-bin-directory="/data/data/net.homeip.ofn.androix/usr/bin" --disable-devel-docs diff --git a/android/gen/net/homeip/ofn/androix/R.java b/hw/android/gen/net/homeip/ofn/androix/R.java similarity index 100% rename from android/gen/net/homeip/ofn/androix/R.java rename to hw/android/gen/net/homeip/ofn/androix/R.java diff --git a/hw/android/jni/Android.mk b/hw/android/jni/Android.mk new file mode 100644 index 000000000..9b52ae480 --- /dev/null +++ b/hw/android/jni/Android.mk @@ -0,0 +1,32 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +#LOCAL_MODULE := fakedix +#LOCAL_SRC_FILES := fakejni.c + +#LOCAL_STATIC_LIBRARIES := libfakedix + +LOCAL_MODULE := androix +LOCAL_SRC_FILES := androix.c native.c +LOCAL_LDFLAGS := -L/ndk/androix/usr/lib -lxandroid -lz -llog -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype + +#LOCAL_STATIC_LIBRARIES := libxfakelib +LOCAL_STATIC_LIBRARIES := libxandroid + +include $(BUILD_SHARED_LIBRARY) +#include $(BUILD_STATIC_LIBRARY) diff --git a/hw/android/jni/androix.c b/hw/android/jni/androix.c new file mode 100644 index 000000000..672cf9488 --- /dev/null +++ b/hw/android/jni/androix.c @@ -0,0 +1,142 @@ + +#include "../android.h" + +#include +#include +#include + +static pthread_mutex_t events_lock = PTHREAD_MUTEX_INITIALIZER; + +jint +JNI_OnLoad(JavaVM *jvm, void *reserved) { + Android = (AndroidVars *)calloc(sizeof(AndroidVars), 1); + Android->events_lock = &events_lock; + androidInitNative(jvm); + return JNI_VERSION_1_4; +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_init( JNIEnv* env, jobject thiz, int screenWidth, int screenHeight ) +{ + struct stat stats; + int mode = 0666; + + char argv[] = {":1"}; + char envp[] = {}; + + LOG("[androix] init(%d, %d)", screenWidth, screenHeight); + Android->screenWidth = screenWidth; + Android->screenHeight = screenHeight; + + LOG("fixing up /data/data/net.homeip.ofn.androix/usr/bin/xkbcomp"); + chmod("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", 0775); + LOG("done."); + + LOG("creating event wakeup socket pair"); + socketpair(AF_UNIX, SOCK_STREAM, 0, Android->wakeupFD); + LOG("remote (Xorg) fd: %d", Android->wakeupFD[0]); + LOG("local (android) fd: %d", Android->wakeupFD[1]); + + LOG("starting DIX"); + #if 1 + dix_main(1, &argv, &envp); + #else + main(1, &argv, &envp); + #endif + LOG("returning from DIX (this shouldn't happen)"); +} + +void wakeupFD() { + int res; + char nullbyte=0; + // oh, i ... er ... christ. + LOG("writing to wakeupFD"); + res = write(Android->wakeupFD[1], &nullbyte, sizeof(nullbyte)); + //res = write(Android->wakeupFD[1], "X", 1); + LOG("wrote %d bytes", res); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_keyDown( JNIEnv* env, jobject thiz, jint kbd, jint keyCode ) +{ + LOG("keyDown: kbd: %p keyCode: %d", kbd, keyCode); + LOG("keyDown TAKING LOCK"); + pthread_mutex_lock(Android->events_lock); + androidCallbackKeyDown((void *)kbd, keyCode); + LOG("keyDown RELEASIN LOCK"); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_keyUp( JNIEnv* env, jobject thiz, jint kbd, jint keyCode ) +{ + LOG("keyUp: kbd: %p keyCode: %d", (unsigned int)kbd, keyCode); + LOG("keyUp TAKING LOCK"); + pthread_mutex_lock(Android->events_lock); + androidCallbackKeyUp((void *)kbd, keyCode); + LOG("keyUp RELEASING LOCK"); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_touchDown( JNIEnv* env, jobject thiz, jint mouse, jint x, jint y ) +{ + LOG("touchDown: mouse: %p x: %d y: %d", mouse, x, y); + pthread_mutex_lock(Android->events_lock); + androidCallbackTouchDown((void *)mouse, x, y); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_touchMove( JNIEnv* env, jobject thiz, jint mouse, jint x, jint y ) +{ + LOG("touchMove: mouse: %p x: %d y: %d", mouse, x, y); + pthread_mutex_lock(Android->events_lock); + androidCallbackTouchMove((void *)mouse, x, y); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_touchUp( JNIEnv* env, jobject thiz, jint mouse, jint x, jint y ) +{ + LOG("touchUp: mouse: %p x: %d y: %d", mouse, x, y); + pthread_mutex_lock(Android->events_lock); + androidCallbackTouchUp((void *)mouse, x, y); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_trackballNormalizedMotion( JNIEnv* env, jobject thiz, jint ball, jfloat x, jfloat y ) +{ + LOG("trackballNormalizedMotion: ball: %p x: %d y: %d", ball, x, y); + pthread_mutex_lock(Android->events_lock); + androidCallbackTrackballNormalizedMotion((void *)ball, x, y); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_trackballPress( JNIEnv* env, jobject thiz, jint ball ) +{ + LOG("trackballPress: ball: %p", ball); + pthread_mutex_lock(Android->events_lock); + androidCallbackTrackballPress((void *)ball); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + +void +Java_net_homeip_ofn_androix_AndroiXLib_trackballRelease( JNIEnv* env, jobject thiz, jint ball ) +{ + LOG("trackballPress: ball: %p", ball); + pthread_mutex_lock(Android->events_lock); + androidCallbackTrackballRelease((void *)ball); + pthread_mutex_unlock(Android->events_lock); + wakeupFD(); +} + diff --git a/hw/android/jni/native.c b/hw/android/jni/native.c new file mode 100644 index 000000000..aee20f4b8 --- /dev/null +++ b/hw/android/jni/native.c @@ -0,0 +1,117 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "../android.h" + +#define ANDROIDNATIVEABI 2 /* added trackball events */ + +int androidGetNativeVersion(void) { + return ANDROIDNATIVEABI; +} + +void androidInitNative(JavaVM *jvm) { + JNIEnv *jni_env; + jclass AndroiXService_class; + jfieldID blitview_id; + jclass AndroiXBlitView_class; + jobject blitview; + + Android->jvm = jvm; + + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + AndroiXService_class = (*jni_env)->FindClass(jni_env, "net/homeip/ofn/androix/AndroiXService"); + LOG("[native] init: local AndroiXService_class: %p", AndroiXService_class); + + blitview_id = (*jni_env)->GetStaticFieldID(jni_env, AndroiXService_class, "blitView", "Lnet/homeip/ofn/androix/AndroiXBlitView;"); + blitview = (*jni_env)->GetStaticObjectField(jni_env, AndroiXService_class, blitview_id); + LOG("[native] init: local blitview: %p", blitview); + + AndroiXBlitView_class = (*jni_env)->GetObjectClass(jni_env, blitview); + LOG("[native] init: local AndroiXBlitView_class: %p", AndroiXBlitView_class); + + /* setup global references and cache methodIDs */ + Android->AndroiXService_class = (*jni_env)->NewGlobalRef(jni_env, AndroiXService_class); + + Android->AndroiXBlitView_class = (*jni_env)->NewGlobalRef(jni_env, AndroiXBlitView_class); + Android->blitview = (*jni_env)->NewGlobalRef(jni_env, blitview); + + Android->initNativeScreen = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "initNativeScreen", "(I)I"); + Android->initNativeKeyboard = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "initNativeKeyboard", "(I)I"); + Android->initNativeMouse = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "initNativeMouse", "(I)I"); + Android->initNativeTrackball = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "initNativeTrackball", "(I)I"); + Android->initFramebuffer = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "initFramebuffer", "(IIILjava/nio/ByteBuffer;)I"); + Android->draw = (*jni_env)->GetMethodID(jni_env, Android->AndroiXBlitView_class, "draw", "(IIII)V"); + + (*jni_env)->DeleteLocalRef(jni_env, AndroiXService_class); + (*jni_env)->DeleteLocalRef(jni_env, AndroiXBlitView_class); + (*jni_env)->DeleteLocalRef(jni_env, blitview); +}; + +void androidInitNativeScreen(void *screen) { + JNIEnv *jni_env; + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + (*jni_env)->CallIntMethod(jni_env, Android->blitview, Android->initNativeScreen, screen); +}; + +int androidInitNativeKeyboard(void *keyboard) { + JNIEnv *jni_env; + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + LOG("[native] androidInitNativeKeyboard: keyboard: %p", keyboard); + return (*jni_env)->CallIntMethod(jni_env, Android->blitview, Android->initNativeKeyboard, keyboard); +}; + +int androidInitNativeMouse(void *mouse) { + JNIEnv *jni_env; + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + LOG("[native] androidInitNativeMouse: mouse: %p", mouse); + return (*jni_env)->CallIntMethod(jni_env, Android->blitview, Android->initNativeMouse, mouse); +}; + +int androidInitNativeTrackball(void *ball) { + JNIEnv *jni_env; + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + LOG("[native] androidInitNativeTrackball: ball: %p", ball); + return (*jni_env)->CallIntMethod(jni_env, Android->blitview, Android->initNativeTrackball, ball); +}; + +int androidInitNativeFramebuffer(void *base, void **bufPtr, int width, int height, int depth) { + JNIEnv *jni_env; + jobject *buf = (jobject *)bufPtr; + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + + int bpp = depth/8; + LOG("[native] androidInitNativeFramebuffer: base: %p buf: %p width: %d height: %d bpp: %d", base, buf, width, height, bpp); + + buf = (*jni_env)->NewDirectByteBuffer(jni_env, base, (width*height*bpp)); + + jint res = (*jni_env)->CallIntMethod(jni_env, Android->blitview, Android->initFramebuffer, width, height, depth, buf); + return res; +}; + +void androidDraw(int x, int y, int w, int h) { + JNIEnv *jni_env; + jmethodID initNativeMouse; + LOG("[native] androidDraw: %d,%d %d x %d", x, y, w, h); + (*(Android->jvm))->AttachCurrentThread(Android->jvm, &jni_env, NULL); + (*jni_env)->CallVoidMethod(jni_env, Android->blitview, Android->draw, x, y, w, h); +}; + diff --git a/hw/android/libs/armeabi/gdb.setup b/hw/android/libs/armeabi/gdb.setup new file mode 100644 index 000000000..ab3bc2095 --- /dev/null +++ b/hw/android/libs/armeabi/gdb.setup @@ -0,0 +1,2 @@ +set solib-search-path /home/webbb/androix/androix-xserver/hw/android/obj/local/armeabi +directory /home/webbb/NDK/android-ndk-r5b/platforms/android-8/arch-arm/usr/include /home/webbb/androix/androix-xserver/hw/android/jni /home/webbb/NDK/android-ndk-r5b/sources/cxx-stl/system diff --git a/hw/android/libs/armeabi/gdbserver b/hw/android/libs/armeabi/gdbserver new file mode 100755 index 000000000..0fa40f015 Binary files /dev/null and b/hw/android/libs/armeabi/gdbserver differ diff --git a/hw/android/native.sh b/hw/android/native.sh new file mode 100755 index 000000000..bdbc77a05 --- /dev/null +++ b/hw/android/native.sh @@ -0,0 +1 @@ +CFLAGS="-W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -Wno-pointer-sign -Wno-override-init -I/opt/androix-native/include -I/opt/androix-native/usr/include -fPIC -I/opt/androix-native/usr/include -Dlinux -DDEBUG" LDFLAGS="-L/opt/androix-native/usr/lib -lm" PKG_CONFIG_PATH="/opt/androix-native/usr/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure --prefix=/opt/androix-native/usr --disable-dmx --disable-dri --disable-dri2 --disable-xorg --disable-glx --disable-xvfb --disable-xinerama --disable-xnest --enable-android --with-xkb-path="/usr/share/X11/xkb" --with-xkb-output="/usr/share/X11/xkb/compiled" --with-default-font-path="/usr/share/fonts/X11" --with-xkb-bin-directory="/usr/bin" --prefix=/opt/androix-native/usr diff --git a/android/obj/local/armeabi/objs/hello-jni/hello-jni.o.d b/hw/android/obj/local/armeabi/objs/hello-jni/hello-jni.o.d similarity index 100% rename from android/obj/local/armeabi/objs/hello-jni/hello-jni.o.d rename to hw/android/obj/local/armeabi/objs/hello-jni/hello-jni.o.d diff --git a/hw/android/package.sh b/hw/android/package.sh new file mode 100755 index 000000000..a407caae7 --- /dev/null +++ b/hw/android/package.sh @@ -0,0 +1,12 @@ +make -C ../../dix +make -C ../../os +make -C ../../fb +make -C ../../mi +make +make install + +cp /opt/androix/usr/lib/libxandroid.a obj/local/armeabi/ +/home/tmzt/src/android-ndk-4/android-ndk-r4b/ndk-build +cp usrdata.zip libs/armeabi/libusrdata.so +ant compile +ant debug diff --git a/hw/android/private.h b/hw/android/private.h new file mode 100644 index 000000000..6c4711515 --- /dev/null +++ b/hw/android/private.h @@ -0,0 +1,54 @@ + +#ifndef _DDXANDROID_PRIV_H_ +#define _DDXANDROID_PRIV_H_ +#include +#include + +#ifdef RANDR +#include "randrstr.h" +#endif + +#include + +#include +#include + +typedef struct _androidPriv { + + DeviceIntPtr keyboard; + DeviceIntPtr mouse; + +} AndroidPriv; + +typedef struct _androidScreenPriv { + Rotation randr; + DamagePtr pDamage; + ScreenInfo *pScreenInfo; + Bool(*wrappedCreateScreenResources)(ScreenPtr); + + CARD8 *base; + jobject buf; + int bytes_per_line; + int dpi; + int pitch; + int depth; + int bitsPerPixel; + int pixelStride; + int byteStride; + Bool shadow; + unsigned long visuals; + Pixel redMask, greenMask, blueMask; + + int width; + int height; +} AndroidScreenPriv; + +typedef struct _androidKeyboardPriv { + Bool enabled; +} AndroidKeyboardPriv; + +typedef struct _androidPointerPriv { + Bool enabled; +} AndroidPointerPriv; + +#endif /* _DDXANDROID_PRIV_H_ */ diff --git a/android/res/values/strings.xml b/hw/android/res/values/strings.xml similarity index 100% rename from android/res/values/strings.xml rename to hw/android/res/values/strings.xml diff --git a/hw/android/screen.c b/hw/android/screen.c new file mode 100644 index 000000000..9eae7da1e --- /dev/null +++ b/hw/android/screen.c @@ -0,0 +1,236 @@ + +#include +#include +#include "os.h" +#include "servermd.h" +#include "inputstr.h" +#include "scrnintstr.h" +#include "mibstore.h" // mi backing store implementation +#include "mipointer.h" // mi software cursor +#include "micmap.h" // mi colormap code +#include "fb.h" // fb framebuffer code +#include "site.h" +#include "globals.h" +#include "dix.h" +#include "xkbsrv.h" + +#include +#include +#include "exevents.h" +#include "extinit.h" + +//include "xserver-properties.h" + +#include +#include +#include +#include +#include +#include + +#include "android.h" +#include "screen.h" +#include "private.h" + +DevPrivateKeyRec androidScreenKeyRec; + + +static Bool AndroidSaveScreen(ScreenPtr screen, int on) { + /* tell Android to shutoff the display (based on dpms settings?) */ + return TRUE; +} + +Bool DPMSSupported() { return TRUE; } + +int DPMSSet(ClientPtr client, int level) { + /* tell Android to shutoff the display */ + return TRUE; +} + +static Bool AndroidCreateScreenResources(ScreenPtr pScreen) { + Bool res; + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + res = priv->wrappedCreateScreenResources(pScreen); + + LogMessage(X_INFO, "[startup] AndroidCreateScreenResources: before androidSetInternalDamage: pScreen->devPrivate: %p", pScreen->devPrivate); + //AndroidSetShadow(pScreen); + AndroidSetInternalDamage(pScreen); + LogMessage(X_INFO, "[startup] AndroidCreateScreenResources: after androidSetInternalDamage: pScreen->devPrivate: %p", pScreen->devPrivate); + + //return res; + return TRUE; +} + +Bool AndroidScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) { + AndroidScreenPriv *priv; + + LogMessage(X_INFO, "[startup] AndroidScreenInit called: index: %d pScreen: %p", index, pScreen); + + if(!dixRegisterPrivateKey(androidScreenKey, PRIVATE_SCREEN, 0)) { + LogMessage(X_ERROR, "[startup] AndroidScreenInit: failed to register screen key"); + }; + LogMessage(X_INFO, "[startup] AndroidScreenInit: registered key: %p", androidScreenKey); + + priv = (AndroidScreenPriv *)malloc(sizeof(AndroidScreenPriv)); + + LogMessage(X_INFO, "[startup] AndroidScreenInit: setting private: key: %p priv: %p", androidScreenKey, priv); + dixSetPrivate(&(pScreen->devPrivates), androidScreenKey, priv); + + LogMessage(X_INFO, "[startup] AndroidScreenInit: private set: %p (devPrivates: %p)", androidScreenKey, pScreen->devPrivates ); + + pScreen->width = Android->screenWidth; + pScreen->height = Android->screenHeight; + LogMessage(X_INFO, "[startup] AndroidScreenInit: screen size (%dx%d)", pScreen->width, pScreen->height); + + priv->visuals = ((1 << TrueColor) | (1 << DirectColor)); +#define Mask(o,l) (((1 << l) - 1) << o) + priv->dpi = 100; /* set from Android */ + priv->depth = 16; + priv->bitsPerPixel = 16; + priv->redMask = Mask (11, 5); + priv->greenMask = Mask (5, 6); + priv->blueMask = Mask (0, 5); + + priv->bytes_per_line = ((pScreen->width * priv->bitsPerPixel + 31) >> 5) << 2; + priv->base = NULL; + free(priv->base); + priv->base = malloc (priv->bytes_per_line * pScreen->height); + LogMessage(X_INFO, "[startup] alloc framebuffer (%dx%d): %p", priv->bytes_per_line, pScreen->height, priv->base); + + priv->byteStride = priv->bytes_per_line; + priv->pixelStride = (priv->bytes_per_line * 8/priv->bitsPerPixel); + + LogMessage(X_INFO, "[startup] AddScreen: priv->base: %p", priv->base); + + pScreen->SaveScreen = AndroidSaveScreen; + pScreen->CreateScreenResources = AndroidCreateScreenResources; + + LogMessage(X_INFO, "[startup] AndroidScreenInit: pScreen->CreateScreenResources: %p", pScreen->CreateScreenResources); + + miClearVisualTypes(); + + pScreen->x = 0; + pScreen->y = 0; + + AndroidFinishScreenInit(index, pScreen, argc, argv); + + LogMessage(X_INFO, "[startup] initNativeScreen: pScreen: %p", pScreen); + androidInitNativeScreen(pScreen); + LogMessage(X_INFO, "[startup] initNativeFramebuffer: base: %p buf: %p width: %d height: %d depth: %d", priv->base, &(priv->buf), pScreen->width, pScreen->height, priv->depth); + androidInitNativeFramebuffer(priv->base, &(priv->buf), pScreen->width, pScreen->height, priv->depth); + + return TRUE; +} + +Bool AndroidFinishScreenInit (int index, ScreenPtr pScreen, int argc, char **argv) { + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + char *pbits = NULL; + + /* allocate */ + + if (!AndroidInitVisuals(pScreen)) { + LogMessage(X_ERROR, "[screen] AndroidFinishScreenInitFB: AndroidInitVisuals failed"); + return FALSE; + } + + LogMessage(X_INFO, "[startup] AndroidScreenInit: fbSetupScreen: pScreen: %p base: %p width: %d height: %d dpi: %d stride?: %d bpp: %d", pScreen, priv->base, pScreen->width, pScreen->height, priv->dpi, priv->pitch/(priv->bitsPerPixel/8), priv->bitsPerPixel); + + if (! fbSetupScreen(pScreen, + priv->base, // pointer to screen bitmap + pScreen->width, pScreen->height, // screen size in pixels + priv->dpi, priv->dpi, // dots per inch +/* priv->pitch/(priv->bitsPerPixel/8), // pixel width of framebuffer */ + pScreen->width, + priv->bitsPerPixel)) // bits per pixel for screen + { + LogMessage(X_ERROR, "[startup] AndroidScreenInit: fbScreenInit failed"); + return FALSE; + } + + pbits = priv->base; + miSetPixmapDepths(); + + pScreen->SaveScreen = AndroidSaveScreen; + + if (!fbFinishScreenInit(pScreen, + priv->base, // pointer to screen bitmap + pScreen->width, pScreen->height, // screen size in pixels + priv->dpi, priv->dpi, // dots per inch +/* priv->pitch/(priv->bitsPerPixel/8), // pixel width of framebuffer */ + pScreen->width, + priv->bitsPerPixel)) // bits per pixel for screen + { + LogMessage(X_ERROR, "[startup] AndroidScreenInit: fbFinishScreenInit failed"); + return FALSE; + } + +// pScreen->BlockHandler = AndroidBlockHandler; +// pScreen->WakeupHandler = AndroidWakeupHandler; +// pScreen->blockData = pScreen; +// pScreen->wakeupData = pScreen; + + if (! fbPictureInit(pScreen, 0, 0)) { + LogMessage(X_ERROR, "[screen] AndroidFinishScreenInitFB: fbPictureInit failed"); + return FALSE; + } + + /* randr */ + + /* is this used?? */ + miInitializeBackingStore (pScreen); + + miDCInitialize(pScreen, &androidPointerCursorFuncs); + + fbCreateDefColormap(pScreen); + + if (!shadowSetup(pScreen)) + { + ErrorF ("[screen] AndroidFinishScreenInit: shadowSetup failed\n"); + return FALSE; + } + + priv->wrappedCreateScreenResources = pScreen->CreateScreenResources; + pScreen->CreateScreenResources = AndroidCreateScreenResources; + + return TRUE; + +} + +/* from kdrive/epyhr */ +/* BlockHandler/WakeHandler */ + +static Bool AndroidInitVisuals (ScreenPtr pScreen) { + AndroidScreenPriv *priv = dixLookupPrivate(&(pScreen->devPrivates), androidScreenKey); + + if (!miSetVisualTypesAndMasks (priv->depth, +/* TrueColorMask, */ + priv->visuals, + 8, + -1, + priv->redMask, + priv->greenMask, + priv->blueMask)) + { + LogMessage(X_ERROR, "[screen] AndroidInitVisuals: miSetVisualTypesAndMasks failed"); + return FALSE; + } + + return TRUE; +} + +static Bool AndroidCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) +{ + return FALSE; +} + +static void AndroidCrossScreen(ScreenPtr pScreen, Bool entering) +{ +} + +static miPointerScreenFuncRec androidPointerCursorFuncs = +{ + AndroidCursorOffScreen, + AndroidCrossScreen, + miPointerWarpCursor +}; + diff --git a/hw/android/screen.h b/hw/android/screen.h new file mode 100644 index 000000000..970a05454 --- /dev/null +++ b/hw/android/screen.h @@ -0,0 +1,20 @@ +#include +#include +#include "shadow.h" + +extern DevPrivateKeyRec androidScreenKeyRec; +#define androidScreenKey (&androidScreenKeyRec) + +static miPointerScreenFuncRec androidPointerCursorFuncs; + +Bool AndroidScreenInit(int index, ScreenPtr pScreen, int argc, char **argv); +Bool AndroidFinishScreenInit (int index, ScreenPtr pScreen, int argc, char **argv); +static Bool AndroidInitVisuals (ScreenPtr pScreen); + +/* damage.c */ +Bool androidSetShadow (ScreenPtr pScreen); +void androidShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf); + +Bool androidSetInternalDamage (ScreenPtr pScreen); +void androidUnsetInternalDamage (ScreenPtr pScreen); + diff --git a/hw/android/src/net/homeip/ofn/androix/AndroiX.java b/hw/android/src/net/homeip/ofn/androix/AndroiX.java new file mode 100755 index 000000000..4c51ce37b --- /dev/null +++ b/hw/android/src/net/homeip/ofn/androix/AndroiX.java @@ -0,0 +1,93 @@ + +package net.homeip.ofn.androix; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.view.Display; + +import android.widget.TextView; + + +public class AndroiX extends Activity +{ + private static AndroiX instance = null; + public static AndroiX getActivity() { return instance; } + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + + Display display = getWindowManager().getDefaultDisplay(); + AndroiXService.screenWidth = display.getWidth(); + AndroiXService.screenHeight = display.getHeight(); + final Intent intent = new Intent(this, AndroiXService.class); + startService(intent); + + /* + new Thread(new Runnable() { + @Override + public void run() + { + try { while(AndroiXService.blitView == null) Thread.sleep(250); } catch (InterruptedException e) {}; + runOnUiThread(new Runnable() { + @Override + public void run() { + setContentView(AndroiXService.blitView); + AndroiXService.blitView.resume(); + AndroiXService.blitView.invalidate(); + } + }); + } + }, "AndroiX Setup View Thread").start(); + */ + +// Log.d("AndroiX", "Waiting for View in Activity"); +// try { while(AndroiXService.blitView == null) Thread.sleep(250); } catch (InterruptedException e) {}; +// Log.d("AndroiX", "Setting the View"); +// setContentView(AndroiXService.blitView); + + instance = this; + } + + @Override + public void onPause() + { + Log.d("AndroiX", "paused"); + super.onPause(); + AndroiXService.blitView.suspend(); + } + + @Override + public void onResume() + { + Log.d("AndroiX", "resumed"); + super.onResume(); + if (AndroiXService.blitView != null) { + try { setContentView(AndroiXService.blitView); } + catch (IllegalStateException ex) { + ViewGroup g = (ViewGroup)AndroiXService.blitView.getParent(); + g.removeView(AndroiXService.blitView); + setContentView(AndroiXService.blitView); + } + AndroiXService.blitView.resume(); + } + } + + @Override + public void onDestroy() + { + instance = null; + super.onDestroy(); + Log.d("AndroiX", "destroyed"); + } + +} diff --git a/hw/android/src/net/homeip/ofn/androix/AndroiXBlitView.java b/hw/android/src/net/homeip/ofn/androix/AndroiXBlitView.java new file mode 100755 index 000000000..fc9e82948 --- /dev/null +++ b/hw/android/src/net/homeip/ofn/androix/AndroiXBlitView.java @@ -0,0 +1,203 @@ +package net.homeip.ofn.androix; + +import android.app.Activity; +import android.os.Bundle; +import android.content.Context; +import android.view.*; +import android.graphics.Bitmap; +import android.graphics.Canvas; + +import android.util.Log; + +import java.nio.*; + +/* 2d version */ + +public class AndroiXBlitView extends View implements View.OnKeyListener, View.OnTouchListener { + private int mScreenPtr = 0; + private int mKeyboardPtr = 0; + private int mMousePtr = 0; + private int mTrackballPtr = 0; + private Bitmap mBitmap = null; + private ByteBuffer mBuf = null; + private boolean mCreated = false; + private boolean mDrawing = false; + + class UiThread implements Runnable { + public void run() { + AndroiX.getActivity().setContentView(AndroiXService.blitView); + AndroiXService.blitView.setOnKeyListener(AndroiXService.blitView); + AndroiXService.blitView.setOnTouchListener(AndroiXService.blitView); + AndroiXService.blitView.setFocusable(true); + AndroiXService.blitView.setFocusableInTouchMode(true); + AndroiXService.blitView.requestFocus(); + AndroiXService.blitView.resume(); + AndroiXService.blitView.invalidate(); + } + } + + public AndroiXBlitView(Context context) { + super(context); + + setOnKeyListener(this); + setOnTouchListener(this); + setFocusable(true); + setFocusableInTouchMode(true); + requestFocus(); + + //mBitmap = Bitmap.createBitmap(W, H, Bitmap.Config.RGB_565); + } + + public boolean getIsDrawing() { return mDrawing; } + public boolean getIsCreated() { return mCreated; } + + public int initNativeScreen(int screen) { + mScreenPtr = screen; /* only on 32bit */ + Log.d("AndroiX", "[blitView] initNativeScreen: screen: " + screen); + return 0; + } + + public int initNativeKeyboard(int kbd) { + mKeyboardPtr = kbd; /* only on 32bit */ + Log.d("AndroiX", "[blitView] initNativeKeyboard: kbd: " + kbd); + return 0; + } + + public int initNativeMouse(int mouse) { + mMousePtr = mouse; /* only on 32bit */ + Log.d("AndroiX", "[blitView] initNativeMouse: mouse: " + mouse); + return 0; + } + + public int initNativeTrackball(int ball) { + mTrackballPtr = ball; /* only on 32bit */ + Log.d("AndroiX", "[blitView] initNativeTrackball: ball: " + ball); + return 0; + } + + public int initFramebuffer(int width, int height, int depth, java.nio.ByteBuffer buf) { + Log.d("AndroiX", "Initialize Framebuffer: " + width + " x " + height + " depth: " + depth); + if (depth != 16) { + Log.d("AndroiX", "Bad depth: " + depth); + return -1; + } + mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); + + AndroiX.getActivity().runOnUiThread(new UiThread()); + +// AndroiX.getActivity().setContentView(this); + + mBuf = buf; + return 0; + } + + public void draw(int x, int y, int w, int h) { + Log.d("AndroiX", "Draw from native: " + x + "," + y + "(" + w + " x " + h + ")"); + if (!mDrawing) { + Log.d("AndroiX", "draw ignored while suspended"); + return; + } + mBitmap.copyPixelsFromBuffer(mBuf); + postInvalidate(); + } + + public void suspend() { + mDrawing = false; + } + + public void resume() { + mDrawing = true; + //draw(0, 0, getWidth(), getHeight()); + draw(0, 0, 1280, 900); + } + + @Override protected void onDraw(Canvas canvas) { + // assume we're created + mCreated = true; + + if (mBitmap == null) { + Log.d("AndroiX", "mBitmap not ready, did [native] run?"); + postInvalidate(); // call us again + } + + canvas.drawBitmap(mBitmap, 0, 0, null); + invalidate(); + } + + /* OnKeyListener */ + + public boolean onKey(View v, int keyCode, KeyEvent event) { + if (mKeyboardPtr == 0) { Log.d("AndroiX", "keyboard not ready. kbd: " + mKeyboardPtr); return false; } + switch (event.getAction()) { + case KeyEvent.ACTION_DOWN: + Log.d("AndroiX", "onKey: ACTION_DOWN keyCode: " + keyCode); + if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { + AndroiXService.lib.trackballPress(mTrackballPtr); + AndroiXService.lib.keyDown(mKeyboardPtr, keyCode); + } else if(keyCode == KeyEvent.KEYCODE_BACK) { + AndroiX.getActivity().finish(); + return true; + } else { + AndroiXService.lib.keyDown(mKeyboardPtr, keyCode); + }; + return true; + case KeyEvent.ACTION_UP: + Log.d("AndroiX", "onKey: ACTION_UP keyCode: " + keyCode); + if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { + AndroiXService.lib.trackballRelease(mTrackballPtr); + AndroiXService.lib.keyUp(mKeyboardPtr, keyCode); + + } else { + AndroiXService.lib.keyUp(mKeyboardPtr, keyCode); + }; + return true; + + /* not handling multiple keypresses yet */ + }; + return false; + } + + /* OnTouchListener */ + + public boolean onTouch(View v, MotionEvent event) { + if (mMousePtr == 0) { Log.d("AndroiX", "mouse not ready. mouse: " + mMousePtr); return false; } + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + Log.d("AndroiX", "onTouchEvent: ACTION_DOWN x: " + event.getX() + " y: " + event.getY()); + AndroiXService.lib.touchDown(mMousePtr, (int)(event.getX()), (int)(event.getY())); + return true; + case MotionEvent.ACTION_MOVE: + Log.d("AndroiX", "onTouchEvent: ACTION_MOVE x: " + event.getX() + " y: " + event.getY()); + AndroiXService.lib.touchMove(mMousePtr, (int)(event.getX()), (int)(event.getY())); + return true; + case MotionEvent.ACTION_UP: + Log.d("AndroiX", "onTouchEvent: ACTION_UP x: " + event.getX() + " y: " + event.getY()); + AndroiXService.lib.touchUp(mMousePtr, (int)(event.getX()), (int)(event.getY())); + return true; + }; + return false; + } + + /* OnTrackballEvent */ + + @Override + public boolean onTrackballEvent(MotionEvent event) { + if (mMousePtr == 0) { Log.d("AndroiX", "trackball not ready. ball: " + mTrackballPtr); return false; } + switch (event.getAction()) { + case MotionEvent.ACTION_MOVE: + Log.d("AndroiX", "onTrackballEvent: x: " + event.getX() + " y: " + event.getY()); + AndroiXService.lib.trackballNormalizedMotion(mTrackballPtr, event.getX(), event.getY()); + return true; + case MotionEvent.ACTION_DOWN: + Log.d("AndroiX", "onTrackballEvent: ACTION_DOWN"); + AndroiXService.lib.trackballPress(mTrackballPtr); + return true; + case MotionEvent.ACTION_UP: + Log.d("AndroiX", "onTrackballEvent: ACTION_UP"); + AndroiXService.lib.trackballRelease(mTrackballPtr); + return true; + }; + return false; + } + +} diff --git a/hw/android/src/net/homeip/ofn/androix/AndroiXLib.java b/hw/android/src/net/homeip/ofn/androix/AndroiXLib.java new file mode 100755 index 000000000..acc92c645 --- /dev/null +++ b/hw/android/src/net/homeip/ofn/androix/AndroiXLib.java @@ -0,0 +1,34 @@ + +package net.homeip.ofn.androix; + +import android.util.Log; + +public class AndroiXLib implements Runnable { + public native void init(int screenWidth, int screenHeight); + public native void keyDown(int kbd, int keyCode); + public native void keyUp(int kbd, int keyCode); + public native void touchDown(int mouse, int x, int y); + public native void touchMove(int mouse, int x, int y); + public native void touchUp(int mouse, int x, int y); + public native void trackballNormalizedMotion(int ball, float x, float y); + public native void trackballPress(int ball); + public native void trackballRelease(int ball); + + private int screenWidth; + private int screenHeight; + + public AndroiXLib(int width, int height) { + screenWidth = width; + screenHeight = height; + } + + public void run() { + Log.i("AndroiX","in AndroiXLib main"); + init(screenWidth, screenHeight); + } + + static + { + System.loadLibrary("androix"); + } +} diff --git a/android/src/net/ofn/homeip/androix/AndroiXService.java b/hw/android/src/net/homeip/ofn/androix/AndroiXService.java old mode 100644 new mode 100755 similarity index 70% rename from android/src/net/ofn/homeip/androix/AndroiXService.java rename to hw/android/src/net/homeip/ofn/androix/AndroiXService.java index 49d98147d..a299409b1 --- a/android/src/net/ofn/homeip/androix/AndroiXService.java +++ b/hw/android/src/net/homeip/ofn/androix/AndroiXService.java @@ -5,6 +5,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; +import android.view.View; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -18,9 +19,22 @@ public class AndroiXService extends Service { + public static AndroiXBlitView blitView; + private static AndroiXService instance; + protected static AndroiXLib lib; + public static int screenWidth = 800; + public static int screenHeight = 480; + + public static AndroiXService getService() { return instance; } + @Override public void onCreate() { + + /* create the 2d view */ + blitView = new AndroiXBlitView(this); + + /* extract resources */ try { BufferedOutputStream os; BufferedInputStream is; @@ -57,20 +71,28 @@ public void onCreate() Log.d("AndroiX", "Done extracting /usr"); - AndroiXDixMain dixmain = new AndroiXDixMain(); - Thread mainthread = new Thread(dixmain, "AndroiX DIX Thread"); - mainthread.setDaemon(true); - mainthread.start(); + + instance = this; } -/* service should not restart when it dies */ -/* + /* service should not restart when it dies */ @Override public int onStartCommand(Intent intent, int flags, int startId) { + Log.d("AndroiX", "onStartCommand: screen size = (" + screenWidth + "x" + screenHeight + ")"); + lib = new AndroiXLib(screenWidth, screenHeight); + + Log.d("AndroiX", "Waiting for View"); + try { while(AndroiXService.blitView == null) Thread.sleep(250); } catch (InterruptedException e) {}; +// Log.d("AndroiX", "Waiting for mCreated"); +// try { while(!AndroiXService.blitView.getIsCreated()) Thread.sleep(250); } catch (InterruptedException e) {}; + Log.d("AndroiX", "Now starting the X server"); + + Thread mainthread = new Thread(lib, "AndroiX DIX Thread"); + mainthread.setDaemon(true); + mainthread.start(); return START_STICKY; } -*/ @Override public IBinder onBind(Intent intent) diff --git a/hw/android/startup.c b/hw/android/startup.c new file mode 100644 index 000000000..37bd16663 --- /dev/null +++ b/hw/android/startup.c @@ -0,0 +1,84 @@ + +#include +#include +#include "os.h" +#include "servermd.h" +#include "inputstr.h" +#include "scrnintstr.h" +#include "mibstore.h" // mi backing store implementation +#include "mipointer.h" // mi software cursor +#include "micmap.h" // mi colormap code +#include "fb.h" // fb framebuffer code +#include "site.h" +#include "globals.h" +#include "dix.h" +#include "xkbsrv.h" + +#include +#include +#include "exevents.h" +#include "extinit.h" + +//include "xserver-properties.h" + +#include +#include +#include +#include +#include +#include + +#include "android.h" +#include "screen.h" +#include "private.h" + +//static DevScreenPrivateKeyRec androidScreenKeyRec; +//define androidScreenKey (&androidScreenKeyRec) + +// Common pixmap formats +static PixmapFormatRec formats[] = { + { 1, 1, BITMAP_SCANLINE_PAD }, + { 4, 8, BITMAP_SCANLINE_PAD }, + { 8, 8, BITMAP_SCANLINE_PAD }, + { 15, 16, BITMAP_SCANLINE_PAD }, + { 16, 16, BITMAP_SCANLINE_PAD }, + { 24, 32, BITMAP_SCANLINE_PAD }, + { 32, 32, BITMAP_SCANLINE_PAD } +}; +const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); + +void AbortDDX(void) { exit(-1); } +void OsVendorInit(void) {} +void OsVendorFatalError(void) {} + +void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) { + int i; + int numFormats = 0; + + pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; + pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; + pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; + pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; + + for(i = 0; i < NUMFORMATS; i++) { + pScreenInfo->formats[i].depth = formats[i].depth; + pScreenInfo->formats[i].bitsPerPixel = formats[i].bitsPerPixel; + pScreenInfo->formats[i].scanlinePad = BITMAP_SCANLINE_PAD; + numFormats++; + } + + pScreenInfo->numPixmapFormats = numFormats; + + AddScreen(AndroidScreenInit, argc, argv); +} + +int ddxProcessArgument(int argc, char *argv[], int i) { return 0; } + +void ddxUseMsg(void) { + /* we're started from jni, not the command line */ +} + +void ddxGiveUp(void) { + LogMessage(X_ERROR, "[startup] AndroiX DIX Exiting"); +} + diff --git a/android/tests/AndroidManifest.xml b/hw/android/tests/AndroidManifest.xml similarity index 100% rename from android/tests/AndroidManifest.xml rename to hw/android/tests/AndroidManifest.xml diff --git a/android/tests/build.xml b/hw/android/tests/build.xml similarity index 100% rename from android/tests/build.xml rename to hw/android/tests/build.xml diff --git a/android/tests/default.properties b/hw/android/tests/default.properties similarity index 100% rename from android/tests/default.properties rename to hw/android/tests/default.properties diff --git a/android/local.properties b/hw/android/tests/local.properties similarity index 100% rename from android/local.properties rename to hw/android/tests/local.properties diff --git a/android/tests/src/com/example/HelloJni/HelloJniTest.java b/hw/android/tests/src/com/example/HelloJni/HelloJniTest.java similarity index 100% rename from android/tests/src/com/example/HelloJni/HelloJniTest.java rename to hw/android/tests/src/com/example/HelloJni/HelloJniTest.java diff --git a/hw/android/usrdata.zip b/hw/android/usrdata.zip new file mode 100644 index 000000000..efbd92042 Binary files /dev/null and b/hw/android/usrdata.zip differ diff --git a/hw/android/vfb.sh b/hw/android/vfb.sh new file mode 100755 index 000000000..e6adee1b1 --- /dev/null +++ b/hw/android/vfb.sh @@ -0,0 +1 @@ +CC="/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc" CFLAGS="-W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ -DDEBUG" LDFLAGS="-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -ldl -llog -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc" PKG_CONFIG_PATH="/opt/androix/usr/lib/pkgconfig" ./configure --host arm-eabi --prefix=/opt/androix/usr --disable-xorg --disable-glx --disable-xinerama --disable-xnest --enable-android --with-xkb-path="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb" --with-xkb-output="/data/data/net.homeip.ofn.androix/usr/share/X11/xkb/compiled" --with-default-font-path="/data/data/net.homeip.ofn.androix/usr/share/fonts/X11" --with-xkb-bin-directory="/data/data/net.homeip.ofn.androix/usr/bin" --prefix=/opt/androix/usr diff --git a/hw/android/xandroix/.gitignore b/hw/android/xandroix/.gitignore new file mode 100644 index 000000000..ca8b481f1 --- /dev/null +++ b/hw/android/xandroix/.gitignore @@ -0,0 +1,4 @@ +xfakelibdynamic +xandroix +xandroixdynamic +xandroixinputstree diff --git a/android/jni/Android.mk b/hw/android/xandroix/Android.mk similarity index 85% rename from android/jni/Android.mk rename to hw/android/xandroix/Android.mk index c4af6b7c6..2b2422ea7 100644 --- a/android/jni/Android.mk +++ b/hw/android/xandroix/Android.mk @@ -22,11 +22,11 @@ include $(CLEAR_VARS) #LOCAL_STATIC_LIBRARIES := libfakedix LOCAL_MODULE := androix -LOCAL_SRC_FILES := androix.c +LOCAL_SRC_FILES := stub.c LOCAL_LDFLAGS := -L/opt/androix/usr/lib -lz -llog -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype -#LOCAL_STATIC_LIBRARIES := libxfakelib libXdmcp pixman-1 libXfont libXau libfontenc freetype -LOCAL_STATIC_LIBRARIES := libxfakelib +#LOCAL_STATIC_LIBRARIES := libxfakelib +LOCAL_STATIC_LIBRARIES := libxandroid include $(BUILD_SHARED_LIBRARY) #include $(BUILD_STATIC_LIBRARY) diff --git a/hw/android/xandroix/Makefile b/hw/android/xandroix/Makefile new file mode 100644 index 000000000..e97ae8719 --- /dev/null +++ b/hw/android/xandroix/Makefile @@ -0,0 +1,42 @@ +#PLATFORM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm +PREBUILT=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0 +PLATFORM=/opt/androix +CC=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc +NM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-nm +PKG_CONFIG_PATH=/opt/androix/usr/lib/pkgconfig +CFLAGS = -W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib +CFLAGS += -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ +LDFLAGS=-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -lz -llog +LDFLAGS += -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc + +LDFLAGS_BIN += -L../obj/local/armeabi -landroix +LDFLAGS_BIN += /opt/androix/usr/lib/crtbegin_dynamic.o + +LDFLAGS_STATIC += ../obj/local/armeabi/libxandroid.a +LDFLAGS_STATIC += /opt/androix/usr/lib/crtbegin_dynamic.o + +LOCAL_LDFLAGS += -L/opt/androix/usr/lib -Bstatic -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype +BUILD_LDFLAGS += -Bstatic -L../obj/local/armeabi -lxandroid + +LDFLAGS_LIB += -shared ../obj/local/armeabi/libxandroid.a + +xfakelibdynamic: andmain.c + ${CC} -o xfakelibdynamic andmain.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroixdynamic: xandroix.c stub.c + ${CC} -o xandroixdynamic xandroix.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroix: xandroix.c stub.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroix xandroix.c stub.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputstress: xandroixinputstress.c inputstress.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputstress xandroixinputstress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputkeypress: xandroixinputkeypress.c inputstubs.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputkeypress xandroixinputkeypress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +libandroix.so: stub.c ../obj/local/armeabi/libxandroid.a + $(CC) -o libandroix.so stub.c ${CFLAGS} ${LDFLAGS} ${LOCAL_LDFLAGS} ${LDFLAGS_LIB} + + +.PHONY: xfakelibdynamic xandroix libandroix.so diff --git a/hw/android/xandroix/Makefile.am b/hw/android/xandroix/Makefile.am new file mode 100644 index 000000000..b4c0dab03 --- /dev/null +++ b/hw/android/xandroix/Makefile.am @@ -0,0 +1,13 @@ + + +bin_PROGRAMS = inputgen xandroixinputgen + +inputgen_SOURCES = inputgen.c +inputgen_DEPENDENCES = xandroixinputgen +inputgen_CFLAGS = $(CFLAGS) + +xandroixinputgen_SOURCES = xandroixinputgen.c +xandroixinputgen_DEPENDENCIES = ../obj/local/armeabi/libxandroid.a + + + diff --git a/hw/android/xandroix/Makefile.native b/hw/android/xandroix/Makefile.native new file mode 100644 index 000000000..458a2f741 --- /dev/null +++ b/hw/android/xandroix/Makefile.native @@ -0,0 +1,63 @@ +#PLATFORM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm +#PREBUILT=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0 +#PLATFORM=/opt/androix +#CC=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc +#NM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-nm +PKG_CONFIG_PATH=/opt/androix/usr/lib/pkgconfig +#CFLAGS = -W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib + +CFLAGS = -W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix-native/include -I/opt/androix-native/usr/include + +#CFLAGS += -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ +CFLAGS += -Dlinux + +#LDFLAGS=-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -lz -llog +#LDFLAGS += -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc + +LDFLAGS += -L/opt/androix-native/usr/lib -L/opt/androix-native/lib -lm + +#LDFLAGS_PROG= /opt/androix/usr/lib/crtbegin_static.o +LDFLAGS_PROG= + +#LDFLAGS_BIN += -L../obj/local/armeabi -landroix +#LDFLAGS_BIN += /opt/androix/usr/lib/crtbegin_dynamic.o + +#LDFLAGS_STATIC += ../obj/local/armeabi/libxandroid.a +#LDFLAGS_STATIC += /opt/androix/usr/lib/crtbegin_dynamic.o + +#LOCAL_LDFLAGS += -L/opt/androix/usr/lib -Bstatic -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype +#LOCAL_LDFLAGS += -L/opt/androix-native/usr/lib -Bstatic -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype +LOCAL_LDFLAGS += -L/opt/androix-native/usr/lib -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype + +#BUILD_LDFLAGS += -Bstatic -L../obj/local/armeabi -lxandroid +BUILD_LDFLAGS += -Bstatic -L/opt/androix-native/usr/lib -lxandroid + +LDFLAGS_LIB += -shared ../obj/local/armeabi/libxandroid.a + +xfakelibdynamic: andmain.c + ${CC} -o xfakelibdynamic andmain.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroixdynamic: xandroix.c stub.c + ${CC} -o xandroixdynamic xandroix.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroix: xandroix.c stub.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroix xandroix.c stub.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputstress: xandroixinputstress.c inputstress.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputstress xandroixinputstress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputkeypress: xandroixinputkeypress.c inputstubs.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputkeypress xandroixinputkeypress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +# test driver program, execs xandroixinputgen +inputgen: xandroixinputgen inputgen.c + ${CC} -o inputgen inputgen.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_PROG} +#xandroixinputgen: xandroixinputgen.c inputstubs.c ../obj/local/armeabi/libxandroid.a +xandroixinputgen: xandroixinputgen.c inputstubs.c + ${CC} -o xandroixinputgen xandroixinputgen.c inputstubs.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +libandroix.so: stub.c ../obj/local/armeabi/libxandroid.a + $(CC) -o libandroix.so stub.c ${CFLAGS} ${LDFLAGS} ${LOCAL_LDFLAGS} ${LDFLAGS_LIB} + + +.PHONY: xfakelibdynamic xandroix libandroix.so diff --git a/hw/android/xandroix/Makefile.old b/hw/android/xandroix/Makefile.old new file mode 100644 index 000000000..f703c8fec --- /dev/null +++ b/hw/android/xandroix/Makefile.old @@ -0,0 +1,50 @@ +#PLATFORM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/platforms/android-8/arch-arm +PREBUILT=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0 +PLATFORM=/opt/androix +CC=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc +NM=/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-nm +PKG_CONFIG_PATH=/opt/androix/usr/lib/pkgconfig +CFLAGS = -W -Wall -O0 -g3 -Wstrict-prototypes -pipe -std=gnu99 -ffunction-sections -fno-short-enums -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -Wno-pointer-sign -Wno-override-init -I/opt/androix/include -I/opt/androix/usr/include -nostdlib +CFLAGS += -fPIC -DANDROID -I/opt/androix/usr/include -Dbionic -Dlinux -D__arm__ +LDFLAGS=-Wl,-T,/home/tmzt/src/android-ndk-4/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/opt/androix/usr/lib -L/opt/androix/usr/lib -nostdlib -lc -lm -lz -llog +LDFLAGS += -nostdlib -Wl,-dynamic-linker,/system/bin/linker -Wl,-z-nocopyreloc + +LDFLAGS_PROG= /opt/androix/usr/lib/crtbegin_static.o + +LDFLAGS_BIN += -L../obj/local/armeabi -landroix +LDFLAGS_BIN += /opt/androix/usr/lib/crtbegin_dynamic.o + +LDFLAGS_STATIC += ../obj/local/armeabi/libxandroid.a +LDFLAGS_STATIC += /opt/androix/usr/lib/crtbegin_dynamic.o + +LOCAL_LDFLAGS += -L/opt/androix/usr/lib -Bstatic -lXdmcp -lpixman-1 -lXfont -lXau -lfontenc -lfreetype +BUILD_LDFLAGS += -Bstatic -L../obj/local/armeabi -lxandroid + +LDFLAGS_LIB += -shared ../obj/local/armeabi/libxandroid.a + +xfakelibdynamic: andmain.c + ${CC} -o xfakelibdynamic andmain.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroixdynamic: xandroix.c stub.c + ${CC} -o xandroixdynamic xandroix.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_BIN} + +xandroix: xandroix.c stub.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroix xandroix.c stub.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputstress: xandroixinputstress.c inputstress.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputstress xandroixinputstress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +xandroixinputkeypress: xandroixinputkeypress.c inputstubs.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputkeypress xandroixinputkeypress.c inputstress.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +# test driver program, execs xandroixinputgen +inputgen: xandroixinputgen inputgen.c + ${CC} -o inputgen inputgen.c ${CFLAGS} ${LDFLAGS} ${LDFLAGS_PROG} +xandroixinputgen: xandroixinputgen.c inputstubs.c ../obj/local/armeabi/libxandroid.a + ${CC} -o xandroixinputgen xandroixinputgen.c inputstubs.c ${CFLAGS} ${BUILD_LDFLAGS} ${LDFLAGS} ${LDFLAGS_STATIC} ${LOCAL_LDFLAGS} + +libandroix.so: stub.c ../obj/local/armeabi/libxandroid.a + $(CC) -o libandroix.so stub.c ${CFLAGS} ${LDFLAGS} ${LOCAL_LDFLAGS} ${LDFLAGS_LIB} + + +.PHONY: xfakelibdynamic xandroix libandroix.so diff --git a/android/xfakelib/andmain.c b/hw/android/xandroix/andmain.c similarity index 100% rename from android/xfakelib/andmain.c rename to hw/android/xandroix/andmain.c diff --git a/hw/android/xandroix/inputgen.c b/hw/android/xandroix/inputgen.c new file mode 100644 index 000000000..b2f1ca3d3 --- /dev/null +++ b/hw/android/xandroix/inputgen.c @@ -0,0 +1,67 @@ + +#include +#include +#include + +#include +#include + +#include "../android.h" +#include "../androidevents.h" + +extern int dix_main(int argc, char *argv[], char *envp[]); + +int fds[2]; + +void androidSendEvent(AndroidWireEvent *ev, size_t len) +{ + AndroidWireEvent wire; + memcpy(&wire, ev, len); + + int res; +// LOG("[inputgen] writing event to eventFD"); + res = write(fds[1], &wire, sizeof(AndroidWireEvent)); +// LOG("[inputgen] wrote %d bytes", res); +} + +int main() { + int serverpid = -1; + + unsigned int k; + AndroidWireKeyDownEvent down = { ANDROIDWIREKEYDOWNEVENT, 0, NULL, 0 }; + AndroidWireKeyUpEvent up = { ANDROIDWIREKEYUPEVENT, 0, NULL, 0 }; + + pipe(fds); + + LOG("[inputgen] about to fork"); + if (!(serverpid = fork())) { + + LOG("[inputgen] [child] serverpid: %d", serverpid); + LOG("[inputgen] [child] input fd: %d", fds[0]); + + /* in child */ + dup2(fds[0], 1); /* stdin */ + close(fds[0]); + execl("xandroixinputgen", "xandroixinputgen", (char *)NULL); + + } else { + + LOG("[inputgen] [parent] serverpid: %d", serverpid); + + /* in parent */ + + /* requires the server's hw/android/events.c defaults to Android->keyboardPtr when dev is NULL */ + + for(;;) { + k = floor(rand()%100); + down.keyCode = k; + androidSendEvent((AndroidWireEvent *)&down, sizeof(AndroidWireKeyDownEvent)); + up.keyCode = k; + androidSendEvent((AndroidWireEvent *)&up, sizeof(AndroidWireKeyDownEvent)); + sleep(2); + }; + + }; + +} + diff --git a/hw/android/xandroix/inputstress.c b/hw/android/xandroix/inputstress.c new file mode 100644 index 000000000..1ca109d17 --- /dev/null +++ b/hw/android/xandroix/inputstress.c @@ -0,0 +1,77 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "../android.h" + +#include +#include + +extern void *mousePtr; +extern void *keyboardPtr; +extern void *trackballPtr; + +int androidRequestInputLock() { + LOG("[stub] androidRequestInputLock"); + return 1; +}; + +int androidReleaseInputLock() { + LOG("[stub] androidReleaseInputLock"); + return 1; +}; + +void androidInitNative(JavaVM *jvm) { + LOG("[stub] androidInitNative"); +}; + +void androidInitNativeScreen(void *screen) { + LOG("[stub] androidInitNativeScreen: screen: %p", screen); +}; + +int androidInitNativeKeyboard(void *keyboard) { + LOG("[stub] androidInitNativeKeyboard: keyboard: %p", keyboard); + keyboardPtr = keyboard; + return 0; +}; + +int androidInitNativeMouse(void *mouse) { + LOG("[stub] androidInitNativeMouse: mouse: %p", mouse); + mousePtr = mouse; + return 0; +}; + +int androidInitNativeTrackball(void *ball) { + LOG("[stub] androidInitNativeTrackball: ball: %p", ball); + trackballPtr = ball; + return 0; +}; + +int androidInitNativeFramebuffer(void *base, void **bufPtr, int width, int height, int depth) { + void *buf = (void*)bufPtr; + int bpp = depth/8; + LOG("[stub] androidInitNativeFramebuffer: base: %p buf: %p width: %d height: %d bpp: %d", base, buf, width, height, bpp); + return 0; +}; + +void androidDraw(int x, int y, int w, int h) { + LOG("[stub] androidInitNativeFramebuffer: %d,%d,%d,%d", x, y, w, h); +}; diff --git a/hw/android/xandroix/inputstubs.c b/hw/android/xandroix/inputstubs.c new file mode 100644 index 000000000..b35eb7530 --- /dev/null +++ b/hw/android/xandroix/inputstubs.c @@ -0,0 +1,74 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "../android.h" + +#include +#include + + +int androidRequestInputLock() { + LOG("[stub] androidRequestInputLock"); + return 1; +}; + +int androidReleaseInputLock() { + LOG("[stub] androidReleaseInputLock"); + return 1; +}; + +void androidInitNative(JavaVM *jvm) { + LOG("[stub] androidInitNative"); +}; + +void androidInitNativeScreen(void *screen) { + LOG("[stub] androidInitNativeScreen: screen: %p", screen); +}; + +int androidInitNativeKeyboard(void *keyboard) { + LOG("[stub] androidInitNativeKeyboard: keyboard: %p", keyboard); + Android->keyboardPtr = keyboard; + return 0; +}; + +int androidInitNativeMouse(void *mouse) { + LOG("[stub] androidInitNativeMouse: mouse: %p", mouse); + Android->mousePtr = mouse; + return 0; +}; + +int androidInitNativeTrackball(void *ball) { + LOG("[stub] androidInitNativeTrackball: ball: %p", ball); + Android->trackballPtr = ball; + return 0; +}; + +int androidInitNativeFramebuffer(void *base, void **bufPtr, int width, int height, int depth) { + void *buf = (void*)bufPtr; + int bpp = depth/8; + LOG("[stub] androidInitNativeFramebuffer: base: %p buf: %p width: %d height: %d bpp: %d", base, buf, width, height, bpp); + return 0; +}; + +void androidDraw(int x, int y, int w, int h) { + LOG("[stub] androidInitNativeFramebuffer: %d,%d,%d,%d", x, y, w, h); +}; diff --git a/hw/android/xandroix/stub.c b/hw/android/xandroix/stub.c new file mode 100644 index 000000000..6fd8dd488 --- /dev/null +++ b/hw/android/xandroix/stub.c @@ -0,0 +1,65 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "../android.h" + +#include +#include + +int androidRequestInputLock() { + LOG("[stub] androidRequestInputLock"); + return 1; +}; + +int androidReleaseInputLock() { + LOG("[stub] androidReleaseInputLock"); + return 1; +}; + +void androidInitNative(JavaVM *jvm) { + LOG("[stub] androidInitNative"); +}; + +void androidInitNativeScreen(void *screen) { + LOG("[stub] androidInitNativeScreen: screen: %p", screen); +}; + +int androidInitNativeKeyboard(void *keyboard) { + LOG("[stub] androidInitNativeKeyboard: keyboard: %p", keyboard); + return 0; +}; + +int androidInitNativeMouse(void *mouse) { + LOG("[stub] androidInitNativeMouse: mouse: %p", mouse); + return 0; +}; + +int androidInitNativeFramebuffer(void *base, void **bufPtr, int width, int height, int depth) { + void *buf = (void*)bufPtr; + int bpp = depth/8; + LOG("[stub] androidInitNativeFramebuffer: base: %p buf: %p width: %d height: %d bpp: %d", base, buf, width, height, bpp); + return 0; +}; + +void androidDraw(int x, int y, int w, int h) { + LOG("[stub] androidInitNativeFramebuffer: %d,%d,%d,%d", x, y, w, h); +}; diff --git a/hw/android/xandroix/test.sh b/hw/android/xandroix/test.sh new file mode 100755 index 000000000..e8c347b0f --- /dev/null +++ b/hw/android/xandroix/test.sh @@ -0,0 +1,2 @@ +cp /opt/androix/usr/lib/libxandroid.a ../obj/local/armeabi/ +/home/tmzt/src/android-ndk-4/android-ndk-r4b/ndk-build diff --git a/hw/kdrive/fakelib/main.c b/hw/android/xandroix/xandroix.c similarity index 84% rename from hw/kdrive/fakelib/main.c rename to hw/android/xandroix/xandroix.c index 44c25a500..88521d757 100644 --- a/hw/kdrive/fakelib/main.c +++ b/hw/android/xandroix/xandroix.c @@ -20,15 +20,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "../android.h" + #include #include + extern int dix_main(int argc, char *argv[], char *envp[]); int main(int argc, char *argv[], char *envp[]) { - fprintf(stderr, "[xfakelib main] starting dix_main in main thread\n"); + Android = (AndroidVars *)calloc(sizeof(AndroidVars), 1); + + LOG("[xandroix main] starting dix_main in main thread\n"); dix_main(argc, argv, envp); - fprintf(stderr, "[xfakelib main] dix_main exited in main thread\n"); + LOG("[xandroix main] dix_main exited in main thread\n"); } diff --git a/hw/android/xandroix/xandroixinputgen.c b/hw/android/xandroix/xandroixinputgen.c new file mode 100644 index 000000000..3115e687b --- /dev/null +++ b/hw/android/xandroix/xandroixinputgen.c @@ -0,0 +1,50 @@ + +#include +#include +#include +#include +#include +#include + +#include + +#include "../android.h" +#include "../androidevents.h" + +extern int dix_main(int argc, char *argv[], char *envp[]); +AndroidVars *Android; + +int main(/*int argc, char *argv[], char *envp[]*/) { + int res; + struct stat stats; + int mode = 0666; + + char *name = "X"; + char *arg1 = ":1"; + char *argv[] = {name, arg1}; + char *envp = NULL; + + Android = (AndroidVars *)calloc(sizeof(AndroidVars), 1); + Android->keyboardPtr = NULL; + Android->mousePtr = NULL; + Android->trackballPtr = NULL; + androidInitNative(NULL); + + LOG("fixing up /data/data/net.homeip.ofn.androix/usr/bin/xkbcomp"); + + chmod("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", 0775); + + LOG("done."); + + stat("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", &stats); + +// LOG("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp mode: %o" + stats.st_mode); + + LOG("local (android) socket (STDIN): %d", 1); + Android->eventFD[0] = 1; + + LOG("starting DIX"); + dix_main(2, (char**)argv, (char**)&envp); + LOG("returning from DIX (this shouldn't happen)"); +} + diff --git a/hw/android/xandroix/xandroixinputkeypress.c b/hw/android/xandroix/xandroixinputkeypress.c new file mode 100644 index 000000000..3c0f2d32a --- /dev/null +++ b/hw/android/xandroix/xandroixinputkeypress.c @@ -0,0 +1,177 @@ +/* + +Copyright 2010 Timothy Meade + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name(s) of the above copyright +holders shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization. + +includes code from quartzStartup.c, copyright 2001-2004 Torrey T. Lyons. All Rights Reserved + +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "../android.h" +#include "../androidevents.h" + +extern int dix_main(int argc, char *argv[], char *envp[]); +static pthread_mutex_t events_lock = PTHREAD_MUTEX_INITIALIZER; +AndroidVars *Android; + +int main_thread_id; +int server_thread_id; +int stress_thread_id; + +struct arg { + int argc; + char **argv; + char **envp; +}; + +static void server_thread (void *arg) { + struct arg args = *((struct arg *)arg); + int res; + struct stat stats; + int mode = 0666; + free(arg); + + char *argv[] = {":1"}; + char *envp[] = {}; + + LOG("fixing up /data/data/net.homeip.ofn.androix/usr/bin/xkbcomp"); + + chmod("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", 0775); + + LOG("done."); + + stat("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", &stats); + + LOG("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp mode: %o" + stats.st_mode); + + LOG("creating event event socket pair"); + socketpair(AF_UNIX, SOCK_STREAM, 0, Android->eventFD); + LOG("remote (Xorg) socket: %d", Android->eventFD[0]); + LOG("local (android) socket: %d", Android->eventFD[1]); + + LOG("starting DIX"); + dix_main(1, argv, envp); + LOG("returning from DIX (this shouldn't happen)"); +} + +void androidSendEvent(AndroidWireEvent *ev, size_t len) +{ + AndroidWireEvent wire; + memcpy(&wire, ev, len); + + int res; + LOG("writing event to eventFD"); + res = write(Android->eventFD[1], &wire, sizeof(AndroidWireEvent)); + LOG("wrote %d bytes", res); +} + +void wakeupFD() { + int res; + char nullbyte=0; + // oh, i ... er ... christ. + LOG("writing to eventFD"); + res = write(Android->eventFD[1], &nullbyte, sizeof(nullbyte)); +// res = write(Android->wakeupFD[1], "X", 1); + LOG("wrote %d bytes", res); +} + +static void stress_thread (void) { + unsigned int k; + AndroidWireKeyDownEvent down = { ANDROIDWIREKEYDOWNEVENT, 0, NULL, 0 }; + AndroidWireKeyUpEvent up = { ANDROIDWIREKEYUPEVENT, 0, NULL, 0 }; + + fprintf(stderr, "[xfakelib stress_thread] starting input stress test\n"); + for(;;) { + while (!keyboardPtr) sleep(1); + k = floor(rand()%100); + down.dev = (void *)keyboardPtr; + down.keyCode = k; + androidSendEvent((AndroidWireEvent *)&down, sizeof(AndroidWireKeyDownEvent)); + up.dev = (void *)keyboardPtr; + up.keyCode = k; + androidSendEvent((AndroidWireEvent *)&up, sizeof(AndroidWireKeyDownEvent)); + sleep(2); + }; + + fprintf(stderr, "[xfakelib stress_thread] stress test finished (should not happen)"); + exit(0); +} + +static pthread_t create_thread (void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; + + fprintf(stderr, "[xfakelib create_thread] creating thread\n"); + + pthread_attr_init (&attr); + pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + pthread_create (&tid, &attr, func, arg); + pthread_attr_destroy (&attr); + + return tid; +} + +int main(int argc, char *argv[], char *envp[]) +{ + struct arg *args = (struct arg*)malloc(sizeof(struct arg)); + + args->argc = argc; + args->argv = argv; + args->envp = envp; + + main_thread_id = pthread_self(); + + Android = (AndroidVars *)calloc(sizeof(AndroidVars), 1); + Android->events_lock = &events_lock; + androidInitNative(NULL); + + server_thread_id = create_thread(server_thread, args); + + fprintf(stderr, "[xfakelib main] server_thread_id: %d\n", server_thread_id); + + if (!server_thread_id) { + fprintf(stderr, "[xfakelib main] can't create server thread\n"); + } + + stress_thread_id = create_thread(stress_thread, NULL); + + if (!server_thread_id) { + fprintf(stderr, "[xfakelib main] can't create stress thread\n"); + } + +// stress_thread(); + while(1) {}; + + fprintf(stderr, "[xfakelib main] exited in main thread\n"); +} + diff --git a/hw/kdrive/fakelib/main6.c b/hw/android/xandroix/xandroixinputstress.c similarity index 54% rename from hw/kdrive/fakelib/main6.c rename to hw/android/xandroix/xandroixinputstress.c index a76438776..ebab2e97d 100644 --- a/hw/kdrive/fakelib/main6.c +++ b/hw/android/xandroix/xandroixinputstress.c @@ -30,13 +30,23 @@ includes code from quartzStartup.c, copyright 2001-2004 Torrey T. Lyons. All Rig #include #include #include +#include +#include #include +#include + +#include "../android.h" extern int dix_main(int argc, char *argv[], char *envp[]); +AndroidVars *Android; int main_thread_id; int server_thread_id; +int stress_thread_id; + +void *mousePtr; +void *keyboardPtr; struct arg { int argc; @@ -47,12 +57,58 @@ struct arg { static void server_thread (void *arg) { struct arg args = *((struct arg *)arg); int res; + struct stat stats; + int mode = 0666; free(arg); - fprintf(stderr, "[xfakelib server_thread] starting dix_main\n"); - res = dix_main(args.argc, args.argv, args.envp); - fprintf(stderr, "[xfakelib server_thread] dix_main exit: %d\n", res); - exit(res); + char *argv[] = {":1"}; + char *envp[] = {}; + + LOG("fixing up /data/data/net.homeip.ofn.androix/usr/bin/xkbcomp"); + + chmod("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", 0775); + + LOG("done."); + + stat("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp", &stats); + + LOG("/data/data/net.homeip.ofn.androix/usr/bin/xkbcomp mode: %o" + stats.st_mode); + + LOG("creating event wakeup socket pair"); + socketpair(AF_UNIX, SOCK_STREAM, 0, Android->wakeupFD); + LOG("remote (Xorg) socket: %d", Android->wakeupFD[0]); + LOG("local (android) socket: %d", Android->wakeupFD[1]); + + LOG("starting DIX"); + dix_main(1, argv, envp); + LOG("returning from DIX (this shouldn't happen)"); +} + +void wakeupFD() { + int res; + char nullbyte=0; + // oh, i ... er ... christ. + LOG("writing to wakeupFD"); + res = write(Android->wakeupFD[1], &nullbyte, sizeof(nullbyte)); +// res = write(Android->wakeupFD[1], "X", 1); + LOG("wrote %d bytes", res); +} + +static void stress_thread (void) { + unsigned int x, y; + + fprintf(stderr, "[xfakelib stress_thread] starting input stress test\n"); + for(;;) { + if (!mousePtr) continue; + x = floor(rand()%800); + y = floor(rand()%480); + androidCallbackTouchDown(mousePtr, x, y); + wakeupFD(); + sleep(1); + }; + + fprintf(stderr, "[xfakelib stress_thread] stress test finished (should not happen)"); + exit(0); } static pthread_t create_thread (void *func, void *arg) { @@ -79,15 +135,28 @@ int main(int argc, char *argv[], char *envp[]) args->envp = envp; main_thread_id = pthread_self(); + + Android = (AndroidVars *)calloc(sizeof(AndroidVars), 1); + androidInitNative(NULL); + server_thread_id = create_thread(server_thread, args); fprintf(stderr, "[xfakelib main] server_thread_id: %d\n", server_thread_id); if (!server_thread_id) { - fprintf(stderr, "[xfakelib main] can't create secondary thread\n"); + fprintf(stderr, "[xfakelib main] can't create server thread\n"); + } + +// stress_thread_id = create_thread(stress_thread, NULL); + +/* + if (!server_thread_id) { + fprintf(stderr, "[xfakelib main] can't create stress thread\n"); } +*/ - while(1) {}; + stress_thread(); +// while(1) {}; fprintf(stderr, "[xfakelib main] exited in main thread\n"); } diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index 0d0634628..fb727e656 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -1,6 +1,5 @@ -DIST_SUBDIRS = input config glxProxy examples doc -SUBDIRS = input config examples +SUBDIRS = input config examples doc doxygen man bin_PROGRAMS = Xdmx if XINERAMA @@ -15,10 +14,6 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod GLX_DEFS = @GL_CFLAGS@ endif -if BUILDDOCS -SUBDIRS += doc -endif - AM_CFLAGS = \ -DHAVE_DMX_CONFIG_H \ $(DIX_CFLAGS) \ @@ -81,8 +76,8 @@ Xdmx_SOURCES = dmx.c \ #endif XDMX_LIBS = \ - @XDMX_LIBS@ \ $(GLX_LIBS) \ + @XDMX_LIBS@ \ input/libdmxinput.a \ config/libdmxconfig.a @@ -90,28 +85,5 @@ Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) Xdmx_DEPENDENCIES= $(XDMX_LIBS) Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) -# Man page -appmandir = $(APP_MAN_DIR) - -appman_PRE = Xdmx.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -CLEANFILES = $(appman_DATA) - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' - -SUFFIXES = .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ - -EXTRA_DIST = $(appman_PRE) - relink: $(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT) diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am index 25a814e79..de4ce315d 100644 --- a/hw/dmx/config/Makefile.am +++ b/hw/dmx/config/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + noinst_LIBRARIES = libdmxconfig.a LIBSRCS = parser.y \ @@ -53,26 +55,7 @@ dmxtodmx_DEPENDENCIES = libdmxconfig.a dmxtodmx_SOURCES = dmxtodmx.c dmxtodmx_LDADD = -L. -ldmxconfig -appmandir = $(APP_MAN_DIR) - -appman_PRE = xdmxconfig.man vdltodmx.man dmxtodmx.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -CLEANFILES = $(appman_DATA) - -SUFFIXES = .$(APP_MAN_SUFFIX) .man - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MAN_SUBSTS = -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' - -.man.$(APP_MAN_SUFFIX): - $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ - EXTRA_DIST = \ - $(appman_PRE) \ test-a.in test-a.out \ test-b.in test-b.out \ test-c.in test-c.out \ diff --git a/hw/dmx/config/man/Makefile.am b/hw/dmx/config/man/Makefile.am new file mode 100644 index 000000000..9bb62a4c6 --- /dev/null +++ b/hw/dmx/config/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = xdmxconfig.man vdltodmx.man dmxtodmx.man diff --git a/hw/dmx/config/dmxtodmx.man b/hw/dmx/config/man/dmxtodmx.man similarity index 100% rename from hw/dmx/config/dmxtodmx.man rename to hw/dmx/config/man/dmxtodmx.man diff --git a/hw/dmx/config/vdltodmx.man b/hw/dmx/config/man/vdltodmx.man similarity index 100% rename from hw/dmx/config/vdltodmx.man rename to hw/dmx/config/man/vdltodmx.man diff --git a/hw/dmx/config/xdmxconfig.man b/hw/dmx/config/man/xdmxconfig.man similarity index 100% rename from hw/dmx/config/xdmxconfig.man rename to hw/dmx/config/man/xdmxconfig.man diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c index 033b52512..c67077aec 100644 --- a/hw/dmx/config/xdmxconfig.c +++ b/hw/dmx/config/xdmxconfig.c @@ -142,7 +142,7 @@ static void dmxConfigGetDims(int *maxWidth, int *maxHeight) DMXConfigEntryPtr e; *maxWidth = dmxConfigWallWidth = 0; - *maxWidth = dmxConfigWallHeight = 0; + *maxHeight = dmxConfigWallHeight = 0; if (!dmxConfigCurrent) return; dmxConfigWallWidth = dmxConfigCurrent->width; diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index 1dee077b5..f3e41ac17 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -231,8 +231,9 @@ static int ProcDMXForceWindowCreation(ClientPtr client) PanoramiXRes *win; int i; - if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW, - DixReadAccess))) + if (Success != dixLookupResourceByType((pointer*) &win, + stuff->window, XRT_WINDOW, + client, DixReadAccess)) return -1; /* BadWindow */ FOR_NSCREENS(i) { @@ -506,8 +507,9 @@ static int dmxPopulatePanoramiX(ClientPtr client, Window window, int count = 0; DMXWindowAttributesRec attr; - if (!(win = SecurityLookupIDByType(client, window, XRT_WINDOW, - DixReadAccess))) + if (Success != dixLookupResourceByType((pointer*) &win, + window, XRT_WINDOW, + client, DixReadAccess)) return -1; /* BadWindow */ FOR_NSCREENS(i) { diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index bf4b92cb2..c6b6199a5 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -249,8 +249,6 @@ typedef struct _DMXScreenInfo { TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; } DMXScreenInfo; /* Global variables available to all Xserver/hw/dmx routines. */ diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c index 4e7279a51..d0eb35117 100644 --- a/hw/dmx/dmxcb.c +++ b/hw/dmx/dmxcb.c @@ -46,6 +46,7 @@ extern int connBlockScreenStart; #ifdef PANORAMIX +#include "panoramiXsrv.h" extern int PanoramiXPixWidth; extern int PanoramiXPixHeight; extern int PanoramiXNumScreens; @@ -137,7 +138,7 @@ void dmxConnectionBlockCallback(void) } dmxLog(dmxInfo, "%d screens configured with Xinerama (%d %d)\n", PanoramiXNumScreens, PanoramiXPixWidth, PanoramiXPixHeight); - for (i = 0; i < PanoramiXNumScreens; i++) found[i] = FALSE; + FOR_NSCREENS(i) found[i] = FALSE; } else { #endif /* This never happens because we're @@ -177,7 +178,7 @@ void dmxConnectionBlockCallback(void) #ifdef PANORAMIX if (!noPanoramiXExtension) { int k; - for (k = 0; k < PanoramiXNumScreens; k++) { + FOR_NSCREENS(k) { DMXScreenInfo *dmxScreen = &dmxScreens[k]; if (dmxScreen->beDisplay) { @@ -203,7 +204,7 @@ void dmxConnectionBlockCallback(void) #ifdef PANORAMIX if (!noPanoramiXExtension) { Bool fatal = FALSE; - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { fatal |= !found[i]; if (!found[i]) { dmxLog(dmxError, diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index 009283505..db5709ee6 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -699,17 +699,18 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type, PixmapPtr pPix; int i; - pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP); + dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id, + RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv = NULL; if (i == idx) continue; /* Self replication is bad */ - pSrc = - (PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP); + dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id, + RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { DMXScreenInfo *dmxSrcScreen = &dmxScreens[i]; @@ -854,7 +855,7 @@ static void dmxBERestorePixmap(PixmapPtr pPixmap) static void dmxBECreateResources(pointer value, XID id, RESTYPE type, pointer n) { - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { @@ -1058,7 +1059,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n) { PicturePtr pPicture = value; /* The picture */ DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */ - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; if (pDraw->pScreen->myNum != scrnNum) { /* Picture not on the screen we are restoring*/ @@ -1080,7 +1081,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n) static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n) { GlyphSetPtr glyphSet = value; - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum]; GlyphRefPtr table; @@ -1273,7 +1274,7 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindAllClientResources(clients[i], dmxBECreateResources, - (pointer)idx); + (pointer)(uintptr_t)idx); /* Create window hierarchy (top down) */ dmxBECreateWindowTree(idx); @@ -1282,13 +1283,15 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindClientResourcesByType(clients[i],PictureType, - dmxBERestoreRenderPict,(pointer)idx); + dmxBERestoreRenderPict, + (pointer)(uintptr_t)idx); /* Restore the glyph state for RENDER */ for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindClientResourcesByType(clients[i],GlyphSetType, - dmxBERestoreRenderGlyph,(pointer)idx); + dmxBERestoreRenderGlyph, + (pointer)(uintptr_t)idx); /* Refresh screen by generating exposure events for all windows */ dmxForceExposures(idx); @@ -1365,17 +1368,18 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type, PixmapPtr pPix; int i; - pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP); + dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id, + RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ - for (i = 0; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS(i) { PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv = NULL; if (i == idx) continue; /* Self replication is bad */ - pSrc = - (PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP); + dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id, + RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { FoundPixImage = True; @@ -1451,7 +1455,7 @@ static void dmxBESavePixmap(PixmapPtr pPixmap) static void dmxBEDestroyResources(pointer value, XID id, RESTYPE type, pointer n) { - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { @@ -1594,7 +1598,7 @@ int dmxDetachScreen(int idx) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindAllClientResources(clients[i], dmxBEDestroyResources, - (pointer)idx); + (pointer)(uintptr_t)idx); /* Free scratch GCs */ dmxBEDestroyScratchGCs(idx); diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 829200e6a..f10f9a074 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -383,12 +383,7 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) break; case CT_PIXMAP: - case CT_UNSORTED: - case CT_YSORTED: - case CT_YXSORTED: - case CT_YXBANDED: - /* These clip types are condensed down to either NONE or REGION - in the mi code */ + /* Condensed down to REGION in the mi code */ break; } diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c index 589c6377b..500e2cdf1 100644 --- a/hw/dmx/dmxgcops.c +++ b/hw/dmx/dmxgcops.c @@ -523,18 +523,20 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw) if (noPanoramiXExtension) return NULL; if (pDrawable->type != DRAWABLE_PIXMAP) return NULL; - - if (!(pXinPix = (PanoramiXRes *)LookupIDByType(pDrawable->id, XRT_PIXMAP))) + + if (Success != dixLookupResourceByType((pointer*) &pXinPix, + pDrawable->id, XRT_PIXMAP, + NullClient, DixUnknownAccess)) return NULL; - for (i = 1; i < PanoramiXNumScreens; i++) { + FOR_NSCREENS_FORWARD_SKIP(i) { dmxScreen = &dmxScreens[i]; if (dmxScreen->beDisplay) { PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv; - pSrc = (PixmapPtr)LookupIDByType(pXinPix->info[i].id, - RT_PIXMAP); + dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id, + RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { *draw = pSrcPriv->pixmap; diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 915e7678a..1fb54620a 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -165,8 +165,6 @@ Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps); DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps); - DMX_WRAP(TriStrip, dmxTriStrip, dmxScreen, ps); - DMX_WRAP(TriFan, dmxTriFan, dmxScreen, ps); return TRUE; } @@ -271,9 +269,11 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client) /* Look up glyphSet that was just created ???? */ /* Store glyphsets from backends in glyphSet->devPrivate ????? */ /* Make sure we handle all errors here!! */ - - glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType, - DixDestroyAccess); + + dixLookupResourceByType((pointer*) &glyphSet, + stuff->gsid, GlyphSetType, + client, DixDestroyAccess); + glyphPriv = malloc(sizeof(dmxGlyphPrivRec)); if (!glyphPriv) return BadAlloc; glyphPriv->glyphSets = NULL; @@ -314,8 +314,9 @@ static int dmxProcRenderFreeGlyphSet(ClientPtr client) REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType, - DixDestroyAccess); + dixLookupResourceByType((pointer*) &glyphSet, + stuff->glyphset, GlyphSetType, + client, DixDestroyAccess); if (glyphSet && glyphSet->refcnt == 1) { dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); @@ -357,8 +358,9 @@ static int dmxProcRenderAddGlyphs(ClientPtr client) CARD8 *bits; int nbytes; - glyphSet = SecurityLookupIDByType(client, stuff->glyphset, - GlyphSetType, DixReadAccess); + dixLookupResourceByType((pointer*) &glyphSet, + stuff->glyphset, GlyphSetType, + client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); nglyphs = stuff->nglyphs; @@ -400,8 +402,9 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client) REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType, - DixWriteAccess); + dixLookupResourceByType((pointer*) &glyphSet, + stuff->glyphset, GlyphSetType, + client, DixWriteAccess); if (glyphSet) { dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); @@ -472,14 +475,18 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) GlyphSetPtr glyphSet; dmxGlyphPrivPtr glyphPriv; - pSrc = SecurityLookupIDByType(client, stuff->src, PictureType, - DixReadAccess); + dixLookupResourceByType((pointer*) &pSrc, + stuff->src, PictureType, + client, DixReadAccess); + pSrcPriv = DMX_GET_PICT_PRIV(pSrc); if (!pSrcPriv->pict) return ret; - pDst = SecurityLookupIDByType(client, stuff->dst, PictureType, - DixWriteAccess); + dixLookupResourceByType((pointer*) &pDst, + stuff->dst, PictureType, + client, DixWriteAccess); + pDstPriv = DMX_GET_PICT_PRIV(pDst); if (!pDstPriv->pict) return ret; @@ -495,8 +502,9 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) return ret; if (stuff->maskFormat) - pFmt = SecurityLookupIDByType(client, stuff->maskFormat, - PictFormatType, DixReadAccess); + dixLookupResourceByType((pointer*) &pFmt, + stuff->maskFormat, PictFormatType, + client, DixReadAccess); else pFmt = NULL; @@ -546,8 +554,9 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) curGlyph = glyphs; curElt = elts; - glyphSet = SecurityLookupIDByType(client, stuff->glyphset, - GlyphSetType, DixReadAccess); + dixLookupResourceByType((pointer*) &glyphSet, + stuff->glyphset, GlyphSetType, + client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); while (buffer + sizeof(xGlyphElt) < end) { @@ -555,10 +564,11 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client) buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { - glyphSet = SecurityLookupIDByType(client, - *((CARD32 *)buffer), - GlyphSetType, - DixReadAccess); + dixLookupResourceByType((pointer*) &glyphSet, + *((CARD32 *)buffer), + GlyphSetType, + client, + DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); buffer += 4; } else { @@ -1011,8 +1021,6 @@ void dmxValidatePicture(PicturePtr pPicture, Mask mask) attribs.poly_edge = pPicture->polyEdge; if (mask & CPPolyMode) attribs.poly_mode = pPicture->polyMode; - if (mask & CPDither) - attribs.dither = pPicture->dither; if (mask & CPComponentAlpha) attribs.component_alpha = pPicture->componentAlpha; @@ -1227,88 +1235,3 @@ void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps); } - -/** Composite a triangle strip on the appropriate screen. For a - * complete description see the protocol document of the RENDER - * library. */ -void dmxTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, - int npoint, xPointFixed *points) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - PictureScreenPtr ps = GetPictureScreen(pScreen); - dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc); - dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst); - - DMX_UNWRAP(TriStrip, dmxScreen, ps); -#if 0 - if (ps->TriStrip) - ps->TriStrip(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points); -#endif - - /* Draw trapezoids on back-end server */ - if (pDstPriv->pict) { - XRenderPictFormat *pFormat; - - pFormat = dmxFindFormat(dmxScreen, maskFormat); - if (!pFormat) { - /* FIXME: Error! */ - } - - XRenderCompositeTriStrip(dmxScreen->beDisplay, - op, - pSrcPriv->pict, - pDstPriv->pict, - pFormat, - xSrc, ySrc, - (XPointFixed *)points, - npoint); - dmxSync(dmxScreen, FALSE); - } - - DMX_WRAP(TriStrip, dmxTriStrip, dmxScreen, ps); -} - -/** Composite a triangle fan on the appropriate screen. For a complete - * description see the protocol document of the RENDER library. */ -void dmxTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, - int npoint, xPointFixed *points) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - PictureScreenPtr ps = GetPictureScreen(pScreen); - dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc); - dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst); - - DMX_UNWRAP(TriFan, dmxScreen, ps); -#if 0 - if (ps->TriFan) - ps->TriFan(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points); -#endif - - /* Draw trapezoids on back-end server */ - if (pDstPriv->pict) { - XRenderPictFormat *pFormat; - - pFormat = dmxFindFormat(dmxScreen, maskFormat); - if (!pFormat) { - /* FIXME: Error! */ - } - - XRenderCompositeTriFan(dmxScreen->beDisplay, - op, - pSrcPriv->pict, - pDstPriv->pict, - pFormat, - xSrc, ySrc, - (XPointFixed *)points, - npoint); - dmxSync(dmxScreen, FALSE); - } - - DMX_WRAP(TriFan, dmxTriFan, dmxScreen, ps); -} diff --git a/hw/dmx/dmxpict.h b/hw/dmx/dmxpict.h index 3c8a09ce4..a732991e4 100644 --- a/hw/dmx/dmxpict.h +++ b/hw/dmx/dmxpict.h @@ -100,16 +100,6 @@ extern void dmxTriangles(CARD8 op, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle *tris); -extern void dmxTriStrip(CARD8 op, - PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, - int npoint, xPointFixed *points); -extern void dmxTriFan(CARD8 op, - PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, - int npoint, xPointFixed *points); extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet); extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet); diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 6d2f2d3f5..7a94627f0 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -283,8 +283,6 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL)) return FALSE; - miInitializeBackingStore(pScreen); - if (dmxShadowFB) { miDCInitialize(pScreen, &dmxPointerCursorFuncs); } else { diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index 44848281f..704fcff54 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -84,7 +84,8 @@ Window dmxCreateRootWindow(WindowPtr pWindow) parent = dmxScreen->scrnWin; /* This is our "Screen" window */ visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual; - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP); + dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow), + RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); mask = CWEventMask | CWBackingStore | CWColormap | CWBorderPixel; @@ -114,7 +115,7 @@ Window dmxCreateRootWindow(WindowPtr pWindow) } /** Change the location and size of the "screen" window. Called from - * #dmxConfigureScreenWindow(). */ + * dmxextension.c dmxConfigureScreenWindow(). */ void dmxResizeScreenWindow(ScreenPtr pScreen, int x, int y, int w, int h) { @@ -137,7 +138,7 @@ void dmxResizeScreenWindow(ScreenPtr pScreen, } /** Change the location and size of the "root" window. Called from - * #dmxConfigureRootWindow. */ + * #dmxCreateWindow. */ void dmxResizeRootWindow(WindowPtr pRoot, int x, int y, int w, int h) { @@ -191,8 +192,8 @@ void dmxGetDefaultWindowAttributes(WindowPtr pWindow, ColormapPtr pCmap; dmxColormapPrivPtr pCmapPriv; - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), - RT_COLORMAP); + dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow), + RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); *cmap = pCmapPriv->cmap; } else { @@ -545,7 +546,8 @@ static void dmxDoChangeWindowAttributes(WindowPtr pWindow, ColormapPtr pCmap; dmxColormapPrivPtr pCmapPriv; - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP); + dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow), + RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); attribs->colormap = pCmapPriv->cmap; } diff --git a/hw/dmx/doc/.gitignore b/hw/dmx/doc/.gitignore index 6bdd862f3..9629c1538 100644 --- a/hw/dmx/doc/.gitignore +++ b/hw/dmx/doc/.gitignore @@ -1,10 +1,6 @@ -# Add & Override for this directory and it's subdirectories -html/ -dmx.html -dmx.pdf -dmx.ps -dmx.txt -scaled.html -scaled.pdf -scaled.ps -scaled.txt +*.html +*.pdf +*.ps +*.txt +!DMXSpec.txt +!DMXSpec-v1.txt diff --git a/hw/dmx/doc/Makefile.am b/hw/dmx/doc/Makefile.am index 58306d24c..0713884cd 100644 --- a/hw/dmx/doc/Makefile.am +++ b/hw/dmx/doc/Makefile.am @@ -19,249 +19,16 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -XML_FILES = dmx.xml scaled.xml - -include ../../../doc/xml/xmlrules.in - if ENABLE_DEVEL_DOCS -noinst_DATA = $(BUILT_DOC_FILES) -endif -CLEANFILES = $(CLEAN_DOC_FILES) - -if HAVE_DOXYGEN - -DOXYGEN_SRC=doxygen.head doxygen.foot doxygen.css doxygen.conf - -all-local: html/annotated.html - -dist-local: html/annotated.html - -html/annotated.html: $(DOXYGEN_SRC) - $(DOXYGEN) $(srcdir)/doxygen.conf - -maintainer-clean-local: - rm -rf html/ -endif - -EXTRA_DIST = \ - $(XML_FILES) \ - DMXSpec.txt \ - DMXSpec-v1.txt \ - dmx.txt \ - doxygen.conf \ - doxygen.css \ - doxygen.foot \ - doxygen.head \ - scaled.txt \ - html/annotated.html \ - html/ChkNotMaskEv_8c.html \ - html/ChkNotMaskEv_8h.html \ - html/ChkNotMaskEv_8h_source.html \ - html/classes.html \ - html/dmx_8h.html \ - html/dmx_8h_source.html \ - html/dmxarg_8c.html \ - html/dmxarg_8h.html \ - html/dmxarg_8h_source.html \ - html/dmxbackend_8c.html \ - html/dmxbackend_8h.html \ - html/dmxbackend_8h_source.html \ - html/dmxcb_8c.html \ - html/dmxcb_8h.html \ - html/dmxcb_8h_source.html \ - html/dmxclient_8h.html \ - html/dmxclient_8h_source.html \ - html/dmxcmap_8c.html \ - html/dmxcmap_8h.html \ - html/dmxcmap_8h_source.html \ - html/dmxcommon_8c.html \ - html/dmxcommon_8h.html \ - html/dmxcommon_8h_source.html \ - html/dmxcompat_8c.html \ - html/dmxcompat_8h.html \ - html/dmxcompat_8h_source.html \ - html/dmxconfig_8c.html \ - html/dmxconfig_8h.html \ - html/dmxconfig_8h_source.html \ - html/dmxconsole_8c.html \ - html/dmxconsole_8h.html \ - html/dmxconsole_8h_source.html \ - html/dmxcursor_8c.html \ - html/dmxcursor_8h.html \ - html/dmxcursor_8h_source.html \ - html/dmxdetach_8c.html \ - html/dmxdpms_8c.html \ - html/dmxdpms_8h.html \ - html/dmxdpms_8h_source.html \ - html/dmxdummy_8c.html \ - html/dmxdummy_8h.html \ - html/dmxdummy_8h_source.html \ - html/dmxevents_8c.html \ - html/dmxevents_8h.html \ - html/dmxevents_8h_source.html \ - html/dmxextension_8c.html \ - html/dmxextension_8h.html \ - html/dmxextension_8h_source.html \ - html/dmxfont_8c.html \ - html/dmxfont_8h.html \ - html/dmxfont_8h_source.html \ - html/dmxgc_8c.html \ - html/dmxgc_8h.html \ - html/dmxgc_8h_source.html \ - html/dmxgcops_8c.html \ - html/dmxgcops_8h.html \ - html/dmxgcops_8h_source.html \ - html/dmx__glxvisuals_8h_source.html \ - html/dmxinit_8c.html \ - html/dmxinit_8h.html \ - html/dmxinit_8h_source.html \ - html/dmxinput_8c.html \ - html/dmxinput_8h.html \ - html/dmxinput_8h_source.html \ - html/dmxinputinit_8c.html \ - html/dmxinputinit_8h.html \ - html/dmxinputinit_8h_source.html \ - html/dmxlog_8c.html \ - html/dmxlog_8h.html \ - html/dmxlog_8h_source.html \ - html/dmxmap_8c.html \ - html/dmxmap_8h.html \ - html/dmxmap_8h_source.html \ - html/dmxmotion_8c.html \ - html/dmxmotion_8h.html \ - html/dmxmotion_8h_source.html \ - html/dmxparse_8c.html \ - html/dmxparse_8h.html \ - html/dmxparse_8h_source.html \ - html/dmxpict_8c.html \ - html/dmxpict_8h.html \ - html/dmxpict_8h_source.html \ - html/dmxpixmap_8c.html \ - html/dmxpixmap_8h.html \ - html/dmxpixmap_8h_source.html \ - html/dmxprint_8c.html \ - html/dmxprint_8h.html \ - html/dmxprint_8h_source.html \ - html/dmxprop_8c.html \ - html/dmxprop_8h.html \ - html/dmxprop_8h_source.html \ - html/dmxscrinit_8c.html \ - html/dmxscrinit_8h.html \ - html/dmxscrinit_8h_source.html \ - html/dmxshadow_8c.html \ - html/dmxshadow_8h.html \ - html/dmxshadow_8h_source.html \ - html/dmxsigio_8c.html \ - html/dmxsigio_8h.html \ - html/dmxsigio_8h_source.html \ - html/dmxstat_8c.html \ - html/dmxstat_8h.html \ - html/dmxstat_8h_source.html \ - html/dmxsync_8c.html \ - html/dmxsync_8h.html \ - html/dmxsync_8h_source.html \ - html/dmxvisual_8c.html \ - html/dmxvisual_8h.html \ - html/dmxvisual_8h_source.html \ - html/dmxwindow_8c.html \ - html/dmxwindow_8h.html \ - html/dmxwindow_8h_source.html \ - html/dmxxinput_8c.html \ - html/doxygen.css \ - html/doxygen.png \ - html/files.html \ - html/ftv2blank.png \ - html/ftv2doc.png \ - html/ftv2folderclosed.png \ - html/ftv2folderopen.png \ - html/ftv2lastnode.png \ - html/ftv2link.png \ - html/ftv2mlastnode.png \ - html/ftv2mnode.png \ - html/ftv2node.png \ - html/ftv2plastnode.png \ - html/ftv2pnode.png \ - html/ftv2vertline.png \ - html/functions.html \ - html/functions_vars.html \ - html/globals_defs.html \ - html/globals_enum.html \ - html/globals_eval.html \ - html/globals_func.html \ - html/globals.html \ - html/globals_type.html \ - html/globals_vars.html \ - html/index.html \ - html/lnx-keyboard_8c.html \ - html/lnx-keyboard_8h.html \ - html/lnx-keyboard_8h_source.html \ - html/lnx-ms_8c.html \ - html/lnx-ms_8h.html \ - html/lnx-ms_8h_source.html \ - html/lnx-ps2_8c.html \ - html/lnx-ps2_8h.html \ - html/lnx-ps2_8h_source.html \ - html/main.html \ - html/struct__dmxArg.html \ - html/struct__dmxColormapPriv.html \ - html/structDMXConfigCmdStruct.html \ - html/struct__DMXConfigComment.html \ - html/struct__DMXConfigDisplay.html \ - html/struct__DMXConfigEntry.html \ - html/struct__DMXConfigFullDim.html \ - html/structDMXConfigListStruct.html \ - html/struct__DMXConfigNumber.html \ - html/struct__DMXConfigOption.html \ - html/struct__DMXConfigPair.html \ - html/struct__DMXConfigParam.html \ - html/struct__DMXConfigPartDim.html \ - html/struct__DMXConfigString.html \ - html/struct__DMXConfigSub.html \ - html/struct__DMXConfigToken.html \ - html/struct__DMXConfigVirtual.html \ - html/struct__DMXConfigWall.html \ - html/struct__dmxCursorPriv.html \ - html/structDMXDesktopAttributesRec.html \ - html/struct__DMXEventMap.html \ - html/struct__dmxFontPriv.html \ - html/struct__dmxGCPriv.html \ - html/structdmxGlxVisualPrivate.html \ - html/struct__dmxGlyphPriv.html \ - html/structDMXInputAttributesRec.html \ - html/struct__DMXInputInfo.html \ - html/struct__DMXLocalInitInfo.html \ - html/struct__DMXLocalInputInfo.html \ - html/struct__dmxPictPriv.html \ - html/struct__dmxPixPriv.html \ - html/structDMXScreenAttributesRec.html \ - html/struct__DMXScreenInfo.html \ - html/struct__DMXStatAvg.html \ - html/struct__DMXStatInfo.html \ - html/structDMXWindowAttributesRec.html \ - html/struct__dmxWinPriv.html \ - html/struct__myPrivate.html \ - html/tree.html \ - html/usb-common_8c.html \ - html/usb-common_8h.html \ - html/usb-common_8h_source.html \ - html/usb-keyboard_8c.html \ - html/usb-keyboard_8h.html \ - html/usb-keyboard_8h_source.html \ - html/usb-mouse_8c.html \ - html/usb-mouse_8h.html \ - html/usb-mouse_8h_source.html \ - html/usb-other_8c.html \ - html/usb-other_8h.html \ - html/usb-other_8h_source.html \ - html/usb-private_8h.html \ - html/usb-private_8h_source.html +if HAVE_XMLTO -$(builddir)/doxygen.head: - $(LN_S) $(srcdir)/doxygen.head $@ +# Main DocBook/XML files (DOCTYPE book) +docbook = dmx.xml scaled.xml -$(builddir)/doxygen.foot: - $(LN_S) $(srcdir)/doxygen.foot $@ +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/devbook.am -$(builddir)doxygen.css: - $(LN_S) $(srcdir)/doxygen.css $@ +endif HAVE_XMLTO +endif ENABLE_DEVEL_DOCS +EXTRA_DIST = DMXSpec.txt DMXSpec-v1.txt diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml index c6dc0ccd4..8dbb7d86f 100644 --- a/hw/dmx/doc/dmx.xml +++ b/hw/dmx/doc/dmx.xml @@ -817,22 +817,10 @@ is called once for each input device. Once input handles for core keyboard and core pointer devices have -been obtained from AddInputDevice(), they are registered as core devices -by calling RegisterPointerDevice() and RegisterKeyboardDevice(). Each -of these should be called once. If both core devices are not +been obtained from AddInputDevice(). If both core devices are not registered, then the X server will exit with a fatal error when it attempts to start the input devices in InitAndStartDevices(), which is called directly after InitInput() (see below). - - - -Register{Pointer,Keyboard}Device() -These DIX functions take a -handle returned from AddInputDevice() and initialize the core input -device fields in inputInfo, and initialize the input processing and grab -functions for each core input device. - - The core pointer device is then registered with the miPointer code diff --git a/hw/dmx/doc/doxygen.conf b/hw/dmx/doc/doxygen.conf deleted file mode 100644 index f7a541f90..000000000 --- a/hw/dmx/doc/doxygen.conf +++ /dev/null @@ -1,1053 +0,0 @@ -# Doxyfile 1.3.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "Distributed Multihead X" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = "dmx-1-2-20040604 and later" - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explict @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# reimplements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = .. \ - ../input \ - ../config - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = ../config/parser.c \ - ../config/parser.h \ - ../config/scanner.c - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = YES - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = atKeynames.h \ - Canvas*.* - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = doxygen.head - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = doxygen.foot - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet - -HTML_STYLESHEET = doxygen.css - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output dir. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimised for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assigments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = SHAPE \ - RENDER \ - XKB \ - XINPUT - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superceded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similiar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = gif - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/hw/dmx/doc/doxygen.css b/hw/dmx/doc/doxygen.css deleted file mode 100644 index 841f709a7..000000000 --- a/hw/dmx/doc/doxygen.css +++ /dev/null @@ -1,49 +0,0 @@ -H1 { text-align: center; } -CAPTION { font-weight: bold } -A.qindex {} -A.qindexRef {} -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #eeeeee } -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #f2f2ff; font-weight: bold; } -TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } -TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { background: white } -TD.indexkey { - background-color: #eeeeff; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px -} -FONT.keyword { color: #008000 } -FONT.keywordtype { color: #604020 } -FONT.keywordflow { color: #e08000 } -FONT.comment { color: #800000 } -FONT.preprocessor { color: #806020 } -FONT.stringliteral { color: #002080 } -FONT.charliteral { color: #008080 } diff --git a/hw/dmx/doc/doxygen.foot b/hw/dmx/doc/doxygen.foot deleted file mode 100644 index 3aca11763..000000000 --- a/hw/dmx/doc/doxygen.foot +++ /dev/null @@ -1,12 +0,0 @@ -
-
- - Generated June 29, 2004 for Distributed Multihead X by - doxygen - 1.3.4. - - - - - diff --git a/hw/dmx/doc/doxygen.head b/hw/dmx/doc/doxygen.head deleted file mode 100644 index 89bda8fda..000000000 --- a/hw/dmx/doc/doxygen.head +++ /dev/null @@ -1,8 +0,0 @@ - - - - - File Index - - - diff --git a/hw/dmx/doxygen/.gitignore b/hw/dmx/doxygen/.gitignore new file mode 100644 index 000000000..550262f01 --- /dev/null +++ b/hw/dmx/doxygen/.gitignore @@ -0,0 +1,2 @@ +html/ +doxygen.conf diff --git a/hw/xfree86/doc/sgml/Makefile.am b/hw/dmx/doxygen/Makefile.am similarity index 80% rename from hw/xfree86/doc/sgml/Makefile.am rename to hw/dmx/doxygen/Makefile.am index 5322b4263..fe159df5c 100644 --- a/hw/xfree86/doc/sgml/Makefile.am +++ b/hw/dmx/doxygen/Makefile.am @@ -19,13 +19,18 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -XML_FILES = DESIGN.xml +if ENABLE_DEVEL_DOCS +if HAVE_DOXYGEN -include ../../../../doc/xml/xmlrules.in +# Developers documentation is not installed +noinst_DATA = html/index.html +dist_noinst_DATA = doxygen.conf.in footer.html -if ENABLE_DEVEL_DOCS -noinst_DATA = $(BUILT_DOC_FILES) -endif -CLEANFILES = $(CLEAN_DOC_FILES) +html/index.html: + $(AM_V_GEN)$(DOXYGEN) doxygen.conf + +clean-local: + $(AM_V_at)rm -fr html/ -EXTRA_DIST = $(XML_FILES) +endif HAVE_DOXYGEN +endif ENABLE_DEVEL_DOCS diff --git a/hw/dmx/doxygen/doxygen.conf.in b/hw/dmx/doxygen/doxygen.conf.in new file mode 100644 index 000000000..3dbb27ec0 --- /dev/null +++ b/hw/dmx/doxygen/doxygen.conf.in @@ -0,0 +1,1559 @@ +# Doxyfile 1.6.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "Distributed Multihead X" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "@PACKAGE_VERSION@" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/.. \ + @srcdir@/../input \ + @srcdir@/../config + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = @srcdir@/../config/parser.c \ + @srcdir@/../config/parser.h \ + @srcdir@/../config/scanner.c + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = YES + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = atKeynames.h \ + Canvas*.* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = @srcdir@/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = SHAPE \ + RENDER \ + XKB \ + XINPUT + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = gif + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/hw/dmx/doxygen/footer.html b/hw/dmx/doxygen/footer.html new file mode 100644 index 000000000..f80dc8269 --- /dev/null +++ b/hw/dmx/doxygen/footer.html @@ -0,0 +1,4 @@ +
+Generated on $datetime for $projectname by doxygen $doxygenversion
+ + diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index a9744e186..f79264ea9 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -101,8 +101,8 @@ static int CreateContext(__GLXclientState *cl, int from_screen = screen; int to_screen = screen; DMXScreenInfo *dmxScreen; - VisualID be_vid; - GLXFBConfigID be_fbconfigId; + VisualID be_vid = 0; + GLXFBConfigID be_fbconfigId = 0; int num_be_screens; Display *dpy; @@ -129,7 +129,8 @@ static int CreateContext(__GLXclientState *cl, if (shareList == None) { shareglxc = NULL; } else { - shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes); + dixLookupResourceByType((pointer*) &shareglxc, shareList, + __glXContextRes, NullClient, DixUnknownAccess); if (!shareglxc) { client->errorValue = shareList; return __glXBadContext; @@ -420,14 +421,14 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc) rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess); if (rc != Success) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable, + __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable, - __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable, + __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) pDraw = pGlxWindow->pDraw; } @@ -450,14 +451,14 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc) rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess); if (rc != Success) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable, + __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable, - __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable, + __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) pDraw = pGlxWindow->pDraw; } @@ -470,14 +471,16 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc) rc = dixLookupDrawable(&pMember, req->member, client, 0, DixGetAttrAccess); if (rc != Success) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, req->member, + __glXPixmapRes, NullClient, + DixUnknownAccess); if (pGlxPixmap) pMember = pGlxPixmap->pDraw; } if (!pMember && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(req->member, - __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, req->member, + __glXWindowRes, NullClient, + DixUnknownAccess); if (pGlxWindow) pMember = pGlxWindow->pDraw; } @@ -505,7 +508,8 @@ int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc) int to_screen = 0; int s; - glxc = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes); + dixLookupResourceByType((pointer*) &glxc, gcId, __glXContextRes, + NullClient, DixUnknownAccess); if (glxc) { /* ** Just free the resource; don't actually destroy the context, @@ -752,7 +756,8 @@ static int MakeCurrent(__GLXclientState *cl, ** Lookup new context. It must not be current for someone else. */ if (contextId != None) { - glxc = (__GLXcontext *) LookupIDByType(contextId, __glXContextRes); + dixLookupResourceByType((pointer*) &glxc, contextId, __glXContextRes, + NullClient, DixUnknownAccess); if (!glxc) { client->errorValue = contextId; return __glXBadContext; @@ -802,8 +807,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pDraw) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, drawId, + __glXPixmapRes, NullClient, + DixUnknownAccess); if (pGlxPixmap) { /* ** Check if pixmap and context are similar. @@ -826,7 +832,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, drawId, + __glXWindowRes, NullClient, + DixUnknownAccess); if (pGlxWindow) { /* ** Drawable is a GLXWindow. @@ -847,7 +855,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); + dixLookupResourceByType((pointer*) &pGlxPbuffer, drawId, + __glXPbufferRes, NullClient, + DixUnknownAccess); if (pGlxPbuffer) { if (pGlxPbuffer->pScreen != glxc->pScreen || pGlxPbuffer->pFBConfig != glxc->pFBConfig) { @@ -908,8 +918,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pReadDraw) { - pReadGlxPixmap = (__GLXpixmap *) LookupIDByType(readId, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pReadGlxPixmap, readId, + __glXPixmapRes, NullClient, + DixUnknownAccess); if (pReadGlxPixmap) { /* ** Check if pixmap and context are similar. @@ -929,8 +940,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxReadWindow = (__glXWindow *) - LookupIDByType(readId, __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxReadWindow, readId, + __glXWindowRes, NullClient, + DixUnknownAccess); if (pGlxReadWindow) { /* ** Drawable is a GLXWindow. @@ -950,7 +962,9 @@ static int MakeCurrent(__GLXclientState *cl, } if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxReadPbuffer = (__glXPbuffer *)LookupIDByType(readId, __glXPbufferRes); + dixLookupResourceByType((pointer*) &pGlxReadPbuffer, readId, + __glXPbufferRes, NullClient, + DixUnknownAccess); if (pGlxReadPbuffer) { if (pGlxReadPbuffer->pScreen != glxc->pScreen || pGlxReadPbuffer->pFBConfig != glxc->pFBConfig) { @@ -1090,14 +1104,16 @@ static int MakeCurrent(__GLXclientState *cl, to_screen = screenInfo.numScreens - 1; if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) { - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } if (pReadDraw && pReadDraw != pDraw && new_reply.readType != GLX_PBUFFER_TYPE) { - pXinReadDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinReadDraw, + pReadDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } else { pXinReadDraw = pXinDraw; @@ -1303,7 +1319,8 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc) /* ** Find the GL context. */ - glxc = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes); + dixLookupResourceByType((pointer*) &glxc, req->context, __glXContextRes, + NullClient, DixUnknownAccess); if (!glxc) { client->errorValue = req->context; return __glXBadContext; @@ -1449,12 +1466,14 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc) /* ** Check that each context exists. */ - src = (__GLXcontext *) LookupIDByType(source, __glXContextRes); + dixLookupResourceByType((pointer*) &src, source, __glXContextRes, + NullClient, DixUnknownAccess); if (!src) { client->errorValue = source; return __glXBadContext; } - dst = (__GLXcontext *) LookupIDByType(dest, __glXContextRes); + dixLookupResourceByType((pointer*) &dst, dest, __glXContextRes, + NullClient, DixUnknownAccess); if (!dst) { client->errorValue = dest; return __glXBadContext; @@ -1531,7 +1550,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc) int i, p; screen = req->screen; - if (screen > screenInfo.numScreens) { + if (screen >= screenInfo.numScreens) { /* The client library must send a valid screen number. */ client->errorValue = screen; return BadValue; @@ -1641,7 +1660,7 @@ static int CreateGLXPixmap(__GLXclientState *cl, return BadMatch; } - if (fbconfigId == NULL && visual == NULL) { + if (fbconfigId == 0 && visual == 0) { return BadValue; } @@ -1714,6 +1733,7 @@ static int CreateGLXPixmap(__GLXclientState *cl, else { pVisual = NULL; pGlxVisual = NULL; + pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum]; } pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap)); @@ -1748,8 +1768,9 @@ static int CreateGLXPixmap(__GLXclientState *cl, from_screen = 0; to_screen = screenInfo.numScreens - 1; - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } #endif @@ -1870,7 +1891,8 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) /* ** Check if it's a valid GLX pixmap. */ - pGlxPixmap = (__GLXpixmap *)LookupIDByType(glxpixmap, __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, glxpixmap, + __glXPixmapRes, NullClient, DixUnknownAccess); if (!pGlxPixmap) { client->errorValue = glxpixmap; return __glXBadPixmap; @@ -1953,8 +1975,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag) } if (!pDraw) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, drawId, + __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { /* ** Drawable is a GLX pixmap. @@ -1965,7 +1987,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag) } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, drawId, + __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { /* ** Drawable is a GLXWindow. @@ -1994,8 +2017,9 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag) if (!noPanoramiXExtension) { from_screen = 0; to_screen = screenInfo.numScreens - 1; - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); + dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess); } #endif @@ -2100,8 +2124,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc) } if (!pDraw) { - pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, - __glXPixmapRes); + dixLookupResourceByType((pointer*) &pGlxPixmap, drawId, + __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { /* ** Drawable is a GLX pixmap. @@ -2111,7 +2135,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc) } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) { - pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); + dixLookupResourceByType((pointer*) &pGlxWindow, drawId, + __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { /* ** Drawable is a GLXWindow. @@ -2565,7 +2590,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major; cl->GLClientminorVersion = req->minor; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); buf = (const char *)(req+1); cl->GLClientextensions = strdup(buf); @@ -2620,9 +2645,13 @@ int __glXUseXFont(__GLXclientState *cl, GLbyte *pc) ** Font can actually be either the ID of a font or the ID of a GC ** containing a font. */ - pFont = (FontPtr)LookupIDByType(req->font, RT_FONT); + dixLookupResourceByType((pointer*) &pFont, req->font, RT_FONT, + NullClient, DixUnknownAccess); if (!pFont) { - GC *pGC = (GC *)LookupIDByType(req->font, RT_GC); + GC *pGC; + dixLookupResourceByType((pointer*) &pGC, req->font, + RT_GC, NullClient, + DixUnknownAccess); if (!pGC) { client->errorValue = req->font; return BadFont; @@ -2680,7 +2709,7 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc) int numFBConfigs, i, p; __GLXscreenInfo *pGlxScreen; - if (screen > screenInfo.numScreens) { + if (screen >= screenInfo.numScreens) { /* The client library must send a valid screen number. */ client->errorValue = screen; return BadValue; @@ -2873,6 +2902,7 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc) VisualPtr pVisual; VisualID visId; int i, rc; + pointer val; /* ** Check if windowId is valid @@ -2938,7 +2968,9 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc) /* ** Check if there is already a fbconfig associated with this window */ - if ( LookupIDByType(glxwindowId, __glXWindowRes) ) { + if (Success == dixLookupResourceByType(&val, + glxwindowId, __glXWindowRes, + NullClient, DixUnknownAccess)) { client->errorValue = glxwindowId; return BadAlloc; } @@ -2970,11 +3002,14 @@ int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc) ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; XID glxwindow = req->glxwindow; + pointer val; /* ** Check if it's a valid GLX window. */ - if (!LookupIDByType(glxwindow, __glXWindowRes)) { + if (Success != dixLookupResourceByType(&val, + glxwindow, __glXWindowRes, + NullClient, DixUnknownAccess)) { client->errorValue = glxwindow; return __glXBadDrawable; } @@ -2998,7 +3033,8 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc) int nReplyBytes; req = (xGLXQueryContextReq *)pc; - ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes); + dixLookupResourceByType((pointer*) &ctx, req->context, __glXContextRes, + NullClient, DixUnknownAccess); if (!ctx) { client->errorValue = req->context; return __glXBadContext; @@ -3043,7 +3079,10 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) int nReplyBytes; req = (xGLXQueryContextInfoEXTReq *)pc; - ctx = (__GLXcontext *) SecurityLookupIDByType(client, req->context, __glXContextRes, DixReadAccess); + dixLookupResourceByType((pointer*) &ctx, + req->context, __glXContextRes, + client, DixReadAccess); + if (!ctx) { client->errorValue = req->context; return __glXBadContext; @@ -3102,7 +3141,7 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc) /* ** Look up screen and FBConfig. */ - if (screen > screenInfo.numScreens) { + if (screen >= screenInfo.numScreens) { /* The client library must send a valid screen number. */ client->errorValue = screen; return BadValue; @@ -3208,7 +3247,8 @@ int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc) /* ** Check if it's a valid Pbuffer */ - pGlxPbuffer = (__glXPbuffer *)LookupIDByType(pbuffer, __glXPbufferRes); + dixLookupResourceByType((pointer*) &pGlxPbuffer, pbuffer, + __glXPbufferRes, NullClient, DixUnknownAccess); if (!pGlxPbuffer) { client->errorValue = pbuffer; return __glXBadPbuffer; @@ -3256,32 +3296,30 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) int screen, rc; DMXScreenInfo *dmxScreen; CARD32 *attribs = NULL; - int attribs_size; + int attribs_size = 0; #ifdef PANORAMIX PanoramiXRes *pXinDraw = NULL; #endif if (drawId != None) { rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); - if (rc == Success) { - if (pDraw->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr)pDraw; - be_drawable = 0; - screen = pWin->drawable.pScreen->myNum; - - } - else { - /* - ** Drawable is not a Window , GLXWindow or a GLXPixmap. - */ - client->errorValue = drawId; - return __glXBadDrawable; - } + if (rc == Success && pDraw->type == DRAWABLE_WINDOW) { + WindowPtr pWin = (WindowPtr)pDraw; + be_drawable = 0; + screen = pWin->drawable.pScreen->myNum; + } else { + /* + ** Drawable is not a Window , GLXWindow or a GLXPixmap. + */ + client->errorValue = drawId; + return __glXBadDrawable; } if (!pDraw) { - __GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, - __glXPixmapRes); + __GLXpixmap *pGlxPixmap; + dixLookupResourceByType((pointer*) &pGlxPixmap, + drawId, __glXPixmapRes, + NullClient, DixUnknownAccess); if (pGlxPixmap) { pDraw = pGlxPixmap->pDraw; screen = pGlxPixmap->pScreen->myNum; @@ -3290,7 +3328,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) } if (!pDraw) { - __glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); + __glXWindow *pGlxWindow; + dixLookupResourceByType((pointer*) &pGlxWindow, + drawId, __glXWindowRes, + NullClient, DixUnknownAccess); if (pGlxWindow) { pDraw = pGlxWindow->pDraw; screen = pGlxWindow->pScreen->myNum; @@ -3299,24 +3340,25 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) } if (!pDraw) { - __glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); + __glXPbuffer *pGlxPbuffer; + dixLookupResourceByType((pointer*) &pGlxPbuffer, + drawId, __glXPbufferRes, + NullClient, DixUnknownAccess); if (pGlxPbuffer) { pDraw = (DrawablePtr)pGlxPbuffer; screen = pGlxPbuffer->pScreen->myNum; be_drawable = pGlxPbuffer->be_xids[screen]; } } - - - if (!pDraw) { - /* - ** Drawable is not a Window , GLXWindow or a GLXPixmap. - */ - client->errorValue = drawId; - return __glXBadDrawable; - } } + if (!pDraw) { + /* + ** Drawable is not a Window , GLXWindow or a GLXPixmap. + */ + client->errorValue = drawId; + return __glXBadDrawable; + } /* if the drawable is a window or GLXWindow - * we need to find the base id on the back-end server @@ -3326,9 +3368,9 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) #ifdef PANORAMIX if (!noPanoramiXExtension) { - pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); - if (!pXinDraw) { + if (Success != dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess)) { client->errorValue = drawId; return __glXBadDrawable; } @@ -3419,25 +3461,22 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) if (drawId != None) { rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess); - if (rc == Success) { - if (pDraw->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr)pDraw; - be_drawable = 0; - screen = pWin->drawable.pScreen->myNum; - - } - else { - /* - ** Drawable is not a Window , GLXWindow or a GLXPixmap. - */ - client->errorValue = drawId; - return __glXBadDrawable; - } + if (rc == Success && pDraw->type == DRAWABLE_WINDOW) { + be_drawable = 0; + screen = pDraw->pScreen->myNum; + } else { + /* + ** Drawable is not a Window , GLXWindow or a GLXPixmap. + */ + client->errorValue = drawId; + return __glXBadDrawable; } if (!pDraw) { - __GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId, - __glXPixmapRes); + __GLXpixmap *pGlxPixmap; + dixLookupResourceByType((pointer*) &pGlxPixmap, + drawId, __glXPixmapRes, + NullClient, DixUnknownAccess); if (pGlxPixmap) { pDraw = pGlxPixmap->pDraw; screen = pGlxPixmap->pScreen->myNum; @@ -3446,7 +3485,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) } if (!pDraw) { - __glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes); + __glXWindow *pGlxWindow; + dixLookupResourceByType((pointer*) &pGlxWindow, + drawId, __glXWindowRes, + NullClient, DixUnknownAccess); if (pGlxWindow) { pDraw = pGlxWindow->pDraw; screen = pGlxWindow->pScreen->myNum; @@ -3455,24 +3497,25 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) } if (!pDraw) { - __glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes); + __glXPbuffer *pGlxPbuffer; + dixLookupResourceByType((pointer*) &pGlxPbuffer, + drawId, __glXPbufferRes, + NullClient, DixUnknownAccess); if (pGlxPbuffer) { pDraw = (DrawablePtr)pGlxPbuffer; screen = pGlxPbuffer->pScreen->myNum; be_drawable = pGlxPbuffer->be_xids[screen]; } } + } - - if (!pDraw) { + if (!pDraw) { /* ** Drawable is not a Window , GLXWindow or a GLXPixmap. */ client->errorValue = drawId; return __glXBadDrawable; - } - } - + } /* if the drawable is a window or GLXWindow - * we need to find the base id on the back-end server @@ -3482,9 +3525,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) #ifdef PANORAMIX if (!noPanoramiXExtension) { - PanoramiXRes *pXinDraw = (PanoramiXRes *) - SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess); - if (!pXinDraw) { + PanoramiXRes *pXinDraw; + if (Success != dixLookupResourceByClass((pointer*) &pXinDraw, + pDraw->id, XRC_DRAWABLE, + client, DixReadAccess)) { client->errorValue = drawId; return __glXBadDrawable; } diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c index 44f1c1592..22940593b 100644 --- a/hw/dmx/glxProxy/glxcmdsswap.c +++ b/hw/dmx/glxProxy/glxcmdsswap.c @@ -252,7 +252,7 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc) __GLX_SWAP_INT(&req->screen); screen = req->screen; - if (screen > screenInfo.numScreens) { + if (screen >= screenInfo.numScreens) { /* The client library must send a valid screen number. */ client->errorValue = screen; return BadValue; diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index a8fc0a88d..7f63b6b0b 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex) Display **keep_be_displays; int i; - if (cl->returnBuf) free(cl->returnBuf); - if (cl->currentContexts) free(cl->currentContexts); - if (cl->currentDrawables) free(cl->currentDrawables); - if (cl->largeCmdBuf) free(cl->largeCmdBuf); + free(cl->returnBuf); + free(cl->currentContexts); + free(cl->currentDrawables); + free(cl->largeCmdBuf); for (i=0; i< screenInfo.numScreens; i++) { if (cl->be_displays[i]) @@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex) */ cl->GLClientmajorVersion = 1; cl->GLClientminorVersion = 0; - if (cl->GLClientextensions) free(cl->GLClientextensions); + free(cl->GLClientextensions); memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *)); } @@ -186,8 +186,12 @@ void __glXFreeGLXWindow(__glXWindow *pGlxWindow) { if (!pGlxWindow->idExists && !pGlxWindow->refcnt) { WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw; + WindowPtr ret; - if (LookupIDByType(pWindow->drawable.id, RT_WINDOW) == pWindow) { + dixLookupResourceByType((pointer) &ret, + pWindow->drawable.id, RT_WINDOW, + NullClient, DixUnknownAccess); + if (ret == pWindow) { (*pGlxWindow->pScreen->DestroyWindow)(pWindow); } @@ -222,10 +226,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx) { if (cx->idExists || cx->isCurrent) return GL_FALSE; - if (cx->feedbackBuf) free(cx->feedbackBuf); - if (cx->selectBuf) free(cx->selectBuf); - if (cx->real_ids) free(cx->real_ids); - if (cx->real_vids) free(cx->real_vids); + free(cx->feedbackBuf); + free(cx->selectBuf); + free(cx->real_ids); + free(cx->real_vids); if (cx->pGlxPixmap) { /* diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index 17adce46a..cd833f853 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -92,14 +92,6 @@ extern GLint __glXNumActiveScreens; extern __GLXcontext *__glXLastContext; extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*); -/* -** Macros to set, unset, and retrieve the flag that says whether a context -** has unflushed commands. -*/ -#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE -#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE -#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands) - /************************************************************************/ typedef struct { diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c index 4c473ff13..33cc612a7 100644 --- a/hw/dmx/glxProxy/glxsingle.c +++ b/hw/dmx/glxProxy/glxsingle.c @@ -215,7 +215,7 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc ) xGLXSingleReply be_reply; __GLXcontext *glxc; int buf_size; - char *be_buf; + char *be_buf = NULL; int be_buf_size; DMXScreenInfo *dmxScreen; Display *dpy; @@ -297,8 +297,8 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc ) xGLXSingleReply be_reply; __GLXcontext *glxc; int buf_size; - char *be_buf; - int be_buf_size; + char *be_buf = NULL; + int be_buf_size = 0; int from_screen = 0; int to_screen = 0; int s; @@ -811,6 +811,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc) } else { buf_size = 0; + buf = NULL; } if (buf_size > 0) { diff --git a/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c index 7ba727dc2..0b6ba4134 100644 --- a/hw/dmx/glxProxy/glxvendor.c +++ b/hw/dmx/glxProxy/glxvendor.c @@ -202,7 +202,7 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc ) xGLXVendorPrivReply be_reply; __GLXcontext *glxc; int buf_size; - char *be_buf; + char *be_buf = NULL; int be_buf_size; DMXScreenInfo *dmxScreen; Display *dpy; @@ -281,8 +281,8 @@ int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc ) xGLXVendorPrivReply be_reply; __GLXcontext *glxc; int buf_size; - char *be_buf; - int be_buf_size; + char *be_buf = NULL; + int be_buf_size = 0; int from_screen = 0; int to_screen = 0; int s; diff --git a/hw/dmx/glxProxy/render2swap.c b/hw/dmx/glxProxy/render2swap.c index 5754ff472..81bb501ea 100644 --- a/hw/dmx/glxProxy/render2swap.c +++ b/hw/dmx/glxProxy/render2swap.c @@ -261,60 +261,6 @@ void __glXDispSwap_CallLists(GLbyte *pc) } -static void swapArray(GLint numVals, GLenum datatype, - GLint stride, GLint numVertexes, GLbyte *pc) -{ - int i,j; - __GLX_DECLARE_SWAP_VARIABLES; - - switch (datatype) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - /* don't need to swap */ - return; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - for (i=0; i #include "opaque.h" #include "inputstr.h" +#include "inpututils.h" #include "mipointer.h" #include "mi.h" #include "exglobals.h" @@ -175,17 +176,15 @@ static void enqueueMotion(DevicePtr pDev, int x, int y) { GETDMXLOCALFROMPDEV; DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; + int valuators[3]; int detail = 0; /* XXX should this be mask of pressed buttons? */ + ValuatorMask mask; valuators[0] = x; valuators[1] = y; - GetEventList(&events); - nevents = GetPointerEvents(events, p, MotionNotify, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); + valuator_mask_set_range(&mask, 0, 2, valuators); + QueuePointerEvents(p, MotionNotify, detail, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; } @@ -288,16 +287,14 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, deviceValuator *xv = (deviceValuator *)xev+1; int thisX = 0; int thisY = 0; - int i; int count; - EventListPtr events; - int nevents; + ValuatorMask mask; memset(xE, 0, sizeof(xE)); if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES; - if (!pDevice->valuator->mode && axesCount == 2) { + if ((valuator_get_mode(pDevice,0) == Relative) && axesCount == 2) { /* The dmx console is a relative mode * device that sometimes reports * absolute motion. It only has two @@ -344,6 +341,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, } count = 2; } else { + int i; for (i = 0, count = 0; i < axesCount; i += 6) { xev->time = GetTimeInMillis(); xev->type = DeviceMotionNotify; @@ -370,11 +368,9 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, if (block) dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, MotionNotify, 0, POINTER_ABSOLUTE, - firstAxis, axesCount, v); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); + valuator_mask_set_range(&mask, firstAxis, axesCount, v); + QueuePointerEvents(pDevice, MotionNotify, 0, + POINTER_ABSOLUTE, &mask); if (block) dmxSigioUnblock(); @@ -388,13 +384,12 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e; XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; DeviceIntPtr pDevice = dmxLocal->pDevice; - int valuators[6]; - EventListPtr events; - int nevents, i; + int valuators[MAX_VALUATORS]; + ValuatorMask mask; if (!e) return -1; /* No extended event passed, cannot handle */ - + if ((XID)dmxLocal->deviceId != ke->deviceid) { /* Search for the correct dmxLocal, * since backend and console events are @@ -432,56 +427,42 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, } #define EXTRACT_VALUATORS(ke, valuators) \ - valuators[0] = ke->axis_data[0]; \ - valuators[1] = ke->axis_data[1]; \ - valuators[2] = ke->axis_data[2]; \ - valuators[3] = ke->axis_data[3]; \ - valuators[4] = ke->axis_data[4]; \ - valuators[5] = ke->axis_data[5]; \ + valuators[0] = ke->axis_data[0]; \ + valuators[1] = ke->axis_data[1]; \ + valuators[2] = ke->axis_data[2]; \ + valuators[3] = ke->axis_data[3]; \ + valuators[4] = ke->axis_data[4]; \ + valuators[5] = ke->axis_data[5]; \ switch (type) { case XI_DeviceKeyPress: case XI_DeviceKeyRelease: EXTRACT_VALUATORS(ke, valuators); + valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - nevents = GetKeyboardValuatorEvents(events, pDevice, event, - ke->keycode, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - + QueueKeyboardEvents(pDevice, event, ke->keycode, &mask); if (block) dmxSigioUnblock(); break; case XI_DeviceButtonPress: case XI_DeviceButtonRelease: EXTRACT_VALUATORS(ke, valuators); + valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, event, ke->keycode, - POINTER_ABSOLUTE, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - + QueuePointerEvents(pDevice, event, ke->keycode, + POINTER_ABSOLUTE, &mask); if (block) dmxSigioUnblock(); break; case XI_ProximityIn: case XI_ProximityOut: EXTRACT_VALUATORS(ke, valuators); + valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - nevents = GetProximityEvents(events, pDevice, event, - ke->first_axis, ke->axes_count, - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - + QueueProximityEvents(pDevice, event, &mask); if (block) dmxSigioUnblock(); break; @@ -662,8 +643,8 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, GETDMXINPUTFROMPDEV; xEvent xE; DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; + int valuators[3]; + ValuatorMask mask; DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); @@ -677,35 +658,25 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) xE.u.u.detail = dmxFixup(pDev, detail, keySym); - GetEventList(&events); /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ - nevents = GetKeyboardEvents(events, p, type, detail); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); + QueueKeyboardEvents(p, type, detail, NULL); return; case ButtonPress: case ButtonRelease: detail = dmxGetButtonMapping(dmxLocal, detail); - GetEventList(&events); - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, - 0, /* first_valuator = 0 */ - 0, /* num_valuators = 0 */ - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); + valuator_mask_zero(&mask); + QueuePointerEvents(p, type, detail, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; case MotionNotify: - GetEventList(&events); valuators[0] = e->xmotion.x; valuators[1] = e->xmotion.y; valuators[2] = e->xmotion.state; /* FIXME: WTF?? */ - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 3, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); + valuator_mask_set_range(&mask, 0, 3, valuators); + QueuePointerEvents(p, type, detail, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; case EnterNotify: diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 83a2abbb8..5cbd620c9 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -132,14 +132,6 @@ static DMXLocalInputInfoRec DMXConsoleKbd = { NULL, dmxCommonKbdCtrl, dmxCommonKbdBell }; -static DMXLocalInputInfoRec DMXCommonOth = { - "common-oth", DMX_LOCAL_OTHER, DMX_LOCAL_TYPE_COMMON, 1, - dmxCommonCopyPrivate, NULL, - NULL, NULL, NULL, dmxCommonOthGetInfo, - dmxCommonOthOn, dmxCommonOthOff -}; - - static DMXLocalInputInfoRec DMXLocalDevices[] = { /* Dummy drivers that can compile on any OS */ #ifdef __linux__ @@ -476,7 +468,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i], info.minval[i], info.maxval[i], info.res[i], - info.minres[i], info.maxres[i]); + info.minres[i], info.maxres[i], + Relative); } else if (info.numRelAxes) { InitValuatorClassDeviceStruct(pDevice, info.numRelAxes, axis_labels, @@ -486,7 +479,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i], info.minval[i], info.maxval[i], info.res[i], - info.minres[i], info.maxres[i]); + info.minres[i], info.maxres[i], + Relative); } else if (info.numAbsAxes) { InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes, axis_labels, @@ -497,7 +491,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) axis_labels[i], info.minval[i], info.maxval[i], info.res[i], info.minres[i], - info.maxres[i]); + info.maxres[i], Absolute); } } if (info.focusClass) InitFocusClassDeviceStruct(pDevice); @@ -613,7 +607,7 @@ static void dmxCollectAll(DMXInputInfo *dmxInput) static void dmxBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) { - DMXInputInfo *dmxInput = &dmxInputs[(int)blockData]; + DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData]; static unsigned long generation = 0; if (generation != serverGeneration) { @@ -640,7 +634,7 @@ static void dmxSwitchReturn(pointer p) static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask) { - DMXInputInfo *dmxInput = &dmxInputs[(int)blockData]; + DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData]; int i; if (dmxInput->vt_switch_pending) { @@ -693,7 +687,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) DeviceIntPtr pDevice; Atom atom; const char *name = NULL; - void (*registerProcPtr)(DeviceIntPtr) = NULL; char *devname; DMXInputInfo *dmxInput; @@ -706,22 +699,19 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) dmxLocal->isCore = 1; dmxLocalCoreKeyboard = dmxLocal; name = "keyboard"; - registerProcPtr = RegisterKeyboardDevice; } if (dmxLocal->type == DMX_LOCAL_MOUSE && !dmxLocalCorePointer) { dmxLocal->isCore = 1; dmxLocalCorePointer = dmxLocal; name = "pointer"; - registerProcPtr = RegisterPointerDevice; } } if (!name) { name = "extension"; - registerProcPtr = RegisterOtherDevice; } - if (!name || !registerProcPtr) + if (!name) dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name); pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE); @@ -738,8 +728,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) pDevice->type = atom; pDevice->name = devname; - registerProcPtr(pDevice); - if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) { #if 00 /*BP*/ miRegisterPointerDevice(screenInfo.screens[0], pDevice); @@ -901,29 +889,6 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI) } } break; -#if 0 - case IsXExtensionDevice: - case IsXExtensionKeyboard: - case IsXExtensionPointer: - if (doXI) { - if (!dmxInput->numDevs) { - dmxLog(dmxWarning, - "Cannot use remote (%s) XInput devices if" - " not also using core devices\n", - dmxInput->name); - } else { - dmxLocal = dmxInputCopyLocal(dmxInput, - &DMXCommonOth); - dmxLocal->isCore = FALSE; - dmxLocal->sendsCore = FALSE; - dmxLocal->deviceId = devices[i].id; - dmxLocal->deviceName = (devices[i].name - ? strdup(devices[i].name) - : NULL); - } - } - break; -#endif } } XFreeDeviceList(devices); @@ -1071,9 +1036,8 @@ void dmxInputInit(DMXInputInfo *dmxInput) dmxInput->processInputEvents = dmxProcessInputEvents; dmxInput->detached = False; - RegisterBlockAndWakeupHandlers(dmxBlockHandler, - dmxWakeupHandler, - (void *)dmxInput->inputIdx); + RegisterBlockAndWakeupHandlers(dmxBlockHandler, dmxWakeupHandler, + (void *)(uintptr_t)dmxInput->inputIdx); } static void dmxInputFreeLocal(DMXLocalInputInfoRec *local) diff --git a/hw/dmx/input/dmxmotion.c b/hw/dmx/input/dmxmotion.c index a86b62e5c..1aae5feb5 100644 --- a/hw/dmx/input/dmxmotion.c +++ b/hw/dmx/input/dmxmotion.c @@ -125,12 +125,11 @@ void dmxPointerPutMotionEvent(DeviceIntPtr pDevice, /* Initialize the data from the known * values (if Absolute) or to zero (if * Relative) */ - if (pDevice->valuator->mode == Absolute) { - for (i = 0; i < numAxes; i++) + for (i = 0; i < numAxes; i++) { + if (pDevice->valuator->axes[i].mode == Absolute) dmxLocal->history[OFFSET(dmxLocal->tail,i+1)] = dmxLocal->valuators[i]; - } else { - for (i = 0; i < numAxes; i++) + else dmxLocal->history[OFFSET(dmxLocal->tail,i+1)] = 0; } diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c index 8b58eeb69..54381b2e0 100644 --- a/hw/dmx/input/dmxxinput.c +++ b/hw/dmx/input/dmxxinput.c @@ -51,23 +51,6 @@ #include "dmxinputinit.h" #include "exevents.h" -/** Close the input device. This is not required by the XINPUT model - * that DMX uses. */ -void CloseInputDevice (DeviceIntPtr d, ClientPtr client) -{ -} - -/** This is not required by the XINPUT model that DMX uses. */ -void AddOtherInputDevices(void) -{ -} - -/** Open an input device. This is not required by the XINPUT model that - * DMX uses. */ -void OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status) -{ -} - /** Set device mode to \a mode. This is not implemented. */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { diff --git a/hw/dmx/man/Makefile.am b/hw/dmx/man/Makefile.am new file mode 100644 index 000000000..e717aefe2 --- /dev/null +++ b/hw/dmx/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xdmx.man diff --git a/hw/dmx/Xdmx.man b/hw/dmx/man/Xdmx.man similarity index 100% rename from hw/dmx/Xdmx.man rename to hw/dmx/man/Xdmx.man diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am index baa34f3ed..471ca89dd 100644 --- a/hw/kdrive/Makefile.am +++ b/hw/kdrive/Makefile.am @@ -6,10 +6,6 @@ if XFAKESERVER XFAKE_SUBDIRS = fake endif -if XFAKELIB -XFAKELIB_SUBDIRS = fakelib -endif - if XEPHYR XEPHYR_SUBDIRS = ephyr endif @@ -21,15 +17,14 @@ endif SERVER_SUBDIRS = \ $(FBDEV_SUBDIRS) \ $(XEPHYR_SUBDIRS) \ - $(XFAKE_SUBDIRS) \ - $(XFAKELIB_SUBDIRS) + $(XFAKE_SUBDIRS) SUBDIRS = \ src \ $(LINUX_SUBDIRS) \ $(SERVER_SUBDIRS) -DIST_SUBDIRS = fbdev ephyr src linux fake fakelib +DIST_SUBDIRS = fbdev ephyr src linux fake relink: $(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done diff --git a/hw/kdrive/ephyr/.gitignore b/hw/kdrive/ephyr/.gitignore index bfe7e08c2..4962d1ef0 100644 --- a/hw/kdrive/ephyr/.gitignore +++ b/hw/kdrive/ephyr/.gitignore @@ -1,3 +1 @@ -# Add & Override for this directory and it's subdirectories Xephyr -Xephyr.man diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am index 8646703ad..9d9b64ee5 100644 --- a/hw/kdrive/ephyr/Makefile.am +++ b/hw/kdrive/ephyr/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + INCLUDES = \ @KDRIVE_INCS@ \ @KDRIVE_CFLAGS@ \ @@ -83,20 +85,6 @@ Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) relink: $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) -MAN_SRCS = Xephyr.man.pre - -appmandir = $(APP_MAN_DIR) -appman_DATA = Xephyr.$(APP_MAN_SUFFIX) - -Xephyr.$(APP_MAN_SUFFIX): Xephyr.man - -$(AM_V_at)rm -f Xephyr.$(APP_MAN_SUFFIX) - $(AM_V_at)$(LN_S) Xephyr.man Xephyr.$(APP_MAN_SUFFIX) - -include $(top_srcdir)/cpprules.in - -CLEANFILES = $(appman_DATA) Xephyr.man - EXTRA_DIST = \ $(HOSTVIDEO_SRCS) \ - $(HOSTDRI_SRCS) \ - $(MAN_SRCS) + $(HOSTDRI_SRCS) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 8096a24cc..ac8e5bef9 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -52,6 +52,7 @@ Bool ephyrNoDRI=FALSE ; Bool ephyrNoXV=FALSE ; static int mouseState = 0; +static Rotation ephyrRandr = RR_Rotate_0; typedef struct _EphyrInputPrivate { Bool enabled; @@ -249,7 +250,11 @@ ephyrMapFramebuffer (KdScreenInfo *screen) EPHYR_LOG("screen->width: %d, screen->height: %d index=%d", screen->width, screen->height, screen->mynum); - KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height); + /* + * Use the rotation last applied to ourselves (in the Xephyr case the fb + * coordinate system moves independently of the pointer coordiante system). + */ + KdComputePointerMatrix (&m, ephyrRandr, screen->width, screen->height); KdSetPointerMatrix (&m); priv->bytes_per_line = ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2; @@ -530,7 +535,15 @@ ephyrRandRSetConfig (ScreenPtr pScreen, * Set new configuration */ - scrpriv->randr = KdAddRotation (screen->randr, randr); + /* + * We need to store the rotation value for pointer coords transformation; + * though initially the pointer and fb rotation are identical, when we map + * the fb, the screen will be reinitialized and return into an unrotated + * state (presumably the HW is taking care of the rotation of the fb), but the + * pointer still needs to be transformed. + */ + ephyrRandr = KdAddRotation (screen->randr, randr); + scrpriv->randr = ephyrRandr; ephyrUnmapFramebuffer (screen); @@ -1058,6 +1071,14 @@ MouseInit (KdPointerInfo *pi) pi->nButtons = 32; free(pi->name); pi->name = strdup("Xephyr virtual mouse"); + + /* + * Must transform pointer coords since the pointer position + * relative to the Xephyr window is controlled by the host server and + * remains constant regardless of any rotation applied to the Xephyr screen. + */ + pi->transformCoordinates = TRUE; + ephyrMouse = pi; return Success; } diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 8874a436e..6945f5b61 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -398,7 +398,7 @@ EphyrDuplicateVisual (unsigned int a_screen, int i=0 ; EPHYR_LOG ("enter\n") ; - if (a_screen > screenInfo.numScreens) { + if (a_screen >= screenInfo.numScreens) { EPHYR_LOG_ERROR ("bad screen number\n") ; goto out; } diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 27cab3b63..2deb7b81d 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -358,13 +358,18 @@ ephyrDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) return TRUE; } +static void +ephyrDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) +{ +} + miPointerSpriteFuncRec EphyrPointerSpriteFuncs = { ephyrRealizeCursor, ephyrUnrealizeCursor, ephyrSetCursor, ephyrMoveCursor, ephyrDeviceCursorInitialize, - NULL + ephyrDeviceCursorCleanup }; diff --git a/hw/kdrive/ephyr/man/Makefile.am b/hw/kdrive/ephyr/man/Makefile.am new file mode 100644 index 000000000..e8a372143 --- /dev/null +++ b/hw/kdrive/ephyr/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xephyr.man diff --git a/hw/kdrive/ephyr/Xephyr.man.pre b/hw/kdrive/ephyr/man/Xephyr.man similarity index 98% rename from hw/kdrive/ephyr/Xephyr.man.pre rename to hw/kdrive/ephyr/man/Xephyr.man index eb80b96b0..8e7bfd550 100644 --- a/hw/kdrive/ephyr/Xephyr.man.pre +++ b/hw/kdrive/ephyr/man/Xephyr.man @@ -46,9 +46,9 @@ sets the screen size. .BI -parent " id" uses exiting window .I id . -If a -.BI -screen -argument follows a +If a +.BI -screen +argument follows a .BI -parent argument, this screen is embedded into the given window. .TP 8 @@ -85,5 +85,3 @@ Mouse button 5 probably won't work. X(__miscmansuffix__), Xserver(__appmansuffix__) .SH AUTHOR Matthew Allum 2004 - - diff --git a/hw/kdrive/fake/fake.c b/hw/kdrive/fake/fake.c index b8306db0a..ba05234dc 100644 --- a/hw/kdrive/fake/fake.c +++ b/hw/kdrive/fake/fake.c @@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen) { FakePriv *priv = screen->card->driver; KdShadowFbFree (screen); - if (priv->base) - { - free (priv->base); - priv->base = 0; - } + free(priv->base); + priv->base = NULL; return TRUE; } diff --git a/hw/kdrive/fakelib/.gitignore b/hw/kdrive/fakelib/.gitignore deleted file mode 100644 index e3dc5ebaf..000000000 --- a/hw/kdrive/fakelib/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.*.swp -andtest -main2 -main3 -main4 -Xfakelib -Xfakelibthreaded diff --git a/hw/kdrive/fakelib/.main3.c.swp b/hw/kdrive/fakelib/.main3.c.swp deleted file mode 100644 index a749c57e7..000000000 Binary files a/hw/kdrive/fakelib/.main3.c.swp and /dev/null differ diff --git a/hw/kdrive/fakelib/Makefile.am b/hw/kdrive/fakelib/Makefile.am deleted file mode 100644 index 05b5eb200..000000000 --- a/hw/kdrive/fakelib/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -#INCLUDES = \ -# @KDRIVE_INCS@ \ -# @KDRIVE_CFLAGS@ - -noinst_LTLIBRARIES = libfakelib.la - -lib_LTLIBRARIES = libxfakelib.la - -bin_PROGRAMS = Xfakelib Xfakelibthreaded andtest - -libfakelib_la_CFLAGS = \ - @KDRIVE_INCS@ \ - @KDRIVE_CFLAGS@ - -libfakelib_la_SOURCES = \ - fakelibinit.c \ - fakelib.c \ - kbd.c \ - os.c \ - mouse.c \ - fake.h - -libxfakelib_la_CFLAGS = \ - @KDRIVE_INCS@ \ - @XFAKELIB_CFLAGS@ - -libxfakelib_la_SOURCES = - -libxfakelib_la_LIBADD = \ - libfakelib.la \ - @XFAKELIB_LIBS@ - -libxfakelib_la_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,--shared \ - -Wl,-z,nocopyreloc -llog - -libxfakelib_la_DEPENDENCIES = \ - libfakelib.la \ - @XFAKELIB_LOCAL_LIBS@ - -Xfakelib_SOURCES = \ - andmain.c - -Xfakelib_LDFLAGS = -lc -lz -ldl -llog -lxfakelib \ - /opt/androix/usr/lib/crtbegin_dynamic.o - -Xfakelibthreaded_SOURCES = \ - main6.c - -Xfakelibthreaded_LDFLAGS = -lc -lz -ldl -llog -lxfakelib \ - -nostdlib -Bdynamic \ - -Wl,-dynamic-linker,/system/bin/linker \ - -Wl,-z,nocopyreloc \ - /opt/androix/usr/lib/crtbegin_dynamic.o - -andtest_SOURCES = \ - andtest.c - -andtest_LDFLAGS = -lc -llog \ - -nostdlib -Bdynamic \ - -Wl,-dynamic-linker,/system/bin/linker \ - -Wl,-z,nocopyreloc \ - /opt/androix/usr/lib/crtbegin_dynamic.o - -relink: - $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) diff --git a/hw/kdrive/fakelib/Makefile.am-xfakelib b/hw/kdrive/fakelib/Makefile.am-xfakelib deleted file mode 100644 index 7cd4304ee..000000000 --- a/hw/kdrive/fakelib/Makefile.am-xfakelib +++ /dev/null @@ -1,35 +0,0 @@ -#INCLUDES = \ -# @KDRIVE_INCS@ \ -# @KDRIVE_CFLAGS@ - -lib_LTLIBRARIES = libxfakelib.la - -bin_PROGRAMS = Xfakelib - -libxfakelib_la_CFLAGS = \ - @KDRIVE_INCS@ \ - @XFAKELIB_CFLAGS@ - -libxfakelib_la_SOURCES = \ - fakelibinit.c \ - fakelib.c \ - kbd.c \ - os.c \ - mouse.c \ - fake.h - -libxfakelib_la_LIBADD = \ - @XFAKELIB_LIBS@ - -libxfakelib_la_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) - -libxfakelib_la_DEPENDENCIES = \ - @XFAKELIB_LOCAL_LIBS@ - -Xfakelib_SOURCES = \ - main.c - -Xfakelib_LDFLAGS = -lxfakelib - -relink: - $(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS) diff --git a/hw/kdrive/fakelib/andmain.c b/hw/kdrive/fakelib/andmain.c deleted file mode 100644 index 64b5e23cc..000000000 --- a/hw/kdrive/fakelib/andmain.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - -Copyright 2010 Timothy Meade - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#include "os.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -extern int dix_main(int argc, char *argv[], char *envp[]); - -int main(int argc, char *argv[], char *envp[]) -{ - fprintf(stderr, "[xfakelib main] starting dix_main in main thread\n"); - dix_main(argc, argv, envp); - fprintf(stderr, "[xfakelib main] dix_main exited in main thread\n"); -} - diff --git a/hw/kdrive/fakelib/androiderr.c b/hw/kdrive/fakelib/androiderr.c deleted file mode 100644 index 3d9d3bd5f..000000000 --- a/hw/kdrive/fakelib/androiderr.c +++ /dev/null @@ -1,26 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fakelib.h" - -#include - -#define LOG_TAG "AndroiX" -//define LOG(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) -#define LOG(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) - -#ifdef DDXOSVERRORF -#warn Android logging enabled -void -OsVendorVErrorF (const char *pszFormat, va_list va_args) -{ - int len; - char buf[1024]; - if ((len = strlen(pszFormat)) >= 1024) len = 1024; - snprintf(buf, len, pszFormat, &va_args); - LOG(buf); - LOG("[logging]"); - fprintf(stderr, "[OSVERROR] %s", buf); -} -#endif diff --git a/hw/kdrive/fakelib/andtest.c b/hw/kdrive/fakelib/andtest.c deleted file mode 100644 index 3cf9be9c0..000000000 --- a/hw/kdrive/fakelib/andtest.c +++ /dev/null @@ -1,14 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#define LOG_TAG "AndroiX" -//define LOG(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) -#define LOG(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) - -int main() { - LOG("test success"); -} diff --git a/hw/kdrive/fakelib/fakelib.c b/hw/kdrive/fakelib/fakelib.c deleted file mode 100644 index 7ba699c34..000000000 --- a/hw/kdrive/fakelib/fakelib.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fakelib.h" - -extern int KdTsPhyScreen; - -Bool -fakeInitialize (KdCardInfo *card, FakePriv *priv) -{ - priv->base = 0; - priv->bytes_per_line = 0; - return TRUE; -} - -Bool -fakeCardInit (KdCardInfo *card) -{ - FakePriv *priv; - - priv = (FakePriv *) malloc(sizeof (FakePriv)); - if (!priv) - return FALSE; - - if (!fakeInitialize (card, priv)) - { - free(priv); - return FALSE; - } - card->driver = priv; - - return TRUE; -} - -Bool -fakeScreenInitialize (KdScreenInfo *screen, FakeScrPriv *scrpriv) -{ - if (!screen->width || !screen->height) - { - screen->width = 1024; - screen->height = 768; - screen->rate = 72; - } - - if (screen->width <= 0) - screen->width = 1; - if (screen->height <= 0) - screen->height = 1; - - if (!screen->fb.depth) - screen->fb.depth = 16; - - if (screen->fb.depth <= 8) - { - screen->fb.visuals = ((1 << StaticGray) | - (1 << GrayScale) | - (1 << StaticColor) | - (1 << PseudoColor) | - (1 << TrueColor) | - (1 << DirectColor)); - } - else - { - screen->fb.visuals = (1 << TrueColor); -#define Mask(o,l) (((1 << l) - 1) << o) - if (screen->fb.depth <= 15) - { - screen->fb.depth = 15; - screen->fb.bitsPerPixel = 16; - screen->fb.redMask = Mask (10, 5); - screen->fb.greenMask = Mask (5, 5); - screen->fb.blueMask = Mask (0, 5); - } - else if (screen->fb.depth <= 16) - { - screen->fb.depth = 16; - screen->fb.bitsPerPixel = 16; - screen->fb.redMask = Mask (11, 5); - screen->fb.greenMask = Mask (5, 6); - screen->fb.blueMask = Mask (0, 5); - } - else - { - screen->fb.depth = 24; - screen->fb.bitsPerPixel = 32; - screen->fb.redMask = Mask (16, 8); - screen->fb.greenMask = Mask (8, 8); - screen->fb.blueMask = Mask (0, 8); - } - } - - scrpriv->randr = screen->randr; - - return fakeMapFramebuffer (screen); -} - -Bool -fakeScreenInit (KdScreenInfo *screen) -{ - FakeScrPriv *scrpriv; - - scrpriv = calloc(1, sizeof (FakeScrPriv)); - if (!scrpriv) - return FALSE; - screen->driver = scrpriv; - if (!fakeScreenInitialize (screen, scrpriv)) - { - screen->driver = 0; - free(scrpriv); - return FALSE; - } - return TRUE; -} - -void * -fakeWindowLinear (ScreenPtr pScreen, - CARD32 row, - CARD32 offset, - int mode, - CARD32 *size, - void *closure) -{ - KdScreenPriv(pScreen); - FakePriv *priv = pScreenPriv->card->driver; - - if (!pScreenPriv->enabled) - return 0; - *size = priv->bytes_per_line; - return priv->base + row * priv->bytes_per_line; -} - -Bool -fakeMapFramebuffer (KdScreenInfo *screen) -{ - FakeScrPriv *scrpriv = screen->driver; - KdPointerMatrix m; - FakePriv *priv = screen->card->driver; - - if (scrpriv->randr != RR_Rotate_0) - scrpriv->shadow = TRUE; - else - scrpriv->shadow = FALSE; - - KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height); - - KdSetPointerMatrix (&m); - - priv->bytes_per_line = ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2; - free(priv->base); - priv->base = malloc (priv->bytes_per_line * screen->height); - - if (scrpriv->shadow) - { - if (!KdShadowFbAlloc (screen, scrpriv->randr & (RR_Rotate_90|RR_Rotate_270))) - return FALSE; - } - else - { - screen->fb.byteStride = priv->bytes_per_line; - screen->fb.pixelStride = (priv->bytes_per_line * 8/ - screen->fb.bitsPerPixel); - screen->fb.frameBuffer = (CARD8 *) (priv->base); - } - - return TRUE; -} - -void -fakeSetScreenSizes (ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - - if (scrpriv->randr & (RR_Rotate_0|RR_Rotate_180)) - { - pScreen->width = screen->width; - pScreen->height = screen->height; - pScreen->mmWidth = screen->width_mm; - pScreen->mmHeight = screen->height_mm; - } - else - { - pScreen->width = screen->width; - pScreen->height = screen->height; - pScreen->mmWidth = screen->height_mm; - pScreen->mmHeight = screen->width_mm; - } -} - -Bool -fakeUnmapFramebuffer (KdScreenInfo *screen) -{ - FakePriv *priv = screen->card->driver; - KdShadowFbFree (screen); - if (priv->base) - { - free (priv->base); - priv->base = 0; - } - return TRUE; -} - -Bool -fakeSetShadow (ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - ShadowUpdateProc update; - ShadowWindowProc window; - - window = fakeWindowLinear; - update = 0; - if (scrpriv->randr) - update = shadowUpdateRotatePacked; - else - update = shadowUpdatePacked; - return KdShadowSet (pScreen, scrpriv->randr, update, window); -} - - -#ifdef RANDR -Bool -fakeRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - RRScreenSizePtr pSize; - Rotation randr; - int n; - - *rotations = RR_Rotate_All|RR_Reflect_All; - - for (n = 0; n < pScreen->numDepths; n++) - if (pScreen->allowedDepths[n].numVids) - break; - if (n == pScreen->numDepths) - return FALSE; - - pSize = RRRegisterSize (pScreen, - screen->width, - screen->height, - screen->width_mm, - screen->height_mm); - - randr = KdSubRotation (scrpriv->randr, screen->randr); - - RRSetCurrentConfig (pScreen, randr, 0, pSize); - - return TRUE; -} - -Bool -fakeRandRSetConfig (ScreenPtr pScreen, - Rotation randr, - int rate, - RRScreenSizePtr pSize) -{ - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; - FakeScrPriv *scrpriv = screen->driver; - Bool wasEnabled = pScreenPriv->enabled; - FakeScrPriv oldscr; - int oldwidth; - int oldheight; - int oldmmwidth; - int oldmmheight; - int newwidth, newheight; - - if (screen->randr & (RR_Rotate_0|RR_Rotate_180)) - { - newwidth = pSize->width; - newheight = pSize->height; - } - else - { - newwidth = pSize->height; - newheight = pSize->width; - } - - if (wasEnabled) - KdDisableScreen (pScreen); - - oldscr = *scrpriv; - - oldwidth = screen->width; - oldheight = screen->height; - oldmmwidth = pScreen->mmWidth; - oldmmheight = pScreen->mmHeight; - - /* - * Set new configuration - */ - - scrpriv->randr = KdAddRotation (screen->randr, randr); - - fakeUnmapFramebuffer (screen); - - if (!fakeMapFramebuffer (screen)) - goto bail4; - - KdShadowUnset (screen->pScreen); - - if (!fakeSetShadow (screen->pScreen)) - goto bail4; - - fakeSetScreenSizes (screen->pScreen); - - /* - * Set frame buffer mapping - */ - (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap (pScreen), - pScreen->width, - pScreen->height, - screen->fb.depth, - screen->fb.bitsPerPixel, - screen->fb.byteStride, - screen->fb.frameBuffer); - - /* set the subpixel order */ - - KdSetSubpixelOrder (pScreen, scrpriv->randr); - if (wasEnabled) - KdEnableScreen (pScreen); - - return TRUE; - -bail4: - fakeUnmapFramebuffer (screen); - *scrpriv = oldscr; - (void) fakeMapFramebuffer (screen); - pScreen->width = oldwidth; - pScreen->height = oldheight; - pScreen->mmWidth = oldmmwidth; - pScreen->mmHeight = oldmmheight; - - if (wasEnabled) - KdEnableScreen (pScreen); - return FALSE; -} - -Bool -fakeRandRInit (ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (!RRScreenInit (pScreen)) - return FALSE; - - pScrPriv = rrGetScrPriv(pScreen); - pScrPriv->rrGetInfo = fakeRandRGetInfo; - pScrPriv->rrSetConfig = fakeRandRSetConfig; - return TRUE; -} -#endif - -Bool -fakeCreateColormap (ColormapPtr pmap) -{ - return fbInitializeColormap (pmap); -} - -Bool -fakeInitScreen (ScreenPtr pScreen) -{ -#ifdef TOUCHSCREEN - KdTsPhyScreen = pScreen->myNum; -#endif - - pScreen->CreateColormap = fakeCreateColormap; - return TRUE; -} - -Bool -fakeFinishInitScreen (ScreenPtr pScreen) -{ - if (!shadowSetup (pScreen)) - return FALSE; - -#ifdef RANDR - if (!fakeRandRInit (pScreen)) - return FALSE; -#endif - - return TRUE; -} - - -Bool -fakeCreateResources (ScreenPtr pScreen) -{ - return fakeSetShadow (pScreen); -} - -void -fakePreserve (KdCardInfo *card) -{ -} - -Bool -fakeEnable (ScreenPtr pScreen) -{ - return TRUE; -} - -Bool -fakeDPMS (ScreenPtr pScreen, int mode) -{ - return TRUE; -} - -void -fakeDisable (ScreenPtr pScreen) -{ -} - -void -fakeRestore (KdCardInfo *card) -{ -} - -void -fakeScreenFini (KdScreenInfo *screen) -{ -} - -void -fakeCardFini (KdCardInfo *card) -{ - FakePriv *priv = card->driver; - - free (priv->base); - free(priv); -} - -void -fakeGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs) -{ - while (n--) - { - pdefs->red = 0; - pdefs->green = 0; - pdefs->blue = 0; - pdefs++; - } -} - -void -fakePutColors (ScreenPtr pScreen, int n, xColorItem *pdefs) -{ -} diff --git a/hw/kdrive/fakelib/fakelib.h b/hw/kdrive/fakelib/fakelib.h deleted file mode 100644 index d5058606a..000000000 --- a/hw/kdrive/fakelib/fakelib.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FBDEV_H_ -#define _FBDEV_H_ -#include -#include -#include "kdrive.h" - -#ifdef RANDR -#include "randrstr.h" -#endif - -typedef struct _fakePriv { - CARD8 *base; - int bytes_per_line; -} FakePriv; - -typedef struct _fakeScrPriv { - Rotation randr; - Bool shadow; -} FakeScrPriv; - -extern KdCardFuncs fakeFuncs; - -Bool -fakeInitialize (KdCardInfo *card, FakePriv *priv); - -Bool -fakeCardInit (KdCardInfo *card); - -Bool -fakeScreenInit (KdScreenInfo *screen); - -Bool -fakeScreenInitialize (KdScreenInfo *screen, FakeScrPriv *scrpriv); - -Bool -fakeInitScreen (ScreenPtr pScreen); - -Bool -fakeFinishInitScreen (ScreenPtr pScreen); - -Bool -fakeCreateResources (ScreenPtr pScreen); - -void -fakePreserve (KdCardInfo *card); - -Bool -fakeEnable (ScreenPtr pScreen); - -Bool -fakeDPMS (ScreenPtr pScreen, int mode); - -void -fakeDisable (ScreenPtr pScreen); - -void -fakeRestore (KdCardInfo *card); - -void -fakeScreenFini (KdScreenInfo *screen); - -void -fakeCardFini (KdCardInfo *card); - -void -fakeGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs); - -void -fakePutColors (ScreenPtr pScreen, int n, xColorItem *pdefs); - -Bool -fakeMapFramebuffer (KdScreenInfo *screen); - -void * -fakeWindowLinear (ScreenPtr pScreen, - CARD32 row, - CARD32 offset, - int mode, - CARD32 *size, - void *closure); - -void -fakeSetScreenSizes (ScreenPtr pScreen); - -Bool -fakeUnmapFramebuffer (KdScreenInfo *screen); - -Bool -fakeSetShadow (ScreenPtr pScreen); - -Bool -fakeCreateColormap (ColormapPtr pmap); - -#ifdef RANDR -Bool -fakeRandRGetInfo (ScreenPtr pScreen, Rotation *rotations); - -Bool -fakeRandRSetConfig (ScreenPtr pScreen, - Rotation randr, - int rate, - RRScreenSizePtr pSize); -Bool -fakeRandRInit (ScreenPtr pScreen); - -#endif - -extern KdPointerDriver FakePointerDriver; - -extern KdKeyboardDriver FakeKeyboardDriver; - -extern KdOsFuncs FakeOsFuncs; - -#endif /* _FBDEV_H_ */ diff --git a/hw/kdrive/fakelib/fakelibinit.c b/hw/kdrive/fakelib/fakelibinit.c deleted file mode 100644 index 475ae2da8..000000000 --- a/hw/kdrive/fakelib/fakelibinit.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fakelib.h" - -void -InitCard (char *name) -{ - KdCardInfoAdd (&fakeFuncs, 0); -} - -void -InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv) -{ - KdInitOutput (pScreenInfo, argc, argv); -} - -void -InitInput (int argc, char **argv) -{ - KdPointerInfo *pi; - KdKeyboardInfo *ki; - - pi = KdNewPointer (); - if (!pi) - return; - pi->driver = &FakePointerDriver; - KdAddPointer(pi); - - ki = KdNewKeyboard (); - if (!ki) - return; - ki->driver = &FakeKeyboardDriver; - KdAddKeyboard(ki); - - KdInitInput (); -} - -void -CloseInput (void) -{ -} - -#ifdef DDXBEFORERESET -void -ddxBeforeReset (void) -{ -} -#endif - -void -ddxUseMsg (void) -{ - KdUseMsg(); -} - -int -ddxProcessArgument (int argc, char **argv, int i) -{ - return KdProcessArgument (argc, argv, i); -} - -void -OsVendorInit (void) -{ - KdOsInit (&FakeOsFuncs); -} - -KdCardFuncs fakeFuncs = { - fakeCardInit, /* cardinit */ - fakeScreenInit, /* scrinit */ - fakeInitScreen, /* initScreen */ - fakeFinishInitScreen, /* finishInitScreen */ - fakeCreateResources, /* createRes */ - fakePreserve, /* preserve */ - fakeEnable, /* enable */ - fakeDPMS, /* dpms */ - fakeDisable, /* disable */ - fakeRestore, /* restore */ - fakeScreenFini, /* scrfini */ - fakeCardFini, /* cardfini */ - - 0, /* initCursor */ - 0, /* enableCursor */ - 0, /* disableCursor */ - 0, /* finiCursor */ - 0, /* recolorCursor */ - - 0, /* initAccel */ - 0, /* enableAccel */ - 0, /* disableAccel */ - 0, /* finiAccel */ - - fakeGetColors, /* getColors */ - fakePutColors, /* putColors */ -}; diff --git a/hw/kdrive/fakelib/kbd.c b/hw/kdrive/fakelib/kbd.c deleted file mode 100644 index 3aa15afbe..000000000 --- a/hw/kdrive/fakelib/kbd.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 1999 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fakelib.h" -#include - -#define FAKE_WIDTH 2 - -static Status -FakeKeyboardInit (KdKeyboardInfo *ki) -{ - ki->minScanCode = 8; - ki->maxScanCode = 255; - return Success; -} - -static Status -FakeKeyboardEnable (KdKeyboardInfo *ki) -{ - return Success; -} - -static void -FakeKeyboardDisable (KdKeyboardInfo *ki) -{ - return; -} - -static void -FakeKeyboardFini (KdKeyboardInfo *ki) -{ -} - -static void -FakeKeyboardLeds (KdKeyboardInfo *ki, int leds) -{ -} - -static void -FakeKeyboardBell (KdKeyboardInfo *ki, int volume, int frequency, int duration) -{ -} - -KdKeyboardDriver FakeKeyboardDriver = { - "fake", - FakeKeyboardInit, - FakeKeyboardEnable, - FakeKeyboardLeds, - FakeKeyboardBell, - FakeKeyboardDisable, - FakeKeyboardFini, - NULL, -}; diff --git a/hw/kdrive/fakelib/main2 b/hw/kdrive/fakelib/main2 deleted file mode 100755 index 49646280d..000000000 Binary files a/hw/kdrive/fakelib/main2 and /dev/null differ diff --git a/hw/kdrive/fakelib/main2.c b/hw/kdrive/fakelib/main2.c deleted file mode 100644 index 4705a1698..000000000 --- a/hw/kdrive/fakelib/main2.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - -Copyright 2010 Timothy Meade - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#include -#include -#include - -int (*dix_main)(int argc, char *argv[], char *envp[]); - -int main(int argc, char *argv[], char *envp[]) -{ - void *xfakelib; - - fprintf(stderr, "[xfakelib2 main] opening the library\n"); - xfakelib = (void *)dlopen("libxfakelib.so", RTLD_NOW); - *(void **) (&dix_main) = dlsym(xfakelib, "dix_main"); - fprintf(stderr, "[xfakelib2 main] dix_main: %llu\n", (unsigned long long)dix_main); - - fprintf(stderr, "[xfakelib main] starting dix_main in main thread\n"); - dix_main(argc, argv, envp); - fprintf(stderr, "[xfakelib main] dix_main exited in main thread\n"); -} - diff --git a/hw/kdrive/fakelib/main3 b/hw/kdrive/fakelib/main3 deleted file mode 100755 index 85da434b1..000000000 Binary files a/hw/kdrive/fakelib/main3 and /dev/null differ diff --git a/hw/kdrive/fakelib/main3.c b/hw/kdrive/fakelib/main3.c deleted file mode 100644 index 06907cc38..000000000 --- a/hw/kdrive/fakelib/main3.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - -Copyright 2010 Timothy Meade - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name(s) of the above copyright -holders shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written authorization. - -includes code from quartzStartup.c, copyright 2001-2004 Torrey T. Lyons. All Rights Reserved - -*/ - -#include -#include -#include - -#include - -int (*dix_main)(int argc, char *argv[], char *envp[]); - -int main_thread_id; -int server_thread_id; - -struct arg { - int argc; - char **argv; - char **envp; -}; - -static void server_thread (void *arg) { - struct arg args = *((struct arg *)arg); - free(arg); - exit (dix_main(args.argc, args.argv, args.envp)); -} - -static pthread_t create_thread (void *func, void *arg) { - pthread_attr_t attr; - pthread_t tid; - - pthread_attr_init (&attr); - pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); - pthread_create (&tid, &attr, func, arg); - pthread_attr_destroy (&attr); - - return tid; -} - -int xfakelib_init(int argc, char *argv[], char *envp[]) { -// struct arg *args = (struct arg*)malloc(sizeof(struct arg)); - struct arg args; -// if(!args) { -// fprintf(stderr, "Could not allocate memory.\n"); -// }; - - args.argc = argc; - args.argv = argv; - args.envp = envp; - - main_thread_id = pthread_self(); - server_thread_id = create_thread(server_thread, &args); - - if (!server_thread_id) { - fprintf(stderr, "[xfakelib main] can't create secondary thread\n"); - } -} - -int main(int argc, char *argv[], char *envp[]) -{ - void *xfakelib; - - fprintf(stderr, "[xfakelib2 main] opening the library\n"); - xfakelib = (void *)dlopen("libxfakelib.so", RTLD_NOW); - *(void **) (&dix_main) = dlsym(xfakelib, "dix_main"); - fprintf(stderr, "[xfakelib2 main] dix_main: %llu\n", (unsigned long long)dix_main); - - fprintf(stderr, "[xfakelib main] creating thread\n"); -// dix_main(argc, argv, envp); - xfakelib_init(argc, argv, envp); - fprintf(stderr, "[xfakelib main] dix_main exited in main thread\n"); -} - diff --git a/hw/kdrive/fakelib/main4 b/hw/kdrive/fakelib/main4 deleted file mode 100755 index 904db23b1..000000000 Binary files a/hw/kdrive/fakelib/main4 and /dev/null differ diff --git a/hw/kdrive/fakelib/main4.c b/hw/kdrive/fakelib/main4.c deleted file mode 100644 index 77dc4213f..000000000 --- a/hw/kdrive/fakelib/main4.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - -Copyright 2010 Timothy Meade - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name(s) of the above copyright -holders shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written authorization. - -includes code from quartzStartup.c, copyright 2001-2004 Torrey T. Lyons. All Rights Reserved - -*/ - -#include -#include -#include -#include - -#include - -int (*dix_main)(int argc, char *argv[], char *envp[]); - -int main_thread_id; -int server_thread_id; - -struct arg { - int argc; - char **argv; - char **envp; -}; - -static void server_thread (void *arg) { - void* handle; - struct arg args = *((struct arg *)arg); - int res; - free(arg); - - fprintf(stderr, "[xfakelib2 main] opening the library\n"); - handle = (void *)dlopen("libxfakelib.so", RTLD_NOW); - *(void **) (&dix_main) = dlsym(handle, "dix_main"); - fprintf(stderr, "[xfakelib2 main] dix_main: %llu\n", (unsigned long long)dix_main); - - fprintf(stderr, "[xfakelib server_thread] starting dix_main\n"); - - res = dix_main(args.argc, args.argv, args.envp); - fprintf(stderr, "[xfakelib server_thread] dix_main exit: %d\n", res); - exit(res); - -// exit (dix_main(args.argc, args.argv, args.envp)); -} - -static pthread_t create_thread (void *func, void *arg) { - pthread_attr_t attr; - pthread_t tid; - - fprintf(stderr, "[xfakelib create_thread] creating thread\n"); - - pthread_attr_init (&attr); - pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); - pthread_create (&tid, &attr, func, arg); - pthread_attr_destroy (&attr); - - return tid; -} - -int main(int argc, char *argv[], char *envp[]) -{ - void *xfakelib; - struct arg args; - - args.argc = argc; - args.argv = argv; - args.envp = envp; - - main_thread_id = pthread_self(); - server_thread_id = create_thread(server_thread, &args); - - fprintf(stderr, "[xfakelib main] server_thread_id: %d\n", server_thread_id); - - if (!server_thread_id) { - fprintf(stderr, "[xfakelib main] can't create secondary thread\n"); - } - - fprintf(stderr, "[xfakelib main] exited in main thread\n"); -} - diff --git a/hw/kdrive/fakelib/main5.c b/hw/kdrive/fakelib/main5.c deleted file mode 100644 index 4efacbbeb..000000000 --- a/hw/kdrive/fakelib/main5.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - -Copyright 2010 Timothy Meade - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name(s) of the above copyright -holders shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written authorization. - -includes code from quartzStartup.c, copyright 2001-2004 Torrey T. Lyons. All Rights Reserved - -*/ - -#include -#include -#include -#include - -#include - -extern int dix_main(int argc, char *argv[], char *envp[]); - -int main_thread_id; -int server_thread_id; - -struct arg { - int argc; - char **argv; - char **envp; -}; - -static void server_thread (void *arg) { - void* handle; - struct arg args = *((struct arg *)arg); - int res; - free(arg); - - fprintf(stderr, "[xfakelib2 main] opening the library\n"); -// handle = (void *)dlopen("libxfakelib.so", RTLD_NOW); - // *(void **) (&dix_main) = dlsym(handle, "dix_main"); - fprintf(stderr, "[xfakelib2 main] dix_main: %llu\n", (unsigned long long)dix_main); - - fprintf(stderr, "[xfakelib server_thread] starting dix_main\n"); - - res = dix_main(args.argc, args.argv, args.envp); - fprintf(stderr, "[xfakelib server_thread] dix_main exit: %d\n", res); - exit(res); - -// exit (dix_main(args.argc, args.argv, args.envp)); -} - -static pthread_t create_thread (void *func, void *arg) { - pthread_attr_t attr; - pthread_t tid; - - fprintf(stderr, "[xfakelib create_thread] creating thread\n"); - - pthread_attr_init (&attr); - pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); - pthread_create (&tid, &attr, func, arg); - pthread_attr_destroy (&attr); - - return tid; -} - -int main(int argc, char *argv[], char *envp[]) -{ - void *xfakelib; - struct arg args; - - args.argc = argc; - args.argv = argv; - args.envp = envp; - - main_thread_id = pthread_self(); - server_thread_id = create_thread(server_thread, &args); - - fprintf(stderr, "[xfakelib main] server_thread_id: %d\n", server_thread_id); - - if (!server_thread_id) { - fprintf(stderr, "[xfakelib main] can't create secondary thread\n"); - } - - fprintf(stderr, "[xfakelib main] exited in main thread\n"); -} - diff --git a/hw/kdrive/fakelib/mouse.c b/hw/kdrive/fakelib/mouse.c deleted file mode 100644 index 758f6cd22..000000000 --- a/hw/kdrive/fakelib/mouse.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "kdrive.h" - -static Status -MouseInit (KdPointerInfo *pi) -{ - return Success; -} - -static Status -MouseEnable (KdPointerInfo *pi) -{ - return Success; -} - -static void -MouseDisable (KdPointerInfo *pi) -{ - return; -} - -static void -MouseFini (KdPointerInfo *pi) -{ - return; -} - - -KdPointerDriver FakePointerDriver = { - "fake", - MouseInit, - MouseEnable, - MouseDisable, - MouseFini, -}; diff --git a/hw/kdrive/fakelib/non_stop_multi_threaded_debugging_in_gdb.pdf b/hw/kdrive/fakelib/non_stop_multi_threaded_debugging_in_gdb.pdf deleted file mode 100644 index 3f66e19f8..000000000 Binary files a/hw/kdrive/fakelib/non_stop_multi_threaded_debugging_in_gdb.pdf and /dev/null differ diff --git a/hw/kdrive/fakelib/os.c b/hw/kdrive/fakelib/os.c deleted file mode 100644 index a60a70309..000000000 --- a/hw/kdrive/fakelib/os.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "fakelib.h" - -static int -FakeInit (void) -{ - return 1; -} - -static void -FakeEnable (void) -{ -} - -static Bool -FakeSpecialKey (KeySym sym) -{ - return FALSE; -} - -static void -FakeDisable (void) -{ -} - -static void -FakeFini (void) -{ -} - -KdOsFuncs FakeOsFuncs = { - FakeInit, - FakeEnable, - FakeSpecialKey, - FakeDisable, - FakeFini, - 0 -}; - diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 48a084220..570cbf99a 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -117,15 +117,22 @@ TslibEnable (KdPointerInfo *pi) pi->path = strdup("/dev/input/touchscreen0"); ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path); } + private->tsDev = ts_open(pi->path, 0); - private->fd = ts_fd(private->tsDev); - if (!private->tsDev || ts_config(private->tsDev) || private->fd < 0) { + if (!private->tsDev) { ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path); - if (private->fd >= 0) - close(private->fd); return BadAlloc; } + if (ts_config(private->tsDev)) { + ErrorF("[tslib/TslibEnable] failed to load configuration\n"); + ts_close(private->tsDev); + private->tsDev = NULL; + return BadValue; + } + + private->fd = ts_fd(private->tsDev); + KdRegisterFd(private->fd, TsRead, pi); return Success; diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 06c3661da..f034ce463 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -91,95 +91,6 @@ static Bool kdCaughtSignal = FALSE; KdOsFuncs *kdOsFuncs; -void -KdSetRootClip (ScreenPtr pScreen, BOOL enable) -{ - WindowPtr pWin = pScreen->root; - WindowPtr pChild; - Bool WasViewable; - Bool anyMarked = FALSE; - WindowPtr pLayerWin; - BoxRec box; - - if (!pWin) - return; - WasViewable = (Bool)(pWin->viewable); - if (WasViewable) - { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - (void) (*pScreen->MarkOverlappedWindows)(pChild, - pChild, - &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = RegionCreate(NullBox, 1); - RegionSubtract(borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - if (enable) - { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - pWin->drawable.width = pScreen->width; - pWin->drawable.height = pScreen->height; - RegionInit(&pWin->winSize, &box, 1); - RegionInit(&pWin->borderSize, &box, 1); - RegionReset(&pWin->borderClip, &box); - RegionBreak(&pWin->clipList); - } - else - { - RegionEmpty(&pWin->borderClip); - RegionBreak(&pWin->clipList); - } - - ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->firstChild) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, - pWin->firstChild, - (WindowPtr *)NULL); - } - else - { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - - - if (anyMarked) - (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); - } - - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); -} - void KdDisableScreen (ScreenPtr pScreen) { @@ -188,7 +99,7 @@ KdDisableScreen (ScreenPtr pScreen) if (!pScreenPriv->enabled) return; if (!pScreenPriv->closed) - KdSetRootClip (pScreen, FALSE); + SetRootClip (pScreen, FALSE); KdDisableColormap (pScreen); if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel) (*pScreenPriv->card->cfuncs->disableAccel) (pScreen); @@ -271,7 +182,7 @@ KdEnableScreen (ScreenPtr pScreen) if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel) (*pScreenPriv->card->cfuncs->enableAccel) (pScreen); KdEnableColormap (pScreen); - KdSetRootClip (pScreen, TRUE); + SetRootClip (pScreen, TRUE); if (pScreenPriv->card->cfuncs->dpms) (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState); return TRUE; @@ -1022,12 +933,6 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) fbInitValidateTree (pScreen); #endif -#if 0 - pScreen->backingStoreSupport = Always; - miInitializeBackingStore (pScreen); -#endif - - /* * Wrap CloseScreen, the order now is: * KdCloseScreen diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 3ca98146b..2ab535aef 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -386,9 +386,6 @@ KdStoreColors (ColormapPtr pCmap, int ndef, xColorItem *pdefs); /* kdrive.c */ extern miPointerScreenFuncRec kdPointerScreenFuncs; -void -KdSetRootClip (ScreenPtr pScreen, BOOL enable); - void KdDisableScreen (ScreenPtr pScreen); diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 80a1458b1..114fd6189 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -48,6 +48,7 @@ #include "exglobals.h" #include "eventstr.h" #include "xserver-properties.h" +#include "inpututils.h" #define AtomFromName(x) MakeAtom(x, strlen(x), 1) @@ -65,8 +66,6 @@ static struct KdConfigDevice *kdConfigPointers = NULL; static KdKeyboardDriver *kdKeyboardDrivers = NULL; static KdPointerDriver *kdPointerDrivers = NULL; -static EventListPtr kdEvents = NULL; - static Bool kdInputEnabled; static Bool kdOffScreen; static unsigned long kdOffScreenTime; @@ -222,6 +221,7 @@ KdRegisterFd (int fd, void (*read) (int fd, void *closure), void *closure) kdInputFds[kdNumInputFds].disable = 0; kdInputFds[kdNumInputFds].closure = closure; kdNumInputFds++; + LogMessage(X_DEFAULT, "[kinput] KdRegisterFd kdInputEnabled: %d", kdInputEnabled); if (kdInputEnabled) KdAddFd (fd); return TRUE; @@ -476,7 +476,6 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) free(axes_labels); if (pi->inputClass == KD_TOUCHSCREEN) { - InitAbsoluteClassDeviceStruct(pDevice); xiclass = AtomFromName(XI_TOUCHSCREEN); } else { @@ -943,10 +942,6 @@ KdAddKeyboard (KdKeyboardInfo *ki) return !Success; } - ki->dixdev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; - ki->dixdev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; - RegisterOtherDevice(ki->dixdev); - #ifdef DEBUG ErrorF("added keyboard %s with dix id %d\n", ki->name, ki->dixdev->id); #endif @@ -1014,10 +1009,6 @@ KdAddPointer (KdPointerInfo *pi) return BadDevice; } - pi->dixdev->deviceGrab.ActivateGrab = ActivatePointerGrab; - pi->dixdev->deviceGrab.DeactivateGrab = DeactivatePointerGrab; - RegisterOtherDevice(pi->dixdev); - for (prev = &kdPointers; *prev; prev = &(*prev)->next); *prev = pi; @@ -1801,7 +1792,7 @@ void KdReleaseAllKeys (void) { #if 0 - int key, nEvents, i; + int key; KdKeyboardInfo *ki; KdBlockSigio (); @@ -1811,10 +1802,7 @@ KdReleaseAllKeys (void) key++) { if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { KdHandleKeyboardEvent(ki, KeyRelease, key); - GetEventList(&kdEvents); - nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, KeyRelease, key); - for (i = 0; i < nEvents; i++) - KdQueueEvent (ki->dixdev, (kdEvents + i)->event); + QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL); } } } @@ -1850,7 +1838,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, unsigned char key_code; KeyClassPtr keyc = NULL; KeybdCtrl *ctrl = NULL; - int type, nEvents, i; + int type; if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key) return; @@ -1870,11 +1858,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, else type = KeyPress; - GetEventList(&kdEvents); - - nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code); - for (i = 0; i < nEvents; i++) - KdQueueEvent(ki->dixdev, (InternalEvent *)((kdEvents + i)->event)); + QueueKeyboardEvents(ki->dixdev, type, key_code, NULL); } else { ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", @@ -1973,18 +1957,16 @@ void _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, int b, int absrel, Bool force) { - int nEvents = 0, i = 0; int valuators[3] = { x, y, z }; + ValuatorMask mask; /* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */ if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel)) return; - GetEventList(&kdEvents); - nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel, - 0, 3, valuators); - for (i = 0; i < nEvents; i++) - KdQueueEvent(pi->dixdev, (InternalEvent *)((kdEvents + i)->event)); + valuator_mask_set_range(&mask, 0, 3, valuators); + + QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); } void @@ -2177,6 +2159,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs = void ProcessInputEvents (void) { + LogMessage(X_DEFAULT, "[kinput] ProcessInputEvents"); mieqProcessInputEvents(); miPointerUpdateSprite(inputInfo.pointer); if (kdSwitchPending) @@ -2184,30 +2167,6 @@ ProcessInputEvents (void) KdCheckLock (); } -/* FIXME use XSECURITY to work out whether the client should be allowed to - * open and close. */ -void -OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status) -{ - if (!pDev) - *status = BadDevice; - else - *status = Success; -} - -void -CloseInputDevice(DeviceIntPtr pDev, ClientPtr client) -{ - return; -} - -/* We initialise all input devices at startup. */ -void -AddOtherInputDevices(void) -{ - return; -} - /* At the moment, absolute/relative is up to the client. */ int SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode) @@ -2233,8 +2192,6 @@ ChangeDeviceControl(register ClientPtr client, DeviceIntPtr pDev, case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: - return Success; - case DEVICE_CORE: return BadMatch; case DEVICE_ENABLE: diff --git a/hw/vfb/.gitignore b/hw/vfb/.gitignore index 55076f01d..c04754124 100644 --- a/hw/vfb/.gitignore +++ b/hw/vfb/.gitignore @@ -1,3 +1 @@ -# Add & Override for this directory and it's subdirectories Xvfb -Xvfb.man diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 801aaa0b4..60b59c164 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -138,10 +138,8 @@ InitInput(int argc, char *argv[]) Atom xiclass; p = AddInputDevice(serverClient, vfbMouseProc, TRUE); k = AddInputDevice(serverClient, vfbKeybdProc, TRUE); - RegisterPointerDevice(p); xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE); AssignTypeAndName(p, xiclass, "Xvfb mouse"); - RegisterKeyboardDevice(k); xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE); AssignTypeAndName(k, xiclass, "Xvfb keyboard"); (void)mieqInit(); diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index e10973480..53f82f9e2 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -875,13 +875,6 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; - miInitializeBackingStore(pScreen); - - /* - * Circumvent the backing store that was just initialised. This amounts - * to a truely bizarre way of initialising SaveDoomedAreas and friends. - */ - pScreen->InstallColormap = vfbInstallColormap; pScreen->UninstallColormap = vfbUninstallColormap; pScreen->ListInstalledColormaps = vfbListInstalledColormaps; diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index de5e1c5c9..ed46dbbc1 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + bin_PROGRAMS = Xvfb noinst_LIBRARIES = libfbcmap.a @@ -28,24 +30,5 @@ Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -# Man page -include $(top_srcdir)/cpprules.in - -appmandir = $(APP_MAN_DIR) - -appman_PRE = Xvfb.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -BUILT_SOURCES = $(appman_PRE) -CLEANFILES = $(appman_PRE) $(appman_DATA) - -SUFFIXES += .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - -$(AM_V_at)rm -f $@ - $(AM_V_at)$(LN_S) $< $@ - -EXTRA_DIST = Xvfb.man.pre - relink: $(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT) diff --git a/hw/vfb/man/Makefile.am b/hw/vfb/man/Makefile.am new file mode 100644 index 000000000..93941882a --- /dev/null +++ b/hw/vfb/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xvfb.man diff --git a/hw/vfb/Xvfb.man.pre b/hw/vfb/man/Xvfb.man similarity index 99% rename from hw/vfb/Xvfb.man.pre rename to hw/vfb/man/Xvfb.man index 569afe175..95b4dd4c1 100644 --- a/hw/vfb/Xvfb.man.pre +++ b/hw/vfb/man/Xvfb.man @@ -1,16 +1,16 @@ .\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.3 2005/03/23 20:49:52 gisburn Exp $ .\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ .\" Copyright 1993, 1998 The Open Group -.\" +.\" .\" Permission to use, copy, modify, distribute, and sell this software and its .\" documentation for any purpose is hereby granted without fee, provided that .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. -.\" +.\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. -.\" +.\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -18,7 +18,7 @@ .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. -.\" +.\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization @@ -66,7 +66,7 @@ have values from 1 to 32. .B "\-fbdir \fIframebuffer-directory\fP" This option specifies the directory in which the memory mapped files containing the framebuffer memory should be created. -See FILES. +See FILES. This option only exists on machines that have the mmap and msync system calls. .TP 4 @@ -113,7 +113,7 @@ Xvfb -pixdepths 3 27 -fbdir /var/tmp The server will listen for connections as server number 0, will have the default screen configuration (one screen, 1280x1024x8), will also support pixmap -depths of 3 and 27, +depths of 3 and 27, and will use memory mapped files in /var/tmp for the framebuffer. .TP 8 xwud -in /var/tmp/Xvfb_screen0 diff --git a/hw/xfree86/.gitignore b/hw/xfree86/.gitignore index 813af0b97..2ddca49e3 100644 --- a/hw/xfree86/.gitignore +++ b/hw/xfree86/.gitignore @@ -1,7 +1,4 @@ -# Add & Override for this directory and it's subdirectories libxorg.c Xorg xorg.c xorg.conf.example -xorg.conf.example.pre - diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 116113b1a..f1a759a27 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -1,4 +1,3 @@ -include $(top_srcdir)/cpprules.in if DRI DRI_SUBDIR = dri @@ -28,17 +27,15 @@ if INT10MODULE INT10_SUBDIR = int10 endif -DOC_SUBDIR = doc - SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \ ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \ - xf8_16bpp loader dixmods exa modes \ - $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR) + loader dixmods exa modes \ + $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ parser ramdac shadowfb vbe vgahw xaa \ - xf8_16bpp loader dixmods dri dri2 exa modes \ - utils doc + loader dixmods dri dri2 exa modes \ + utils doc man bin_PROGRAMS = Xorg Xorg_SOURCES = xorg.c @@ -77,7 +74,7 @@ Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) BUILT_SOURCES = xorg.conf.example -DISTCLEANFILES += xorg.conf.example xorg.conf.example.pre +DISTCLEANFILES += xorg.conf.example EXTRA_DIST = xorgconf.cpp if SPECIAL_DTRACE_OBJECTS @@ -108,13 +105,14 @@ if INSTALL_SETUID chmod u+s $(DESTDIR)$(bindir)/Xorg endif -CPP_FILES_FLAGS = \ - $(MANDEFS) \ - -DDEFAULTFONTPATH="\"$(COMPILEDDEFAULTFONTPATH)\"" \ - -DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\" +# Use variables from XORG_MANPAGE_SECTIONS and X Server configuration +# Do not include manpages.am as values are not appropriate for rc files +CONF_SUBSTS = -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \ + -e 's|MODULEPATH|$(DEFAULT_MODULE_PATH)|g' \ + -e 's|DEFAULTFONTPATH|$(COMPILEDDEFAULTFONTPATH)|g' + +xorg.conf.example: xorgconf.cpp + $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@ relink: $(AM_V_at)rm -f Xorg && $(MAKE) Xorg - -xorg.conf.example.pre: xorgconf.cpp - cp $(srcdir)/xorgconf.cpp $@ diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index 821a2b500..c031d4be3 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -17,8 +17,6 @@ if DGA DGASOURCES = xf86DGA.c endif -XISOURCES = xf86Xinput.c xisb.c -XISDKINCS = xf86Xinput.h xisb.h RANDRSOURCES = xf86RandR.c BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) @@ -26,8 +24,8 @@ BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) - cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ - echo >> $@ + $(AM_V_GEN)cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ + $(AM_V_GEN)echo >> $@ BUILT_SOURCES = xf86DefModeSet.c @@ -61,7 +59,6 @@ CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = \ compiler.h \ fourcc.h \ - scoasm.h \ vidmodeproc.h \ xf86.h \ xf86Bus.h \ diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 958f8d027..9e00d7571 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1525,22 +1525,9 @@ inl(unsigned short port) # define asm __asm # endif # endif -# ifndef SCO325 -# if defined(__UNIXWARE__) -# /* avoid including for on UnixWare */ -# define ushort unsigned short -# define ushort_t unsigned short -# define ulong unsigned long -# define ulong_t unsigned long -# define uint_t unsigned int -# define uchar_t unsigned char -# endif /* __UNIXWARE__ */ # if !defined(__SUNPRO_C) # include # endif -# else -# include "scoasm.h" -# endif # if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \ defined(__USLC__) # pragma asm partial_optimization outl diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h deleted file mode 100644 index 8f80e7b1e..000000000 --- a/hw/xfree86/common/scoasm.h +++ /dev/null @@ -1,142 +0,0 @@ - -/* - * Copyright (c) 1996 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * scoasm.h - used to define inline versions of certain functions which - * do NOT appear in sys/inline.h. - */ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#if defined(__SCO__) && defined(__USLC__) -#ifndef _SCOASM_HDR_INC -#define _SCOASM_HDR_INC - -asm void outl(port,val) -{ -%reg port,val; - movl port, %edx - movl val, %eax - outl (%dx) -%reg port; mem val; - movl port, %edx - movl val, %eax - outl (%dx) -%mem port; reg val; - movw port, %dx - movl val, %eax - outl (%dx) -%mem port,val; - movw port, %dx - movl val, %eax - outl (%dx) -} - -asm void outw(port,val) -{ -%reg port,val; - movl port, %edx - movl val, %eax - data16 - outl (%dx) -%reg port; mem val; - movl port, %edx - movw val, %ax - data16 - outl (%dx) -%mem port; reg val; - movw port, %dx - movl val, %eax - data16 - outl (%dx) -%mem port,val; - movw port, %dx - movw val, %ax - data16 - outl (%dx) -} - -asm void outb(port,val) -{ -%reg port,val; - movl port, %edx - movl val, %eax - outb (%dx) -%reg port; mem val; - movl port, %edx - movb val, %al - outb (%dx) -%mem port; reg val; - movw port, %dx - movl val, %eax - outb (%dx) -%mem port,val; - movw port, %dx - movb val, %al - outb (%dx) -} - -asm int inl(port) -{ -%reg port; - movl port, %edx - inl (%dx) -%mem port; - movw port, %dx - inl (%dx) -} - -asm int inw(port) -{ -%reg port; - subl %eax, %eax - movl port, %edx - data16 - inl (%dx) -%mem port; - subl %eax, %eax - movw port, %dx - data16 - inl (%dx) -} - -asm int inb(port) -{ -%reg port; - subl %eax, %eax - movl port, %edx - inb (%dx) -%mem port; - subl %eax, %eax - movw port, %dx - inb (%dx) -} - -#endif /* _SCOASM_HDR_INC */ -#endif /* __SCO__ && __USLC__ */ diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 886c25b13..54332e381 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -62,9 +62,6 @@ extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec; #define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec) -extern _X_EXPORT DevPrivateKeyRec xf86PixmapKeyRec; -#define xf86PixmapKey (&xf86PixmapKeyRec) - extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern _X_EXPORT const unsigned char byte_reversed[256]; extern _X_EXPORT Bool fbSlotClaimed; @@ -72,7 +69,6 @@ extern _X_EXPORT Bool fbSlotClaimed; extern _X_EXPORT Bool sbusSlotClaimed; #endif extern _X_EXPORT confDRIRec xf86ConfigDRI; -extern _X_EXPORT Bool xf86inSuspend; extern _X_EXPORT Bool xf86DRI2Enabled(void); extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ @@ -139,7 +135,6 @@ extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex); extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer); extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex); -extern _X_EXPORT void xf86EnterServerState(xf86State state); extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex); @@ -203,6 +198,7 @@ extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, po extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler); extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler); extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler); +extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, pointer data); extern _X_EXPORT void xf86InterceptSignals(int *signo); extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler)(void)); extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new); diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 200cb8f03..5c6e7210c 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -120,7 +120,7 @@ FreeList(const char ***list, int *lines) int i; for (i = 0; i < *lines; i++) { - free((*list)[i]); + free((char *)((*list)[i])); } free(*list); *list = NULL; @@ -282,21 +282,31 @@ listPossibleVideoDrivers(char *matches[], int nmatches) static Bool copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) { + confScreenPtr nscreen; GDevPtr cptr = NULL; - xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); - if(!xf86ConfigLayout.screens[i].screen) + nscreen = malloc(sizeof(confScreenRec)); + if (!nscreen) return FALSE; - memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); + memcpy(nscreen, oscreen, sizeof(confScreenRec)); - cptr = calloc(1, sizeof(GDevRec)); - if (!cptr) + cptr = malloc(sizeof(GDevRec)); + if (!cptr) { + free(nscreen); return FALSE; + } memcpy(cptr, odev, sizeof(GDevRec)); - cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver); + if (asprintf(&cptr->identifier, "Autoconfigured Video Device %s", driver) + == -1) { + free(cptr); + free(nscreen); + return FALSE; + } cptr->driver = driver; + xf86ConfigLayout.screens[i].screen = nscreen; + /* now associate the new driver entry with the new screen entry */ xf86ConfigLayout.screens[i].screen->device = cptr; cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 90c1914f0..3b0896863 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -484,8 +484,6 @@ xf86AccessEnter(void) for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityEnter) xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); - - xf86EnterServerState(SETUP); } void @@ -498,32 +496,6 @@ xf86AccessLeave(void) xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); } -/* - * xf86EnterServerState() -- set state the server is in. - */ - -typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState; - -void -xf86EnterServerState(xf86State state) -{ - static int sigio_state; - static TriState sigio_blocked = TRI_UNSET; - - /* - * This is a good place to block SIGIO during SETUP state. SIGIO should be - * blocked in SETUP state otherwise (u)sleep() might get interrupted - * early. We take care not to call xf86BlockSIGIO() twice. - */ - if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) { - sigio_state = xf86BlockSIGIO(); - sigio_blocked = TRI_TRUE; - } else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) { - xf86UnblockSIGIO(sigio_state); - sigio_blocked = TRI_FALSE; - } -} - /* * xf86PostProbe() -- Allocate all non conflicting resources * This function gets called by xf86Init(). @@ -546,13 +518,6 @@ xf86PostProbe(void) xf86Entities[i]->entityInit(i,xf86Entities[i]->private); } -void -xf86PostScreenInit(void) -{ - xf86VGAarbiterWrapFunctions(); - xf86EnterServerState(OPERATING); -} - int xf86GetLastScrnFlag(int entityIndex) { diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 92fb74da8..114bdc3a3 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -63,7 +63,6 @@ #include "xf86pciBus.h" #include "xf86Xinput.h" -extern DeviceAssocRec mouse_assoc; #include "xkbsrv.h" @@ -136,7 +135,7 @@ static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor); static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active); -static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, +static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input, MessageType from); static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display); static Bool addDefaultModes(MonPtr monitorp); @@ -209,9 +208,7 @@ xf86ValidateFontPath(char *path) continue; } else { - p1 = xnfalloc(strlen(dir_elem)+strlen(DIR_FILE)+1); - strcpy(p1, dir_elem); - strcat(p1, DIR_FILE); + XNFasprintf(&p1, "%s%s", dir_elem, DIR_FILE); flag = stat(p1, &stat_buf); if (flag == 0) if (!S_ISREG(stat_buf.st_mode)) @@ -312,7 +309,7 @@ xf86ModulelistFromConfig(pointer **optlist) } if (found == FALSE) { XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; - ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); + xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name); } } @@ -321,7 +318,7 @@ xf86ModulelistFromConfig(pointer **optlist) for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { if (ModuleDefaults[i].toLoad == TRUE) { XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; - ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); + xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); } } } @@ -445,8 +442,8 @@ xf86InputDriverlistFromConfig(void) { int count = 0; char **modulearray; - IDevPtr* idp; - + InputInfoPtr *idp; + /* * make sure the config file has been parsed and that we have a * ModulePath set; if no ModulePath was given, use the default @@ -504,7 +501,6 @@ fixup_video_driver_list(char **drivers) static const char *fallback[4] = { "vesa", "fbdev", "wsfb", NULL }; char **end, **drv; char *x; - char **ati, **atimisc; int i; /* walk to the end of the list */ @@ -587,12 +583,11 @@ configFiles(XF86ConfFilesPtr fileconf) else if (fileconf && fileconf->file_fontpath) { pathFrom = X_CONFIG; if (xf86Info.useDefaultFontPath) { - defaultFontPath = Xprintf("%s%s%s", - fileconf->file_fontpath, - *temp_path ? "," : "", temp_path); - if (defaultFontPath != NULL) { + if (asprintf(&defaultFontPath, "%s%s%s", fileconf->file_fontpath, + *temp_path ? "," : "", temp_path) == -1) + defaultFontPath = NULL; + else must_copy = FALSE; - } } else defaultFontPath = fileconf->file_fontpath; @@ -743,8 +738,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE }, { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, @@ -955,13 +948,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif - /* AllowEmptyInput is automatically true if we're hotplugging */ - xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); - xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); + /* if we're not hotplugging, force some input devices to exist */ + xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices); - /* AEI on? Then we're not using kbd, so use the evdev rules set. */ + /* when forcing input devices, we use kbd. otherwise evdev, so use the + * evdev rules set. */ #if defined(linux) - if (xf86Info.allowEmptyInput) + if (!xf86Info.forceInputDevices) set.rules = "evdev"; #endif XkbSetRulesDflts(&set); @@ -1093,12 +1086,12 @@ Bool xf86DRI2Enabled(void) static Bool checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) { - IDevPtr corePointer = NULL, coreKeyboard = NULL; + InputInfoPtr corePointer = NULL, coreKeyboard = NULL; Bool foundPointer = FALSE, foundKeyboard = FALSE; const char *pointerMsg = NULL, *keyboardMsg = NULL; - IDevPtr *devs, /* iterator */ + InputInfoPtr *devs, /* iterator */ indp; - IDevRec Pointer, Keyboard; + InputInfoRec Pointer = {}, Keyboard = {}; XF86ConfInputPtr confInput; XF86ConfInputRec defPtr, defKbd; int count = 0; @@ -1113,49 +1106,27 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * remove the core attribute from the later ones. */ for (devs = servlayoutp->inputs; devs && *devs; devs++) { - pointer opt1 = NULL, opt2 = NULL; indp = *devs; - if (indp->commonOptions && - xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) { - opt1 = indp->commonOptions; - } - if (indp->extraOptions && - xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) { - opt2 = indp->extraOptions; - } - if (opt1 || opt2) { + if (indp->options && + xf86CheckBoolOption(indp->options, "CorePointer", FALSE)) { if (!corePointer) { corePointer = indp; } else { - if (opt1) - xf86ReplaceBoolOption(opt1, "CorePointer", FALSE); - if (opt2) - xf86ReplaceBoolOption(opt2, "CorePointer", FALSE); + xf86ReplaceBoolOption(indp->options, "CorePointer", FALSE); xf86Msg(X_WARNING, "Duplicate core pointer devices. " "Removing core pointer attribute from \"%s\"\n", - indp->identifier); + indp->name); } } - opt1 = opt2 = NULL; - if (indp->commonOptions && - xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) { - opt1 = indp->commonOptions; - } - if (indp->extraOptions && - xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) { - opt2 = indp->extraOptions; - } - if (opt1 || opt2) { + if (indp->options && + xf86CheckBoolOption(indp->options, "CoreKeyboard", FALSE)) { if (!coreKeyboard) { coreKeyboard = indp; } else { - if (opt1) - xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE); - if (opt2) - xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE); + xf86ReplaceBoolOption(indp->options, "CoreKeyboard", FALSE); xf86Msg(X_WARNING, "Duplicate core keyboard devices. " "Removing core keyboard attribute from \"%s\"\n", - indp->identifier); + indp->name); } } count++; @@ -1182,7 +1153,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == corePointer) { free(*devs); - *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/ + *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop*/ break; } for (; devs && *devs; devs++) @@ -1200,7 +1171,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 3. First core pointer device. */ - if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) { + if (!foundPointer && (xf86Info.forceInputDevices || implicitLayout)) { XF86ConfInputPtr p; for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { @@ -1216,7 +1187,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 4. First pointer with an allowed mouse driver. */ - if (!foundPointer && !xf86Info.allowEmptyInput) { + if (!foundPointer && xf86Info.forceInputDevices) { const char **driver = mousedrivers; confInput = xf86findInput(CONF_IMPLICIT_POINTER, xf86configptr->conf_input_lst); @@ -1233,7 +1204,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 5. Built-in default. */ - if (!foundPointer && !xf86Info.allowEmptyInput) { + if (!foundPointer && xf86Info.forceInputDevices) { memset(&defPtr, 0, sizeof(defPtr)); defPtr.inp_identifier = strdup(""); defPtr.inp_driver = strdup("mouse"); @@ -1249,17 +1220,18 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) { count++; devs = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevPtr)); - devs[count - 1] = xnfalloc(sizeof(IDevRec)); + (count + 1) * sizeof(InputInfoPtr)); + devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); *devs[count - 1] = Pointer; - devs[count - 1]->extraOptions = - xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL); + devs[count - 1]->options = + xf86addNewOption(devs[count -1]->options, + xnfstrdup("CorePointer"), NULL); devs[count] = NULL; servlayoutp->inputs = devs; } } - if (!foundPointer && !xf86Info.allowEmptyInput) { + if (!foundPointer && xf86Info.forceInputDevices) { /* This shouldn't happen. */ xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n"); return FALSE; @@ -1283,7 +1255,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) driver++; } } - if (!found && !xf86Info.allowEmptyInput) { + if (!found && xf86Info.forceInputDevices) { xf86Msg(X_INFO, "No default mouse found, adding one\n"); memset(&defPtr, 0, sizeof(defPtr)); defPtr.inp_identifier = strdup(""); @@ -1293,10 +1265,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) { count++; devs = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevPtr)); - devs[count - 1] = xnfalloc(sizeof(IDevRec)); + (count + 1) * sizeof(InputInfoPtr)); + devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); *devs[count - 1] = Pointer; - devs[count - 1]->extraOptions = + devs[count - 1]->options = xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL); devs[count] = NULL; servlayoutp->inputs = devs; @@ -1324,7 +1296,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == coreKeyboard) { free(*devs); - *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */ + *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop */ break; } for (; devs && *devs; devs++) @@ -1342,7 +1314,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 3. First core keyboard device. */ - if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) { + if (!foundKeyboard && (xf86Info.forceInputDevices || implicitLayout)) { XF86ConfInputPtr p; for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { @@ -1358,7 +1330,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */ - if (!foundKeyboard && !xf86Info.allowEmptyInput) { + if (!foundKeyboard && xf86Info.forceInputDevices) { confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD, xf86configptr->conf_input_lst); if (!confInput) { @@ -1373,7 +1345,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } /* 5. Built-in default. */ - if (!foundKeyboard && !xf86Info.allowEmptyInput) { + if (!foundKeyboard && xf86Info.forceInputDevices) { memset(&defKbd, 0, sizeof(defKbd)); defKbd.inp_identifier = strdup(""); defKbd.inp_driver = strdup("kbd"); @@ -1389,17 +1361,18 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundKeyboard) { count++; devs = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevPtr)); - devs[count - 1] = xnfalloc(sizeof(IDevRec)); + (count + 1) * sizeof(InputInfoPtr)); + devs[count - 1] = xnfalloc(sizeof(InputInfoRec)); *devs[count - 1] = Keyboard; - devs[count - 1]->extraOptions = - xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL); + devs[count - 1]->options = + xf86addNewOption(devs[count - 1]->options, + xnfstrdup("CoreKeyboard"), NULL); devs[count] = NULL; servlayoutp->inputs = devs; } } - if (!foundKeyboard && !xf86Info.allowEmptyInput) { + if (!foundKeyboard && xf86Info.forceInputDevices) { /* This shouldn't happen. */ xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n"); return FALSE; @@ -1425,7 +1398,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "\tUsing the %s.\n", keyboardMsg); } - if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) { + if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) { #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) const char *config_backend; #if defined(CONFIG_HAL) @@ -1438,8 +1411,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "reconfigure %s or disable AutoAddDevices.\n", config_backend, config_backend); #else - xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n" - "\tTry disabling AllowEmptyInput.\n"); + xf86Msg(X_WARNING, "Hotplugging requested but the server was " + "compiled without a config backend. " + "No input devices were configured, the server " + "will start without any input devices.\n"); #endif } @@ -1464,7 +1439,7 @@ static Bool configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) { XF86ConfInputrefPtr irp; - IDevPtr *indp; + InputInfoPtr *indp; int count = 0; /* @@ -1477,19 +1452,21 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) } DebugF("Found %d input devices in the layout section %s\n", count, layout->lay_identifier); - indp = xnfcalloc((count + 1), sizeof(IDevPtr)); + indp = xnfcalloc((count + 1), sizeof(InputInfoPtr)); indp[count] = NULL; irp = layout->lay_input_lst; count = 0; while (irp) { - indp[count] = xnfalloc(sizeof(IDevRec)); + indp[count] = xf86AllocateInput(); if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) { - while(count--) + do { free(indp[count]); + } while(count--); free(indp); return FALSE; } - indp[count]->extraOptions = irp->iref_option_lst; + indp[count]->options = xf86OptionListMerge(indp[count]->options, + irp->iref_option_lst); count++; irp = (XF86ConfInputrefPtr)irp->list.next; } @@ -1509,7 +1486,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, { XF86ConfAdjacencyPtr adjp; XF86ConfInactivePtr idp; - int count = 0; + int saved_count, count = 0; int scrnum; XF86ConfLayoutPtr l; MessageType from; @@ -1577,6 +1554,9 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, scrnum = adjp->adj_scrnum; if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum, X_CONFIG)) { + do { + free(slp[count].screen); + } while(count--); free(slp); return FALSE; } @@ -1665,6 +1645,10 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, } } + if (!count) + saved_count = 1; + else + saved_count = count; /* * Count the number of inactive devices. */ @@ -1681,16 +1665,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, idp = conf_layout->lay_inactive_lst; count = 0; while (idp) { - if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) { - free(gdp); - return FALSE; - } + if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) + goto bail; count++; idp = (XF86ConfInactivePtr)idp->list.next; } if (!configInputDevices(conf_layout, servlayoutp)) - return FALSE; + goto bail; servlayoutp->id = conf_layout->lay_identifier; servlayoutp->screens = slp; @@ -1699,6 +1681,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, from = X_DEFAULT; return TRUE; + +bail: + do { + free(slp[saved_count].screen); + } while(saved_count--); + free(slp); + free(gdp); + return FALSE; } /* @@ -1712,7 +1702,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, MessageType from; XF86ConfScreenPtr s; screenLayoutPtr slp; - IDevPtr *indp; + InputInfoPtr *indp; XF86ConfLayoutRec layout; if (!servlayoutp) @@ -1758,7 +1748,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, from = X_DEFAULT; } else { /* Set up an empty input device list, then look for some core devices. */ - indp = xnfalloc(sizeof(IDevPtr)); + indp = xnfalloc(sizeof(InputInfoPtr)); *indp = NULL; servlayoutp->inputs = indp; } @@ -1811,9 +1801,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, XF86ConfDisplayPtr dispptr; XF86ConfAdaptorLinkPtr conf_adaptor; Bool defaultMonitor = FALSE; + XF86ConfScreenRec local_conf_screen; if (!conf_screen) { - conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec)); + memset(&local_conf_screen, 0, sizeof(local_conf_screen)); + conf_screen = &local_conf_screen; conf_screen->scrn_identifier = "Default Screen Section"; xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n"); } @@ -2211,7 +2203,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) static void configDRI(XF86ConfDRIPtr drip) { - int i; struct group *grp; xf86ConfigDRI.group = -1; @@ -2283,13 +2274,12 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) } static Bool -configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from) +configInput(InputInfoPtr inputp, XF86ConfInputPtr conf_input, MessageType from) { xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier); - inputp->identifier = conf_input->inp_identifier; + inputp->name = conf_input->inp_identifier; inputp->driver = conf_input->inp_driver; - inputp->commonOptions = conf_input->inp_option_lst; - inputp->extraOptions = NULL; + inputp->options = conf_input->inp_option_lst; inputp->attrs = NULL; return TRUE; @@ -2338,12 +2328,13 @@ static void checkInput(serverLayoutPtr layout, Bool implicit_layout) { checkCoreInputDevices(layout, implicit_layout); - /* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually - * exclusive. Trawl the list for mouse/kbd devices and disable them. + /* Unless we're forcing input devices, disable mouse/kbd devices in the + * config. Otherwise the same physical device is added multiple times, + * leading to duplicate events. */ - if (xf86Info.allowEmptyInput && layout->inputs) + if (!xf86Info.forceInputDevices && layout->inputs) { - IDevPtr *dev = layout->inputs; + InputInfoPtr *dev = layout->inputs; BOOL warned = FALSE; while(*dev) @@ -2352,15 +2343,15 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { strcmp((*dev)->driver, "mouse") == 0 || strcmp((*dev)->driver, "vmmouse") == 0) { - IDevPtr *current; + InputInfoPtr *current; if (!warned) { - xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using " + xf86Msg(X_WARNING, "Hotplugging is on, devices using " "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n"); warned = TRUE; } - xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier); + xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->name); current = dev; free(*dev); diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 7235c6175..975266943 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -39,6 +39,7 @@ #include "xf86Bus.h" #include "xf86Sbus.h" #endif +#include "misc.h" typedef struct _DevToConfig { GDevRec GDev; @@ -56,17 +57,15 @@ xf86MonPtr ConfiguredMonitor; Bool xf86DoConfigurePass1 = TRUE; static Bool foundMouse = FALSE; -#if defined(__SCO__) -static char *DFLT_MOUSE_PROTO = "OSMouse"; -#elif defined(__UNIXWARE__) -static char *DFLT_MOUSE_PROTO = "OSMouse"; -static char *DFLT_MOUSE_DEV = "/dev/mouse"; -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) static char *DFLT_MOUSE_DEV = "/dev/sysmouse"; static char *DFLT_MOUSE_PROTO = "auto"; #elif defined(linux) static char DFLT_MOUSE_DEV[] = "/dev/input/mice"; static char DFLT_MOUSE_PROTO[] = "auto"; +#elif defined(WSCONS_SUPPORT) +static char *DFLT_MOUSE_DEV = "/dev/wsmouse"; +static char *DFLT_MOUSE_PROTO = "wsmouse"; #else static char *DFLT_MOUSE_DEV = "/dev/mouse"; static char *DFLT_MOUSE_PROTO = "auto"; @@ -158,26 +157,12 @@ configureInputSection (void) /* Crude mechanism to auto-detect mouse (os dependent) */ { int fd; -#ifdef WSCONS_SUPPORT - fd = open("/dev/wsmouse", 0); - if (fd >= 0) { - DFLT_MOUSE_DEV = "/dev/wsmouse"; - DFLT_MOUSE_PROTO = "wsmouse"; - close(fd); - } else { - ErrorF("cannot open /dev/wsmouse\n"); - } -#endif -#ifndef __SCO__ fd = open(DFLT_MOUSE_DEV, 0); if (fd != -1) { foundMouse = TRUE; close(fd); } -#else - foundMouse = TRUE; -#endif } mouse = calloc(1, sizeof(XF86ConfInputRec)); @@ -186,11 +171,9 @@ configureInputSection (void) mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, strdup("Protocol"), strdup(DFLT_MOUSE_PROTO)); -#ifndef __SCO__ mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, strdup("Device"), strdup(DFLT_MOUSE_DEV)); -#endif mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, strdup("ZAxisMapping"), strdup("4 5 6 7")); @@ -205,12 +188,9 @@ configureScreenSection (int screennum) int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ }; parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec) - ptr->scrn_identifier = malloc(18); - sprintf(ptr->scrn_identifier, "Screen%d", screennum); - ptr->scrn_monitor_str = malloc(19); - sprintf(ptr->scrn_monitor_str, "Monitor%d", screennum); - ptr->scrn_device_str = malloc(16); - sprintf(ptr->scrn_device_str, "Card%d", screennum); + XNFasprintf(&ptr->scrn_identifier, "Screen%d", screennum); + XNFasprintf(&ptr->scrn_monitor_str, "Monitor%d", screennum); + XNFasprintf(&ptr->scrn_device_str, "Card%d", screennum); for (i=0; idev_identifier = strdup(identifier); + if (asprintf(&ptr->dev_identifier, "Card%d", screennum) == -1) + ptr->dev_identifier = NULL; ptr->dev_chipset = DevToConfig[screennum].GDev.chipset; ptr->dev_busid = DevToConfig[screennum].GDev.busID; ptr->dev_driver = DevToConfig[screennum].GDev.driver; @@ -306,10 +285,8 @@ configureDeviceSection (int screennum) int len = strlen(ptr->dev_comment) + strlen(prefix) + strlen(middle) + strlen(suffix) + 1; - optname = malloc(strlen(p->name) + 2 + 1); - if (!optname) + if (asprintf(&optname, "\"%s\"", p->name) == -1) break; - sprintf(optname, "\"%s\"", p->name); len += max(20, strlen(optname)); len += strlen(opttype); @@ -370,16 +347,14 @@ configureLayoutSection (void) aptr->adj_x = 0; aptr->adj_y = 0; aptr->adj_scrnum = scrnum; - aptr->adj_screen_str = xnfalloc(18); - sprintf(aptr->adj_screen_str, "Screen%d", scrnum); + XNFasprintf(&aptr->adj_screen_str, "Screen%d", scrnum); if (scrnum == 0) { aptr->adj_where = CONF_ADJ_ABSOLUTE; aptr->adj_refscreen = NULL; } else { aptr->adj_where = CONF_ADJ_RIGHTOF; - aptr->adj_refscreen = xnfalloc(18); - sprintf(aptr->adj_refscreen, "Screen%d", scrnum - 1); + XNFasprintf(&aptr->adj_refscreen, "Screen%d", scrnum - 1); } ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr)xf86addListItem((glp)ptr->lay_adjacency_lst, @@ -443,8 +418,7 @@ configureMonitorSection (int screennum) { parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec) - ptr->mon_identifier = malloc(19); - sprintf(ptr->mon_identifier, "Monitor%d", screennum); + XNFasprintf(&ptr->mon_identifier, "Monitor%d", screennum); ptr->mon_vendor = strdup("Monitor Vendor"); ptr->mon_modelname = strdup("Monitor Model"); @@ -491,11 +465,9 @@ configureDDCMonitorSection (int screennum) parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec) - ptr->mon_identifier = malloc(19); - sprintf(ptr->mon_identifier, "Monitor%d", screennum); + XNFasprintf(&ptr->mon_identifier, "Monitor%d", screennum); ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name); - ptr->mon_modelname = malloc(12); - sprintf(ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id); + XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id); /* features in centimetres, we want millimetres */ mon_width = 10 * ConfiguredMonitor->features.hsize ; @@ -536,10 +508,6 @@ configureDDCMonitorSection (int screennum) return ptr; } -#if !defined(PATH_MAX) -# define PATH_MAX 1024 -#endif - void DoConfigure(void) { @@ -760,13 +728,6 @@ DoConfigure(void) ErrorF("\n"); -#ifdef __SCO__ - ErrorF("\n"__XSERVERNAME__ - " is using the kernel event driver to access the mouse.\n" - "If you wish to use the internal "__XSERVERNAME__ - " mouse drivers, please\n" - "edit the file and correct the Device.\n"); -#else /* !__SCO__ */ if (!foundMouse) { ErrorF("\n"__XSERVERNAME__" is not able to detect your mouse.\n" "Edit the file and correct the Device.\n"); @@ -777,7 +738,6 @@ DoConfigure(void) " tries to autodetect\n" "the protocol.\n",DFLT_MOUSE_DEV); } -#endif /* !__SCO__ */ if (xf86NumScreens > 1) { ErrorF("\n"__XSERVERNAME__ diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 0d27fd585..929f047cc 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -202,7 +202,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); ScreenPtr pCursorScreen; Bool Switched; - int px, py; + int px, py, was_blocked; DeviceIntPtr dev, it; if (!pScr->vtSema || !mode || !pScr->SwitchMode) @@ -232,7 +232,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (pScreen == pCursorScreen) miPointerGetPosition(dev, &px, &py); - xf86EnterServerState(SETUP); + was_blocked = xf86BlockSIGIO(); Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0); if (Switched) { pScr->currentMode = mode; @@ -269,7 +269,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) pScr->frameY1 = pScr->virtualY - 1; } } - xf86EnterServerState(OPERATING); + xf86UnblockSIGIO(was_blocked); if (pScr->AdjustFrame) (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 1058a466c..74eb739e4 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -53,7 +53,7 @@ static DevPrivateKeyRec DGAScreenKeyRec; #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec) -static int mieq_installed = 0; +static Bool mieq_installed; static Bool DGACloseScreen(int i, ScreenPtr pScreen); static void DGADestroyColormap(ColormapPtr pmap); @@ -250,9 +250,10 @@ DGACloseScreen(int i, ScreenPtr pScreen) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); - if (XDGAEventBase) { + if (mieq_installed) { mieqSetHandler(ET_DGAEvent, NULL); - } + mieq_installed = FALSE; + } FreeMarkedVisuals(pScreen); @@ -446,6 +447,11 @@ xf86SetDGAMode( pScreenPriv->grabMouse = TRUE; pScreenPriv->grabKeyboard = TRUE; + if (!mieq_installed) { + mieqSetHandler(ET_DGAEvent, DGAHandleEvent); + mieq_installed = TRUE; + } + return Success; } @@ -466,7 +472,7 @@ DGASetInputMode(int index, Bool keyboard, Bool mouse) if (!mieq_installed) { mieqSetHandler(ET_DGAEvent, DGAHandleEvent); - mieq_installed = 1; + mieq_installed = TRUE; } } } @@ -936,8 +942,6 @@ DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down) return TRUE; } -static int DGAMouseX, DGAMouseY; - Bool DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy) { @@ -952,17 +956,6 @@ DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy) if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */ return FALSE; - DGAMouseX += dx; - if (DGAMouseX < 0) - DGAMouseX = 0; - else if (DGAMouseX > screenInfo.screens[index]->width) - DGAMouseX = screenInfo.screens[index]->width; - DGAMouseY += dy; - if (DGAMouseY < 0) - DGAMouseY = 0; - else if (DGAMouseY > screenInfo.screens[index]->height) - DGAMouseY = screenInfo.screens[index]->height; - memset(&event, 0, sizeof(event)); event.header = ET_Internal; event.type = ET_DGAEvent; @@ -1006,18 +999,6 @@ DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) /* We have the power to steal or modify events that are about to get queued */ -Bool -DGAIsDgaEvent (xEvent *e) -{ - int coreEquiv; - if (!DGAScreenKeyRegistered || XDGAEventBase == 0) - return FALSE; - coreEquiv = e->u.u.type - *XDGAEventBase; - if (KeyPress <= coreEquiv && coreEquiv <= MotionNotify) - return TRUE; - return FALSE; -} - #define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */ static Mask filters[] = { @@ -1039,6 +1020,7 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr keybd) DeviceEvent ev; memset(&ev, 0, sizeof(ev)); + ev.header = ET_Internal; ev.length = sizeof(ev); ev.detail.key = event->detail; ev.type = event->subtype; @@ -1058,8 +1040,8 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr keybd) de.u.u.type = *XDGAEventBase + GetCoreType((InternalEvent*)&ev); de.u.u.detail = event->detail; de.u.event.time = event->time; - de.u.event.dx = 0; - de.u.event.dy = 0; + de.u.event.dx = event->dx; + de.u.event.dy = event->dy; de.u.event.screen = pScreen->myNum; de.u.event.state = ev.corestate; @@ -1114,8 +1096,8 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse) de.u.u.type = *XDGAEventBase + coreEquiv; de.u.u.detail = event->detail; de.u.event.time = event->time; - de.u.event.dx = 0; - de.u.event.dy = 0; + de.u.event.dx = event->dx; + de.u.event.dy = event->dy; de.u.event.screen = pScreen->myNum; de.u.event.state = ev.corestate; @@ -1216,6 +1198,9 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device) if (!pScreenPriv) return; + if (!IsMaster(device)) + return; + switch (event->subtype) { case KeyPress: case KeyRelease: diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 2e82848ce..c4a4db9be 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -376,7 +376,7 @@ static void xf86ReleaseKeys(DeviceIntPtr pDev) { KeyClassPtr keyc; - int i, j, nevents, sigstate; + int i, sigstate; if (!pDev || !pDev->key) return; @@ -399,9 +399,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev) i++) { if (key_is_down(pDev, i, KEY_POSTED)) { sigstate = xf86BlockSIGIO (); - nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); - for (j = 0; j < nevents; j++) - mieqEnqueue(pDev, (InternalEvent*)(xf86Events + j)->event); + QueueKeyboardEvents(pDev, KeyRelease, i, NULL); xf86UnblockSIGIO(sigstate); } } @@ -414,7 +412,8 @@ xf86ReleaseKeys(DeviceIntPtr pDev) static void xf86VTSwitch(void) { - int i, prevSIGIO; + int i; + static int prevSIGIO; InputInfoPtr pInfo; IHPtr ih; @@ -456,7 +455,8 @@ xf86VTSwitch(void) DisableDevice(pInfo->dev, TRUE); } } - xf86EnterServerState(SETUP); + + prevSIGIO = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(i, 0); @@ -468,14 +468,11 @@ xf86VTSwitch(void) */ DebugF("xf86VTSwitch: Leave failed\n"); - prevSIGIO = xf86BlockSIGIO(); xf86AccessEnter(); - xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { if (!xf86Screens[i]->EnterVT(i, 0)) FatalError("EnterVT failed for screen %d\n", i); } - xf86EnterServerState(OPERATING); if (!(dispatchException & DE_TERMINATE)) { for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) @@ -513,11 +510,9 @@ xf86VTSwitch(void) xf86DisableIO(); } } else { - DebugF("xf86VTSwitch: Entering\n"); if (!xf86VTSwitchTo()) return; - prevSIGIO = xf86BlockSIGIO(); #ifdef XF86PM xf86OSPMClose = xf86OSPMOpen(); #endif @@ -525,13 +520,11 @@ xf86VTSwitch(void) if (xorgHWAccess) xf86EnableIO(); xf86AccessEnter(); - xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->vtSema = TRUE; if (!xf86Screens[i]->EnterVT(i, 0)) FatalError("EnterVT failed for screen %d\n", i); } - xf86EnterServerState(OPERATING); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess)(i, TRUE); @@ -600,6 +593,26 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) return ih; } +/** + * Set the handler for the console's fd. Replaces (and returns) the previous + * handler or NULL, whichever appropriate. + * proc may be NULL if the server should not handle events on the console. + */ +InputHandlerProc +xf86SetConsoleHandler(InputHandlerProc proc, pointer data) +{ + static InputHandlerProc handler = NULL; + InputHandlerProc old_handler = handler; + + if (old_handler) + xf86RemoveGeneralHandler(old_handler); + + xf86AddGeneralHandler(xf86Info.consoleFd, proc, data); + handler = proc; + + return old_handler; +} + static void removeInputHandler(IHPtr ih) { diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 781ee49ca..16d55577e 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -49,7 +49,6 @@ DevPrivateKeyRec xf86CreateRootWindowKeyRec; DevPrivateKeyRec xf86ScreenKeyRec; -DevPrivateKeyRec xf86PixmapKeyRec; ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */ const unsigned char byte_reversed[256] = @@ -125,15 +124,14 @@ xf86InfoRec xf86Info = { #endif .pmFlag = TRUE, .log = LogNone, - .kbdCustomKeycodes = FALSE, .disableRandR = FALSE, .randRFrom = X_DEFAULT, #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) - .allowEmptyInput = TRUE, + .forceInputDevices = FALSE, .autoAddDevices = TRUE, .autoEnableDevices = TRUE #else - .allowEmptyInput = FALSE, + .forceInputDevices = TRUE, .autoAddDevices = FALSE, .autoEnableDevices = FALSE #endif @@ -196,5 +194,4 @@ Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; -Bool xf86inSuspend = FALSE; Bool xorgHWAccess = FALSE; diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 67be200c5..3cdffdb43 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -273,72 +273,6 @@ xf86AllocateScrnInfoPrivateIndex(void) return idx; } -/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */ -InputInfoPtr -xf86AllocateInput(InputDriverPtr drv, int flags) -{ - InputInfoPtr new, *prev = NULL; - - if (!(new = calloc(sizeof(InputInfoRec), 1))) - return NULL; - - new->drv = drv; - new->module = DuplicateModule(drv->module, NULL); - - for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next) - ; - - *prev = new; - new->next = NULL; - - return new; -} - - -/* - * Remove an entry from xf86InputDevs. Ideally it should free all allocated - * data. To do this properly may require a driver hook. - */ - -void -xf86DeleteInput(InputInfoPtr pInp, int flags) -{ - InputInfoPtr p; - - /* First check if the inputdev is valid. */ - if (pInp == NULL) - return; - -#if 0 - /* If a free function is defined, call it here. */ - if (pInp->free) - pInp->free(pInp, 0); -#endif - - if (pInp->module) - UnloadModule(pInp->module); - - /* This should *really* be handled in drv->UnInit(dev) call instead, but - * if the driver forgets about it make sure we free it or at least crash - * with flying colors */ - free(pInp->private); - - FreeInputAttributes(pInp->attrs); - - /* Remove the entry from the list. */ - if (pInp == xf86InputDevs) - xf86InputDevs = pInp->next; - else { - p = xf86InputDevs; - while (p && p->next != pInp) - p = p->next; - if (p) - p->next = pInp->next; - /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ - } - free(pInp); -} - Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) { @@ -1048,106 +982,6 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen) } } -/* - * xf86SetRootClip -- - * Enable or disable rendering to the screen by - * setting the root clip list and revalidating - * all of the windows - */ - -static void -xf86SetRootClip (ScreenPtr pScreen, Bool enable) -{ - WindowPtr pWin = pScreen->root; - WindowPtr pChild; - Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked = FALSE; - WindowPtr pLayerWin; - BoxRec box; - - if (WasViewable) - { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - (void) (*pScreen->MarkOverlappedWindows)(pChild, - pChild, - &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = RegionCreate(NullBox, 1); - RegionSubtract(borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - /* - * Use REGION_BREAK to avoid optimizations in ValidateTree - * that assume the root borderClip can't change well, normally - * it doesn't...) - */ - if (enable) - { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - RegionInit(&pWin->winSize, &box, 1); - RegionInit(&pWin->borderSize, &box, 1); - if (WasViewable) - RegionReset(&pWin->borderClip, &box); - pWin->drawable.width = pScreen->width; - pWin->drawable.height = pScreen->height; - RegionBreak(&pWin->clipList); - } - else - { - RegionEmpty(&pWin->borderClip); - RegionBreak(&pWin->clipList); - } - - ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->firstChild) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, - pWin->firstChild, - (WindowPtr *)NULL); - } - else - { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - - - if (anyMarked) - (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); - } - - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - FlushAllOutput (); -} - /* * Function to enable/disable access to the frame buffer * @@ -1181,7 +1015,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) * Restore all of the clip lists on the screen */ if (!xf86Resetting) - xf86SetRootClip (pScreen, TRUE); + SetRootClip (pScreen, TRUE); } else @@ -1189,7 +1023,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) /* * Empty all of the clip lists on the screen */ - xf86SetRootClip (pScreen, FALSE); + SetRootClip (pScreen, FALSE); } } @@ -1247,6 +1081,47 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) va_end(ap); } +/* Print input driver messages in the standard format of + : : */ +void +xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, + va_list args) +{ + char *msg; + + if (asprintf(&msg, "%s: %s: %s", dev->drv->driverName, dev->name, format) + == -1) { + LogVMessageVerb(type, verb, "%s", args); + } else { + LogVMessageVerb(type, verb, msg, args); + free(msg); + } +} + +/* Print input driver message, with verbose level specified directly */ +void +xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, + ...) +{ + va_list ap; + + va_start(ap, format); + xf86VIDrvMsgVerb(dev, type, verb, format, ap); + va_end(ap); +} + +/* Print input driver messages, with verbose level of 1 (default) */ +void +xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + xf86VIDrvMsgVerb(dev, type, 1, format, ap); + va_end(ap); +} + + /* Print non-driver messages with verbose level specified directly */ void xf86MsgVerb(MessageType type, int verb, const char *format, ...) @@ -1305,11 +1180,8 @@ xf86LogInit(void) /* Get the log file name */ if (xf86LogFileFrom == X_DEFAULT) { /* Append the display number and ".log" */ - lf = malloc(strlen(xf86LogFile) + strlen("%s") + - strlen(LOGSUFFIX) + 1); - if (!lf) + if (asprintf(&lf, "%s%%s" LOGSUFFIX, xf86LogFile) == -1) FatalError("Cannot allocate space for the log file name\n"); - sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile); xf86LogFile = lf; } @@ -1959,6 +1831,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, xf86SetEntityFuncs(entityIndex,init,enter,leave,private); + free(pEnt); return pScrn; } @@ -2070,7 +1943,7 @@ xf86IsUnblank(int mode) } void -xf86MotionHistoryAllocate(LocalDevicePtr local) +xf86MotionHistoryAllocate(InputInfoPtr pInfo) { - AllocateMotionHistory(local->dev); + AllocateMotionHistory(pInfo->dev); } diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h index 3838d6940..1b9b502f5 100644 --- a/hw/xfree86/common/xf86InPriv.h +++ b/hw/xfree86/common/xf86InPriv.h @@ -37,9 +37,6 @@ extern InputDriverPtr *xf86InputDriverList; extern int xf86NumInputDrivers; -/* xf86Xinput.c */ -int xf86ActivateDevice(InputInfoPtr pInfo); - /* xf86Helper.c */ InputDriverPtr xf86LookupInputDriver(const char *name); diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 877ebabf3..53f763aaf 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -330,7 +330,7 @@ InstallSignalHandlers(void) void InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) { - int i, j, k, scr_index; + int i, j, k, scr_index, was_blocked = 0; char **modulelist; pointer *optionlist; Pix24Flags screenpix24, pix24; @@ -536,8 +536,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->name == NULL) { - xf86Screens[i]->name = xnfalloc(strlen("screen") + 10 + 1); - sprintf(xf86Screens[i]->name, "screen%d", i); + XNFasprintf(&xf86Screens[i]->name, "screen%d", i); xf86MsgVerb(X_WARNING, 0, "Screen driver %d has no name set, using `%s'.\n", i, xf86Screens[i]->name); @@ -709,31 +708,16 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif xf86AccessEnter(); - xf86EnterServerState(SETUP); + was_blocked = xf86BlockSIGIO(); } } -#ifdef SCO325 - else { - /* - * Under SCO we must ack that we got the console at startup, - * I think this is the safest way to assure it. - */ - static int once = 1; - if (once) { - once = 0; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) - xf86Msg(X_WARNING, "VT_ACKACQ failed"); - } - } -#endif /* SCO325 */ for (i = 0; i < xf86NumScreens; i++) if (!xf86ColormapAllocatePrivates(xf86Screens[i])) FatalError("Cannot register DDX private keys"); if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterPrivateKey(&xf86PixmapKeyRec, PRIVATE_PIXMAP, 0)) + !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) FatalError("Cannot register DDX private keys"); for (i = 0; i < xf86NumScreens; i++) { @@ -795,7 +779,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #endif } - xf86PostScreenInit(); + xf86VGAarbiterWrapFunctions(); + xf86UnblockSIGIO(was_blocked); xf86InitOrigins(); @@ -814,16 +799,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void InitInput(int argc, char **argv) { - IDevPtr* pDev; + InputInfoPtr* pDev; DeviceIntPtr dev; xf86Info.vtRequestsPending = FALSE; mieqInit(); - GetEventList(&xf86Events); - - /* Call the PreInit function for each input device instance. */ + /* Initialize all configured input devices */ for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { /* Replace obsolete keyboard driver with kbd */ if (!xf86NameCmp((*pDev)->driver, "keyboard")) { @@ -944,6 +927,8 @@ AbortDDX(void) { int i; + xf86BlockSIGIO(); + /* * try to restore the original video state */ @@ -952,8 +937,6 @@ AbortDDX(void) DPMSSet(serverClient, DPMSModeOn); #endif if (xf86Screens) { - if (xf86Screens[0]->vtSema) - xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) if (xf86Screens[i]->vtSema) { /* @@ -1429,8 +1412,10 @@ xf86LoadModules(char **list, pointer *optlist) name = xf86NormalizeName(list[i]); /* Skip empty names */ - if (name == NULL || *name == '\0') + if (name == NULL || *name == '\0') { + free(name); continue; + } /* Replace obsolete keyboard driver with kbd */ if (!xf86NameCmp(name, "keyboard")) { diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index d03310e20..644e5ce80 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1402,6 +1402,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, strategy &= ~LOOKUP_OPTIONAL_TOLERANCES; } else { const char *type = ""; + Bool specified = FALSE; if (scrp->monitor->nHsync <= 0) { if (numTimings > 0) { @@ -1412,11 +1413,13 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } } else { scrp->monitor->hsync[0].lo = 31.5; - scrp->monitor->hsync[0].hi = 37.9; + scrp->monitor->hsync[0].hi = 48.0; scrp->monitor->nHsync = 1; } type = "default "; - } + } else { + specified = TRUE; + } for (i = 0; i < scrp->monitor->nHsync; i++) { if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, @@ -1445,7 +1448,9 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->monitor->nVrefresh = 1; } type = "default "; - } + } else { + specified = TRUE; + } for (i = 0; i < scrp->monitor->nVrefresh; i++) { if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, @@ -1459,10 +1464,16 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].hi); } + + type = ""; + if (!scrp->monitor->maxPixClock && !specified) { + type = "default "; + scrp->monitor->maxPixClock = 65000.0; + } if (scrp->monitor->maxPixClock) { xf86DrvMsg(scrp->scrnIndex, X_INFO, - "%s: Using maximum pixel clock of %.2f MHz\n", - scrp->monitor->id, + "%s: Using %smaximum pixel clock of %.2f MHz\n", + scrp->monitor->id, type, (float)scrp->monitor->maxPixClock / 1000.0); } } @@ -1632,8 +1643,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, new = xnfcalloc(1, sizeof(DisplayModeRec)); new->prev = last; new->type = M_T_USERDEF; - new->name = xnfalloc(strlen(modeNames[i]) + 1); - strcpy(new->name, modeNames[i]); + new->name = xnfstrdup(modeNames[i]); if (new->prev) new->prev->next = new; *endp = last = new; @@ -1705,10 +1715,9 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, p = xnfcalloc(1, sizeof(DisplayModeRec)); p->prev = last; - p->name = xnfalloc(strlen(r->name) + 1); + p->name = xnfstrdup(r->name); if (!userModes) p->type = M_T_USERDEF; - strcpy(p->name, r->name); if (p->prev) p->prev->next = p; *endp = last = p; diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 7a8f62f99..2a5c805c4 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -82,9 +82,9 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h index d75d3bf87..9453f2a73 100644 --- a/hw/xfree86/common/xf86Opt.h +++ b/hw/xfree86/common/xf86Opt.h @@ -84,6 +84,7 @@ extern _X_EXPORT pointer xf86NewOption(char *name, char *value ); extern _X_EXPORT pointer xf86NextOption(pointer list ); extern _X_EXPORT pointer xf86OptionListCreate(const char **options, int count, int used); extern _X_EXPORT pointer xf86OptionListMerge(pointer head, pointer tail); +extern _X_EXPORT pointer xf86OptionListDuplicate(pointer list); extern _X_EXPORT void xf86OptionListFree(pointer opt); extern _X_EXPORT char *xf86OptionName(pointer opt); extern _X_EXPORT char *xf86OptionValue(pointer opt); diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index aa6ea3011..480f38694 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -118,58 +118,43 @@ xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts) } /* - * xf86CollectInputOptions collects the options for an InputDevice. - * This function requires that the following has been initialised: - * - * pInfo->conf_idev - * - * The extraOpts parameter may optionally contain a list of additional options - * to include. - * - * The order of precedence for options is: - * - * extraOpts, pInfo->conf_idev->extraOptions, - * pInfo->conf_idev->commonOptions, defaultOpts + * xf86CollectInputOptions collects extra options for an InputDevice (other + * than those added by the config backend). + * The options are merged into the existing ones and thus take precedence + * over the others. */ void -xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, - pointer extraOpts) +xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts) { - XF86OptionPtr tmp; - XF86OptionPtr extras = (XF86OptionPtr)extraOpts; - - pInfo->options = NULL; if (defaultOpts) { - pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0); - } - if (pInfo->conf_idev && pInfo->conf_idev->commonOptions) { - tmp = xf86optionListDup(pInfo->conf_idev->commonOptions); - if (pInfo->options) - pInfo->options = xf86optionListMerge(pInfo->options, tmp); - else - pInfo->options = tmp; - } - if (pInfo->conf_idev && pInfo->conf_idev->extraOptions) { - tmp = xf86optionListDup(pInfo->conf_idev->extraOptions); + XF86OptionPtr tmp =xf86optionListCreate(defaultOpts, -1, 0); if (pInfo->options) - pInfo->options = xf86optionListMerge(pInfo->options, tmp); - else - pInfo->options = tmp; - } - if (extras) { - tmp = xf86optionListDup(extras); - if (pInfo->options) - pInfo->options = xf86optionListMerge(pInfo->options, tmp); + pInfo->options = xf86optionListMerge(tmp, pInfo->options); else pInfo->options = tmp; } +} - if (pInfo->conf_idev && pInfo->conf_idev->attrs) { - pInfo->attrs = pInfo->conf_idev->attrs; +/** + * Duplicate the option list passed in. The returned pointer will be a newly + * allocated option list and must be freed by the caller. + */ +pointer +xf86OptionListDuplicate(pointer options) +{ + pointer o = NULL; + + while (options) + { + o = xf86AddNewOption(o, xf86OptionName(options), xf86OptionValue(options)); + options = xf86nextOption(options); } + + return o; } + /* Created for new XInput stuff -- essentially extensions to the parser */ static int @@ -227,7 +212,7 @@ LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed) return deflt; } -static int +static double LookupPercentOption(pointer optlist, const char *name, double deflt, Bool markUsed) { OptionInfoRec o; @@ -511,27 +496,33 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, switch (p->type) { case OPTV_INTEGER: if (*s == '\0') { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires an integer value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires an integer value\n", + p->name); + } p->found = FALSE; } else { p->value.num = strtoul(s, &end, 0); if (*end == '\0') { p->found = TRUE; } else { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires an integer value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires an integer value\n", + p->name); + } p->found = FALSE; } } break; case OPTV_STRING: if (*s == '\0') { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires an string value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires an string value\n", + p->name); + } p->found = FALSE; } else { p->value.str = s; @@ -544,18 +535,22 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, break; case OPTV_REAL: if (*s == '\0') { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a floating point value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a floating point " + "value\n", p->name); + } p->found = FALSE; } else { p->value.realnum = strtod(s, &end); if (*end == '\0') { p->found = TRUE; } else { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a floating point value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a floating point " + "value\n", p->name); + } p->found = FALSE; } } @@ -564,8 +559,11 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, if (GetBoolValue(p, s)) { p->found = TRUE; } else { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a boolean value\n", p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a boolean value\n", + p->name); + } p->found = FALSE; } break; @@ -576,8 +574,10 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, * hence 100 looks the same as 100% to the caller of sccanf */ if (sscanf(s, "%lf%c", &p->value.realnum, &tmp) != 2 || tmp != '%') { - xf86DrvMsg(scrnIndex, X_WARNING, + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" requires a percent value\n", p->name); + } p->found = FALSE; } else { p->found = TRUE; @@ -586,9 +586,11 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, break; case OPTV_FREQ: if (*s == '\0') { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a frequency value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a frequency value\n", + p->name); + } p->found = FALSE; } else { double freq = strtod(s, &end); @@ -605,17 +607,21 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, !xf86NameCmp(end, "M")) units = 1000000; else { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a frequency value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a frequency value\n", + p->name); + } p->found = FALSE; } if (p->found) freq *= (double)units; } else { - xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires a frequency value\n", - p->name); + if (markUsed) { + xf86DrvMsg(scrnIndex, X_WARNING, + "Option \"%s\" requires a frequency value\n", + p->name); + } p->found = FALSE; } if (p->found) { @@ -653,13 +659,10 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, newn = n + 2; } else { free(n); - n = malloc(strlen(p->name) + 2 + 1); - if (!n) { + if (asprintf(&n, "No%s", p->name) == -1) { p->found = FALSE; return FALSE; } - strcpy(n, "No"); - strcat(n, p->name); newn = n; } if ((s = xf86findOptionValue(options, newn)) != NULL) { diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c index 7af89b5b4..16b6bdc4a 100644 --- a/hw/xfree86/common/xf86PM.c +++ b/hw/xfree86/common/xf86PM.c @@ -33,6 +33,7 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" +#include "xf86_OSproc.h" int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num) = NULL; pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event) = NULL; @@ -61,14 +62,14 @@ eventName(pmEvent event, char **str) } } +static int sigio_blocked_for_suspend; + static void suspend (pmEvent event, Bool undo) { int i; InputInfoPtr pInfo; - xf86inSuspend = TRUE; - for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); @@ -78,7 +79,7 @@ suspend (pmEvent event, Bool undo) DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - xf86EnterServerState(SETUP); + sigio_blocked_for_suspend = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(i,event,undo); @@ -98,7 +99,6 @@ resume(pmEvent event, Bool undo) InputInfoPtr pInfo; xf86AccessEnter(); - xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) xf86Screens[i]->PMEvent(i,event,undo); @@ -107,7 +107,7 @@ resume(pmEvent event, Bool undo) xf86Screens[i]->EnterVT(i, 0); } } - xf86EnterServerState(OPERATING); + xf86UnblockSIGIO(sigio_blocked_for_suspend); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); @@ -118,18 +118,12 @@ resume(pmEvent event, Bool undo) EnableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - xf86inSuspend = FALSE; } static void DoApmEvent(pmEvent event, Bool undo) { - /* - * we leave that as a global function for now. I don't know if - * this might cause problems in the future. It is a global server - * variable therefore it needs to be in a server info structure - */ - int i, setup = 0; + int i, was_blocked; switch(event) { #if 0 @@ -159,14 +153,13 @@ DoApmEvent(pmEvent event, Bool undo) } break; default: + was_blocked = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { - if (!setup) xf86EnterServerState(SETUP); - setup = 1; xf86Screens[i]->PMEvent(i,event,undo); } } - if (setup) xf86EnterServerState(OPERATING); + xf86UnblockSIGIO(was_blocked); break; } } diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 08c0fa93a..5d91ab367 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -114,7 +114,6 @@ extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86PostProbe(void); extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); -extern _X_EXPORT void xf86PostScreenInit(void); /* xf86Config.c */ @@ -149,9 +148,6 @@ extern _X_EXPORT int xf86SetVerbosity(int verb); extern _X_EXPORT int xf86SetLogVerbosity(int verb); extern _X_EXPORT Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only ); -/* xf86Xinput.c */ -extern _X_EXPORT EventList *xf86Events; - #endif /* _NO_XF86_PROTOTYPES */ diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 39cd23074..608f9bd19 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -96,7 +96,6 @@ typedef struct { #endif Bool pmFlag; Log log; - Bool kbdCustomKeycodes; Bool disableRandR; MessageType randRFrom; Bool aiglx; @@ -108,8 +107,7 @@ typedef struct { MessageType useDefaultFontPathFrom; Bool ignoreABI; - Bool allowEmptyInput; /* Allow the server to start with no input - * devices. */ + Bool forceInputDevices; /* force xorg.conf or built-in input devices */ Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */ Bool autoEnableDevices; /* Whether to enable, or let the client * control. */ diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index d7ffff4ca..4663d0366 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -242,11 +242,20 @@ xf86RandRSetConfig (ScreenPtr pScreen, ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - int px, py; + int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; + DeviceIntPtr dev; + Bool view_adjusted = FALSE; + + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (!IsMaster(dev) && !IsFloating(dev)) + continue; + + miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); + } - miPointerGetPosition(inputInfo.pointer, &px, &py); for (mode = scrp->modes; ; mode = mode->next) { if (mode->HDisplay == pSize->width && @@ -303,17 +312,31 @@ xf86RandRSetConfig (ScreenPtr pScreen, } return FALSE; } + /* * Move the cursor back where it belongs; SwitchMode repositions it + * FIXME: duplicated code, see modes/xf86RandR12.c */ - if (pScreen == miPointerCurrentScreen ()) + for (dev = inputInfo.devices; dev; dev = dev->next) { - px = (px >= pScreen->width ? (pScreen->width - 1) : px); - py = (py >= pScreen->height ? (pScreen->height - 1) : py); + if (!IsMaster(dev) && !IsFloating(dev)) + continue; - xf86SetViewport(pScreen, px, py); + if (pScreen == miPointerGetScreen(dev)) { + int px = pos[dev->id][0]; + int py = pos[dev->id][1]; - (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); + px = (px >= pScreen->width ? (pScreen->width - 1) : px); + py = (py >= pScreen->height ? (pScreen->height - 1) : py); + + /* Setting the viewpoint makes only sense on one device */ + if (!view_adjusted && IsMaster(dev)) { + xf86SetViewport(pScreen, px, py); + view_adjusted = TRUE; + } + + (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); + } } return TRUE; diff --git a/hw/xfree86/common/xf86ShowOpts.c b/hw/xfree86/common/xf86ShowOpts.c index eac25d701..c0fa80ac7 100644 --- a/hw/xfree86/common/xf86ShowOpts.c +++ b/hw/xfree86/common/xf86ShowOpts.c @@ -97,11 +97,8 @@ void DoShowOptions (void) { ); continue; } - pSymbol = malloc( - strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1 - ); - strcpy (pSymbol, xf86DriverList[i]->driverName); - strcat (pSymbol, "ModuleData"); + XNFasprintf(&pSymbol, "%sModuleData", + xf86DriverList[i]->driverName); initData = LoaderSymbol (pSymbol); if (initData) { XF86ModuleVersionInfo *vers = initData->vers; @@ -111,6 +108,9 @@ void DoShowOptions (void) { ); for (p = pOption; p->name != NULL; p++) { const char *opttype = optionTypeToSting(p->type); + /* XXX: Why overallocate by 2 bytes? + * Otherwise, this would be strdup() + */ char *optname = malloc(strlen(p->name) + 2 + 1); if (!optname) { continue; diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c index e518f455f..215e8454a 100644 --- a/hw/xfree86/common/xf86VGAarbiter.c +++ b/hw/xfree86/common/xf86VGAarbiter.c @@ -325,13 +325,14 @@ VGAarbiterGetSpans ( static void VGAarbiterSourceValidate ( DrawablePtr pDrawable, - int x, int y, int width, int height ) + int x, int y, int width, int height, + unsigned int subWindowMode ) { ScreenPtr pScreen = pDrawable->pScreen; SCREEN_PROLOG (SourceValidate); VGAGet(pScreen); if (pScreen->SourceValidate) - (*pScreen->SourceValidate) (pDrawable, x, y, width, height); + (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode); VGAPut(); SCREEN_EPILOG (SourceValidate, VGAarbiterSourceValidate); } diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h index 2920fb53a..848e45da7 100644 --- a/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -149,7 +149,7 @@ static void VGAarbiterGetImage (DrawablePtr pDrawable, int sx, int sy, int w, static void VGAarbiterGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void VGAarbiterSourceValidate (DrawablePtr pDrawable, int x, int y, - int width, int height); + int width, int height, unsigned int subWindowMode); static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w, diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 1788fa192..4dd454d8b 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -634,7 +634,7 @@ VidModeSetModeValue(pointer mode, int valtyp, int val) vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx) { - vidMonitorValue ret; + vidMonitorValue ret = { NULL, }; switch (valtyp) { case VIDMODE_MON_VENDOR: diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index e71b09cd2..26051ad7f 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -59,23 +59,15 @@ #include "xf86Priv.h" #include "xf86Config.h" #include "xf86Xinput.h" -#include "XIstubs.h" #include "xf86Optrec.h" -#include "xf86Parser.h" #include "mipointer.h" -#include "xf86InPriv.h" -#include "compiler.h" #include "extinit.h" #include "loaderProcs.h" -#ifdef DPMSExtension -#include -#include "dpmsproc.h" -#endif - #include "exevents.h" /* AddInputDevice */ #include "exglobals.h" #include "eventstr.h" +#include "inpututils.h" #include /* InputClassMatches */ #ifdef HAVE_FNMATCH_H @@ -85,15 +77,9 @@ #include #endif -#include "extnsionst.h" - -#include "windowstr.h" /* screenIsSaved */ - #include #include /* for int64_t */ -#include - #include "mi.h" #include /* dix pointer acceleration */ @@ -105,9 +91,16 @@ #include "xkbsrv.h" -#include "os.h" +/* Valuator verification macro */ +#define XI_VERIFY_VALUATORS(num_valuators) \ + if (num_valuators > MAX_VALUATORS) { \ + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \ + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \ + return; \ + } -EventListPtr xf86Events = NULL; +static int +xf86InputDevicePostInit(DeviceIntPtr dev); /** * Eval config and modify DeviceVelocityRec accordingly @@ -203,11 +196,11 @@ static void ApplyAccelerationSettings(DeviceIntPtr dev){ int scheme, i; DeviceVelocityPtr pVel; - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate; char* schemeStr; if (dev->valuator && dev->ptrfeed) { - schemeStr = xf86SetStrOption(local->options, "AccelerationScheme", ""); + schemeStr = xf86SetStrOption(pInfo->options, "AccelerationScheme", ""); scheme = dev->valuator->accelScheme.number; @@ -228,15 +221,15 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ if (InitPointerAccelerationScheme(dev, scheme)) { xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n", - local->name, schemeStr, scheme); + pInfo->name, schemeStr, scheme); } else { xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n", - local->name, schemeStr); + pInfo->name, schemeStr); scheme = dev->valuator->accelScheme.number; } } else { xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n", - local->name, scheme); + pInfo->name, scheme); } free(schemeStr); @@ -245,45 +238,34 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ switch (scheme) { case PtrAccelPredictable: pVel = GetDevicePredictableAccelData(dev); - ProcessVelocityConfiguration (dev, local->name, local->options, + ProcessVelocityConfiguration (dev, pInfo->name, pInfo->options, pVel); break; } - i = xf86SetIntOption(local->options, "AccelerationNumerator", + i = xf86SetIntOption(pInfo->options, "AccelerationNumerator", dev->ptrfeed->ctrl.num); if (i >= 0) dev->ptrfeed->ctrl.num = i; - i = xf86SetIntOption(local->options, "AccelerationDenominator", + i = xf86SetIntOption(pInfo->options, "AccelerationDenominator", dev->ptrfeed->ctrl.den); if (i > 0) dev->ptrfeed->ctrl.den = i; - i = xf86SetIntOption(local->options, "AccelerationThreshold", + i = xf86SetIntOption(pInfo->options, "AccelerationThreshold", dev->ptrfeed->ctrl.threshold); if (i >= 0) dev->ptrfeed->ctrl.threshold = i; xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n", - local->name, ((float)dev->ptrfeed->ctrl.num)/ + pInfo->name, ((float)dev->ptrfeed->ctrl.num)/ ((float)dev->ptrfeed->ctrl.den)); xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n", - local->name, dev->ptrfeed->ctrl.threshold); + pInfo->name, dev->ptrfeed->ctrl.threshold); } } -static Bool -xf86SendDragEvents(DeviceIntPtr device) -{ - LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate; - - if (device->button && device->button->buttonsDown > 0) - return local->flags & XI86_SEND_DRAG_EVENTS; - else - return TRUE; -} - /*********************************************************************** * * xf86ProcessCommonOptions -- @@ -293,27 +275,19 @@ xf86SendDragEvents(DeviceIntPtr device) *********************************************************************** */ void -xf86ProcessCommonOptions(LocalDevicePtr local, +xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer list) { - if (!xf86SetBoolOption(list, "AlwaysCore", 1) || + if (xf86SetBoolOption(list, "Floating", 0) || + !xf86SetBoolOption(list, "AlwaysCore", 1) || !xf86SetBoolOption(list, "SendCoreEvents", 1) || !xf86SetBoolOption(list, "CorePointer", 1) || !xf86SetBoolOption(list, "CoreKeyboard", 1)) { - xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name); + xf86Msg(X_CONFIG, "%s: doesn't report core events\n", pInfo->name); } else { - local->flags |= XI86_ALWAYS_CORE; - xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name); + pInfo->flags |= XI86_ALWAYS_CORE; + xf86Msg(X_CONFIG, "%s: always reports core events\n", pInfo->name); } - - if (xf86SetBoolOption(list, "SendDragEvents", 1)) { - local->flags |= XI86_SEND_DRAG_EVENTS; - } else { - xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name); - } - - /* Backwards compatibility. */ - local->history_size = GetMotionHistorySize(); } /*********************************************************************** @@ -325,86 +299,38 @@ xf86ProcessCommonOptions(LocalDevicePtr local, * Returns TRUE on success, or FALSE otherwise. *********************************************************************** */ -int -xf86ActivateDevice(LocalDevicePtr local) +static DeviceIntPtr +xf86ActivateDevice(InputInfoPtr pInfo) { DeviceIntPtr dev; + Atom atom; - if (local->flags & XI86_CONFIGURED) { - dev = AddInputDevice(serverClient, local->device_control, TRUE); + dev = AddInputDevice(serverClient, pInfo->device_control, TRUE); - if (dev == NULL) - { - xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n", - local->name); - local->dev = NULL; - return FALSE; - } - - local->atom = MakeAtom(local->type_name, - strlen(local->type_name), - TRUE); - AssignTypeAndName(dev, local->atom, local->name); - dev->public.devicePrivate = (pointer) local; - local->dev = dev; - - dev->coreEvents = local->flags & XI86_ALWAYS_CORE; - dev->type = SLAVE; - dev->spriteInfo->spriteOwner = FALSE; - - dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; - dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; - - RegisterOtherDevice(dev); - XkbSetExtension(dev, ProcessKeyboardEvent); - - if (serverGeneration == 1) - xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n", - local->name, local->type_name); + if (dev == NULL) + { + xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n", + pInfo->name); + pInfo->dev = NULL; + return NULL; } - return TRUE; -} + atom = MakeAtom(pInfo->type_name, strlen(pInfo->type_name), TRUE); + AssignTypeAndName(dev, atom, pInfo->name); + dev->public.devicePrivate = pInfo; + pInfo->dev = dev; + dev->coreEvents = pInfo->flags & XI86_ALWAYS_CORE; + dev->type = SLAVE; + dev->spriteInfo->spriteOwner = FALSE; -/*********************************************************************** - * - * Caller: ProcXOpenDevice - * - * This is the implementation-dependent routine to open an input device. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. This entry point is for the latter type of - * implementation. - * - * If the physical device is not already open, do it here. In this case, - * you need to keep track of the fact that one or more clients has the - * device open, and physically close it when the last client that has - * it open does an XCloseDevice. - * - * The default implementation is to do nothing (assume all input devices - * are opened during X server initialization and kept open). - * - *********************************************************************** - */ - -void -OpenInputDevice(DeviceIntPtr dev, - ClientPtr client, - int *status) -{ - if (!dev->inited) - ActivateDevice(dev, TRUE); + dev->config_info = xf86SetStrOption(pInfo->options, "config_info", NULL); - *status = Success; -} + if (serverGeneration == 1) + xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s, id %d)\n", + pInfo->name, pInfo->type_name, dev->id); -void -CloseInputDevice(DeviceIntPtr dev, - ClientPtr client) -{ + return dev; } /**************************************************************************** @@ -423,10 +349,10 @@ CloseInputDevice(DeviceIntPtr dev, int SetDeviceMode (ClientPtr client, DeviceIntPtr dev, int mode) { - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate; - if (local->switch_mode) { - return (*local->switch_mode)(client, dev, mode); + if (pInfo->switch_mode) { + return (*pInfo->switch_mode)(client, dev, mode); } else return BadMatch; @@ -450,10 +376,10 @@ int SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators, int first_valuator, int num_valuators) { - LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; - if (local->set_device_valuators) - return (*local->set_device_valuators)(local, valuators, first_valuator, + if (pInfo->set_device_valuators) + return (*pInfo->set_device_valuators)(pInfo, valuators, first_valuator, num_valuators); return BadMatch; @@ -472,15 +398,15 @@ SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators, int ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) { - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate; - if (!local->control_proc) { + if (!pInfo->control_proc) { switch (control->control) { case DEVICE_CORE: - return BadMatch; - case DEVICE_RESOLUTION: case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: + return BadMatch; + case DEVICE_RESOLUTION: case DEVICE_ENABLE: return Success; default: @@ -488,15 +414,10 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) } } else { - return (*local->control_proc)(local, control); + return (*pInfo->control_proc)(pInfo, control); } } -void -AddOtherInputDevices(void) -{ -} - /* * Get the operating system name from uname and store it statically to avoid * repeating the system call each time MatchOS is checked. @@ -548,6 +469,20 @@ match_path_pattern(const char *attr, const char *pattern) #define match_path_pattern match_substring #endif +/* + * If no Layout section is found, xf86ServerLayout.id becomes "(implicit)" + * It is convenient that "" in patterns means "no explicit layout" + */ +static int +match_string_implicit(const char *attr, const char *pattern) +{ + if (strlen(pattern)) { + return strcmp(attr, pattern); + } else { + return strcmp(attr,"(implicit)"); + } +} + /* * Match an attribute against a list of NULL terminated arrays of patterns. * If a pattern in each list entry is matched, return TRUE. @@ -592,7 +527,7 @@ MatchAttrToken(const char *attr, struct list *patterns, * statements must match. */ static Bool -InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev, +InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev, const InputAttributes *attrs) { /* MatchProduct substring */ @@ -643,6 +578,13 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev, return FALSE; } + /* MatchLayout string */ + if (!list_is_empty(&iclass->match_layout)) { + if (!MatchAttrToken(xf86ConfigLayout.id, + &iclass->match_layout, match_string_implicit)) + return FALSE; + } + /* MatchIs* booleans */ if (iclass->is_keyboard.set && iclass->is_keyboard.val != !!(attrs->flags & ATTR_KEYBOARD)) @@ -672,7 +614,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev, * well as any previous InputClass sections. */ static int -MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) +MergeInputClasses(const InputInfoPtr idev, const InputAttributes *attrs) { XF86ConfInputClassPtr cl; XF86OptionPtr classopts; @@ -697,9 +639,8 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) /* Apply options to device with InputClass settings preferred. */ xf86Msg(X_CONFIG, "%s: Applying InputClass \"%s\"\n", - idev->identifier, cl->identifier); - idev->commonOptions = xf86optionListMerge(idev->commonOptions, - classopts); + idev->name, cl->identifier); + idev->options = xf86optionListMerge(idev->options, classopts); } return Success; @@ -710,7 +651,7 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) * value of the last matching class and holler when returning TRUE. */ static Bool -IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) +IgnoreInputClass(const InputInfoPtr idev, const InputAttributes *attrs) { XF86ConfInputClassPtr cl; Bool ignore = FALSE; @@ -727,10 +668,96 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) if (ignore) xf86Msg(X_CONFIG, "%s: Ignoring device from InputClass \"%s\"\n", - idev->identifier, ignore_class); + idev->name, ignore_class); return ignore; } +InputInfoPtr +xf86AllocateInput(void) +{ + InputInfoPtr pInfo; + + pInfo = calloc(sizeof(*pInfo), 1); + if (!pInfo) + return NULL; + + pInfo->fd = -1; + pInfo->type_name = "UNKNOWN"; + + return pInfo; +} + +/* Append InputInfoRec to the tail of xf86InputDevs. */ +static void +xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo) +{ + InputInfoPtr *prev = NULL; + + pInfo->drv = drv; + pInfo->module = DuplicateModule(drv->module, NULL); + + for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next) + ; + + *prev = pInfo; + pInfo->next = NULL; + + xf86CollectInputOptions(pInfo, (const char**)drv->default_options); + xf86OptionListReport(pInfo->options); + xf86ProcessCommonOptions(pInfo, pInfo->options); +} + +/* + * Remove an entry from xf86InputDevs and free all the device's information. + */ +void +xf86DeleteInput(InputInfoPtr pInp, int flags) +{ + /* First check if the inputdev is valid. */ + if (pInp == NULL) + return; + + if (pInp->module) + UnloadModule(pInp->module); + + /* This should *really* be handled in drv->UnInit(dev) call instead, but + * if the driver forgets about it make sure we free it or at least crash + * with flying colors */ + free(pInp->private); + + FreeInputAttributes(pInp->attrs); + + /* Remove the entry from the list. */ + if (pInp == xf86InputDevs) + xf86InputDevs = pInp->next; + else { + InputInfoPtr p = xf86InputDevs; + while (p && p->next != pInp) + p = p->next; + if (p) + p->next = pInp->next; + /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ + } + + free(pInp->driver); + free(pInp->name); + xf86optionListFree(pInp->options); + free(pInp); +} + +/* + * Apply backend-specific initialization. Invoked after ActiveteDevice(), + * i.e. after the driver successfully completed DEVICE_INIT and the device + * is advertised. + * @param dev the device + * @return Success or an error code + */ +static int +xf86InputDevicePostInit(DeviceIntPtr dev) { + ApplyAccelerationSettings(dev); + return Success; +} + /** * Create a new input device, activate and enable it. * @@ -749,25 +776,26 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) * @return Success or an error code */ _X_INTERNAL int -xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) +xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable) { InputDriverPtr drv = NULL; - InputInfoPtr pInfo = NULL; DeviceIntPtr dev = NULL; int rval; /* Memory leak for every attached device if we don't * test if the module is already loaded first */ - drv = xf86LookupInputDriver(idev->driver); + drv = xf86LookupInputDriver(pInfo->driver); if (!drv) - if (xf86LoadOneModule(idev->driver, NULL)) - drv = xf86LookupInputDriver(idev->driver); + if (xf86LoadOneModule(pInfo->driver, NULL)) + drv = xf86LookupInputDriver(pInfo->driver); if (!drv) { - xf86Msg(X_ERROR, "No input driver matching `%s'\n", idev->driver); + xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver); rval = BadName; goto unwind; } + xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, pInfo->name); + if (!drv->PreInit) { xf86Msg(X_ERROR, "Input driver `%s' has no PreInit function (ignoring)\n", @@ -776,47 +804,52 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind; } - pInfo = drv->PreInit(drv, idev, 0); + xf86AddInput(drv, pInfo); - if (!pInfo) { - xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier); - rval = BadMatch; - goto unwind; - } - else if (!(pInfo->flags & XI86_CONFIGURED)) { - xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - idev->identifier); - rval = BadMatch; + rval = drv->PreInit(drv, pInfo, 0); + + if (rval != Success) { + xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name); goto unwind; } - if (!xf86ActivateDevice(pInfo)) + if (!(dev = xf86ActivateDevice(pInfo))) { rval = BadAlloc; goto unwind; } - dev = pInfo->dev; rval = ActivateDevice(dev, TRUE); if (rval != Success) { - xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); RemoveDevice(dev, TRUE); goto unwind; } + rval = xf86InputDevicePostInit(dev); + if (rval != Success) + { + xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", pInfo->name); + RemoveDevice(dev, TRUE); + goto unwind; + } + /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) { + OsBlockSignals(); EnableDevice(dev, TRUE); if (!dev->enabled) { - xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); + OsReleaseSignals(); + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name); rval = BadMatch; goto unwind; } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); + OsReleaseSignals(); } *pdev = dev; @@ -824,7 +857,7 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) unwind: if(pInfo) { - if(drv->UnInit) + if(drv && drv->UnInit) drv->UnInit(drv, pInfo, 0); else xf86DeleteInput(pInfo, 0); @@ -836,23 +869,23 @@ int NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, DeviceIntPtr *pdev) { - IDevRec *idev = NULL; + InputInfoPtr pInfo = NULL; InputOption *option = NULL; int rval = Success; int is_auto = 0; - idev = calloc(sizeof(*idev), 1); - if (!idev) + pInfo = xf86AllocateInput(); + if (!pInfo) return BadAlloc; for (option = options; option; option = option->next) { if (strcasecmp(option->key, "driver") == 0) { - if (idev->driver) { + if (pInfo->driver) { rval = BadRequest; goto unwind; } - idev->driver = xstrdup(option->value); - if (!idev->driver) { + pInfo->driver = xstrdup(option->value); + if (!pInfo->driver) { rval = BadAlloc; goto unwind; } @@ -860,12 +893,12 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, if (strcasecmp(option->key, "name") == 0 || strcasecmp(option->key, "identifier") == 0) { - if (idev->identifier) { + if (pInfo->name) { rval = BadRequest; goto unwind; } - idev->identifier = xstrdup(option->value); - if (!idev->identifier) { + pInfo->name = xstrdup(option->value); + if (!pInfo->name) { rval = BadAlloc; goto unwind; } @@ -885,7 +918,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, for (option = options; option; option = option->next) { /* Steal option key/value strings from the provided list. * We need those strings, the InputOption list doesn't. */ - idev->commonOptions = xf86addNewOption(idev->commonOptions, + pInfo->options = xf86addNewOption(pInfo->options, option->key, option->value); option->key = NULL; option->value = NULL; @@ -893,58 +926,51 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, /* Apply InputClass settings */ if (attrs) { - if (IgnoreInputClass(idev, attrs)) { + if (IgnoreInputClass(pInfo, attrs)) { rval = BadIDChoice; goto unwind; } - rval = MergeInputClasses(idev, attrs); + rval = MergeInputClasses(pInfo, attrs); if (rval != Success) goto unwind; - idev->attrs = DuplicateInputAttributes(attrs); + pInfo->attrs = DuplicateInputAttributes(attrs); } - if (!idev->driver || !idev->identifier) { + if (!pInfo->driver || !pInfo->name) { xf86Msg(X_INFO, "No input driver/identifier specified (ignoring)\n"); rval = BadRequest; goto unwind; } - if (!idev->identifier) { + if (!pInfo->name) { xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n"); - return BadMatch; + rval = BadMatch; + goto unwind; } - rval = xf86NewInputDevice(idev, pdev, + rval = xf86NewInputDevice(pInfo, pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); - if (rval == Success) - return Success; + + return rval; unwind: if (is_auto && !xf86Info.autoAddDevices) xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n"); - free(idev->driver); - free(idev->identifier); - xf86optionListFree(idev->commonOptions); - free(idev); + xf86DeleteInput(pInfo, 0); return rval; } void DeleteInputDeviceRequest(DeviceIntPtr pDev) { - LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate; InputDriverPtr drv = NULL; - IDevRec *idev = NULL; - IDevPtr *it; Bool isMaster = IsMaster(pDev); if (pInfo) /* need to get these before RemoveDevice */ - { drv = pInfo->drv; - idev = pInfo->conf_idev; - } OsBlockSignals(); RemoveDevice(pDev, TRUE); @@ -955,19 +981,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) drv->UnInit(drv, pInfo, 0); else xf86DeleteInput(pInfo, 0); - - /* devices added through HAL aren't in the config layout */ - it = xf86ConfigLayout.inputs; - while(*it && *it != idev) - it++; - - if (!(*it)) /* end of list, not in the layout */ - { - free(idev->driver); - free(idev->identifier); - xf86optionListFree(idev->commonOptions); - free(idev); - } } OsReleaseSignals(); } @@ -985,16 +998,17 @@ xf86PostMotionEvent(DeviceIntPtr device, { va_list var; int i = 0; - static int valuators[MAX_VALUATORS]; + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); + valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) - valuators[i] = va_arg(var, int); + valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); - xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators); + xf86PostMotionEventM(device, is_absolute, &mask); } void @@ -1002,40 +1016,49 @@ xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, - int *valuators) + const int *valuators) { - int i = 0, nevents = 0; - Bool drag = xf86SendDragEvents(device); - DeviceEvent *event; - int flags = 0; - -#if XFreeXDGA - int index; - int dx = 0, dy = 0; -#endif + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); - if (is_absolute) - flags = POINTER_ABSOLUTE; - else - flags = POINTER_RELATIVE | POINTER_ACCELERATE; + valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); + xf86PostMotionEventM(device, is_absolute, &mask); +} + +void +xf86PostMotionEventM(DeviceIntPtr device, + int is_absolute, + const ValuatorMask *mask) +{ + int flags = 0; + + if (valuator_mask_num_valuators(mask) > 0) + { + if (is_absolute) + flags = POINTER_ABSOLUTE; + else + flags = POINTER_RELATIVE | POINTER_ACCELERATE; + } #if XFreeXDGA /* The evdev driver may not always send all axes across. */ - if (num_valuators >= 1 && first_valuator <= 1) { + if (valuator_mask_isset(mask, 0) || + valuator_mask_isset(mask, 1)) if (miPointerGetScreen(device)) { - index = miPointerGetScreen(device)->myNum; - if (first_valuator == 0) + int index = miPointerGetScreen(device)->myNum; + int dx = 0, dy = 0; + + if (valuator_mask_isset(mask, 0)) { - dx = valuators[0]; + dx = valuator_mask_get(mask, 0); if (is_absolute) dx -= device->last.valuators[0]; } - if (first_valuator == 1 || num_valuators >= 2) + if (valuator_mask_isset(mask, 1)) { - dy = valuators[1 - first_valuator]; + dy = valuator_mask_get(mask, 1); if (is_absolute) dy -= device->last.valuators[1]; } @@ -1043,22 +1066,9 @@ xf86PostMotionEventP(DeviceIntPtr device, if (DGAStealMotionEvent(device, index, dx, dy)) return; } - } #endif - nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0, - flags, first_valuator, num_valuators, - valuators); - - for (i = 0; i < nevents; i++) { - event = (DeviceEvent*)((xf86Events + i)->event); - /* Don't post core motion events for devices not registered to send - * drag events. */ - if (event->header == ET_Internal && - (event->type != ET_Motion || drag)) { - mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event)); - } - } + QueuePointerEvents(device, MotionNotify, 0, flags, mask); } void @@ -1070,18 +1080,17 @@ xf86PostProximityEvent(DeviceIntPtr device, { va_list var; int i; - int valuators[MAX_VALUATORS]; + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); + valuator_mask_zero(&mask); va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) - valuators[i] = va_arg(var, int); + valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); - xf86PostProximityEventP(device, is_in, first_valuator, num_valuators, - valuators); - + xf86PostProximityEventM(device, is_in, &mask); } void @@ -1089,18 +1098,22 @@ xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, - int *valuators) + const int *valuators) { - int i, nevents; + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); - nevents = GetProximityEvents(xf86Events, device, - is_in ? ProximityIn : ProximityOut, - first_valuator, num_valuators, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event)); + valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); + xf86PostProximityEventM(device, is_in, &mask); +} +void +xf86PostProximityEventM(DeviceIntPtr device, + int is_in, + const ValuatorMask *mask) +{ + QueueProximityEvents(device, is_in ? ProximityIn : ProximityOut, mask); } void @@ -1113,19 +1126,19 @@ xf86PostButtonEvent(DeviceIntPtr device, ...) { va_list var; - int valuators[MAX_VALUATORS]; + ValuatorMask mask; int i = 0; XI_VERIFY_VALUATORS(num_valuators); + valuator_mask_zero(&mask); + va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) - valuators[i] = va_arg(var, int); + valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); - xf86PostButtonEventP(device, is_absolute, button, is_down, first_valuator, - num_valuators, valuators); - + xf86PostButtonEventM(device, is_absolute, button, is_down, &mask); } void @@ -1135,37 +1148,45 @@ xf86PostButtonEventP(DeviceIntPtr device, int is_down, int first_valuator, int num_valuators, - int *valuators) + const int *valuators) { - int i = 0, nevents = 0; - int flags = 0; - -#if XFreeXDGA - int index; -#endif + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); - if (is_absolute) - flags = POINTER_ABSOLUTE; - else - flags = POINTER_RELATIVE | POINTER_ACCELERATE; + valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); + xf86PostButtonEventM(device, is_absolute, button, is_down, &mask); +} + +void +xf86PostButtonEventM(DeviceIntPtr device, + int is_absolute, + int button, + int is_down, + const ValuatorMask *mask) +{ + int flags = 0; + + if (valuator_mask_num_valuators(mask) > 0) + { + if (is_absolute) + flags = POINTER_ABSOLUTE; + else + flags = POINTER_RELATIVE | POINTER_ACCELERATE; + } #if XFreeXDGA if (miPointerGetScreen(device)) { - index = miPointerGetScreen(device)->myNum; + int index = miPointerGetScreen(device)->myNum; + if (DGAStealButtonEvent(device, index, button, is_down)) return; } #endif - nevents = GetPointerEvents(xf86Events, device, - is_down ? ButtonPress : ButtonRelease, button, - flags, first_valuator, num_valuators, valuators); - - for (i = 0; i < nevents; i++) - mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event)); - + QueuePointerEvents(device, + is_down ? ButtonPress : ButtonRelease, button, + flags, mask); } void @@ -1179,18 +1200,18 @@ xf86PostKeyEvent(DeviceIntPtr device, { va_list var; int i = 0; - static int valuators[MAX_VALUATORS]; + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); + valuator_mask_zero(&mask); + va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) - valuators[i] = va_arg(var, int); + valuator_mask_set(&mask, first_valuator + i, va_arg(var, int)); va_end(var); - xf86PostKeyEventP(device, key_code, is_down, is_absolute, first_valuator, - num_valuators, valuators); - + xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask); } void @@ -1200,26 +1221,39 @@ xf86PostKeyEventP(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, - int *valuators) + const int *valuators) { - int i = 0, nevents = 0; + ValuatorMask mask; XI_VERIFY_VALUATORS(num_valuators); - if (is_absolute) { - nevents = GetKeyboardValuatorEvents(xf86Events, device, - is_down ? KeyPress : KeyRelease, - key_code, first_valuator, - num_valuators, valuators); - } - else { - nevents = GetKeyboardEvents(xf86Events, device, - is_down ? KeyPress : KeyRelease, - key_code); + valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators); + xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask); +} + +void +xf86PostKeyEventM(DeviceIntPtr device, + unsigned int key_code, + int is_down, + int is_absolute, + const ValuatorMask *mask) +{ +#if XFreeXDGA + DeviceIntPtr pointer; + + /* Some pointers send key events, paired device is wrong then. */ + pointer = IsPointerDevice(device) ? device : GetPairedDevice(device); + if (miPointerGetScreen(pointer)) { + int index = miPointerGetScreen(pointer)->myNum; + + if (DGAStealKeyEvent(device, index, key_code, is_down)) + return; } +#endif - for (i = 0; i < nevents; i++) - mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event)); + QueueKeyboardEvents(device, + is_down ? KeyPress : KeyRelease, + key_code, mask); } void @@ -1227,10 +1261,13 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down) { - xf86PostKeyEventP(device, key_code, is_down, 0, 0, 0, NULL); + ValuatorMask mask; + + valuator_mask_zero(&mask); + xf86PostKeyEventM(device, key_code, is_down, 0, &mask); } -LocalDevicePtr +InputInfoPtr xf86FirstLocalDevice(void) { return xf86InputDevs; @@ -1268,7 +1305,7 @@ xf86ScaleAxis(int Cx, } else { X = 0; - ErrorF ("Divide by Zero in xf86ScaleAxis"); + ErrorF ("Divide by Zero in xf86ScaleAxis\n"); } if (X > to_max) @@ -1286,27 +1323,27 @@ xf86ScaleAxis(int Cx, * specific like a touch screen. */ void -xf86XInputSetScreen(LocalDevicePtr local, +xf86XInputSetScreen(InputInfoPtr pInfo, int screen_number, int x, int y) { - if (miPointerGetScreen(local->dev) != + if (miPointerGetScreen(pInfo->dev) != screenInfo.screens[screen_number]) { - miPointerSetScreen(local->dev, screen_number, x, y); + miPointerSetScreen(pInfo->dev, screen_number, x, y); } } void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, - int resolution, int min_res, int max_res) + int resolution, int min_res, int max_res, int mode) { if (!dev || !dev->valuator) return; InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res, - max_res); + max_res, mode); } /* @@ -1324,9 +1361,6 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; dev->last.valuators[1] = dev->valuator->axisVal[1]; } - - if(axnum == 0) /* to prevent double invocation */ - ApplyAccelerationSettings(dev); } diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 1d013aa67..1b0b16f04 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -59,161 +59,124 @@ #include "XIstubs.h" /* Input device flags */ -#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */ -#define XI86_CONFIGURED 0x02 /* the device has been configured */ #define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */ /* the device sends Xinput and core pointer events */ #define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE -/* if the device is the core pointer or is sending core events, and - * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events - * (mouse drag action) are sent. This is mainly to allow a touch screen to be - * used with netscape and other browsers which do strange things if the mouse - * moves between button down and button up. With a touch screen, this motion - * is common due to the user's finger moving slightly. - */ -#define XI86_SEND_DRAG_EVENTS 0x08 -#define XI86_CORE_POINTER 0x10 /* device is the core pointer */ -#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */ -#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */ -#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */ - -#define XI_PRIVATE(dev) \ - (((LocalDevicePtr)((dev)->public.devicePrivate))->private) - -/* Valuator verification macro */ -#define XI_VERIFY_VALUATORS(num_valuators) \ - if (num_valuators > MAX_VALUATORS) { \ - xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \ - " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \ - return; \ - } - -/* Stupid API backwards-compatibility. */ -#define TS_Raw 60 -#define TS_Scaled 61 /* This holds the input driver entry and module information. */ typedef struct _InputDriverRec { int driverVersion; char * driverName; void (*Identify)(int flags); - struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv, - IDevPtr dev, int flags); + int (*PreInit)(struct _InputDriverRec *drv, + struct _InputInfoRec* pInfo, int flags); void (*UnInit)(struct _InputDriverRec *drv, - struct _LocalDeviceRec *pInfo, + struct _InputInfoRec *pInfo, int flags); pointer module; + char ** default_options; } InputDriverRec, *InputDriverPtr; /* This is to input devices what the ScrnInfoRec is to screens. */ -typedef struct _LocalDeviceRec { - struct _LocalDeviceRec *next; +typedef struct _InputInfoRec { + struct _InputInfoRec *next; char * name; + char * driver; + int flags; Bool (*device_control)(DeviceIntPtr device, int what); - void (*read_input)(struct _LocalDeviceRec *local); - int (*control_proc)(struct _LocalDeviceRec *local, + void (*read_input)(struct _InputInfoRec *local); + int (*control_proc)(struct _InputInfoRec *local, xDeviceCtl *control); - void (*close_proc)(struct _LocalDeviceRec *local); int (*switch_mode)(ClientPtr client, DeviceIntPtr dev, int mode); - Bool (*conversion_proc)(struct _LocalDeviceRec *local, - int first, int num, int v0, - int v1, int v2, int v3, int v4, - int v5, int *x, int *y); - Bool (*reverse_conversion_proc)( - struct _LocalDeviceRec *local, - int x, int y, int *valuators); int (*set_device_valuators) - (struct _LocalDeviceRec *local, + (struct _InputInfoRec *local, int *valuators, int first_valuator, int num_valuators); int fd; - Atom atom; DeviceIntPtr dev; pointer private; - int private_flags; - unsigned int first; - unsigned int last; - int old_x; - int old_y; char * type_name; - IntegerFeedbackPtr always_core_feedback; - IDevPtr conf_idev; InputDriverPtr drv; pointer module; pointer options; - unsigned int history_size; InputAttributes *attrs; -} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr; - -typedef struct _DeviceAssocRec -{ - char * config_section_name; - LocalDevicePtr (*device_allocate)(void); -} DeviceAssocRec, *DeviceAssocPtr; +} *InputInfoPtr; /* xf86Globals.c */ -extern _X_EXPORT InputInfoPtr xf86InputDevs; +extern InputInfoPtr xf86InputDevs; /* xf86Xinput.c */ extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, - int first_valuator, int num_valuators, int *valuators); + int first_valuator, int num_valuators, const int *valuators); +extern _X_EXPORT void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute, + const ValuatorMask *mask); extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator, - int num_valuators, int *valuators); + int num_valuators, const int *valuators); +extern _X_EXPORT void xf86PostProximityEventM(DeviceIntPtr device, int is_in, + const ValuatorMask *mask); extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, ...); extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button, int is_down, int first_valuator, int num_valuators, - int *valuators); + const int *valuators); +extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute, int button, + int is_down, const ValuatorMask *mask); extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, ...); +extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down, + int is_absolute, const ValuatorMask *mask); extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down, int is_absolute, int first_valuator, int num_valuators, - int *valuators); + const int *valuators); extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); -extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local); -extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void); +extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void); extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min); -extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y); +extern _X_EXPORT void xf86XInputSetScreen(InputInfoPtr pInfo, int screen_number, int x, int y); extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options); extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval, int resolution, int min_res, - int max_res); + int max_res, int mode); extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum); extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo); extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo); extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic); extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev); /* not exported */ -int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto); +int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto); +InputInfoPtr xf86AllocateInput(void); /* xf86Helper.c */ extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags); extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex); -extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags); extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name); extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name); extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags); -extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local); +extern _X_EXPORT void xf86MotionHistoryAllocate(InputInfoPtr pInfo); +extern _X_EXPORT void xf86IDrvMsgVerb(InputInfoPtr dev, + MessageType type, int verb, + const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5); +extern _X_EXPORT void xf86IDrvMsg(InputInfoPtr dev, + MessageType type, + const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); +extern _X_EXPORT void xf86VIDrvMsgVerb(InputInfoPtr dev, + MessageType type, + int verb, + const char *format, + va_list args); /* xf86Option.c */ -extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, - pointer extraOpts); - - -/* Legacy hatred */ -#define SendCoreEvents 59 -#define DontSendCoreEvents 60 +extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts); #endif /* _xf86Xinput_h */ diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 3e9c4551f..447b19229 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1167,6 +1167,7 @@ videoPtrToDriverList(struct pci_device *dev, return i; /* Number of entries added */ } +#ifdef __linux__ static int xchomp(char *line) { @@ -1183,7 +1184,6 @@ xchomp(char *line) return 0; } -#ifdef __linux__ /* This function is used to provide a workaround for binary drivers that * don't export their PCI ID's properly. If distros don't end up using this * feature it can and should be removed because the symbol-based resolution @@ -1347,9 +1347,9 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, pVideo = (struct pci_device *) busData; - GDev->busID = xnfalloc(16); xf86FormatPciBusNumber(pVideo->bus, busnum); - sprintf(GDev->busID, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func); + XNFasprintf(&GDev->busID, "PCI:%s:%d:%d", + busnum, pVideo->dev, pVideo->func); GDev->chipID = pVideo->device_id; GDev->chipRev = pVideo->revision; diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c index d7c928b4c..181c6ab00 100644 --- a/hw/xfree86/common/xf86sbusBus.c +++ b/hw/xfree86/common/xf86sbusBus.c @@ -706,11 +706,9 @@ xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec *GDev) sparcPromClose(); } if (promPath) { - GDev->busID = xnfalloc(strlen(promPath) + 6); - sprintf(GDev->busID, "SBUS:%s", promPath); + XNFasprintf(&GDev->busID, "SBUS:%s", promPath); free(promPath); } else { - GDev->busID = xnfalloc(12); - sprintf(GDev->busID, "SBUS:fb%d", sBus->fbNum); + XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum); } } diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index b979884ff..0493dc53c 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -401,14 +401,6 @@ typedef struct { int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; -typedef struct { - char * identifier; - char * driver; - pointer commonOptions; - pointer extraOptions; - InputAttributes *attrs; -} IDevRec, *IDevPtr; - typedef struct { int frameX0; int frameY0; @@ -478,11 +470,13 @@ typedef struct _screenlayoutrec { confScreenPtr refscreen; } screenLayoutRec, *screenLayoutPtr; +typedef struct _InputInfoRec InputInfoRec; + typedef struct _serverlayoutrec { char * id; screenLayoutPtr screens; GDevPtr inactives; - IDevPtr* inputs; /* NULL terminated */ + InputInfoRec** inputs; /* NULL terminated */ pointer options; } serverLayoutRec, *serverLayoutPtr; @@ -504,7 +498,7 @@ typedef struct _confdrirec { /* These values should be adjusted when new fields are added to ScrnInfoRec */ #define NUM_RESERVED_INTS 16 #define NUM_RESERVED_POINTERS 14 -#define NUM_RESERVED_FUNCS 11 +#define NUM_RESERVED_FUNCS 10 typedef pointer (*funcPointer)(void); @@ -587,13 +581,6 @@ typedef struct _entityInfo { DriverPtr driver; } EntityInfoRec, *EntityInfoPtr; -/* server states */ - -typedef enum { - SETUP, - OPERATING -} xf86State; - /* DGA */ typedef struct { @@ -658,6 +645,7 @@ typedef Bool xf86PMEventProc (int, pmEvent, Bool); typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int); typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr); typedef void xf86SetOverscanProc (ScrnInfoPtr, int); +typedef void xf86ModeSetProc (ScrnInfoPtr); /* @@ -808,6 +796,7 @@ typedef struct _ScrnInfoRec { xf86LoadPaletteProc *LoadPalette; xf86SetOverscanProc *SetOverscan; xorgDriverFuncProc *DriverFunc; + xf86ModeSetProc *ModeSet; /* * This can be used when the minor ABI version is incremented. diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 46761303d..b46dfefed 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -97,13 +97,17 @@ static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, static Bool xf86XVDestroyWindow(WindowPtr pWin); static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); +static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); +#define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) + /* ScrnInfoRec functions */ static Bool xf86XVEnterVT(int, int); static void xf86XVLeaveVT(int, int); static void xf86XVAdjustFrame(int index, int x, int y, int flags); +static void xf86XVModeSet(ScrnInfoPtr pScrn); /* misc */ @@ -279,14 +283,14 @@ xf86XVScreenInit( pScrn = xf86Screens[pScreen->myNum]; - ScreenPriv->videoGC = NULL; /* for the helper */ - ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; + ScreenPriv->ModeSet = pScrn->ModeSet; pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; @@ -295,6 +299,7 @@ xf86XVScreenInit( pScrn->LeaveVT = xf86XVLeaveVT; if(pScrn->AdjustFrame) pScrn->AdjustFrame = xf86XVAdjustFrame; + pScrn->ModeSet = xf86XVModeSet; if(!xf86XVInitAdaptors(pScreen, adaptors, num)) return FALSE; @@ -308,6 +313,7 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) int i; free(pAdaptor->name); + pAdaptor->name = NULL; if(pAdaptor->pEncodings) { XvEncodingPtr pEncode = pAdaptor->pEncodings; @@ -315,9 +321,11 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) free(pEncode->name); free(pAdaptor->pEncodings); + pAdaptor->pEncodings = NULL; } free(pAdaptor->pFormats); + pAdaptor->pFormats = NULL; if(pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; @@ -330,22 +338,28 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) RegionDestroy(pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); + if (pPriv->ckeyFilled) + RegionDestroy(pPriv->ckeyFilled); free(pPriv); } } free(pAdaptor->pPorts); + pAdaptor->pPorts = NULL; } - if(pAdaptor->nAttributes) { + if(pAdaptor->pAttributes) { XvAttributePtr pAttribute = pAdaptor->pAttributes; for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) free(pAttribute->name); free(pAdaptor->pAttributes); + pAdaptor->pAttributes = NULL; } free(pAdaptor->pImages); free(pAdaptor->devPriv.ptr); + pAdaptor->pImages = NULL; + pAdaptor->devPriv.ptr = NULL; } static Bool @@ -556,7 +570,7 @@ xf86XVInitAdaptors( adaptorPriv->QueryBestSize = adaptorPtr->QueryBestSize; adaptorPriv->QueryImageAttributes = adaptorPtr->QueryImageAttributes; adaptorPriv->PutImage = adaptorPtr->PutImage; - adaptorPriv->ReputImage = adaptorPtr->ReputImage; + adaptorPriv->ReputImage = adaptorPtr->ReputImage; /* image/still */ pa->devPriv.ptr = (pointer)adaptorPriv; @@ -661,8 +675,7 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) pCompositeClip = RegionCreate(NullBox, 1); RegionCopy(pCompositeClip, portPriv->clientClip); RegionTranslate(pCompositeClip, - portPriv->pDraw->x + portPriv->clipOrg.x, - portPriv->pDraw->y + portPriv->clipOrg.y); + portPriv->pDraw->x, portPriv->pDraw->y); RegionIntersect(pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; @@ -687,6 +700,8 @@ xf86XVCopyClip( portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ RegionCopy(portPriv->clientClip, pGC->clientClip); + RegionTranslate(portPriv->clientClip, + pGC->clipOrg.x, pGC->clipOrg.y); } else if(portPriv->clientClip) { /* free the old clientClip */ RegionDestroy(portPriv->clientClip); portPriv->clientClip = NULL; @@ -697,7 +712,27 @@ xf86XVCopyClip( RegionDestroy(portPriv->pCompositeClip); } - portPriv->clipOrg = pGC->clipOrg; + portPriv->pCompositeClip = pGC->pCompositeClip; + portPriv->FreeCompositeClip = FALSE; + portPriv->subWindowMode = pGC->subWindowMode; +} + +static void +xf86XVCopyCompositeClip(XvPortRecPrivatePtr portPriv, + GCPtr pGC, + DrawablePtr pDraw) +{ + if (!portPriv->clientClip) + portPriv->clientClip = RegionCreate(NullBox, 1); + /* Keep the original GC composite clip around for ReputImage */ + RegionCopy(portPriv->clientClip, pGC->pCompositeClip); + RegionTranslate(portPriv->clientClip, + -pDraw->x, -pDraw->y); + + /* get rid of the old clip list */ + if (portPriv->pCompositeClip && portPriv->FreeCompositeClip) + RegionDestroy(portPriv->pCompositeClip); + portPriv->pCompositeClip = pGC->pCompositeClip; portPriv->FreeCompositeClip = FALSE; portPriv->subWindowMode = pGC->subWindowMode; @@ -852,6 +887,7 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) return ret; } +/* Reput image/still */ static int xf86XVReputImage(XvPortRecPrivatePtr portPriv) { @@ -863,6 +899,11 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) xf86XVUpdateCompositeClip(portPriv); + /* the clip can get smaller over time */ + RegionCopy(portPriv->clientClip, portPriv->pCompositeClip); + RegionTranslate(portPriv->clientClip, + -portPriv->pDraw->x, -portPriv->pDraw->y); + /* translate the video region to the screen */ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x; WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; @@ -912,7 +953,10 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) } ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn, + portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, + portPriv->vid_w, portPriv->vid_h, + portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr, portPriv->pDraw); @@ -985,7 +1029,6 @@ static void xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { XF86XVWindowPtr winPriv, prevPriv = NULL; - winPriv = GET_XF86XV_WINDOW(pWin); while(winPriv) { @@ -1002,6 +1045,81 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) winPriv = winPriv->next; } portPriv->pDraw = NULL; + if (portPriv->ckeyFilled) { + RegionDestroy(portPriv->ckeyFilled); + portPriv->ckeyFilled = NULL; + } + portPriv->clipChanged = FALSE; +} + +static void +xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, + WindowPtr pWin, + Bool visible) +{ + if (!visible) { + if (pPriv->isOn == XV_ON) { + (*pPriv->AdaptorRec->StopVideo)(pPriv->pScrn, pPriv->DevPriv.ptr, FALSE); + pPriv->isOn = XV_PENDING; + } + + if (!pPriv->type) /* overlaid still/image*/ + xf86XVRemovePortFromWindow(pWin, pPriv); + + return; + } + + switch (pPriv->type) { + case XvInputMask: + xf86XVReputVideo(pPriv); + break; + case XvOutputMask: + xf86XVRegetVideo(pPriv); + break; + default: /* overlaid still/image*/ + if (pPriv->AdaptorRec->ReputImage) + xf86XVReputImage(pPriv); + break; + } +} + +static void +xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) +{ + ScreenPtr pScreen = pScrn->pScreen; + XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); + XvAdaptorPtr pa; + int c, i; + + for (c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) { + XvPortPtr pPort = pa->pPorts; + + for (i = pa->nPorts; i > 0; i--, pPort++) { + XvPortRecPrivatePtr pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; + WindowPtr pWin = (WindowPtr)pPriv->pDraw; + Bool visible; + + if (pPriv->isOn == XV_OFF || !pWin) + continue; + + if (onlyChanged && !pPriv->clipChanged) + continue; + + visible = pWin->visibility == VisibilityUnobscured || + pWin->visibility == VisibilityPartiallyObscured; + + /* + * Stop and remove still/images if + * ReputImage isn't supported. + */ + if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) + visible = FALSE; + + xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; + } + } } /**** ScreenRec fields ****/ @@ -1025,9 +1143,6 @@ xf86XVDestroyWindow(WindowPtr pWin) pPriv->pDraw = NULL; tmp = WinPriv; - if(WinPriv->pGC) { - FreeGC(WinPriv->pGC, 0); - } WinPriv = WinPriv->next; free(tmp); } @@ -1041,6 +1156,29 @@ xf86XVDestroyWindow(WindowPtr pWin) return ret; } +static void +xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) +{ + ScreenPtr pScreen; + XF86XVScreenPtr ScreenPriv; + ScrnInfoPtr pScrn; + + if (pWin) + pScreen = pWin->drawable.pScreen; + else + pScreen = pLayerWin->drawable.pScreen; + + ScreenPriv = GET_XF86XV_SCREEN(pScreen); + pScrn = xf86Screens[pScreen->myNum]; + + xf86XVReputOrStopAllPorts(pScrn, TRUE); + + pScreen->PostValidateTree = ScreenPriv->PostValidateTree; + if (pScreen->PostValidateTree) { + (*pScreen->PostValidateTree)(pWin, pLayerWin, kind); + } + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; +} static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) @@ -1048,7 +1186,6 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); - XF86XVWindowPtr pPrev; XvPortRecPrivatePtr pPriv; Bool AreasExposed; @@ -1061,67 +1198,51 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) /* filter out XClearWindow/Area */ if (!pWin->valdata) return; - pPrev = NULL; - while(WinPriv) { - pPriv = WinPriv->PortRec; - - /* Reput anyone with a reput function */ - - switch(pPriv->type) { - case XvInputMask: - xf86XVReputVideo(pPriv); - break; - case XvOutputMask: - xf86XVRegetVideo(pPriv); - break; - default: /* overlaid still/image*/ - if (pPriv->AdaptorRec->ReputImage) - xf86XVReputImage(pPriv); - else if(AreasExposed) { - XF86XVWindowPtr tmp; + Bool visible = TRUE; - if (pPriv->isOn == XV_ON) { - (*pPriv->AdaptorRec->StopVideo)( - pPriv->pScrn, pPriv->DevPriv.ptr, FALSE); - pPriv->isOn = XV_PENDING; - } - pPriv->pDraw = NULL; + pPriv = WinPriv->PortRec; - if(!pPrev) - dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, - WinPriv->next); - else - pPrev->next = WinPriv->next; - tmp = WinPriv; - WinPriv = WinPriv->next; - free(tmp); - continue; - } - break; + /* + * Stop and remove still/images if areas were exposed and + * ReputImage isn't supported. + */ + if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) + visible = !AreasExposed; + + /* + * Subtract exposed areas from overlaid image to match textured video + * behavior. + */ + if (!pPriv->type && pPriv->clientClip) + RegionSubtract(pPriv->clientClip, pPriv->clientClip, reg1); + + if (visible && pPriv->ckeyFilled) { + RegionRec tmp; + RegionNull(&tmp); + RegionCopy(&tmp, reg1); + RegionTranslate(&tmp, pWin->drawable.x, pWin->drawable.y); + RegionSubtract(pPriv->ckeyFilled, pPriv->ckeyFilled, &tmp); } - pPrev = WinPriv; + WinPriv = WinPriv->next; + xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; } } - static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy) { ScreenPtr pScreen = pWin->drawable.pScreen; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); - XF86XVWindowPtr tmp, pPrev = NULL; XvPortRecPrivatePtr pPriv; - Bool visible = (pWin->visibility == VisibilityUnobscured) || - (pWin->visibility == VisibilityPartiallyObscured); while(WinPriv) { pPriv = WinPriv->PortRec; - if(!pPriv) goto next; - if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); @@ -1131,33 +1252,13 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) (*pPriv->AdaptorRec->ClipNotify)(pPriv->pScrn, pPriv->DevPriv.ptr, pWin, dx, dy); - /* Stop everything except images, but stop them too if the - window isn't visible. But we only remove the images. */ - - if(pPriv->type || !visible) { - if(pPriv->isOn == XV_ON) { - (*pPriv->AdaptorRec->StopVideo)( - pPriv->pScrn, pPriv->DevPriv.ptr, FALSE); - pPriv->isOn = XV_PENDING; - } - - if(!pPriv->type) { /* overlaid still/image */ - pPriv->pDraw = NULL; + pPriv->clipChanged = TRUE; - if(!pPrev) - dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, - WinPriv->next); - else - pPrev->next = WinPriv->next; - tmp = WinPriv; - WinPriv = WinPriv->next; - free(tmp); - continue; - } + if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) { + ScreenPriv->PostValidateTree = pScreen->PostValidateTree; + pScreen->PostValidateTree = xf86XVPostValidateTree; } -next: - pPrev = WinPriv; WinPriv = WinPriv->next; } @@ -1183,11 +1284,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) if(!ScreenPriv) return TRUE; - if(ScreenPriv->videoGC) { - FreeGC(ScreenPriv->videoGC, 0); - ScreenPriv->videoGC = NULL; - } - pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; @@ -1195,6 +1291,7 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) pScrn->EnterVT = ScreenPriv->EnterVT; pScrn->LeaveVT = ScreenPriv->LeaveVT; pScrn->AdjustFrame = ScreenPriv->AdjustFrame; + pScrn->ModeSet = ScreenPriv->ModeSet; for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) { xf86XVFreeAdaptor(pa); @@ -1287,11 +1384,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = pScrn->pScreen; - XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); - WindowPtr pWin; - XvAdaptorPtr pa; - int c, i; if(ScreenPriv->AdjustFrame) { pScrn->AdjustFrame = ScreenPriv->AdjustFrame; @@ -1299,40 +1392,30 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) pScrn->AdjustFrame = xf86XVAdjustFrame; } - for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) { - XvPortPtr pPort = pa->pPorts; - XvPortRecPrivatePtr pPriv; - - for(i = pa->nPorts; i > 0; i--, pPort++) { - pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; + xf86XVReputOrStopAllPorts(pScrn, FALSE); +} - if(!pPriv->type && (pPriv->isOn != XV_OFF)) { /* overlaid still/image */ +static void +xf86XVModeSet(ScrnInfoPtr pScrn) +{ + ScreenPtr pScreen = pScrn->pScreen; + XF86XVScreenPtr ScreenPriv; - if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - RegionDestroy(pPriv->pCompositeClip); + /* Can be called before pScrn->pScreen is set */ + if (!pScreen) + return; - pPriv->pCompositeClip = NULL; + ScreenPriv = GET_XF86XV_SCREEN(pScreen); - pWin = (WindowPtr)pPriv->pDraw; + if (ScreenPriv->ModeSet) { + pScrn->ModeSet = ScreenPriv->ModeSet; + (*pScrn->ModeSet)(pScrn); + pScrn->ModeSet = xf86XVModeSet; + } - if ((pPriv->AdaptorRec->ReputImage) && - ((pWin->visibility == VisibilityUnobscured) || - (pWin->visibility == VisibilityPartiallyObscured))) - { - xf86XVReputImage(pPriv); - } else if (pPriv->isOn == XV_ON) { - (*pPriv->AdaptorRec->StopVideo)( - pPriv->pScrn, pPriv->DevPriv.ptr, FALSE); - xf86XVRemovePortFromWindow(pWin, pPriv); - pPriv->isOn = XV_PENDING; - continue; - } - } - } - } + xf86XVReputOrStopAllPorts(pScrn, FALSE); } - /**** XvAdaptorRec fields ****/ static int @@ -1429,6 +1512,8 @@ xf86XVPutStill( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; + xf86XVCopyCompositeClip(portPriv, pGC, pDraw); + RegionInit(&WinRegion, &WinBox, 1); RegionNull(&ClipRegion); RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); @@ -1482,6 +1567,8 @@ xf86XVPutStill( xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); portPriv->isOn = XV_ON; + portPriv->vid_x = vid_x; portPriv->vid_y = vid_y; + portPriv->vid_w = vid_w; portPriv->vid_h = vid_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should @@ -1497,6 +1584,10 @@ xf86XVPutStill( portPriv->isOn = XV_PENDING; } + /* This clip was copied and only good for one shot */ + if(!portPriv->FreeCompositeClip) + portPriv->pCompositeClip = NULL; + RegionUninit(&WinRegion); RegionUninit(&ClipRegion); @@ -1718,6 +1809,8 @@ xf86XVPutImage( if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ + xf86XVCopyCompositeClip(portPriv, pGC, pDraw); + WinBox.x1 = pDraw->x + drw_x; WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; @@ -1779,6 +1872,8 @@ xf86XVPutImage( (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { portPriv->isOn = XV_ON; + portPriv->vid_x = src_x; portPriv->vid_y = src_y; + portPriv->vid_w = src_w; portPriv->vid_h = src_h; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should @@ -1794,6 +1889,10 @@ xf86XVPutImage( portPriv->isOn = XV_PENDING; } + /* This clip was copied and only good for one shot */ + if(!portPriv->FreeCompositeClip) + portPriv->pCompositeClip = NULL; + RegionUninit(&WinRegion); RegionUninit(&ClipRegion); @@ -1817,92 +1916,92 @@ xf86XVQueryImageAttributes( format->id, width, height, pitches, offsets); } - void -xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) +xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; - WindowPtr pWin = (WindowPtr)pDraw; - XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); - GCPtr pGC = NULL; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); - xRectangle *rects; - - if(!xf86Screens[pScreen->myNum]->vtSema) return; - - if(pPriv) - pGC = pPriv->pGC; - - if(!pGC) { - int status; - XID pval[2]; - pval[0] = key; - pval[1] = IncludeInferiors; - pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status, - (XID)0, serverClient); - if(!pGC) return; - ValidateGC(pDraw, pGC); - if (pPriv) pPriv->pGC = pGC; - } else if (key != pGC->fgPixel){ - ChangeGCVal val; - val.val = key; - ChangeGC(NullClient, pGC, GCForeground, &val); - ValidateGC(pDraw, pGC); - } - - RegionTranslate(clipboxes, -pDraw->x, -pDraw->y); - - rects = malloc(nbox * sizeof(xRectangle)); - - for(i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1; - rects[i].y = pbox->y1; - rects[i].width = pbox->x2 - pbox->x1; - rects[i].height = pbox->y2 - pbox->y1; - } - - (*pGC->ops->PolyFillRect)(pDraw, pGC, nbox, rects); - - if (!pPriv) FreeGC(pGC, 0); - - free(rects); -} - -void -xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) -{ - DrawablePtr root = &pScreen->root->drawable; ChangeGCVal pval[2]; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); + BoxPtr pbox = RegionRects(fillboxes); + int i, nbox = RegionNumRects(fillboxes); xRectangle *rects; GCPtr gc; if(!xf86Screens[pScreen->myNum]->vtSema) return; - gc = GetScratchGC(root->depth, pScreen); + gc = GetScratchGC(pDraw->depth, pScreen); pval[0].val = key; pval[1].val = IncludeInferiors; (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval); - ValidateGC(root, gc); + ValidateGC(pDraw, gc); rects = malloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1; - rects[i].y = pbox->y1; + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } - (*gc->ops->PolyFillRect)(root, gc, nbox, rects); + (*gc->ops->PolyFillRect)(pDraw, gc, nbox, rects); free(rects); FreeScratchGC (gc); } +void +xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes) +{ + xf86XVFillKeyHelperDrawable (&pScreen->root->drawable, key, fillboxes); +} + +void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything) +{ + WindowPtr pWin = (WindowPtr)pDraw; + XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); + XvPortRecPrivatePtr portPriv = NULL; + RegionRec reg; + RegionPtr fillboxes; + + while (WinPriv) { + XvPortRecPrivatePtr pPriv = WinPriv->PortRec; + + if (data == pPriv->DevPriv.ptr) { + portPriv = pPriv; + break; + } + + WinPriv = WinPriv->next; + } + + if (!portPriv) + return; + + if (!portPriv->ckeyFilled) + portPriv->ckeyFilled = RegionCreate(NULL, 0); + + if (!fillEverything) { + RegionNull(®); + fillboxes = ® + RegionSubtract(fillboxes, clipboxes, portPriv->ckeyFilled); + + if (!RegionNotEmpty(fillboxes)) + goto out; + } else + fillboxes = clipboxes; + + + RegionCopy(portPriv->ckeyFilled, clipboxes); + + xf86XVFillKeyHelperDrawable(pDraw, key, fillboxes); +out: + if (!fillEverything) + RegionUninit(®); +} + + /* xf86XVClipVideoHelper - Takes the dst box in standard X BoxRec form (top and left diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h index c3db6cc73..f0d8495c6 100644 --- a/hw/xfree86/common/xf86xv.h +++ b/hw/xfree86/common/xf86xv.h @@ -36,6 +36,10 @@ #define VIDEO_INVERT_CLIPLIST 0x00000002 #define VIDEO_OVERLAID_IMAGES 0x00000004 #define VIDEO_OVERLAID_STILLS 0x00000008 +/* + * Usage of VIDEO_CLIP_TO_VIEWPORT is not recommended. + * It can make reput behaviour inconsistent. + */ #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 typedef struct { @@ -107,7 +111,9 @@ typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn, short src_w, short src_h, short drw_w, short drw_h, int image, unsigned char* buf, short width, short height, Bool Sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw ); -typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y, +typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, + short src_x, short src_y, short drw_x, short drw_y, + short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw ); typedef int (*QueryImageAttributesFuncPtr)(ScrnInfoPtr pScrn, int image, unsigned short *width, unsigned short *height, @@ -165,7 +171,7 @@ typedef struct { GetPortAttributeFuncPtr GetPortAttribute; QueryBestSizeFuncPtr QueryBestSize; PutImageFuncPtr PutImage; - ReputImageFuncPtr ReputImage; + ReputImageFuncPtr ReputImage; /* image/still */ QueryImageAttributesFuncPtr QueryImageAttributes; ClipNotifyFuncPtr ClipNotify; } XF86VideoAdaptorRec, *XF86VideoAdaptorPtr; @@ -238,6 +244,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); +extern _X_EXPORT void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything); + extern _X_EXPORT Bool xf86XVClipVideoHelper( BoxPtr dst, diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h index 7623d297d..2a459f1b4 100644 --- a/hw/xfree86/common/xf86xvpriv.h +++ b/hw/xfree86/common/xf86xvpriv.h @@ -40,10 +40,11 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; + PostValidateTreeProcPtr PostValidateTree; void (*AdjustFrame)(int, int, int, int); Bool (*EnterVT)(int, int); void (*LeaveVT)(int, int); - GCPtr videoGC; + xf86ModeSetProc *ModeSet; } XF86XVScreenRec, *XF86XVScreenPtr; typedef struct { @@ -67,13 +68,13 @@ typedef struct { DrawablePtr pDraw; unsigned char type; unsigned int subWindowMode; - DDXPointRec clipOrg; RegionPtr clientClip; + RegionPtr ckeyFilled; RegionPtr pCompositeClip; Bool FreeCompositeClip; XvAdaptorRecPrivatePtr AdaptorRec; XvStatus isOn; - Bool moved; + Bool clipChanged; int vid_x, vid_y, vid_w, vid_h; int drw_x, drw_y, drw_w, drw_h; DevUnion DevPriv; @@ -82,7 +83,6 @@ typedef struct { typedef struct _XF86XVWindowRec{ XvPortRecPrivatePtr PortRec; struct _XF86XVWindowRec *next; - GCPtr pGC; } XF86XVWindowRec, *XF86XVWindowPtr; #endif /* _XF86XVPRIV_H_ */ diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index 7c7dc9c6b..179f42ccd 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -235,15 +235,12 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEDID_DDC1( - int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, - unsigned int (*DDC1Read)(ScrnInfoPtr) -) +xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, + unsigned int (*DDC1Read)(ScrnInfoPtr)) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; - int sigio; /* Default DDC and DDC1 to enabled. */ Bool noddc = FALSE, noddc1 = FALSE; OptionInfoPtr options; @@ -259,9 +256,9 @@ xf86DoEDID_DDC1( if (noddc || noddc1) return NULL; - sigio = xf86BlockSIGIO(); + OsBlockSignals(); EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read); - xf86UnblockSIGIO(sigio); + OsReleaseSignals(); if (EDID_block){ tmp = xf86InterpretEDID(scrnIndex,EDID_block); diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index d2d90ba2d..5d6eec927 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -30,7 +30,6 @@ #include #include "property.h" #include "propertyst.h" -#include "xf86DDC.h" #include #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index 365f00671..1a162ab1c 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -45,7 +45,7 @@ libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libglx_la_LDFLAGS = -avoid-version -if AIGLX +if AIGLX_DRI_LOADER GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la endif libglx_la_LIBADD = \ diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h index 6745a6e7a..a13a51794 100644 --- a/hw/xfree86/dixmods/extmod/dgaproc.h +++ b/hw/xfree86/dixmods/extmod/dgaproc.h @@ -124,7 +124,6 @@ extern _X_EXPORT Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index, int butto int is_down); extern _X_EXPORT Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy); extern _X_EXPORT Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index, int key_code, int is_down); -extern _X_EXPORT Bool DGAIsDgaEvent (xEvent *e); extern _X_EXPORT Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem, int *size, int *offset, int *flags); diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c index f4e922cd0..a415e5f27 100644 --- a/hw/xfree86/dixmods/extmod/modinit.c +++ b/hw/xfree86/dixmods/extmod/modinit.c @@ -146,11 +146,8 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) for (i = 0; extensionModules[i].name != NULL; i++) { if (opts) { char *s; - s = (char *)malloc(strlen(extensionModules[i].name) + 5); - if (s) { + if (asprintf(&s, "omit%s", extensionModules[i].name) != -1) { pointer o; - strcpy(s, "omit"); - strcat(s, extensionModules[i].name); o = xf86FindOption(opts, s); free(s); if (o) { diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h index 1154e4601..5bbbb882b 100644 --- a/hw/xfree86/dixmods/extmod/modinit.h +++ b/hw/xfree86/dixmods/extmod/modinit.h @@ -18,6 +18,10 @@ extern void XTestExtensionInit(INITARGS); extern void XTestExtension1Init(INITARGS); #endif +#if 1 +extern void XCMiscExtensionInit(INITARGS); +#endif + #ifdef SCREENSAVER extern void ScreenSaverExtensionInit (INITARGS); #include diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index ca5d519e5..4bcf77efd 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -99,7 +99,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client) char *deviceName; int nameSize; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!DGAAvailable(stuff->screen)) @@ -133,7 +133,7 @@ ProcXDGACloseFramebuffer(ClientPtr client) { REQUEST(xXDGACloseFramebufferReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (!DGAAvailable(stuff->screen)) @@ -155,7 +155,7 @@ ProcXDGAQueryModes(ClientPtr client) xXDGAModeInfo info; XDGAModePtr mode; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXDGAQueryModesReq); @@ -274,7 +274,7 @@ ProcXDGASetMode(ClientPtr client) ClientPtr owner; int size; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; owner = DGA_GETCLIENT(stuff->screen); @@ -363,7 +363,7 @@ ProcXDGASetViewport(ClientPtr client) { REQUEST(xXDGASetViewportReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -383,7 +383,7 @@ ProcXDGAInstallColormap(ClientPtr client) int rc; REQUEST(xXDGAInstallColormapReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -405,7 +405,7 @@ ProcXDGASelectInput(ClientPtr client) { REQUEST(xXDGASelectInputReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -425,7 +425,7 @@ ProcXDGAFillRectangle(ClientPtr client) { REQUEST(xXDGAFillRectangleReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -445,7 +445,7 @@ ProcXDGACopyArea(ClientPtr client) { REQUEST(xXDGACopyAreaReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -466,7 +466,7 @@ ProcXDGACopyTransparentArea(ClientPtr client) { REQUEST(xXDGACopyTransparentAreaReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -488,7 +488,7 @@ ProcXDGAGetViewportStatus(ClientPtr client) REQUEST(xXDGAGetViewportStatusReq); xXDGAGetViewportStatusReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -511,7 +511,7 @@ ProcXDGASync(ClientPtr client) REQUEST(xXDGASyncReq); xXDGASyncReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -556,7 +556,7 @@ ProcXDGAChangePixmapMode(ClientPtr client) xXDGAChangePixmapModeReply rep; int x, y; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -587,7 +587,7 @@ ProcXDGACreateColormap(ClientPtr client) REQUEST(xXDGACreateColormapReq); int result; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if(DGA_GETCLIENT(stuff->screen) != client) @@ -625,7 +625,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client) int num, offset, flags; char *name; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); @@ -664,7 +664,7 @@ ProcXF86DGADirectVideo(ClientPtr client) ClientPtr owner; REQUEST(xXF86DGADirectVideoReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); @@ -718,7 +718,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client) REQUEST(xXF86DGAGetViewPortSizeReq); xXF86DGAGetViewPortSizeReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); @@ -746,7 +746,7 @@ ProcXF86DGASetViewPort(ClientPtr client) { REQUEST(xXF86DGASetViewPortReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) @@ -773,7 +773,7 @@ ProcXF86DGAGetVidPage(ClientPtr client) REQUEST(xXF86DGAGetVidPageReq); xXF86DGAGetVidPageReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); @@ -792,7 +792,7 @@ ProcXF86DGASetVidPage(ClientPtr client) { REQUEST(xXF86DGASetVidPageReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); @@ -810,7 +810,7 @@ ProcXF86DGAInstallColormap(ClientPtr client) int rc; REQUEST(xXF86DGAInstallColormapReq); - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) @@ -837,7 +837,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client) REQUEST(xXF86DGAQueryDirectVideoReq); xXF86DGAQueryDirectVideoReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); @@ -859,7 +859,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client) REQUEST(xXF86DGAViewPortChangedReq); xXF86DGAViewPortChangedReply rep; - if (stuff->screen > screenInfo.numScreens) + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (DGA_GETCLIENT(stuff->screen) != client) diff --git a/hw/xfree86/doc/.gitignore b/hw/xfree86/doc/.gitignore new file mode 100644 index 000000000..63eee5960 --- /dev/null +++ b/hw/xfree86/doc/.gitignore @@ -0,0 +1,4 @@ +ddxDesign.html +ddxDesign.pdf +ddxDesign.ps +ddxDesign.txt diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am index 33ff18ab7..1c3620abb 100644 --- a/hw/xfree86/doc/Makefile.am +++ b/hw/xfree86/doc/Makefile.am @@ -1,8 +1,18 @@ -if BUILDDOCS -SUBDIRS = devel man sgml -else -SUBDIRS = man -endif -EXTRA_DIST = \ +if ENABLE_DEVEL_DOCS +if HAVE_XMLTO + +# Main DocBook/XML files (DOCTYPE book) +docbook = ddxDesign.xml + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/devbook.am + +endif HAVE_XMLTO +endif ENABLE_DEVEL_DOCS + +EXTRA_DIST = \ + Registry \ + exa-driver.txt \ + README.DRIcomp \ README.modes diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/README.DRIcomp similarity index 99% rename from hw/xfree86/doc/devel/README.DRIcomp rename to hw/xfree86/doc/README.DRIcomp index 89f40a759..2d3ebf148 100644 --- a/hw/xfree86/doc/devel/README.DRIcomp +++ b/hw/xfree86/doc/README.DRIcomp @@ -552,5 +552,3 @@ ated direct rendering. Please read the DRI User Guide for information about trouble shooting and how to use the DRI-enabled X server for 3D applications. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $ - - diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/Registry similarity index 99% rename from hw/xfree86/doc/devel/Registry rename to hw/xfree86/doc/Registry index 1fec230e8..48e24a2f4 100644 --- a/hw/xfree86/doc/devel/Registry +++ b/hw/xfree86/doc/Registry @@ -243,6 +243,7 @@ DemandLoad O I ?? Device S I Device file name DeviceName S I Input device name FlowControl S I Serial flow control ("xon", "none") +Floating B I Device initialised as floating HistorySize I I ?? MaxX I I Maximum X coordinate MaxY I I Maximum Y coordinate @@ -253,7 +254,6 @@ ReportDelay I I ?? ReportingMode S I may be "raw" or "scaled" ScreenNumber I I Screen number (for touch screen) SendCoreEvents B I Send core events -SendDragEvents B I Send drag events StopBits I I Serial port stop bits SwapXY B I Swap the X and Y axes UntouchDelay I I ?? diff --git a/hw/xfree86/doc/sgml/DESIGN.xml b/hw/xfree86/doc/ddxDesign.xml similarity index 99% rename from hw/xfree86/doc/sgml/DESIGN.xml rename to hw/xfree86/doc/ddxDesign.xml index 6c90a4011..02909602c 100644 --- a/hw/xfree86/doc/sgml/DESIGN.xml +++ b/hw/xfree86/doc/ddxDesign.xml @@ -16,7 +16,7 @@ ServerFlags"> ] > -
+
XFree86 DDX Design (Xorg server version &xserver.version;) @@ -1628,14 +1628,6 @@ Here is what InitOutput() does: - - Currently, aperture remapping, as described here, should not be - attempted if the driver uses the xf8_16bpp or - xf8_32bpp framebuffer layers. A pending - restructuring of VT switching will address this restriction in - the near future. - - Other layers may wrap the ChipEnterVT() and ChipLeaveVT() functions if they need to take some @@ -4913,7 +4905,7 @@ as follows: XV_HUE XV_SATURATION XV_BRIGHTNESS - XV_CONTRAST + XV_CONTRAST but the driver may recognize as many atoms as it wishes. If a requested attribute is unknown by the driver it should return diff --git a/hw/xfree86/doc/devel/Makefile.am b/hw/xfree86/doc/devel/Makefile.am deleted file mode 100644 index c9eca5eb3..000000000 --- a/hw/xfree86/doc/devel/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# Documentation for developers that is distributed with the source but -# not installed on the system for end-users - -EXTRA_DIST = \ - Registry \ - exa-driver.txt \ - README.DRIcomp diff --git a/hw/xfree86/doc/devel/exa-driver.txt b/hw/xfree86/doc/exa-driver.txt similarity index 100% rename from hw/xfree86/doc/devel/exa-driver.txt rename to hw/xfree86/doc/exa-driver.txt diff --git a/hw/xfree86/doc/man/.gitignore b/hw/xfree86/doc/man/.gitignore deleted file mode 100644 index 7a16e4a29..000000000 --- a/hw/xfree86/doc/man/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Add & Override for this directory and it's subdirectories -Xorg -Xorg.man -xorg.conf.man diff --git a/hw/xfree86/doc/man/Makefile.am b/hw/xfree86/doc/man/Makefile.am deleted file mode 100644 index 737166b51..000000000 --- a/hw/xfree86/doc/man/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# Xserver.man covers options generic to all X servers built in this tree -MAN_SRCS = Xorg.man.pre xorg.conf.man.pre - -appmandir = $(APP_MAN_DIR) -appman_DATA = Xorg.$(APP_MAN_SUFFIX) - -filemandir = $(FILE_MAN_DIR) -fileman_DATA = xorg.conf.$(FILE_MAN_SUFFIX) - -Xorg.$(APP_MAN_SUFFIX): Xorg.man - -$(AM_V_at)rm -f Xorg.$(APP_MAN_SUFFIX) - $(AM_V_at)$(LN_S) Xorg.man Xorg.$(APP_MAN_SUFFIX) - -xorg.conf.$(FILE_MAN_SUFFIX): xorg.conf.man - -$(AM_V_at)rm -f xorg.conf.$(FILE_MAN_SUFFIX) - $(AM_V_at)$(LN_S) xorg.conf.man xorg.conf.$(FILE_MAN_SUFFIX) - -include $(top_srcdir)/cpprules.in - -EXTRAMANDEFS = -D__logdir__=$(logdir) - -CLEANFILES = $(appman_DATA) $(fileman_DATA) xorg.conf.man Xorg.man - -EXTRA_DIST = $(MAN_SRCS) diff --git a/hw/xfree86/doc/sgml/.gitignore b/hw/xfree86/doc/sgml/.gitignore deleted file mode 100644 index b0b2d0565..000000000 --- a/hw/xfree86/doc/sgml/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Add & Override for this directory and it's subdirectories -DESIGN.html -DESIGN.pdf -DESIGN.ps -DESIGN.txt -xorg.css diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index fe99a2dcc..1726960ae 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -63,8 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dri.h" #include "sarea.h" #include "dristruct.h" -#include "xf86.h" -#include "xf86drm.h" #include "mi.h" #include "mipointer.h" #include "xf86_OSproc.h" @@ -431,7 +429,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) if (!pDRIPriv->pDriverInfo->dontMapFrameBuffer) { if (drmAddMap( pDRIPriv->drmFD, - (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, + (uintptr_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, pDRIPriv->pDriverInfo->frameBufferSize, DRM_FRAME_BUFFER, 0, @@ -1497,10 +1495,6 @@ DRIGetDrawableInfo(ScreenPtr pScreen, *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; *X = (int)(pWin->drawable.x); *Y = (int)(pWin->drawable.y); -#if 0 - *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1); - *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1); -#endif *W = (int)(pWin->drawable.width); *H = (int)(pWin->drawable.height); *numClipRects = RegionNumRects(&pWin->clipList); @@ -2426,13 +2420,10 @@ DRICreatePCIBusID(const struct pci_device * dev) { char *busID; - busID = malloc(20); - if (busID == NULL) + if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", + dev->domain, dev->bus, dev->dev, dev->func) == -1) return NULL; - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", dev->domain, dev->bus, - dev->dev, dev->func); - return busID; } diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 20baa24f2..e02644a30 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -58,7 +58,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dri.h" #include "sarea.h" #include "dristruct.h" -#include "xf86.h" #include "xf86drm.h" #include "protocol-versions.h" diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 34f735f52..bf7ebb9f8 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -83,6 +83,7 @@ typedef struct _DRI2Drawable { CARD64 last_swap_ust; /* ust at completion of most recent swap */ int swap_limit; /* for N-buffering */ unsigned long serialNumber; + Bool needInvalidate; } DRI2DrawableRec, *DRI2DrawablePtr; typedef struct _DRI2Screen { @@ -221,11 +222,16 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, if (ref == NULL) return BadAlloc; - if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) + if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) { + free(ref); return BadAlloc; + } if (!DRI2LookupDrawableRef(pPriv, id)) - if (!AddResource(id, dri2DrawableRes, pPriv)) + if (!AddResource(id, dri2DrawableRes, pPriv)) { + FreeResourceByType(dri2_id, dri2DrawableRes, TRUE); + free(ref); return BadAlloc; + } ref->id = id; ref->dri2_id = dri2_id; @@ -353,7 +359,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds, static void update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw, - DRI2BufferPtr *buffers, int *out_count, int *width, int *height) + DRI2BufferPtr *buffers, int out_count, int *width, int *height) { DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); int i; @@ -369,7 +375,7 @@ update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw, } pPriv->buffers = buffers; - pPriv->bufferCount = *out_count; + pPriv->bufferCount = out_count; pPriv->width = pDraw->width; pPriv->height = pDraw->height; *width = pPriv->width; @@ -403,7 +409,9 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, && (pDraw->height == pPriv->height) && (pPriv->serialNumber == DRI2DrawableSerial(pDraw)); - buffers = malloc((count + 1) * sizeof(buffers[0])); + buffers = calloc((count + 1), sizeof(buffers[0])); + if (!buffers) + goto err_out; for (i = 0; i < count; i++) { const unsigned attachment = *(attachments++); @@ -470,7 +478,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, *out_count = i; - update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height); + update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height); /* If the client is getting a fake front-buffer, pre-fill it with the * contents of the real front-buffer. This ensures correct operation of @@ -490,21 +498,25 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, DRI2BufferFrontLeft); } + pPriv->needInvalidate = TRUE; + return pPriv->buffers; err_out: *out_count = 0; - for (i = 0; i < count; i++) { + if (buffers) { + for (i = 0; i < count; i++) { if (buffers[i] != NULL) - (*ds->DestroyBuffer)(pDraw, buffers[i]); - } + (*ds->DestroyBuffer)(pDraw, buffers[i]); + } - free(buffers); - buffers = NULL; + free(buffers); + buffers = NULL; + } - update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height); + update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height); return buffers; } @@ -531,9 +543,11 @@ DRI2InvalidateDrawable(DrawablePtr pDraw) DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); DRI2DrawableRefPtr ref; - if (!pPriv) + if (!pPriv || !pPriv->needInvalidate) return; + pPriv->needInvalidate = FALSE; + list_for_each_entry(ref, &pPriv->reference_list, link) ref->invalidate(pDraw, ref->priv); } @@ -640,6 +654,17 @@ DRI2CanFlip(DrawablePtr pDraw) if (!RegionEqual(&pWin->clipList, &pRoot->winSize)) return FALSE; + /* Does the window match the pixmap exactly? */ + if (pDraw->x != 0 || + pDraw->y != 0 || +#ifdef COMPOSITE + pDraw->x != pWinPixmap->screen_x || + pDraw->y != pWinPixmap->screen_y || +#endif + pDraw->width != pWinPixmap->drawable.width || + pDraw->height != pWinPixmap->drawable.height) + return FALSE; + return TRUE; } @@ -828,11 +853,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, * is moved to a crtc with a lower refresh rate, or a crtc that just * got enabled. */ - if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc)) - pPriv->last_swap_target = 0; + if (ds->GetMSC) { + if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc)) + pPriv->last_swap_target = 0; + + if (current_msc < pPriv->last_swap_target) + pPriv->last_swap_target = current_msc; - if (current_msc < pPriv->last_swap_target) - pPriv->last_swap_target = current_msc; + } /* * Swap target for this swap is last swap target + swap interval since diff --git a/hw/xfree86/exa/.gitignore b/hw/xfree86/exa/.gitignore deleted file mode 100644 index d20a82fb5..000000000 --- a/hw/xfree86/exa/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add & Override for this directory and it's subdirectories -exa.man diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am index da9b720d7..39f7a9057 100644 --- a/hw/xfree86/exa/Makefile.am +++ b/hw/xfree86/exa/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + module_LTLIBRARIES = libexa.la libexa_la_LDFLAGS = -avoid-version @@ -14,15 +16,3 @@ libexa_la_SOURCES = \ libexa_la_LIBADD = \ ../../../exa/libexa.la - -include $(top_srcdir)/cpprules.in - -drivermandir = $(DRIVER_MAN_DIR) -driverman_DATA = exa.$(DRIVER_MAN_SUFFIX) -CLEANFILES = $(driverman_DATA) exa.man - -exa.$(DRIVER_MAN_SUFFIX): exa.man - -$(AM_V_at)rm -f exa.$(DRIVER_MAN_SUFFIX) - $(AM_V_at)$(LN_S) exa.man exa.$(DRIVER_MAN_SUFFIX) - -EXTRA_DIST = exa.man.pre diff --git a/hw/xfree86/exa/man/Makefile.am b/hw/xfree86/exa/man/Makefile.am new file mode 100644 index 000000000..51da4fd50 --- /dev/null +++ b/hw/xfree86/exa/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +driverman_PRE = exa.man diff --git a/hw/xfree86/exa/exa.man.pre b/hw/xfree86/exa/man/exa.man similarity index 96% rename from hw/xfree86/exa/exa.man.pre rename to hw/xfree86/exa/man/exa.man index 5c953e256..30d01824d 100644 --- a/hw/xfree86/exa/exa.man.pre +++ b/hw/xfree86/exa/man/exa.man @@ -7,7 +7,7 @@ exa \- new 2D acceleration architecture for X.Org .B EXA provides a simple API for video drivers to implement for 2D acceleration. It is a module loaded by drivers, and is not intended to be loaded on its own. -See your driver's manual page for how to enable +See your driver's manual page for how to enable .BR EXA . .PP The @@ -25,7 +25,7 @@ the Render extension. Not related to the Composite extension. Default: No. Disables acceleration of uploading pixmap data to the framebuffer. Default: No. .TP .BI "Option \*qEXANoDownloadFromScreen\*q \*q" boolean \*q -Disables acceleration of downloading of pixmap data from the framebuffer. +Disables acceleration of downloading of pixmap data from the framebuffer. .B NOTE: Not usable with drivers which rely on DownloadFromScreen succeeding. Default: No. diff --git a/hw/xfree86/fbdevhw/.gitignore b/hw/xfree86/fbdevhw/.gitignore deleted file mode 100644 index 88d61c605..000000000 --- a/hw/xfree86/fbdevhw/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add & Override for this directory and it's subdirectories -fbdevhw.man diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am index 76a69c1fb..2a038905e 100644 --- a/hw/xfree86/fbdevhw/Makefile.am +++ b/hw/xfree86/fbdevhw/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + module_LTLIBRARIES = libfbdevhw.la libfbdevhw_la_LDFLAGS = -avoid-version @@ -14,14 +16,4 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = fbdevhw.h -include $(top_srcdir)/cpprules.in - -drivermandir = $(DRIVER_MAN_DIR) -driverman_DATA = fbdevhw.$(DRIVER_MAN_SUFFIX) -CLEANFILES = $(driverman_DATA) fbdevhw.man - -fbdevhw.$(DRIVER_MAN_SUFFIX): fbdevhw.man - -$(AM_V_at)rm -f fbdevhw.$(DRIVER_MAN_SUFFIX) - $(AM_V_at)$(LN_S) fbdevhw.man fbdevhw.$(DRIVER_MAN_SUFFIX) - -EXTRA_DIST = fbpriv.h fbdevhw.man.pre README +EXTRA_DIST = fbpriv.h README diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index a5b59e762..dee731be4 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -48,7 +48,6 @@ _X_EXPORT XF86ModuleData fbdevhwModuleData = { #include #include #include -#include /* -------------------------------------------------------------------- */ /* our private data, and two functions to allocate/free this */ @@ -264,14 +263,7 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) { struct fb_fix_screeninfo fix; char filename[256]; - int fd,i,j; - - - /* There are two ways to that we can determine which fb device is - * associated with this PCI device. The more modern way is to look in - * the sysfs directory for the PCI device for a file named - * "graphics/fb*" - */ + int fd, i; for (i = 0; i < 8; i++) { sprintf(filename, @@ -304,55 +296,10 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) } } - - /* The other way is to examine the resources associated with each fb - * device and see if there is a match with the PCI device. This technique - * has some problems on certain mixed 64-bit / 32-bit architectures. - * There is a flaw in the fb_fix_screeninfo structure in that it only - * returns the low 32-bits of the address of the resources associated with - * a device. However, on a mixed architecture the base addresses of PCI - * devices, even for 32-bit applications, may be higher than 0x0f0000000. - */ - - for (i = 0; i < 8; i++) { - sprintf(filename,"/dev/fb%d",i); - if (-1 == (fd = open(filename,O_RDWR,0))) { - xf86DrvMsg(-1, X_WARNING, - "open %s: %s\n", filename, strerror(errno)); - continue; - } - if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) { - close(fd); - continue; - } - for (j = 0; j < 6; j++) { - const pciaddr_t res_start = pPci->regions[j].base_addr; - const pciaddr_t res_end = res_start + pPci->regions[j].size; - - if ((0 != fix.smem_len && - (pciaddr_t) fix.smem_start >= res_start && - (pciaddr_t) fix.smem_start < res_end) || - (0 != fix.mmio_len && - (pciaddr_t) fix.mmio_start >= res_start && - (pciaddr_t) fix.mmio_start < res_end)) - break; - } - if (j == 6) { - close(fd); - continue; - } - if (namep) { - *namep = xnfalloc(16); - strncpy(*namep,fix.id,16); - } - return fd; - } - if (namep) *namep = NULL; - xf86DrvMsg(-1, X_ERROR, - "Unable to find a valid framebuffer device\n"); + xf86DrvMsg(-1, X_ERROR, "Unable to find a valid framebuffer device\n"); return -1; } diff --git a/hw/xfree86/fbdevhw/man/Makefile.am b/hw/xfree86/fbdevhw/man/Makefile.am new file mode 100644 index 000000000..7f22a12b9 --- /dev/null +++ b/hw/xfree86/fbdevhw/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +driverman_PRE = fbdevhw.man diff --git a/hw/xfree86/fbdevhw/fbdevhw.man.pre b/hw/xfree86/fbdevhw/man/fbdevhw.man similarity index 95% rename from hw/xfree86/fbdevhw/fbdevhw.man.pre rename to hw/xfree86/fbdevhw/man/fbdevhw.man index deeced860..fe5d1e17b 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.man.pre +++ b/hw/xfree86/fbdevhw/man/fbdevhw.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $ .TH FBDEVHW __drivermansuffix__ __vendorversion__ .SH NAME fbdevhw \- os-specific submodule for framebuffer device access @@ -14,7 +14,7 @@ fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the fbdevhw module. fbdevhw can be used by other drivers too, this is usually activated with `Option "UseFBDev"' in the device section. .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), fbdev(__drivermansuffix__) .SH AUTHORS diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 55ab05866..ec8420040 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -75,13 +75,14 @@ setup_int(xf86Int10InfoPtr pInt) if (pInt->Flags & SET_BIOS_SCRATCH) SetResetBIOSVars(pInt, TRUE); #endif - return xf86BlockSIGIO(); + OsBlockSignals(); + return 0; } void finish_int(xf86Int10InfoPtr pInt, int sig) { - xf86UnblockSIGIO(sig); + OsReleaseSignals(); pInt->ax = (CARD32) X86_EAX; pInt->bx = (CARD32) X86_EBX; pInt->cx = (CARD32) X86_ECX; @@ -503,7 +504,7 @@ pciCfg1in(CARD16 addr, CARD32 *val) } if (addr == 0xCFC) { pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr), - val, PCI_OFFSET(PciCfg1Addr)); + (uint32_t *)val, PCI_OFFSET(PciCfg1Addr)); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val); return 1; diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index 2bac89ac9..0e5b304a4 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -12,18 +12,22 @@ EXTRA_DIST = \ loaderProcs.h \ sdksyms.sh +nodist_libloader_la_SOURCES = \ + sdksyms.c + libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ loadext.c \ loadmod.c \ - os.c \ - sdksyms.c + os.c + libloader_la_LIBADD = $(DLOPEN_LIBS) CLEANFILES = sdksyms.c sdksyms.dep -sdksyms.dep sdksyms.c: sdksyms.sh +sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES) -sinclude sdksyms.dep +SDKSYMS_DEP = sdksyms.dep +include $(SDKSYMS_DEP) diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index 694c1c2b0..159b61198 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -114,26 +114,6 @@ LoaderInit(void) GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); -#if defined(__UNIXWARE__) && !defined(__GNUC__) - /* For UnixWare we need to load the C Runtime libraries which are - * normally auto-linked by the compiler. Otherwise we are bound to - * see unresolved symbols when trying to use the type "long long". - * Obviously, this does not apply if the GNU C compiler is used. - */ - { - int errmaj, errmin, wasLoaded; /* place holders */ - char *xcrtpath = DEFAULT_MODULE_PATH "/libcrt.a"; - char *uwcrtpath = "/usr/ccs/lib/libcrt.a"; - char *path; - struct stat st; - - if(stat(xcrtpath, &st) < 0) - path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */ - else - path = xcrtpath; /* get the libcrt.a we compiled with */ - LoaderOpen (path, &errmaj, &errmin, &wasLoaded, 0); - } -#endif } /* Public Interface to the loader. */ diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 6e6522774..9f820993a 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -374,7 +374,7 @@ FreeSubdirs(const char **subdirs) if (subdirs) { for (s = subdirs; *s; s++) - free(*s); + free((char *)*s); free(subdirs); } } @@ -406,22 +406,22 @@ FindModuleInSubdir(const char *dirpath, const char *module) snprintf(tmpBuf, PATH_MAX, "lib%s.so", module); if (strcmp(direntry->d_name, tmpBuf) == 0) { - ret = malloc(strlen(tmpBuf) + strlen(dirpath) + 2); - sprintf(ret, "%s%s", dirpath, tmpBuf); + if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) + ret = NULL; break; } snprintf(tmpBuf, PATH_MAX, "%s_drv.so", module); if (strcmp(direntry->d_name, tmpBuf) == 0) { - ret = malloc(strlen(tmpBuf) + strlen(dirpath) + 2); - sprintf(ret, "%s%s", dirpath, tmpBuf); + if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) + ret = NULL; break; } snprintf(tmpBuf, PATH_MAX, "%s.so", module); if (strcmp(direntry->d_name, tmpBuf) == 0) { - ret = malloc(strlen(tmpBuf) + strlen(dirpath) + 2); - sprintf(ret, "%s%s", dirpath, tmpBuf); + if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) + ret = NULL; break; } } @@ -483,19 +483,15 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) char *fp; char **listing = NULL; char **save; + char **ret = NULL; int n = 0; if (!(pathlist = InitPathList(NULL))) return NULL; - if (!(subdirs = InitSubdirs(subdirlist))) { - FreePathList(pathlist); - return NULL; - } - if (!(patterns = InitPatterns(patternlist))) { - FreePathList(pathlist); - FreeSubdirs(subdirs); - return NULL; - } + if (!(subdirs = InitSubdirs(subdirlist))) + goto bail; + if (!(patterns = InitPatterns(patternlist))) + goto bail; for (elem = pathlist; *elem; elem++) { for (s = subdirs; *s; s++) { @@ -529,18 +525,14 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) save[n] = NULL; FreeStringList(save); } - FreePathList(pathlist); - FreeSubdirs(subdirs); - FreePatterns(patterns); - return NULL; + closedir(d); + goto bail; } listing[n] = malloc(len + 1); if (!listing[n]) { FreeStringList(listing); - FreePathList(pathlist); - FreeSubdirs(subdirs); - FreePatterns(patterns); - return NULL; + closedir(d); + goto bail; } strncpy(listing[n], dp->d_name + match[1].rm_so, len); @@ -556,7 +548,13 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) } if (listing) listing[n] = NULL; - return listing; + ret = listing; + +bail: + FreePatterns(patterns); + FreeSubdirs(subdirs); + FreePathList(pathlist); + return ret; } void @@ -933,16 +931,14 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, * now check if the special data object ModuleData is * present. */ - p = malloc(strlen(name) + strlen("ModuleData") + 1); - if (!p) { + if (asprintf(&p, "%sModuleData", name) == -1) { + p = NULL; if (errmaj) *errmaj = LDR_NOMEM; if (errmin) *errmin = 0; goto LoadModule_fail; } - strcpy(p, name); - strcat(p, "ModuleData"); initdata = LoaderSymbol(p); if (initdata) { ModuleSetupProc setup; diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c index 5acce0024..6b5ac7e86 100644 --- a/hw/xfree86/loader/os.c +++ b/hw/xfree86/loader/os.c @@ -50,8 +50,6 @@ #define OSNAME "openbsd" #elif defined(__GNU__) #define OSNAME "hurd" -#elif defined(__SCO__) -#define OSNAME "sco" #elif defined(SVR4) && defined(sun) #define OSNAME "solaris" #elif defined(SVR5) diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh index 6ca368ed5..18bb73523 100755 --- a/hw/xfree86/loader/sdksyms.sh +++ b/hw/xfree86/loader/sdksyms.sh @@ -19,7 +19,6 @@ cat > sdksyms.c << EOF #include "mipict.h" #include "glyphstr.h" #include "picturestr.h" -#include "renderedge.h" /* fb/Makefile.am -- module */ @@ -42,6 +41,9 @@ cat > sdksyms.c << EOF #include "damage.h" #include "damagestr.h" +/* miext/sync/Makefile.am */ +#include "misync.h" +#include "misyncstr.h" /* Xext/Makefile.am -- half is module, half is builtin */ /* @@ -51,6 +53,7 @@ cat > sdksyms.c << EOF #include "geext.h" #include "geint.h" #include "shmint.h" +#include "syncsdk.h" #if XINERAMA # include "panoramiXsrv.h" # include "panoramiX.h" @@ -209,12 +212,6 @@ cat > sdksyms.c << EOF */ -/* hw/xfree86/xf8_16bpp/Makefile.am -- module */ -/* -#include "cfb8_16.h" - */ - - /* mi/Makefile.am */ #include "micmap.h" #include "miline.h" @@ -256,13 +253,13 @@ cat > sdksyms.c << EOF /* include/Makefile.am */ #include "XIstubs.h" -#include "bstore.h" -#include "bstorestr.h" +#include "Xprintf.h" #include "closestr.h" #include "closure.h" #include "colormap.h" #include "colormapst.h" #include "hotplug.h" +#include "client.h" #include "cursor.h" #include "cursorstr.h" #include "dix.h" @@ -363,7 +360,7 @@ BEGIN { # skip modifiers, if any $n ~ /^\*?(unsigned|const|volatile|struct)$/ || # skip pointer - $n ~ /\*$/) + $n ~ /^[a-zA-Z0-9_]*\*$/) n++; # type specifier may not be set, as in @@ -371,6 +368,10 @@ BEGIN { if ($n !~ /[^a-zA-Z0-9_]/) n++; + # go back if we are at the parameter list already + if ($n ~ /^[(]([^*].*)?$/) + n--; + # match # extern _X_EXPORT type (* name[])(...) if ($n ~ /^[^a-zA-Z0-9_]+$/) diff --git a/hw/xfree86/man/Makefile.am b/hw/xfree86/man/Makefile.am new file mode 100644 index 000000000..80e22cbab --- /dev/null +++ b/hw/xfree86/man/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xorg.man +fileman_PRE = xorg.conf.man xorg.conf.d.man diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/man/Xorg.man similarity index 98% rename from hw/xfree86/doc/man/Xorg.man.pre rename to hw/xfree86/man/Xorg.man index 805f3a3e2..6fa334cc3 100644 --- a/hw/xfree86/doc/man/Xorg.man.pre +++ b/hw/xfree86/man/Xorg.man @@ -15,7 +15,7 @@ is a full featured X server that was originally designed for UNIX and UNIX-like operating systems running on Intel x86 hardware. It now runs on a wider range of hardware and OS platforms. .PP -This work was derived by the X.Org Foundation from the XFree86 Project's +This work was derived by the X.Org Foundation from the XFree86 Project's .I "XFree86\ 4.4rc2" release. The XFree86 release was originally derived from @@ -32,8 +32,8 @@ SPARC and PowerPC. The most widely supported operating systems are the free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD, OpenBSD, and Solaris. Commercial UNIX operating systems such as UnixWare are also supported. Other supported operating systems include -GNU Hurd. Darwin and Mac OS X are supported with the -XDarwin(__appmansuffix__) X server. Win32/Cygwin is supported with the +GNU Hurd. Mac OS X is supported with the +Xquartz(__appmansuffix__) X server. Win32/Cygwin is supported with the XWin(__appmansuffix__) X server. .PP .SH "NETWORK CONNECTIONS" @@ -117,13 +117,13 @@ one way, the highest precedence mechanism is used. The list of mechanisms is ordered from highest precedence to lowest. Note that not all parameters can be supplied via all methods. The available command line options and environment variables (and some defaults) are described here and in -the Xserver(__appmansuffix__) manual page. Most configuration file +the Xserver(__appmansuffix__) manual page. Most configuration file parameters, with their defaults, are described in the -__xconfigfile__(__filemansuffix__) manual page. Driver and module specific -configuration parameters are described in the relevant driver or module +__xconfigfile__(__filemansuffix__) manual page. Driver and module specific +configuration parameters are described in the relevant driver or module manual page. .PP -In addition to the normal server options described in the +In addition to the normal server options described in the Xserver(__appmansuffix__) manual page, .B __xservername__ accepts the following command line switches: @@ -673,7 +673,7 @@ information can be found from the X.Org web site .PP .B __xservername__ is copyright software, provided under licenses that permit modification -and redistribution in source and binary form without fee. +and redistribution in source and binary form without fee. .B __xservername__ is copyright by numerous authors and contributors from around the world. Licensing information can be found at @@ -684,6 +684,6 @@ Refer to the source code for specific copyright notices. is a trademark of The XFree86 Project, Inc. .PP .B X11(TM) -and +and .B X Window System(TM) are trademarks of The Open Group. diff --git a/hw/xfree86/man/xorg.conf.d.man b/hw/xfree86/man/xorg.conf.d.man new file mode 100644 index 000000000..6b3379ece --- /dev/null +++ b/hw/xfree86/man/xorg.conf.d.man @@ -0,0 +1 @@ +.so man__filemansuffix__/xorg.conf.__filemansuffix__ diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/man/xorg.conf.man similarity index 98% rename from hw/xfree86/doc/man/xorg.conf.man.pre rename to hw/xfree86/man/xorg.conf.man index cbfea7d98..f406f82bb 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/man/xorg.conf.man @@ -558,9 +558,6 @@ Default: off. This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) drivers to not report failure if the mouse device can't be opened/initialised. It has no effect on the evdev(__drivermansuffix__) or other drivers. -The previous functionality of allowing the server to start up even if -the mouse device can't be opened/initialised is now handled by the -AllowEmptyInput option. Default: false. .TP 7 .BI "Option \*qVTSysReq\*q \*q" boolean \*q @@ -677,12 +674,6 @@ default. Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default. .TP 7 -.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q -If enabled, don't add the standard keyboard and mouse drivers, if there are no -input devices in the config file. Enabled by default if AutoAddDevices and -AutoEnableDevices is enabled, otherwise disabled. -If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored. -.TP 7 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q If this option is disabled, then no devices will be added from HAL events. Enabled by default. @@ -823,11 +814,18 @@ Example: the MIT-SHM extension can be disabled with the following entry: The config file may have multiple .B InputDevice sections. -Recent X servers employ input hotplugging to add input devices, with the HAL -backend being the default backend for X servers since 1.4. It is usually not +Recent X servers employ HAL or udev backends for input device enumeration +and input hotplugging. It is usually not necessary to provide .B InputDevice -sections in the xorg.conf if hotplugging is enabled. +sections in the xorg.conf if hotplugging is in use. If hotplugging is +enabled, +.B InputDevice +sections using the +.B mouse, kbd +and +.B vmmouse +driver will be ignored. .PP If hotplugging is disabled, there will normally be at least two: one for the core (primary) keyboard @@ -913,34 +911,43 @@ the server. This affects implied layouts as well as explicit layouts specified in the configuration and/or on the command line. .TP 7 .BI "Option \*qCorePointer\*q" -Deprecated, use -.B SendCoreEvents -instead. +Deprecated, see +.B Floating .TP 7 .BI "Option \*qCoreKeyboard\*q" -Deprecated, use -.B SendCoreEvents -instead. +Deprecated, see +.B Floating .TP 7 .BI "Option \*qAlwaysCore\*q \*q" boolean \*q -.B -Deprecated, use -.B SendCoreEvents -instead. +Deprecated, see +.B Floating .TP 7 .BI "Option \*qSendCoreEvents\*q \*q" boolean \*q -Both of these options are equivalent, and when enabled cause the -input device to report core events through the master device. They are -enabled by default. Any device configured to send core events will be -attached to the virtual core pointer or keyboard and control the cursor by -default. Devices with -.B SendCoreEvents -disabled will be \*qfloating\*q and only accessible by clients employing the -X Input extension. This option controls the startup behavior only, a device -may be reattached or set floating at runtime. +Deprecated, see +.B Floating + .TP 7 -.BI "Option \*qSendDragEvents\*q \*q" boolean \*q -Send core events while dragging. Enabled by default. +.BI "Option \*qFloating\*q \*q" boolean \*q +When enabled, the input device is set up floating and does not +report events through any master device or control a cursor. The device is +only available to clients using the X Input Extension API. This option is +disabled by default. +The options +.B CorePointer, +.B CoreKeyboard, +.B AlwaysCore, +and +.B SendCoreEvents, +are the inverse of option +.B Floating +(i.e. +.B SendCoreEvents \*qon\*q +is equivalent to +.B Floating \*qoff\*q +). + +This option controls the startup behavior only, a device +may be reattached or set floating at runtime. .PP For pointing devices, the following options control how the pointer is accelerated or decelerated with respect to physical device motion. Most of @@ -1133,6 +1140,16 @@ matches the pattern. A match is found if at least one of the tags given in .RI \*q matchtag \*q matches at least one of the tags assigned by the backend. +.TP 7 +.BI "MatchLayout \*q" matchlayout \*q +Check the case-sensitive string +.RI \*q matchlayout \*q +against the currently active +.B ServerLayout +section. The empty string "" matches an implicit layout which appears +if no named +.B ServerLayout +sections have been found. .PP The second type of entry is used to match device types. These entries take a boolean argument similar to diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index b2daec72e..c2814d4cd 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -371,6 +371,8 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati crtc->active = TRUE; if (scrn->pScreen) xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); + if (scrn->ModeSet) + scrn->ModeSet(scrn); } else { crtc->x = saved_x; crtc->y = saved_y; @@ -407,12 +409,16 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, void xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y) { + ScrnInfoPtr scrn = crtc->scrn; + crtc->x = x; crtc->y = y; if (crtc->funcs->set_origin) { if (!xf86CrtcRotate (crtc)) return; crtc->funcs->set_origin (crtc, x, y); + if (scrn->ModeSet) + scrn->ModeSet(scrn); } else xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y); @@ -474,7 +480,6 @@ static void xf86OutputSetMonitor (xf86OutputPtr output) { char *option_name; - static const char monitor_prefix[] = "monitor-"; char *monitor; if (!output->name) @@ -484,11 +489,8 @@ xf86OutputSetMonitor (xf86OutputPtr output) output->options = xnfalloc (sizeof (xf86OutputOptions)); memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions)); - - option_name = xnfalloc (strlen (monitor_prefix) + - strlen (output->name) + 1); - strcpy (option_name, monitor_prefix); - strcat (option_name, output->name); + + XNFasprintf(&option_name, "monitor-%s", output->name); monitor = xf86findOptionValue (output->scrn->options, option_name); if (!monitor) monitor = output->name; @@ -660,13 +662,11 @@ xf86OutputCreate (ScrnInfoPtr scrn, Bool xf86OutputRename (xf86OutputPtr output, const char *name) { - int len = strlen(name) + 1; - char *newname = malloc(len); + char *newname = strdup(name); if (!newname) return FALSE; /* so sorry... */ - strcpy (newname, name); if (output->name && output->name != (char *) (output + 1)) free(output->name); output->name = newname; @@ -1512,7 +1512,6 @@ struct det_monrec_parameter { static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, void *data) { - enum { sync_config, sync_edid, sync_default }; struct det_monrec_parameter *p; p = (struct det_monrec_parameter *)data; @@ -1566,7 +1565,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) int min_clock = 0; int max_clock = 0; double clock; - Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE); + Bool add_default_modes; Bool debug_modes = config->debug_modes || xf86Initialising; enum det_monrec_source sync_source = sync_default; @@ -1612,6 +1611,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) } output_modes = (*output->funcs->get_modes) (output); + + /* + * If the user has a preference, respect it. + * Otherwise, don't second-guess the driver. + */ + if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES, + &add_default_modes)) + add_default_modes = (output_modes == NULL); edid_monitor = output->MonInfo; @@ -2347,6 +2354,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) int i = scrn->scrnIndex; Bool have_outputs = TRUE; Bool ret; + Bool success = FALSE; /* Set up the device options */ config->options = xnfalloc (sizeof (xf86DeviceOptions)); @@ -2405,11 +2413,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) * Set the position of each output */ if (!xf86InitialOutputPositions (scrn, modes)) - { - free(crtcs); - free(modes); - return FALSE; - } + goto bailout; /* * Set initial panning of each output @@ -2420,11 +2424,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) * Assign CRTCs to fit output configuration */ if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height)) - { - free(crtcs); - free(modes); - return FALSE; - } + goto bailout; /* XXX override xf86 common frame computation code */ @@ -2501,7 +2501,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) * Make sure the configuration isn't too small. */ if (width < config->minWidth || height < config->minHeight) - return FALSE; + goto bailout; /* * Limit the crtc config to virtual[XY] if the driver can't grow the @@ -2524,10 +2524,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) xf86CVTMode(width, height, 60, 0, 0)); } - + success = TRUE; + bailout: free(crtcs); free(modes); - return TRUE; + free(enabled); + return success; } /* @@ -2894,6 +2896,8 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) } if (pScrn->pScreen) xf86_crtc_notify(pScrn->pScreen); + if (pScrn->ModeSet) + pScrn->ModeSet(pScrn); } #ifdef RANDR_12_INTERFACE @@ -2964,10 +2968,11 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) int size; #endif - if (output->MonInfo != NULL) - free(output->MonInfo); + free(output->MonInfo); output->MonInfo = edid_mon; + output->mm_width = 0; + output->mm_height = 0; if (debug_modes) { xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index ab07b6045..066744744 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -1,5 +1,6 @@ /* * Copyright © 2007 Keith Packard + * Copyright © 2010 Aaron Plattner * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -126,12 +127,33 @@ xf86_crtc_rotate_coord_back (Rotation rotation, *y_src = y_dst; } +struct cursor_bit { + CARD8 *byte; + char bitpos; +}; + /* * Convert an x coordinate to a position within the cursor bitmap */ -static int -cursor_bitpos (int flags, int x, Bool mask) +static struct cursor_bit +cursor_bitpos (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, + Bool mask) { + const int flags = cursor_info->Flags; + const Bool interleaved = + !!(flags & (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64)); + const int width = cursor_info->MaxWidth; + const int height = cursor_info->MaxHeight; + const int stride = interleaved ? width / 4 : width / 8; + + struct cursor_bit ret; + + image += y * stride; + if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) mask = !mask; if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) @@ -149,29 +171,33 @@ cursor_bitpos (int flags, int x, Bool mask) x = ((x & ~31) << 1) | (mask << 5) | (x & 31); else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64) x = ((x & ~63) << 1) | (mask << 6) | (x & 63); - return x; + else if (mask) + image += stride * height; + + ret.byte = image + (x / 8); + ret.bitpos = x & 7; + + return ret; } /* * Fetch one bit from a cursor bitmap */ static CARD8 -get_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask) +get_bit (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) { - x = cursor_bitpos (flags, x, mask); - image += y * stride; - return (image[(x >> 3)] >> (x & 7)) & 1; + struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask); + return (*bit.byte >> bit.bitpos) & 1; } /* * Set one bit in a cursor bitmap */ static void -set_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask) +set_bit (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask) { - x = cursor_bitpos (flags, x, mask); - image += y * stride; - image[(x >> 3)] |= 1 << (x & 7); + struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask); + *bit.byte |= 1 << bit.bitpos; } /* @@ -186,7 +212,6 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src) CARD32 *cursor_image = (CARD32 *) xf86_config->cursor_image; int x, y; int xin, yin; - int stride = cursor_info->MaxWidth >> 2; int flags = cursor_info->Flags; CARD32 bits; @@ -201,10 +226,10 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src) cursor_info->MaxWidth, cursor_info->MaxHeight, x, y, &xin, &yin); - if (get_bit (src, stride, flags, xin, yin, TRUE) == + if (get_bit (src, cursor_info, xin, yin, TRUE) == ((flags & HARDWARE_CURSOR_INVERT_MASK) == 0)) { - if (get_bit (src, stride, flags, xin, yin, FALSE)) + if (get_bit (src, cursor_info, xin, yin, FALSE)) bits = xf86_config->cursor_fg; else bits = xf86_config->cursor_bg; @@ -407,7 +432,6 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src) int x, y; int xin, yin; int stride = cursor_info->MaxWidth >> 2; - int flags = cursor_info->Flags; cursor_image = xf86_config->cursor_image; memset(cursor_image, 0, cursor_info->MaxHeight * stride); @@ -419,10 +443,10 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src) cursor_info->MaxWidth, cursor_info->MaxHeight, x, y, &xin, &yin); - if (get_bit(src, stride, flags, xin, yin, FALSE)) - set_bit(cursor_image, stride, flags, x, y, FALSE); - if (get_bit(src, stride, flags, xin, yin, TRUE)) - set_bit(cursor_image, stride, flags, x, y, TRUE); + if (get_bit(src, cursor_info, xin, yin, FALSE)) + set_bit(cursor_image, cursor_info, x, y, FALSE); + if (get_bit(src, cursor_info, xin, yin, TRUE)) + set_bit(cursor_image, cursor_info, x, y, TRUE); } } crtc->funcs->load_cursor_image (crtc, cursor_image); diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 3d51b1d44..9ff2f0d60 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -145,6 +145,11 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC) DDC->vendor.prod_id == 0x2a00) return TRUE; + /* Bug #28414: HP Compaq NC8430 LP154W01-TLA8 */ + if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && + DDC->vendor.prod_id == 5750) + return TRUE; + /* Bug #21750: Samsung Syncmaster 2333HD */ if (memcmp (DDC->vendor.name, "SAM", 4) == 0 && DDC->vendor.prod_id == 1157) @@ -954,7 +959,7 @@ static const DisplayModeRec CEAVideoModes[CEA_VIDEO_MODES_NUM] = { { MODEPREFIX, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX },/* VIC 58:1440x480i@240 */ { MODEPREFIX, 108000, 1440, 1478, 1602, 1716, 0, 480, 488, 494, 525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX },/* VIC 59:1440x480i@240 */ { MODEPREFIX, 59400, 1280, 3040, 3080, 3300, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 60: 1280x720@24Hz */ - { MODEPREFIX, 74250, 3700, 3740, 1430, 3960, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 61: 1280x720@25Hz */ + { MODEPREFIX, 74250, 1280, 3700, 3740, 3960, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 61: 1280x720@25Hz */ { MODEPREFIX, 74250, 1280, 3040, 3080, 3300, 0, 720, 725, 730, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 62: 1280x720@30Hz */ { MODEPREFIX, 297000, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 63: 1920x1080@120Hz */ { MODEPREFIX, 297000, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 64:1920x1080@100Hz */ diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 51eb4c952..c2dc3dc75 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -132,8 +132,8 @@ xf86SetModeDefaultName(DisplayModePtr mode) free(mode->name); - mode->name = XNFprintf("%dx%d%s", mode->HDisplay, mode->VDisplay, - interlaced ? "i" : ""); + XNFasprintf(&mode->name, "%dx%d%s", mode->HDisplay, mode->VDisplay, + interlaced ? "i" : ""); } /* @@ -355,15 +355,32 @@ xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, { DisplayModePtr mode; - for (mode = modeList; mode != NULL; mode = mode->next) { - if (maxPitch > 0 && mode->HDisplay > maxPitch) - mode->status = MODE_BAD_WIDTH; - - if (maxX > 0 && mode->HDisplay > maxX) - mode->status = MODE_VIRTUAL_X; + if (maxPitch <= 0) + maxPitch = MAXINT; + if (maxX <= 0) + maxX = MAXINT; + if (maxY <= 0) + maxY = MAXINT; - if (maxY > 0 && mode->VDisplay > maxY) - mode->status = MODE_VIRTUAL_Y; + for (mode = modeList; mode != NULL; mode = mode->next) { + if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch || + xf86ModeWidth(mode, RR_Rotate_0) > maxX || + xf86ModeHeight(mode, RR_Rotate_0) > maxY) && + (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch || + xf86ModeWidth(mode, RR_Rotate_90) > maxX || + xf86ModeHeight(mode, RR_Rotate_90) > maxY)) { + if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch || + xf86ModeWidth(mode, RR_Rotate_90) > maxPitch) + mode->status = MODE_BAD_WIDTH; + + if (xf86ModeWidth(mode, RR_Rotate_0) > maxX || + xf86ModeWidth(mode, RR_Rotate_90) > maxX) + mode->status = MODE_VIRTUAL_X; + + if (xf86ModeHeight(mode, RR_Rotate_0) > maxY || + xf86ModeHeight(mode, RR_Rotate_90) > maxY) + mode->status = MODE_VIRTUAL_Y; + } if (mode->next == modeList) break; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index ba0862a6c..cb20d1c35 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -31,7 +31,6 @@ #include "xf86.h" #include "os.h" #include "globals.h" -#include "xf86.h" #include "xf86Priv.h" #include "xf86DDC.h" #include "mipointer.h" @@ -584,10 +583,12 @@ xf86RandR12SetConfig (ScreenPtr pScreen, ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - int px, py; + int pos[MAXDEVICES][2]; Bool useVirtual = FALSE; int maxX = 0, maxY = 0; Rotation oldRotation = randrp->rotation; + DeviceIntPtr dev; + Bool view_adjusted = FALSE; randrp->rotation = rotation; @@ -597,7 +598,14 @@ xf86RandR12SetConfig (ScreenPtr pScreen, randrp->virtualY = scrp->virtualY; } - miPointerGetPosition (inputInfo.pointer, &px, &py); + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (!IsMaster(dev) && !IsFloating(dev)) + continue; + + miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]); + } + for (mode = scrp->modes; ; mode = mode->next) { if (randrp->maxX == 0 || randrp->maxY == 0) @@ -643,15 +651,28 @@ xf86RandR12SetConfig (ScreenPtr pScreen, /* * Move the cursor back where it belongs; SwitchMode repositions it + * FIXME: duplicated code, see modes/xf86RandR12.c */ - if (pScreen == miPointerGetScreen(inputInfo.pointer)) + for (dev = inputInfo.devices; dev; dev = dev->next) { - px = (px >= pScreen->width ? (pScreen->width - 1) : px); - py = (py >= pScreen->height ? (pScreen->height - 1) : py); + if (!IsMaster(dev) && !IsFloating(dev)) + continue; + + if (pScreen == miPointerGetScreen(dev)) { + int px = pos[dev->id][0]; + int py = pos[dev->id][1]; - xf86SetViewport(pScreen, px, py); + px = (px >= pScreen->width ? (pScreen->width - 1) : px); + py = (py >= pScreen->height ? (pScreen->height - 1) : py); - (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); + /* Setting the viewpoint makes only sense on one device */ + if (!view_adjusted && IsMaster(dev)) { + xf86SetViewport(pScreen, px, py); + view_adjusted = TRUE; + } + + (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE); + } } return TRUE; @@ -1731,7 +1752,9 @@ xf86RandR12EnterVT (int screen_index, int flags) ScreenPtr pScreen = screenInfo.screens[screen_index]; ScrnInfoPtr pScrn = xf86Screens[screen_index]; XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + rrScrPrivPtr rp = rrGetScrPriv(pScreen); Bool ret; + int i; if (randrp->orig_EnterVT) { pScrn->EnterVT = randrp->orig_EnterVT; @@ -1742,6 +1765,10 @@ xf86RandR12EnterVT (int screen_index, int flags) return FALSE; } + /* reload gamma */ + for (i = 0; i < rp->numCrtcs; i++) + xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]); + return RRGetInfo (pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ } @@ -1751,6 +1778,7 @@ xf86RandR12Init12 (ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; rrScrPrivPtr rp = rrGetScrPriv(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + int i; rp->rrGetInfo = xf86RandR12GetInfo12; rp->rrScreenSetSize = xf86RandR12ScreenSetSize; @@ -1780,6 +1808,9 @@ xf86RandR12Init12 (ScreenPtr pScreen) */ if (!xf86RandR12SetInfo12 (pScreen)) return FALSE; + for (i = 0; i < rp->numCrtcs; i++) { + xf86RandR12CrtcGetGamma(pScreen, rp->crtcs[i]); + } return TRUE; } diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index fdc38c5a6..57c3499ac 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width; if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; RegionInit(&damage_region, &damage_box, 1); - DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, &damage_region); RegionUninit(&damage_region); crtc->shadowClear = TRUE; diff --git a/hw/xfree86/modes/xf86cvt.c b/hw/xfree86/modes/xf86cvt.c index 1da5fe50b..244f3b9a3 100644 --- a/hw/xfree86/modes/xf86cvt.c +++ b/hw/xfree86/modes/xf86cvt.c @@ -279,15 +279,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, if (Interlaced) Mode->VTotal *= 2; - { - char Name[256]; - Name[0] = 0; - - snprintf(Name, 256, "%dx%d", HDisplay, VDisplay); - - Mode->name = xnfalloc(strlen(Name) + 1); - memcpy(Mode->name, Name, strlen(Name) + 1); - } + XNFasprintf(&Mode->name, "%dx%d", HDisplay, VDisplay); if (Reduced) Mode->Flags |= V_PHSYNC | V_NVSYNC; diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am index 04997a6cb..3af4328ff 100644 --- a/hw/xfree86/os-support/Makefile.am +++ b/hw/xfree86/os-support/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS) -DIST_SUBDIRS = bsd bus misc linux solaris sysv sco hurd +DIST_SUBDIRS = bsd bus misc linux solaris hurd sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index 13c6ec37c..123eb17d1 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.c @@ -50,11 +50,7 @@ static Bool ShareVTs = FALSE; #ifdef PCCONS_SUPPORT /* Stock 0.1 386bsd pccons console driver interface */ -#ifndef __OpenBSD__ -# define PCCONS_CONSOLE_DEV1 "/dev/ttyv0" -#else -# define PCCONS_CONSOLE_DEV1 "/dev/ttyC0" -#endif +#define PCCONS_CONSOLE_DEV1 "/dev/ttyv0" #define PCCONS_CONSOLE_DEV2 "/dev/vga" #define PCCONS_CONSOLE_MODE O_RDWR|O_NDELAY #endif diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c index ccef5f218..3f942aaca 100644 --- a/hw/xfree86/os-support/hurd/hurd_mmap.c +++ b/hw/xfree86/os-support/hurd/hurd_mmap.c @@ -39,8 +39,8 @@ int xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; vm_address_t addr = (vm_address_t)0; /* serach starting address */ kern_return_t err; @@ -51,14 +51,14 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) errno = err; FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self (), device); if( err ) { errno = err; FatalError("xf86ReadBIOS() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&mem_obj,0); if( err ) { errno = err; @@ -69,13 +69,13 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len) BIOS_SIZE, 0, TRUE, - iopl_mem, + mem_obj, Base, FALSE, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 4a99db375..39f353bd3 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -44,8 +44,8 @@ static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { - mach_port_t device,iopl_dev; - memory_object_t iopl_mem; + mach_port_t device,mem_dev; + memory_object_t mem_obj; kern_return_t err; vm_address_t addr=(vm_address_t)0; @@ -55,7 +55,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) errno = err; FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno)); } - err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev); + err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev); mach_port_deallocate (mach_task_self(), device); if( err ) { @@ -63,7 +63,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno)); } - err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&iopl_mem,0); + err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&mem_obj,0); if( err ) { errno = err; @@ -74,23 +74,23 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) Size, 0, /* mask */ TRUE, /* anywhere */ - iopl_mem, + mem_obj, (vm_offset_t)Base, FALSE, /* copy on write */ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE, VM_INHERIT_SHARE); - mach_port_deallocate(mach_task_self(),iopl_mem); + mach_port_deallocate(mach_task_self(),mem_obj); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't vm_map.(iopl_mem) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n",strerror(errno)); } - mach_port_deallocate(mach_task_self(),iopl_dev); + mach_port_deallocate(mach_task_self(),mem_dev); if( err ) { errno = err; - FatalError("xf86MapVidMem() can't mach_port_deallocate.(iopl_dev) (%s)\n",strerror(errno)); + FatalError("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n",strerror(errno)); } return (pointer)addr; } @@ -124,8 +124,17 @@ xf86EnableIO() FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); return FALSE; } +#if 0 + /* + * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these + * ports, and the int10 wrapper is not emulating them. (Note that it's + * effectively what happens in the Linux variant too, as iopl() is used + * there, making the ioperm() meaningless.) + * + * Reenable this when int10 gets fixed. */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ +#endif return TRUE; } diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index c65f1e3f3..a5f041162 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/hw/xfree86/os-support/linux/lnx_agp.c @@ -264,7 +264,7 @@ xf86DeallocateGARTMemory(int screenNum, int key) } #ifdef __linux__ - if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)key) != 0) { + if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)(uintptr_t)key) != 0) { #else if (ioctl(gartFd, AGPIOC_DEALLOCATE, &key) != 0) { #endif diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 92bfde48f..77dfb2f16 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -39,59 +39,44 @@ #include static Bool KeepTty = FALSE; -static int VTnum = -1; static Bool VTSwitch = TRUE; static Bool ShareVTs = FALSE; static int activeVT = -1; -static int vtPermSave[4]; static char vtname[11]; static struct termios tty_attr; /* tty state to restore */ static int tty_mode; /* kbd mode to restore */ -static int -saveVtPerms(void) -{ - /* We need to use stat to get permissions. */ - struct stat svtp; - - /* Do them numerically ordered, hard coded tty0 first. */ - if (stat("/dev/tty0", &svtp) != 0) - return 0; - vtPermSave[0] = (int)svtp.st_uid; - vtPermSave[1] = (int)svtp.st_gid; - - /* Now check the console we are dealing with. */ - if (stat(vtname, &svtp) != 0) - return 0; - vtPermSave[2] = (int)svtp.st_uid; - vtPermSave[3] = (int)svtp.st_gid; - - return 1; -} +static void *console_handler; static void -restoreVtPerms(void) +drain_console(int fd, void *closure) { - if (geteuid() == 0) { - /* Set the terminal permissions back to before we started. */ - (void)chown("/dev/tty0", vtPermSave[0], vtPermSave[1]); - (void)chown(vtname, vtPermSave[2], vtPermSave[3]); + errno = 0; + if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { + xf86RemoveGeneralHandler(console_handler); + console_handler = NULL; } } -static void *console_handler; - static void -drain_console(int fd, void *closure) +switch_to(int vt, const char *from) { - tcflush(fd, TCIOFLUSH); + int ret; + + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); + if (ret < 0) + FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); + + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); + if (ret < 0) + FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); } void xf86OpenConsole(void) { - int i, fd = -1; + int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; MessageType from = X_PROBED; @@ -108,8 +93,7 @@ xf86OpenConsole(void) /* * setup the virtual terminal manager */ - if (VTnum != -1) { - xf86Info.vtno = VTnum; + if (xf86Info.vtno != -1) { from = X_CMDLINE; } else { @@ -127,17 +111,19 @@ xf86OpenConsole(void) if (ShareVTs) { - if (ioctl(fd, VT_GETSTATE, &vts) == 0) - xf86Info.vtno = vts.v_active; - else - FatalError("xf86OpenConsole: Cannot find the current" - " VT (%s)\n", strerror(errno)); + SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts)); + if (ret < 0) + FatalError("xf86OpenConsole: Cannot find the current" + " VT (%s)\n", strerror(errno)); + xf86Info.vtno = vts.v_active; } else { - if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || - (xf86Info.vtno == -1)) - FatalError("xf86OpenConsole: Cannot find a free VT: %s\n", - strerror(errno)); - } + SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno)); + if (ret < 0) + FatalError("xf86OpenConsole: Cannot find a free VT: " + "%s\n", strerror(errno)); + if (xf86Info.vtno == -1) + FatalError("xf86OpenConsole: Cannot find a free VT\n"); + } close(fd); } @@ -175,39 +161,12 @@ xf86OpenConsole(void) FatalError("xf86OpenConsole: Cannot open virtual console" " %d (%s)\n", xf86Info.vtno, strerror(errno)); - if (!ShareVTs) - { - /* - * Grab the vt ownership before we overwrite it. - * Hard coded /dev/tty0 into this function as well for below. - */ - if (!saveVtPerms()) - xf86Msg(X_WARNING, - "xf86OpenConsole: Could not save ownership of VT\n"); - - if (geteuid() == 0) { - /* change ownership of the vt */ - if (chown(vtname, getuid(), getgid()) < 0) - xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n", - vtname, strerror(errno)); - - /* - * the current VT device we're running on is not - * "console", we want to grab all consoles too - * - * Why is this needed?? - */ - if (chown("/dev/tty0", getuid(), getgid()) < 0) - xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n", - strerror(errno)); - } - } - /* * Linux doesn't switch to an active vt after the last close of a vt, * so we do this ourselves by remembering which is active now. */ - if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) < 0) + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts)); + if (ret < 0) xf86Msg(X_WARNING,"xf86OpenConsole: VT_GETSTATE failed: %s\n", strerror(errno)); else @@ -219,7 +178,7 @@ xf86OpenConsole(void) * Detach from the controlling tty to avoid char loss */ if ((i = open("/dev/tty",O_RDWR)) >= 0) { - ioctl(i, TIOCNOTTY, 0); + SYSCALL(ioctl(i, TIOCNOTTY, 0)); close(i); } } @@ -232,38 +191,36 @@ xf86OpenConsole(void) /* * now get the VT. This _must_ succeed, or else fail completely. */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) - FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", - strerror(errno)); + switch_to(xf86Info.vtno, "xf86OpenConsole"); - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0) - FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n", + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); + if (ret < 0) + FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", strerror(errno)); - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) - FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", - strerror(errno)); - signal(SIGUSR1, xf86VTRequest); VT.mode = VT_PROCESS; VT.relsig = SIGUSR1; VT.acqsig = SIGUSR1; - if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) - FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n", + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT)); + if (ret < 0) + FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n", strerror(errno)); - - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) - FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n", - strerror(errno)); + + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS)); + if (ret < 0) + FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n", + strerror(errno)); tcgetattr(xf86Info.consoleFd, &tty_attr); - ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode); + SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode)); - if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0) - FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", - strerror(errno)); + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW)); + if (ret < 0) + FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", + strerror(errno)); nTty = tty_attr; nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); @@ -277,9 +234,7 @@ xf86OpenConsole(void) tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty); /* need to keep the buffer clean, else the kernel gets angry */ - if (xf86Info.allowEmptyInput) - console_handler = xf86AddGeneralHandler(xf86Info.consoleFd, - drain_console, NULL); + xf86SetConsoleHandler(drain_console, NULL); /* we really should have a InitOSInputDevices() function instead * of Init?$#*&Device(). So I just place it here */ @@ -287,16 +242,8 @@ xf86OpenConsole(void) } else { /* serverGeneration != 1 */ if (!ShareVTs && VTSwitch) { - /* - * now get the VT - */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) - xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed %s\n", - strerror(errno)); - - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0) - xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed %s\n", - strerror(errno)); + /* now get the VT */ + switch_to(xf86Info.vtno, "xf86OpenConsole"); } } } @@ -305,6 +252,7 @@ void xf86CloseConsole(void) { struct vt_mode VT; + int ret; if (ShareVTs) { close(xf86Info.consoleFd); @@ -317,20 +265,23 @@ xf86CloseConsole(void) }; /* Back to text mode ... */ - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT) < 0) + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); + if (ret < 0) xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n", strerror(errno)); - ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode); + SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode)); tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); + if (ret < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n", strerror(errno)); else { /* set dflt vt handling */ VT.mode = VT_AUTO; - if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT)); + if (ret < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_SETMODE failed: %s\n", strerror(errno)); } @@ -341,19 +292,11 @@ xf86CloseConsole(void) * Perform a switch back to the active VT when we were started */ if (activeVT >= 0) { - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0) - xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n", - strerror(errno)); - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0) - xf86Msg(X_WARNING, - "xf86CloseConsole: VT_WAITACTIVE failed: %s\n", - strerror(errno)); + switch_to(activeVT, "xf86CloseConsole"); activeVT = -1; } } close(xf86Info.consoleFd); /* make the vt-manager happy */ - - restoreVtPerms(); /* restore the permissions */ } int @@ -380,10 +323,10 @@ xf86ProcessArgument(int argc, char *argv[], int i) } if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { - if (sscanf(argv[i], "vt%2d", &VTnum) == 0) + if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0) { UseMsg(); - VTnum = -1; + xf86Info.vtno = -1; return 0; } return 1; diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index b97757c9b..3d455112c 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -461,7 +461,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) " (0x%08lx,0x%lx) (%s)\n", Base, Size, strerror(errno)); } - DebugF("base: %lx aligned base: %lx\n",base, base + alignOff); + DebugF("base: %lx aligned base: %lx\n",base, (char *)base + alignOff); return (char *)base + alignOff; } #endif /* !(__sparc__) */ @@ -530,6 +530,8 @@ xf86EnableIO(void) return FALSE; } # if !defined(__alpha__) + /* XXX: this is actually not trapping anything because of iopl(3) + * above */ ioperm(0x40,4,0); /* trap access to the timer chip */ ioperm(0x60,4,0); /* trap access to the keyboard controller */ # endif diff --git a/hw/xfree86/os-support/sco/Makefile.am b/hw/xfree86/os-support/sco/Makefile.am deleted file mode 100644 index b5d40f7a5..000000000 --- a/hw/xfree86/os-support/sco/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTRA_DIST = \ - VTsw_sco.c \ - sco_init.c \ - sco_iop.c \ - sco_video.c diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c deleted file mode 100644 index c9194ec8d..000000000 --- a/hw/xfree86/os-support/sco/VTsw_sco.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 1993 by David Wexelblat - * Copyright 1993 by David McCullough - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -/* For the event driver prototypes */ -#include -#include - -/* - * Handle the VT-switching interface for SCO - */ - -/* - * This function is the signal handler for the VT-switching signal. It - * is only referenced inside the OS-support layer. NOTE: we do NOT need - * to re-arm the signal here, since we used sigaction() to set the signal - * disposition in sco_init.c. If we had used signal(), we would need to - * re-arm the signal here. All we need to do now is record the fact that - * we got the signal. XFree86 handles the rest. - */ -void -xf86VTRequest(int sig) -{ - xf86Info.vtRequestsPending = TRUE; - return; -} - -Bool -xf86VTSwitchPending(void) -{ - return xf86Info.vtRequestsPending ? TRUE : FALSE; -} - -/* - * When we switch away, we need to flush and suspend the event driver - * before the VT_RELDISP. We also need to get the current LED status - * and preserve it, so that we can restore it when we come back. - */ -static int sco_ledstatus = -1; -static unsigned int sco_ledstate = 0; - -Bool -xf86VTSwitchAway(void) -{ - ev_flush(); - ev_suspend(); - - sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate); - - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) { - return FALSE; - } else { - return TRUE; - } -} - -/* - * When we come back to the X server, we need to resume the event driver, - * and we need to restore the LED settings to what they were when we - * switched away. - */ -Bool -xf86VTSwitchTo(void) -{ - ev_resume(); - - xf86Info.vtRequestsPending = FALSE; - if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { - return FALSE; - } else { - if (sco_ledstatus >= 0) { - ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate); - } - sco_ledstatus = -1; - - /* - * Convince the console driver this screen is in graphics mode, - * otherwise it assumes it can do more to the screen than it should. - */ - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { - ErrorF("Failed to set graphics mode (%s)\n", strerror(errno)); - } - - return TRUE; - } -} - -Bool -xf86VTActivate(int vtno) -{ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) { - return FALSE; - } - - return TRUE; -} diff --git a/hw/xfree86/os-support/sco/sco_init.c b/hw/xfree86/os-support/sco/sco_init.c deleted file mode 100644 index 3322ed589..000000000 --- a/hw/xfree86/os-support/sco/sco_init.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2001-2005 by J. Kean Johnston - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name J. Kean Johnston not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. J. Kean Johnston makes no - * representations about the suitability of this software for any purpose. - * It is provided "as is" without express or implied warranty. - * - * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* Re-written May 2001 to represent the current state of reality */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include - -#include "compiler.h" - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -static Bool KeepTty = FALSE; -static int VTnum = -1; -static char vtdevice[48]; -static int sco_console_mode = -1; - -extern Bool mpxLock; - -void -xf86OpenConsole(void) -{ - int i, ioctl_ret; - struct vt_mode VT; - struct vid_info vidinf; - struct sigaction sigvtsw; - char *ttn; - - if (serverGeneration == 1) { - /* check if we're run with euid==0 */ - if (geteuid() != 0) { - FatalError("xf86OpenConsole: Server must be setuid root\n"); - } - - /* If we are run in the background we will get SIGTTOU. Ignore it. */ - OsSignal (SIGTTOU, SIG_IGN); - - /* - * Set up the virtual terminal (multiscreen in SCO parlance). - * For the actual console itself, screens are numbered from - * 1 to (usually) 16. However, it is possible to have a nested - * server, and it is also possible to be on a multi-console - * system such as MaxSpeed or SunRiver. Therefore, we should - * not make any assumptions about the TTY name we are on, and - * instead we rely on ttyname() to give us the real TTY name. - * Previously, we tried to determine the TTY name manually. - * This is wrong. The only time we need to futz with the TTY name - * is if we were given the name of a TTY to run on explicity on - * the command line. - */ - - if (VTnum == -1) { - /* - * No device was specified. We need to query the kernel to see which - * console device we are on (and in fact if we are on a console at all). - */ - ttn = ttyname (1); - - if (ttn == (char *)0) { - FatalError ("xf86OpenConsole: Could not determine TTY name: %s\n", - strerror(errno)); - } - strlcpy (vtdevice, ttn, sizeof(vtdevice)); - } else if (VTnum >= 0) { - snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum); - } - - /* - * Now we can dispose of stdin/stdout - */ - fclose (stdin); - fclose (stdout); - - if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NDELAY, 0)) < 0) { - FatalError("xf86OpenConsole: Cannot open %s: %s\n", vtdevice, - strerror(errno)); - } - - /* - * We make 100% sure we use the correct VT number. This can get ugly - * where there are multi-consoles in use, so we make sure we query - * the kernel for the correct VT number. It knows best, we don't. - */ - vidinf.size = sizeof(vidinf); - if (ioctl (xf86Info.consoleFd, CONS_GETINFO, &vidinf) < 0) { - FatalError ("xf86OpenConsole: %s not a console device " - "or error querying device: %s\n", vtdevice, strerror (errno)); - } - xf86Info.vtno = vidinf.m_num; - VTnum = vidinf.m_num + 1; /* 0-based */ - - ErrorF("(using VT%02d device %s)\n\n", VTnum, vtdevice); - - /* We activate the console just in case its not the one we are on */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { - ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno)); - } - - /* Disassociate from controling TTY */ - if (!KeepTty) { - setpgrp(); - } - - /* - * Now we get the current mode that the console device is in. We will - * use this later when we close the console device to restore it to - * that same mode. - */ - if ((sco_console_mode = ioctl(xf86Info.consoleFd, CONS_GET, 0L)) < 0) { - FatalError("xf86OpenConsole: CONS_GET failed on console (%s)\n", - strerror(errno)); - } - - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) { - FatalError("xf86OpenConsole: VT_GETMODE failed (%s)\n", strerror(errno)); - } - - sigvtsw.sa_handler = xf86VTRequest; - sigfillset(&sigvtsw.sa_mask); - sigvtsw.sa_flags = 0; - - /* NOTE: Using sigaction means we dont have to re-arm the signal */ - sigaction(SIGUSR1, &sigvtsw, NULL); - - VT.mode = VT_PROCESS; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - VT.frsig = SIGINT; /* Not implemented */ - VT.waitv = 0; - - /* - * The SCO X server tries the following call 5 times. Lets do the same - * thing. It shouldn't really be required but sometimes things take a - * while to settle down when switching screens. *helpless shrug* I know - * its sucks but ... - */ - - ioctl_ret = 0; - for (i = 0; i < 5; i++) { - ioctl_ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); - if (ioctl_ret >= 0) - break; - usleep(999999); /* Dont use nap() - it forces linking with -lx */ - } - - if (ioctl_ret < 0) { - FatalError("xf86OpenConsole: VT_SETMODE failed (%s)\n", strerror(errno)); - } - - /* - * Convince the console driver we are in graphics mode. - */ - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { - ErrorF("Failed to set graphics mode (%s)\n", strerror(errno)); - } - } else { /* serverGeneration != 1 */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { - ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno)); - } - } -} - -/* - * Restore the console to its previous state. This may cause flicker if - * the screen was previous in a graphics mode, because we first set it - * to text mode. This has the advantage of getting the console driver - * to do a soft reset on the card, which really does help settle the - * video card down again after coming out of Xfree86. - */ -void -xf86CloseConsole(void) -{ - struct vt_mode VT; - struct sigaction sigvtsw; - - /* Set text mode (possibly briefly) */ - ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT0); - - /* Restore the original mode */ - if (sco_console_mode != -1) { - ioctl(xf86Info.consoleFd, MODESWITCH | sco_console_mode, 0L); - } - - ioctl(xf86Info.consoleFd, VT_RELDISP, 1); /* Release the display */ - - sigvtsw.sa_handler = SIG_DFL; - sigfillset(&sigvtsw.sa_mask); - sigvtsw.sa_flags = 0; - - sigaction(SIGUSR1, &sigvtsw, NULL); - - VT.mode = VT_AUTO; - VT.waitv = 0; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - VT.frsig = SIGINT; - ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* Revert to auto handling */ - - close(xf86Info.consoleFd); /* We're done with the device */ -} - -int -xf86ProcessArgument(int argc, char *argv[], int i) -{ - /* - * Keep server from detaching from controlling tty. This is useful - * when debugging (so the server can receive keyboard signals). - */ - if (!strcmp(argv[i], "-keeptty")) { - KeepTty = TRUE; - return 1; - } - - /* - * By default, the X server wants to bind itself to CPU 0. This makes - * sure that the server has full access to the I/O ports at IOPL 3. - * Some SMP systems have trouble with I/O on CPU's other than 0. If, - * however, you have a system that is well behaved, you can specify - * this argument and let the scheduler decide which CPU the server - * should run on. - */ - if (!strcmp(argv[i], "-nompxlock")) { - mpxLock = FALSE; - return 1; - } - - /* - * Specify the VT number to run on (NOT the device). - */ - if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { - if (sscanf(argv[i], "vt%2d", &VTnum) == 0) { - UseMsg(); - VTnum = -1; - return 0; - } - if (VTnum <= 0) { - UseMsg(); - VTnum = -1; - return 0; - } - return 1; - } - - /* - * Use a device the user specifies. - */ - if (!strcmp(argv[i], "-crt")) { - if (++i > argc) { - UseMsg(); - VTnum = -1; - return 0; - } else { - VTnum = -2; - strlcpy (vtdevice, argv[i], sizeof(vtdevice)); - return 2; - } - } - return 0; -} - -void -xf86UseMsg(void) -{ - ErrorF("vtXX use the specified VT number\n"); - ErrorF("-crt DEVICE use the specified VT device\n"); - ErrorF("-nompxlock dont bind X server to CPU 0\n"); - ErrorF("-keeptty "); - ErrorF("don't detach controlling tty (for debugging only)\n"); -} diff --git a/hw/xfree86/os-support/sco/sco_iop.c b/hw/xfree86/os-support/sco/sco_iop.c deleted file mode 100644 index 3da4fcf3a..000000000 --- a/hw/xfree86/os-support/sco/sco_iop.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2001 by J. Kean Johnston - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name J. Kean Johnston not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. J. Kean Johnston makes no - * representations about the suitability of this software for any purpose. - * It is provided "as is" without express or implied warranty. - * - * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "compiler.h" - -#define _NEED_SYSI86 -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86OSpriv.h" -#include "xf86_OSlib.h" - - -/***************************************************************************/ -/* I/O Permissions section */ -/***************************************************************************/ - -/* - * There is a right way and a wrong way of doing this. Unfortunately, we - * are forced to do it the wrong way. The right way is to be told the range - * or ranges of I/O ports the driver(s) need access to, in order to use the - * CONS_IOPERM ioctl() to grant access only to those ports we care about. - * This way we can guarantee some small level of stability because a driver - * does not have access to all ports (which would mean it could play with - * the PIT and thus affect scheduling times, or a whole slew of other - * nasty things). However, because XFree86 currently only enables or disables - * ALL port access, we need to run at IOPL 3, which basically means the - * X Server runs at the same level as the kernel. You can image why this is - * unsafe. Oh, and this is not a problem unique to OSR5, other OSes are - * affected by this as well. - * - * So, for the time being, we change our IOPL until such time as the XFree86 - * architecture is changed to allow for tighter control of I/O ports. If and - * when it is, then the CONS_ADDIOP/DELIOP ioctl() should be used to enable - * or disable access to the desired ports. - */ - -extern long sysi86 (int cmd, ...); - -static Bool IOEnabled = FALSE; - -Bool -xf86EnableIO(void) -{ - if (IOEnabled) - return TRUE; - - if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) { - xf86Msg(X_WARNING,"Failed to set IOPL for extended I/O\n"); - return FALSE; - } - - IOEnabled = TRUE; - return TRUE; -} - -void -xf86DisableIO(void) -{ - if (!IOEnabled) - return; - - sysi86(SI86V86, V86SC_IOPL, 0); - IOEnabled = FALSE; -} diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c deleted file mode 100644 index f63b71df8..000000000 --- a/hw/xfree86/os-support/sco/sco_video.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2001 by J. Kean Johnston - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name J. Kean Johnston not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. J. Kean Johnston makes no - * representations about the suitability of this software for any purpose. - * It is provided "as is" without express or implied warranty. - * - * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* Re-written May 2001 to represent the current state of reality */ - -/* - * This file contains the completely re-written SCO OpenServer video - * routines for XFree86 4.x. Much of this is based on the SCO X server - * code (which is an X11R5 server) and will probably only work on - * OpenServer versions 5.0.5, 5.0.6 and later. Please send me (jkj@sco.com) - * email if you have any questions. - * - * Ideally, you should use OSR5.0.6A or later, with the updated console - * driver for 5.0.6A (its the default driver in 5.0.7 and later). - * However, if you are running on an older system, this code will detect - * that and adjust accordingly. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "input.h" -#include "scrnintstr.h" - -#define _NEED_SYSI86 -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86OSpriv.h" -#include "xf86_OSlib.h" - -#include -#define MPXNAME "/dev/atp1" -#define BASECPU 1 - -Bool mpxLock = TRUE; - -#define USE_VASMETHOD 1 - -/***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -static int sco_mcdone = 0, sco_ismc = 0; - -/***************************************************************************/ -/* - * To map the video memory, we first need to see if we are on a multi-console - * system. If we are, we need to try to use an existing video class in the - * kernel. We do this by retrieving the list of currently defined classes - * (via the new CONS_GETCLASS ioctl()) to see if we have a class that will - * match the range of memory we desire. If we can't find one, we have an - * error and we abort. - * - * If we are not using a multi-console, we can simply use mmap() to map in - * the frame buffer, using the classs-access method as a fall-back only if - * the mmap() fails (it shouldn't). We always set the appropriate pointers - * in the config structure to point ot the right function to map and unmap - * the video memory. An alternative to using mmap() is to use the new - * CONS_ADDVAS call, which will use vasmalloc() and vasbind() in the kernel - * to map the physical address to a virtual one, which it then returns. - * I am not 100% sure if this is faster or not, but it may prove easier to - * debug things. Just to be on the safe side, I have included both methods - * here, and the mmap() method can be used by setting USE_VASMETHOD to 0 - * above. - */ - -#if !defined(CONS_ADDVAS) -# undef USE_VASMETHOD -# define USE_VASMETHOD 0 -#endif - -static int -scoIsMultiConsole (void) -{ - int x; - - if (sco_mcdone) - return sco_ismc; - x = access ("/usr/lib/vidconf/.multiconsole", F_OK); - if (x == 0) - sco_ismc = 1; - sco_mcdone = 1; - return sco_ismc; -} - -/* - * This maps memory using mmap() - */ -static pointer -mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - int fd; - unsigned long realBase, alignOff; - pointer base; - - fd = open (DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); - if (fd < 0) { - FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, - strerror(errno)); - return 0; /* NOTREACHED */ - } - - realBase = Base & ~(getpagesize() - 1); - alignOff = Base - realBase; - - DebugF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff); - - base = mmap((caddr_t)0, Size + alignOff, - (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, (off_t)realBase); - close(fd); - if (base == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap framebuffer (0x%08x,0x%x) (%s)\n", - Base, Size, strerror(errno)); - return 0; /* NOTREACHED */ - } - - DebugF("base: %lx aligned base: %lx\n",base, base + alignOff); - return (pointer)((char *)base + alignOff); -} - -#if (USE_VASMETHOD) -/* - * This maps memory using the virtual address space (VAS) console calls. - */ -static pointer -mapVidMemVAS(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - struct vidvasmem vas; - pointer base; - - vas.base = (long)Base; - vas.size = (long)Size; - - base = (pointer)ioctl (xf86Info.consoleFd, CONS_ADDVAS, &vas); - if (base == (pointer)-1) { - return mapVidMemMMAP(ScreenNum, Base, Size, flags); - } - return base; -} -#endif /* USE_VASMETHOD */ - -struct vidclass vidclasslist[] = { - { "VBE", "", 0xf0000000, 0x2000000, 0 }, - { "P9000", "", 0xc0000000, 0x400000, 0 }, - { "TULIP", "", 0x80000000, 0x400000, 0 }, - { "VIPER", "", 0xa0000000, 0x400000, 0 }, - { "S3T", "", 0xa0000000, 0x200000, 0 }, - { "S3DT", "", 0x4000000, 0x400000, 0 }, - { "MGA", "", 0x2200000, 0x4000, 0 }, - { "CLVGA", "", 0xa0000, 0x20000, 0 }, - { "OLIVE", "", 0xd8000000, 0x400000, 0 }, - { "S3C", "", 0xa0000, 0x10000, 0 }, - { "MGAVLB", "", 0xac000, 0x34000, 0 }, - { "ATI8514", "", 0xFF000, 0x1000, 0 }, - { "GXREGS", "", 0xb0000, 0x10000, 0 }, - { "GX", "", 0xa0000, 0x10000, 0 }, - { "CT64300", "", 0xa0000000, 0x400000, 0 }, - { "SVGA", "", 0xa0000, 0x20000, 0 }, - { "S3V", "", 0xa0000000, 0x400000, 0 }, - { "8514A", "", 0xFF000, 0x1000, 0 }, - { "VGA", "", 0xa0000, 0x10000, 0 }, - { 0 } -}; - -static pointer -mapVidMemVC(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - struct vidclass *vcp; - char *class = NULL; - pointer base; - - for (vcp = vidclasslist; vcp->name; vcp++) { - if ((vcp->base == Base) && (vcp->size == Size)) { - class = vcp->name; - break; - } - } - - if (class == NULL) { - /* - * As a fall-back, we will try and use the mmap() approach. This may - * prove to be the wrong thing to do, but time and testing will tell. - */ - ErrorF("xf86MapVidMem: No class map defined for (0x%08x,0x%08x)\n", Base, Size); -#if USE_VASMETHOD - return mapVidMemVAS(ScreenNum, Base, Size, flags); -#else /* !USE_VASMETHOD */ - return mapVidMemMMAP(ScreenNum, Base, Size, flags); -#endif - } - - /* - * We found a suitable class. Try and use it. - */ - base = (pointer)ioctl(xf86Info.consoleFd, MAP_CLASS, class); - if ((int)base == -1) { - FatalError("xf86MapVidMem: Failed to map video memory class `%s'\n", class); - return 0; /* NOTREACHED */ - } - - return base; -} - -/* - * Unmapping the video memory is easy. We always call munmap(), as it is - * safe to do so even if we haven't actually mapped in any pages via mmap(). - * In the case where we used the video class, we don't need to do anything - * as the kernel will clean up the TSS when we exit, and will undo the - * vasbind() that was done when the class was originally mapped. If we used - * vasmap, we simply undo the map. Again, it is benign to call vasunmap - * even if we got the frame buffer via some other mechanism (like mmap). - */ - -static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) -{ -#if USE_VASMETHOD - struct vidvasmem vas; - int x; - - vas.base = (long)Base; - vas.size = (long)Size; - - x = ioctl (xf86Info.consoleFd, CONS_DELVAS, &vas); - if (x == 0) - return; -#endif /* USE_VASMETHOD */ - - munmap(Base, Size); -} - -/* - * Set things up to point to our local functions. When the kernel gets - * MTRR support, we will need to add the required functions for that - * here too. MTRR support will most likely appear in 5.0.8 or 5.1.0. - * - * We also want to lock the X server process to the base CPU in an MPX - * system, since we will be going to IOPL 3. Most engine drivers can cope - * with I/O access on any CPU but there are a few (AST Manhattan I believe) - * that can't, so the server needs to be locked to CPU0. - */ -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - int mpx_fd; - - if (scoIsMultiConsole ()) { - pVidMem->mapMem = mapVidMemVC; - } else { -#if USE_VASMETHOD - pVidMem->mapMem = mapVidMemVAS; -#else - pVidMem->mapMem = mapVidMemMMAP; -#endif - } - - pVidMem->unmapMem = unmapVidMem; - pVidMem->linearSupported = TRUE; - pVidMem->initialised = TRUE; - - if (mpxLock && (mpx_fd = open (MPXNAME, O_RDONLY)) > 0) { - if (ioctl (mpx_fd, ACPU_XLOCK, BASECPU) < 0) - ErrorF ("xf86OSInitVidMem: Can not bind to CPU 0 (%s)\n", - strerror(errno)); - close (mpx_fd); - } -} - diff --git a/hw/xfree86/os-support/shared/VTsw_usl.c b/hw/xfree86/os-support/shared/VTsw_usl.c index d4ef0f713..818de1713 100644 --- a/hw/xfree86/os-support/shared/VTsw_usl.c +++ b/hw/xfree86/os-support/shared/VTsw_usl.c @@ -31,10 +31,6 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" -#ifdef OSHEADER -# include OSHEADER -#endif - /* * Handle the VT-switching interface for OSs that use USL-style ioctl()s * (the sysv, sco, and linux subdirs). @@ -63,16 +59,9 @@ xf86VTSwitchAway(void) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) - { return FALSE; - } else - { -#ifdef OSSWITCHAWAY - OSSWITCHAWAY; -#endif return TRUE; - } } Bool @@ -80,13 +69,9 @@ xf86VTSwitchTo(void) { xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) - { return FALSE; - } else - { return TRUE; - } } Bool diff --git a/hw/xfree86/os-support/solaris/solaris-amd64.S b/hw/xfree86/os-support/solaris/solaris-amd64.S index 94ffa40e7..4cc0642dd 100644 --- a/hw/xfree86/os-support/solaris/solaris-amd64.S +++ b/hw/xfree86/os-support/solaris/solaris-amd64.S @@ -1,4 +1,4 @@ -/ Copyright 2005 Sun Microsystems, Inc. All rights reserved. +/ Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. / / Permission is hereby granted, free of charge, to any person obtaining a / copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/solaris-ia32.S b/hw/xfree86/os-support/solaris/solaris-ia32.S index 4dadf7ffd..74d787d31 100644 --- a/hw/xfree86/os-support/solaris/solaris-ia32.S +++ b/hw/xfree86/os-support/solaris/solaris-ia32.S @@ -1,4 +1,4 @@ -/ Copyright 2004 Sun Microsystems, Inc. All rights reserved. +/ Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. / / Permission is hereby granted, free of charge, to any person obtaining a / copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S index 0f6d694fd..0ecafb352 100644 --- a/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S +++ b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S @@ -1,4 +1,4 @@ -/* Copyright 2004 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c index cff279e0c..e6f31879b 100644 --- a/hw/xfree86/os-support/solaris/sun_VTsw.c +++ b/hw/xfree86/os-support/solaris/sun_VTsw.c @@ -1,5 +1,5 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c index 9db5d6368..a4517d666 100644 --- a/hw/xfree86/os-support/solaris/sun_agp.c +++ b/hw/xfree86/os-support/solaris/sun_agp.c @@ -6,7 +6,7 @@ * Copyright 2000 VA Linux Systems, Inc. * Copyright 2001 The XFree86 Project, Inc. */ -/* Copyright 2005 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -318,7 +318,7 @@ xf86EnableAGP(int screenNum, CARD32 mode) if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: " "AGPIOC_SETUP with mode %x failed (%s)\n", - mode, strerror(errno)); + (unsigned int) mode, strerror(errno)); return FALSE; } diff --git a/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c index 23e14f17e..55081b6d1 100644 --- a/hw/xfree86/os-support/solaris/sun_apm.c +++ b/hw/xfree86/os-support/solaris/sun_apm.c @@ -27,7 +27,7 @@ * XFree86 Project. */ -/* Copyright 2005 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c index bab391372..b59835e53 100644 --- a/hw/xfree86/os-support/solaris/sun_bell.c +++ b/hw/xfree86/os-support/solaris/sun_bell.c @@ -1,4 +1,4 @@ -/* Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2004-2005, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c index edcc60b88..281a6df9f 100644 --- a/hw/xfree86/os-support/solaris/sun_init.c +++ b/hw/xfree86/os-support/solaris/sun_init.c @@ -71,7 +71,6 @@ xf86OpenConsole(void) int fd; struct vt_mode VT; struct vt_stat vtinfo; - int FreeVTslot; MessageType from = X_PROBED; #endif @@ -95,8 +94,8 @@ xf86OpenConsole(void) } else { - if ((int)mmap(0, 0x1000, PROT_NONE, - MAP_FIXED | MAP_SHARED, fd, 0) == -1) + if (mmap(0, 0x1000, PROT_NONE, + MAP_FIXED | MAP_SHARED, fd, 0) == MAP_FAILED) xf86Msg(X_WARNING, "xf86OpenConsole: failed to protect page 0 (%s)\n", strerror(errno)); @@ -413,7 +412,7 @@ xf86ProcessArgument(int argc, char **argv, int i) return 0; } -void xf86UseMsg() +void xf86UseMsg(void) { #ifdef HAS_USL_VTS ErrorF("vtX Use the specified VT number\n"); diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c index 5089ae74d..f99bac517 100644 --- a/hw/xfree86/os-support/solaris/sun_vid.c +++ b/hw/xfree86/os-support/solaris/sun_vid.c @@ -22,7 +22,7 @@ * OF THIS SOFTWARE. * */ -/* Copyright 2008 Sun Microsystems, Inc. All rights reserved. +/* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -157,7 +157,7 @@ solUnMapVidMem(int ScreenNum, pointer Base, unsigned long Size) if (munmap(Base, Size) != 0) { xf86DrvMsgVerb(ScreenNum, X_WARNING, 0, "solUnMapVidMem: failed to unmap %s" - " (0x%08lx,0x%lx) (%s)\n", + " (0x%p,0x%lx) (%s)\n", apertureDevName, Base, Size, strerror(errno)); } @@ -212,8 +212,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, (void)memcpy(Buf, (void *)(ptr + Offset), Len); if (munmap((caddr_t)ptr, mlen) != 0) { xf86MsgVerb(X_WARNING, 0, - "solUnMapVidMem: failed to unmap %s" - " (0x%08lx,0x%lx) (%s)\n", + "xf86ReadBIOS: failed to unmap %s (0x%p,0x%x) (%s)\n", apertureDevName, ptr, mlen, strerror(errno)); } diff --git a/hw/xfree86/os-support/sysv/Makefile.am b/hw/xfree86/os-support/sysv/Makefile.am deleted file mode 100644 index e86e70ad1..000000000 --- a/hw/xfree86/os-support/sysv/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = sysv_init.c sysv_video.c diff --git a/hw/xfree86/os-support/sysv/sysv_init.c b/hw/xfree86/os-support/sysv/sysv_init.c deleted file mode 100644 index 9a423ffa5..000000000 --- a/hw/xfree86/os-support/sysv/sysv_init.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany - * Copyright 1993 by David Wexelblat - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Thomas Roell and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. Thomas Roell and - * David Wexelblat makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include - -#include "compiler.h" - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" - -static Bool KeepTty = FALSE; -#ifdef SVR4 -static Bool Protect0 = FALSE; -#endif -static int VTnum = -1; - - -void -xf86OpenConsole() -{ - int fd; - struct vt_mode VT; - char vtname1[10],vtname2[10]; - MessageType from = X_PROBED; - - if (serverGeneration == 1) - { - /* check if we're run with euid==0 */ - if (geteuid() != 0) - { - FatalError("xf86OpenConsole: Server must be suid root\n"); - } - -#ifdef SVR4 - /* Protect page 0 to help find NULL dereferencing */ - /* mprotect() doesn't seem to work */ - if (Protect0) - { - int fd = -1; - - if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0) - { - xf86Msg(X_WARNING, - "xf86OpenConsole: cannot open /dev/zero (%s)\n", - strerror(errno)); - } - else - { - if ((int)mmap(0, 0x1000, PROT_NONE, - MAP_FIXED | MAP_SHARED, fd, 0) == -1) - { - xf86Msg(X_WARNING, - "xf86OpenConsole: failed to protect page 0 (%s)\n", - strerror(errno)); - } - close(fd); - } - } -#endif - /* - * setup the virtual terminal manager - */ - if (VTnum != -1) - { - xf86Info.vtno = VTnum; - from = X_CMDLINE; - } - else - { - if ((fd = open("/dev/console",O_WRONLY,0)) < 0) - { - FatalError( - "xf86OpenConsole: Cannot open /dev/console (%s)\n", - strerror(errno)); - } - if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || - (xf86Info.vtno == -1)) - { - FatalError("xf86OpenConsole: Cannot find a free VT\n"); - } - close(fd); - } - xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); - - sprintf(vtname1,"/dev/vc%02d",xf86Info.vtno); /* ESIX */ - sprintf(vtname2,"/dev/vt%02d",xf86Info.vtno); /* rest of the world */ - - if (!KeepTty) - { - setpgrp(); - } - - if (((xf86Info.consoleFd = open(vtname1, O_RDWR|O_NDELAY, 0)) < 0) && - ((xf86Info.consoleFd = open(vtname2, O_RDWR|O_NDELAY, 0)) < 0)) - { - FatalError("xf86OpenConsole: Cannot open %s (%s) (%s)\n", - vtname2, vtname1, strerror(errno)); - } - - /* change ownership of the vt */ - if (chown(vtname1, getuid(), getgid()) < 0) - { - chown(vtname2, getuid(), getgid()); - } - - /* - * now get the VT - */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); - } - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); - } - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) - { - FatalError("xf86OpenConsole: VT_GETMODE failed\n"); - } - - signal(SIGUSR1, xf86VTRequest); - - VT.mode = VT_PROCESS; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) - { - FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); - } - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) - { - FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); - } - } - else - { - /* serverGeneration != 1 */ - /* - * now get the VT - */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); - } - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); - } - /* - * If the server doesn't have the VT when the reset occurs, - * this is to make sure we don't continue until the activate - * signal is received. - */ - if (!xf86Screens[0]->vtSema) - sleep(5); - } - return; -} - -void -xf86CloseConsole() -{ - struct vt_mode VT; - -#if 0 - ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno); - ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0); -#endif - ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) - { - VT.mode = VT_AUTO; - ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ - } - close(xf86Info.consoleFd); /* make the vt-manager happy */ - return; -} - -int -xf86ProcessArgument(int argc, char *argv[], int i) -{ - /* - * Keep server from detaching from controlling tty. This is useful - * when debugging (so the server can receive keyboard signals. - */ - if (!strcmp(argv[i], "-keeptty")) - { - KeepTty = TRUE; - return 1; - } -#ifdef SVR4 - /* - * Undocumented flag to protect page 0 from read/write to help - * catch NULL pointer dereferences. This is purely a debugging - * flag. - */ - if (!strcmp(argv[i], "-protect0")) - { - Protect0 = TRUE; - return 1; - } -#endif - if ((argv[i][0] == 'v') && (argv[i][1] == 't')) - { - if (sscanf(argv[i], "vt%2d", &VTnum) == 0) - { - UseMsg(); - VTnum = -1; - return 0; - } - return 1; - } - return 0; -} - -void -xf86UseMsg() -{ - ErrorF("vtXX use the specified VT number\n"); - ErrorF("-keeptty "); - ErrorF("don't detach controlling tty (for debugging only)\n"); - return; -} diff --git a/hw/xfree86/os-support/sysv/sysv_video.c b/hw/xfree86/os-support/sysv/sysv_video.c deleted file mode 100644 index 480abe5f9..000000000 --- a/hw/xfree86/os-support/sysv/sysv_video.c +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany - * Copyright 1993 by David Wexelblat - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Thomas Roell and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. Thomas Roell and - * David Wexelblat makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#define _NEED_SYSI86 -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "xf86OSpriv.h" - -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) -#endif - -#ifndef SI86IOPL -#define SET_IOPL() sysi86(SI86V86,V86SC_IOPL,PS_IOPL) -#define RESET_IOPL() sysi86(SI86V86,V86SC_IOPL,0) -#else -#define SET_IOPL() sysi86(SI86IOPL,3) -#define RESET_IOPL() sysi86(SI86IOPL,0) -#endif - -/***************************************************************************/ -/* Video Memory Mapping section */ -/***************************************************************************/ - -/* - * XXX Support for SVR3 will need to be reworked if needed. In particular - * the Region parameter is no longer passed, and will need to be dealt - * with internally if required. - * OK, i'll rework that thing ... (clean it up a lot) - * SVR3 Support only with SVR3_MMAPDRV (mr) - * - */ - -#ifdef HAS_SVR3_MMAPDRV -#ifndef MMAP_DEBUG -#define MMAP_DEBUG 3 -#endif - -struct kd_memloc MapDSC; -int mmapFd = -2; - -static int -mmapStat(pointer Base, unsigned long Size) { - - int nmmreg,i=0,region=-1; - mmapinfo_t *ibuf; - - nmmreg = ioctl(mmapFd, GETNMMREG); - - if(nmmreg <= 0) - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "\nNo physical memory mapped currently.\n\n"); - else { - if((ibuf = (mmapinfo_t *)malloc(nmmreg*sizeof(mmapinfo_t))) == NULL) - xf86Msg(X_WARNING, - "Couldn't allocate memory 4 mmapinfo_t\n"); - else { - if(ioctl(mmapFd, GETMMREG, ibuf) != -1) - { - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "# mmapStat: [Size=%x,Base=%x]\n", Size, Base); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "# Physical Address Size Reference Count\n"); - for(i = 0; i < nmmreg; i++) { - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "%-4d 0x%08X %5dk %5d ", - i, ibuf[i].physaddr, ibuf[i].length/1024, ibuf[i].refcnt); - if (ibuf[i].physaddr == Base || ibuf[i].length == Size ) { - xf86MsgVerb(X_INFO, MMAP_DEBUG,"MATCH !!!"); - if (region==-1) region=i; - } - xf86ErrorFVerb(MMAP_DEBUG, "\n"); - } - xf86ErrorFVerb(MMAP_DEBUG, "\n"); - } - free(ibuf); - } - } - if (region == -1 && nmmreg > 0) region=region * i; - return region; -} -#endif - - -static Bool -linearVidMem() -{ -#ifdef SVR4 - return TRUE; -#elif defined(HAS_SVR3_MMAPDRV) - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "# xf86LinearVidMem: MMAP 2.2.2 called\n"); - - if(mmapFd >= 0) return TRUE; - - if ((mmapFd = open("/dev/mmap", O_RDWR)) != -1) - { - if(ioctl(mmapFd, GETVERSION) < 0x0222) { - xf86Msg(X_WARNING, - "xf86LinearVidMem: MMAP 2.2.2 or above required\n"); - xf86ErrorF("\tlinear memory access disabled\n"); - return FALSE; - } - return TRUE; - } - xf86Msg(X_WARNING, "xf86LinearVidMem: failed to open /dev/mmap (%s)\n", - strerror(errno)); - xf86ErrorF("\tlinear memory access disabled\n"); - return FALSE; -#endif -} - -static pointer -mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) -{ - pointer base; - int fd; - -#if defined(SVR4) - fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); - if (fd < 0) - { - FatalError("xf86MapVidMem: failed to open %s (%s)\n", - DEV_MEM, strerror(errno)); - } - base = mmap((caddr_t)0, Size, - (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, (off_t)Base); - close(fd); - if (base == MAP_FAILED) - { - FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n", - "xf86MapVidMem", Size, Base, strerror(errno)); - } -#else /* SVR4 */ -#ifdef HAS_SVR3_MMAPDRV - - xf86MsgVerb(X_INFO, MMAP_DEBUG, "# xf86MapVidMem: MMAP 2.2.2 called\n"); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION)); - if (ioctl(mmapFd, GETVERSION) == -1) - { - xf86LinearVidMem(); - } - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION)); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "xf86MapVidMem: Screen: %d\n", ScreenNum); - mmapStat(Base,Size); - /* To force the MMAP driver to provide the address */ - base = (pointer)0; - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "xf86MapVidMem: [s=%x,a=%x]\n", Size, Base); - MapDSC.vaddr = (char *)base; - MapDSC.physaddr = (char *)Base; - MapDSC.length = Size; - MapDSC.ioflg = 1; - if(mmapFd >= 0) - { - if((base = (pointer)ioctl(mmapFd, MAP, &MapDSC)) == (pointer)-1) - { - FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n", - "xf86MapVidMem", Size, Base, strerror(errno)); - /* NOTREACHED */ - } - - /* Next time we want the same address! */ - MapDSC.vaddr = (char *)base; - } - - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "MapDSC.vaddr : 0x%x\n", MapDSC.vaddr); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "MapDSC.physaddr: 0x%x\n", MapDSC.physaddr); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "MapDSC.length : %d\n", MapDSC.length); - mmapStat(Base,Size); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "xf86MapVidMem: [s=%x,a=%x,b=%x]\n", Size, Base, base); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "xf86MapVidMem: SUCCEED Mapping FrameBuffer \n"); -#endif /* HAS_SVR3_MMAPDRV */ -#endif /* SVR4 */ - return base; -} - -/* ARGSUSED */ -static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) -{ -#if defined (SVR4) - munmap(Base, Size); -#else /* SVR4 */ -#ifdef HAS_SVR3_MMAPDRV - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "# xf86UnMapVidMem: UNMapping FrameBuffer\n"); - mmapStat(Base,Size); - ioctl(mmapFd, UNMAPRM , Base); - mmapStat(Base,Size); - xf86MsgVerb(X_INFO, MMAP_DEBUG, - "# xf86UnMapVidMem: Screen: %d [v=%x]\n", ScreenNum, Base); -#endif /* HAS_SVR3_MMAPDRV */ -#endif /* SVR4 */ - return; -} - -#if defined(SVR4) && defined(__i386__) && !defined(sun) -/* - * For some SVR4 versions, a 32-bit read is done for the first location - * in each page when the page is first mapped. If this is done while - * memory access is enabled for regions that have read side-effects, - * this can cause unexpected results, including lockups on some hardware. - * This function is called to make sure each page is mapped while it is - * safe to do so. - */ - -/* - * XXX Should get this the correct way (see os/xalloc.c), but since this is - * for one platform I'll be lazy. - */ -#define X_PAGE_SIZE 4096 - -static void -readSideEffects(int ScreenNum, pointer Base, unsigned long Size) -{ - unsigned long base, end, addr; - CARD32 val; - - base = (unsigned long)Base; - end = base + Size; - - for (addr = base; addr < end; addr += X_PAGE_SIZE) - val = *(volatile CARD32 *)addr; -} -#endif - -void -xf86OSInitVidMem(VidMemInfoPtr pVidMem) -{ - pVidMem->linearSupported = linearVidMem(); - pVidMem->mapMem = mapVidMem; - pVidMem->unmapMem = unmapVidMem; -#if defined(SVR4) && defined(__i386__) && !defined(sun) - pVidMem->readSideEffects = readSideEffects; -#endif - pVidMem->initialised = TRUE; -} - -/***************************************************************************/ -/* I/O Permissions section */ -/***************************************************************************/ - -static Bool ExtendedEnabled = FALSE; -static Bool InitDone = FALSE; - -Bool -xf86EnableIO() -{ - int i; - - if (ExtendedEnabled) - return TRUE; - - if (SET_IOPL() < 0) - { - xf86Msg(X_WARNING, - "xf86EnableIO: Failed to set IOPL for extended I/O\n"); - return FALSE; - } - ExtendedEnabled = TRUE; - - return TRUE; -} - -void -xf86DisableIO() -{ - if (!ExtendedEnabled) - return; - - RESET_IOPL(); - ExtendedEnabled = FALSE; - - return; -} diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index c53fc0dac..24c92fbbc 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -85,22 +85,11 @@ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ (defined(sun) || defined(__i386__)) -# ifdef SCO325 -# ifndef _SVID3 -# define _SVID3 -# endif -# ifndef _NO_STATIC -# define _NO_STATIC -# endif -# endif # include # include # include # include # include -# if defined(__SCO__) -# include -# endif # include @@ -140,15 +129,7 @@ # if !defined(sun) # include # endif -# if defined(SCO325) -# include -# include -# include -# include -# define LED_CAP CLKED -# define LED_NUM NLKED -# define LED_SCR SLKED -# elif defined(HAS_USL_VTS) +# if defined(HAS_USL_VTS) # if !defined(sun) # include # endif @@ -177,20 +158,12 @@ # define VT_ACKACQ 2 # endif /* !VT_ACKACQ */ -# if defined(__SCO__) -# include -# define POSIX_TTY -# endif /* __SCO__ */ -# if defined(SVR4) || defined(SCO325) +# if defined(SVR4) # include # if !(defined(sun) && defined (SVR4)) # define DEV_MEM "/dev/pmem" # endif -# ifdef SCO325 -# undef DEV_MEM -# define DEV_MEM "/dev/mem" -# endif # define CLEARDTR_SUPPORT # define POSIX_TTY # endif /* SVR4 */ @@ -291,14 +264,6 @@ # define CONSOLE_X_MODE_OFF PCCONIOCCOOK # define CONSOLE_X_BELL PCCONIOCBEEP # else /* __bsdi__ */ -# if defined(__OpenBSD__) -# ifdef PCCONS_SUPPORT -# include -# undef CONSOLE_X_MODE_ON -# undef CONSOLE_X_MODE_OFF -# undef CONSOLE_X_BELL -# endif -# endif # ifdef SYSCONS_SUPPORT # define COMPAT_SYSCONS # if defined(__NetBSD__) || defined(__OpenBSD__) @@ -405,6 +370,9 @@ #include /* May need to adjust this for other OSs */ +/* For PATH_MAX */ +#include "misc.h" + /* * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere, * and it's safe, so just do it. @@ -425,14 +393,6 @@ # undef _POSIX_SOURCE #endif /* _POSIX_SOURCE */ -#if !defined(PATH_MAX) -# if defined(MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif /* MAXPATHLEN */ -#endif /* !PATH_MAX */ - #ifndef DEV_MEM #define DEV_MEM "/dev/mem" diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index a9149c243..7a0794bb0 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -61,8 +61,8 @@ #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" -#include #include +#include "Xprintf.h" extern LexRec val; @@ -143,9 +143,8 @@ xf86parseFlagsSection (void) } else { if (tokentype != NUMBER) Error (NUMBER_MSG, tmp); - valstr = malloc(16); - if (valstr) - sprintf(valstr, "%d", val.num); + if (asprintf(&valstr, "%d", val.num) == -1) + valstr = NULL; } } ptr->flg_option_lst = xf86addNewOption @@ -426,13 +425,9 @@ char * xf86uLongToString(unsigned long i) { char *s; - int l; - l = ceil(log10((double)i) + 2.5); - s = malloc(l); - if (!s) + if (asprintf(&s, "%lu", i) == -1) return NULL; - sprintf(s, "%lu", i); return s; } diff --git a/hw/xfree86/parser/InputClass.c b/hw/xfree86/parser/InputClass.c index 9f88e7ee4..3f801700e 100644 --- a/hw/xfree86/parser/InputClass.c +++ b/hw/xfree86/parser/InputClass.c @@ -52,6 +52,7 @@ xf86ConfigSymTabRec InputClassTab[] = {MATCH_USBID, "matchusbid"}, {MATCH_DRIVER, "matchdriver"}, {MATCH_TAG, "matchtag"}, + {MATCH_LAYOUT, "matchlayout"}, {MATCH_IS_KEYBOARD, "matchiskeyboard"}, {MATCH_IS_POINTER, "matchispointer"}, {MATCH_IS_JOYSTICK, "matchisjoystick"}, @@ -94,6 +95,7 @@ xf86parseInputClassSection(void) list_init(&ptr->match_usbid); list_init(&ptr->match_driver); list_init(&ptr->match_tag); + list_init(&ptr->match_layout); while ((token = xf86getToken(InputClassTab)) != ENDSECTION) { switch (token) { @@ -169,6 +171,12 @@ xf86parseInputClassSection(void) add_group_entry(&ptr->match_tag, xstrtokenize(val.str, TOKEN_SEP)); break; + case MATCH_LAYOUT: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "MatchLayout"); + add_group_entry(&ptr->match_layout, + xstrtokenize(val.str, TOKEN_SEP)); + break; case MATCH_IS_KEYBOARD: if (xf86getSubToken(&(ptr->comment)) != STRING) Error(QUOTE_MSG, "MatchIsKeyboard"); @@ -307,6 +315,13 @@ xf86printInputClassSection (FILE * cf, XF86ConfInputClassPtr ptr) *cur); fprintf(cf, "\"\n"); } + list_for_each_entry(group, &ptr->match_layout, entry) { + fprintf(cf, "\tMatchLayout \""); + for (cur = group->values; *cur; cur++) + fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, + *cur); + fprintf(cf, "\"\n"); + } if (ptr->is_keyboard.set) fprintf(cf, "\tIsKeyboard \"%s\"\n", @@ -392,6 +407,12 @@ xf86freeInputClassList (XF86ConfInputClassPtr ptr) free(*list); free(group); } + list_for_each_entry_safe(group, next, &ptr->match_layout, entry) { + list_del(&group->entry); + for (list = group->values; *list; list++) + free(*list); + free(group); + } TestFree(ptr->comment); xf86optionListFree(ptr->option_lst); diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079d4..1cd70e7a5 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -1,6 +1,6 @@ if INSTALL_LIBXF86CONFIG noinst_LTLIBRARIES = libxf86config_internal.la -lib_LIBRARIES = libxf86config.a +lib_LTLIBRARIES = libxf86config.la LIBHEADERS = \ xf86Optrec.h \ xf86Parser.h @@ -30,9 +30,11 @@ INTERNAL_SOURCES= \ libxf86config_internal_la_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_SOURCES = \ +libxf86config_la_SOURCES = \ + $(top_srcdir)/os/xprintf.c \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_la_CFLAGS = $(AM_CFLAGS) +libxf86config_la_LDFLAGS = -static AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\"$(sysconfdir)\" \ diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c index 76c35ae74..970406d4d 100644 --- a/hw/xfree86/parser/Monitor.c +++ b/hw/xfree86/parser/Monitor.c @@ -105,7 +105,6 @@ static xf86ConfigSymTabRec TimingTab[] = {TT_HSKEW, "hskew"}, {TT_BCAST, "bcast"}, {TT_VSCAN, "vscan"}, - {TT_CUSTOM, "CUSTOM"}, {-1, ""}, }; @@ -247,9 +246,6 @@ xf86parseModeLine (void) ptr->ml_vscan = val.num; ptr->ml_flags |= XF86CONF_VSCAN; break; - case TT_CUSTOM: - ptr->ml_flags |= XF86CONF_CUSTOM; - break; case EOF_TOKEN: Error (UNEXPECTED_EOF_MSG, NULL); break; @@ -370,9 +366,6 @@ xf86parseVerboseMode (void) case TT_DBLSCAN: ptr->ml_flags |= XF86CONF_DBLSCAN; break; - case TT_CUSTOM: - ptr->ml_flags |= XF86CONF_CUSTOM; - break; case EOF_TOKEN: Error (UNEXPECTED_EOF_MSG, NULL); break; diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c index 56a26ba74..e8ad290f9 100644 --- a/hw/xfree86/parser/Pointer.c +++ b/hw/xfree86/parser/Pointer.c @@ -62,6 +62,7 @@ #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" +#include "Xprintf.h" extern LexRec val; @@ -99,8 +100,8 @@ static xf86ConfigSymTabRec ZMapTab[] = XF86ConfInputPtr xf86parsePointerSection (void) { - char *s, *s1, *s2; - int l; + char *s; + unsigned long val1; int token; parsePrologue (XF86ConfInputPtr, XF86ConfInputRec) @@ -184,17 +185,12 @@ xf86parsePointerSection (void) case NUMBER: if (val.num < 0) Error (ZAXISMAPPING_MSG, NULL); - s1 = xf86uLongToString(val.num); + val1 = val.num; if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) { - free(s1); Error (ZAXISMAPPING_MSG, NULL); } - s2 = xf86uLongToString(val.num); - l = strlen(s1) + 1 + strlen(s2) + 1; - s = malloc(l); - sprintf(s, "%s %s", s1, s2); - free(s1); - free(s2); + if (asprintf(&s, "%lu %u", val1, val.num) == -1) + s = NULL; break; case XAXIS: s = strdup("x"); diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index e4fce309f..1cff3bc5c 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -77,18 +77,13 @@ #undef _POSIX_SOURCE #endif /* _POSIX_SOURCE */ -#if !defined(PATH_MAX) -#if defined(MAXPATHLEN) -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif /* MAXPATHLEN */ -#endif /* !PATH_MAX */ - #if !defined(MAXHOSTNAMELEN) #define MAXHOSTNAMELEN 32 #endif /* !MAXHOSTNAMELEN */ +/* For PATH_MAX */ +#include "misc.h" + #include "Configint.h" #include "xf86tokens.h" diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 9f0a602ed..a8785c5fa 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -119,7 +119,6 @@ XF86ConfModuleRec, *XF86ConfModulePtr; #define XF86CONF_NCSYNC 0x0100 #define XF86CONF_HSKEW 0x0200 /* hskew provided */ #define XF86CONF_BCAST 0x0400 -#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */ #define XF86CONF_VSCAN 0x1000 typedef struct @@ -359,6 +358,7 @@ typedef struct struct list match_usbid; struct list match_driver; struct list match_tag; + struct list match_layout; xf86TriState is_keyboard; xf86TriState is_pointer; xf86TriState is_joystick; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index ec04e4c7d..abcafcf8e 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -165,7 +165,6 @@ typedef enum { TT_HSKEW, TT_BCAST, TT_VSCAN, - TT_CUSTOM, /* Module tokens */ LOAD, @@ -283,6 +282,7 @@ typedef enum { MATCH_USBID, MATCH_DRIVER, MATCH_TAG, + MATCH_LAYOUT, MATCH_IS_KEYBOARD, MATCH_IS_POINTER, MATCH_IS_JOYSTICK, diff --git a/hw/xfree86/ramdac/Makefile.am b/hw/xfree86/ramdac/Makefile.am index 98e367c88..3c3780516 100644 --- a/hw/xfree86/ramdac/Makefile.am +++ b/hw/xfree86/ramdac/Makefile.am @@ -15,5 +15,5 @@ AM_CFLAGS = -DXAAReverseBitOrder=xf86ReverseBitOrder -DRAMDAC_MODULE \ INCLUDES = $(XORG_INCS) xf86BitOrder.c: - echo "#define XAAReverseBitOrder xf86ReverseBitOrder" > $@ - echo "#include \"$(srcdir)/../xaa/xaaBitOrder.c\"" >> $@ + $(AM_V_GEN)echo "#define XAAReverseBitOrder xf86ReverseBitOrder" > $@ + $(AM_V_GEN)echo "#include \"$(srcdir)/../xaa/xaaBitOrder.c\"" >> $@ diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index ec781aad8..24c91cc37 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -317,8 +317,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, /* only update for VCP, otherwise we get cursor jumps when removing a sprite. The second cursor is never HW rendered anyway. */ - if (pDev == inputInfo.pointer || - (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) + if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { pCurs->refcnt++; if (ScreenPriv->CurrentCursor) @@ -386,8 +385,7 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) /* only update coordinate state for first sprite, otherwise we get jumps when removing a sprite. The second sprite is never HW rendered anyway */ - if (pDev == inputInfo.pointer || - (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) + if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer) { ScreenPriv->x = x; ScreenPriv->y = y; diff --git a/hw/xfree86/utils/Makefile.am b/hw/xfree86/utils/Makefile.am index d27861b03..71f979048 100644 --- a/hw/xfree86/utils/Makefile.am +++ b/hw/xfree86/utils/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ gtf \ - cvt + cvt \ + man diff --git a/hw/xfree86/utils/cvt/.gitignore b/hw/xfree86/utils/cvt/.gitignore index 7816fd7c6..a217c5563 100644 --- a/hw/xfree86/utils/cvt/.gitignore +++ b/hw/xfree86/utils/cvt/.gitignore @@ -1,3 +1 @@ -# Add & Override for this directory and it's subdirectories cvt -cvt.man diff --git a/hw/xfree86/utils/cvt/Makefile.am b/hw/xfree86/utils/cvt/Makefile.am index 6b99cbd5f..4ebcedf39 100644 --- a/hw/xfree86/utils/cvt/Makefile.am +++ b/hw/xfree86/utils/cvt/Makefile.am @@ -1,4 +1,4 @@ -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -27,13 +27,8 @@ INCLUDES = $(XORG_INCS) \ -I$(top_srcdir)/hw/xfree86/parser # gah -cvt_SOURCES = cvt.c $(top_srcdir)/hw/xfree86/modes/xf86cvt.c -cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) - -man1_MANS = cvt.man - -CLEANFILES = $(man1_MANS) +cvt_SOURCES = cvt.c \ + $(top_srcdir)/hw/xfree86/modes/xf86cvt.c \ + $(top_srcdir)/os/xprintf.c -include $(top_srcdir)/cpprules.in - -EXTRA_DIST = cvt.man.pre +cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/utils/cvt/cvt.c b/hw/xfree86/utils/cvt/cvt.c index cf0a479f2..fff500b43 100644 --- a/hw/xfree86/utils/cvt/cvt.c +++ b/hw/xfree86/utils/cvt/cvt.c @@ -25,6 +25,24 @@ #include "xf86.h" +/* Error implementation used by the server code we built in */ +void +Error(const char *str) +{ + perror(str); +} + +/* FatalError implementation used by the server code we built in */ +void +FatalError(const char *f, ...) +{ + va_list args; + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); + exit(1); +} + /* xnfalloc implementation used by the server code we built in */ pointer XNFalloc(unsigned long n) diff --git a/hw/xfree86/utils/gtf/.gitignore b/hw/xfree86/utils/gtf/.gitignore index 9aebbbb60..919c993fb 100644 --- a/hw/xfree86/utils/gtf/.gitignore +++ b/hw/xfree86/utils/gtf/.gitignore @@ -1,3 +1 @@ -# Add & Override for this directory and it's subdirectories gtf -gtf.man diff --git a/hw/xfree86/utils/gtf/Makefile.am b/hw/xfree86/utils/gtf/Makefile.am index d1a6d611c..f77bf608e 100644 --- a/hw/xfree86/utils/gtf/Makefile.am +++ b/hw/xfree86/utils/gtf/Makefile.am @@ -1,4 +1,4 @@ -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -25,20 +25,3 @@ bin_PROGRAMS = gtf gtf_SOURCES = gtf.c gtf_CFLAGS = $(XORG_CFLAGS) gtf_LDADD = -lm - -appmandir = $(APP_MAN_DIR) - -appman_PRE = gtf.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -include $(top_srcdir)/cpprules.in - -EXTRA_DIST = gtf.man.pre -BUILT_SOURCES = $(appman_PRE) -CLEANFILES = $(appman_PRE) $(appman_DATA) - -SUFFIXES += .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - -$(AM_V_at)rm -f $@ - $(AM_V_at)$(LN_S) $< $@ diff --git a/hw/xfree86/utils/man/Makefile.am b/hw/xfree86/utils/man/Makefile.am new file mode 100644 index 000000000..7afc5bcca --- /dev/null +++ b/hw/xfree86/utils/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = cvt.man gtf.man diff --git a/hw/xfree86/utils/cvt/cvt.man.pre b/hw/xfree86/utils/man/cvt.man similarity index 99% rename from hw/xfree86/utils/cvt/cvt.man.pre rename to hw/xfree86/utils/man/cvt.man index 8a292eed8..b380171ee 100644 --- a/hw/xfree86/utils/cvt/cvt.man.pre +++ b/hw/xfree86/utils/man/cvt.man @@ -13,7 +13,7 @@ cvt - calculate VESA CVT mode lines .I Cvt is a utility for calculating VESA Coordinated Video Timing modes. Given the desired horizontal and vertical resolutions, a modeline adhering to the CVT -standard is printed. This modeline can be included in __xservername__ +standard is printed. This modeline can be included in __xservername__ .B __xconfigfile__(__filemansuffix__) . diff --git a/hw/xfree86/utils/gtf/gtf.man.pre b/hw/xfree86/utils/man/gtf.man similarity index 100% rename from hw/xfree86/utils/gtf/gtf.man.pre rename to hw/xfree86/utils/man/gtf.man diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index 7a64a4a71..04132d956 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/hw/xfree86/vbe/vbe.c @@ -395,7 +395,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) i = 0; while (modes[i] != 0xffff) i++; - block->VideoModePtr = malloc(sizeof(CARD16) * i + 1); + block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1)); memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i); block->VideoModePtr[i] = 0xffff; @@ -1028,6 +1028,11 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data) if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh) return; + if (data->hsize < 320 || data->vsize < 240) { + xf86DrvMsg(scrnIndex, X_INFO, "...which I refuse to believe\n"); + return; + } + mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0); pScrn->monitor->nHsync = 1; diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c index 3f2cae5bf..ea24b61cd 100644 --- a/hw/xfree86/vbe/vbeModes.c +++ b/hw/xfree86/vbe/vbeModes.c @@ -356,8 +356,8 @@ VBESetModeNames(DisplayModePtr pMode) pMode->VDisplay > 10000 || pMode->VDisplay < 0) { pMode->name = strdup("BADMODE"); } else { - pMode->name = xnfalloc(4 + 1 + 4 + 1); - sprintf(pMode->name, "%dx%d", pMode->HDisplay, pMode->VDisplay); + XNFasprintf(&pMode->name, "%dx%d", + pMode->HDisplay, pMode->VDisplay); } } pMode = pMode->next; diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c index 21a034712..5d3cac1b4 100644 --- a/hw/xfree86/x86emu/ops.c +++ b/hw/xfree86/x86emu/ops.c @@ -7065,15 +7065,20 @@ Handles opcode 0x9a ****************************************************************************/ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1)) { - u16 farseg, faroff; + u32 farseg, faroff; START_OF_INSTR(); - DECODE_PRINTF("CALL\t"); + DECODE_PRINTF("CALL\t"); + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + faroff = fetch_long_imm(); + farseg = fetch_word_imm(); + } else { faroff = fetch_word_imm(); farseg = fetch_word_imm(); - DECODE_PRINTF2("%04x:", farseg); - DECODE_PRINTF2("%04x\n", faroff); - CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR "); + } + DECODE_PRINTF2("%04x:", farseg); + DECODE_PRINTF2("%04x\n", faroff); + CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR "); /* XXX * @@ -7084,8 +7089,12 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1)) TRACE_AND_STEP(); push_word(M.x86.R_CS); M.x86.R_CS = farseg; - push_word(M.x86.R_IP); - M.x86.R_IP = faroff; + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + push_long(M.x86.R_EIP); + } else { + push_word(M.x86.R_IP); + } + M.x86.R_EIP = faroff & 0xffff; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } @@ -9670,17 +9679,30 @@ Handles opcode 0xe8 ****************************************************************************/ static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1)) { - s16 ip; + s16 ip16; + s32 ip32; START_OF_INSTR(); - DECODE_PRINTF("CALL\t"); - ip = (s16) fetch_word_imm(); - ip += (s16) M.x86.R_IP; /* CHECK SIGN */ - DECODE_PRINTF2("%04x\n", (u16)ip); - CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, ""); + DECODE_PRINTF("CALL\t"); + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + ip32 = (s32) fetch_long_imm(); + ip32 += (s16) M.x86.R_IP; /* CHECK SIGN */ + DECODE_PRINTF2("%04x\n", (u16)ip32); + CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, ""); + } else { + ip16 = (s16) fetch_word_imm(); + ip16 += (s16) M.x86.R_IP; /* CHECK SIGN */ + DECODE_PRINTF2("%04x\n", (u16)ip16); + CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, ""); + } TRACE_AND_STEP(); - push_word(M.x86.R_IP); - M.x86.R_IP = ip; + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + push_long(M.x86.R_EIP); + M.x86.R_EIP = ip32 & 0xffff; + } else { + push_word(M.x86.R_IP); + M.x86.R_EIP = ip16; + } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } @@ -9691,15 +9713,23 @@ Handles opcode 0xe9 ****************************************************************************/ static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1)) { - int ip; + u32 ip; START_OF_INSTR(); DECODE_PRINTF("JMP\t"); - ip = (s16)fetch_word_imm(); - ip += (s16)M.x86.R_IP; - DECODE_PRINTF2("%04x\n", (u16)ip); - TRACE_AND_STEP(); - M.x86.R_IP = (u16)ip; + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + ip = (u32)fetch_long_imm(); + ip += (u32)M.x86.R_EIP; + DECODE_PRINTF2("%08x\n", (u32)ip); + TRACE_AND_STEP(); + M.x86.R_EIP = (u32)ip; + } else { + ip = (s16)fetch_word_imm(); + ip += (s16)M.x86.R_IP; + DECODE_PRINTF2("%04x\n", (u16)ip); + TRACE_AND_STEP(); + M.x86.R_IP = (u16)ip; + } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } @@ -9710,16 +9740,21 @@ Handles opcode 0xea ****************************************************************************/ static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1)) { - u16 cs, ip; + u16 cs; + u32 ip; START_OF_INSTR(); DECODE_PRINTF("JMP\tFAR "); - ip = fetch_word_imm(); + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + ip = fetch_long_imm(); + } else { + ip = fetch_word_imm(); + } cs = fetch_word_imm(); DECODE_PRINTF2("%04x:", cs); DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); - M.x86.R_IP = ip; + M.x86.R_EIP = ip & 0xffff; M.x86.R_CS = cs; DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am index 4ba1f7812..5bfb4e9a8 100644 --- a/hw/xfree86/xaa/Makefile.am +++ b/hw/xfree86/xaa/Makefile.am @@ -25,40 +25,40 @@ libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ $(LSB_FIRST) $(MSB_FIRST) $(LSB_FIXED) $(MSB_FIXED) \ $(LSB_3_FIRST) $(MSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIXED) ${POLYSEG}: - echo "#define POLYSEGMENT" > $@ - echo '#include "$(srcdir)/${@:s-%=%}"' >> $@ + $(AM_V_GEN)echo "#define POLYSEGMENT" > $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:s-%=%}"' >> $@ ${LSB_FIRST}: - echo "#define LSBFIRST" > $@ - echo '#include "$(srcdir)/${@:l-%=%}"' >> $@ + $(AM_V_GEN)echo "#define LSBFIRST" > $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:l-%=%}"' >> $@ ${LSB_3_FIRST}: - echo "#define LSBFIRST" > $@ - echo "#define TRIPLE_BITS" >> $@ - echo '#include "$(srcdir)/${@:l3-%=%}"' >> $@ + $(AM_V_GEN)echo "#define LSBFIRST" > $@ + $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:l3-%=%}"' >> $@ ${LSB_FIXED}: - echo "#define LSBFIRST" > $@ - echo "#define FIXEDBASE" >> $@ - echo '#include "$(srcdir)/${@:lf-%=%}"' >> $@ + $(AM_V_GEN)echo "#define LSBFIRST" > $@ + $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf-%=%}"' >> $@ ${LSB_3_FIXED}: - echo "#define LSBFIRST" > $@ - echo "#define TRIPLE_BITS" >> $@ - echo "#define FIXEDBASE" >> $@ - echo '#include "$(srcdir)/${@:lf3-%=%}"' >> $@ + $(AM_V_GEN)echo "#define LSBFIRST" > $@ + $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ + $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf3-%=%}"' >> $@ ${MSB_FIRST}: - echo "#define MSBFIRST" > $@ - echo '#include "$(srcdir)/${@:m-%=%}"' >> $@ + $(AM_V_GEN)echo "#define MSBFIRST" > $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:m-%=%}"' >> $@ ${MSB_3_FIRST}: - echo "#define MSBFIRST" > $@ - echo "#define TRIPLE_BITS" >> $@ - echo '#include "$(srcdir)/${@:m3-%=%}"' >> $@ + $(AM_V_GEN)echo "#define MSBFIRST" > $@ + $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:m3-%=%}"' >> $@ ${MSB_FIXED}: - echo "#define MSBFIRST" > $@ - echo "#define FIXEDBASE" >> $@ - echo '#include "$(srcdir)/${@:mf-%=%}"' >> $@ + $(AM_V_GEN)echo "#define MSBFIRST" > $@ + $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf-%=%}"' >> $@ ${MSB_3_FIXED}: - echo "#define MSBFIRST" > $@ - echo "#define TRIPLE_BITS" >> $@ - echo "#define FIXEDBASE" >> $@ - echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@ + $(AM_V_GEN)echo "#define MSBFIRST" > $@ + $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ + $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ + $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@ DISTCLEANFILES = $(POLYSEG) \ $(LSB_FIRST) $(LSB_FIXED) $(MSB_FIRST) $(MSB_FIXED) \ diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h index 2af954fee..40b49e540 100644 --- a/hw/xfree86/xaa/xaa.h +++ b/hw/xfree86/xaa/xaa.h @@ -1241,8 +1241,6 @@ typedef struct _XAAInfoRec { GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; CopyWindowProcPtr CopyWindow; - BackingStoreSaveAreasProcPtr SaveAreas; - BackingStoreRestoreAreasProcPtr RestoreAreas; unsigned int offscreenDepths; Bool offscreenDepthsInitialized; diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index 5148ed4a2..049dbfbe7 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -54,10 +54,10 @@ XAABitBlt( origDest.x = dstx; origDest.y = dsty; - if((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) { + if (pSrcDrawable->pScreen->SourceValidate) { (*pSrcDrawable->pScreen->SourceValidate) ( - pSrcDrawable, srcx, srcy, width, height); + pSrcDrawable, srcx, srcy, width, height, + pGC->subWindowMode); } srcx += pSrcDrawable->x; diff --git a/hw/xfree86/xf8_16bpp/Makefile.am b/hw/xfree86/xf8_16bpp/Makefile.am deleted file mode 100644 index 3c5b8c93d..000000000 --- a/hw/xfree86/xf8_16bpp/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -module_LTLIBRARIES = libxf8_16bpp.la - -sdk_HEADERS = cfb8_16.h - -INCLUDES = $(XORG_INCS) -I$(top_srcdir)/fb - -AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) - -libxf8_16bpp_la_LDFLAGS = -avoid-version - -libxf8_16bpp_la_SOURCES = xf8_16module.c diff --git a/hw/xfree86/xf8_16bpp/xf8_16module.c b/hw/xfree86/xf8_16bpp/xf8_16module.c deleted file mode 100644 index 6a4529ae8..000000000 --- a/hw/xfree86/xf8_16bpp/xf8_16module.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2006 Adam Jackson. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "servermd.h" -#include "scrnintstr.h" -#include "resource.h" -#include "fb.h" -#include "fboverlay.h" -#include "cfb8_16.h" - -Bool -cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8, - int xsize, int ysize, int dpix, int dpiy, - int width16, int width8) -{ - return - (fbOverlaySetupScreen(pScreen, pbits16, pbits8, xsize, ysize, - dpix, dpiy, width16, width8, 16, 8) && - fbOverlayFinishScreenInit(pScreen, pbits16, pbits8, xsize, ysize, - dpix, dpiy, width16, width8, 16, 8, 16, 8)); -} - -#include "xf86Module.h" - -static MODULESETUPPROTO(xf8_16bppSetup); - -static XF86ModuleVersionInfo VersRec = { - "xf8_16bpp", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 2, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - NULL, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -_X_EXPORT XF86ModuleData xf8_16bppModuleData = { - &VersRec, - xf8_16bppSetup, - NULL -}; - -static pointer -xf8_16bppSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - return (pointer)LoadSubModule(module, "fb", NULL, NULL, NULL, NULL, - errmaj, errmin); -} diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp index 8f0c83014..cd6d4a983 100644 --- a/hw/xfree86/xorgconf.cpp +++ b/hw/xfree86/xorgconf.cpp @@ -1,73 +1,73 @@ -XCOMM -XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc. -XCOMM -XCOMM Permission is hereby granted, free of charge, to any person obtaining a -XCOMM copy of this software and associated documentation files (the "Software"), -XCOMM to deal in the Software without restriction, including without limitation -XCOMM the rights to use, copy, modify, merge, publish, distribute, sublicense, -XCOMM and/or sell copies of the Software, and to permit persons to whom the -XCOMM Software is furnished to do so, subject to the following conditions: -XCOMM -XCOMM The above copyright notice and this permission notice shall be included in -XCOMM all copies or substantial portions of the Software. -XCOMM -XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -XCOMM THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -XCOMM WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -XCOMM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -XCOMM SOFTWARE. -XCOMM -XCOMM Except as contained in this notice, the name of the XFree86 Project shall -XCOMM not be used in advertising or otherwise to promote the sale, use or other -XCOMM dealings in this Software without prior written authorization from the -XCOMM XFree86 Project. -XCOMM -XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ - -XCOMM ********************************************************************** -XCOMM This is a sample configuration file only, intended to illustrate -XCOMM what a config file might look like. Refer to the __xconfigfile__(__filemansuffix__) -XCOMM man page for details about the format of this file. -XCOMM ********************************************************************** - -XCOMM The ordering of sections is not important in XFree86 4.0 and later, -XCOMM nor in any Xorg release. - -XCOMM ********************************************************************** -XCOMM Files section. This allows default font and module paths to be set -XCOMM ********************************************************************** +# +# Copyright (c) 1994-1998 by The XFree86 Project, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Except as contained in this notice, the name of the XFree86 Project shall +# not be used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization from the +# XFree86 Project. +# +# $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ + +# ********************************************************************** +# This is a sample configuration file only, intended to illustrate +# what a config file might look like. Refer to the xorg.conf(__filemansuffix__) +# man page for details about the format of this file. +# ********************************************************************** + +# The ordering of sections is not important in XFree86 4.0 and later, +# nor in any Xorg release. + +# ********************************************************************** +# Files section. This allows default font and module paths to be set +# ********************************************************************** Section "Files" -XCOMM Multiple FontPath entries are allowed (which are concatenated together), -XCOMM as well as specifying multiple comma-separated entries in one FontPath -XCOMM command (or a combination of both methods). -XCOMM The default path is shown here. +# Multiple FontPath entries are allowed (which are concatenated together), +# as well as specifying multiple comma-separated entries in one FontPath +# command (or a combination of both methods). +# The default path is shown here. -XCOMM FontPath DEFAULTFONTPATH +# FontPath DEFAULTFONTPATH -XCOMM ModulePath can be used to set a search path for the X server modules. -XCOMM The default path is shown here. +# ModulePath can be used to set a search path for the X server modules. +# The default path is shown here. -XCOMM ModulePath MODULEPATH +# ModulePath MODULEPATH EndSection -XCOMM ********************************************************************** -XCOMM Module section -- this is an optional section which is used to specify -XCOMM which run-time loadable modules to load when the X server starts up. -XCOMM ********************************************************************** +# ********************************************************************** +# Module section -- this is an optional section which is used to specify +# which run-time loadable modules to load when the X server starts up. +# ********************************************************************** Section "Module" -XCOMM This loads the DBE extension module. +# This loads the DBE extension module. Load "dbe" -XCOMM This loads the miscellaneous extensions module, and disables -XCOMM initialisation of the XFree86-DGA extension within that module. +# This loads the miscellaneous extensions module, and disables +# initialisation of the XFree86-DGA extension within that module. SubSection "extmod" Option "omit xfree86-dga" @@ -76,53 +76,53 @@ XCOMM initialisation of the XFree86-DGA extension within that module. EndSection -XCOMM ********************************************************************** -XCOMM Server flags section. This contains various server-wide Options. -XCOMM ********************************************************************** +# ********************************************************************** +# Server flags section. This contains various server-wide Options. +# ********************************************************************** Section "ServerFlags" -XCOMM Uncomment this to cause a core dump at the spot where a signal is -XCOMM received. This may leave the console in an unusable state, but may -XCOMM provide a better stack trace in the core dump to aid in debugging +# Uncomment this to cause a core dump at the spot where a signal is +# received. This may leave the console in an unusable state, but may +# provide a better stack trace in the core dump to aid in debugging -XCOMM Option "NoTrapSignals" +# Option "NoTrapSignals" -XCOMM Uncomment this to disable the VT switch sequence -XCOMM (where n is 1 through 12). This allows clients to receive these key -XCOMM events. +# Uncomment this to disable the VT switch sequence +# (where n is 1 through 12). This allows clients to receive these key +# events. -XCOMM Option "DontVTSwitch" +# Option "DontVTSwitch" -XCOMM Uncomment this to disable the server abort sequence -XCOMM This allows clients to receive this key event. +# Uncomment this to disable the server abort sequence +# This allows clients to receive this key event. -XCOMM Option "DontZap" "false" +# Option "DontZap" "false" -XCOMM Uncomment this to disable the / mode switching -XCOMM sequences. This allows clients to receive these key events. +# Uncomment this to disable the / mode switching +# sequences. This allows clients to receive these key events. -XCOMM Option "DontZoom" +# Option "DontZoom" -XCOMM Uncomment this to disable tuning with the xvidtune client. With -XCOMM it the client can still run and fetch card and monitor attributes, -XCOMM but it will not be allowed to change them. If it tries it will -XCOMM receive a protocol error. +# Uncomment this to disable tuning with the xvidtune client. With +# it the client can still run and fetch card and monitor attributes, +# but it will not be allowed to change them. If it tries it will +# receive a protocol error. -XCOMM Option "DisableVidModeExtension" +# Option "DisableVidModeExtension" -XCOMM Uncomment this to enable the use of a non-local xvidtune client. +# Uncomment this to enable the use of a non-local xvidtune client. -XCOMM Option "AllowNonLocalXvidtune" +# Option "AllowNonLocalXvidtune" -XCOMM Set the basic blanking screen saver timeout. +# Set the basic blanking screen saver timeout. Option "BlankTime" "10" # 10 minutes -XCOMM Set the DPMS timeouts. These are set here because they are global -XCOMM rather than screen-specific. These settings alone don't enable DPMS. -XCOMM It is enabled per-screen (or per-monitor), and even then only when -XCOMM the driver supports it. +# Set the DPMS timeouts. These are set here because they are global +# rather than screen-specific. These settings alone don't enable DPMS. +# It is enabled per-screen (or per-monitor), and even then only when +# the driver supports it. Option "StandbyTime" "10" # 10 minutes Option "SuspendTime" "10" # 10 minutes @@ -130,115 +130,115 @@ XCOMM the driver supports it. EndSection -XCOMM ********************************************************************** -XCOMM Input devices -XCOMM ********************************************************************** +# ********************************************************************** +# Input devices +# ********************************************************************** -XCOMM ********************************************************************** -XCOMM Core keyboard's InputDevice section -XCOMM ********************************************************************** +# ********************************************************************** +# Core keyboard's InputDevice section +# ********************************************************************** Section "InputDevice" Identifier "Keyboard1" Driver "kbd" -XCOMM Set the keyboard auto repeat parameters. Not all platforms implement -XCOMM this. +# Set the keyboard auto repeat parameters. Not all platforms implement +# this. Option "AutoRepeat" "500 5" -XCOMM Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)). - -XCOMM Option "Xleds" "1 2 3" - -XCOMM To customise the XKB settings to suit your keyboard, modify the -XCOMM lines below (which are the defaults). For example, for a European -XCOMM keyboard, you will probably want to use one of: -XCOMM -XCOMM Option "XkbModel" "pc102" -XCOMM Option "XkbModel" "pc105" -XCOMM -XCOMM If you have a Microsoft Natural keyboard, you can use: -XCOMM -XCOMM Option "XkbModel" "microsoft" -XCOMM -XCOMM If you have a US "windows" keyboard you will want: -XCOMM -XCOMM Option "XkbModel" "pc104" -XCOMM -XCOMM Then to change the language, change the Layout setting. -XCOMM For example, a german layout can be obtained with: -XCOMM -XCOMM Option "XkbLayout" "de" -XCOMM -XCOMM or: -XCOMM -XCOMM Option "XkbLayout" "de" -XCOMM Option "XkbVariant" "nodeadkeys" -XCOMM -XCOMM If you'd like to switch the positions of your capslock and -XCOMM control keys, use: -XCOMM -XCOMM Option "XkbOptions" "ctrl:swapcaps" - - -XCOMM These are the default XKB settings for xorg -XCOMM -XCOMM Option "XkbRules" "xorg" -XCOMM Option "XkbModel" "pc105" -XCOMM Option "XkbLayout" "us" -XCOMM Option "XkbVariant" "" -XCOMM Option "XkbOptions" "" +# Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)). + +# Option "Xleds" "1 2 3" + +# To customise the XKB settings to suit your keyboard, modify the +# lines below (which are the defaults). For example, for a European +# keyboard, you will probably want to use one of: +# +# Option "XkbModel" "pc102" +# Option "XkbModel" "pc105" +# +# If you have a Microsoft Natural keyboard, you can use: +# +# Option "XkbModel" "microsoft" +# +# If you have a US "windows" keyboard you will want: +# +# Option "XkbModel" "pc104" +# +# Then to change the language, change the Layout setting. +# For example, a german layout can be obtained with: +# +# Option "XkbLayout" "de" +# +# or: +# +# Option "XkbLayout" "de" +# Option "XkbVariant" "nodeadkeys" +# +# If you'd like to switch the positions of your capslock and +# control keys, use: +# +# Option "XkbOptions" "ctrl:swapcaps" + + +# These are the default XKB settings for xorg +# +# Option "XkbRules" "xorg" +# Option "XkbModel" "pc105" +# Option "XkbLayout" "us" +# Option "XkbVariant" "" +# Option "XkbOptions" "" EndSection -XCOMM ********************************************************************** -XCOMM Core Pointer's InputDevice section -XCOMM ********************************************************************** +# ********************************************************************** +# Core Pointer's InputDevice section +# ********************************************************************** Section "InputDevice" -XCOMM Identifier and driver +# Identifier and driver Identifier "Mouse1" Driver "mouse" -XCOMM The mouse protocol and device. The device is normally set to /dev/mouse, -XCOMM which is usually a symbolic link to the real device. +# The mouse protocol and device. The device is normally set to /dev/mouse, +# which is usually a symbolic link to the real device. Option "Protocol" "Microsoft" Option "Device" "/dev/mouse" -XCOMM On platforms where PnP mouse detection is supported the following -XCOMM protocol setting can be used when using a newer PnP mouse: +# On platforms where PnP mouse detection is supported the following +# protocol setting can be used when using a newer PnP mouse: -XCOMM Option "Protocol" "Auto" +# Option "Protocol" "Auto" -XCOMM When using mouse connected to a PS/2 port (aka "MousePort"), set the -XCOMM the protocol as follows. On some platforms some other settings may -XCOMM be available. +# When using mouse connected to a PS/2 port (aka "MousePort"), set the +# the protocol as follows. On some platforms some other settings may +# be available. -XCOMM Option "Protocol" "PS/2" +# Option "Protocol" "PS/2" -XCOMM Baudrate and SampleRate are only for some older Logitech mice. In -XCOMM almost every case these lines should be omitted. +# Baudrate and SampleRate are only for some older Logitech mice. In +# almost every case these lines should be omitted. -XCOMM Option "BaudRate" "9600" -XCOMM Option "SampleRate" "150" +# Option "BaudRate" "9600" +# Option "SampleRate" "150" -XCOMM Emulate3Buttons is an option for 2-button mice -XCOMM Emulate3Timeout is the timeout in milliseconds (default is 50ms) +# Emulate3Buttons is an option for 2-button mice +# Emulate3Timeout is the timeout in milliseconds (default is 50ms) -XCOMM Option "Emulate3Buttons" -XCOMM Option "Emulate3Timeout" "50" +# Option "Emulate3Buttons" +# Option "Emulate3Timeout" "50" -XCOMM ChordMiddle is an option for some 3-button Logitech mice, or any -XCOMM 3-button mouse where the middle button generates left+right button -XCOMM events. +# ChordMiddle is an option for some 3-button Logitech mice, or any +# 3-button mouse where the middle button generates left+right button +# events. -XCOMM Option "ChordMiddle" +# Option "ChordMiddle" EndSection @@ -249,91 +249,91 @@ Section "InputDevice" Option "Device" "/dev/mouse2" EndSection -XCOMM Some examples of extended input devices - -XCOMM Section "InputDevice" -XCOMM Identifier "spaceball" -XCOMM Driver "magellan" -XCOMM Option "Device" "/dev/cua0" -XCOMM EndSection -XCOMM -XCOMM Section "InputDevice" -XCOMM Identifier "spaceball2" -XCOMM Driver "spaceorb" -XCOMM Option "Device" "/dev/cua0" -XCOMM EndSection -XCOMM -XCOMM Section "InputDevice" -XCOMM Identifier "touchscreen0" -XCOMM Driver "microtouch" -XCOMM Option "Device" "/dev/ttyS0" -XCOMM Option "MinX" "1412" -XCOMM Option "MaxX" "15184" -XCOMM Option "MinY" "15372" -XCOMM Option "MaxY" "1230" -XCOMM Option "ScreenNumber" "0" -XCOMM Option "ReportingMode" "Scaled" -XCOMM Option "ButtonNumber" "1" -XCOMM Option "SendCoreEvents" -XCOMM EndSection -XCOMM -XCOMM Section "InputDevice" -XCOMM Identifier "touchscreen1" -XCOMM Driver "elo2300" -XCOMM Option "Device" "/dev/ttyS0" -XCOMM Option "MinX" "231" -XCOMM Option "MaxX" "3868" -XCOMM Option "MinY" "3858" -XCOMM Option "MaxY" "272" -XCOMM Option "ScreenNumber" "0" -XCOMM Option "ReportingMode" "Scaled" -XCOMM Option "ButtonThreshold" "17" -XCOMM Option "ButtonNumber" "1" -XCOMM Option "SendCoreEvents" -XCOMM EndSection - -XCOMM ********************************************************************** -XCOMM Monitor section -XCOMM ********************************************************************** - -XCOMM Any number of monitor sections may be present +# Some examples of extended input devices + +# Section "InputDevice" +# Identifier "spaceball" +# Driver "magellan" +# Option "Device" "/dev/cua0" +# EndSection +# +# Section "InputDevice" +# Identifier "spaceball2" +# Driver "spaceorb" +# Option "Device" "/dev/cua0" +# EndSection +# +# Section "InputDevice" +# Identifier "touchscreen0" +# Driver "microtouch" +# Option "Device" "/dev/ttyS0" +# Option "MinX" "1412" +# Option "MaxX" "15184" +# Option "MinY" "15372" +# Option "MaxY" "1230" +# Option "ScreenNumber" "0" +# Option "ReportingMode" "Scaled" +# Option "ButtonNumber" "1" +# Option "SendCoreEvents" +# EndSection +# +# Section "InputDevice" +# Identifier "touchscreen1" +# Driver "elo2300" +# Option "Device" "/dev/ttyS0" +# Option "MinX" "231" +# Option "MaxX" "3868" +# Option "MinY" "3858" +# Option "MaxY" "272" +# Option "ScreenNumber" "0" +# Option "ReportingMode" "Scaled" +# Option "ButtonThreshold" "17" +# Option "ButtonNumber" "1" +# Option "SendCoreEvents" +# EndSection + +# ********************************************************************** +# Monitor section +# ********************************************************************** + +# Any number of monitor sections may be present Section "Monitor" -XCOMM The identifier line must be present. +# The identifier line must be present. Identifier "Generic Monitor" -XCOMM HorizSync is in kHz unless units are specified. -XCOMM HorizSync may be a comma separated list of discrete values, or a -XCOMM comma separated list of ranges of values. -XCOMM NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S -XCOMM USER MANUAL FOR THE CORRECT NUMBERS. +# HorizSync is in kHz unless units are specified. +# HorizSync may be a comma separated list of discrete values, or a +# comma separated list of ranges of values. +# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S +# USER MANUAL FOR THE CORRECT NUMBERS. -XCOMM HorizSync 31.5 # typical for a single frequency fixed-sync monitor -XCOMM HorizSync 30-64 # multisync -XCOMM HorizSync 31.5, 35.2 # multiple fixed sync frequencies -XCOMM HorizSync 15-25, 30-50 # multiple ranges of sync frequencies +# HorizSync 31.5 # typical for a single frequency fixed-sync monitor +# HorizSync 30-64 # multisync +# HorizSync 31.5, 35.2 # multiple fixed sync frequencies +# HorizSync 15-25, 30-50 # multiple ranges of sync frequencies -XCOMM VertRefresh is in Hz unless units are specified. -XCOMM VertRefresh may be a comma separated list of discrete values, or a -XCOMM comma separated list of ranges of values. -XCOMM NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S -XCOMM USER MANUAL FOR THE CORRECT NUMBERS. +# VertRefresh is in Hz unless units are specified. +# VertRefresh may be a comma separated list of discrete values, or a +# comma separated list of ranges of values. +# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S +# USER MANUAL FOR THE CORRECT NUMBERS. -XCOMM VertRefresh 60 # typical for a single frequency fixed-sync monitor +# VertRefresh 60 # typical for a single frequency fixed-sync monitor -XCOMM VertRefresh 50-100 # multisync -XCOMM VertRefresh 60, 65 # multiple fixed sync frequencies -XCOMM VertRefresh 40-50, 80-100 # multiple ranges of sync frequencies +# VertRefresh 50-100 # multisync +# VertRefresh 60, 65 # multiple fixed sync frequencies +# VertRefresh 40-50, 80-100 # multiple ranges of sync frequencies -XCOMM Modes can be specified in two formats. A compact one-line format, or -XCOMM a multi-line format. +# Modes can be specified in two formats. A compact one-line format, or +# a multi-line format. -XCOMM A generic VGA 640x480 mode (hsync = 31.5kHz, refresh = 60Hz) -XCOMM These two are equivalent +# A generic VGA 640x480 mode (hsync = 31.5kHz, refresh = 60Hz) +# These two are equivalent -XCOMM ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525 +# ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525 Mode "640x480" DotClock 25.175 @@ -341,75 +341,75 @@ XCOMM ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525 VTimings 480 491 493 525 EndMode -XCOMM These two are equivalent +# These two are equivalent -XCOMM ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace +# ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace -XCOMM Mode "1024x768i" -XCOMM DotClock 45 -XCOMM HTimings 1024 1048 1208 1264 -XCOMM VTimings 768 776 784 817 -XCOMM Flags "Interlace" -XCOMM EndMode +# Mode "1024x768i" +# DotClock 45 +# HTimings 1024 1048 1208 1264 +# VTimings 768 776 784 817 +# Flags "Interlace" +# EndMode -XCOMM If a monitor has DPMS support, that can be indicated here. This will -XCOMM enable DPMS when the monitor is used with drivers that support it. +# If a monitor has DPMS support, that can be indicated here. This will +# enable DPMS when the monitor is used with drivers that support it. -XCOMM Option "dpms" +# Option "dpms" -XCOMM If a monitor requires that the sync signals be superimposed on the -XCOMM green signal, the following option will enable this when used with -XCOMM drivers that support it. Only a relatively small range of hardware -XCOMM (and drivers) actually support this. +# If a monitor requires that the sync signals be superimposed on the +# green signal, the following option will enable this when used with +# drivers that support it. Only a relatively small range of hardware +# (and drivers) actually support this. -XCOMM Option "sync on green" +# Option "sync on green" EndSection -XCOMM ********************************************************************** -XCOMM Graphics device section -XCOMM ********************************************************************** +# ********************************************************************** +# Graphics device section +# ********************************************************************** -XCOMM Any number of graphics device sections may be present +# Any number of graphics device sections may be present Section "Device" -XCOMM The Identifier must be present. +# The Identifier must be present. Identifier "Generic VESA" -XCOMM The Driver line must be present. When using run-time loadable driver -XCOMM modules, this line instructs the server to load the specified driver -XCOMM module. Even when not using loadable driver modules, this line -XCOMM indicates which driver should interpret the information in this section. +# The Driver line must be present. When using run-time loadable driver +# modules, this line instructs the server to load the specified driver +# module. Even when not using loadable driver modules, this line +# indicates which driver should interpret the information in this section. Driver "vesa" -XCOMM The chipset line is optional in most cases. It can be used to override -XCOMM the driver's chipset detection, and should not normally be specified. +# The chipset line is optional in most cases. It can be used to override +# the driver's chipset detection, and should not normally be specified. -XCOMM Chipset "generic" +# Chipset "generic" -XCOMM Various other lines can be specified to override the driver's automatic -XCOMM detection code. In most cases they are not needed. +# Various other lines can be specified to override the driver's automatic +# detection code. In most cases they are not needed. -XCOMM VideoRam 256 -XCOMM Clocks 25.2 28.3 +# VideoRam 256 +# Clocks 25.2 28.3 -XCOMM The BusID line is used to specify which of possibly multiple devices -XCOMM this section is intended for. When this line isn't present, a device -XCOMM section can only match up with the primary video device. For PCI -XCOMM devices a line like the following could be used. This line should not -XCOMM normally be included unless there is more than one video device -XCOMM intalled. +# The BusID line is used to specify which of possibly multiple devices +# this section is intended for. When this line isn't present, a device +# section can only match up with the primary video device. For PCI +# devices a line like the following could be used. This line should not +# normally be included unless there is more than one video device +# intalled. -XCOMM BusID "PCI:0:10:0" +# BusID "PCI:0:10:0" -XCOMM Various option lines can be added here as required. Some options -XCOMM are more appropriate in Screen sections, Display subsections or even -XCOMM Monitor sections. +# Various option lines can be added here as required. Some options +# are more appropriate in Screen sections, Display subsections or even +# Monitor sections. -XCOMM Option "hw cursor" "off" +# Option "hw cursor" "off" EndSection @@ -433,24 +433,24 @@ Section "Device" EndSection -XCOMM ********************************************************************** -XCOMM Screen sections. -XCOMM ********************************************************************** +# ********************************************************************** +# Screen sections. +# ********************************************************************** -XCOMM Any number of screen sections may be present. Each describes -XCOMM the configuration of a single screen. A single specific screen section -XCOMM may be specified from the X server command line with the "-screen" -XCOMM option. +# Any number of screen sections may be present. Each describes +# the configuration of a single screen. A single specific screen section +# may be specified from the X server command line with the "-screen" +# option. Section "Screen" -XCOMM The Identifier, Device and Monitor lines must be present +# The Identifier, Device and Monitor lines must be present Identifier "Screen 1" Device "Generic VESA" Monitor "Generic Monitor" -XCOMM The favoured Depth and/or Bpp may be specified here +# The favoured Depth and/or Bpp may be specified here DefaultDepth 8 @@ -480,7 +480,7 @@ Section "Screen" Monitor "Generic Monitor" Option "no accel" DefaultDepth 16 -XCOMM DefaultDepth 24 +# DefaultDepth 24 SubSection "Display" Depth 8 @@ -514,38 +514,38 @@ Section "Screen" EndSection -XCOMM ********************************************************************** -XCOMM ServerLayout sections. -XCOMM ********************************************************************** +# ********************************************************************** +# ServerLayout sections. +# ********************************************************************** -XCOMM Any number of ServerLayout sections may be present. Each describes -XCOMM the way multiple screens are organised. A specific ServerLayout -XCOMM section may be specified from the X server command line with the -XCOMM "-layout" option. In the absence of this, the first section is used. -XCOMM When now ServerLayout section is present, the first Screen section -XCOMM is used alone. +# Any number of ServerLayout sections may be present. Each describes +# the way multiple screens are organised. A specific ServerLayout +# section may be specified from the X server command line with the +# "-layout" option. In the absence of this, the first section is used. +# When now ServerLayout section is present, the first Screen section +# is used alone. Section "ServerLayout" -XCOMM The Identifier line must be present +# The Identifier line must be present Identifier "Main Layout" -XCOMM Each Screen line specifies a Screen section name, and optionally -XCOMM the relative position of other screens. The four names after -XCOMM primary screen name are the screens to the top, bottom, left and right -XCOMM of the primary screen. In this example, screen 2 is located to the -XCOMM right of screen 1. +# Each Screen line specifies a Screen section name, and optionally +# the relative position of other screens. The four names after +# primary screen name are the screens to the top, bottom, left and right +# of the primary screen. In this example, screen 2 is located to the +# right of screen 1. Screen "Screen MGA 1" "" "" "" "Screen MGA 2" Screen "Screen MGA 2" "" "" "Screen MGA 1" "" -XCOMM Each InputDevice line specifies an InputDevice section name and -XCOMM optionally some options to specify the way the device is to be -XCOMM used. Those options include "CorePointer", "CoreKeyboard" and -XCOMM "SendCoreEvents". In this example, "Mouse1" is the core pointer, -XCOMM and "Mouse2" is an extended input device that also generates core -XCOMM pointer events (i.e., both mice will move the standard pointer). +# Each InputDevice line specifies an InputDevice section name and +# optionally some options to specify the way the device is to be +# used. Those options include "CorePointer", "CoreKeyboard" and +# "SendCoreEvents". In this example, "Mouse1" is the core pointer, +# and "Mouse2" is an extended input device that also generates core +# pointer events (i.e., both mice will move the standard pointer). InputDevice "Mouse1" "CorePointer" InputDevice "Mouse2" "SendCoreEvents" diff --git a/hw/xnest/.gitignore b/hw/xnest/.gitignore index 16db15e20..b76c5a2d0 100644 --- a/hw/xnest/.gitignore +++ b/hw/xnest/.gitignore @@ -1,3 +1 @@ -# Add & Override for this directory and it's subdirectories Xnest -Xnest.man diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index 62e17cb66..619427ded 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -25,6 +25,7 @@ is" without express or implied warranty. #include "windowstr.h" #include "servermd.h" #include "inputstr.h" +#include "inpututils.h" #include "mi.h" @@ -42,8 +43,6 @@ is" without express or implied warranty. CARD32 lastEventTime = 0; -extern EventList *xnestEvents; - void ProcessInputEvents(void) { @@ -103,22 +102,17 @@ xnestCollectExposures(void) void xnestQueueKeyEvent(int type, unsigned int keycode) { - int i, n; - - GetEventList(&xnestEvents); lastEventTime = GetTimeInMillis(); - n = GetKeyboardEvents(xnestEvents, xnestKeyboardDevice, type, keycode); - for (i = 0; i < n; i++) - mieqEnqueue(xnestKeyboardDevice, (InternalEvent*)(xnestEvents + i)->event); + QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL); } void xnestCollectEvents(void) { XEvent X; - int i, n, valuators[2]; + int valuators[2]; + ValuatorMask mask; ScreenPtr pScreen; - GetEventList(&xnestEvents); while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { switch (X.type) { @@ -133,31 +127,28 @@ xnestCollectEvents(void) break; case ButtonPress: + valuator_mask_set_range(&mask, 0, 0, NULL); xnestUpdateModifierState(X.xkey.state); lastEventTime = GetTimeInMillis(); - n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonPress, - X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL); - for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event); + QueuePointerEvents(xnestPointerDevice, ButtonPress, + X.xbutton.button, POINTER_RELATIVE, &mask); break; case ButtonRelease: + valuator_mask_set_range(&mask, 0, 0, NULL); xnestUpdateModifierState(X.xkey.state); lastEventTime = GetTimeInMillis(); - n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease, - X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL); - for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event); + QueuePointerEvents(xnestPointerDevice, ButtonRelease, + X.xbutton.button, POINTER_RELATIVE, &mask); break; case MotionNotify: valuators[0] = X.xmotion.x; valuators[1] = X.xmotion.y; + valuator_mask_set_range(&mask, 0, 2, valuators); lastEventTime = GetTimeInMillis(); - n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, - 0, POINTER_ABSOLUTE, 0, 2, valuators); - for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event); + QueuePointerEvents(xnestPointerDevice, MotionNotify, + 0, POINTER_ABSOLUTE, &mask); break; case FocusIn: @@ -186,11 +177,10 @@ xnestCollectEvents(void) NewCurrentScreen(inputInfo.pointer, pScreen, X.xcrossing.x, X.xcrossing.y); valuators[0] = X.xcrossing.x; valuators[1] = X.xcrossing.y; + valuator_mask_set_range(&mask, 0, 2, valuators); lastEventTime = GetTimeInMillis(); - n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, - 0, POINTER_ABSOLUTE, 0, 2, valuators); - for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event); + QueuePointerEvents(xnestPointerDevice, MotionNotify, + 0, POINTER_ABSOLUTE, &mask); xnestDirectInstallColormaps(pScreen); } } diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index 8a90cc65e..ee74101d2 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -45,8 +45,6 @@ is" without express or implied warranty. Bool xnestDoFullGeneration = True; -EventList *xnestEvents = NULL; - void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) { @@ -100,8 +98,6 @@ InitInput(int argc, char *argv[]) if (rc != Success) FatalError("Failed to init Xnest default devices.\n"); - GetEventList(&xnestEvents); - mieqInit(); AddEnabledDevice(XConnectionNumber(xnestDisplay)); diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index 666a0f0e6..c395b4dae 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = man + bin_PROGRAMS = Xnest noinst_LIBRARIES = libfbcmap.a @@ -59,34 +61,12 @@ Xnest_LDADD = $(XNEST_LIBS) $(XNEST_SYS_LIBS) $(XSERVER_SYS_LIBS) Xnest_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) EXTRA_DIST = icon \ - screensaver \ - Xnest.man.pre + screensaver # -UDPMSExtension for miinitext? can't put into # OS_DEFINES??? # EXT_DEFINES??? # ICONFIGFILES -- SpecialCObjectRule -# Man page -include $(top_srcdir)/cpprules.in - -appmandir = $(APP_MAN_DIR) - -appman_PRE = Xnest.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -EXTRAMANDEFS = \ - -D__XCONFIGFILE__=$(__XCONFIGFILE__) \ - -D__XSERVERNAME__=$(XSERVERNAME) - -BUILT_SOURCES = $(appman_PRE) -CLEANFILES = $(appman_PRE) $(appman_DATA) - -SUFFIXES += .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - -$(AM_V_at)rm -f $@ - $(AM_V_at)$(LN_S) $< $@ - relink: $(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT) diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index 3a92ffde8..eccf56986 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -21,7 +21,6 @@ is" without express or implied warranty. #include "regionstr.h" #include "pixmapstr.h" #include "scrnintstr.h" -#include "regionstr.h" #include "gc.h" #include "servermd.h" #include "privates.h" diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 0a6cab687..d0c7fc8b0 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -239,8 +239,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) defaultVisual, /* root visual */ numVisuals, visuals); -/* miInitializeBackingStore(pScreen); */ - pScreen->defColormap = (Colormap) FakeClientID(0); pScreen->minInstalledCmaps = MINCMAPS; pScreen->maxInstalledCmaps = MAXCMAPS; diff --git a/hw/xnest/man/Makefile.am b/hw/xnest/man/Makefile.am new file mode 100644 index 000000000..30b6370bc --- /dev/null +++ b/hw/xnest/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xnest.man diff --git a/hw/xnest/Xnest.man.pre b/hw/xnest/man/Xnest.man similarity index 100% rename from hw/xnest/Xnest.man.pre rename to hw/xnest/man/Xnest.man diff --git a/hw/xquartz/GL/Makefile.am b/hw/xquartz/GL/Makefile.am index af890776e..736c94b4a 100644 --- a/hw/xquartz/GL/Makefile.am +++ b/hw/xquartz/GL/Makefile.am @@ -1,5 +1,5 @@ noinst_LTLIBRARIES = libCGLCore.la -AM_CFLAGS = $(DIX_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(GL_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/glx \ diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c index fc7dd57dd..dd3f855f4 100644 --- a/hw/xquartz/GL/capabilities.c +++ b/hw/xquartz/GL/capabilities.c @@ -507,7 +507,7 @@ bool getGlCapabilities(struct glCapabilities *cap) { err = CGLQueryRendererInfo((GLuint)-1, &info, &numRenderers); if(err) { - fprintf(stderr, "CGLQueryRendererInfo error: %s\n", CGLErrorString(err)); + ErrorF("CGLQueryRendererInfo error: %s\n", CGLErrorString(err)); return err; } @@ -518,8 +518,8 @@ bool getGlCapabilities(struct glCapabilities *cap) { err = handleRendererDescriptions(info, r, &tmpconf); if(err) { - fprintf(stderr, "handleRendererDescriptions returned error: %s\n", CGLErrorString(err)); - fprintf(stderr, "trying to continue...\n"); + ErrorF("handleRendererDescriptions returned error: %s\n", CGLErrorString(err)); + ErrorF("trying to continue...\n"); continue; } diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 58f78fb80..6da27c78a 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -139,7 +139,6 @@ #include #include #include -#include #include #include "x-hash.h" #include "x-list.h" @@ -174,7 +173,6 @@ static __GLXdrawable * __glXAquaScreenCreateDrawable(ClientPtr client, __GLXscre static void __glXAquaContextDestroy(__GLXcontext *baseContext); static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext); static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext); -static int __glXAquaContextForceCurrent(__GLXcontext *baseContext); static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask); static CGLPixelFormatObj makeFormat(__GLXconfig *conf); @@ -235,7 +233,6 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, context->base.makeCurrent = __glXAquaContextMakeCurrent; context->base.loseCurrent = __glXAquaContextLoseCurrent; context->base.copy = __glXAquaContextCopy; - context->base.forceCurrent = __glXAquaContextForceCurrent; /*FIXME verify that the context->base is fully initialized. */ context->pixelFormat = makeFormat(conf); @@ -458,19 +455,6 @@ static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, un return gl_err == 0; } -static int __glXAquaContextForceCurrent(__GLXcontext *baseContext) -{ - CGLError gl_err; - __GLXAquaContext *context = (__GLXAquaContext *) baseContext; - GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx); - - gl_err = CGLSetCurrentContext(context->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - return gl_err == 0; -} - /* Drawing surface notification callbacks */ static GLboolean __glXAquaDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base) { CGLError err; @@ -586,8 +570,6 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { screen->base.createContext = __glXAquaScreenCreateContext; screen->base.createDrawable = __glXAquaScreenCreateDrawable; screen->base.swapInterval = /*FIXME*/ NULL; - screen->base.hyperpipeFuncs = NULL; - screen->base.swapBarrierFuncs = NULL; screen->base.pScreen = pScreen; screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum); @@ -683,17 +665,8 @@ GLuint __glFloorLog2(GLuint val) return c; } -void warn_func(void * p1, char *format, ...) { - va_list v; - va_start(v, format); - vfprintf(stderr, format, v); - va_end(v); -} - static void setup_dispatch_table(void) { struct _glapi_table *disp=_glapi_get_dispatch(); - _glapi_set_warning_func((_glapi_warning_func)warn_func); - _glapi_noop_enable_warnings(TRUE); /* to update: * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c index b209b7656..2c2a9a29e 100644 --- a/hw/xquartz/GL/visualConfigs.c +++ b/hw/xquartz/GL/visualConfigs.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include "capabilities.h" diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am index 721d2725e..a7cc012d9 100644 --- a/hw/xquartz/Makefile.am +++ b/hw/xquartz/Makefile.am @@ -14,9 +14,9 @@ if GLX GL_DIR = GL endif -SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc +SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup man -DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup doc +DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup man libXquartz_la_SOURCES = \ $(top_srcdir)/fb/fbcmap_mi.c \ @@ -30,12 +30,11 @@ libXquartz_la_SOURCES = \ keysym2ucs.c \ pseudoramiX.c \ quartz.c \ - quartzAudio.c \ quartzCocoa.m \ quartzKeyboard.c \ quartzStartup.c \ quartzRandR.c \ - threadSafety.c + console_redirect.c EXTRA_DIST = \ X11Application.h \ @@ -47,10 +46,9 @@ EXTRA_DIST = \ keysym2ucs.h \ pseudoramiX.h \ quartz.h \ - quartzAudio.h \ quartzCommon.h \ quartzKeyboard.h \ quartzRandR.h \ sanitizedCarbon.h \ sanitizedCocoa.h \ - threadSafety.h + console_redirect.h diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index 462128464..619f32f7a 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -43,11 +43,12 @@ - (void) set_controller:controller; - (void) set_window_menu:(NSArray *)list; +- (CFPropertyListRef) prefs_get_copy:(NSString *)key CF_RETURNS_RETAINED; - (int) prefs_get_integer:(NSString *)key default:(int)def; - (const char *) prefs_get_string:(NSString *)key default:(const char *)def; - (float) prefs_get_float:(NSString *)key default:(float)def; - (int) prefs_get_boolean:(NSString *)key default:(int)def; -- (NSURL *) prefs_copy_url:(NSString *)key default:(NSURL *)def; +- (NSURL *) prefs_copy_url:(NSString *)key default:(NSURL *)def NS_RETURNS_RETAINED; - (NSArray *) prefs_get_array:(NSString *)key; - (void) prefs_set_integer:(NSString *)key value:(int)value; - (void) prefs_set_float:(NSString *)key value:(float)value; @@ -73,11 +74,12 @@ void X11ApplicationServerReady (void); void X11ApplicationShowHideMenubar (int state); void X11ApplicationLaunchClient (const char *cmd); +Bool X11ApplicationCanEnterRandR (void); + void X11ApplicationMain(int argc, char **argv, char **envp); #define PREFS_APPSMENU "apps_menu" #define PREFS_FAKEBUTTONS "enable_fake_buttons" -#define PREFS_SYSBEEP "enable_system_beep" #define PREFS_KEYEQUIVS "enable_key_equivalents" #define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" #define PREFS_FULLSCREEN_MENU "fullscreen_menu" @@ -87,6 +89,7 @@ void X11ApplicationMain(int argc, char **argv, char **envp); #define PREFS_NO_TCP "nolisten_tcp" #define PREFS_DONE_XINIT_CHECK "done_xinit_check" #define PREFS_NO_QUIT_ALERT "no_quit_alert" +#define PREFS_NO_RANDR_ALERT "no_randr_alert" #define PREFS_OPTION_SENDS_ALT "option_sends_alt" #define PREFS_FAKE_BUTTON2 "fake_button2" #define PREFS_FAKE_BUTTON3 "fake_button3" diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 8f4f23ff3..7c41cbcb5 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -41,7 +41,6 @@ #include "quartz.h" #include "darwinEvents.h" #include "quartzKeyboard.h" -#include "quartz.h" #include #include "micmap.h" #include "exglobals.h" @@ -61,6 +60,12 @@ #define XSERVER_VERSION "?" #endif +#ifdef HAVE_LIBDISPATCH +#include + +static dispatch_queue_t eventTranslationQueue; +#endif + /* Stuck modifier / button state... force release when we context switch */ static NSEventType keyState[NUM_KEYCODES]; @@ -231,8 +236,7 @@ - (void) sendEvent:(NSEvent *)e { if ([self isActive]) { [self deactivate]; - if (!_x_active && quartzProcs->IsX11Window([e window], - [e windowNumber])) + if (!_x_active && quartzProcs->IsX11Window([e windowNumber])) [self activateX:YES]; } } @@ -385,7 +389,15 @@ - (void) sendEvent:(NSEvent *)e { if (for_appkit) [super sendEvent:e]; - if (for_x) [self sendX11NSEvent:e]; + if (for_x) { +#ifdef HAVE_LIBDISPATCH + dispatch_async(eventTranslationQueue, ^{ +#endif + [self sendX11NSEvent:e]; +#ifdef HAVE_LIBDISPATCH + }); +#endif + } } - (void) set_window_menu:(NSArray *)list { @@ -718,8 +730,6 @@ - (void) read_defaults NSString *nsstr; const char *tem; - XQuartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP - default:XQuartzUseSysBeep]; XQuartzRootlessDefault = [self prefs_get_boolean:@PREFS_ROOTLESS default:XQuartzRootlessDefault]; XQuartzFullscreenMenu = [self prefs_get_boolean:@PREFS_FULLSCREEN_MENU @@ -885,6 +895,35 @@ void X11ApplicationLaunchClient (const char *cmd) { [string release]; } +/* This is a special function in that it is run from the *SERVER* thread and + * not the AppKit thread. We want to block entering a screen-capturing RandR + * mode until we notify the user about how to get out if the X11 client crashes. + */ +Bool X11ApplicationCanEnterRandR(void) { + NSString *title, *msg; + + if([X11App prefs_get_boolean:@PREFS_NO_RANDR_ALERT default:NO] || XQuartzShieldingWindowLevel != 0) + return TRUE; + + title = NSLocalizedString(@"Enter RandR mode?", @"Dialog title when switching to RandR"); + msg = NSLocalizedString(@"An application has requested X11 to change the resolution of your display. X11 will restore the display to its previous state when the requesting application requests to return to the previous state. Alternatively, you can use the ⌥⌘A key sequence to force X11 to return to the previous state.", + @"Dialog when switching to RandR"); + + if(!XQuartzIsRootless) + QuartzShowFullscreen(FALSE); + + switch(NSRunAlertPanel(title, msg, NSLocalizedString(@"Allow", @""), NSLocalizedString (@"Cancel", @""), NSLocalizedString (@"Always Allow", @""))) { + case NSAlertOtherReturn: + [X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES]; + [X11App prefs_synchronize]; + case NSAlertDefaultReturn: + return YES; + + default: + return NO; + } +} + static void check_xinitrc (void) { char *tem, buf[1024]; NSString *msg; @@ -923,7 +962,7 @@ static void check_xinitrc (void) { [X11App prefs_synchronize]; } -static inline pthread_t create_thread(void *func, void *arg) { +static inline pthread_t create_thread(void *(*func)(void *), void *arg) { pthread_attr_t attr; pthread_t tid; @@ -939,7 +978,7 @@ static inline pthread_t create_thread(void *func, void *arg) { static void *xpbproxy_x_thread(void *args) { xpbproxy_run(); - fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n"); + ErrorF("xpbproxy thread is terminating unexpectedly.\n"); return NULL; } @@ -972,20 +1011,25 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) - NSMaxY([[NSScreen mainScreen] visibleFrame]); +#ifdef HAVE_LIBDISPATCH + eventTranslationQueue = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL); + assert(eventTranslationQueue != NULL); +#endif + /* Set the key layout seed before we start the server */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 last_key_layout = TISCopyCurrentKeyboardLayoutInputSource(); if(!last_key_layout) - fprintf(stderr, "X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n"); + ErrorF("X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n"); #else KLGetCurrentKeyboardLayout(&last_key_layout); if(!last_key_layout) - fprintf(stderr, "X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n"); + ErrorF("X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n"); #endif if (!QuartsResyncKeymap(FALSE)) { - fprintf(stderr, "X11ApplicationMain: Could not build a valid keymap.\n"); + ErrorF("X11ApplicationMain: Could not build a valid keymap.\n"); } /* Tell the server thread that it can proceed */ @@ -1023,14 +1067,58 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe } #endif +#ifdef DEBUG_UNTRUSTED_POINTER_DELTA +static const char *untrusted_str(NSEvent *e) { + switch([e type]) { + case NSScrollWheel: + return "NSScrollWheel"; + case NSTabletPoint: + return "NSTabletPoint"; + case NSOtherMouseDown: + return "NSOtherMouseDown"; + case NSOtherMouseUp: + return "NSOtherMouseUp"; + case NSLeftMouseDown: + return "NSLeftMouseDown"; + case NSLeftMouseUp: + return "NSLeftMouseUp"; + default: + switch([e subtype]) { + case NSTabletPointEventSubtype: + return "NSTabletPointEventSubtype"; + case NSTabletProximityEventSubtype: + return "NSTabletProximityEventSubtype"; + default: + return "Other"; + } + } +} +#endif + - (void) sendX11NSEvent:(NSEvent *)e { - NSPoint location = NSZeroPoint, tilt = NSZeroPoint; + NSPoint location = NSZeroPoint; int ev_button, ev_type; - float pressure = 0.0; + static float pressure = 0.0; // static so ProximityOut will have the value from the previous tablet event + static NSPoint tilt; // static so ProximityOut will have the value from the previous tablet event + static DeviceIntPtr darwinTabletCurrent = NULL; + static BOOL needsProximityIn = NO; // Do we do need to handle a pending ProximityIn once we have pressure/tilt? DeviceIntPtr pDev; int modifierFlags; BOOL isMouseOrTabletEvent, isTabletEvent; +#ifdef HAVE_LIBDISPATCH + static dispatch_once_t once_pred; + dispatch_once(&once_pred, ^{ + tilt = NSZeroPoint; + darwinTabletCurrent = darwinTabletStylus; + }); +#else + if(!darwinTabletCurrent) { + tilt = NSZeroPoint; + darwinTabletCurrent = darwinTabletStylus; + } +#endif + isMouseOrTabletEvent = [e type] == NSLeftMouseDown || [e type] == NSOtherMouseDown || [e type] == NSRightMouseDown || [e type] == NSLeftMouseUp || [e type] == NSOtherMouseUp || [e type] == NSRightMouseUp || [e type] == NSLeftMouseDragged || [e type] == NSOtherMouseDragged || [e type] == NSRightMouseDragged || @@ -1060,6 +1148,10 @@ - (void) sendX11NSEvent:(NSEvent *)e { // The deltaXY for scroll events correspond to the scroll delta, not the pointer delta // deltaXY for wheel events are being sent as mouse movement hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] == NSScrollWheel; + +#ifdef DEBUG_UNTRUSTED_POINTER_DELTA + hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] == NSLeftMouseDown || [e type] == NSLeftMouseUp; +#endif if (window != nil) { NSRect frame = [window frame]; @@ -1068,8 +1160,22 @@ - (void) sendX11NSEvent:(NSEvent *)e { location.y += frame.origin.y; lastpt = location; } else if(hasUntrustedPointerDelta) { +#ifdef DEBUG_UNTRUSTED_POINTER_DELTA + ErrorF("--- Begin Event Debug ---\n"); + ErrorF("Event type: %s\n", untrusted_str(e)); + ErrorF("old lastpt: (%0.2f, %0.2f)\n", lastpt.x, lastpt.y); + ErrorF(" delta: (%0.2f, %0.2f)\n", [e deltaX], -[e deltaY]); + ErrorF(" location: (%0.2f, %0.2f)\n", lastpt.x + [e deltaX], lastpt.y - [e deltaY]); + ErrorF("workaround: (%0.2f, %0.2f)\n", [e locationInWindow].x, [e locationInWindow].y); + ErrorF("--- End Event Debug ---\n"); + + location.x = lastpt.x + [e deltaX]; + location.y = lastpt.y - [e deltaY]; + lastpt = [e locationInWindow]; +#else location = [e locationInWindow]; lastpt = location; +#endif } else { location.x = lastpt.x + [e deltaX]; location.y = lastpt.y - [e deltaY]; @@ -1134,19 +1240,14 @@ - (void) sendX11NSEvent:(NSEvent *)e { darwinTabletCurrent=darwinTabletCursor; break; } - - /* NSTabletProximityEventSubtype doesn't encode pressure ant tilt - * So we just pretend the motion was caused by the mouse. Hopefully - * we'll have a better solution for this in the future (like maybe - * NSTabletProximityEventSubtype will come from NSTabletPoint - * rather than NSMouseMoved. - pressure = [e pressure]; - tilt = [e tilt]; - pDev = darwinTabletCurrent; - */ - DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut, - location.x, location.y); + if([e isEnteringProximity]) + needsProximityIn = YES; + else + DarwinSendProximityEvents(darwinTabletCurrent, ProximityOut, + location.x, location.y, pressure, + tilt.x, tilt.y); + return; } if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) { @@ -1154,13 +1255,21 @@ - (void) sendX11NSEvent:(NSEvent *)e { tilt = [e tilt]; pDev = darwinTabletCurrent; + + if(needsProximityIn) { + DarwinSendProximityEvents(darwinTabletCurrent, ProximityIn, + location.x, location.y, pressure, + tilt.x, tilt.y); + + needsProximityIn = NO; + } } if(!XQuartzServerVisible && noTestExtensions) { #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */ xp_window_id wid = 0; - xp_error e; + xp_error err; /* Sigh. Need to check that we're really over one of * our windows. (We need to receive pointer events while @@ -1168,9 +1277,9 @@ - (void) sendX11NSEvent:(NSEvent *)e { * when another window is over us or we might show a tooltip) */ - e = xp_find_window(location.x, location.y, 0, &wid); + err = xp_find_window(location.x, location.y, 0, &wid); - if (e != XP_Success || (e == XP_Success && wid == 0)) + if (err != XP_Success || (err == XP_Success && wid == 0)) #endif { bgMouseLocation = location; @@ -1207,8 +1316,12 @@ - (void) sendX11NSEvent:(NSEvent *)e { break; } - DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut, - location.x, location.y); + if([e isEnteringProximity]) + needsProximityIn = YES; + else + DarwinSendProximityEvents(darwinTabletCurrent, ProximityOut, + location.x, location.y, pressure, + tilt.x, tilt.y); break; case NSScrollWheel: @@ -1257,7 +1370,7 @@ - (void) sendX11NSEvent:(NSEvent *)e { #endif /* Update keyInfo */ if (!QuartsResyncKeymap(TRUE)) { - fprintf(stderr, "sendX11NSEvent: Could not build a valid keymap.\n"); + ErrorF("sendX11NSEvent: Could not build a valid keymap.\n"); } } } diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index 65a09b8d5..9edaacdd5 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -65,7 +65,6 @@ typedef unsigned int NSUInteger; IBOutlet NSButton *fake_buttons; IBOutlet NSButton *enable_fullscreen; IBOutlet NSButton *enable_fullscreen_menu; - IBOutlet NSButton *use_sysbeep; IBOutlet NSButton *enable_keyequivs; IBOutlet NSButton *sync_keymap; IBOutlet NSButton *option_sends_alt; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 13b63664f..2edfb185e 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -637,9 +637,6 @@ - (IBAction)prefs_changed:sender if(sender == fake_buttons) { darwinFakeButtons = [fake_buttons intValue]; [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; - } else if(sender == use_sysbeep) { - XQuartzUseSysBeep = [use_sysbeep intValue]; - [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:XQuartzUseSysBeep]; } else if(sender == enable_keyequivs) { XQuartzEnableKeyEquivalents = [enable_keyequivs intValue]; [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:XQuartzEnableKeyEquivalents]; @@ -701,7 +698,6 @@ - (IBAction) prefs_show:sender BOOL pbproxy_active = [NSApp prefs_get_boolean:@PREFS_SYNC_PB default:YES]; [fake_buttons setIntValue:darwinFakeButtons]; - [use_sysbeep setIntValue:XQuartzUseSysBeep]; [enable_keyequivs setIntValue:XQuartzEnableKeyEquivalents]; [sync_keymap setIntValue:darwinSyncKeymap]; [option_sends_alt setIntValue:XQuartzOptionSendsAlt]; diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index ec20534e0..2f26e61d9 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -437,7 +437,7 @@ ProcAppleWMSetWindowLevel(register ClientPtr client) DixReadAccess)) return BadValue; - if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { + if (stuff->level >= AppleWMNumWindowLevels) { return BadValue; } diff --git a/hw/xquartz/applewmExt.h b/hw/xquartz/applewmExt.h index 5ef8b5496..c46a7bde4 100644 --- a/hw/xquartz/applewmExt.h +++ b/hw/xquartz/applewmExt.h @@ -32,16 +32,23 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _APPLEWMEXT_H_ #include "window.h" +#include + +#if XPLUGIN_VERSION < 4 +typedef int xp_frame_attr; +typedef int xp_frame_class; +typedef int xp_frame_rect; +#endif typedef int (*DisableUpdateProc)(void); typedef int (*EnableUpdateProc)(void); typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level); -typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer, +typedef int (*FrameGetRectProc)(xp_frame_rect type, xp_frame_class class, const BoxRec *outer, const BoxRec *inner, BoxRec *ret); -typedef int (*FrameHitTestProc)(int class, int x, int y, +typedef int (*FrameHitTestProc)(xp_frame_class class, int x, int y, const BoxRec *outer, const BoxRec *inner, int *ret); -typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, +typedef int (*FrameDrawProc)(WindowPtr pWin, xp_frame_class class, xp_frame_attr attr, const BoxRec *outer, const BoxRec *inner, unsigned int title_len, const unsigned char *title_bytes); diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp index 85b439ad4..a4b8e1926 100644 --- a/hw/xquartz/bundle/Info.plist.cpp +++ b/hw/xquartz/bundle/Info.plist.cpp @@ -7,11 +7,11 @@ CFBundleExecutable X11 CFBundleGetInfoString - LAUNCHD_ID_PREFIX.X11 + BUNDLE_ID_PREFIX.X11 CFBundleIconFile X11.icns CFBundleIdentifier - LAUNCHD_ID_PREFIX.X11 + BUNDLE_ID_PREFIX.X11 CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -19,9 +19,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.6.0 + 2.7.0 CFBundleVersion - 2.6.0 + 2.7.0 CFBundleSignature x11a CSResourcesFileMapped @@ -34,10 +34,12 @@ SUFeedURL http://xquartz.macosforge.org/downloads/sparkle/release.xml #endif + LSApplicationCategoryType + public.app-category.utilities NSHumanReadableCopyright - © 2003-2010 Apple Inc. + © 2003-2011 Apple Inc. © 2003 XFree86 Project, Inc. -© 2003-2010 X.org Foundation, Inc. +© 2003-2011 X.org Foundation, Inc. NSMainNibFile main diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am index c4d77c099..6deecae55 100644 --- a/hw/xquartz/bundle/Makefile.am +++ b/hw/xquartz/bundle/Makefile.am @@ -1,7 +1,7 @@ include cpprules.in CPP_FILES_FLAGS = \ - -DLAUNCHD_ID_PREFIX="$(LAUNCHD_ID_PREFIX)" \ + -DBUNDLE_ID_PREFIX="$(BUNDLE_ID_PREFIX)" \ -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" if XQUARTZ_SPARKLE @@ -12,7 +12,9 @@ install-data-hook: $(srcdir)/mk_bundke.sh $(srcdir) $(builddir) $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app install uninstall-hook: - $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app + $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/Resources + $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/Info.plist + $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/PkgInfo noinst_PRE = Info.plist.cpp noinst_DATA = $(noinst_PRE:plist.cpp=plist) diff --git a/hw/xquartz/bundle/Resources/Dutch.lproj/locversion.plist b/hw/xquartz/bundle/Resources/Dutch.lproj/locversion.plist index b512569f8..f95033644 100644 --- a/hw/xquartz/bundle/Resources/Dutch.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/Dutch.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale nl LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/designable.nib index e95db0cf6..4b030d359 100644 --- a/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/designable.nib @@ -2,23 +2,22 @@ 1040 - 11A79a - 784 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 784 + 851 - - - - - + com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -370,10 +369,11 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -387,7 +387,7 @@ 1 - + 256 @@ -408,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -491,7 +491,7 @@ ZW4uCg 1211912703 2 - + @@ -530,7 +530,7 @@ ZW4uCg 1211912703 2 - + @@ -568,7 +568,7 @@ ZW4uCg 1211912703 2 - + @@ -578,7 +578,6 @@ ZW4uCg {{10, 33}, {518, 246}} - Invoer @@ -589,48 +588,9 @@ ZW4uCg 2 - + 256 - - - 256 - {{18, 61}, {402, 18}} - - YES - - 67239424 - 0 - Gebruik waarschuwingssignaal van systeem - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 13}, {468, 42}} - - YES - - 67239424 - 4194304 - Voor X11-geluidssignalen wordt het waarschuwingssignaal van het systeem gebruikt, zoals ingesteld in het tabblad 'Geluidseffecten' van het systeemvoorkeurenpaneel 'Geluid'. - - - - - - - 256 @@ -767,7 +727,7 @@ ZW4uCg 1211912703 2 - + @@ -789,7 +749,7 @@ ZW4uCg 1211912703 2 - + @@ -816,6 +776,7 @@ ZW4uCg {{10, 33}, {518, 246}} + Uitvoer @@ -843,7 +804,7 @@ ZW4uCg 1211912703 2 - + @@ -881,7 +842,7 @@ ZW4uCg 1211912703 2 - + @@ -903,7 +864,7 @@ ZW4uCg 1211912703 2 - + @@ -925,7 +886,7 @@ ZW4uCg 1211912703 2 - + @@ -947,7 +908,7 @@ ZW4uCg 1211912703 2 - + @@ -1016,7 +977,7 @@ ZW4uCg 1211912703 2 - + @@ -1054,7 +1015,7 @@ ZW4uCg 1211912703 2 - + @@ -1092,7 +1053,7 @@ ZW4uCg 1211912703 2 - + @@ -1142,7 +1103,7 @@ ZW4uCg 1211912703 2 - + @@ -1164,7 +1125,7 @@ ZW4uCg 1211912703 2 - + @@ -1231,18 +1192,17 @@ ZW4uCg - + 0 YES YES - + {564, 308} - {{0, 0}, {1280, 938}} {320, 262} @@ -1259,10 +1219,11 @@ ZW4uCg View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -1472,6 +1433,7 @@ ZW4uCg 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1518,12 +1480,11 @@ ZW4uCg {{20, 20}, {318, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1551,7 +1512,6 @@ ZW4uCg {454, 271} - {{0, 0}, {1280, 938}} {320, 262} @@ -1749,14 +1709,6 @@ ZW4uCg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1805,14 +1757,6 @@ ZW4uCg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2564,27 +2508,9 @@ ZW4uCg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2777,16 +2703,6 @@ ZW4uCg - - 100371 - - - - - 100372 - - - 100382 @@ -3266,8 +3182,6 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3275,11 +3189,9 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3304,7 +3216,7 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - {{310, 988}, {127, 23}} + {{168, 821}, {113, 23}} com.apple.InterfaceBuilder.CocoaPlugin {{202, 626}, {154, 153}} @@ -3319,13 +3231,13 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - {{370, 868}, {313, 143}} + {{349, 868}, {315, 143}} com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 565}, {564, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 565}, {564, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3336,7 +3248,7 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - {{203, 978}, {131, 33}} + {{58, 803}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin {{100, 746}, {155, 33}} @@ -3355,7 +3267,7 @@ ZW4uCg {320, 240} com.apple.InterfaceBuilder.CocoaPlugin - {{145, 1011}, {356, 20}} + {{145, 1011}, {336, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{67, 819}, {336, 20}} @@ -3405,7 +3317,6 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3429,14 +3340,10 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3467,10 +3374,6 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3497,12 +3400,10 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - {{440, 988}, {128, 23}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{84, 998}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3537,7 +3438,7 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - {{157, 808}, {319, 203}} + {{20, 641}, {218, 203}} com.apple.InterfaceBuilder.CocoaPlugin {{79, 616}, {218, 203}} @@ -3585,6 +3486,259 @@ ZW4uCg + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib index 9523b392e..4063cfba9 100644 Binary files a/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings index 03415026e..bf2089ca1 100644 Binary files a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib index 7609393ba..bbf7eda62 100644 --- a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 10D573 - 761 - 1038.29 - 460.00 + 10J541 + 850 + 1038.35 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 761 + 850 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -388,7 +391,7 @@ 1 - + 256 @@ -396,7 +399,6 @@ 256 {{18, 210}, {402, 18}} - YES 67239424 @@ -424,7 +426,6 @@ 256 {{36, 60}, {385, 31}} - YES 67239424 @@ -461,7 +462,6 @@ 256 {{36, 162}, {385, 42}} - YES 67239424 @@ -479,7 +479,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 97}, {402, 18}} - YES 67239424 @@ -501,7 +500,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 126}, {385, 14}} - YES 67239424 @@ -518,7 +516,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 146}, {402, 18}} - YES 67239424 @@ -540,7 +537,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, -1}, {385, 31}} - YES 67239424 @@ -557,7 +553,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 36}, {402, 18}} - YES 67239424 @@ -576,8 +571,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg {{10, 33}, {438, 246}} - - Input @@ -588,51 +581,15 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Use system alert effect - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{36, 29}, {385, 28}} - - YES - - 67239424 - 4194304 - X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel. - - - - - - 256 {{74, 202}, {128, 26}} + YES -2076049856 @@ -723,6 +680,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{17, 205}, {55, 20}} + YES 67239424 @@ -739,6 +697,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 183}, {392, 14}} + YES 67239424 @@ -755,6 +714,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{18, 149}, {409, 23}} + YES 67239424 @@ -776,6 +736,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{37, 83}, {409, 23}} + YES 67239424 @@ -797,6 +758,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 256 {{36, 112}, {385, 31}} + YES 67239424 @@ -810,6 +772,8 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg {{10, 33}, {438, 246}} + + Output @@ -1212,13 +1176,13 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - + 0 YES YES - + @@ -1732,14 +1696,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1788,14 +1744,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2547,27 +2495,9 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2760,16 +2690,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg - - 100371 - - - - - 100372 - - - 100382 @@ -3249,8 +3169,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3443,10 +3361,6 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3582,6 +3496,76 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg id id + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + NSMenuItem NSTableView @@ -3614,6 +3598,128 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg NSMenuItem NSMenuItem + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + IBDocumentRelativeSource ../../../X11Controller.h diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib index 888424dfc..836d59532 100644 Binary files a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/French.lproj/locversion.plist b/hw/xquartz/bundle/Resources/French.lproj/locversion.plist index 877a10c9d..1af1256c3 100644 --- a/hw/xquartz/bundle/Resources/French.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/French.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 98 + 101 LprojLocale fr LprojRevisionLevel 1 LprojVersion - 98 + 101 diff --git a/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib index d35e44f59..cec363241 100644 --- a/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A194b - 787 - 1079 - 502.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 787 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -407,7 +410,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -490,7 +493,7 @@ A 1211912703 2 - + @@ -529,7 +532,7 @@ A 1211912703 2 - + @@ -567,7 +570,7 @@ A 1211912703 2 - + @@ -587,48 +590,9 @@ A 2 - + 256 - - - 256 - {{34, 84}, {402, 18}} - - YES - - 67239424 - 0 - Utiliser l’effet d’avertissement du système - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{52, 50}, {385, 28}} - - YES - - 67239424 - 4194304 - Les sons émis par X11 utiliseront l’avertissement standard du système, comme défini dans le panneau Effets sonores des Préférences Système. - - - - - - - 256 @@ -765,7 +729,7 @@ A 1211912703 2 - + @@ -787,7 +751,7 @@ A 1211912703 2 - + @@ -814,6 +778,7 @@ A {{10, 33}, {536, 267}} + Sortie @@ -841,7 +806,7 @@ A 1211912703 2 - + @@ -879,7 +844,7 @@ A 1211912703 2 - + @@ -901,7 +866,7 @@ A 1211912703 2 - + @@ -923,7 +888,7 @@ A 1211912703 2 - + @@ -945,7 +910,7 @@ A 1211912703 2 - + @@ -997,7 +962,7 @@ A 2 - + 256 @@ -1014,7 +979,7 @@ A 1211912703 2 - + @@ -1053,7 +1018,7 @@ A 1211912703 2 - + @@ -1092,7 +1057,7 @@ A 1211912703 2 - + @@ -1119,7 +1084,6 @@ A {{10, 33}, {536, 267}} - Fenêtres @@ -1144,7 +1108,7 @@ A 1211912703 2 - + @@ -1166,7 +1130,7 @@ A 1211912703 2 - + @@ -1233,13 +1197,13 @@ A - + 0 YES YES - + @@ -1477,6 +1441,7 @@ A 0 YES 0 + 1 {{1, 17}, {333, 198}} @@ -1503,7 +1468,7 @@ A 1 _doScroller: - 0.97368421052631582 + 0.68852460000000004 @@ -1523,11 +1488,12 @@ A {{20, 20}, {350, 231}} - 50 + 133170 + QSAAAEEgAABBmAAAQZgAAA @@ -1752,14 +1718,6 @@ A 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1808,14 +1766,6 @@ A 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2567,27 +2517,9 @@ A - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2780,16 +2712,6 @@ A - - 100371 - - - - - 100372 - - - 100382 @@ -3269,8 +3191,6 @@ A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3278,13 +3198,11 @@ A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{318, 756}, {64, 6}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3307,7 +3225,7 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{176, 789}, {120, 23}} + {{168, 821}, {113, 23}} com.apple.InterfaceBuilder.CocoaPlugin {{202, 626}, {154, 153}} @@ -3322,13 +3240,13 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{242, 669}, {365, 143}} + {{349, 868}, {315, 143}} com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{575, 463}, {582, 329}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{575, 463}, {582, 329}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3339,17 +3257,17 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{74, 779}, {171, 33}} + {{58, 803}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{838, 503}, {548, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{838, 503}, {548, 271}} + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3358,7 +3276,7 @@ A {320, 240} com.apple.InterfaceBuilder.CocoaPlugin - {{16, 812}, {356, 20}} + {{145, 1011}, {336, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{67, 819}, {336, 20}} @@ -3410,27 +3328,19 @@ A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3439,14 +3349,10 @@ A com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3477,10 +3383,6 @@ A com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3491,7 +3393,6 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{274, 290}, {155, 83}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3508,12 +3409,10 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{311, 789}, {128, 23}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{567, 341}, {150, 33}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3524,7 +3423,6 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{717, 331}, {171, 33}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3549,7 +3447,7 @@ A com.apple.InterfaceBuilder.CocoaPlugin - {{28, 609}, {290, 203}} + {{20, 641}, {218, 203}} com.apple.InterfaceBuilder.CocoaPlugin {{79, 616}, {218, 203}} @@ -3597,6 +3495,259 @@ A + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib index 981332331..3443780f1 100644 Binary files a/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/German.lproj/locversion.plist b/hw/xquartz/bundle/Resources/German.lproj/locversion.plist index 061f05311..caf0364c7 100644 --- a/hw/xquartz/bundle/Resources/German.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/German.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 102 LprojLocale de LprojRevisionLevel 1 LprojVersion - 97 + 102 diff --git a/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib index f2ae22d37..dea837bce 100644 --- a/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib @@ -2,13 +2,13 @@ 1040 - 10A432 - 732 - 1038 - 437.00 + 11A289 + 844 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 844 @@ -369,10 +369,11 @@ View - {3.40282e+38, 3.40282e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -380,14 +381,13 @@ 256 {{13, 10}, {579, 286}} - 1 - + 256 @@ -395,7 +395,6 @@ 256 {{18, 211}, {402, 18}} - YES 67239424 @@ -409,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -427,7 +426,6 @@ 256 {{36, 60}, {376, 28}} - YES 67239424 @@ -446,7 +444,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -465,7 +463,6 @@ 256 {{36, 171}, {385, 34}} - YES 67239424 @@ -485,7 +482,6 @@ dmllcmVuLgo 256 {{18, 94}, {402, 18}} - YES 67239424 @@ -495,7 +491,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -508,7 +504,6 @@ dmllcmVuLgo 256 {{36, 118}, {385, 28}} - YES 67239424 @@ -526,7 +521,6 @@ dmllcmVuLgo 256 {{18, 152}, {402, 18}} - YES 67239424 @@ -536,7 +530,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -549,7 +543,6 @@ dmllcmVuLgo 256 {{36, -1}, {385, 31}} - YES 67239424 @@ -566,7 +559,6 @@ dmllcmVuLgo 256 {{18, 36}, {402, 18}} - YES 67239424 @@ -576,7 +568,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -586,8 +578,6 @@ dmllcmVuLgo {{10, 33}, {559, 240}} - - Eingabe @@ -598,48 +588,9 @@ dmllcmVuLgo 2 - + 256 - - - 256 - {{15, 61}, {402, 18}} - - YES - - 67239424 - 0 - System-Warneffekte verwenden - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{33, 27}, {385, 28}} - - YES - - 67239424 - 4194304 - X11 verwendet als akustischen Signalton den Standard-Warnton, wie in der Systemeinstellung „Toneffekte“ festgelegt. - - - - - - - 256 @@ -776,7 +727,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -798,7 +749,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -825,6 +776,7 @@ dmllcmVuLgo {{10, 33}, {559, 240}} + Ausgabe @@ -852,7 +804,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -890,7 +842,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -912,7 +864,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -934,7 +886,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -956,7 +908,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -967,7 +919,7 @@ dmllcmVuLgo 256 - {{48, 129}, {401, 28}} + {{48, 124}, {401, 28}} YES @@ -1025,7 +977,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -1063,7 +1015,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -1101,7 +1053,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -1151,7 +1103,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -1173,7 +1125,7 @@ dmllcmVuLgo 1211912703 2 - + @@ -1240,23 +1192,21 @@ dmllcmVuLgo - + 0 YES YES - + {613, 302} - - {{0, 0}, {1440, 878}} {320, 262} - {3.40282e+38, 3.40282e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1269,7 +1219,8 @@ dmllcmVuLgo View - {3.40282e+38, 3.40282e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {512, 240} @@ -1364,7 +1315,7 @@ dmllcmVuLgo 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1482,10 +1433,12 @@ dmllcmVuLgo 0 YES 0 + 1 {{1, 17}, {301, 198}} + 4 @@ -1497,7 +1450,7 @@ dmllcmVuLgo _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1507,7 +1460,7 @@ dmllcmVuLgo 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1517,6 +1470,7 @@ dmllcmVuLgo {{1, 0}, {301, 17}} + 4 @@ -1525,7 +1479,8 @@ dmllcmVuLgo {{20, 20}, {318, 231}} - 50 + + 133170 @@ -1561,7 +1516,7 @@ dmllcmVuLgo {{0, 0}, {1440, 878}} {512, 262} - {3.40282e+38, 3.40282e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1755,14 +1710,6 @@ dmllcmVuLgo 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1811,14 +1758,6 @@ dmllcmVuLgo 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2570,27 +2509,9 @@ dmllcmVuLgo - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2783,16 +2704,6 @@ dmllcmVuLgo - - 100371 - - - - - 100372 - - - 100382 @@ -3272,8 +3183,6 @@ dmllcmVuLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3327,9 +3236,9 @@ dmllcmVuLgo com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 554}, {613, 302}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 554}, {613, 302}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3346,10 +3255,11 @@ dmllcmVuLgo {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {512, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {512, 271}} + + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3414,7 +3324,6 @@ dmllcmVuLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3466,10 +3375,6 @@ dmllcmVuLgo com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3582,8 +3487,262 @@ dmllcmVuLgo + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3591,5 +3750,10 @@ dmllcmVuLgo YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib index 20ede8b1c..55b75a38a 100644 Binary files a/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/Italian.lproj/locversion.plist b/hw/xquartz/bundle/Resources/Italian.lproj/locversion.plist index 144d5da54..54ff76e94 100644 --- a/hw/xquartz/bundle/Resources/Italian.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/Italian.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale it LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/designable.nib index 2993e3a3c..37333dc50 100644 --- a/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -487,7 +491,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -526,7 +530,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -564,7 +568,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -574,7 +578,6 @@ Q29tYW5kby4KA {{10, 33}, {618, 246}} - Ingresso @@ -585,48 +588,9 @@ Q29tYW5kby4KA 2 - + 256 - - - 256 - {{66, 57}, {402, 18}} - - YES - - 67239424 - 0 - Utilizza effetto avviso sistema - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{84, 23}, {457, 28}} - - YES - - 67239424 - 4194304 - I bip di X11 utilizzeranno l'avviso sistema, come definito nel pannello Preferenze di Sistema degli Effetti sonori. - - - - - - - 256 @@ -763,7 +727,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -785,7 +749,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -812,6 +776,7 @@ Q29tYW5kby4KA {{10, 33}, {618, 246}} + Uscita @@ -839,7 +804,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -877,7 +842,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -899,7 +864,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -921,7 +886,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -943,7 +908,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1012,7 +977,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1050,7 +1015,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1088,7 +1053,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1115,7 +1080,7 @@ Q29tYW5kby4KA {{10, 33}, {618, 246}} - Windows + Finestre @@ -1138,7 +1103,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1160,7 +1125,7 @@ Q29tYW5kby4KA 1211912703 2 - + @@ -1227,13 +1192,13 @@ Q29tYW5kby4KA - + 0 YES YES - + @@ -1254,6 +1219,7 @@ Q29tYW5kby4KA View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1349,7 +1315,7 @@ Q29tYW5kby4KA 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1470,6 +1436,7 @@ Q29tYW5kby4KA 0 YES 0 + 1 {{1, 17}, {333, 198}} @@ -1486,7 +1453,7 @@ Q29tYW5kby4KA _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1496,7 +1463,7 @@ Q29tYW5kby4KA 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1516,12 +1483,11 @@ Q29tYW5kby4KA {{20, 20}, {350, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1746,14 +1712,6 @@ Q29tYW5kby4KA 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1802,14 +1760,6 @@ Q29tYW5kby4KA 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2561,27 +2511,9 @@ Q29tYW5kby4KA - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2774,16 +2706,6 @@ Q29tYW5kby4KA - - 100371 - - - - - 100372 - - - 100382 @@ -3263,8 +3185,6 @@ Q29tYW5kby4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3272,7 +3192,6 @@ Q29tYW5kby4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3319,10 +3238,9 @@ Q29tYW5kby4KA com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {664, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - - {{507, 548}, {664, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3339,10 +3257,11 @@ Q29tYW5kby4KA {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {546, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {546, 271}} + + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3424,14 +3343,10 @@ Q29tYW5kby4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3462,10 +3377,6 @@ Q29tYW5kby4KA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3578,8 +3489,262 @@ Q29tYW5kby4KA + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3587,5 +3752,10 @@ Q29tYW5kby4KA YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib index 79c41ea58..794de812f 100644 Binary files a/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist b/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist index 2f7e575e8..6c8948397 100644 --- a/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 102 LprojLocale ja LprojRevisionLevel 1 LprojVersion - 97 + 102 diff --git a/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib index d13f81fca..a800d3c9d 100644 --- a/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 784 - 1059 - 478.00 + 11A289 + 844 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 784 + 844 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,7 +369,8 @@ View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -440,7 +444,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -464,9 +468,9 @@ 67239424 4194304 T3B0aW9uIOOCreODvOOCkuaKvOOBl+OBn+OBvuOBvuOCr+ODquODg+OCr+OBmeOCi+OBqOODnuOCpuOC -ueOBruS4reODnOOCv+ODs+aTjeS9nOOBq+OBquOCiuOAgeOCs+ODnuODs+ODieOCreODvOOCkuaKvOOB -l+OBn+OBvuOBvuOCr+ODquODg+OCr+OBmeOCi+OBqOODnuOCpuOCueOBruWPs+ODnOOCv+ODs+aTjeS9 -nOOBq+OBquOCiuOBvuOBmeOAggo +ueOBruS4reODnOOCv+ODs+aTjeS9nOOBq+OBquOCiuOAgUNvbW1hbmQg44Kt44O844KS5oq844GX44Gf +44G+44G+44Kv44Oq44OD44Kv44GZ44KL44Go44Oe44Km44K544Gu5Y+z44Oc44K/44Oz5pON5L2c44Gr +44Gq44KK44G+44GZ44CCCg @@ -488,7 +492,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -527,7 +531,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -538,7 +542,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{36, -1}, {385, 31}} + {{36, -1}, {466, 31}} YES @@ -565,7 +569,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -575,7 +579,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{10, 33}, {538, 246}} - 入力 @@ -586,48 +589,9 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 2 - + 256 - - - 256 - {{18, 51}, {402, 18}} - - YES - - 67239424 - 0 - システムの警告エフェクトを使用 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 17}, {460, 28}} - - YES - - 67239424 - 4194304 - X11 のビープ音のために、“サウンドエフェクト”システム環境設定パネルに定義されているシステム標準の警告音を使用します。 - - - - - - - 256 @@ -764,7 +728,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -786,7 +750,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -813,6 +777,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{10, 33}, {538, 246}} + 出力 @@ -840,7 +805,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -851,7 +816,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{36, 188}, {463, 28}} + {{36, 188}, {488, 28}} YES @@ -878,7 +843,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -889,7 +854,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{37, 71}, {489, 18}} + {{37, 71}, {486, 18}} YES @@ -900,7 +865,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -922,7 +887,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -944,7 +909,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -955,7 +920,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{55, 125}, {445, 28}} + {{55, 125}, {469, 28}} YES @@ -971,7 +936,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{55, 12}, {451, 28}} + {{55, 12}, {469, 28}} YES @@ -1013,7 +978,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -1024,7 +989,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{36, 176}, {466, 28}} + {{36, 176}, {474, 28}} YES @@ -1052,7 +1017,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -1063,7 +1028,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{36, 126}, {490, 14}} + {{36, 126}, {474, 14}} YES @@ -1091,7 +1056,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -1102,7 +1067,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 - {{36, 62}, {464, 28}} + {{36, 62}, {474, 28}} YES @@ -1142,7 +1107,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -1164,7 +1129,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 1211912703 2 - + @@ -1231,13 +1196,13 @@ nOOBq+OBquOCiuOBvuOBmeOAggo - + 0 YES YES - + @@ -1245,7 +1210,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{0, 0}, {1440, 878}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1258,10 +1223,11 @@ nOOBq+OBquOCiuOBvuOBmeOAggo View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {454, 271} - + 256 @@ -1269,7 +1235,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 265 {{340, 191}, {105, 32}} - YES 67239424 @@ -1297,7 +1262,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 265 {{340, 159}, {105, 32}} - YES 67239424 @@ -1329,14 +1293,12 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 {301, 198} - YES 256 {301, 17} - @@ -1344,7 +1306,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 {{302, 0}, {16, 17}} - @@ -1358,7 +1319,7 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1479,11 +1440,11 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 0 YES 0 + 1 {{1, 17}, {301, 198}} - @@ -1494,21 +1455,19 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 256 {{302, 17}, {15, 198}} - _doScroller: - 0.99492377042770386 + 0.99492380000000002 256 {{1, 215}, {301, 15}} - 1 _doScroller: - 0.94357365369796753 + 0.68852460000000004 @@ -1518,7 +1477,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{1, 0}, {301, 17}} - @@ -1528,14 +1486,12 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{20, 20}, {318, 231}} - - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1543,7 +1499,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 265 {{340, 223}, {105, 32}} - YES -2080244224 @@ -1564,12 +1519,10 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {454, 271} - - {{0, 0}, {1440, 878}} {454, 293} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1763,14 +1716,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1819,14 +1764,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2578,27 +2515,9 @@ nOOBq+OBquOCiuOBvuOBmeOAggo - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2791,16 +2710,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo - - 100371 - - - - - 100372 - - - 100382 @@ -3280,8 +3189,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3289,7 +3196,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3362,7 +3268,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} - IBBuiltInLabel-Red {3.40282e+38, 3.40282e+38} @@ -3421,27 +3326,19 @@ nOOBq+OBquOCiuOBvuOBmeOAggo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3450,14 +3347,10 @@ nOOBq+OBquOCiuOBvuOBmeOAggo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3488,10 +3381,6 @@ nOOBq+OBquOCiuOBvuOBmeOAggo com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3604,6 +3493,259 @@ nOOBq+OBquOCiuOBvuOBmeOAggo + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib index c1a0d5b75..6700f64a6 100644 Binary files a/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist b/hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist index c648282a2..3e9ae7e4d 100644 --- a/hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale es LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib index 19e139bb7..a5d0f36ba 100644 --- a/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 784 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 784 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,10 +369,11 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -377,14 +381,13 @@ 256 {{13, 10}, {593, 292}} - 1 - + 256 @@ -392,7 +395,6 @@ 256 {{18, 215}, {402, 18}} - YES 67239424 @@ -406,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -424,7 +426,6 @@ 256 {{36, 65}, {501, 28}} - YES 67239424 @@ -462,7 +463,6 @@ 256 {{36, 181}, {501, 28}} - YES 67239424 @@ -481,7 +481,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA256 {{18, 99}, {402, 18}} - YES 67239424 @@ -491,7 +490,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -504,7 +503,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA256 {{36, 123}, {501, 28}} - YES 67239424 @@ -522,7 +520,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA256 {{18, 157}, {402, 18}} - YES 67239424 @@ -532,7 +529,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -545,7 +542,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA256 {{36, 7}, {501, 28}} - YES 67239424 @@ -562,7 +558,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA256 {{18, 41}, {402, 18}} - YES 67239424 @@ -572,7 +567,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -582,8 +577,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA {{10, 33}, {573, 246}} - - Entrada @@ -594,48 +587,9 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Usar el efecto de alerta del sistema - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {511, 28}} - - YES - - 67239424 - 4194304 - Los sonidos de X11 usarán el sonido de alerta estándar del sistema definido en la pestaña “Efectos de sonido” del panel Sonido de Preferencias del Sistema. - - - - - - - 256 @@ -772,7 +726,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -794,7 +748,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -821,6 +775,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA {{10, 33}, {573, 246}} + Salida @@ -848,7 +803,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -886,7 +841,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -908,7 +863,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -930,7 +885,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -952,7 +907,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1021,7 +976,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1059,7 +1014,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1097,7 +1052,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1147,7 +1102,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1169,7 +1124,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 1211912703 2 - + @@ -1236,19 +1191,17 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA - + 0 YES YES - + {619, 308} - - {{0, 0}, {1280, 938}} {320, 262} @@ -1265,6 +1218,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1350,7 +1304,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA - 121.73100280761719 + 105 62.730998992919922 1000 @@ -1417,7 +1371,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA - 82 + 99 10 1000 @@ -1481,6 +1435,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1507,7 +1462,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA1 _doScroller: - 0.96474358974358976 + 0.68852460000000004 @@ -1527,7 +1482,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA{{20, 20}, {318, 231}} - 50 + 133170 @@ -1756,14 +1711,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1812,14 +1759,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2571,27 +2510,9 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2784,16 +2705,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA - - 100371 - - - - - 100372 - - - 100382 @@ -3273,8 +3184,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KAcom.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3282,7 +3191,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KAcom.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3329,9 +3237,9 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KAcom.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 565}, {619, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 565}, {619, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3361,7 +3269,7 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA{320, 240} com.apple.InterfaceBuilder.CocoaPlugin - {{145, 986}, {375, 20}} + {{145, 1011}, {336, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{67, 819}, {336, 20}} @@ -3434,14 +3342,10 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KAcom.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3472,10 +3376,6 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3588,6 +3488,259 @@ IHBhcmEgYWN0aXZhciBlbCBib3TDs24gY2VudHJhbCBvIGRlcmVjaG8gZGVsIHJhdMOzbi4KA + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib index 806c0e84a..8ca8ccf60 100644 Binary files a/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/ar.lproj/locversion.plist b/hw/xquartz/bundle/Resources/ar.lproj/locversion.plist index 627fb3ea7..0fd47106e 100644 --- a/hw/xquartz/bundle/Resources/ar.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/ar.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 98 + 101 LprojLocale ar LprojRevisionLevel 1 LprojVersion - 98 + 101 diff --git a/hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib index 8bc6b618d..f5cc32825 100644 --- a/hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A194b - 787 - 1079 - 502.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 787 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -185,7 +188,7 @@ submenuAction: - التطبيقات + تطبيقات @@ -367,7 +370,7 @@ View - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -402,7 +405,7 @@ 1210864127 2 - + NSImage NSSwitch @@ -429,7 +432,7 @@ 1210864127 2 - + @@ -459,7 +462,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -508,7 +511,7 @@ {{10, 33}, {438, 246}} - أمان + الأمان @@ -534,7 +537,7 @@ 1210864127 2 - + @@ -572,7 +575,7 @@ 1210864127 2 - + @@ -610,7 +613,7 @@ 1210864127 2 - + @@ -637,7 +640,7 @@ {{10, 33}, {438, 246}} - Windows + النوافذ @@ -663,7 +666,7 @@ 1210864127 2 - + @@ -701,7 +704,7 @@ 1210864127 2 - + @@ -723,7 +726,7 @@ 1210864127 2 - + @@ -745,7 +748,7 @@ 1210864127 2 - + @@ -767,7 +770,7 @@ 1210864127 2 - + @@ -819,47 +822,9 @@ 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 67108992 - استخدام تأثير تنبيه النظام - - - 1210864127 - 2 - - - - - 200 - 25 - - - - - 256 - {{17, 29}, {385, 28}} - - YES - - 67239424 - 71303296 - تستخدم إشارات X11 الصوتية تنبيه النظام القياسي، كما هو محدد في لوحة تفضيلات النظام لمؤثرات الصوت. - - - - - - 256 @@ -878,9 +843,7 @@ 13 16 - - - + @@ -908,7 +871,7 @@ - 256 لونًا + ٢٥٦ لونًا 1048576 2147483647 @@ -996,7 +959,7 @@ 1210864127 2 - + @@ -1018,7 +981,7 @@ 1210864127 2 - + @@ -1035,7 +998,7 @@ 67239424 71303296 - تمكين نافذة X11 الجذري. استخدم ضغط مفاتيح الأوامر-الاختيار-A لدخول ومغادرة وضع ملء الشاشة. + تمكين نافذة X11 root. استخدم ضغط مفاتيح الأوامر-الاختيار-A لدخول ومغادرة وضع ملء الشاشة. @@ -1044,6 +1007,7 @@ {{10, 33}, {438, 246}} + الإخراج @@ -1054,7 +1018,7 @@ 1 - + 256 @@ -1071,7 +1035,7 @@ 1210864127 2 - + @@ -1128,7 +1092,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 1210864127 2 - + @@ -1145,7 +1109,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 67239424 71303296 - السماح بكتابة تغييرات قائمة الإدخال فوق مخطط مفاتيح X11 الحالي. + السماح لتغييرات قائمة الإدخال بالكتابة فوق مخطط مفاتيح X11 الحالي. @@ -1166,7 +1130,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 1210864127 2 - + @@ -1183,7 +1147,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 67239424 71303296 - عند التمكين، مفاتيح الخيار إرسال Alt_L و Alt_R X11 علامات المفتاح بدلًا من Mode_switch. + عند تمكينها، تقوم مفاتيح الاختيار بإرسال علامات المفتاح Alt_L و Alt_R X11 بدلًا من Mode_switch. @@ -1199,12 +1163,12 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 67239424 67108992 - مفاتيح الخيار إرسال Alt_L و Alt_R + مفاتيح الاختيار تقوم بإرسال Alt_L و Alt_R 1210864127 2 - + @@ -1214,20 +1178,19 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {{10, 33}, {438, 246}} - - إدخال + الإدخال - + 0 YES YES - + @@ -1235,7 +1198,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {{0, 0}, {1280, 938}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1249,10 +1212,10 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF View - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -1260,7 +1223,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 268 {{14, 191}, {100, 32}} - YES 67239424 @@ -1288,7 +1250,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 268 {{14, 159}, {100, 32}} - YES 67239424 @@ -1320,14 +1281,12 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 256 {301, 198} - YES 256 {301, 17} - @@ -1335,7 +1294,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 256 {{302, 0}, {16, 17}} - @@ -1398,7 +1356,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA @@ -1445,7 +1403,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 3 2 - + 6 System @@ -1464,11 +1422,11 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 0 YES 0 + 1 {{1, 17}, {301, 198}} - @@ -1479,21 +1437,19 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 256 {{302, 17}, {15, 198}} - _doScroller: - 0.99492377042770386 + 0.99492380000000002 256 {{1, 215}, {301, 15}} - 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1503,7 +1459,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {{1, 0}, {301, 17}} - @@ -1513,14 +1468,12 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {{116, 20}, {318, 231}} - - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1528,7 +1481,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 268 {{14, 223}, {100, 32}} - YES -2080244224 @@ -1549,12 +1501,10 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {454, 271} - - {{0, 0}, {1280, 938}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1581,7 +1531,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF submenuAction: - التطبيقات + تطبيقات @@ -1748,14 +1698,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1804,14 +1746,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2466,11 +2400,11 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 348 - - - + + + @@ -2563,27 +2497,9 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2776,16 +2692,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF - - 100371 - - - - - 100372 - - - 100382 @@ -2900,9 +2806,9 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF 296 - + @@ -3265,8 +3171,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3274,7 +3178,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3321,10 +3224,9 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{631, 535}, {484, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - - {{631, 535}, {484, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3332,7 +3234,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {3.40282e+38, 3.40282e+38} {320, 240} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin @@ -3342,10 +3243,11 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{209, 293}, {454, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{209, 293}, {454, 271}} + + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3430,9 +3332,7 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3463,10 +3363,6 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3579,6 +3475,259 @@ INmE2KrZhti02YrYtyDYstixINin2YTZhdin2YjYsyDYp9mE2KPZiNiz2Lcg2KPZiCDYp9mE2KPZitmF + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib index f86a5b9f2..f78f6a9c7 100644 Binary files a/hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/da.lproj/locversion.plist b/hw/xquartz/bundle/Resources/da.lproj/locversion.plist index c565c6f71..de5508ec1 100644 --- a/hw/xquartz/bundle/Resources/da.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/da.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale da LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib index 087c79245..fb13cdcdf 100644 --- a/hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -487,7 +491,7 @@ ZW4uCg 1211912703 2 - + @@ -526,7 +530,7 @@ ZW4uCg 1211912703 2 - + @@ -564,7 +568,7 @@ ZW4uCg 1211912703 2 - + @@ -574,7 +578,6 @@ ZW4uCg {{10, 33}, {438, 246}} - Indtastning @@ -585,48 +588,9 @@ ZW4uCg 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Brug systemets advarsler - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {351, 28}} - - YES - - 67239424 - 4194304 - Advarselslyde i X11 bruger systemets standardadvarsler, som er defineret i Lydeffekter i Systemindstillinger. - - - - - - - 256 @@ -763,7 +727,7 @@ ZW4uCg 1211912703 2 - + @@ -785,7 +749,7 @@ ZW4uCg 1211912703 2 - + @@ -812,6 +776,7 @@ ZW4uCg {{10, 33}, {438, 246}} + Resultat @@ -839,7 +804,7 @@ ZW4uCg 1211912703 2 - + @@ -877,7 +842,7 @@ ZW4uCg 1211912703 2 - + @@ -899,7 +864,7 @@ ZW4uCg 1211912703 2 - + @@ -921,7 +886,7 @@ ZW4uCg 1211912703 2 - + @@ -943,7 +908,7 @@ ZW4uCg 1211912703 2 - + @@ -1012,7 +977,7 @@ ZW4uCg 1211912703 2 - + @@ -1050,7 +1015,7 @@ ZW4uCg 1211912703 2 - + @@ -1067,7 +1032,7 @@ ZW4uCg 67239424 4194304 - Fokus i X11-vinduet følger markøren + Fokus i X11-vinduet følger markøren. @@ -1088,7 +1053,7 @@ ZW4uCg 1211912703 2 - + @@ -1138,7 +1103,7 @@ ZW4uCg 1211912703 2 - + @@ -1160,7 +1125,7 @@ ZW4uCg 1211912703 2 - + @@ -1227,13 +1192,13 @@ ZW4uCg - + 0 YES YES - + @@ -1254,6 +1219,7 @@ ZW4uCg View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1467,6 +1433,7 @@ ZW4uCg 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1513,12 +1480,11 @@ ZW4uCg {{20, 20}, {318, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1743,14 +1709,6 @@ ZW4uCg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1799,14 +1757,6 @@ ZW4uCg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2558,27 +2508,9 @@ ZW4uCg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2771,16 +2703,6 @@ ZW4uCg - - 100371 - - - - - 100372 - - - 100382 @@ -3260,8 +3182,6 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3454,10 +3374,6 @@ ZW4uCg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3570,8 +3486,262 @@ ZW4uCg + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3579,5 +3749,10 @@ ZW4uCg YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib index e5f27d575..eefa1cf65 100644 Binary files a/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/fi.lproj/locversion.plist b/hw/xquartz/bundle/Resources/fi.lproj/locversion.plist index 65cdba35c..4e86b4083 100644 --- a/hw/xquartz/bundle/Resources/fi.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/fi.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale fi LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/fi.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/fi.lproj/main.nib/designable.nib index 0c7cee1fd..3f654decd 100644 --- a/hw/xquartz/bundle/Resources/fi.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/fi.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A194b + 787 + 1079 + 502.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 787 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -486,7 +490,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -525,7 +529,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -536,7 +540,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 - {{56, -1}, {385, 31}} + {{56, -1}, {488, 31}} YES @@ -563,7 +567,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -573,7 +577,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{10, 33}, {584, 261}} - Syöte @@ -584,48 +587,9 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 2 - + 256 - - - 256 - {{42, 74}, {402, 18}} - - YES - - 67239424 - 0 - Käytä järjestelmän varoitustehostetta - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{60, 40}, {488, 28}} - - YES - - 67239424 - 4194304 - X11:n äänimerkit käyttävät normaalia järjestelmävaroitusta, joka määritellään Äänitehosteet-järjestelmäasetuspaneelissa. - - - - - - - 256 @@ -717,7 +681,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 - {{41, 220}, {55, 20}} + {{41, 220}, {45, 20}} YES @@ -762,7 +726,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -784,7 +748,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -811,6 +775,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{10, 33}, {584, 261}} + Tuloste @@ -838,7 +803,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -849,7 +814,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 - {{20, 181}, {534, 42}} + {{20, 189}, {527, 34}} YES @@ -876,7 +841,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -898,7 +863,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -920,7 +885,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -942,7 +907,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1011,7 +976,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1049,7 +1014,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1087,7 +1052,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1137,7 +1102,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1159,7 +1124,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 1211912703 2 - + @@ -1226,13 +1191,13 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA - + 0 YES YES - + @@ -1253,10 +1218,11 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA View + {1.7976931348623157e+308, 1.7976931348623157e+308} - {320, 240} + {450, 240} - + 256 @@ -1264,6 +1230,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 265 {{340, 191}, {115, 32}} + YES 67239424 @@ -1291,6 +1258,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 265 {{340, 159}, {115, 32}} + YES 67239424 @@ -1322,12 +1290,14 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 {301, 198} + YES 256 {301, 17} + @@ -1335,6 +1305,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 {{302, 0}, {16, 17}} + @@ -1348,7 +1319,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1470,6 +1441,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{1, 17}, {301, 198}} + @@ -1480,19 +1452,21 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 256 {{302, 17}, {15, 198}} + _doScroller: - 0.99492377042770386 + 0.99492380000000002 256 {{1, 215}, {301, 15}} + 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1502,6 +1476,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{1, 0}, {301, 17}} + @@ -1511,6 +1486,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{20, 20}, {318, 231}} + 50 @@ -1525,6 +1501,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 265 {{340, 223}, {115, 32}} + YES -2080244224 @@ -1545,9 +1522,11 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {469, 271} + + {{0, 0}, {1280, 938}} - {320, 262} + {450, 262} {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1742,14 +1721,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1798,14 +1769,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2557,27 +2520,9 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2770,16 +2715,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA - - 100371 - - - - - 100372 - - - 100382 @@ -3256,12 +3191,9 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3269,7 +3201,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3301,7 +3232,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin {{202, 626}, {154, 153}} - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin @@ -3319,6 +3249,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {{271, 666}, {301, 153}} {{507, 533}, {625, 323}} com.apple.InterfaceBuilder.CocoaPlugin + {{507, 533}, {625, 323}} {{184, 290}, {481, 345}} @@ -3346,7 +3277,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA {3.40282e+38, 3.40282e+38} - {320, 240} + {450, 240} com.apple.InterfaceBuilder.CocoaPlugin {{145, 1011}, {336, 20}} @@ -3375,11 +3306,8 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3404,27 +3332,19 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3433,14 +3353,10 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3471,10 +3387,6 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3501,13 +3413,10 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3592,6 +3501,7 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3599,5 +3509,10 @@ dGFpIEtvbWVudG8tbsOkcHDDpGltacOkIHBhaW5ldHR1bmEgb3NvaXRldHRhZXNzYS4KA YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib index da8c1acf8..3aa05c19a 100644 Binary files a/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/ko.lproj/locversion.plist b/hw/xquartz/bundle/Resources/ko.lproj/locversion.plist index 4b6a95abc..fe42fb24c 100644 --- a/hw/xquartz/bundle/Resources/ko.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/ko.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale ko LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/ko.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/ko.lproj/main.nib/designable.nib index ce6b2d171..3a0f69d9f 100644 --- a/hw/xquartz/bundle/Resources/ko.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/ko.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -487,7 +491,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -526,7 +530,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -564,7 +568,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -574,7 +578,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg {{10, 33}, {438, 246}} - 입력 @@ -585,48 +588,9 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - 시스템 경고 효과 사용 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {379, 28}} - - YES - - 67239424 - 4194304 - X11 경고음은 사운드 효과 시스템 환경설정 패널에서 정의된 표준 시스템 경고를 사용합니다. - - - - - - - 256 @@ -763,7 +727,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -785,7 +749,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -812,6 +776,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg {{10, 33}, {438, 246}} + 출력 @@ -839,7 +804,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -877,7 +842,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -899,7 +864,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -921,7 +886,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -943,7 +908,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1012,7 +977,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1050,7 +1015,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1088,7 +1053,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1138,7 +1103,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1160,7 +1125,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 1211912703 2 - + @@ -1227,13 +1192,13 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg - + 0 YES YES - + @@ -1254,6 +1219,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1467,6 +1433,7 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1513,12 +1480,11 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg {{20, 20}, {318, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1743,14 +1709,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1799,14 +1757,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2558,27 +2508,9 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2771,16 +2703,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg - - 100371 - - - - - 100372 - - - 100382 @@ -3260,8 +3182,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3454,10 +3374,6 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3570,8 +3486,262 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3579,5 +3749,10 @@ qbQsIO2BtOumre2VmOuKlCDrj5nslYggT3B0aW9uIOuYkOuKlCBDb21tYW5kIO2CpOulvCDtlajqu5gg YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib index f61614314..e7fd919ef 100644 Binary files a/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/no.lproj/locversion.plist b/hw/xquartz/bundle/Resources/no.lproj/locversion.plist index 417e57c02..0a1e68a7c 100644 --- a/hw/xquartz/bundle/Resources/no.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/no.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale no LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/no.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/no.lproj/main.nib/designable.nib index 8d1b79128..305f02a4a 100644 --- a/hw/xquartz/bundle/Resources/no.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/no.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 784 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 784 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,10 +369,11 @@ View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -377,14 +381,13 @@ 256 {{13, 10}, {458, 292}} - 1 - + 256 @@ -392,7 +395,6 @@ 256 {{18, 210}, {402, 18}} - YES 67239424 @@ -406,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -424,7 +426,6 @@ 256 {{36, 60}, {385, 28}} - YES 67239424 @@ -443,7 +444,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -462,7 +463,6 @@ 256 {{36, 162}, {385, 42}} - YES 67239424 @@ -481,7 +481,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 256 {{18, 94}, {402, 18}} - YES 67239424 @@ -491,7 +490,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -504,7 +503,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 256 {{36, 118}, {385, 28}} - YES 67239424 @@ -522,7 +520,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 256 {{18, 152}, {402, 18}} - YES 67239424 @@ -532,7 +529,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -545,7 +542,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 256 {{36, -1}, {385, 31}} - YES 67239424 @@ -562,7 +558,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 256 {{18, 36}, {402, 18}} - YES 67239424 @@ -572,7 +567,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -582,8 +577,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo {{10, 33}, {438, 246}} - - Inndata @@ -594,48 +587,9 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Bruk systemvarseleffekt - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {375, 28}} - - YES - - 67239424 - 4194304 - X11-lyder vil bruke lyden for et vanlig systemvarsel slik denne lyden er definert i Lydeffekter-valgpanelet. - - - - - - - 256 @@ -772,7 +726,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -794,7 +748,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -821,6 +775,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo {{10, 33}, {438, 246}} + Utdata @@ -848,7 +803,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -886,7 +841,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -908,7 +863,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -930,7 +885,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -952,7 +907,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1021,7 +976,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1059,7 +1014,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1097,7 +1052,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1147,7 +1102,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1169,7 +1124,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1211912703 2 - + @@ -1236,23 +1191,21 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo - + 0 YES YES - + {484, 308} - - {{0, 0}, {1280, 938}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1265,7 +1218,8 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1360,7 +1314,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1478,6 +1432,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1494,7 +1449,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1504,7 +1459,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1524,11 +1479,12 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo {{20, 20}, {318, 231}} - 50 + 133170 + QSAAAEEgAABBmAAAQZgAAA @@ -1559,7 +1515,7 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo {{0, 0}, {1280, 938}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1753,14 +1709,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1809,14 +1757,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2568,27 +2508,9 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2781,16 +2703,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo - - 100371 - - - - - 100372 - - - 100382 @@ -3270,8 +3182,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3279,7 +3189,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3326,9 +3235,9 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3345,11 +3254,11 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {485, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {485, 271}} + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3431,14 +3340,10 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3469,10 +3374,6 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3585,6 +3486,259 @@ IMOlIGFrdGl2ZXJlIGRlbiBtaWR0cmUgZWxsZXIgaMO4eXJlIG11c2VrbmFwcGVuLgo + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib index a287eabf8..87a12b611 100644 Binary files a/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/pl.lproj/locversion.plist b/hw/xquartz/bundle/Resources/pl.lproj/locversion.plist index 6dc0d45c1..be85c462a 100644 --- a/hw/xquartz/bundle/Resources/pl.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/pl.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale pl LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib index dca6bb2bf..1c6c8bbdf 100644 --- a/hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -257,7 +260,7 @@ - Miniaturka + Minimalizuj okno m 1048576 2147483647 @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -486,7 +490,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -525,7 +529,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -563,7 +567,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -573,7 +577,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg {{10, 33}, {538, 246}} - Wejście @@ -584,48 +587,9 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 2 - + 256 - - - 256 - {{64, 63}, {402, 18}} - - YES - - 67239424 - 0 - Korzystaj z systemowych dźwięków komunikatów - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{82, 29}, {385, 28}} - - YES - - 67239424 - 4194304 - X11 będzie korzystał ze standardowych systemowych dźwięków komunikatów, zdefiniowanych na karcie preferencji Efekty dźwiękowe. - - - - - - - 256 @@ -762,7 +726,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -784,7 +748,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -811,6 +775,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg {{10, 33}, {538, 246}} + Wyjście @@ -838,7 +803,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -876,7 +841,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -898,7 +863,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -920,7 +885,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -942,7 +907,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1011,7 +976,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1028,7 +993,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 67239424 4194304 - Lliknięcie nieaktywnego okna będzie powodowało jego uaktywnienie i przeniesienie do niego fokusu. + Kliknięcie nieaktywnego okna będzie powodowało jego uaktywnienie i przeniesienie do niego fokusu. @@ -1050,7 +1015,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1089,7 +1054,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1140,7 +1105,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1162,7 +1127,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1211912703 2 - + @@ -1229,13 +1194,13 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg - + 0 YES YES - + @@ -1256,6 +1221,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1351,7 +1317,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1472,6 +1438,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1488,7 +1455,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1498,7 +1465,7 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1518,12 +1485,11 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg {{20, 20}, {318, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1748,14 +1714,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1804,14 +1762,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2563,27 +2513,9 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2776,16 +2708,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg - - 100371 - - - - - 100372 - - - 100382 @@ -3265,8 +3187,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3274,7 +3194,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3321,10 +3240,9 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {584, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - - {{507, 548}, {584, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3427,14 +3345,10 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3465,10 +3379,6 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3581,8 +3491,262 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3590,5 +3754,10 @@ dWplIMWbcm9ka293eSBsdWIgcHJhd3kgcHJ6eWNpc2sgbXlzenkuCg YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib index d9672ee6a..273298a5b 100644 Binary files a/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/pt.lproj/locversion.plist b/hw/xquartz/bundle/Resources/pt.lproj/locversion.plist index 3b46498b4..74d039bb9 100644 --- a/hw/xquartz/bundle/Resources/pt.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/pt.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale pt LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib index ea9f5f321..0f376316b 100644 --- a/hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -296,8 +299,8 @@ Percorrer Janelas no Sentido Inverso - ~ - 1179914 + ` + 1179648 2147483647 @@ -315,7 +318,7 @@ - Trazer Tudo para Frente + Trazer Todas Para a Frente 1048576 2147483647 @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,13 +387,13 @@ 1 - + 256 256 - {{18, 210}, {402, 18}} + {{18, 214}, {402, 18}} YES @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -457,7 +461,7 @@ 256 - {{36, 162}, {548, 42}} + {{36, 166}, {548, 42}} YES @@ -487,7 +491,7 @@ ZS4KA 1211912703 2 - + @@ -498,13 +502,13 @@ ZS4KA 256 - {{36, 126}, {548, 14}} + {{36, 121}, {548, 28}} YES 67239424 4194304 - Permitir que as mudanças no menu de entrada sobreescrevam o mapa do teclado atual do X11. + Permite que as alterações feitas no menu de leiautes de teclado sobrescrevam o mapa de teclado atual do X11. @@ -515,7 +519,7 @@ ZS4KA 256 - {{18, 146}, {402, 18}} + {{18, 153}, {402, 18}} YES @@ -526,7 +530,7 @@ ZS4KA 1211912703 2 - + @@ -537,7 +541,7 @@ ZS4KA 256 - {{36, -1}, {385, 31}} + {{36, -1}, {548, 31}} YES @@ -564,7 +568,7 @@ ZS4KA 1211912703 2 - + @@ -574,7 +578,6 @@ ZS4KA {{10, 33}, {598, 246}} - Entrada @@ -585,48 +588,9 @@ ZS4KA 2 - + 256 - - - 256 - {{18, 70}, {402, 18}} - - YES - - 67239424 - 0 - Usar o efeito de aviso do sistema - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 36}, {548, 28}} - - YES - - 67239424 - 4194304 - Os bipes do X11 usarão o aviso do sistema padrão, conforme definido no painel de preferências do sistema Efeitos Sonoros. - - - - - - - 256 @@ -763,7 +727,7 @@ ZS4KA 1211912703 2 - + @@ -785,7 +749,7 @@ ZS4KA 1211912703 2 - + @@ -812,6 +776,7 @@ ZS4KA {{10, 33}, {598, 246}} + Saída @@ -839,7 +804,7 @@ ZS4KA 1211912703 2 - + @@ -877,7 +842,7 @@ ZS4KA 1211912703 2 - + @@ -899,7 +864,7 @@ ZS4KA 1211912703 2 - + @@ -921,7 +886,7 @@ ZS4KA 1211912703 2 - + @@ -943,7 +908,7 @@ ZS4KA 1211912703 2 - + @@ -1012,7 +977,7 @@ ZS4KA 1211912703 2 - + @@ -1050,7 +1015,7 @@ ZS4KA 1211912703 2 - + @@ -1088,7 +1053,7 @@ ZS4KA 1211912703 2 - + @@ -1138,7 +1103,7 @@ ZS4KA 1211912703 2 - + @@ -1160,7 +1125,7 @@ ZS4KA 1211912703 2 - + @@ -1227,13 +1192,13 @@ ZS4KA - + 0 YES YES - + @@ -1254,6 +1219,7 @@ ZS4KA View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1339,8 +1305,8 @@ ZS4KA - 132.73099999999999 - 62.731000000000002 + 132.73100280761719 + 62.730998992919922 1000 75628096 @@ -1467,6 +1433,7 @@ ZS4KA 0 YES 0 + 1 {{1, 17}, {333, 198}} @@ -1513,7 +1480,7 @@ ZS4KA {{20, 20}, {350, 231}} - 50 + 133170 @@ -1743,14 +1710,6 @@ ZS4KA 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1799,14 +1758,6 @@ ZS4KA 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2558,27 +2509,9 @@ ZS4KA - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2771,16 +2704,6 @@ ZS4KA - - 100371 - - - - - 100372 - - - 100382 @@ -3260,8 +3183,6 @@ ZS4KA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3454,10 +3375,6 @@ ZS4KA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3570,8 +3487,262 @@ ZS4KA + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3579,5 +3750,10 @@ ZS4KA YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib index 1b68c4588..ab90fb0ff 100644 Binary files a/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/pt_PT.lproj/locversion.plist b/hw/xquartz/bundle/Resources/pt_PT.lproj/locversion.plist index cf6548ad2..5c98e2a68 100644 --- a/hw/xquartz/bundle/Resources/pt_PT.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/pt_PT.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale pt_PT LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/designable.nib index 710d9eaa8..2494443e6 100644 --- a/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A194b + 787 + 1079 + 502.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 787 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,10 +369,11 @@ View - {1.7976931348623157e+308, 1.7976931348623157e+308} + + {3.4028235e+38, 3.4028235e+38} {320, 240} - + 256 @@ -377,13 +381,14 @@ 256 {{13, 10}, {607, 292}} + 1 - + 256 @@ -404,7 +409,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -440,7 +445,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -486,7 +491,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -525,7 +530,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -563,7 +568,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -573,7 +578,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo {{10, 33}, {587, 246}} - Entrada @@ -584,53 +588,15 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Utilizar o efeito de alerta do sistema - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 15}, {521, 42}} - - YES - - 67239424 - 4194304 - Os sinais sonoros do X11 utilizarão o alerta padrão do sistema, tal como estiver definido em Efeitos sonoros, nas preferências do sistema. - - - - - - - 256 {{68, 201}, {131, 26}} + YES -2076049856 @@ -719,6 +685,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 {{17, 205}, {55, 20}} + YES 67239424 @@ -736,6 +703,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 {{36, 183}, {392, 14}} + YES 67239424 @@ -753,6 +721,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 {{18, 149}, {409, 23}} + YES 67239424 @@ -762,7 +731,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -775,6 +744,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 {{37, 88}, {476, 18}} + YES 67239424 @@ -784,7 +754,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -797,6 +767,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 {{36, 115}, {521, 28}} + YES 67239424 @@ -811,6 +782,8 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo {{10, 33}, {587, 246}} + + Saída @@ -838,7 +811,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -865,7 +838,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 - {{24, 96}, {409, 23}} + {{24, 101}, {409, 23}} YES @@ -876,7 +849,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -887,7 +860,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 - {{24, 74}, {560, 18}} + {{24, 79}, {560, 18}} YES @@ -898,7 +871,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -909,7 +882,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 - {{24, 46}, {544, 23}} + {{24, 53}, {544, 22}} YES @@ -920,7 +893,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -942,7 +915,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -953,7 +926,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 - {{38, 125}, {509, 28}} + {{38, 130}, {509, 28}} YES @@ -969,7 +942,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 256 - {{38, 14}, {534, 28}} + {{38, 19}, {534, 28}} YES @@ -1011,7 +984,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -1049,7 +1022,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -1087,7 +1060,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -1137,7 +1110,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -1159,7 +1132,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1211912703 2 - + @@ -1226,21 +1199,23 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo - + 0 YES YES - + {633, 308} + + {{0, 0}, {1440, 878}} {320, 262} - {1.7976931348623157e+308, 1.7976931348623157e+308} + {3.4028235e+38, 3.4028235e+38} x11_prefs @@ -1253,7 +1228,8 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo View - {1.7976931348623157e+308, 1.7976931348623157e+308} + + {3.4028235e+38, 3.4028235e+38} {320, 240} @@ -1348,7 +1324,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 3 - MC4zMzMzMzI5OQA + MC4zMzMzMzI5ODU2AA 6 @@ -1482,7 +1458,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo _doScroller: - 0.99492380000000002 + 0.99492377042770386 @@ -1492,7 +1468,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 1 _doScroller: - 0.68852460000000004 + 0.68852460384368896 @@ -1517,7 +1493,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo - QSAAAEEgAABBmAAAQZgAAA @@ -1548,7 +1523,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo {{0, 0}, {1440, 878}} {320, 262} - {1.7976931348623157e+308, 1.7976931348623157e+308} + {3.4028235e+38, 3.4028235e+38} x11_apps @@ -1742,14 +1717,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1798,14 +1765,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2557,27 +2516,9 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2770,16 +2711,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo - - 100371 - - - - - 100372 - - - 100382 @@ -3259,8 +3190,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3314,9 +3243,10 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 565}, {484, 308}} + {{507, 548}, {633, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 565}, {484, 308}} + + {{507, 548}, {633, 308}} {{184, 290}, {481, 345}} @@ -3453,10 +3383,6 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3571,6 +3497,7 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3578,5 +3505,10 @@ cmEgYWN0aXZhciBvcyBib3TDtWVzIGNlbnRyYWwgb3UgZGlyZWl0byBkbyByYXRvLgo YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib index efae77699..4cf336129 100644 Binary files a/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/ru.lproj/locversion.plist b/hw/xquartz/bundle/Resources/ru.lproj/locversion.plist index 06b662be8..253725c41 100644 --- a/hw/xquartz/bundle/Resources/ru.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/ru.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale ru LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/ru.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/ru.lproj/main.nib/designable.nib index bba4ce614..97e1506f3 100644 --- a/hw/xquartz/bundle/Resources/ru.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/ru.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 732 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -315,7 +318,7 @@ - Все окна - на передний план + Все окна — на передний план 1048576 2147483647 @@ -366,6 +369,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -383,7 +387,7 @@ 1 - + 256 @@ -404,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -487,7 +491,7 @@ 1211912703 2 - + @@ -526,7 +530,7 @@ 1211912703 2 - + @@ -564,7 +568,7 @@ 1211912703 2 - + @@ -574,7 +578,6 @@ {{10, 33}, {558, 246}} - Вход @@ -585,48 +588,9 @@ 2 - + 256 - - - 256 - {{23, 70}, {402, 18}} - - YES - - 67239424 - 0 - Использовать системный эффект предупреждений - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{41, 31}, {494, 33}} - - YES - - 67239424 - 4194304 - Звуковые сигналы X11 будут использовать стандартные системные предупреждения, как это определено в панели «Звуковые эффекты» Системных настроек. - - - - - - - 256 @@ -763,7 +727,7 @@ 1211912703 2 - + @@ -785,7 +749,7 @@ 1211912703 2 - + @@ -812,6 +776,7 @@ {{10, 33}, {558, 246}} + Выход @@ -839,7 +804,7 @@ 1211912703 2 - + @@ -877,7 +842,7 @@ 1211912703 2 - + @@ -899,7 +864,7 @@ 1211912703 2 - + @@ -921,7 +886,7 @@ 1211912703 2 - + @@ -943,7 +908,7 @@ 1211912703 2 - + @@ -1012,7 +977,7 @@ 1211912703 2 - + @@ -1050,7 +1015,7 @@ 1211912703 2 - + @@ -1088,7 +1053,7 @@ 1211912703 2 - + @@ -1105,7 +1070,7 @@ 67239424 4194304 - Если включено, создание нового окна X11 повлечет за собой перемещение на передний план X11.app (вместо Finder.app, Terminal.app и т.д.) + Если включено, создание нового окна X11 повлечет за собой перемещение на передний план X11.app (вместо Finder.app, Terminal.app и т. д.) @@ -1133,12 +1098,12 @@ 67239424 0 - Проверять идентификации подключений + Проверять аутентификации подключений 1211912703 2 - + @@ -1160,7 +1125,7 @@ 1211912703 2 - + @@ -1194,7 +1159,7 @@ 67239424 4194304 - Если включено, проверка идентификации подключений должна быть также включена для гарантии работы системы безопасности. Если выключено, подключения из удаленных программ недоступны. + Если включено, проверка аутентификации подключений должна быть также включена для гарантии работы системы безопасности. Если выключено, подключения из удаленных программ недоступны. @@ -1227,13 +1192,13 @@ - + 0 YES YES - + @@ -1254,6 +1219,7 @@ View + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1467,6 +1433,7 @@ 0 YES 0 + 1 {{1, 17}, {351, 198}} @@ -1513,12 +1480,11 @@ {{10, 20}, {368, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1743,14 +1709,6 @@ 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1799,14 +1757,6 @@ 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2558,27 +2508,9 @@ - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2771,16 +2703,6 @@ - - 100371 - - - - - 100372 - - - 100382 @@ -3260,8 +3182,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3315,10 +3235,9 @@ com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {604, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - - {{507, 548}, {604, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3455,10 +3374,6 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3571,8 +3486,262 @@ + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3580,5 +3749,10 @@ YES ../X11.xcodeproj 3 + + {9, 8} + {7, 2} + {15, 15} + diff --git a/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib index 9c5cc85e7..4d441f7ef 100644 Binary files a/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/sv.lproj/locversion.plist b/hw/xquartz/bundle/Resources/sv.lproj/locversion.plist index 43e790ad5..ad63d54e4 100644 --- a/hw/xquartz/bundle/Resources/sv.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/sv.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 97 + 101 LprojLocale sv LprojRevisionLevel 1 LprojVersion - 97 + 101 diff --git a/hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib index 601aca4ba..715848e35 100644 --- a/hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib @@ -2,19 +2,22 @@ 1040 - 11A79a - 784 - 1059 - 478.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 784 + 851 com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -366,10 +369,11 @@ View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -377,14 +381,13 @@ 256 {{13, 10}, {458, 292}} - 1 - + 256 @@ -392,7 +395,6 @@ 256 {{18, 210}, {402, 18}} - YES 67239424 @@ -406,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -424,7 +426,6 @@ 256 {{36, 56}, {385, 31}} - YES 67239424 @@ -443,7 +444,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -462,7 +463,6 @@ 256 {{36, 164}, {385, 42}} - YES 67239424 @@ -481,7 +481,6 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 256 {{18, 91}, {402, 18}} - YES 67239424 @@ -491,7 +490,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -504,12 +503,11 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 256 {{36, 116}, {400, 29}} - YES 67239424 4194304 - Tillåter att ändringar i indatamenyn skriver över de befintliga X11-tangentkopplingarna. + Tillåter att ändringar i inmatningsmenyn skriver över de befintliga X11-tangentkopplingarna. @@ -522,7 +520,6 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 256 {{18, 149}, {402, 18}} - YES 67239424 @@ -532,7 +529,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -545,7 +542,6 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 256 {{36, 1}, {385, 31}} - YES 67239424 @@ -562,7 +558,6 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 256 {{18, 36}, {402, 18}} - YES 67239424 @@ -572,7 +567,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -582,8 +577,6 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo {{10, 33}, {438, 246}} - - Indata @@ -594,48 +587,9 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - Använd systemets varningseffekt - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {385, 28}} - - YES - - 67239424 - 4194304 - X11-ljudet blir det vanliga systemvarningsljudet som valts på inställningspanelen Ljudeffekter i Systeminställningar. - - - - - - - 256 @@ -772,7 +726,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -794,7 +748,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -821,6 +775,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo {{10, 33}, {438, 246}} + Utdata @@ -848,7 +803,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -886,7 +841,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -908,7 +863,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -930,7 +885,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -952,7 +907,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -1021,7 +976,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 1211912703 2 - + @@ -1038,9 +993,7 @@ ciBzw6UgYWt0aXZlcmFzIG11c2VucyBtaXR0LSByZXNwZWt0aXZlIGjDtmdlcmtuYXBwLgo 67239424 4194304 - TWVkIGRldCBow6RyIGFsdGVybmF0aXZldCBrb21tZXIgZXR0IGtsaWNrIHDDpSBldHQgaW5ha3RpdnQg -ZsO2bnN0ZXIgYsOlZGUgYWt0aXZlcmEgZsO2bnN0cmV0IG9jaCBsw6V0YSBtdXNrbGlja2V0IHDDpXZl -cmthIGlubmVow6VsbGV0Lgo + Med det här alternativet kommer ett klick på ett inaktivt fönster både aktivera fönstret och låta musklicket påverka innehållet. @@ -1062,7 +1015,7 @@ cmthIGlubmVow6VsbGV0Lgo 1211912703 2 - + @@ -1101,7 +1054,7 @@ cmthIGlubmVow6VsbGV0Lgo 1211912703 2 - + @@ -1152,7 +1105,7 @@ cmthIGlubmVow6VsbGV0Lgo 1211912703 2 - + @@ -1174,7 +1127,7 @@ cmthIGlubmVow6VsbGV0Lgo 1211912703 2 - + @@ -1241,23 +1194,21 @@ cmthIGlubmVow6VsbGV0Lgo - + 0 YES YES - + {484, 308} - - {{0, 0}, {1440, 878}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1270,7 +1221,8 @@ cmthIGlubmVow6VsbGV0Lgo View - {3.4028235e+38, 3.4028235e+38} + + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} @@ -1365,7 +1317,7 @@ cmthIGlubmVow6VsbGV0Lgo 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1486,10 +1438,12 @@ cmthIGlubmVow6VsbGV0Lgo 0 YES 0 + 1 {{1, 17}, {301, 198}} + 4 @@ -1501,7 +1455,7 @@ cmthIGlubmVow6VsbGV0Lgo _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1511,7 +1465,7 @@ cmthIGlubmVow6VsbGV0Lgo 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1521,6 +1475,7 @@ cmthIGlubmVow6VsbGV0Lgo {{1, 0}, {301, 17}} + 4 @@ -1529,7 +1484,8 @@ cmthIGlubmVow6VsbGV0Lgo {{20, 20}, {318, 231}} - 50 + + 133170 @@ -1565,7 +1521,7 @@ cmthIGlubmVow6VsbGV0Lgo {{0, 0}, {1440, 878}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1759,14 +1715,6 @@ cmthIGlubmVow6VsbGV0Lgo 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1815,14 +1763,6 @@ cmthIGlubmVow6VsbGV0Lgo 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2574,27 +2514,9 @@ cmthIGlubmVow6VsbGV0Lgo - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2787,16 +2709,6 @@ cmthIGlubmVow6VsbGV0Lgo - - 100371 - - - - - 100372 - - - 100382 @@ -3276,8 +3188,6 @@ cmthIGlubmVow6VsbGV0Lgo com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3331,9 +3241,9 @@ cmthIGlubmVow6VsbGV0Lgo com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3350,11 +3260,11 @@ cmthIGlubmVow6VsbGV0Lgo {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {496, 271}} + {{68, 585}, {454, 271}} com.apple.InterfaceBuilder.CocoaPlugin - {{68, 585}, {496, 271}} + {{68, 585}, {454, 271}} {{433, 406}, {486, 327}} @@ -3470,10 +3380,6 @@ cmthIGlubmVow6VsbGV0Lgo com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3586,6 +3492,259 @@ cmthIGlubmVow6VsbGV0Lgo + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib index c623b1ad8..3087e65ce 100644 Binary files a/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings index 7706fe541..042f9483a 100644 Binary files a/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings differ diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/locversion.plist b/hw/xquartz/bundle/Resources/zh_CN.lproj/locversion.plist index c2c6a557a..47c52a9f8 100644 --- a/hw/xquartz/bundle/Resources/zh_CN.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/zh_CN.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 99 + 101 LprojLocale zh_CN LprojRevisionLevel 1 LprojVersion - 99 + 101 diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib index 13cf11e0d..4ed57f3ab 100644 --- a/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib @@ -1,3597 +1,3517 @@ - - 1040 - 11A194b - 787 - 1079 - 502.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 787 - - - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - NSApplication - - - - FirstResponder - - - NSApplication - - - MainMenu - - - - X11 - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - X11 - - - - 关于 X11 - - 2147483647 - - - - - - 偏好设置… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 服务 - - 1048576 - 2147483647 - - - submenuAction: - - 服务 - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 开关全屏幕 - a - 1572864 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 隐藏 X11 - h - 1048576 - 2147483647 - - - 42 - - - - 隐藏其他 - h - 1572864 - 2147483647 - - - - - - 全部显示 - - 1048576 - 2147483647 - - - 42 - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 退出 X11 - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - 应用程序 - - 1048576 - 2147483647 - - - submenuAction: - - 应用程序 - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 自定… - - 1048576 - 2147483647 - - - - - - - - - 编辑 - - 1048576 - 2147483647 - - - submenuAction: - - 编辑 - - - - 拷贝 - c - 1048576 - 2147483647 - - - - - - - - - 窗口 - - 1048576 - 2147483647 - - - submenuAction: - - 窗口 - - - - 关闭 - w - 1048576 - 2147483647 - - - - - - 最小化 - m - 1048576 - 2147483647 - - - - - - 缩放 - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 循环显示窗口 - ` - 1048840 - 2147483647 - - - - - - 反向循环显示窗口 - ~ - 1179914 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 前置全部窗口 - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - 帮助 - - 1048576 - 2147483647 - - - submenuAction: - - 帮助 - - - - X11 帮助 - - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - X11Controller - - - 3 - 2 - {{240, 335}, {484, 308}} - 1350041600 - X11 偏好设置 - NSPanel - - View - - - {1.7976931348623157e+308, 1.7976931348623157e+308} - {320, 240} - - - 256 - - - - 256 - {{13, 10}, {458, 292}} - - - - - 1 - - - - 256 - - - - 256 - {{18, 210}, {402, 18}} - - YES - - 67239424 - 0 - 模拟三按键鼠标 - - LucidaGrande - 13 - 1044 - - - 1211912703 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - - - - 256 - {{36, 45}, {385, 31}} - - YES - - 67239424 - 4194304 - 启用时,菜单栏等效键可能会干扰使用元修饰键的 X11 应用程序。 - - LucidaGrande - 11 - 3100 - - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 256 - {{36, 162}, {385, 42}} - - YES - - 67239424 - 4194304 - 6K+35oyJ5L2PIE9wdGlvbiDmiJYgQ29tbWFuZCDngrnmjInku6Xmv4DmtLvkuK3pl7TmiJblj7Povrnn + + 1040 + 11A289 + 851 + 1094.2 + 521.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 851 + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + + NSApplication + + + + FirstResponder + + + NSApplication + + + MainMenu + + + + X11 + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + X11 + + + + 关于 X11 + + 2147483647 + + + + + + 偏好设置… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 服务 + + 1048576 + 2147483647 + + + submenuAction: + + 服务 + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 开关全屏幕 + a + 1572864 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 隐藏 X11 + h + 1048576 + 2147483647 + + + 42 + + + + 隐藏其他 + h + 1572864 + 2147483647 + + + + + + 全部显示 + + 1048576 + 2147483647 + + + 42 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 退出 X11 + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + 应用程序 + + 1048576 + 2147483647 + + + submenuAction: + + 应用程序 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 自定… + + 1048576 + 2147483647 + + + + + + + + + 编辑 + + 1048576 + 2147483647 + + + submenuAction: + + 编辑 + + + + 拷贝 + c + 1048576 + 2147483647 + + + + + + + + + 窗口 + + 1048576 + 2147483647 + + + submenuAction: + + 窗口 + + + + 关闭 + w + 1048576 + 2147483647 + + + + + + 最小化 + m + 1048576 + 2147483647 + + + + + + 缩放 + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 循环显示窗口 + ` + 1048840 + 2147483647 + + + + + + 反向循环显示窗口 + ~ + 1179914 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 前置全部窗口 + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + 帮助 + + 1048576 + 2147483647 + + + submenuAction: + + 帮助 + + + + X11 帮助 + + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + X11Controller + + + 3 + 2 + {{240, 335}, {484, 308}} + 1350041600 + X11 偏好设置 + NSPanel + + View + + + {1.7976931348623157e+308, 1.7976931348623157e+308} + {320, 240} + + + 256 + + + + 256 + {{13, 10}, {458, 292}} + + + + + + 1 + + + + 256 + + + + 256 + {{18, 210}, {402, 18}} + + YES + + 67239424 + 0 + 模拟三按键鼠标 + + LucidaGrande + 13 + 1044 + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 256 + {{36, 45}, {385, 31}} + + YES + + 67239424 + 4194304 + 启用时,菜单栏等效键可能会干扰使用元修饰键的 X11 应用程序。 + + LucidaGrande + 11 + 3100 + + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 256 + {{36, 162}, {385, 42}} + + YES + + 67239424 + 4194304 + 6K+35oyJ5L2PIE9wdGlvbiDmiJYgQ29tbWFuZCDngrnmjInku6Xmv4DmtLvkuK3pl7TmiJblj7Povrnn moTpvKDmoIfmjInplK7jgIIKA - - - - - - - - - - 256 - {{18, 82}, {402, 18}} - - YES - - 67239424 - 0 - 在 X11 环境下启用等效键 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 126}, {385, 14}} - - YES - - 67239424 - 4194304 - 允许进行输入菜单更改以覆盖当前的 X11 键盘映射。 - - - - - - - - - - 256 - {{18, 146}, {402, 18}} - - YES - - 67239424 - 0 - 依照系统键盘布局 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, -1}, {385, 31}} - - YES - - 67239424 - 4194304 - 如果已启用,则 Option 键会发送 Alt_L 和 Alt_R X11 键符号,而不是发送 Mode_switch。 - - - - - - - - - 256 - {{18, 36}, {402, 18}} - - YES - - 67239424 - 0 - Option 键会发送 Alt_L 和 Alt_R - - - 1211912703 - 2 - - - - - 200 - 25 - - - - {{10, 33}, {438, 246}} - - - 输入 - - - - - - 2 - - - - 256 - - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - 使用系统警报效果 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {405, 28}} - - YES - - 67239424 - 4194304 - X11 警笛将使用标准的系统警报,具体如“声音效果”系统偏好设置面板中所定义。 - - - - - - - - - - 256 - {{59, 202}, {128, 26}} - - YES - - -2076049856 - 1024 - - - 109199615 - 1 - - LucidaGrande - 13 - 16 - - - - - - 400 - 75 - - - 从显示器 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - -1 - - - YES - - - OtherViews - - - - - - 256 种颜色 - - 1048576 - 2147483647 - - - _popUpItemAction: - 8 - - - - - 上万种 - - 1048576 - 2147483647 - - - _popUpItemAction: - 15 - - - - - 上千万种 - - 1048576 - 2147483647 - - - _popUpItemAction: - 24 - - - - - 3 - YES - YES - 1 - - - - - 256 - {{17, 206}, {43, 20}} - - YES - - 67239424 - 4194304 - 颜色: - - - - - - - - - - 256 - {{36, 183}, {392, 14}} - - YES - - 67239424 - 4194304 - 此选项会在再次开启 X11 时生效。 - - - - - - - - - - 256 - {{18, 149}, {409, 23}} - - YES - - 67239424 - 0 - 全屏幕模式 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{37, 83}, {409, 23}} - - YES - - 67239424 - 0 - 以全屏幕模式自动显示菜单栏 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 112}, {405, 31}} - - YES - - 67239424 - 4194304 - 启用 X11 根窗口。使用 Command-Option-A 击键来进入和离开全屏幕模式。 - - - - - - - - - {{10, 33}, {438, 246}} - - 输出 - - - - - - 2 - - - - 256 - - - - 256 - {{18, 222}, {409, 23}} - - YES - - 67239424 - 0 - 启用同步 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 188}, {385, 28}} - - YES - - 67239424 - 4194304 - 启用“拷贝”菜单项并允许 OSX“粘贴板”与 X11 CLIPBOARD 和 PRIMARY 缓冲区之间同步。 - - - - - - - - - 256 - {{34, 96}, {409, 23}} - - YES - - 67239424 - 0 - 粘贴板改变时更新 CLIPBOARD - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{34, 71}, {409, 23}} - - YES - - 67239424 - 0 - 粘贴板改变时更新 PRIMARY(点按鼠标中间键) - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{34, 46}, {409, 23}} - - YES - - 67239424 - 0 - 选定新文本时立即更新粘贴板 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{34, 159}, {409, 23}} - - YES - - 67239424 - 0 - CLIPBOARD 改变时更新粘贴板 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{48, 125}, {385, 28}} - - YES - - 67239424 - 4194304 - 如果您想要使用 xclipboard、klipper 或其他任何 X11 夹纸板管理程序,请停用此选项。 - - - - - - - - - 256 - {{48, 14}, {370, 28}} - - YES - - 67239424 - 4194304 - 由于 X11 协议中的限制,此选项在某些应用程序中可能无法工作。 - - - - - - - - {{10, 33}, {438, 246}} - - 粘贴板 - - - - - - 2 - - - - 256 - - - - 256 - {{15, 212}, {402, 18}} - - YES - - 67239424 - 0 - 点按各个不活跃窗口 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{23, 175}, {385, 31}} - - YES - - 67239424 - 4194304 - 启用时,点按不活跃窗口会激活窗口,除此以外,还将导致鼠标点按传递到该窗口。 - - - - - - - - - 256 - {{15, 151}, {402, 18}} - - YES - - 67239424 - 0 - 焦点跟随鼠标 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{23, 128}, {385, 17}} - - YES - - 67239424 - 4194304 - X11 窗口焦点跟随光标。这会产生一些不好的效果。 - - - - - - - - - 256 - {{15, 107}, {402, 18}} - - YES - - 67239424 - 0 - 聚焦新窗口 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{23, 73}, {385, 28}} - - YES - - 67239424 - 4194304 - 启用时,创建新 X11 窗口将导致 X11.app 移到最前面(而不是 Finder.app、终端.app 等应用程序移到最前面)。 - - - - - - - - {{10, 33}, {438, 246}} - - 窗口 - - - - - - - 256 - - - - 256 - {{18, 210}, {402, 18}} - - YES - - 67239424 - 0 - 鉴定连接 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{18, 133}, {402, 18}} - - YES - - 67239424 - 0 - 允许从网络客户端连接 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 162}, {385, 42}} - - YES - - 67239424 - 4194304 - 开启 X11 将创建 Xauthority 访问控制按键。如果系统的 IP 地址已更改,这些按键会变成无效的,这可能会阻止 X11 应用程序开启。 - - - - - - - - - - 256 - {{36, 85}, {385, 42}} - - YES - - 67239424 - 4194304 - 如果已启用,则必须也启用鉴定连接以确保系统安全。停用时,不允许远程应用程序的连接。 - - - - - - - - - - 256 - {{20, -16}, {404, 14}} - - YES - - 67239424 - 4194304 - 这些选项会在下一次开启 X11 时生效。 - - - - - - - - - {{10, 33}, {438, 246}} - - 安全性 - - - - - - - 0 - YES - YES - - - - - - {484, 308} - - {{0, 0}, {1280, 938}} - {320, 262} - {1.7976931348623157e+308, 1.7976931348623157e+308} - x11_prefs - - - 11 - 2 - {{279, 416}, {454, 271}} - 1350041600 - X11 应用程序菜单 - NSPanel - - View - - - {1.7976931348623157e+308, 1.7976931348623157e+308} - {320, 240} - - - 256 - - - - 265 - {{340, 191}, {100, 32}} - - YES - - 67239424 - 137887744 - 复制 - - - -2038284033 - 1 - - Helvetica - 13 - 16 - - - - - - 200 - 25 - - - - - 265 - {{340, 159}, {100, 32}} - - YES - - 67239424 - 137887744 - 移除 - - - -2038284033 - 1 - - - - - - 200 - 25 - - - - - 274 - - - - 2304 - - - - 256 - {301, 198} - - YES - - - 256 - {301, 17} - - - - - - 256 - {{302, 0}, {16, 17}} - - - - - 121.73100280761719 - 62.730998992919922 - 1000 - - 75628096 - 2048 - 名称 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - - - - 338820672 - 1024 - Text Cell - - - - - 3 - MQA - - - - 3 - YES - YES - - - - - 99 - 40 - 1000 - - 75628096 - 2048 - 命令 - - - - - - 338820672 - 1024 - Text Cell - - - - - - - 3 - YES - YES - - - - - 71 - 10 - 1000 - - 75628096 - 2048 - 快捷 - - - 6 - System - headerColor - - - - - - 338820672 - 1024 - Text Cell - - LucidaGrande - 12 - 16 - - - - YES - - 6 - System - controlBackgroundColor - - - - - 3 - YES - YES - - - - - 3 - 2 - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - 1379958784 - - - 1 - -1 - 0 - YES - 0 - - - {{1, 17}, {301, 198}} - - - - - 4 - - - - 256 - {{302, 17}, {15, 198}} - - - _doScroller: - 0.99492377042770386 - - - - 256 - {{1, 215}, {301, 15}} - - 1 - - _doScroller: - 0.68852460384368896 - - - - 2304 - - - - {{1, 0}, {301, 17}} - - - - - 4 - - - - {{20, 20}, {318, 231}} - - - 50 - - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 265 - {{340, 223}, {100, 32}} - - YES - - -2080244224 - 137887744 - 添加项 - - - -2038284033 - 1 - - - - - - 200 - 25 - - - - {454, 271} - - {{0, 0}, {1280, 938}} - {320, 262} - {1.7976931348623157e+308, 1.7976931348623157e+308} - x11_apps - - - 菜单 - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 应用程序 - - 1048576 - 2147483647 - - - submenuAction: - - 应用程序 - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - 自定… - - 1048576 - 2147483647 - - - - - - - - - - - - - - - copy: - - - - 181 - - - - minimize_window: - - - - 202 - - - - close_window: - - - - 205 - - - - zoom_window: - - - - 206 - - - - bring_to_front: - - - - 207 - - - - hideOtherApplications: - - - - 263 - - - - apps_separator - - - - 273 - - - - apps_table - - - - 301 - - - - apps_table_delete: - - - - 303 - - - - apps_table_duplicate: - - - - 304 - - - - apps_table_show: - - - - 308 - - - - apps_table_new: - - - - 311 - - - - prefs_show: - - - - 318 - - - - x11_about_item - - - - 321 - - - - enable_auth - - - - 387 - - - - enable_tcp - - - - 388 - - - - depth - - - - 389 - - - - use_sysbeep - - - - 390 - - - - fake_buttons - - - - 391 - - - - sync_keymap - - - - 392 - - - - enable_keyequivs - - - - 393 - - - - prefs_changed: - - - - 394 - - - - prefs_changed: - - - - 395 - - - - prefs_changed: - - - - 396 - - - - prefs_changed: - - - - 397 - - - - prefs_changed: - - - - 398 - - - - prefs_changed: - - - - 399 - - - - prefs_changed: - - - - 401 - - - - prefs_panel - - - - 402 - - - - x11_help: - - - - 422 - - - - dockMenu - - - - 426 - - - - dock_menu - - - - 428 - - - - delegate - - - - 429 - - - - hide: - - - - 430 - - - - unhideAllApplications: - - - - 431 - - - - orderFrontStandardAboutPanel: - - - - 433 - - - - dock_apps_menu - - - - 530 - - - - dock_window_separator - - - - 531 - - - - apps_table_show: - - - - 534 - - - - next_window: - - - - 539 - - - - previous_window: - - - - 540 - - - - enable_fullscreen - - - - 546 - - - - enable_fullscreen_changed: - - - - 547 - - - - toggle_fullscreen: - - - - 548 - - - - toggle_fullscreen_item - - - - 549 - - - - menu - - - - 300334 - - - - terminate: - - - - 300336 - - - - prefs_changed: - - - - 300389 - - - - prefs_changed: - - - - 300390 - - - - prefs_changed: - - - - 300391 - - - - click_through - - - - 300392 - - - - focus_follows_mouse - - - - 300393 - - - - focus_on_new_window - - - - 300394 - - - - copy_menu_item - - - - 300443 - - - - sync_pasteboard - - - - 300444 - - - - sync_clipboard_to_pasteboard - - - - 300461 - - - - sync_pasteboard_to_clipboard - - - - 300462 - - - - sync_pasteboard_to_primary - - - - 300463 - - - - sync_primary_immediately - - - - 300464 - - - - prefs_changed: - - - - 300465 - - - - prefs_changed: - - - - 300466 - - - - prefs_changed: - - - - 300467 - - - - prefs_changed: - - - - 300468 - - - - prefs_changed: - - - - 300469 - - - - sync_text1 - - - - 300470 - - - - sync_text2 - - - - 300471 - - - - enable_fullscreen_menu - - - - 300474 - - - - prefs_changed: - - - - 300475 - - - - prefs_changed: - - - - 300480 - - - - option_sends_alt - - - - 300481 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - MainMenu - - - 19 - - - - - - - - 24 - - - - - - - - - - - - - - - 5 - - - - - 23 - - - - - 92 - - - - - 203 - - - - - 204 - - - - - 536 - - - - - 537 - - - - - 538 - - - - - 56 - - - - - - - - 57 - - - - - - - - - - - - - - - - - - - 58 - - - - - 129 - - - - - 131 - - - - - - - - 130 - - - - - 134 - - - - - 136 - - - - - 143 - - - - - 144 - - - - - 145 - - - - - 149 - - - - - 150 - - - - - 544 - - - - - 545 - - - - - 163 - - - - - - - - 169 - - - - - - - - 157 - - - - - 269 - - - - - - - - 270 - - - - - - - - - 272 - - - - - 305 - - - - - 419 - - - - - - - - 420 - - - - - - - - 421 - - - - - 196 - - - X11Controller - - - 244 - - - - - - PrefsPanel - - - 245 - - - - - - - - 348 - - - - - - - - - - - - 349 - - - - - - - - 351 - - - - - - - - - - - - - - - 363 - - - - - - - - 364 - - - - - - - - 365 - - - - - - - - 368 - - - - - - - - 369 - - - - - - - - 370 - - - - - - - - 352 - - - - - - - - 350 - - - - - - - - - - - - - - - 371 - - - - - - - - 372 - - - - - - - - 382 - - - - - - - - 385 - - - - - - - - 386 - - - - - - - - 541 - - - - - - - - 543 - - - - - - - - 353 - - - - - - - - 354 - - - - - - - - - - - - 374 - - - - - - - - 375 - - - - - - - - 376 - - - - - - - - 377 - - - - - - - - 379 - - - - - - - - 285 - - - - - - EditPrograms - - - 286 - - - - - - - - - - - 423 - - - - - - - DockMenu - - - 524 - - - - - 526 - - - - - - - - 527 - - - - - - - - - 532 - - - - - 533 - - - - - 100363 - - - - - 100364 - - - - - 100365 - - - - - 100368 - - - - - 100369 - - - - - 100370 - - - - - 100371 - - - - - 100372 - - - - - 100382 - - - - - - - - 100385 - - - - - 100386 - - - - - 100541 - - - - - 100543 - - - - - 100374 - - - - - 100375 - - - - - 100376 - - - - - 100377 - - - - - 100379 - - - - - 380 - - - - - - - - - - - 435 - - - - - 384 - - - - - 383 - - - - - 381 - - - - - 295 - - - - - - - - - - - 300295 - - - - - 200295 - - - - - 100295 - - - - - 296 - - - - - - - - - - 535 - - - - - - - - 575 - - - - - 298 - - - - - - - - 573 - - - - - 297 - - - - - - - - 574 - - - - - 310 - - - - - - - - 100310 - - - - - 292 - - - - - - - - 100292 - - - - - 293 - - - - - - - - 100293 - - - - - 300337 - - - - - - - - 300338 - - - - - - - - - - - - - 300358 - - - - - - - - 300359 - - - - - - - - 300360 - - - - - 300361 - - - - - 300362 - - - - - - - - 300363 - - - - - 300364 - - - - - - - - 300365 - - - - - 300368 - - - - - - - - 300369 - - - - - 300370 - - - - - - - - 300371 - - - - - 300421 - - - - - - - - 300422 - - - - - - - - - - - - - - - 300423 - - - - - - - - 300424 - - - - - - - - 300440 - - - - - 300441 - - - - - 300447 - - - - - - - - 300450 - - - - - 300451 - - - - - - - - 300452 - - - - - 300453 - - - - - - - - 300454 - - - - - 300455 - - - - - - - - 300456 - - - - - 300457 - - - - - - - - 300458 - - - - - 300459 - - - - - - - - 300460 - - - - - 300472 - - - - - - - - 300473 - - - - - 300476 - - - - - - - - 300477 - - - - - - - - 300478 - - - - - 300479 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{168, 821}, {113, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{202, 626}, {154, 153}} - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{349, 868}, {315, 143}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{271, 666}, {301, 153}} - {{507, 548}, {484, 308}} - com.apple.InterfaceBuilder.CocoaPlugin - {{507, 548}, {484, 308}} - - {{184, 290}, {481, 345}} - - - {3.40282e+38, 3.40282e+38} - {320, 240} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{58, 803}, {155, 33}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{100, 746}, {155, 33}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{68, 585}, {454, 271}} - com.apple.InterfaceBuilder.CocoaPlugin - - - {{68, 585}, {454, 271}} - - {{433, 406}, {486, 327}} - - - {3.40282e+38, 3.40282e+38} - {320, 240} - com.apple.InterfaceBuilder.CocoaPlugin - - {{145, 1011}, {336, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{67, 819}, {336, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - IBBuiltInLabel-Red - com.apple.InterfaceBuilder.CocoaPlugin - - IBBuiltInLabel-Red - com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red - com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{20, 641}, {218, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{79, 616}, {218, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - 300481 - - - - - FirstResponder - NSObject - - IBUserSource - - - - - NSFormatter - NSObject - - IBUserSource - - - - - X11Controller - NSObject - - IBUserSource - - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - ../X11.xcodeproj - 3 - - {9, 8} - {7, 2} - {15, 15} - - + + + + + + + + + + 256 + {{18, 82}, {402, 18}} + + YES + + 67239424 + 0 + 在 X11 环境下启用等效键 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{36, 126}, {385, 14}} + + YES + + 67239424 + 4194304 + 允许进行输入菜单更改以覆盖当前的 X11 键盘映射。 + + + + + + + + + + 256 + {{18, 146}, {402, 18}} + + YES + + 67239424 + 0 + 依照系统键盘布局 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{36, -1}, {385, 31}} + + YES + + 67239424 + 4194304 + 如果已启用,则 Option 键会发送 Alt_L 和 Alt_R X11 键符号,而不是发送 Mode_switch。 + + + + + + + + + 256 + {{18, 36}, {402, 18}} + + YES + + 67239424 + 0 + Option 键会发送 Alt_L 和 Alt_R + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {{10, 33}, {438, 246}} + + 输入 + + + + + + 2 + + + + 256 + + + + 256 + {{59, 202}, {128, 26}} + + + YES + + -2076049856 + 1024 + + + 109199615 + 1 + + LucidaGrande + 13 + 16 + + + + + + 400 + 75 + + + 从显示器 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + -1 + + + YES + + + OtherViews + + + + + + 256 种颜色 + + 1048576 + 2147483647 + + + _popUpItemAction: + 8 + + + + + 上万种 + + 1048576 + 2147483647 + + + _popUpItemAction: + 15 + + + + + 上千万种 + + 1048576 + 2147483647 + + + _popUpItemAction: + 24 + + + + + 3 + YES + YES + 1 + + + + + 256 + {{17, 206}, {43, 20}} + + + YES + + 67239424 + 4194304 + 颜色: + + + + + + + + + + 256 + {{36, 183}, {392, 14}} + + + YES + + 67239424 + 4194304 + 此选项会在再次开启 X11 时生效。 + + + + + + + + + + 256 + {{18, 149}, {409, 23}} + + + YES + + 67239424 + 0 + 全屏幕模式 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{37, 83}, {409, 23}} + + + YES + + 67239424 + 0 + 以全屏幕模式自动显示菜单栏 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{36, 112}, {405, 31}} + + + YES + + 67239424 + 4194304 + 启用 X11 根窗口。使用 Command-Option-A 击键来进入和离开全屏幕模式。 + + + + + + + + + {{10, 33}, {438, 246}} + + + + 输出 + + + + + + 2 + + + + 256 + + + + 256 + {{18, 222}, {409, 23}} + + YES + + 67239424 + 0 + 启用同步 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{36, 188}, {385, 28}} + + YES + + 67239424 + 4194304 + 启用“拷贝”菜单项并允许 OSX“粘贴板”与 X11 CLIPBOARD 和 PRIMARY 缓冲区之间同步。 + + + + + + + + + 256 + {{34, 96}, {409, 23}} + + YES + + 67239424 + 0 + 粘贴板改变时更新 CLIPBOARD + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{34, 71}, {409, 23}} + + YES + + 67239424 + 0 + 粘贴板改变时更新 PRIMARY(点按鼠标中间键) + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{34, 46}, {409, 23}} + + YES + + 67239424 + 0 + 选定新文本时立即更新粘贴板 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{34, 159}, {409, 23}} + + YES + + 67239424 + 0 + CLIPBOARD 改变时更新粘贴板 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{48, 125}, {385, 28}} + + YES + + 67239424 + 4194304 + 如果您想要使用 xclipboard、klipper 或其他任何 X11 剪贴板管理程序,请停用此选项。 + + + + + + + + + 256 + {{48, 14}, {370, 28}} + + YES + + 67239424 + 4194304 + 由于 X11 协议中的限制,此选项在某些应用程序中可能无法工作。 + + + + + + + + {{10, 33}, {438, 246}} + + 粘贴板 + + + + + + 2 + + + + 256 + + + + 256 + {{15, 212}, {402, 18}} + + YES + + 67239424 + 0 + 点按各个不活跃窗口 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{23, 175}, {385, 31}} + + YES + + 67239424 + 4194304 + 启用时,点按不活跃窗口会激活窗口,除此以外,还将导致鼠标点按传递到该窗口。 + + + + + + + + + 256 + {{15, 151}, {402, 18}} + + YES + + 67239424 + 0 + 焦点跟随鼠标 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{23, 128}, {385, 17}} + + YES + + 67239424 + 4194304 + X11 窗口焦点跟随光标。这会产生一些不好的效果。 + + + + + + + + + 256 + {{15, 107}, {402, 18}} + + YES + + 67239424 + 0 + 聚焦新窗口 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{23, 73}, {395, 28}} + + YES + + 67239424 + 4194304 + 启用时,创建新 X11 窗口将导致 X11.app 移到最前面(而不是 Finder.app、终端.app 等应用程序移到最前面)。 + + + + + + + + {{10, 33}, {438, 246}} + + 窗口 + + + + + + + 256 + + + + 256 + {{18, 210}, {402, 18}} + + YES + + 67239424 + 0 + 鉴定连接 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{18, 133}, {402, 18}} + + YES + + 67239424 + 0 + 允许从网络客户端连接 + + + 1211912703 + 2 + + + + + 200 + 25 + + + + + 256 + {{36, 162}, {385, 42}} + + YES + + 67239424 + 4194304 + 开启 X11 将创建 Xauthority 访问控制按键。如果系统的 IP 地址已更改,这些按键会变成无效的,这可能会阻止 X11 应用程序开启。 + + + + + + + + + + 256 + {{36, 85}, {385, 42}} + + YES + + 67239424 + 4194304 + 如果已启用,则必须也启用鉴定连接以确保系统安全。停用时,不允许远程应用程序的连接。 + + + + + + + + + + 256 + {{20, -16}, {404, 14}} + + YES + + 67239424 + 4194304 + 这些选项会在下一次开启 X11 时生效。 + + + + + + + + + {{10, 33}, {438, 246}} + + 安全性 + + + + + + + 0 + YES + YES + + + + + + {484, 308} + + + + {{0, 0}, {1280, 938}} + {320, 262} + {1.7976931348623157e+308, 1.7976931348623157e+308} + x11_prefs + + + 11 + 2 + {{279, 416}, {454, 271}} + 1350041600 + X11 应用程序菜单 + NSPanel + + View + + + {1.7976931348623157e+308, 1.7976931348623157e+308} + {320, 240} + + + 256 + + + + 265 + {{340, 191}, {100, 32}} + + YES + + 67239424 + 137887744 + 复制 + + + -2038284033 + 1 + + Helvetica + 13 + 16 + + + + + + 200 + 25 + + + + + 265 + {{340, 159}, {100, 32}} + + YES + + 67239424 + 137887744 + 移除 + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + + 274 + + + + 2304 + + + + 256 + {301, 198} + + YES + + + 256 + {301, 17} + + + + + + 256 + {{302, 0}, {16, 17}} + + + + + 121.73100280761719 + 62.730998992919922 + 1000 + + 75628096 + 2048 + 名称 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 338820672 + 1024 + Text Cell + + + + + 3 + MQA + + + + 3 + YES + YES + + + + + 99 + 40 + 1000 + + 75628096 + 2048 + 命令 + + + + + + 338820672 + 1024 + Text Cell + + + + + + + 3 + YES + YES + + + + + 71 + 10 + 1000 + + 75628096 + 2048 + 快捷 + + + 6 + System + headerColor + + + + + + 338820672 + 1024 + Text Cell + + LucidaGrande + 12 + 16 + + + + YES + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 1379958784 + + + 1 + -1 + 0 + YES + 0 + 1 + + + {{1, 17}, {301, 198}} + + + + + 4 + + + + 256 + {{302, 17}, {15, 198}} + + + _doScroller: + 0.99492380000000002 + + + + 256 + {{1, 215}, {301, 15}} + + 1 + + _doScroller: + 0.68852460000000004 + + + + 2304 + + + + {{1, 0}, {301, 17}} + + + + + 4 + + + + {{20, 20}, {318, 231}} + + + 133170 + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 265 + {{340, 223}, {100, 32}} + + YES + + -2080244224 + 137887744 + 添加项目 + + + -2038284033 + 1 + + + + + + 200 + 25 + + + + {454, 271} + + {{0, 0}, {1280, 938}} + {320, 262} + {1.7976931348623157e+308, 1.7976931348623157e+308} + x11_apps + + + 菜单 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 应用程序 + + 1048576 + 2147483647 + + + submenuAction: + + 应用程序 + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + 自定… + + 1048576 + 2147483647 + + + + + + + + + + + + + + + copy: + + + + 181 + + + + minimize_window: + + + + 202 + + + + close_window: + + + + 205 + + + + zoom_window: + + + + 206 + + + + bring_to_front: + + + + 207 + + + + hideOtherApplications: + + + + 263 + + + + apps_separator + + + + 273 + + + + apps_table + + + + 301 + + + + apps_table_delete: + + + + 303 + + + + apps_table_duplicate: + + + + 304 + + + + apps_table_show: + + + + 308 + + + + apps_table_new: + + + + 311 + + + + prefs_show: + + + + 318 + + + + x11_about_item + + + + 321 + + + + enable_auth + + + + 387 + + + + enable_tcp + + + + 388 + + + + depth + + + + 389 + + + + fake_buttons + + + + 391 + + + + sync_keymap + + + + 392 + + + + enable_keyequivs + + + + 393 + + + + prefs_changed: + + + + 394 + + + + prefs_changed: + + + + 395 + + + + prefs_changed: + + + + 396 + + + + prefs_changed: + + + + 398 + + + + prefs_changed: + + + + 399 + + + + prefs_changed: + + + + 401 + + + + prefs_panel + + + + 402 + + + + x11_help: + + + + 422 + + + + dockMenu + + + + 426 + + + + dock_menu + + + + 428 + + + + delegate + + + + 429 + + + + hide: + + + + 430 + + + + unhideAllApplications: + + + + 431 + + + + orderFrontStandardAboutPanel: + + + + 433 + + + + dock_apps_menu + + + + 530 + + + + dock_window_separator + + + + 531 + + + + apps_table_show: + + + + 534 + + + + next_window: + + + + 539 + + + + previous_window: + + + + 540 + + + + enable_fullscreen + + + + 546 + + + + enable_fullscreen_changed: + + + + 547 + + + + toggle_fullscreen: + + + + 548 + + + + toggle_fullscreen_item + + + + 549 + + + + menu + + + + 300334 + + + + terminate: + + + + 300336 + + + + prefs_changed: + + + + 300389 + + + + prefs_changed: + + + + 300390 + + + + prefs_changed: + + + + 300391 + + + + click_through + + + + 300392 + + + + focus_follows_mouse + + + + 300393 + + + + focus_on_new_window + + + + 300394 + + + + copy_menu_item + + + + 300443 + + + + sync_pasteboard + + + + 300444 + + + + sync_clipboard_to_pasteboard + + + + 300461 + + + + sync_pasteboard_to_clipboard + + + + 300462 + + + + sync_pasteboard_to_primary + + + + 300463 + + + + sync_primary_immediately + + + + 300464 + + + + prefs_changed: + + + + 300465 + + + + prefs_changed: + + + + 300466 + + + + prefs_changed: + + + + 300467 + + + + prefs_changed: + + + + 300468 + + + + prefs_changed: + + + + 300469 + + + + sync_text1 + + + + 300470 + + + + sync_text2 + + + + 300471 + + + + enable_fullscreen_menu + + + + 300474 + + + + prefs_changed: + + + + 300475 + + + + prefs_changed: + + + + 300480 + + + + option_sends_alt + + + + 300481 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + MainMenu + + + 19 + + + + + + + + 24 + + + + + + + + + + + + + + + 5 + + + + + 23 + + + + + 92 + + + + + 203 + + + + + 204 + + + + + 536 + + + + + 537 + + + + + 538 + + + + + 56 + + + + + + + + 57 + + + + + + + + + + + + + + + + + + + 58 + + + + + 129 + + + + + 131 + + + + + + + + 130 + + + + + 134 + + + + + 136 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 149 + + + + + 150 + + + + + 544 + + + + + 545 + + + + + 163 + + + + + + + + 169 + + + + + + + + 157 + + + + + 269 + + + + + + + + 270 + + + + + + + + + 272 + + + + + 305 + + + + + 419 + + + + + + + + 420 + + + + + + + + 421 + + + + + 196 + + + X11Controller + + + 244 + + + + + + PrefsPanel + + + 245 + + + + + + + + 348 + + + + + + + + + + + + 349 + + + + + + + + 351 + + + + + + + + + + + + + + + 363 + + + + + + + + 364 + + + + + + + + 365 + + + + + + + + 368 + + + + + + + + 369 + + + + + + + + 370 + + + + + + + + 352 + + + + + + + + 350 + + + + + + + + + + + + + 382 + + + + + + + + 385 + + + + + + + + 386 + + + + + + + + 541 + + + + + + + + 543 + + + + + + + + 353 + + + + + + + + 354 + + + + + + + + + + + + 374 + + + + + + + + 375 + + + + + + + + 376 + + + + + + + + 377 + + + + + + + + 379 + + + + + + + + 285 + + + + + + EditPrograms + + + 286 + + + + + + + + + + + 423 + + + + + + + DockMenu + + + 524 + + + + + 526 + + + + + + + + 527 + + + + + + + + + 532 + + + + + 533 + + + + + 100363 + + + + + 100364 + + + + + 100365 + + + + + 100368 + + + + + 100369 + + + + + 100370 + + + + + 100382 + + + + + + + + 100385 + + + + + 100386 + + + + + 100541 + + + + + 100543 + + + + + 100374 + + + + + 100375 + + + + + 100376 + + + + + 100377 + + + + + 100379 + + + + + 380 + + + + + + + + + + + 435 + + + + + 384 + + + + + 383 + + + + + 381 + + + + + 295 + + + + + + + + + + + 300295 + + + + + 200295 + + + + + 100295 + + + + + 296 + + + + + + + + + + 535 + + + + + + + + 575 + + + + + 298 + + + + + + + + 573 + + + + + 297 + + + + + + + + 574 + + + + + 310 + + + + + + + + 100310 + + + + + 292 + + + + + + + + 100292 + + + + + 293 + + + + + + + + 100293 + + + + + 300337 + + + + + + + + 300338 + + + + + + + + + + + + + 300358 + + + + + + + + 300359 + + + + + + + + 300360 + + + + + 300361 + + + + + 300362 + + + + + + + + 300363 + + + + + 300364 + + + + + + + + 300365 + + + + + 300368 + + + + + + + + 300369 + + + + + 300370 + + + + + + + + 300371 + + + + + 300421 + + + + + + + + 300422 + + + + + + + + + + + + + + + 300423 + + + + + + + + 300424 + + + + + + + + 300440 + + + + + 300441 + + + + + 300447 + + + + + + + + 300450 + + + + + 300451 + + + + + + + + 300452 + + + + + 300453 + + + + + + + + 300454 + + + + + 300455 + + + + + + + + 300456 + + + + + 300457 + + + + + + + + 300458 + + + + + 300459 + + + + + + + + 300460 + + + + + 300472 + + + + + + + + 300473 + + + + + 300476 + + + + + + + + 300477 + + + + + + + + 300478 + + + + + 300479 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{168, 821}, {113, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{202, 626}, {154, 153}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{349, 868}, {315, 143}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{271, 666}, {301, 153}} + {{507, 548}, {484, 308}} + com.apple.InterfaceBuilder.CocoaPlugin + {{507, 548}, {484, 308}} + + {{184, 290}, {481, 345}} + + + {3.40282e+38, 3.40282e+38} + {320, 240} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{58, 803}, {155, 33}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{100, 746}, {155, 33}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{68, 585}, {454, 271}} + com.apple.InterfaceBuilder.CocoaPlugin + + + {{68, 585}, {454, 271}} + + {{433, 406}, {486, 327}} + + + {3.40282e+38, 3.40282e+38} + {320, 240} + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 1011}, {336, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{67, 819}, {336, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{20, 641}, {218, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{79, 616}, {218, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + 300481 + + + + + FirstResponder + NSObject + + IBUserSource + + + + + NSFormatter + NSObject + + IBUserSource + + + + + X11Controller + NSObject + + IBUserSource + + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + ../X11.xcodeproj + 3 + + {9, 8} + {7, 2} + {15, 15} + + diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib index d8f5f8b75..127c738cf 100644 Binary files a/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/Resources/zh_TW.lproj/locversion.plist b/hw/xquartz/bundle/Resources/zh_TW.lproj/locversion.plist index 77a4ffeab..17aeb6700 100644 --- a/hw/xquartz/bundle/Resources/zh_TW.lproj/locversion.plist +++ b/hw/xquartz/bundle/Resources/zh_TW.lproj/locversion.plist @@ -3,12 +3,12 @@ LprojCompatibleVersion - 98 + 101 LprojLocale zh_TW LprojRevisionLevel 1 LprojVersion - 98 + 101 diff --git a/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/designable.nib index 0739b89a6..e2322d346 100644 --- a/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/designable.nib @@ -2,21 +2,22 @@ 1040 - 11A194b - 787 - 1079 - 502.00 + 11A289 + 851 + 1094.2 + 521.00 com.apple.InterfaceBuilder.CocoaPlugin - 787 + 851 - - - + com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -369,10 +370,10 @@ View - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -380,14 +381,13 @@ 256 {{13, 10}, {458, 292}} - 1 - + 256 @@ -395,7 +395,6 @@ 256 {{18, 210}, {402, 18}} - YES 67239424 @@ -409,7 +408,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -427,7 +426,6 @@ 256 {{36, 92}, {399, 14}} - YES 67239424 @@ -446,7 +444,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -465,7 +463,6 @@ 256 {{36, 176}, {385, 28}} - YES 67239424 @@ -484,7 +481,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 256 {{18, 112}, {402, 18}} - YES 67239424 @@ -494,7 +490,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -507,7 +503,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 256 {{36, 141}, {385, 14}} - YES 67239424 @@ -525,7 +520,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 256 {{18, 161}, {402, 18}} - YES 67239424 @@ -535,7 +529,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -548,7 +542,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 256 {{36, 26}, {385, 31}} - YES 67239424 @@ -565,7 +558,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 256 {{18, 63}, {402, 18}} - YES 67239424 @@ -575,7 +567,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -585,8 +577,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA {{10, 33}, {438, 246}} - - 輸入 @@ -597,48 +587,9 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 2 - + 256 - - - 256 - {{18, 63}, {402, 18}} - - YES - - 67239424 - 0 - 使用系統提示效果 - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 256 - {{36, 29}, {379, 28}} - - YES - - 67239424 - 4194304 - X11 的嗶聲將會使用標準的系統提示聲,即您在系統偏好設定面板的“音效”中設定的聲音。 - - - - - - - 256 @@ -775,7 +726,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -797,7 +748,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -824,6 +775,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA {{10, 33}, {438, 246}} + 輸出 @@ -851,7 +803,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -889,7 +841,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -911,7 +863,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -933,7 +885,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -955,7 +907,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1024,7 +976,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1062,7 +1014,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1100,7 +1052,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1150,7 +1102,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1172,7 +1124,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1211912703 2 - + @@ -1239,23 +1191,21 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA - + 0 YES YES - + {484, 308} - - {{0, 0}, {1440, 878}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_prefs @@ -1269,10 +1219,10 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA View - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} {320, 240} - + 256 @@ -1364,7 +1314,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -1482,6 +1432,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 0 YES 0 + 1 {{1, 17}, {301, 198}} @@ -1498,7 +1449,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA _doScroller: - 0.99492377042770386 + 0.99492380000000002 @@ -1508,7 +1459,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 1 _doScroller: - 0.68852460384368896 + 0.68852460000000004 @@ -1528,12 +1479,11 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA {{20, 20}, {318, 231}} - 50 + 133170 - QSAAAEEgAABBmAAAQZgAAA @@ -1561,11 +1511,10 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA {454, 271} - {{0, 0}, {1440, 878}} {320, 262} - {3.4028235e+38, 3.4028235e+38} + {1.7976931348623157e+308, 1.7976931348623157e+308} x11_apps @@ -1759,14 +1708,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 389 - - - use_sysbeep - - - - 390 - fake_buttons @@ -1815,14 +1756,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA 396 - - - prefs_changed: - - - - 397 - prefs_changed: @@ -2574,27 +2507,9 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA - - - - 371 - - - - - - - - 372 - - - - - - 382 @@ -2787,16 +2702,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA - - 100371 - - - - - 100372 - - - 100382 @@ -3276,8 +3181,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3331,9 +3234,9 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} com.apple.InterfaceBuilder.CocoaPlugin - {{507, 548}, {484, 308}} + {{507, 565}, {484, 308}} {{184, 290}, {481, 345}} @@ -3390,9 +3293,7 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3405,7 +3306,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - IBBuiltInLabel-Red com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3473,10 +3373,6 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3589,6 +3485,259 @@ vKDnmoTkuK3plpPmiJblj7PpgormjInpiJXjgIIKA + + + X11Controller + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + apps_table_delete: + id + + + apps_table_done: + id + + + apps_table_duplicate: + id + + + apps_table_new: + id + + + apps_table_show: + id + + + bring_to_front: + id + + + close_window: + id + + + enable_fullscreen_changed: + id + + + minimize_window: + id + + + next_window: + id + + + prefs_changed: + id + + + prefs_show: + id + + + previous_window: + id + + + quit: + id + + + toggle_fullscreen: + id + + + x11_help: + id + + + zoom_window: + id + + + + NSMenuItem + NSTableView + NSButton + NSMenuItem + NSPopUpButton + NSMenu + NSMenu + NSMenuItem + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPanel + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + + + + apps_separator + NSMenuItem + + + apps_table + NSTableView + + + click_through + NSButton + + + copy_menu_item + NSMenuItem + + + depth + NSPopUpButton + + + dock_apps_menu + NSMenu + + + dock_menu + NSMenu + + + dock_window_separator + NSMenuItem + + + enable_auth + NSButton + + + enable_fullscreen + NSButton + + + enable_fullscreen_menu + NSButton + + + enable_keyequivs + NSButton + + + enable_tcp + NSButton + + + fake_buttons + NSButton + + + focus_follows_mouse + NSButton + + + focus_on_new_window + NSButton + + + option_sends_alt + NSButton + + + prefs_panel + NSPanel + + + sync_clipboard_to_pasteboard + NSButton + + + sync_keymap + NSButton + + + sync_pasteboard + NSButton + + + sync_pasteboard_to_clipboard + NSButton + + + sync_pasteboard_to_primary + NSButton + + + sync_primary_immediately + NSButton + + + sync_text1 + NSTextField + + + sync_text2 + NSTextField + + + toggle_fullscreen_item + NSMenuItem + + + use_sysbeep + NSButton + + + window_separator + NSMenuItem + + + x11_about_item + NSMenuItem + + + + IBDocumentRelativeSource + ../../../X11Controller.h + + + 0 IBCocoaFramework diff --git a/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib index e08046e00..6872c5064 100644 Binary files a/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/bundle/cpprules.in b/hw/xquartz/bundle/cpprules.in index f32eafc06..92a987d92 100644 --- a/hw/xquartz/bundle/cpprules.in +++ b/hw/xquartz/bundle/cpprules.in @@ -13,25 +13,7 @@ CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \ -e '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \ -e '/\@\@$$/s/\@\@$$/\\/' -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MANDEFS = \ - -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \ - -D__appmansuffix__=$(APP_MAN_SUFFIX) \ - -D__filemansuffix__=$(FILE_MAN_SUFFIX) \ - -D__libmansuffix__=$(LIB_MAN_SUFFIX) \ - -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \ - -D__XSERVERNAME__=Xorg -D__XCONFIGFILE__=xorg.conf \ - -D__xinitdir__=$(XINITDIR) \ - -D__bindir__=$(bindir) \ - -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS) - -SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp +SUFFIXES = .cpp .cpp: - $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ - -.man.$(APP_MAN_SUFFIX): - $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@ + $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ diff --git a/hw/xquartz/bundle/mk_bundke.sh b/hw/xquartz/bundle/mk_bundke.sh index c85b21765..58d5f6abf 100755 --- a/hw/xquartz/bundle/mk_bundke.sh +++ b/hw/xquartz/bundle/mk_bundke.sh @@ -8,6 +8,7 @@ BUNDLE_ROOT=$3 localities="Dutch English French German Italian Japanese Spanish da fi ko no pl pt pt_PT ru sv zh_CN zh_TW" for lang in ${localities} ; do + [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj ] && rm -rf ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj mkdir -p ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib ] || exit 1 @@ -16,7 +17,7 @@ for lang in ${localities} ; do done done -install -m 644 ${SRCDIR}/Resources/English.lproj/main.nib//designable.nib ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib +install -m 644 ${SRCDIR}/Resources/English.lproj/main.nib/designable.nib ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib install -m 644 ${SRCDIR}/Resources/X11.icns ${BUNDLE_ROOT}/Contents/Resources install -m 644 ${BUILDDIR}/Info.plist ${BUNDLE_ROOT}/Contents diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c new file mode 100644 index 000000000..70a819e42 --- /dev/null +++ b/hw/xquartz/console_redirect.c @@ -0,0 +1,418 @@ +/* Copyright (c) 2011 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#else +#define DEBUG_CONSOLE_REDIRECT 1 +#define HAVE_LIBDISPATCH 1 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "console_redirect.h" + +#define BUF_SIZE 512 + +#ifdef HAVE_LIBDISPATCH +#include + +static dispatch_queue_t redirect_serial_q; +static dispatch_group_t read_source_group; +#else +#include + +static pthread_t redirect_pthread; +static pthread_mutex_t redirect_fds_lock = PTHREAD_MUTEX_INITIALIZER; + +static int kq; + +/* Notifications to our reader thread */ +#define ASL_REDIRECT_TERMINATE ((void *)(uintptr_t)1) +#endif + +typedef struct { + int level; + aslclient asl; + aslmsg msg; + + /* Buffered reading */ + char *buf; + char *w; + +#ifdef HAVE_LIBDISPATCH + dispatch_source_t read_source; +#endif +} asl_redirect; + +static asl_redirect *redirect_fds = NULL; +static int n_redirect_fds = 0; + +/* Read from the FD until there is no more to read and redirect to ASL. + * Preconditions: + * 1: pthread_mutex_lock lock is held (pthreads) or called + * from the appropriate serial queue for operating on + * redirect_fds + * 2: fd corresponds to a valid entry in redirect_fds + * + * Return values: + * If the pipe is closed, EOF is returned regardless of how many bytes + * were processed. If the pipe is still open, the number of read bytes + * is returned. + */ +static inline int _read_redirect(int fd, int flush) { + int total_read = 0; + int nbytes; + asl_redirect *aslr = &redirect_fds[fd]; + + while((nbytes = read(fd, aslr->w, BUF_SIZE - (aslr->w - aslr->buf) - 1)) > 0) { + char *s, *p; + + /* Increment our returned number read */ + total_read += nbytes; + + nbytes += (aslr->w - aslr->buf); + aslr->buf[nbytes] = '\0'; + + /* One line at a time */ + for(p=aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) { + // Find null or \n + for(s=p; *s && *s != '\n'; s++); + if(*s == '\n') { + *s='\0'; + asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); + } else if(aslr->buf != p) { + memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf)); + aslr->w = aslr->buf + (s - p); + break; + } else if(nbytes == BUF_SIZE - 1) { + asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); + aslr->w = aslr->buf; + break; + } + } + } + + /* Flush if requested or we're at EOF */ + if(flush || nbytes == 0) { + if(aslr->w > aslr->buf) { + *aslr->w = '\0'; + asl_log(aslr->asl, aslr->msg, aslr->level, "%s", aslr->buf); + } + } + + if(nbytes == 0) + return EOF; + return total_read; +} + +#ifdef HAVE_LIBDISPATCH +static void read_from_source(void *_source) { + dispatch_source_t source = (dispatch_source_t)_source; + int fd = dispatch_source_get_handle(source); + if(_read_redirect(fd, 0) == EOF) { + dispatch_source_cancel(source); + } +} + +static void cancel_source(void *_source) { + dispatch_source_t source = (dispatch_source_t)_source; + int fd = dispatch_source_get_handle(source); + asl_redirect *aslr = &redirect_fds[fd]; + + /* Flush the buffer */ + _read_redirect(fd, 1); + + close(fd); + free(aslr->buf); + memset(aslr, 0, sizeof(*aslr)); + dispatch_release(source); + dispatch_group_leave(read_source_group); +} + +#else /* !HAVE_LIBDISPATCH */ +static void *redirect_thread(void *ctx __unused) { + struct kevent ev; + int n; + + while(1) { + n = kevent(kq, NULL, 0, &ev, 1, NULL); + + /* Bail on errors */ + if(n < 0) { + asl_log(NULL, NULL, ASL_LEVEL_ERR, "kevent failure: %s", strerror(errno)); + break; + } + + /* This should not happen */ + if(n == 0) + continue; + + switch(ev.filter) { + case EVFILT_READ: + pthread_mutex_lock(&redirect_fds_lock); + { + int fd = ev.ident; + int close_fd = 0; + asl_redirect *aslr = &redirect_fds[fd]; + + if(fd < 0 || fd >= n_redirect_fds || aslr->buf == NULL) { + asl_log(NULL, NULL, ASL_LEVEL_ERR, "Unexpected file descriptor: %d", fd); + goto next; + } + + if(ev.flags & EV_EOF) { + close_fd = 1; + if(EOF != _read_redirect(fd, 1)) { + asl_log(NULL, NULL, ASL_LEVEL_ERR, "kevent reported EOF on %d, but read doesn't concur.", fd); + } + } else { + close_fd = (EOF == _read_redirect(fd, 0)); + } + + if(close_fd) { + EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, 0); + kevent(kq, &ev, 1, NULL, 0, NULL); + close(fd); + free(aslr->buf); + memset(aslr, 0, sizeof(*aslr)); + } + } + next: + pthread_mutex_unlock(&redirect_fds_lock); + + case EVFILT_TIMER: + if(ev.udata == ASL_REDIRECT_TERMINATE) + return NULL; + + default: + ;; + } + } + + return NULL; +} +#endif + +static void redirect_atexit(void) { + /* stdout is linebuffered, so flush the buffer */ + if(redirect_fds[STDOUT_FILENO].buf) + fflush(stdout); + +#ifdef HAVE_LIBDISPATCH + { + int i; + + /* Cancel all of our dispatch sources, so they flush to ASL */ + for(i=0; i < n_redirect_fds; i++) + if(redirect_fds[i].read_source) + dispatch_source_cancel(redirect_fds[i].read_source); + + /* Wait at least three seconds for our sources to flush to ASL */ + dispatch_group_wait(read_source_group, dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC)); + } +#else + { + struct kevent ev; + + /* Tell our reader thread it is time to pack up and go home */ + EV_SET(&ev, 0, EVFILT_TIMER, EV_ADD | EV_ONESHOT, 0, 0, ASL_REDIRECT_TERMINATE); + kevent(kq, &ev, 1, NULL, 0, NULL); + + pthread_join(redirect_pthread, NULL); + } +#endif +} + +#ifdef HAVE_LIBDISPATCH +static void xq_asl_init(void *ctx __unused) +#else +static void xq_asl_init(void) +#endif +{ + assert((redirect_fds = calloc(16, sizeof(*redirect_fds))) != NULL); + n_redirect_fds = 16; + +#ifdef HAVE_LIBDISPATCH + redirect_serial_q = dispatch_queue_create("com.apple.asl-redirect", NULL); + assert(redirect_serial_q != NULL); + + read_source_group = dispatch_group_create(); + assert(read_source_group != NULL); +#else + assert((kq = kqueue()) != -1); + assert(pthread_create(&redirect_pthread, NULL, redirect_thread, NULL) == 0); +#endif + + atexit(redirect_atexit); +} + +int xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) { +#ifdef HAVE_LIBDISPATCH + int err __block = 0; + static dispatch_once_t once_control; + dispatch_once_f(&once_control, NULL, xq_asl_init); +#else + int err = 0; + static pthread_once_t once_control = PTHREAD_ONCE_INIT; + assert(pthread_once(&once_control, xq_asl_init) == 0); +#endif + + if(fd < 0) + return EBADF; + +#ifdef HAVE_LIBDISPATCH +#define BLOCK_DONE return + dispatch_sync(redirect_serial_q, ^ +#else +#define BLOCK_DONE goto done + assert(pthread_mutex_lock(&redirect_fds_lock) == 0); +#endif + { + /* Reallocate if we need more space */ + if(fd >= n_redirect_fds) { + size_t new_n = 1 << (ffs(fd) + 1); + asl_redirect *new_array = realloc(redirect_fds, new_n * sizeof(*redirect_fds)); + if(!new_array) { + err = errno; + BLOCK_DONE; + } + redirect_fds = new_array; + memset(redirect_fds + n_redirect_fds, 0, new_n - n_redirect_fds); + n_redirect_fds = new_n; + } + + /* If we're already listening on it, return error. */ + if(redirect_fds[fd].buf != NULL) { + err = EBADF; + BLOCK_DONE; + } + + /* Initialize our buffer */ + redirect_fds[fd].buf = (char *)malloc(BUF_SIZE); + if(redirect_fds[fd].buf == NULL) { + err = errno; + BLOCK_DONE; + } + redirect_fds[fd].w = redirect_fds[fd].buf; + + /* Store our ASL settings */ + redirect_fds[fd].level = level; + redirect_fds[fd].asl = asl; + redirect_fds[fd].msg = msg; + + /* Don't block on reads from this fd */ + fcntl(fd, F_SETFL, O_NONBLOCK); + + /* Start listening */ +#ifdef HAVE_LIBDISPATCH + { + dispatch_source_t read_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, redirect_serial_q); + redirect_fds[fd].read_source = read_source; + dispatch_set_context(read_source, read_source); + dispatch_source_set_event_handler_f(read_source, read_from_source); + dispatch_source_set_cancel_handler_f(read_source, cancel_source); + dispatch_group_enter(read_source_group); + dispatch_resume(read_source); + } +#else + { + struct kevent ev; + EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, 0); + kevent(kq, &ev, 1, NULL, 0, NULL); + } +#endif + } +#ifdef HAVE_LIBDISPATCH + ); +#else +done: + assert(pthread_mutex_unlock(&redirect_fds_lock) == 0); +#endif +#undef BLOCK_DONE + + return err; +} + +int xq_asl_capture_fd(aslclient asl, aslmsg msg, int level, int fd) { + int pipepair[2]; + + /* Create pipe */ + if(pipe(pipepair) == -1) + return errno; + + /* Close the read fd but not the write fd on exec */ + if(fcntl(pipepair[0], F_SETFD, FD_CLOEXEC) == -1) + return errno; + + /* Replace the existing fd */ + if(dup2(pipepair[1], fd) == -1) { + close(pipepair[0]); + close(pipepair[1]); + return errno; + } + + /* If we capture STDOUT_FILENO, make sure we linebuffer stdout */ + if(fd == STDOUT_FILENO) + setlinebuf(stdout); + + /* Close the duplicate fds since they've been reassigned */ + close(pipepair[1]); + + /* Hand off the read end of our pipe to xq_asl_log_fd */ + return xq_asl_log_fd(asl, msg, level, pipepair[0]); +} + +#ifdef DEBUG_CONSOLE_REDIRECT +int main(int argc __unused, char **argv __unused) { + xq_asl_capture_fd(NULL, NULL, ASL_LEVEL_NOTICE, STDOUT_FILENO); + xq_asl_capture_fd(NULL, NULL, ASL_LEVEL_ERR, STDERR_FILENO); + + fprintf(stderr, "TEST ERR1\n"); + fprintf(stdout, "TEST OUT1\n"); + fprintf(stderr, "TEST ERR2\n"); + fprintf(stdout, "TEST OUT2\n"); + system("/bin/echo SYST OUT"); + system("/bin/echo SYST ERR >&2"); + fprintf(stdout, "TEST OUT3\n"); + fprintf(stdout, "TEST OUT4\n"); + fprintf(stderr, "TEST ERR3\n"); + fprintf(stderr, "TEST ERR4\n"); + + exit(0); +} +#endif diff --git a/hw/xquartz/console_redirect.h b/hw/xquartz/console_redirect.h new file mode 100644 index 000000000..94520a35c --- /dev/null +++ b/hw/xquartz/console_redirect.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2011 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#ifndef _XQUARTZ_CONSOLE_REDIRECT_H_ +#define _XQUARTZ_CONSOLE_REDIRECT_H_ + +#include + +/* The given fd is replaced with a pipe. Anything written to it will will be + * logged to ASL. + */ +int xq_asl_capture_fd(aslclient asl, aslmsg msg, int level, int fd); + +/* The given fd is read from and passed along to ASL until all write ends of the + * pipe are closed. Once the last writer has closed the pipe, we close our end. + */ +int xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd); + +#endif diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index a99c0f155..fa8d4ced2 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -60,6 +60,7 @@ #include #include #include +#include #define HAS_UTSNAME 1 #include @@ -76,9 +77,31 @@ #include "quartzKeyboard.h" #include "quartz.h" -#ifdef ENABLE_DEBUG_LOG -FILE *debug_log_fp = NULL; -#endif +aslclient aslc; + +void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) { + va_list args; + aslmsg msg = asl_new(ASL_TYPE_MSG); + + if(msg) { + char *_line; + + asl_set(msg, "File", file); + asl_set(msg, "Function", function); + asprintf(&_line, "%d", line); + if(_line) { + asl_set(msg, "Line", _line); + free(_line); + } + } + + va_start(args, fmt); + asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args); + va_end(args); + + if(msg) + asl_free(msg); +} /* * X server shared global variables @@ -117,7 +140,6 @@ unsigned int windowItemModMask = NX_COMMANDMASK; // devices DeviceIntPtr darwinKeyboard = NULL; DeviceIntPtr darwinPointer = NULL; -DeviceIntPtr darwinTabletCurrent = NULL; DeviceIntPtr darwinTabletStylus = NULL; DeviceIntPtr darwinTabletCursor = NULL; DeviceIntPtr darwinTabletEraser = NULL; @@ -134,28 +156,12 @@ static PixmapFormatRec formats[] = { }; const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); -#ifndef OSNAME -#define OSNAME " Darwin" -#endif -#ifndef OSVENDOR -#define OSVENDOR "" -#endif -#ifndef PRE_RELEASE -#define PRE_RELEASE XORG_VERSION_SNAP -#endif -#ifndef BUILD_DATE -#define BUILD_DATE "" -#endif -#ifndef XORG_RELEASE -#define XORG_RELEASE "?" -#endif - void DarwinPrintBanner(void) { - // this should change depending on which specific server we are building ErrorF("Xquartz starting:\n"); - ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE ); + ErrorF("X.Org X Server %s\n", XSERVER_VERSION); + ErrorF("Build Date: %s\n", BUILD_DATE ); } @@ -314,10 +320,8 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); - pPointer->valuator->mode = Absolute; // Relative - InitAbsoluteClassDeviceStruct(pPointer); -// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); -// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); +// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); +// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); break; case DEVICE_ON: pPointer->public.on = TRUE; @@ -362,15 +366,13 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); - pPointer->valuator->mode = Absolute; // Relative InitProximityClassDeviceStruct(pPointer); - InitAbsoluteClassDeviceStruct(pPointer); - InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute); // pPointer->use = IsXExtensionDevice; break; case DEVICE_ON: @@ -468,7 +470,6 @@ void InitInput( int argc, char **argv ) XkbSetRulesDflts(&rmlvo); darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE); - RegisterKeyboardDevice( darwinKeyboard ); darwinKeyboard->name = strdup("keyboard"); /* here's the snippet from the current gdk sources: @@ -486,23 +487,17 @@ void InitInput( int argc, char **argv ) */ darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE); - RegisterPointerDevice( darwinPointer ); darwinPointer->name = strdup("pointer"); darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletStylus ); darwinTabletStylus->name = strdup("pen"); darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletCursor ); darwinTabletCursor->name = strdup("cursor"); darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE); - RegisterPointerDevice( darwinTabletEraser ); darwinTabletEraser->name = strdup("eraser"); - darwinTabletCurrent = darwinTabletStylus; - DarwinEQInit(); QuartzInitInput(argc, argv); @@ -617,6 +612,13 @@ void OsVendorFatalError( void ) void OsVendorInit(void) { if (serverGeneration == 1) { + char *lf; + char *home = getenv("HOME"); + assert(home); + assert(0 < asprintf(&lf, "%s/Library/Logs/X11.%s.log", home, bundle_id_prefix)); + LogInit(lf, ".old"); + free(lf); + DarwinPrintBanner(); #ifdef ENABLE_DEBUG_LOG { @@ -770,141 +772,9 @@ void ddxGiveUp( void ) * made to restore all original setting of the displays. Also all devices * are closed. */ -void AbortDDX( void ) -{ +_X_NORETURN +void AbortDDX( void ) { ErrorF( " AbortDDX\n" ); OsAbort(); } -#include "mivalidate.h" // for union _Validate used by windowstr.h -#include "windowstr.h" // for struct _Window -#include "scrnintstr.h" // for struct _Screen - -// This is copied from Xserver/hw/xfree86/common/xf86Helper.c. -// Quartz mode uses this when switching in and out of Quartz. -// Quartz or IOKit can use this when waking from sleep. -// Copyright (c) 1997-1998 by The XFree86 Project, Inc. - -/* - * xf86SetRootClip -- - * Enable or disable rendering to the screen by - * setting the root clip list and revalidating - * all of the windows - */ - -void -xf86SetRootClip (ScreenPtr pScreen, int enable) -{ - WindowPtr pWin = pScreen->root; - WindowPtr pChild; - Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked = TRUE; - RegionPtr pOldClip = NULL, bsExposed; - WindowPtr pLayerWin; - BoxRec box; - - if (WasViewable) - { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) - { - (void) (*pScreen->MarkOverlappedWindows)(pChild, - pChild, - &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = RegionCreate(NullBox, 1); - RegionSubtract(borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - /* - * Use REGION_BREAK to avoid optimizations in ValidateTree - * that assume the root borderClip can't change well, normally - * it doesn't...) - */ - if (enable) - { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - RegionReset(&pWin->borderClip, &box); - RegionBreak(&pWin->clipList); - } - else - { - RegionEmpty(&pWin->borderClip); - RegionBreak(&pWin->clipList); - } - - ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - - if (WasViewable) - { - if (pWin->backStorage) - { - pOldClip = RegionCreate(NullBox, 1); - RegionCopy(pOldClip, &pWin->clipList); - } - - if (pWin->firstChild) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, - pWin->firstChild, - (WindowPtr *)NULL); - } - else - { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - - - if (anyMarked) - (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); - } - - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - RegionDestroy(pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - RegionEmpty(valExposed); - RegionDestroy(bsExposed); - } - } - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured (); - FlushAllOutput (); -} diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h index 350eadeb6..659de432c 100644 --- a/hw/xquartz/darwin.h +++ b/hw/xquartz/darwin.h @@ -32,9 +32,7 @@ #include "inputstr.h" #include "scrnintstr.h" #include -#include - -#include "threadSafety.h" +#include #include "darwinfb.h" @@ -42,7 +40,6 @@ void DarwinPrintBanner(void); int DarwinParseModifierList(const char *constmodifiers, int separatelr); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); -void xf86SetRootClip (ScreenPtr pScreen, int enable); #define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \ dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey)) @@ -57,7 +54,6 @@ extern io_connect_t darwinParamConnect; extern int darwinEventReadFD; extern int darwinEventWriteFD; extern DeviceIntPtr darwinPointer; -extern DeviceIntPtr darwinTabletCurrent; extern DeviceIntPtr darwinTabletCursor; extern DeviceIntPtr darwinTabletStylus; extern DeviceIntPtr darwinTabletEraser; @@ -77,16 +73,12 @@ extern int darwinDesiredDepth; extern int darwinMainScreenX; extern int darwinMainScreenY; -#define ENABLE_DEBUG_LOG 1 +// bundle-main.c +extern char *bundle_id_prefix; -#ifdef ENABLE_DEBUG_LOG -extern FILE *debug_log_fp; -#define DEBUG_LOG_NAME "x11-debug.txt" -#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%s:%d " msg, threadSafetyID(pthread_self()), __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp); -#else -#define DEBUG_LOG(msg, args...) -#endif +extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5); -#define TRACE() DEBUG_LOG("\n") +#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args); +#define TRACE() DEBUG_LOG("TRACE") #endif /* _DARWIN_H */ diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 74fadf465..fe744b741 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. #include "windowstr.h" #include "pixmapstr.h" #include "inputstr.h" +#include "inpututils.h" #include "eventstr.h" #include "mi.h" #include "scrnintstr.h" @@ -60,6 +61,7 @@ in this Software without prior written authorization from The Open Group. #include #include #include +#include #include @@ -86,13 +88,13 @@ static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_t fd_add_tid = NULL; -static EventListPtr darwinEvents = NULL; +static InternalEvent* darwinEvents = NULL; static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER; /*** Pthread Magics ***/ -static pthread_t create_thread(void *func, void *arg) { +static pthread_t create_thread(void *(*func)(void *), void *arg) { pthread_attr_t attr; pthread_t tid; @@ -111,7 +113,7 @@ void darwinEvents_lock(void) { if((err = pthread_mutex_lock(&mieq_lock))) { ErrorF("%s:%s:%d: Failed to lock mieq_lock: %d\n", __FILE__, __FUNCTION__, __LINE__, err); - spewCallStack(); + xorg_backtrace(); } if(darwinEvents == NULL) { pthread_cond_wait(&mieq_ready_cond, &mieq_lock); @@ -124,7 +126,7 @@ void darwinEvents_unlock(void) { if((err = pthread_mutex_unlock(&mieq_lock))) { ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n", __FILE__, __FUNCTION__, __LINE__, err); - spewCallStack(); + xorg_backtrace(); } } @@ -195,8 +197,6 @@ static void DarwinUpdateModifiers( static void DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr dev) { XQuartzEvent *e = &(ie->xquartz_event); - TA_SERVER(); - switch(e->subtype) { case kXquartzControllerNotify: DEBUG_LOG("kXquartzControllerNotify\n"); @@ -279,10 +279,9 @@ static void DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr de case kXquartzDisplayChanged: DEBUG_LOG("kXquartzDisplayChanged\n"); QuartzUpdateScreens(); -#ifdef RANDR + /* Update our RandR info */ QuartzRandRUpdateFakeModes(TRUE); -#endif break; default: @@ -304,7 +303,28 @@ void DarwinListenOnOpenFD(int fd) { pthread_mutex_unlock(&fd_add_lock); } -static void DarwinProcessFDAdditionQueue_thread(void *args) { +static void *DarwinProcessFDAdditionQueue_thread(void *args) { + /* TODO: Possibly adjust this to no longer be a race... maybe trigger this + * once a client connects and claims to be the WM. + * + * From ajax: + * There's already an internal callback chain for setting selection [in 1.5] + * ownership. See the CallSelectionCallback at the bottom of + * ProcSetSelectionOwner, and xfixes/select.c for an example of how to hook + * into it. + */ + + struct timespec sleep_for; + struct timespec sleep_remaining; + + sleep_for.tv_sec = 3; + sleep_for.tv_nsec = 0; + + ErrorF("X11.app: DarwinProcessFDAdditionQueue_thread: Sleeping to allow xinitrc to catchup.\n"); + while(nanosleep(&sleep_for, &sleep_remaining) != 0) { + sleep_for = sleep_remaining; + } + pthread_mutex_lock(&fd_add_lock); while(true) { while(fd_add_count) { @@ -312,6 +332,8 @@ static void DarwinProcessFDAdditionQueue_thread(void *args) { } pthread_cond_wait(&fd_add_ready_cond, &fd_add_lock); } + + return NULL; } Bool DarwinEQInit(void) { @@ -357,8 +379,6 @@ void ProcessInputEvents(void) { char nullbyte; int x = sizeof(nullbyte); - TA_SERVER(); - mieqProcessInputEvents(); // Empty the signaling pipe @@ -413,7 +433,6 @@ static void DarwinPrepareValuators(DeviceIntPtr pDev, int *valuators, ScreenPtr void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, float pointer_x, float pointer_y, float pressure, float tilt_x, float tilt_y) { static int darwinFakeMouseButtonDown = 0; - int i, num_events; ScreenPtr screen; int valuators[5]; @@ -464,15 +483,14 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, pressure, tilt_x, tilt_y); darwinEvents_lock(); { - num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button, - POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators); - for(i=0; i 0) DarwinPokeEQ(); + ValuatorMask mask; + valuator_mask_set_range(&mask, 0, (pDev == darwinPointer) ? 2 : 5, valuators); + QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &mask); + DarwinPokeEQ(); } darwinEvents_unlock(); } void DarwinSendKeyboardEvents(int ev_type, int keycode) { - int i, num_events; if(!darwinEvents) { DEBUG_LOG("DarwinSendKeyboardEvents called before darwinEvents was initialized\n"); @@ -480,24 +498,22 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) { } darwinEvents_lock(); { - num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE); - for(i=0; i 0) DarwinPokeEQ(); + QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE, NULL); + DarwinPokeEQ(); } darwinEvents_unlock(); } -void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) { - int i, num_events; +void DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, float pointer_x, float pointer_y, + float pressure, float tilt_x, float tilt_y) { ScreenPtr screen; - DeviceIntPtr pDev = darwinTabletCurrent; int valuators[5]; - DEBUG_LOG("DarwinSendProximityEvents(%d, %f, %f)\n", ev_type, pointer_x, pointer_y); + DEBUG_LOG("DarwinSendProximityEvents: %d l:%f,%f p:%f t:%f,%f\n", ev_type, pointer_x, pointer_y, pressure, tilt_x, tilt_y); - if(!darwinEvents) { - DEBUG_LOG("DarwinSendProximityEvents called before darwinEvents was initialized\n"); - return; - } + if(!darwinEvents) { + DEBUG_LOG("DarwinSendProximityEvents called before darwinEvents was initialized\n"); + return; + } screen = miPointerGetScreen(pDev); if(!screen) { @@ -505,12 +521,12 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) { return; } - DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, 0.0f, 0.0f, 0.0f); + DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, pressure, tilt_x, tilt_y); darwinEvents_lock(); { - num_events = GetProximityEvents(darwinEvents, pDev, ev_type, - 0, 5, valuators); - for(i=0; i 0) DarwinPokeEQ(); + ValuatorMask mask; + valuator_mask_set_range(&mask, 0, 5, valuators); + QueueProximityEvents(pDev, ev_type, &mask); + DarwinPokeEQ(); } darwinEvents_unlock(); } diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h index 590305f3e..6769c8bd8 100644 --- a/hw/xquartz/darwinEvents.h +++ b/hw/xquartz/darwinEvents.h @@ -37,7 +37,8 @@ void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e); void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, float pointer_x, float pointer_y, float pressure, float tilt_x, float tilt_y); -void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y); +void DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, float pointer_x, float pointer_y, + float pressure, float tilt_x, float tilt_y); void DarwinSendKeyboardEvents(int ev_type, int keycode); void DarwinSendScrollEvents(float count_x, float count_y, float pointer_x, float pointer_y, float pressure, float tilt_x, float tilt_y); diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c index 19aefb153..3ef34fec0 100644 --- a/hw/xquartz/darwinXinput.c +++ b/hw/xquartz/darwinXinput.c @@ -63,97 +63,6 @@ SOFTWARE. #include "XIstubs.h" #include "darwin.h" -/*********************************************************************** - * - * Caller: ProcXCloseDevice - * - * Take care of implementation-dependent details of closing a device. - * Some implementations may actually close the device, others may just - * remove this clients interest in that device. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * - */ - -void -CloseInputDevice(DeviceIntPtr d, ClientPtr client) -{ - DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client); -} - -/*********************************************************************** - * - * Caller: ProcXListInputDevices - * - * This is the implementation-dependent routine to initialize an input - * device to the point that information about it can be listed. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. If some other process has the device open, the - * server may not be able to get information about the device to list it. - * - * This procedure should be used by implementations that do not initialize - * all input devices at server startup. It should do device-dependent - * initialization for any devices not previously initialized, and call - * AddInputDevice for each of those devices so that a DeviceIntRec will be - * created for them. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * The commented-out sample code shows what you might do if you don't want - * the default. - * - */ - -void -AddOtherInputDevices(void) -{ - /********************************************************************** - for each uninitialized device, do something like: - - DeviceIntPtr dev; - DeviceProc deviceProc; - pointer private; - - dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); - dev->public.devicePrivate = private; - RegisterOtherDevice(dev); - dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); - ************************************************************************/ - DEBUG_LOG("AddOtherInputDevices\n"); -} - -/*********************************************************************** - * - * Caller: ProcXOpenDevice - * - * This is the implementation-dependent routine to open an input device. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. This entry point is for the latter type of - * implementation. - * - * If the physical device is not already open, do it here. In this case, - * you need to keep track of the fact that one or more clients has the - * device open, and physically close it when the last client that has - * it open does an XCloseDevice. - * - * The default implementation is to do nothing (assume all input devices - * are opened during X server initialization and kept open). - * - */ - -void -OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) -{ - DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status); -} - /**************************************************************************** * * Caller: ProcXSetDeviceMode @@ -208,17 +117,7 @@ ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, { DEBUG_LOG("ChangeDeviceControl(%p, %p, %p)\n", client, dev, control); - switch (control->control) { - case DEVICE_RESOLUTION: - return BadMatch; - case DEVICE_ABS_CALIB: - case DEVICE_ABS_AREA: - return BadMatch; - case DEVICE_CORE: - return BadMatch; - default: - return BadMatch; - } + return BadMatch; } diff --git a/hw/xquartz/doc/Makefile.am b/hw/xquartz/doc/Makefile.am deleted file mode 100644 index 6c68c845e..000000000 --- a/hw/xquartz/doc/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -appmandir = $(APP_MAN_DIR) -appman_PRE = Xquartz.man.pre -appman_PROCESSED = $(appman_PRE:man.pre=man) -appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@) - -CLEANFILES = $(appman_PROCESSED) $(appman_DATA) - -include $(top_srcdir)/cpprules.in - -MANDEFS += -D__laucnd_id_prefix__=$(LAUNCHD_ID_PREFIX) - -.man.$(APP_MAN_SUFFIX): - $(AM_V_at)cp $< $@ - -EXTRA_DIST = \ - Xquartz.man.pre diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am index 4dff45aa8..1ce54ad86 100644 --- a/hw/xquartz/mach-startup/Makefile.am +++ b/hw/xquartz/mach-startup/Makefile.am @@ -1,4 +1,5 @@ AM_CPPFLAGS = \ + -I$(srcdir)/.. \ -DBUILD_DATE=\"$(BUILD_DATE)\" \ -DXSERVER_VERSION=\"$(VERSION)\" \ -DX11BINDIR=\"$(bindir)\" diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index 7ac5469eb..94c606823 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -36,18 +36,23 @@ #endif #include +#include #include #include #include #include -#include #include #include +#ifdef HAVE_LIBDISPATCH +#include +#else +#include +#endif + #include #include -#include #include #include @@ -56,10 +61,17 @@ #include "mach_startup.h" #include "mach_startupServer.h" -#include "launchd_fd.h" +#include "console_redirect.h" + /* From darwinEvents.c ... but don't want to pull in all the server cruft */ void DarwinListenOnOpenFD(int fd); +extern aslclient aslc; + +/* Ditto, from os/log.c */ +extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); +extern void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN; + extern int noPanoramiXExtension; #define DEFAULT_CLIENT X11BINDIR "/xterm" @@ -74,7 +86,7 @@ extern int noPanoramiXExtension; #endif static char __crashreporter_info_buff__[4096] = {0}; -static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 // This is actually a toolchain requirement, but I'm not sure the correct check, // but it should be fine to just only include it for Leopard and later. This line @@ -84,7 +96,7 @@ asm (".desc ___crashreporter_info__, 0x10"); static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE; -static char *launchd_id_prefix = NULL; +char *bundle_id_prefix = NULL; static char *server_bootstrap_name = NULL; #define DEBUG 1 @@ -95,8 +107,13 @@ int server_main(int argc, char **argv, char **envp); static int execute(const char *command); static char *command_from_prefs(const char *key, const char *default_value); +static char *pref_app_to_run; +static char *pref_login_shell; +static char *pref_startx_script; + +#ifndef HAVE_LIBDISPATCH /*** Pthread Magics ***/ -static pthread_t create_thread(void *func, void *arg) { +static pthread_t create_thread(void *(*func)(void *), void *arg) { pthread_attr_t attr; pthread_t tid; @@ -108,6 +125,7 @@ static pthread_t create_thread(void *func, void *arg) { return tid; } +#endif /*** Mach-O IPC Stuffs ***/ @@ -128,19 +146,27 @@ static mach_port_t checkin_or_register(char *bname) { /* We probably were not started by launchd or the old mach_init */ kr = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &mp); if (kr != KERN_SUCCESS) { - fprintf(stderr, "mach_port_allocate(): %s\n", mach_error_string(kr)); + ErrorF("mach_port_allocate(): %s\n", mach_error_string(kr)); exit(EXIT_FAILURE); } kr = mach_port_insert_right(mach_task_self(), mp, mp, MACH_MSG_TYPE_MAKE_SEND); if (kr != KERN_SUCCESS) { - fprintf(stderr, "mach_port_insert_right(): %s\n", mach_error_string(kr)); + ErrorF("mach_port_insert_right(): %s\n", mach_error_string(kr)); exit(EXIT_FAILURE); } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // bootstrap_register +#endif kr = bootstrap_register(bootstrap_port, bname, mp); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + if (kr != KERN_SUCCESS) { - fprintf(stderr, "bootstrap_register(): %s\n", mach_error_string(kr)); + ErrorF("bootstrap_register(): %s\n", mach_error_string(kr)); exit(EXIT_FAILURE); } @@ -183,7 +209,7 @@ static int accept_fd_handoff(int connected_fd) { *((int*)CMSG_DATA(cmsg)) = -1; if(recvmsg(connected_fd, &msg, 0) < 0) { - fprintf(stderr, "X11.app: Error receiving $DISPLAY file descriptor. recvmsg() error: %s\n", strerror(errno)); + ErrorF("X11.app: Error receiving $DISPLAY file descriptor. recvmsg() error: %s\n", strerror(errno)); return -1; } @@ -200,11 +226,15 @@ typedef struct { /* This thread accepts an incoming connection and hands off the file * descriptor for the new connection to accept_fd_handoff() */ -static void socket_handoff_thread(void *arg) { +#ifdef HAVE_LIBDISPATCH +static void socket_handoff(socket_handoff_t *handoff_data) { +#else +static void *socket_handoff_thread(void *arg) { socket_handoff_t *handoff_data = (socket_handoff_t *)arg; +#endif + int launchd_fd = -1; int connected_fd; - unsigned remain; /* Now actually get the passed file descriptor from this connection * If we encounter an error, keep listening. @@ -212,14 +242,14 @@ static void socket_handoff_thread(void *arg) { while(launchd_fd == -1) { connected_fd = accept(handoff_data->fd, NULL, NULL); if(connected_fd == -1) { - fprintf(stderr, "X11.app: Failed to accept incoming connection on socket (fd=%d): %s\n", handoff_data->fd, strerror(errno)); + ErrorF("X11.app: Failed to accept incoming connection on socket (fd=%d): %s\n", handoff_data->fd, strerror(errno)); sleep(2); continue; } launchd_fd = accept_fd_handoff(connected_fd); if(launchd_fd == -1) - fprintf(stderr, "X11.app: Error receiving $DISPLAY file descriptor, no descriptor received? Waiting for another connection.\n"); + ErrorF("X11.app: Error receiving $DISPLAY file descriptor, no descriptor received? Waiting for another connection.\n"); close(connected_fd); } @@ -227,22 +257,13 @@ static void socket_handoff_thread(void *arg) { close(handoff_data->fd); unlink(handoff_data->filename); free(handoff_data); - - /* TODO: Clean up this race better... giving xinitrc time to run... need to wait for 1.5 branch: - * - * From ajax: - * There's already an internal callback chain for setting selection [in 1.5] - * ownership. See the CallSelectionCallback at the bottom of - * ProcSetSelectionOwner, and xfixes/select.c for an example of how to hook - * into it. - */ - - remain = 3000000; - fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd); - while((remain = usleep(remain)) > 0); - - fprintf(stderr, "X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd); + + ErrorF("X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd); DarwinListenOnOpenFD(launchd_fd); + +#ifndef HAVE_LIBDISPATCH + return NULL; +#endif } static int create_socket(char *filename_out) { @@ -265,24 +286,24 @@ static int create_socket(char *filename_out) { ret_fd = socket(PF_UNIX, SOCK_STREAM, 0); if(ret_fd == -1) { - fprintf(stderr, "X11.app: Failed to create socket (try %d / %d): %s - %s\n", (int)try+1, (int)try_max, filename_out, strerror(errno)); + ErrorF("X11.app: Failed to create socket (try %d / %d): %s - %s\n", (int)try+1, (int)try_max, filename_out, strerror(errno)); continue; } if(bind(ret_fd, servaddr, servaddr_len) != 0) { - fprintf(stderr, "X11.app: Failed to bind socket: %d - %s\n", errno, strerror(errno)); + ErrorF("X11.app: Failed to bind socket: %d - %s\n", errno, strerror(errno)); close(ret_fd); return 0; } if(listen(ret_fd, 10) != 0) { - fprintf(stderr, "X11.app: Failed to listen to socket: %s - %d - %s\n", filename_out, errno, strerror(errno)); + ErrorF("X11.app: Failed to listen to socket: %s - %d - %s\n", filename_out, errno, strerror(errno)); close(ret_fd); return 0; } #ifdef DEBUG - fprintf(stderr, "X11.app: Listening on socket for fd handoff: (%d) %s\n", ret_fd, filename_out); + ErrorF("X11.app: Listening on socket for fd handoff: (%d) %s\n", ret_fd, filename_out); #endif return ret_fd; @@ -300,7 +321,7 @@ kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t)); if(!handoff_data) { - fprintf(stderr, "X11.app: Error allocating memory for handoff_data\n"); + ErrorF("X11.app: Error allocating memory for handoff_data\n"); return KERN_FAILURE; } @@ -311,11 +332,17 @@ kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) } strlcpy(filename, handoff_data->filename, STRING_T_SIZE); - + +#ifdef HAVE_LIBDISPATCH + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{ + socket_handoff(handoff_data); + }); +#else create_thread(socket_handoff_thread, handoff_data); +#endif #ifdef DEBUG - fprintf(stderr, "X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd.\n"); + ErrorF("X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd.\n"); #endif return KERN_SUCCESS; @@ -340,7 +367,7 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv, * unset DISPLAY or we can run into problems with pbproxy */ if(!launchd_socket_handed_off) { - fprintf(stderr, "X11.app: No launchd socket handed off, unsetting DISPLAY\n"); + ErrorF("X11.app: No launchd socket handed off, unsetting DISPLAY\n"); unsetenv("DISPLAY"); } @@ -348,10 +375,10 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv, return KERN_FAILURE; } - fprintf(stderr, "X11.app: do_start_x11_server(): argc=%d\n", argvCnt); + ErrorF("X11.app: do_start_x11_server(): argc=%d\n", argvCnt); for(i=0; i < argvCnt; i++) { _argv[i] = argv[i]; - fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]); + ErrorF("\targv[%u] = %s\n", (unsigned)i, argv[i]); } _argv[argvCnt] = NULL; @@ -389,7 +416,7 @@ static int startup_trigger(int argc, char **argv, char **envp) { newenvp = (string_array_t)alloca(envpc * sizeof(string_t)); if(!newargv || !newenvp) { - fprintf(stderr, "Memory allocation failure\n"); + ErrorF("Memory allocation failure\n"); exit(EXIT_FAILURE); } @@ -403,16 +430,16 @@ static int startup_trigger(int argc, char **argv, char **envp) { kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp); if (kr != KERN_SUCCESS) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 - fprintf(stderr, "bootstrap_look_up(%s): %s\n", server_bootstrap_name, bootstrap_strerror(kr)); + ErrorF("bootstrap_look_up(%s): %s\n", server_bootstrap_name, bootstrap_strerror(kr)); #else - fprintf(stderr, "bootstrap_look_up(%s): %ul\n", server_bootstrap_name, (unsigned long)kr); + ErrorF("bootstrap_look_up(%s): %ul\n", server_bootstrap_name, (unsigned long)kr); #endif exit(EXIT_FAILURE); } kr = start_x11_server(mp, newargv, argc, newenvp, envpc); if (kr != KERN_SUCCESS) { - fprintf(stderr, "start_x11_server: %s\n", mach_error_string(kr)); + ErrorF("start_x11_server: %s\n", mach_error_string(kr)); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); @@ -428,18 +455,18 @@ static int startup_trigger(int argc, char **argv, char **envp) { /* Could open the display, start the launcher */ XCloseDisplay(display); - return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT)); + return execute(pref_app_to_run); } } /* Start the server */ if((s = getenv("DISPLAY"))) { - fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s); + ErrorF("X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s); unsetenv("DISPLAY"); } else { - fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n"); + ErrorF("X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n"); } - return execute(command_from_prefs("startx_script", DEFAULT_STARTX)); + return execute(pref_startx_script); } /** Setup the environment we want our child processes to inherit */ @@ -457,6 +484,27 @@ static void ensure_path(const char *dir) { } } +static void setup_console_redirect(const char *bundle_id) { + char *asl_sender; + char *asl_facility; + + asprintf(&asl_sender, "%s.server", bundle_id); + assert(asl_sender); + + asl_facility = strdup(bundle_id); + assert(asl_facility); + if(strcmp(asl_facility + strlen(asl_facility) - 4, ".X11") == 0) + asl_facility[strlen(asl_facility) - 4] = '\0'; + + assert(aslc = asl_open(asl_sender, asl_facility, ASL_OPT_NO_DELAY)); + free(asl_sender); + free(asl_facility); + + asl_set_filter(aslc, ASL_FILTER_MASK_UPTO(ASL_LEVEL_WARNING)); + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO); + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO); +} + static void setup_env(void) { char *temp; const char *pds = NULL; @@ -476,23 +524,25 @@ static void setup_env(void) { /* fallback to hardcoded value if we can't discover it */ if(!pds) { - pds = LAUNCHD_ID_PREFIX".X11"; + pds = BUNDLE_ID_PREFIX".X11"; } + setup_console_redirect(pds); + server_bootstrap_name = strdup(pds); if(!server_bootstrap_name) { - fprintf(stderr, "X11.app: Memory allocation error.\n"); + ErrorF("X11.app: Memory allocation error.\n"); exit(1); } setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1); len = strlen(server_bootstrap_name); - launchd_id_prefix = malloc(sizeof(char) * (len - 3)); - if(!launchd_id_prefix) { - fprintf(stderr, "X11.app: Memory allocation error.\n"); + bundle_id_prefix = malloc(sizeof(char) * (len - 3)); + if(!bundle_id_prefix) { + ErrorF("X11.app: Memory allocation error.\n"); exit(1); } - strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3); + strlcpy(bundle_id_prefix, server_bootstrap_name, len - 3); /* We need to unset DISPLAY if it is not our socket */ if(disp) { @@ -504,27 +554,27 @@ static void setup_env(void) { } if(s && *s) { - if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) { - fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n"); + if(strcmp(bundle_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) { + ErrorF("X11.app: Detected old style launchd DISPLAY, please update xinit.\n"); } else { temp = (char *)malloc(sizeof(char) * len); if(!temp) { - fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n"); + ErrorF("X11.app: Memory allocation error creating space for socket name test.\n"); exit(1); } - strlcpy(temp, launchd_id_prefix, len); + strlcpy(temp, bundle_id_prefix, len); strlcat(temp, ":0", len); if(strcmp(temp, s) != 0) { /* If we don't have a match, unset it. */ - fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix); + ErrorF("X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, bundle_id_prefix); unsetenv("DISPLAY"); } free(temp); } } else { /* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */ - fprintf(stderr, "X11.app: DISPLAY does not look like a launchd set variable, unsetting.\n"); + ErrorF("X11.app: DISPLAY does not look like a launchd set variable, unsetting.\n"); unsetenv("DISPLAY"); } } @@ -555,9 +605,9 @@ int main(int argc, char **argv, char **envp) { /* Setup the initial crasherporter info */ strlcpy(__crashreporter_info_buff__, __crashreporter_info__base, sizeof(__crashreporter_info_buff__)); - fprintf(stderr, "X11.app: main(): argc=%d\n", argc); + ErrorF("X11.app: main(): argc=%d\n", argc); for(i=0; i < argc; i++) { - fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]); + ErrorF("\targv[%u] = %s\n", (unsigned)i, argv[i]); if(!strcmp(argv[i], "--listenonly")) { listenOnly = TRUE; } @@ -565,7 +615,7 @@ int main(int argc, char **argv, char **envp) { mp = checkin_or_register(server_bootstrap_name); if(mp == MACH_PORT_NULL) { - fprintf(stderr, "NULL mach service: %s", server_bootstrap_name); + ErrorF("NULL mach service: %s", server_bootstrap_name); return EXIT_FAILURE; } @@ -576,20 +626,29 @@ int main(int argc, char **argv, char **envp) { pid_t child1, child2; int status; + pref_app_to_run = command_from_prefs("app_to_run", DEFAULT_CLIENT); + assert(pref_app_to_run); + + pref_login_shell = command_from_prefs("login_shell", DEFAULT_SHELL); + assert(pref_login_shell); + + pref_startx_script = command_from_prefs("startx_script", DEFAULT_STARTX); + assert(pref_startx_script); + /* Do the fork-twice trick to avoid having to reap zombies */ child1 = fork(); switch (child1) { case -1: /* error */ - break; + FatalError("fork() failed: %s\n", strerror(errno)); case 0: /* child1 */ child2 = fork(); switch (child2) { - int max_files, i; + int max_files; case -1: /* error */ - break; + FatalError("fork() failed: %s\n", strerror(errno)); case 0: /* child2 */ /* close all open files except for standard streams */ @@ -611,13 +670,17 @@ int main(int argc, char **argv, char **envp) { default: /* parent */ waitpid(child1, &status, 0); } + + free(pref_app_to_run); + free(pref_login_shell); + free(pref_startx_script); } /* Main event loop */ - fprintf(stderr, "Waiting for startup parameters via Mach IPC.\n"); + ErrorF("Waiting for startup parameters via Mach IPC.\n"); kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0); if (kr != KERN_SUCCESS) { - fprintf(stderr, "%s.X11(mp): %s\n", LAUNCHD_ID_PREFIX, mach_error_string(kr)); + ErrorF("%s.X11(mp): %s\n", BUNDLE_ID_PREFIX, mach_error_string(kr)); return EXIT_FAILURE; } @@ -628,14 +691,14 @@ static int execute(const char *command) { const char *newargv[4]; const char **p; - newargv[0] = command_from_prefs("login_shell", DEFAULT_SHELL); + newargv[0] = pref_login_shell; newargv[1] = "-c"; newargv[2] = command; newargv[3] = NULL; - fprintf(stderr, "X11.app: Launching %s:\n", command); + ErrorF("X11.app: Launching %s:\n", command); for(p=newargv; *p; p++) { - fprintf(stderr, "\targv[%ld] = %s\n", (long int)(p - newargv), *p); + ErrorF("\targv[%ld] = %s\n", (long int)(p - newargv), *p); } execvp (newargv[0], (char * const *) newargv); diff --git a/hw/xquartz/mach-startup/launchd_fd.c b/hw/xquartz/mach-startup/launchd_fd.c index 6dace8ea1..8003dd177 100644 --- a/hw/xquartz/mach-startup/launchd_fd.c +++ b/hw/xquartz/mach-startup/launchd_fd.c @@ -31,55 +31,57 @@ #endif #include -#include +#include #include #include "launchd_fd.h" +extern aslclient aslc; + int launchd_display_fd(void) { launch_data_t sockets_dict, checkin_request, checkin_response; launch_data_t listening_fd_array, listening_fd; /* Get launchd fd */ if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) == NULL) { - fprintf(stderr,"launch_data_new_string(\"" LAUNCH_KEY_CHECKIN "\") Unable to create string.\n"); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launch_data_new_string(\"" LAUNCH_KEY_CHECKIN "\") Unable to create string.\n"); return ERROR_FD; } if ((checkin_response = launch_msg(checkin_request)) == NULL) { - fprintf(stderr,"launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",strerror(errno)); + asl_log(aslc, NULL, ASL_LEVEL_WARNING, "launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",strerror(errno)); return ERROR_FD; } if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) { // ignore EACCES, which is common if we weren't started by launchd if (launch_data_get_errno(checkin_response) != EACCES) - fprintf(stderr,"launchd check-in failed: %s\n", strerror(launch_data_get_errno(checkin_response))); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in failed: %s\n", strerror(launch_data_get_errno(checkin_response))); return ERROR_FD; } sockets_dict = launch_data_dict_lookup(checkin_response, LAUNCH_JOBKEY_SOCKETS); if (NULL == sockets_dict) { - fprintf(stderr,"launchd check-in: no sockets found to answer requests on!\n"); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in: no sockets found to answer requests on!\n"); return ERROR_FD; } if (launch_data_dict_get_count(sockets_dict) > 1) { - fprintf(stderr,"launchd check-in: some sockets will be ignored!\n"); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in: some sockets will be ignored!\n"); return ERROR_FD; } - listening_fd_array = launch_data_dict_lookup(sockets_dict, LAUNCHD_ID_PREFIX":0"); + listening_fd_array = launch_data_dict_lookup(sockets_dict, BUNDLE_ID_PREFIX":0"); if (NULL == listening_fd_array) { listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0"); if (NULL == listening_fd_array) { - fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", LAUNCHD_ID_PREFIX); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", BUNDLE_ID_PREFIX); return ERROR_FD; } } if (launch_data_array_get_count(listening_fd_array)!=1) { - fprintf(stderr,"launchd check-in: Expected 1 socket from launchd, got %u)\n", + asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in: Expected 1 socket from launchd, got %u)\n", (unsigned)launch_data_array_get_count(listening_fd_array)); return ERROR_FD; } diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c index ccf5ab426..d8e4abdd1 100644 --- a/hw/xquartz/mach-startup/stub.c +++ b/hw/xquartz/mach-startup/stub.c @@ -33,18 +33,16 @@ #endif #include -#include #include #include +#include #include #include -#define kX11AppBundleId LAUNCHD_ID_PREFIX".X11" +#define kX11AppBundleId BUNDLE_ID_PREFIX".X11" #define kX11AppBundlePath "/Contents/MacOS/X11" -static char *server_bootstrap_name = kX11AppBundleId; - #include #include #include @@ -56,18 +54,9 @@ static char *server_bootstrap_name = kX11AppBundleId; #include "launchd_fd.h" -#ifndef BUILD_DATE -#define BUILD_DATE "?" -#endif -#ifndef XSERVER_VERSION -#define XSERVER_VERSION "?" -#endif - -#define DEBUG 1 - static char x11_path[PATH_MAX + 1]; - static pid_t x11app_pid = 0; +aslclient aslc; static void set_x11_path(void) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 @@ -78,26 +67,24 @@ static void set_x11_path(void) { switch (osstatus) { case noErr: if (appURL == NULL) { - fprintf(stderr, "Xquartz: Invalid response from LSFindApplicationForInfo(%s)\n", + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Invalid response from LSFindApplicationForInfo(%s)", kX11AppBundleId); exit(1); } if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) { - fprintf(stderr, "Xquartz: Error resolving URL for %s\n", kX11AppBundleId); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Error resolving URL for %s", kX11AppBundleId); exit(3); } strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path)); -#ifdef DEBUG - fprintf(stderr, "Xquartz: X11.app = %s\n", x11_path); -#endif + asl_log(aslc, NULL, ASL_LEVEL_INFO, "Xquartz: X11.app = %s", x11_path); break; case kLSApplicationNotFoundErr: - fprintf(stderr, "Xquartz: Unable to find application for %s\n", kX11AppBundleId); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Unable to find application for %s", kX11AppBundleId); exit(10); default: - fprintf(stderr, "Xquartz: Unable to find application for %s, error code = %d\n", + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Unable to find application for %s, error code = %d", kX11AppBundleId, (int)osstatus); exit(11); } @@ -123,12 +110,12 @@ static int connect_to_socket(const char *filename) { ret_fd = socket(PF_UNIX, SOCK_STREAM, 0); if(ret_fd == -1) { - fprintf(stderr, "Xquartz: Failed to create socket: %s - %s\n", filename, strerror(errno)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Failed to create socket: %s - %s", filename, strerror(errno)); return -1; } if(connect(ret_fd, servaddr, servaddr_len) < 0) { - fprintf(stderr, "Xquartz: Failed to connect to socket: %s - %d - %s\n", filename, errno, strerror(errno)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Failed to connect to socket: %s - %d - %s", filename, errno, strerror(errno)); close(ret_fd); return -1; } @@ -169,17 +156,15 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) { *((int*)CMSG_DATA(cmsg)) = launchd_fd; if(sendmsg(connected_fd, &msg, 0) < 0) { - fprintf(stderr, "Xquartz: Error sending $DISPLAY file descriptor over fd %d: %d -- %s\n", connected_fd, errno, strerror(errno)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Error sending $DISPLAY file descriptor over fd %d: %d -- %s", connected_fd, errno, strerror(errno)); return; } -#ifdef DEBUG - fprintf(stderr, "Xquartz: Message sent. Closing handoff fd.\n"); -#endif - + asl_log(aslc, NULL, ASL_LEVEL_DEBUG, "Xquartz: Message sent. Closing handoff fd."); close(connected_fd); } +__attribute__((__noreturn__)) static void signal_handler(int sig) { if(x11app_pid) kill(x11app_pid, sig); @@ -196,17 +181,25 @@ int main(int argc, char **argv, char **envp) { int launchd_fd; string_t handoff_socket_filename; sig_t handler; - - if(argc == 2 && !strcmp(argv[1], "-version")) { - fprintf(stderr, "X.org Release 7.5\n"); - fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION); - fprintf(stderr, "Build Date: %s\n", BUILD_DATE); - return EXIT_SUCCESS; - } + char *asl_sender; + char *asl_facility; + char *server_bootstrap_name = kX11AppBundleId; if(getenv("X11_PREFS_DOMAIN")) server_bootstrap_name = getenv("X11_PREFS_DOMAIN"); - + + asprintf(&asl_sender, "%s.stub", server_bootstrap_name); + assert(asl_sender); + + asl_facility = strdup(server_bootstrap_name); + assert(asl_facility); + if(strcmp(asl_facility + strlen(asl_facility) - 4, ".X11") == 0) + asl_facility[strlen(asl_facility) - 4] = '\0'; + + assert(aslc = asl_open(asl_sender, asl_facility, ASL_OPT_NO_DELAY)); + free(asl_sender); + free(asl_facility); + /* We don't have a mechanism in place to handle this interrupt driven * server-start notification, so just send the signal now, so xinit doesn't * time out waiting for it and will just poll for the server. @@ -227,13 +220,13 @@ int main(int argc, char **argv, char **envp) { if(kr != KERN_SUCCESS) { pid_t child; - fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name); + asl_log(aslc, NULL, ASL_LEVEL_WARNING, "Xquartz: Unable to locate waiting server: %s", server_bootstrap_name); set_x11_path(); /* This forking is ugly and will be cleaned up later */ child = fork(); if(child == -1) { - fprintf(stderr, "Xquartz: Could not fork: %s\n", strerror(errno)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Could not fork: %s", strerror(errno)); return EXIT_FAILURE; } @@ -242,7 +235,7 @@ int main(int argc, char **argv, char **envp) { _argv[0] = x11_path; _argv[1] = "--listenonly"; _argv[2] = NULL; - fprintf(stderr, "Xquartz: Starting X server: %s --listenonly\n", x11_path); + asl_log(aslc, NULL, ASL_LEVEL_NOTICE, "Xquartz: Starting X server: %s --listenonly", x11_path); return execvp(x11_path, _argv); } @@ -256,9 +249,9 @@ int main(int argc, char **argv, char **envp) { if(kr != KERN_SUCCESS) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 - fprintf(stderr, "Xquartz: bootstrap_look_up(): %s\n", bootstrap_strerror(kr)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: bootstrap_look_up(): %s", bootstrap_strerror(kr)); #else - fprintf(stderr, "Xquartz: bootstrap_look_up(): %ul\n", (unsigned long)kr); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: bootstrap_look_up(): %ul", (unsigned long)kr); #endif return EXIT_FAILURE; } @@ -274,20 +267,17 @@ int main(int argc, char **argv, char **envp) { for(try=0, try_max=5; try < try_max; try++) { if(request_fd_handoff_socket(mp, handoff_socket_filename) != KERN_SUCCESS) { - fprintf(stderr, "Xquartz: Failed to request a socket from the server to send the $DISPLAY fd over (try %d of %d)\n", (int)try+1, (int)try_max); + asl_log(aslc, NULL, ASL_LEVEL_INFO, "Xquartz: Failed to request a socket from the server to send the $DISPLAY fd over (try %d of %d)", (int)try+1, (int)try_max); continue; } handoff_fd = connect_to_socket(handoff_socket_filename); if(handoff_fd == -1) { - fprintf(stderr, "Xquartz: Failed to connect to socket (try %d of %d)\n", (int)try+1, (int)try_max); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Failed to connect to socket (try %d of %d)", (int)try+1, (int)try_max); continue; } -#ifdef DEBUG - fprintf(stderr, "Xquartz: Handoff connection established (try %d of %d) on fd %d, \"%s\". Sending message.\n", (int)try+1, (int)try_max, handoff_fd, handoff_socket_filename); -#endif - + asl_log(aslc, NULL, ASL_LEVEL_INFO, "Xquartz: Handoff connection established (try %d of %d) on fd %d, \"%s\". Sending message.", (int)try+1, (int)try_max, handoff_fd, handoff_socket_filename); send_fd_handoff(handoff_fd, launchd_fd); close(handoff_fd); break; @@ -300,11 +290,11 @@ int main(int argc, char **argv, char **envp) { /* We have fixed-size string lengths due to limitations in IPC, * so we need to copy our argv and envp. */ - newargv = (string_array_t)malloc(argc * sizeof(string_t)); - newenvp = (string_array_t)malloc(envpc * sizeof(string_t)); + newargv = (string_array_t)calloc((1 + argc), sizeof(string_t)); + newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t)); if(!newargv || !newenvp) { - fprintf(stderr, "Xquartz: Memory allocation failure\n"); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Memory allocation failure"); return EXIT_FAILURE; } @@ -321,7 +311,7 @@ int main(int argc, char **argv, char **envp) { free(newenvp); if (kr != KERN_SUCCESS) { - fprintf(stderr, "Xquartz: start_x11_server: %s\n", mach_error_string(kr)); + asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: start_x11_server: %s", mach_error_string(kr)); return EXIT_FAILURE; } return EXIT_SUCCESS; diff --git a/hw/xquartz/man/Makefile.am b/hw/xquartz/man/Makefile.am new file mode 100644 index 000000000..5a0cde7cc --- /dev/null +++ b/hw/xquartz/man/Makefile.am @@ -0,0 +1,2 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xquartz.man diff --git a/hw/xquartz/doc/Xquartz.man.pre b/hw/xquartz/man/Xquartz.man similarity index 69% rename from hw/xquartz/doc/Xquartz.man.pre rename to hw/xquartz/man/Xquartz.man index 447194740..aea56c943 100644 --- a/hw/xquartz/doc/Xquartz.man.pre +++ b/hw/xquartz/man/Xquartz.man @@ -16,72 +16,72 @@ OS X handles the desktop background. .SH CUSTOMIZATION \fIXquartz\fP can be customized using the defaults(1) command. The available options are: .TP 8 -.B defaults write __laucnd_id_prefix__.X11 enable_fake_buttons -boolean true +.B defaults write __bundle_id_prefix__.X11 enable_fake_buttons -boolean true Emulates a 3 button mouse using modifier keys. By default, the Command modifier is used to emulate button 2 and Option is used for button 3. Thus, clicking the first mouse button while holding down Command will act like clicking button 2. Holding down Option will simulate button 3. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 fake_button2 \fImodifiers\fP +.B defaults write __bundle_id_prefix__.X11 fake_button2 \fImodifiers\fP Change the modifier keys used to emulate the second mouse button. By default, Command is used to emulate the second button. Any combination of the following modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn .TP 8 -.B defaults write __laucnd_id_prefix__.X11 fake_button3 \fImodifiers\fP +.B defaults write __bundle_id_prefix__.X11 fake_button3 \fImodifiers\fP Change the modifier keys used to emulate the second mouse button. By default, Command is used to emulate the second button. Any combination of the following modifier names may be used: {l,r,}shift, {l,r,}option, {l,r,}control, {l,r,}command, fn .TP 8 -.B defaults write __laucnd_id_prefix__.X11 fullscreen_hotkeys -boolean true +.B defaults write __bundle_id_prefix__.X11 fullscreen_hotkeys -boolean true Enable OSX hotkeys while in fullscreen .TP 8 -.B defaults write __laucnd_id_prefix__.X11 fullscreen_menu -boolean true +.B defaults write __bundle_id_prefix__.X11 fullscreen_menu -boolean true Show the OSX menu while in fullscreen .TP 8 -.B defaults write __laucnd_id_prefix__.X11 no_quit_alert -boolean true +.B defaults write __bundle_id_prefix__.X11 no_quit_alert -boolean true Disables the alert dialog displayed when attempting to quit X11. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 no_auth -boolean true +.B defaults write __bundle_id_prefix__.X11 no_auth -boolean true Stops the X server requiring that clients authenticate themselves when connecting. See Xsecurity(__miscmansuffix__). .TP 8 -.B defaults write __laucnd_id_prefix__.X11 nolisten_tcp -boolean false +.B defaults write __bundle_id_prefix__.X11 nolisten_tcp -boolean false This will tell the server to listen and accept TCP connections. Doing this without enabling xauth is a possible security concern. See Xsecurity(__miscmansuffix__). .TP 8 -.B defaults write __laucnd_id_prefix__.X11 enable_system_beep -boolean false +.B defaults write __bundle_id_prefix__.X11 enable_system_beep -boolean false Don't use the standard system beep effect for X11 alerts. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 enable_key_equivalents -boolean false +.B defaults write __bundle_id_prefix__.X11 enable_key_equivalents -boolean false Disable menu keyboard equivalents while X11 windows are focused. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 depth \fIdepth\fP +.B defaults write __bundle_id_prefix__.X11 depth \fIdepth\fP Specifies the color bit depth to use. Currently only 15, and 24 color bits per pixel are supported. If not specified, or a value of -1 is specified, defaults to the depth of the main display. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_keymap -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_keymap -boolean true Keep the X11 keymap up to date with the OSX system keymap. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 option_sends_alt -boolean true +.B defaults write __bundle_id_prefix__.X11 option_sends_alt -boolean true The Option key will send Alt_L and Alt_R instead of Mode_switch. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_pasteboard -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_pasteboard -boolean true Enable syncing between the OSX pasteboard and clipboard/primary selection buffers in X11. This option needs to be true for any of the other pasteboard sync options to have an effect. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_pasteboard_to_clipboard -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_pasteboard_to_clipboard -boolean true Update the X11 CLIPBOARD when the OSX NSPasteboard is updated. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_pasteboard_to_primary -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_pasteboard_to_primary -boolean true Update the the X11 PRIMARY buffer when the OSX NSPasteboard is updated. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_clipboard_to_pasteboard -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_clipboard_to_pasteboard -boolean true Update the the OSX NSPasteboard when the X11 CLIPBOARD is updated. Note that enabling this option causes the clipboard synchronization to act as a clipboard manager in X11. This makes it impossible to use xclipboard, klipper, or any other such clipboard managers. If you want to use any of these programs, you must disable this option. .TP 8 -.B defaults write __laucnd_id_prefix__.X11 sync_primary_on_select -boolean true +.B defaults write __bundle_id_prefix__.X11 sync_primary_on_select -boolean true This option defaults to false and is provided only "for experts." It updates the NSPasteboard whenever a new X11 selection is made (rather than requiring you to hit cmd-c to copy the selection to the NSPasteboard). Since the X11 protocol does not require applications to send notification when they change selection, this might not work in all cases (if you run into this problem, try selecting text in another application first, then selecting the text you want). .TP 8 -.B defaults write __laucnd_id_prefix__.X11 enable_test_extensions -boolean true +.B defaults write __bundle_id_prefix__.X11 enable_test_extensions -boolean true This option defaults to false and is only accessible through the command line. Enable this option to turn on the DEC-XTRAP, RECORD, and XTEST extensions in the server. .SH OPTIONS .PP @@ -102,9 +102,36 @@ Same as fake_button3 above. .TP 8 .B "\-depth \fIdepth\fP" Same as depth above. +.SH LOGGING +XQuartz stores a server log at ~/Library/Logs/X11.__bundle_id_prefix__.log which +is analogous to /var/log/Xorg.#.log on systems that use the XFree86 DDX such as +Linux, BSD, and Solaris. +.PP +In addition to this server log, XQuartz sends messages to syslogd(8) using +asl(3). These logs are sent to the __bundle_id_prefix__ facility, and you can +watch these logs using the following syslog(1) command: +.TP 8 +.B $ syslog -w -k Facility eq __bundle_id_prefix__ +.PP +or you can include extra information such as the file, line, and function where the message originated: +.TP 8 +.B $ syslog -w -F '$(Time) $(Sender) <$(Level)> $(File):$(Line) $(Function) :: $(Message)' -k Facility eq __bundle_id_prefix__ +.PP +By default, XQaurtz sets an ASL mask which prevents it from logging messages +below the ASL_LEVEL_WARNING level (meaning almost all logging is done strictly +to the file referenced above). To force XQuartz to send all log messages to +syslogd(8), you can adjust this mask using the following syslog(1) command: +.TP 8 +.B $ syslog -c X11.bin -d +.PP +The stdout and stderr messages printed by any process launched by XQuartz will +be redirected to this syslog facility with a priority level of ASL_LEVEL_INFO +and ASL_LEVEL_NOTICE respectively. In order to see these messages in syslog, +you will need to adjust XQuartz's asl mask as above but using -i or -n +instead of -d. .SH "SEE ALSO" .PP -X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1) +X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), syslog(1), syslogd(8) .PP http://xquartz.macosforge.org .PP diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am index 188664259..b8b95d232 100644 --- a/hw/xquartz/pbproxy/Makefile.am +++ b/hw/xquartz/pbproxy/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \ - -DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\" + -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" AM_CFLAGS=$(XPBPROXY_CFLAGS) diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m index b00e90a6d..a8c3a6055 100644 --- a/hw/xquartz/pbproxy/app-main.m +++ b/hw/xquartz/pbproxy/app-main.m @@ -34,14 +34,14 @@ #include /*for getpid*/ #include -static const char *app_prefs_domain = LAUNCHD_ID_PREFIX".xpbproxy"; +static const char *app_prefs_domain = BUNDLE_ID_PREFIX".xpbproxy"; CFStringRef app_prefs_domain_cfstr; /* Stubs */ char *display = NULL; -BOOL serverInitComplete = YES; -pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER; +BOOL serverRunning = YES; +pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER; static void signal_handler (int sig) { switch(sig) { @@ -53,12 +53,22 @@ static void signal_handler (int sig) { } } +void +ErrorF(const char * f, ...) +{ + va_list args; + + va_start(args, f); + vfprintf(stderr, f, args); + va_end(args); +} + int main (int argc, const char *argv[]) { const char *s; int i; #ifdef DEBUG - printf("pid: %u\n", getpid()); + ErrorF("pid: %u\n", getpid()); #endif xpbproxy_is_standalone = YES; @@ -70,13 +80,13 @@ int main (int argc, const char *argv[]) { if(strcmp (argv[i], "--prefs-domain") == 0 && i+1 < argc) { app_prefs_domain = argv[++i]; } else if (strcmp (argv[i], "--help") == 0) { - printf("usage: xpbproxy OPTIONS\n" + ErrorF("usage: xpbproxy OPTIONS\n" "Pasteboard proxying for X11.\n\n" "--prefs-domain Change the domain used for reading preferences\n" " (default: %s)\n", app_prefs_domain); return 0; } else { - fprintf(stderr, "usage: xpbproxy OPTIONS...\n" + ErrorF("usage: xpbproxy OPTIONS...\n" "Try 'xpbproxy --help' for more information.\n"); return 1; } diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m index bb0646502..29ce83b35 100644 --- a/hw/xquartz/pbproxy/main.m +++ b/hw/xquartz/pbproxy/main.m @@ -47,17 +47,17 @@ x_selection *_selection_object; -extern BOOL serverInitComplete; -extern pthread_mutex_t serverInitCompleteMutex; -extern pthread_cond_t serverInitCompleteCond; +extern BOOL serverRunning; +extern pthread_mutex_t serverRunningMutex; +extern pthread_cond_t serverRunningCond; static inline void wait_for_server_init(void) { /* If the server hasn't finished initializing, wait for it... */ - if(!serverInitComplete) { - pthread_mutex_lock(&serverInitCompleteMutex); - while(!serverInitComplete) - pthread_cond_wait(&serverInitCompleteCond, &serverInitCompleteMutex); - pthread_mutex_unlock(&serverInitCompleteMutex); + if(!serverRunning) { + pthread_mutex_lock(&serverRunningMutex); + while(!serverRunning) + pthread_cond_wait(&serverRunningCond, &serverRunningMutex); + pthread_mutex_unlock(&serverRunningMutex); } } @@ -105,7 +105,7 @@ int xpbproxy_run (void) { } if (xpbproxy_dpy == NULL) { - fprintf (stderr, "xpbproxy: can't open default display\n"); + ErrorF("xpbproxy: can't open default display\n"); [pool release]; return EXIT_FAILURE; } @@ -115,7 +115,7 @@ int xpbproxy_run (void) { if (!XAppleWMQueryExtension (xpbproxy_dpy, &xpbproxy_apple_wm_event_base, &xpbproxy_apple_wm_error_base)) { - fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n"); + ErrorF("xpbproxy: can't open AppleWM server extension\n"); [pool release]; return EXIT_FAILURE; } @@ -147,19 +147,3 @@ Time xpbproxy_current_timestamp (void) { /* FIXME: may want to fetch a timestamp from the server.. */ return CurrentTime; } - -void debug_printf (const char *fmt, ...) { - static int spew = -1; - - if (spew == -1) { - char *x = getenv ("DEBUG"); - spew = (x != NULL && atoi (x) != 0); - } - - if (spew) { - va_list args; - va_start(args, fmt); - vfprintf (stderr, fmt, args); - va_end(args); - } -} diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h index 013f981d4..fcbf4c4ba 100644 --- a/hw/xquartz/pbproxy/pbproxy.h +++ b/hw/xquartz/pbproxy/pbproxy.h @@ -77,14 +77,16 @@ extern BOOL xpbproxy_have_xfixes; /* from x-input.m */ extern BOOL xpbproxy_input_register (void); +/* os/log.c or app-main.m */ +extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); + #ifdef DEBUG /* BEWARE: this can cause a string memory leak, according to the leaks program. */ -# define DB(msg, args...) debug_printf("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args) +# define DebugF(msg, args...) ErrorF("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args) #else -# define DB(msg, args...) do {} while (0) +# define DebugF(...) /* */ #endif -#define TRACE() DB("TRACE\n") -extern void debug_printf (const char *fmt, ...); +#define TRACE() DebugF("TRACE\n") #endif /* PBPROXY_H */ diff --git a/hw/xquartz/pbproxy/x-input.m b/hw/xquartz/pbproxy/x-input.m index 405ba3c73..ebb89980f 100644 --- a/hw/xquartz/pbproxy/x-input.m +++ b/hw/xquartz/pbproxy/x-input.m @@ -87,7 +87,7 @@ static void xpbproxy_process_xevents(void) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if(pool == nil) { - fprintf(stderr, "unable to allocate/init auto release pool!\n"); + ErrorF("unable to allocate/init auto release pool!\n"); return; } diff --git a/hw/xquartz/pbproxy/x-selection.h b/hw/xquartz/pbproxy/x-selection.h index 614c8b091..d4a39e58f 100644 --- a/hw/xquartz/pbproxy/x-selection.h +++ b/hw/xquartz/pbproxy/x-selection.h @@ -33,7 +33,9 @@ #include "pbproxy.h" +#define Cursor X_Cursor #include +#undef Cursor #include diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m index ef84f8bfb..7964f5193 100644 --- a/hw/xquartz/pbproxy/x-selection.m +++ b/hw/xquartz/pbproxy/x-selection.m @@ -81,19 +81,19 @@ @implementation x_selection #ifdef DEBUG static void -dump_prefs (FILE *fp) { - fprintf(fp, - "pbproxy preferences:\n" - "\tactive %u\n" - "\tprimary_on_grab %u\n" - "\tclipboard_to_pasteboard %u\n" - "\tpasteboard_to_primary %u\n" - "\tpasteboard_to_clipboard %u\n", - pbproxy_prefs.active, - pbproxy_prefs.primary_on_grab, - pbproxy_prefs.clipboard_to_pasteboard, - pbproxy_prefs.pasteboard_to_primary, - pbproxy_prefs.pasteboard_to_clipboard); +dump_prefs() { + ErrorF(fp, + "pbproxy preferences:\n" + "\tactive %u\n" + "\tprimary_on_grab %u\n" + "\tclipboard_to_pasteboard %u\n" + "\tpasteboard_to_primary %u\n" + "\tpasteboard_to_clipboard %u\n", + pbproxy_prefs.active, + pbproxy_prefs.primary_on_grab, + pbproxy_prefs.clipboard_to_pasteboard, + pbproxy_prefs.pasteboard_to_primary, + pbproxy_prefs.pasteboard_to_clipboard); } #endif @@ -152,7 +152,7 @@ @implementation x_selection unsigned char *newbuf = NULL; #ifdef TEST - printf("bytesleft %lu\n", bytesleft); + ErrorF("bytesleft %lu\n", bytesleft); #endif if (Success != XGetWindowProperty (xpbproxy_dpy, win, property, @@ -161,24 +161,29 @@ @implementation x_selection type, &format, &numitems, &bytesleft, &chunk)) { - DB ("Error while getting window property.\n"); + DebugF ("Error while getting window property.\n"); *pdata = null_propdata; free (buf); return True; } #ifdef TEST - printf("format %d numitems %lu bytesleft %lu\n", + ErrorF("format %d numitems %lu bytesleft %lu\n", format, numitems, bytesleft); - printf("type %s\n", XGetAtomName (xpbproxy_dpy, *type)); + ErrorF("type %s\n", XGetAtomName (xpbproxy_dpy, *type)); #endif /* Format is the number of bits. */ - chunkbytesize = numitems * (format / 8); + if (format == 8) + chunkbytesize = numitems; + else if (format == 16) + chunkbytesize = numitems * sizeof(short); + else if (format == 32) + chunkbytesize = numitems * sizeof(long); #ifdef TEST - printf("chunkbytesize %zu\n", chunkbytesize); + ErrorF("chunkbytesize %zu\n", chunkbytesize); #endif newbuflen = buflen + chunkbytesize; if (newbuflen > 0) @@ -206,7 +211,7 @@ @implementation x_selection } #ifdef TEST - printf("bytesleft %lu\n", bytesleft); + ErrorF("bytesleft %lu\n", bytesleft); #endif } while (bytesleft > 0); @@ -231,13 +236,13 @@ - (Atom) find_preferred:(struct propdata *)pdata if (pdata->format != 32) { - fprintf(stderr, "Atom list is expected to be formatted as an array of 32bit values.\n"); + ErrorF("Atom list is expected to be formatted as an array of 32bit values.\n"); return None; } - for (i = 0, step = pdata->format >> 3; i < pdata->length; i += step) + for (i = 0, step = sizeof(long); i < pdata->length; i += step) { - a = (Atom)*(uint32_t *)(pdata->data + i); + a = (Atom)*(long *)(pdata->data + i); if (a == atoms->image_png) { @@ -260,7 +265,7 @@ - (Atom) find_preferred:(struct propdata *)pdata char *type = XGetAtomName(xpbproxy_dpy, a); if (type) { - DB("Unhandled X11 mime type: %s", type); + DebugF("Unhandled X11 mime type: %s", type); XFree(type); } } @@ -373,7 +378,7 @@ - (void) x_active:(Time)timestamp if (countNow != changeCount) { - DB ("changed pasteboard!\n"); + DebugF ("changed pasteboard!\n"); changeCount = countNow; if (pbproxy_prefs.pasteboard_to_primary) @@ -457,9 +462,8 @@ - (BOOL) set_clipboard_manager_status:(BOOL)value return TRUE; if(owner != None) { - fprintf (stderr, "A clipboard manager using window 0x%lx " - "already owns the clipboard selection. " - "pbproxy will not sync clipboard to pasteboard.\n", owner); + ErrorF("A clipboard manager using window 0x%lx already owns the clipboard selection. " + "pbproxy will not sync clipboard to pasteboard.\n", owner); return FALSE; } @@ -486,7 +490,7 @@ - (void) clear_event:(XSelectionClearEvent *)e TRACE (); - DB ("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); + DebugF ("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); if(e->selection == atoms->clipboard) { /* @@ -503,7 +507,7 @@ - (void) clear_event:(XSelectionClearEvent *)e /* Another CLIPBOARD_MANAGER has set itself as owner. Disable syncing * to avoid a race. */ - fprintf(stderr, "Another clipboard manager was started! " + ErrorF("Another clipboard manager was started! " "xpbproxy is disabling syncing with clipboard.\n"); pbproxy_prefs.clipboard_to_pasteboard = NO; } @@ -528,7 +532,7 @@ - (void) claim_clipboard * The owner probably died or we are just starting up pbproxy. * Set pbproxy's _selection_window as the owner, and continue. */ - DB ("No clipboard owner.\n"); + DebugF ("No clipboard owner.\n"); [self copy_completed:atoms->clipboard]; return; } else if (owner == _selection_window) { @@ -536,7 +540,7 @@ - (void) claim_clipboard return; } - DB ("requesting targets\n"); + DebugF ("requesting targets\n"); request_atom = atoms->targets; XConvertSelection (xpbproxy_dpy, atoms->clipboard, atoms->targets, @@ -576,7 +580,7 @@ - (void) send_reply:(XEvent *)reply * We are supposed to use an empty event mask, and not propagate * the event, according to the ICCCM. */ - DB ("reply->xselection.requestor 0x%lx\n", reply->xselection.requestor); + DebugF ("reply->xselection.requestor 0x%lx\n", reply->xselection.requestor); XSendEvent (xpbproxy_dpy, reply->xselection.requestor, False, 0, reply); XFlush (xpbproxy_dpy); @@ -613,7 +617,7 @@ - (void) send_targets:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb if ([pbtypes containsObject:NSStringPboardType]) { /* We have a string type that we can convert to UTF8, or Latin-1... */ - DB ("NSStringPboardType\n"); + DebugF ("NSStringPboardType\n"); list[count] = atoms->utf8_string; ++count; list[count] = atoms->string; @@ -625,18 +629,26 @@ - (void) send_targets:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb /* TODO add the NSPICTPboardType back again, once we have conversion * functionality in send_image. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // NSPICTPboardType +#endif if ([pbtypes containsObject:NSPICTPboardType] || [pbtypes containsObject:NSTIFFPboardType]) { /* We can convert a TIFF to a PNG or JPEG. */ - DB ("NSTIFFPboardType\n"); + DebugF ("NSTIFFPboardType\n"); list[count] = atoms->image_png; ++count; list[count] = atoms->image_jpeg; ++count; } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + if (count) { /* We have a list of ATOMs to send. */ @@ -671,7 +683,7 @@ - (void) send_string:(XSelectionRequestEvent *)e utf8:(BOOL)utf8 pasteboard:(NSP return; } - DB ("pbtypes retainCount after containsObject: %u\n", [pbtypes retainCount]); + DebugF ("pbtypes retainCount after containsObject: %u\n", [pbtypes retainCount]); data = [pb stringForType:NSStringPboardType]; @@ -691,19 +703,19 @@ - (void) send_string:(XSelectionRequestEvent *)e utf8:(BOOL)utf8 pasteboard:(NSP length = strlen (bytes); if (length < 50) { - DB ("UTF-8: %s\n", bytes); - DB ("UTF-8 length: %u\n", length); + DebugF ("UTF-8: %s\n", bytes); + DebugF ("UTF-8 length: %u\n", length); } } else { - DB ("Latin-1\n"); + DebugF ("Latin-1\n"); bytes = [data cStringUsingEncoding:NSISOLatin1StringEncoding]; /*WARNING: bytes is not NUL-terminated. */ length = [data lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding]; } - DB ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); + DebugF ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); XChangeProperty (xpbproxy_dpy, e->requestor, e->property, e->target, 8, PropModeReplace, (unsigned char *) bytes, length); @@ -745,7 +757,7 @@ - (void) send_compound_text:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard { if (8 != textprop.format) - DB ("textprop.format is unexpectedly not 8 - it's %d instead\n", + DebugF ("textprop.format is unexpectedly not 8 - it's %d instead\n", textprop.format); XChangeProperty (xpbproxy_dpy, e->requestor, e->property, @@ -837,7 +849,7 @@ - (BOOL) send_image_pict_reply:(XSelectionRequestEvent *)e if (nil == data) { [img autorelease]; - fprintf(stderr, "unable to convert PICT to TIFF!\n"); + ErrorF("unable to convert PICT to TIFF!\n"); return YES; } @@ -913,7 +925,7 @@ - (void) send_image:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb imagetype = NSJPEGFileType; else { - fprintf(stderr, "internal failure in xpbproxy! imagetype being sent isn't PNG or JPEG.\n"); + ErrorF("internal failure in xpbproxy! imagetype being sent isn't PNG or JPEG.\n"); } pbtypes = [pb types]; @@ -925,7 +937,14 @@ - (void) send_image:(XSelectionRequestEvent *)e pasteboard:(NSPasteboard *)pb if (NO == [self send_image_tiff_reply:e pasteboard:pb type:imagetype]) return; } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // NSPICTPboardType +#endif else if ([pbtypes containsObject:NSPICTPboardType]) +#ifdef __clang__ +#pragma clang diagnostic pop +#endif { if (NO == [self send_image_pict_reply:e pasteboard:pb type:imagetype]) return; @@ -977,7 +996,7 @@ - (void)request_event:(XSelectionRequestEvent *)e if (None != e->target) - DB ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); + DebugF ("e->target %s\n", XGetAtomName (xpbproxy_dpy, e->target)); if (e->target == atoms->targets) { @@ -1029,15 +1048,15 @@ - (void) notify_event:(XSelectionEvent *)e [self release_pending]; if (None == e->property) { - DB ("e->property is None.\n"); + DebugF ("e->property is None.\n"); [self copy_completed:e->selection]; /* Nothing is selected. */ return; } #if 0 - printf ("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); - printf ("e->property %s\n", XGetAtomName (xpbproxy_dpy, e->property)); + ErrorF("e->selection %s\n", XGetAtomName (xpbproxy_dpy, e->selection)); + ErrorF("e->property %s\n", XGetAtomName (xpbproxy_dpy, e->property)); #endif if ([self is_incr_type:e]) @@ -1046,7 +1065,7 @@ - (void) notify_event:(XSelectionEvent *)e * This is an INCR-style transfer, which means that we * will get the data after a series of PropertyNotify events. */ - DB ("is INCR\n"); + DebugF ("is INCR\n"); if (get_property (e->requestor, e->property, &pdata, /*Delete*/ True, &type)) { @@ -1063,7 +1082,7 @@ - (void) notify_event:(XSelectionEvent *)e pending.requestor = e->requestor; pending.selection = e->selection; - DB ("set pending.requestor to 0x%lx\n", pending.requestor); + DebugF ("set pending.requestor to 0x%lx\n", pending.requestor); } else { @@ -1076,7 +1095,7 @@ - (void) notify_event:(XSelectionEvent *)e /* We have the complete selection data.*/ [self handle_selection:e->selection type:type propdata:&pdata]; - DB ("handled selection with the first notify_event\n"); + DebugF ("handled selection with the first notify_event\n"); } } @@ -1096,7 +1115,7 @@ - (void) property_event:(XPropertyEvent *)e if (name) { - DB ("e->atom %s\n", name); + DebugF ("e->atom %s\n", name); XFree(name); } #endif @@ -1104,7 +1123,7 @@ - (void) property_event:(XPropertyEvent *)e if (None != pending.requestor && PropertyNewValue == e->state) { - DB ("pending.requestor 0x%lx\n", pending.requestor); + DebugF ("pending.requestor 0x%lx\n", pending.requestor); if (get_property (e->window, e->atom, &pdata, /*Delete*/ True, &type)) { @@ -1146,7 +1165,7 @@ - (void) xfixes_selection_notify:(XFixesSelectionNotifyEvent *)e { case XFixesSelectionWindowDestroyNotify: case XFixesSelectionClientCloseNotify: default: - fprintf(stderr, "Unhandled XFixesSelectionNotifyEvent: subtype=%d\n", e->subtype); + ErrorF("Unhandled XFixesSelectionNotifyEvent: subtype=%d\n", e->subtype); break; } } @@ -1176,7 +1195,7 @@ - (void) handle_targets: (Atom)selection propdata:(struct propdata *)pdata if (name) { - DB ("requesting %s\n", name); + DebugF ("requesting %s\n", name); } #endif request_atom = preferred; @@ -1200,11 +1219,11 @@ - (void) handle_image: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb if (nil == data) { - DB ("unable to create NSData object!\n"); + DebugF ("unable to create NSData object!\n"); return; } - DB ("data retainCount before NSBitmapImageRep initWithData: %u\n", + DebugF ("data retainCount before NSBitmapImageRep initWithData: %u\n", [data retainCount]); bmimage = [[NSBitmapImageRep alloc] initWithData:data]; @@ -1212,11 +1231,11 @@ - (void) handle_image: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb if (nil == bmimage) { [data autorelease]; - DB ("unable to create NSBitmapImageRep!\n"); + DebugF ("unable to create NSBitmapImageRep!\n"); return; } - DB ("data retainCount after NSBitmapImageRep initWithData: %u\n", + DebugF ("data retainCount after NSBitmapImageRep initWithData: %u\n", [data retainCount]); @try @@ -1226,13 +1245,13 @@ - (void) handle_image: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb @catch (NSException *e) { - DB ("NSTIFFException!\n"); + DebugF ("NSTIFFException!\n"); [data autorelease]; [bmimage autorelease]; return; } - DB ("bmimage retainCount after TIFFRepresentation %u\n", [bmimage retainCount]); + DebugF ("bmimage retainCount after TIFFRepresentation %u\n", [bmimage retainCount]); pbtypes = [NSArray arrayWithObjects:NSTIFFPboardType, nil]; @@ -1246,12 +1265,12 @@ - (void) handle_image: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb [pb declareTypes:pbtypes owner:nil]; if (YES != [pb setData:tiff forType:NSTIFFPboardType]) { - DB ("writing pasteboard data failed!\n"); + DebugF ("writing pasteboard data failed!\n"); } [data autorelease]; - DB ("bmimage retainCount before release %u\n", [bmimage retainCount]); + DebugF ("bmimage retainCount before release %u\n", [bmimage retainCount]); [bmimage autorelease]; } @@ -1279,10 +1298,10 @@ - (void) handle_utf8_string:(struct propdata *)pdata pasteboard:(NSPasteboard *) [pb declareTypes:pbtypes owner:nil]; if (YES != [pb setString:string forType:NSStringPboardType]) { - fprintf(stderr, "pasteboard setString:forType: failed!\n"); + ErrorF("pasteboard setString:forType: failed!\n"); } [string autorelease]; - DB ("done handling utf8 string\n"); + DebugF ("done handling utf8 string\n"); } /* This handles the STRING type, which should be in Latin-1. */ @@ -1308,7 +1327,7 @@ - (void) handle_string: (struct propdata *)pdata pasteboard:(NSPasteboard *)pb [pb declareTypes:pbtypes owner:nil]; if (YES != [pb setString:string forType:NSStringPboardType]) { - fprintf(stderr, "pasteboard setString:forType failed in handle_string!\n"); + ErrorF("pasteboard setString:forType failed in handle_string!\n"); } [string autorelease]; } @@ -1374,7 +1393,7 @@ - (void) copy_completed:(Atom)selection name = XGetAtomName (xpbproxy_dpy, selection); if (name) { - DB ("copy_completed: %s\n", name); + DebugF ("copy_completed: %s\n", name); XFree (name); } #endif @@ -1435,10 +1454,10 @@ - (void) reload_preferences pbproxy_prefs.pasteboard_to_clipboard = prefs_get_bool(CFSTR("sync_pasteboard_to_clipboard"), pbproxy_prefs.pasteboard_to_clipboard); /* This is used for debugging. */ - //dump_prefs(stdout); + //dump_prefs(); if(pbproxy_prefs.active && pbproxy_prefs.primary_on_grab && !xpbproxy_have_xfixes) { - fprintf(stderr, "Disabling sync_primary_on_select functionality due to missing XFixes extension.\n"); + ErrorF("Disabling sync_primary_on_select functionality due to missing XFixes extension.\n"); pbproxy_prefs.primary_on_grab = NO; } diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index e21303ccd..c395b42e6 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -62,6 +62,8 @@ #include #include #include +#include +#include #include #include @@ -79,7 +81,8 @@ Bool XQuartzRootlessDefault = TRUE; Bool XQuartzIsRootless = TRUE; Bool XQuartzServerVisible = FALSE; Bool XQuartzFullscreenMenu = FALSE; -Bool XQuartzUseSysBeep = FALSE; + +int32_t XQuartzShieldingWindowLevel = 0; /* =========================================================================== @@ -143,6 +146,26 @@ void QuartzInitOutput( int argc, char **argv ) { + /* For XQuartz, we want to just use the default signal handler to work better with CrashTracer */ + signal(SIGSEGV, SIG_DFL); + signal(SIGILL, SIG_DFL); +#ifdef SIGEMT + signal(SIGEMT, SIG_DFL); +#endif + signal(SIGFPE, SIG_DFL); +#ifdef SIGBUS + signal(SIGBUS, SIG_DFL); +#endif +#ifdef SIGSYS + signal(SIGSYS, SIG_DFL); +#endif +#ifdef SIGXCPU + signal(SIGXCPU, SIG_DFL); +#endif +#ifdef SIGXFSZ + signal(SIGXFSZ, SIG_DFL); +#endif + if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler, QuartzWakeupHandler, NULL)) @@ -216,8 +239,6 @@ void QuartzUpdateScreens(void) { AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); - miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); - /* pointer events are clipped to old display region after display reconfiguration * http://xquartz.macosforge.org/trac/ticket/346 */ @@ -244,6 +265,46 @@ void QuartzUpdateScreens(void) { DeliverEvents(pRoot, &e, 1, NullWindow); quartzProcs->UpdateScreen(pScreen); + + /* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */ + miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); + + /* Tell RandR about the new size, so new connections get the correct info */ + RRScreenSizeNotify(pScreen); +} + +static void pokeActivityCallback(CFRunLoopTimerRef timer, void *info) { + UpdateSystemActivity(OverallAct); +} + +static void QuartzScreenSaver(int state) { + static CFRunLoopTimerRef pokeActivityTimer = NULL; + static CFRunLoopTimerContext pokeActivityContext = { 0, NULL, NULL, NULL, NULL }; + static OSSpinLock pokeActivitySpinLock = OS_SPINLOCK_INIT; + + OSSpinLockLock(&pokeActivitySpinLock); + + if(state) { + if(pokeActivityTimer == NULL) + goto QuartzScreenSaverEnd; + + CFRunLoopTimerInvalidate(pokeActivityTimer); + CFRelease(pokeActivityTimer); + pokeActivityTimer = NULL; + } else { + if(pokeActivityTimer != NULL) + goto QuartzScreenSaverEnd; + + pokeActivityTimer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent(), 30, 0, 0, pokeActivityCallback, &pokeActivityContext); + if(pokeActivityTimer == NULL) { + ErrorF("Unable to create pokeActivityTimer.\n"); + goto QuartzScreenSaverEnd; + } + + CFRunLoopAddTimer(CFRunLoopGetMain(), pokeActivityTimer, kCFRunLoopCommonModes); + } +QuartzScreenSaverEnd: + OSSpinLockUnlock(&pokeActivitySpinLock); } void QuartzShowFullscreen(int state) { @@ -256,6 +317,8 @@ void QuartzShowFullscreen(int state) { return; } + QuartzScreenSaver(!state); + if(XQuartzFullscreenVisible == state) return; @@ -380,7 +443,7 @@ void QuartzSetRootClip( for (i = 0; i < screenInfo.numScreens; i++) { if (screenInfo.screens[i]) { - xf86SetRootClip(screenInfo.screens[i], enable); + SetRootClip(screenInfo.screens[i], enable); } } } @@ -402,10 +465,24 @@ void QuartzSpaceChanged(uint32_t space_id) { void QuartzCopyDisplayIDs(ScreenPtr pScreen, int displayCount, CGDirectDisplayID *displayIDs) { QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); - int size = displayCount * sizeof(CGDirectDisplayID); free(pQuartzScreen->displayIDs); - pQuartzScreen->displayIDs = malloc(size); - memcpy(pQuartzScreen->displayIDs, displayIDs, size); + if(displayCount) { + size_t size = displayCount * sizeof(CGDirectDisplayID); + pQuartzScreen->displayIDs = malloc(size); + memcpy(pQuartzScreen->displayIDs, displayIDs, size); + } else { + pQuartzScreen->displayIDs = NULL; + } pQuartzScreen->displayCount = displayCount; } + +void NSBeep(void); +void DDXRingBell( + int volume, // volume is % of max + int pitch, // pitch is Hz + int duration) // duration is milliseconds +{ + if (volume) + NSBeep(); +} diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h index 7efb7e09b..0a9c47a6b 100644 --- a/hw/xquartz/quartz.h +++ b/hw/xquartz/quartz.h @@ -70,7 +70,7 @@ typedef void (*UpdateScreenProc)(ScreenPtr pScreen); /* * Rootless helper functions */ -typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber); +typedef Bool (*IsX11WindowProc)(int windowNumber); typedef void (*HideWindowsProc)(Bool hide); /* @@ -123,7 +123,8 @@ extern Bool XQuartzIsRootless; /* Is our current mode rootless (or FS)? */ extern Bool XQuartzFullscreenMenu; /* Show the menu bar (autohide) while in FS */ extern Bool XQuartzFullscreenDisableHotkeys; extern Bool XQuartzOptionSendsAlt; /* Alt or Mode_switch? */ -extern Bool XQuartzUseSysBeep; /* Sys beep or our own? */ + +extern int32_t XQuartzShieldingWindowLevel; /* CGShieldingWindowLevel() or 0 */ Bool QuartzAddScreen(int index, ScreenPtr pScreen); Bool QuartzSetupScreen(int index, ScreenPtr pScreen); diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c deleted file mode 100644 index d0f7c53e5..000000000 --- a/hw/xquartz/quartzAudio.c +++ /dev/null @@ -1,329 +0,0 @@ -// -// QuartzAudio.m -// -// X Window bell support using CoreAudio or AppKit. -// Greg Parker gparker@cs.stanford.edu 19 Feb 2001 -// -// Info about sine wave sound playback: -// CoreAudio code derived from macosx-dev posting by Tim Wood -// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html -// Smoothing transitions between sounds -// http://www.wam.umd.edu/~mphoenix/dss/dss.html -// -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#include "sanitizedCarbon.h" - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartz.h" -#include "quartzAudio.h" - -#include -#include -#include - -#include "inputstr.h" -#include -#include - -void NSBeep(void); - -typedef struct QuartzAudioRec { - double frequency; - double amplitude; - - UInt32 curFrame; - UInt32 remainingFrames; - UInt32 totalFrames; - double sampleRate; - UInt32 fadeLength; - - UInt32 bufferByteCount; - Boolean playing; - pthread_mutex_t lock; - - // used to fade out interrupted sound and avoid 'pop' - double prevFrequency; - double prevAmplitude; - UInt32 prevFrame; -} QuartzAudioRec; - -static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown; -static QuartzAudioRec data; - - -/* - * QuartzAudioEnvelope - * Fade sound in and out to avoid pop. - * Sounds with shorter duration will never reach full amplitude. Deal. - */ -static double QuartzAudioEnvelope( - UInt32 curFrame, - UInt32 totalFrames, - UInt32 fadeLength ) -{ - double fadeFrames = min(fadeLength, totalFrames / 2); - if (fadeFrames < 1) return 0; - - if (curFrame < fadeFrames) { - return curFrame / fadeFrames; - } else if (curFrame > totalFrames - fadeFrames) { - return (totalFrames-curFrame) / fadeFrames; - } else { - return 1.0; - } -} - - -/* - * QuartzFillBuffer - * Fill this buffer with data and update the data position. - * FIXME: this is ugly - */ -static void QuartzFillBuffer( - AudioBuffer *audiobuffer, - QuartzAudioRec *data ) -{ - float *buffer, *b; - unsigned int frame, frameCount; - unsigned int bufferFrameCount; - float multiplier, v; - int i; - - buffer = (float *)audiobuffer->mData; - bufferFrameCount = audiobuffer->mDataByteSize / (sizeof(float) * audiobuffer->mNumberChannels); - - frameCount = min(bufferFrameCount, data->remainingFrames); - - // Fade out previous sine wave, if any. - b = buffer; - if (data->prevFrame) { - multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate); - for (frame = 0; frame < data->fadeLength; frame++) { - v = data->prevAmplitude * - QuartzAudioEnvelope(frame+data->fadeLength, - 2*data->fadeLength, - data->fadeLength) * - sin(multiplier * (data->prevFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - // no more prev fade - data->prevFrame = 0; - - // adjust for space eaten by prev fade - b += audiobuffer->mNumberChannels*frame; - bufferFrameCount -= frame; - frameCount = min(bufferFrameCount, data->remainingFrames); - } - - // Write a sine wave with the specified frequency and amplitude - multiplier = 2*M_PI*(data->frequency/data->sampleRate); - for (frame = 0; frame < frameCount; frame++) { - v = data->amplitude * - QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames, - data->fadeLength) * - sin(multiplier * (data->curFrame+frame)); - for (i = 0; i < audiobuffer->mNumberChannels; i++) { - *b++ = v; - } - } - - // Zero out the rest of the buffer, if any - memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels * - (bufferFrameCount-frame)); - - data->curFrame += frameCount; - data->remainingFrames -= frameCount; - if (data->remainingFrames == 0) { - data->playing = FALSE; - data->curFrame = 0; - } -} - - -/* - * QuartzAudioIOProc - * Callback function for audio playback. - * FIXME: use inOutputTime to correct for skipping - */ -static OSStatus -QuartzAudioIOProc( - AudioDeviceID inDevice, - const AudioTimeStamp *inNow, - const AudioBufferList *inInputData, - const AudioTimeStamp *inInputTime, - AudioBufferList *outOutputData, - const AudioTimeStamp *inOutputTime, - void *inClientData ) -{ - QuartzAudioRec *data = (QuartzAudioRec *)inClientData; - int i; - Boolean wasPlaying; - - pthread_mutex_lock(&data->lock); - wasPlaying = data->playing; - for (i = 0; i < outOutputData->mNumberBuffers; i++) { - if (data->playing) { - QuartzFillBuffer(outOutputData->mBuffers+i, data); - } - else { - memset(outOutputData->mBuffers[i].mData, 0, - outOutputData->mBuffers[i].mDataByteSize); - } - } - if (wasPlaying && !data->playing) { - OSStatus err; - err = AudioDeviceStop(inDevice, QuartzAudioIOProc); - if(err != noErr) - fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err); - } - pthread_mutex_unlock(&data->lock); - return 0; -} - - -/* - * DDXRingBell - * Play a tone using the CoreAudio API - */ -void DDXRingBell( - int volume, // volume is % of max - int pitch, // pitch is Hz - int duration ) // duration is milliseconds -{ - if (XQuartzUseSysBeep) { - if (volume) - NSBeep(); - return; - } - - if (quartzAudioDevice == kAudioDeviceUnknown) return; - - pthread_mutex_lock(&data.lock); - - // fade previous sound, if any - data.prevFrequency = data.frequency; - data.prevAmplitude = data.amplitude; - data.prevFrame = data.curFrame; - - // set new sound - data.frequency = pitch; - data.amplitude = volume / 100.0; - data.curFrame = 0; - data.totalFrames = (int)(data.sampleRate * duration / 1000.0); - data.remainingFrames = data.totalFrames; - - if (! data.playing) { - OSStatus status; - status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc); - if (status) { - ErrorF("DDXRingBell: AudioDeviceStart returned %ld\n", (long)status); - } else { - data.playing = TRUE; - } - } - pthread_mutex_unlock(&data.lock); -} - -/* - * QuartzAudioInit - * Prepare to play the bell with the CoreAudio API - */ -void QuartzAudioInit(void) -{ - UInt32 propertySize; - OSStatus status; - AudioDeviceID outputDevice; - double sampleRate; - AudioObjectPropertyAddress devicePropertyAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; - AudioObjectPropertyAddress sampleRatePropertyAddress = { kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; - - // Get the default output device - propertySize = sizeof(outputDevice); - status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &devicePropertyAddress, - 0, NULL, - &propertySize, &outputDevice); - if (status) { - ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(output device) returned %ld\n", - (long)status); - return; - } - if (outputDevice == kAudioDeviceUnknown) { - ErrorF("QuartzAudioInit: No audio output devices available.\n"); - return; - } - - // Get the basic device description - sampleRate = 0.; - propertySize = sizeof(sampleRate); - status = AudioObjectGetPropertyData(outputDevice, &sampleRatePropertyAddress, - 0, NULL, - &propertySize, &sampleRate); - if (status) { - ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(sample rate) returned %ld\n", - (long)status); - return; - } - - // Fill in the playback data - data.frequency = 0; - data.amplitude = 0; - data.curFrame = 0; - data.remainingFrames = 0; - data.sampleRate = sampleRate; - // data.bufferByteCount = bufferByteCount; - data.playing = FALSE; - data.prevAmplitude = 0; - data.prevFrame = 0; - data.prevFrequency = 0; - data.fadeLength = data.sampleRate / 200; - pthread_mutex_init(&data.lock, NULL); // fixme error check - - // fixme assert fadeLength= 1050 - { - AudioDeviceIOProcID sInputIOProcID = NULL; - status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID ); - } -#else - status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data); -#endif - if (status) { - ErrorF("QuartzAudioInit: AddIOProc returned %ld\n", (long)status); - return; - } - - // success! - quartzAudioDevice = outputDevice; -} diff --git a/hw/xquartz/quartzAudio.h b/hw/xquartz/quartzAudio.h deleted file mode 100644 index 2a78b3957..000000000 --- a/hw/xquartz/quartzAudio.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// QuartzAudio.h -// -// X Window bell support using CoreAudio or AppKit. -// Greg Parker gparker@cs.stanford.edu 19 Feb 2001 -/* - * Copyright (c) 2001 Greg Parker. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef _QUARTZAUDIO_H -#define _QUARTZAUDIO_H - -void QuartzAudioInit(void); - -#endif diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index f54c686d1..e682f08b6 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -53,19 +53,10 @@ #include "darwinEvents.h" #include "quartzKeyboard.h" -#include "quartzAudio.h" #include "X11Application.h" -#include "threadSafety.h" - -#ifdef NDEBUG -#undef NDEBUG -#include -#define NDEBUG 1 -#else #include -#endif #include #include "xkbsrv.h" @@ -370,9 +361,9 @@ static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, int initialKeyRepeatValue if (pDev->kbdfeed) memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize); - //fprintf(stderr, "per_key_repeat =\n"); + //ErrorF("per_key_repeat =\n"); //for(i=0; i < XkbPerKeyBitArraySize; i++) - // fprintf(stderr, "%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n"); + // ErrorF("%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n"); /* And now we notify the puppies about the changes */ XkbDDXChangeControls(pDev, &old, ctrl); @@ -687,6 +678,11 @@ static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { } #endif +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // KLGetCurrentKeyboardLayout, KLGetKeyboardLayoutProperty +#endif + #if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 if (chr_data == NULL) { #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 @@ -720,6 +716,10 @@ static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { } #endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); @@ -776,10 +776,16 @@ static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { } #if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 } else { // kchr - UInt32 c, state = 0, state2 = 0; + UInt32 c, state = 0, state2 = 0; UInt16 code; code = i | mods[j]; + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // KeyTranslate +#endif + c = KeyTranslate (chr_data, code, &state); /* Dead keys are only processed on key-down, so ask @@ -790,6 +796,10 @@ static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { if (state != 0) c = KeyTranslate (chr_data, code | 128, &state2); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + /* Characters seem to be in MacRoman encoding. */ if (c != 0 && c != 0x0010) { diff --git a/hw/xquartz/quartzKeyboard.h b/hw/xquartz/quartzKeyboard.h index 1151a0035..de4aed868 100644 --- a/hw/xquartz/quartzKeyboard.h +++ b/hw/xquartz/quartzKeyboard.h @@ -32,8 +32,6 @@ #include "X11/keysym.h" #include "inputstr.h" -#include - // Each key can generate 4 glyphs. They are, in order: // unshifted, shifted, modeswitch unshifted, modeswitch shifted #define GLYPHS_PER_KEY 4 diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c index 298ec0a52..98b382d65 100644 --- a/hw/xquartz/quartzRandR.c +++ b/hw/xquartz/quartzRandR.c @@ -3,7 +3,7 @@ * * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons, * 2010 Jan Hauffa. - * 2010 Apple Inc. + * 2010-2011 Apple Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -40,6 +40,8 @@ #include "quartz.h" #include "darwin.h" +#include "X11Application.h" + #include #include @@ -122,44 +124,48 @@ static Bool QuartzRandRSetCGMode (CGDirectDisplayID screenId, static Bool QuartzRandREnumerateModes (ScreenPtr pScreen, QuartzModeCallback callback, void *data) { - CFDictionaryRef curModeRef, modeRef; - long curBpp; - CFArrayRef modes; - QuartzModeInfo modeInfo; - int i; - BOOL retval = FALSE; + Bool retval = FALSE; QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); - CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0]; - curModeRef = CGDisplayCurrentMode(screenId); - if (!curModeRef) - return FALSE; - curBpp = getDictLong(curModeRef, kCGDisplayBitsPerPixel); + /* Just an 800x600 fallback if we have no attached heads */ + if(pQuartzScreen->displayIDs) { + CFDictionaryRef curModeRef, modeRef; + long curBpp; + CFArrayRef modes; + QuartzModeInfo modeInfo; + int i; + CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0]; + + curModeRef = CGDisplayCurrentMode(screenId); + if (!curModeRef) + return FALSE; + curBpp = getDictLong(curModeRef, kCGDisplayBitsPerPixel); - modes = CGDisplayAvailableModes(screenId); - if (!modes) - return FALSE; - for (i = 0; i < CFArrayGetCount(modes); i++) { - int cb; - modeRef = (CFDictionaryRef) CFArrayGetValueAtIndex(modes, i); - - /* Skip modes that are not usable on the current display or have a - different pixel encoding than the current mode. */ - if (((unsigned long) getDictLong(modeRef, kCGDisplayIOFlags) & - kDisplayModeUsableFlags) != kDisplayModeUsableFlags) - continue; - if (getDictLong(modeRef, kCGDisplayBitsPerPixel) != curBpp) - continue; - - QuartzRandRGetModeInfo(modeRef, &modeInfo); - modeInfo.ref = (void *)modeRef; - cb = callback(pScreen, &modeInfo, data); - if (cb == CALLBACK_CONTINUE) - retval = TRUE; - else if (cb == CALLBACK_SUCCESS) - return TRUE; - else if (cb == CALLBACK_ERROR) + modes = CGDisplayAvailableModes(screenId); + if (!modes) return FALSE; + for (i = 0; i < CFArrayGetCount(modes); i++) { + int cb; + modeRef = (CFDictionaryRef) CFArrayGetValueAtIndex(modes, i); + + /* Skip modes that are not usable on the current display or have a + different pixel encoding than the current mode. */ + if (((unsigned long) getDictLong(modeRef, kCGDisplayIOFlags) & + kDisplayModeUsableFlags) != kDisplayModeUsableFlags) + continue; + if (getDictLong(modeRef, kCGDisplayBitsPerPixel) != curBpp) + continue; + + QuartzRandRGetModeInfo(modeRef, &modeInfo); + modeInfo.ref = (void *)modeRef; + cb = callback(pScreen, &modeInfo, data); + if (cb == CALLBACK_CONTINUE) + retval = TRUE; + else if (cb == CALLBACK_SUCCESS) + return TRUE; + else if (cb == CALLBACK_ERROR) + return FALSE; + } } switch(callback(pScreen, &pQuartzScreen->rootlessMode, data)) { @@ -223,61 +229,64 @@ static Bool QuartzRandRSetCGMode (CGDirectDisplayID screenId, static Bool QuartzRandREnumerateModes (ScreenPtr pScreen, QuartzModeCallback callback, void *data) { - CGDisplayModeRef curModeRef, modeRef; - CFStringRef curPixelEnc, pixelEnc; - CFComparisonResult pixelEncEqual; - CFArrayRef modes; - QuartzModeInfo modeInfo; - int i; Bool retval = FALSE; - QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); - CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0]; - curModeRef = CGDisplayCopyDisplayMode(screenId); - if (!curModeRef) - return FALSE; - curPixelEnc = CGDisplayModeCopyPixelEncoding(curModeRef); - CGDisplayModeRelease(curModeRef); + /* Just an 800x600 fallback if we have no attached heads */ + if(pQuartzScreen->displayIDs) { + CGDisplayModeRef curModeRef, modeRef; + CFStringRef curPixelEnc, pixelEnc; + CFComparisonResult pixelEncEqual; + CFArrayRef modes; + QuartzModeInfo modeInfo; + int i; + CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0]; + + curModeRef = CGDisplayCopyDisplayMode(screenId); + if (!curModeRef) + return FALSE; + curPixelEnc = CGDisplayModeCopyPixelEncoding(curModeRef); + CGDisplayModeRelease(curModeRef); - modes = CGDisplayCopyAllDisplayModes(screenId, NULL); - if (!modes) { - CFRelease(curPixelEnc); - return FALSE; - } - for (i = 0; i < CFArrayGetCount(modes); i++) { - int cb; - modeRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); - - /* Skip modes that are not usable on the current display or have a - different pixel encoding than the current mode. */ - if ((CGDisplayModeGetIOFlags(modeRef) & kDisplayModeUsableFlags) != - kDisplayModeUsableFlags) - continue; - pixelEnc = CGDisplayModeCopyPixelEncoding(modeRef); - pixelEncEqual = CFStringCompare(pixelEnc, curPixelEnc, 0); - CFRelease(pixelEnc); - if (pixelEncEqual != kCFCompareEqualTo) - continue; - - QuartzRandRGetModeInfo(modeRef, &modeInfo); - modeInfo.ref = modeRef; - cb = callback(pScreen, &modeInfo, data); - if (cb == CALLBACK_CONTINUE) { - retval = TRUE; - } else if (cb == CALLBACK_SUCCESS) { - CFRelease(modes); - CFRelease(curPixelEnc); - return TRUE; - } else if (cb == CALLBACK_ERROR) { - CFRelease(modes); + modes = CGDisplayCopyAllDisplayModes(screenId, NULL); + if (!modes) { CFRelease(curPixelEnc); return FALSE; } - } + for (i = 0; i < CFArrayGetCount(modes); i++) { + int cb; + modeRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); + + /* Skip modes that are not usable on the current display or have a + different pixel encoding than the current mode. */ + if ((CGDisplayModeGetIOFlags(modeRef) & kDisplayModeUsableFlags) != + kDisplayModeUsableFlags) + continue; + pixelEnc = CGDisplayModeCopyPixelEncoding(modeRef); + pixelEncEqual = CFStringCompare(pixelEnc, curPixelEnc, 0); + CFRelease(pixelEnc); + if (pixelEncEqual != kCFCompareEqualTo) + continue; + + QuartzRandRGetModeInfo(modeRef, &modeInfo); + modeInfo.ref = modeRef; + cb = callback(pScreen, &modeInfo, data); + if (cb == CALLBACK_CONTINUE) { + retval = TRUE; + } else if (cb == CALLBACK_SUCCESS) { + CFRelease(modes); + CFRelease(curPixelEnc); + return TRUE; + } else if (cb == CALLBACK_ERROR) { + CFRelease(modes); + CFRelease(curPixelEnc); + return FALSE; + } + } - CFRelease(modes); - CFRelease(curPixelEnc); + CFRelease(modes); + CFRelease(curPixelEnc); + } switch(callback(pScreen, &pQuartzScreen->rootlessMode, data)) { case CALLBACK_SUCCESS: @@ -345,7 +354,21 @@ static int QuartzRandRRegisterModeCallback (ScreenPtr pScreen, static Bool QuartzRandRSetMode(ScreenPtr pScreen, QuartzModeInfoPtr pMode, BOOL doRegister) { QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); - CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0]; + Bool captureDisplay = (pMode->refresh != FAKE_REFRESH_FULLSCREEN && pMode->refresh != FAKE_REFRESH_ROOTLESS); + CGDirectDisplayID screenId; + + if(pQuartzScreen->displayIDs == NULL) + return FALSE; + + screenId = pQuartzScreen->displayIDs[0]; + if(XQuartzShieldingWindowLevel == 0 && captureDisplay) { + if(!X11ApplicationCanEnterRandR()) + return FALSE; + CGCaptureAllDisplays(); + XQuartzShieldingWindowLevel = CGShieldingWindowLevel(); // 2147483630 + DEBUG_LOG("Display captured. ShieldWindowID: %u, Shield level: %d\n", + CGShieldingWindowID(screenId), XQuartzShieldingWindowLevel); + } if (pQuartzScreen->currentMode.ref && CFEqual(pMode->ref, pQuartzScreen->currentMode.ref)) { DEBUG_LOG("Requested RandR resolution matches current CG mode\n"); @@ -367,8 +390,14 @@ static Bool QuartzRandRSetMode(ScreenPtr pScreen, QuartzModeInfoPtr pMode, BOOL if(pQuartzScreen->currentMode.ref) CFRelease(pQuartzScreen->currentMode.ref); pQuartzScreen->currentMode = *pMode; - CFRetain(pQuartzScreen->currentMode.ref); + if(pQuartzScreen->currentMode.ref) + CFRetain(pQuartzScreen->currentMode.ref); + if(XQuartzShieldingWindowLevel != 0 && !captureDisplay) { + CGReleaseAllDisplays(); + XQuartzShieldingWindowLevel = 0; + } + return TRUE; } @@ -389,23 +418,8 @@ static int QuartzRandRSetModeCallback (ScreenPtr pScreen, } static Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) { - QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); - *rotations = RR_Rotate_0; /* TODO: support rotation */ - if (pQuartzScreen->displayCount == 0) - return FALSE; - - if (pQuartzScreen->displayCount > 1) { - /* RandR operations are not well-defined for an X11 screen spanning - multiple CG displays. Create two entries for the current virtual - resolution including/excluding the menu bar. */ - - QuartzRandRRegisterMode(pScreen, &pQuartzScreen->rootlessMode); - QuartzRandRRegisterMode(pScreen, &pQuartzScreen->fullscreenMode); - return TRUE; - } - return QuartzRandREnumerateModes(pScreen, QuartzRandRRegisterModeCallback, NULL); } @@ -420,9 +434,6 @@ static Bool QuartzRandRSetConfig (ScreenPtr pScreen, reqMode.height = pSize->height; reqMode.refresh = rate; - if (pQuartzScreen->displayCount == 0) - return FALSE; - /* Do not switch modes if requested mode is equal to current mode. */ if (QuartzRandRModesEqual(&reqMode, &pQuartzScreen->currentMode)) return TRUE; @@ -437,28 +448,36 @@ static Bool QuartzRandRSetConfig (ScreenPtr pScreen, static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) { QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); + QuartzModeInfo activeMode; - if (pQuartzScreen->displayCount == 1) { - if(pQuartzScreen->fullscreenMode.ref) - CFRelease(pQuartzScreen->fullscreenMode.ref); - if(pQuartzScreen->currentMode.ref) - CFRelease(pQuartzScreen->currentMode.ref); - - if (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0], - &pQuartzScreen->fullscreenMode)) + if(pQuartzScreen->displayCount > 0) { + if(!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0], &activeMode)) { + ErrorF("Unable to determine current display mode.\n"); return FALSE; - - CFRetain(pQuartzScreen->fullscreenMode.ref); /* This extra retain is for currentMode's copy */ + } } else { - pQuartzScreen->fullscreenMode.width = pScreen->width; - pQuartzScreen->fullscreenMode.height = pScreen->height; + memset(&activeMode, 0, sizeof(activeMode)); + activeMode.width = 800; + activeMode.height = 600; + activeMode.refresh = 60; + } + + if(pQuartzScreen->fullscreenMode.ref) + CFRelease(pQuartzScreen->fullscreenMode.ref); + if(pQuartzScreen->currentMode.ref) + CFRelease(pQuartzScreen->currentMode.ref); + + if(pQuartzScreen->displayCount > 1) { + activeMode.width = pScreen->width; + activeMode.height = pScreen->height; if(XQuartzIsRootless) - pQuartzScreen->fullscreenMode.height += aquaMenuBarHeight; + activeMode.height += aquaMenuBarHeight; } + pQuartzScreen->fullscreenMode = activeMode; pQuartzScreen->fullscreenMode.refresh = FAKE_REFRESH_FULLSCREEN; - pQuartzScreen->rootlessMode = pQuartzScreen->fullscreenMode; + pQuartzScreen->rootlessMode = activeMode; pQuartzScreen->rootlessMode.refresh = FAKE_REFRESH_ROOTLESS; pQuartzScreen->rootlessMode.height -= aquaMenuBarHeight; @@ -467,6 +486,12 @@ static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) { } else { pQuartzScreen->currentMode = pQuartzScreen->fullscreenMode; } + + /* This extra retain is for currentMode's copy. + * fullscreen and rootless share a retain. + */ + if(pQuartzScreen->currentMode.ref) + CFRetain(pQuartzScreen->currentMode.ref); DEBUG_LOG("rootlessMode: %d x %d\n", (int)pQuartzScreen->rootlessMode.width, (int)pQuartzScreen->rootlessMode.height); DEBUG_LOG("fullscreenMode: %d x %d\n", (int)pQuartzScreen->fullscreenMode.width, (int)pQuartzScreen->fullscreenMode.height); diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c index ba92ecef6..25ef76efa 100644 --- a/hw/xquartz/quartzStartup.c +++ b/hw/xquartz/quartzStartup.c @@ -40,7 +40,6 @@ #include "X11Controller.h" #include "darwin.h" #include "darwinEvents.h" -#include "quartzAudio.h" #include "quartz.h" #include "opaque.h" #include "micmap.h" @@ -57,6 +56,7 @@ struct arg { char **envp; }; +_X_NORETURN static void server_thread (void *arg) { struct arg args = *((struct arg *)arg); free(arg); @@ -85,10 +85,7 @@ void QuartzInitServer(int argc, char **argv, char **envp) { args->argv = argv; args->envp = envp; - APPKIT_THREAD_ID = pthread_self(); - SERVER_THREAD_ID = create_thread(server_thread, args); - - if (!SERVER_THREAD_ID) { + if (!create_thread(server_thread, args)) { FatalError("can't create secondary thread\n"); } } @@ -117,9 +114,6 @@ int server_main(int argc, char **argv, char **envp) { } } - /* Create the audio mutex */ - QuartzAudioInit(); - X11ControllerMain(argc, argv, envp); exit(0); } diff --git a/hw/xquartz/sanitizedCocoa.h b/hw/xquartz/sanitizedCocoa.h index 58de64c1c..5a2a282d1 100644 --- a/hw/xquartz/sanitizedCocoa.h +++ b/hw/xquartz/sanitizedCocoa.h @@ -16,7 +16,8 @@ #define BOOL OSX_BOOL #define EventType HIT_EventType -#include +#import +#import #undef Cursor #undef WindowPtr @@ -24,4 +25,40 @@ #undef BOOL #undef EventType +#ifndef __has_feature +#define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + +#ifndef NS_RETURNS_RETAINED +#if __has_feature(attribute_ns_returns_retained) +#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) +#else +#define NS_RETURNS_RETAINED +#endif +#endif + +#ifndef NS_RETURNS_NOT_RETAINED +#if __has_feature(attribute_ns_returns_not_retained) +#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) +#else +#define NS_RETURNS_NOT_RETAINED +#endif +#endif + +#ifndef CF_RETURNS_RETAINED +#if __has_feature(attribute_cf_returns_retained) +#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) +#else +#define CF_RETURNS_RETAINED +#endif +#endif + +#ifndef CF_RETURNS_NOT_RETAINED +#if __has_feature(attribute_cf_returns_not_retained) +#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) +#else +#define CF_RETURNS_NOT_RETAINED +#endif +#endif + #endif /* _XQ_SANITIZED_COCOA_H_ */ diff --git a/hw/xquartz/threadSafety.c b/hw/xquartz/threadSafety.c deleted file mode 100644 index 85f85bd0a..000000000 --- a/hw/xquartz/threadSafety.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2008 Apple, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "threadSafety.h" -#include "os.h" - -pthread_t APPKIT_THREAD_ID; -pthread_t SERVER_THREAD_ID; - -#include - -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -#include - -void spewCallStack(void) { - void* callstack[128]; - int i, frames = backtrace(callstack, 128); - char** strs = backtrace_symbols(callstack, frames); - - for (i = 0; i < frames; ++i) { - ErrorF("%s\n", strs[i]); - } - - free(strs); -} -#else -void spewCallStack(void) { - return; -} -#endif - -void _threadSafetyAssert(pthread_t tid, const char *file, const char *fun, int line) { - if(pthread_equal(pthread_self(), tid)) - return; - - /* NOOOO! */ - ErrorF("Thread Assertion Failed: self=%s, expected=%s\n%s:%s:%d\n", - threadSafetyID(pthread_self()), threadSafetyID(tid), - file, fun, line); - spewCallStack(); -} - -const char *threadSafetyID(pthread_t tid) { - if(pthread_equal(tid, APPKIT_THREAD_ID)) { - return "Appkit Thread"; - } else if(pthread_equal(tid, SERVER_THREAD_ID)) { - return "Xserver Thread"; - } else { - return "Unknown Thread"; - } -} diff --git a/hw/xquartz/threadSafety.h b/hw/xquartz/threadSafety.h deleted file mode 100644 index 7b009103a..000000000 --- a/hw/xquartz/threadSafety.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2008 Apple, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#ifndef _XQ_THREAD_SAFETY_H_ -#define _XQ_THREAD_SAFETY_H_ - -#define DEBUG_THREADS 1 - -#include - -extern pthread_t APPKIT_THREAD_ID; -extern pthread_t SERVER_THREAD_ID; - -/* Dump the call stack */ -void spewCallStack(void); - -/* Print message to ErrorF if we're in the wrong thread */ -void _threadSafetyAssert(pthread_t tid, const char *file, const char *fun, int line); - -/* Get a string that identifies our thread nicely */ -const char *threadSafetyID(pthread_t tid); - -#define threadSafetyAssert(tid) _threadSafetyAssert(tid, __FILE__, __FUNCTION__, __LINE__) - -#ifdef DEBUG_THREADS -#define TA_APPKIT() threadSafetyAssert(APPKIT_THREAD_ID) -#define TA_SERVER() threadSafetyAssert(SERVER_THREAD_ID) -#else -#define TA_SERVER() -#define TA_APPKIT() -#endif - -#endif _XQ_THREAD_SAFETY_H_ diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c index 0d2c51a2a..8fef3b793 100644 --- a/hw/xquartz/xpr/dri.c +++ b/hw/xquartz/xpr/dri.c @@ -89,14 +89,6 @@ static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */ static Bool DRIFreePixmapImp(DrawablePtr pDrawable); -/* FIXME: don't hardcode this? */ -#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist" - -/* Corresponds to SU Jaguar Green */ -#define CG_REQUIRED_MAJOR 1 -#define CG_REQUIRED_MINOR 157 -#define CG_REQUIRED_MICRO 11 - typedef struct { DrawablePtr pDrawable; int refCount; @@ -109,96 +101,6 @@ typedef struct { void *buffer; } DRIPixmapBuffer, *DRIPixmapBufferPtr; -/* Returns version as major.minor.micro in 10.10.10 fixed form */ -static unsigned int -get_cg_version (void) -{ - static unsigned int version; - - FILE *fh; - char *ptr; - - if (version != 0) - return version; - - /* I tried CFBundleGetVersion, but it returns zero, so.. */ - - fh = fopen (CG_INFO_FILE, "r"); - if (fh != NULL) - { - char buf[256]; - - while (fgets (buf, sizeof (buf), fh) != NULL) - { - unsigned char c; - - if (!strstr (buf, "CFBundleShortVersionString") - || fgets (buf, sizeof (buf), fh) == NULL) - { - continue; - } - - ptr = strstr (buf, ""); - if (ptr == NULL) - continue; - - ptr += strlen (""); - - /* Now PTR points to "MAJOR.MINOR.MICRO". */ - - version = 0; - - again: - switch ((c = *ptr++)) - { - case '.': - version = version * 1024; - goto again; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - version = ((version & ~0x3ff) - + (version & 0x3ff) * 10 + (c - '0')); - goto again; - } - break; - } - - fclose (fh); - } - - return version; -} - -static Bool -test_cg_version (unsigned int major, unsigned int minor, unsigned int micro) -{ - unsigned int cg_ver = get_cg_version (); - - unsigned int cg_major = (cg_ver >> 20) & 0x3ff; - unsigned int cg_minor = (cg_ver >> 10) & 0x3ff; - unsigned int cg_micro = cg_ver & 0x3ff; - - if (cg_major > major) - return TRUE; - else if (cg_major < major) - return FALSE; - - /* cg_major == major */ - - if (cg_minor > minor) - return TRUE; - else if (cg_minor < minor) - return FALSE; - - /* cg_minor == minor */ - - if (cg_micro < micro) - return FALSE; - - return TRUE; -} - Bool DRIScreenInit(ScreenPtr pScreen) { @@ -224,20 +126,6 @@ DRIScreenInit(ScreenPtr pScreen) pDRIPriv->directRenderingSupport = TRUE; pDRIPriv->nrWindows = 0; - /* Need recent cg for window access update */ - if (!test_cg_version (CG_REQUIRED_MAJOR, - CG_REQUIRED_MINOR, - CG_REQUIRED_MICRO)) - { - ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n", - CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO); - - pDRIPriv->directRenderingSupport = FALSE; - - /* Note we don't nuke the dri private, since we need it for - managing indirect surfaces. */ - } - /* Initialize drawable tables */ for (i = 0; i < DRI_MAX_DRAWABLES; i++) { pDRIPriv->DRIDrawables[i] = NULL; @@ -674,7 +562,6 @@ DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) (*pScreen->WindowExposures)(pWin, prgn, bsreg); - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; pScreen->WindowExposures = DRIWindowExposures; } @@ -699,7 +586,6 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc); /* rewrap */ - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = DRICopyWindow; } @@ -717,7 +603,6 @@ DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind); /* rewrap */ - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; pScreen->ValidateTree = DRIValidateTree; return returnValue; @@ -744,7 +629,6 @@ DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind) (*pScreen->PostValidateTree)(pParent, pChild, kind); /* rewrap */ - pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree; pScreen->PostValidateTree = DRIPostValidateTree; } } @@ -765,7 +649,6 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy) (*pScreen->ClipNotify)(pWin, dx, dy); - pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = DRIClipNotify; } } diff --git a/hw/xquartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h index af1a90ca0..ebd89de3a 100644 --- a/hw/xquartz/xpr/xpr.h +++ b/hw/xquartz/xpr/xpr.h @@ -38,7 +38,7 @@ Bool QuartzModeBundleInit(void); void AppleDRIExtensionInit(void); void xprAppleWMInit(void); Bool xprInit(ScreenPtr pScreen); -Bool xprIsX11Window(void *nsWindow, int windowNumber); +Bool xprIsX11Window(int windowNumber); WindowPtr xprGetXWindow(xp_window_id wid); void xprHideWindows(Bool hide); diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c index 1a3d427b7..b6b9a5fc8 100644 --- a/hw/xquartz/xpr/xprAppleWM.c +++ b/hw/xquartz/xpr/xprAppleWM.c @@ -69,6 +69,8 @@ static int xprSetWindowLevel( if(XQuartzIsRootless) wc.window_level = normal_window_levels[level]; + else if(XQuartzShieldingWindowLevel) + wc.window_level = XQuartzShieldingWindowLevel + 1; else wc.window_level = rooted_window_levels[level]; @@ -112,8 +114,8 @@ static int xprAttachTransient(WindowPtr pWinChild, WindowPtr pWinParent) { static int xprFrameDraw( WindowPtr pWin, - int class, - unsigned int attr, + xp_frame_class class, + xp_frame_attr attr, const BoxRec *outer, const BoxRec *inner, unsigned int title_len, diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 342b54c53..cc86c473d 100644 --- a/hw/xquartz/xpr/xprEvent.c +++ b/hw/xquartz/xpr/xprEvent.c @@ -57,8 +57,6 @@ #include "xprEvent.h" Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) { - TA_SERVER(); - switch(e->subtype) { case kXquartzWindowState: DEBUG_LOG("kXquartzWindowState\n"); diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c index 8ee3a28a6..4818653f6 100644 --- a/hw/xquartz/xpr/xprFrame.c +++ b/hw/xquartz/xpr/xprFrame.c @@ -1,7 +1,7 @@ /* * Xplugin rootless implementation frame functions * - * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2002-2011 Apple Computer, Inc. All rights reserved. * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -35,7 +35,6 @@ #include "rootlessCommon.h" #include #include "x-hash.h" -#include "x-list.h" #include "applewmExt.h" #include "propertyst.h" @@ -44,9 +43,11 @@ #include "windowstr.h" #include "quartz.h" -#include "threadSafety.h" - +#ifdef HAVE_LIBDISPATCH +#include +#else #include +#endif #define DEFINE_ATOM_HELPER(func,atom_name) \ static Atom func (void) { \ @@ -63,7 +64,13 @@ DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID") /* Maps xp_window_id -> RootlessWindowRec */ static x_hash_table *window_hash; -static pthread_mutex_t window_hash_mutex; + +/* Need to guard window_hash since xprIsX11Window can be called from any thread. */ +#ifdef HAVE_LIBDISPATCH +static dispatch_queue_t window_hash_serial_q; +#else +static pthread_rwlock_t window_hash_rwlock; +#endif /* Prototypes for static functions */ static Bool xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, @@ -93,8 +100,6 @@ static inline xp_error xprConfigureWindow(xp_window_id id, unsigned int mask, const xp_window_changes *values) { - TA_SERVER(); - return xp_configure_window(id, mask, values); } @@ -106,8 +111,6 @@ xprSetNativeProperty(RootlessWindowPtr pFrame) unsigned int native_id; long data; - TA_SERVER(); - err = xp_get_native_window(x_cvt_vptr_to_uint(pFrame->wid), &native_id); if (err == Success) { @@ -137,8 +140,6 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, unsigned int mask = 0; xp_error err; - TA_SERVER(); - wc.x = newX; wc.y = newY; wc.width = pFrame->width; @@ -173,6 +174,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, if(XQuartzIsRootless) wc.window_level = normal_window_levels[pFrame->level]; + else if(XQuartzShieldingWindowLevel) + wc.window_level = XQuartzShieldingWindowLevel + 1; else wc.window_level = rooted_window_levels[pFrame->level]; mask |= XP_WINDOW_LEVEL; @@ -184,15 +187,15 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, return FALSE; } - if (window_hash == NULL) - { - window_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - pthread_mutex_init(&window_hash_mutex, NULL); - } - - pthread_mutex_lock(&window_hash_mutex); +#ifdef HAVE_LIBDISPATCH + dispatch_async(window_hash_serial_q, ^{ + x_hash_table_insert(window_hash, pFrame->wid, pFrame); + }); +#else + pthread_rwlock_wrlock(&window_hash_rwlock); x_hash_table_insert(window_hash, pFrame->wid, pFrame); - pthread_mutex_unlock(&window_hash_mutex); + pthread_rwlock_wrlock(&window_hash_rwlock); +#endif xprSetNativeProperty(pFrame); @@ -207,11 +210,16 @@ static void xprDestroyFrame(RootlessFrameID wid) { xp_error err; - TA_SERVER(); - - pthread_mutex_lock(&window_hash_mutex); + +#ifdef HAVE_LIBDISPATCH + dispatch_async(window_hash_serial_q, ^{ + x_hash_table_remove(window_hash, wid); + }); +#else + pthread_rwlock_wrlock(&window_hash_rwlock); x_hash_table_remove(window_hash, wid); - pthread_mutex_unlock(&window_hash_mutex); + pthread_rwlock_unlock(&window_hash_rwlock); +#endif err = xp_destroy_window(x_cvt_vptr_to_uint(wid)); if (err != Success) @@ -227,8 +235,6 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) { xp_window_changes wc; - TA_SERVER(); - wc.x = newX; wc.y = newY; // ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY); @@ -246,8 +252,6 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, { xp_window_changes wc; - TA_SERVER(); - wc.x = newX; wc.y = newY; wc.width = newW; @@ -267,9 +271,11 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) { xp_window_changes wc; unsigned int mask = XP_STACKING; +#ifdef HAVE_LIBDISPATCH + __block +#endif + RootlessWindowRec *winRec; - TA_SERVER(); - /* Stack frame below nextWid it if it exists, or raise frame above everything otherwise. */ @@ -281,16 +287,24 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) { wc.sibling = x_cvt_vptr_to_uint(nextWid); } - if(window_hash) { - RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, wid, NULL); - - if(winRec) { - if(XQuartzIsRootless) - wc.window_level = normal_window_levels[winRec->level]; - else - wc.window_level = rooted_window_levels[winRec->level]; - mask |= XP_WINDOW_LEVEL; - } +#ifdef HAVE_LIBDISPATCH + dispatch_sync(window_hash_serial_q, ^{ + winRec = x_hash_table_lookup(window_hash, wid, NULL); + }); +#else + pthread_rwlock_rdlock(&window_hash_rwlock); + winRec = x_hash_table_lookup(window_hash, wid, NULL); + pthread_rwlock_unlock(&window_hash_rwlock); +#endif + + if(winRec) { + if(XQuartzIsRootless) + wc.window_level = normal_window_levels[winRec->level]; + else if(XQuartzShieldingWindowLevel) + wc.window_level = XQuartzShieldingWindowLevel + 1; + else + wc.window_level = rooted_window_levels[winRec->level]; + mask |= XP_WINDOW_LEVEL; } xprConfigureWindow(x_cvt_vptr_to_uint(wid), mask, &wc); @@ -305,8 +319,6 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) { xp_window_changes wc; - TA_SERVER(); - if (pShape != NULL) { wc.shape_nrects = RegionNumRects(pShape); @@ -332,8 +344,6 @@ xprUnmapFrame(RootlessFrameID wid) { xp_window_changes wc; - TA_SERVER(); - wc.stack_mode = XP_UNMAPPED; wc.sibling = 0; @@ -352,8 +362,6 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) unsigned int rowbytes[2]; xp_error err; - TA_SERVER(); - err = xp_lock_window(x_cvt_vptr_to_uint(wid), NULL, NULL, data, rowbytes, NULL); if (err != Success) FatalError("Could not lock window %i for drawing.", (int)x_cvt_vptr_to_uint(wid)); @@ -370,8 +378,7 @@ static void xprStopDrawing(RootlessFrameID wid, Bool flush) { xp_error err; - TA_SERVER(); - + err = xp_unlock_window(x_cvt_vptr_to_uint(wid), flush); if(err != Success) FatalError("Could not unlock window %i after drawing.", (int)x_cvt_vptr_to_uint(wid)); @@ -384,8 +391,6 @@ xprStopDrawing(RootlessFrameID wid, Bool flush) static void xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) { - TA_SERVER(); - xp_flush_window(x_cvt_vptr_to_uint(wid)); } @@ -397,8 +402,6 @@ static void xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, int shift_x, int shift_y) { - TA_SERVER(); - xp_mark_window(x_cvt_vptr_to_uint(wid), nrects, rects, shift_x, shift_y); } @@ -412,8 +415,6 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) { DeleteProperty(serverClient, oldWin, xa_native_window_id()); - TA_SERVER(); - xprSetNativeProperty(pFrame); } @@ -425,8 +426,6 @@ static Bool xprDoReorderWindow(RootlessWindowPtr pFrame) { WindowPtr pWin = pFrame->win; - TA_SERVER(); - return AppleWMDoReorderWindow(pWin); } @@ -439,8 +438,6 @@ static void xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, int dx, int dy) { - TA_SERVER(); - xp_copy_window(x_cvt_vptr_to_uint(wid), x_cvt_vptr_to_uint(wid), dstNrects, dstRects, dx, dy); } @@ -475,11 +472,16 @@ xprInit(ScreenPtr pScreen) { RootlessInit(pScreen, &xprRootlessProcs); - TA_SERVER(); - rootless_CopyBytes_threshold = xp_copy_bytes_threshold; rootless_CopyWindow_threshold = xp_scroll_area_threshold; + assert((window_hash = x_hash_table_new(NULL, NULL, NULL, NULL))); +#ifdef HAVE_LIBDISPATCH + assert((window_hash_serial_q = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.xpr_window_hash", NULL))); +#else + assert(0 == pthread_rwlock_init(&window_hash_rwlock, NULL)); +#endif + return TRUE; } @@ -491,73 +493,36 @@ xprInit(ScreenPtr pScreen) WindowPtr xprGetXWindow(xp_window_id wid) { +#ifdef HAVE_LIBDISPATCH + RootlessWindowRec *winRec __block; + dispatch_sync(window_hash_serial_q, ^{ + winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL); + }); +#else RootlessWindowRec *winRec; - - if (window_hash == NULL) - return NULL; - - winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL); - - return winRec != NULL ? winRec->win : NULL; -} - -#ifdef UNUSED_CODE -/* - * Given the id of a physical window, try to find the top-level (or root) - * X window that it represents. - */ -WindowPtr -xprGetXWindowFromAppKit(int windowNumber) -{ - RootlessWindowRec *winRec; - Bool ret; - xp_window_id wid; - - if (window_hash == NULL) - return FALSE; - - /* need to lock, since this function can be called by any thread */ - - pthread_mutex_lock(&window_hash_mutex); - - if (xp_lookup_native_window(windowNumber, &wid)) - ret = xprGetXWindow(wid) != NULL; - else - ret = FALSE; - - pthread_mutex_unlock(&window_hash_mutex); - - if (!ret) return NULL; + pthread_rwlock_rdlock(&window_hash_rwlock); winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL); + pthread_rwlock_unlock(&window_hash_rwlock); +#endif return winRec != NULL ? winRec->win : NULL; } -#endif /* * The windowNumber is an AppKit window number. Returns TRUE if xpr is * displaying a window with that number. */ Bool -xprIsX11Window(void *nsWindow, int windowNumber) +xprIsX11Window(int windowNumber) { Bool ret; xp_window_id wid; - if (window_hash == NULL) - return FALSE; - - /* need to lock, since this function can be called by any thread */ - - pthread_mutex_lock(&window_hash_mutex); - if (xp_lookup_native_window(windowNumber, &wid)) ret = xprGetXWindow(wid) != NULL; else ret = FALSE; - pthread_mutex_unlock(&window_hash_mutex); - return ret; } @@ -574,8 +539,6 @@ xprHideWindows(Bool hide) int screen; WindowPtr pRoot, pWin; - TA_SERVER(); - for (screen = 0; screen < screenInfo.numScreens; screen++) { RootlessFrameID prevWid = NULL; pRoot = screenInfo.screens[screen]->root; diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index cba358f8b..98250e641 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -193,9 +193,17 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height, ScreenPtr pScr *width = 800; *height = 600; PseudoramiXAddScreen(*x, *y, *width, *height); + QuartzCopyDisplayIDs(pScreen, 0, NULL); return; } + /* If the displays are captured, we are in a RandR game mode + * on the primary display, so we only want to include the first + * display. The others are covered by the shield window. + */ + if (CGDisplayIsCaptured(kCGDirectMainDisplay)) + displayCount = 1; + displayList = malloc(displayCount * sizeof(CGDirectDisplayID)); if(!displayList) FatalError("Unable to allocate memory for list of displays.\n"); @@ -246,7 +254,7 @@ xprDisplayInit(void) { CGDisplayCount displayCount; - DEBUG_LOG(""); + TRACE(); CGGetActiveDisplayList(0, NULL, &displayCount); @@ -292,9 +300,36 @@ xprAddScreen(int index, ScreenPtr pScreen) DEBUG_LOG("index=%d depth=%d\n", index, depth); if(depth == -1) { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay); +#else + CGDisplayModeRef modeRef; + CFStringRef encStrRef; + + modeRef = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); + if(!modeRef) + goto have_depth; + + encStrRef = CGDisplayModeCopyPixelEncoding(modeRef); + CFRelease(modeRef); + if(!encStrRef) + goto have_depth; + + if(CFStringCompare(encStrRef, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) { + depth = 24; + } else if(CFStringCompare(encStrRef, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) { + depth = 15; + } else if(CFStringCompare(encStrRef, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) { + depth = 8; + } + + CFRelease(encStrRef); +#endif } +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +have_depth: +#endif switch(depth) { case 8: // pseudo-working dfb->visuals = PseudoColorMask; @@ -319,7 +354,7 @@ xprAddScreen(int index, ScreenPtr pScreen) // case 24: default: if(depth != 24) - ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay)); + ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d)\n", depth, darwinDesiredDepth); dfb->visuals = TrueColorMask; //LARGE_VISUALS; dfb->preferredCVC = TrueColor; dfb->depth = 24; diff --git a/hw/xwin/.gitignore b/hw/xwin/.gitignore index a8c3a286b..bc4986cb4 100644 --- a/hw/xwin/.gitignore +++ b/hw/xwin/.gitignore @@ -1,6 +1,3 @@ -# Add & Override for this directory and it's subdirectories winprefslex.c winprefsyacc.c winprefsyacc.h -XWin.man -XWinrc.man diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c index e9a9b11b4..70578b16c 100644 --- a/hw/xwin/InitInput.c +++ b/hw/xwin/InitInput.c @@ -122,10 +122,6 @@ InitInput (int argc, char *argv[]) g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE); g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE); - - RegisterPointerDevice (g_pwinPointer); - RegisterKeyboardDevice (g_pwinKeyboard); - g_pwinPointer->name = strdup("Windows mouse"); g_pwinKeyboard->name = strdup("Windows keyboard"); diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 38a658d77..22ef8da76 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -49,7 +49,7 @@ from The Open Group. #endif #ifdef RELOCATE_PROJECTROOT #include -typedef HRESULT (*SHGETFOLDERPATHPROC)( +typedef WINAPI HRESULT (*SHGETFOLDERPATHPROC)( HWND hwndOwner, int nFolder, HANDLE hToken, @@ -755,6 +755,9 @@ winUseMsg (void) "\t\t1 - Shadow GDI\n" "\t\t2 - Shadow DirectDraw\n" "\t\t4 - Shadow DirectDraw4 Non-Locking\n" +#ifdef XWIN_PRIMARYFB + "\t\t8 - Primary DirectDraw - obsolete\n" +#endif #ifdef XWIN_NATIVEGDI "\t\t16 - Native GDI - experimental\n" #endif @@ -823,6 +826,11 @@ winUseMsg (void) "\tSpecify an optional refresh rate to use in fullscreen mode\n" "\twith a DirectDraw engine.\n"); + ErrorF ("-resize=none|scrollbars|randr" + "\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n" + "\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n" + "\textension to resize the X screen.\n"); + ErrorF ("-rootless\n" "\tRun the server in rootless mode.\n"); @@ -836,11 +844,6 @@ winUseMsg (void) "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n" "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n"); - ErrorF ("-scrollbars\n" - "\tIn windowed mode, allow screens bigger than the Windows desktop.\n" - "\tMoreover, if the window has decorations, one can now resize\n" - "\tit.\n"); - ErrorF ("-silent-dup-error\n" "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n" "\texit silently and don't display any error message.\n"); diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 232d65e86..ce2edb2e6 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -87,6 +87,7 @@ SRCS = InitInput.c \ winkeybd.c \ winkeyhook.c \ winmisc.c \ + winmonitors.c \ winmouse.c \ winmsg.c \ winmultiwindowclass.c \ @@ -156,7 +157,7 @@ winprefsyacc.h: winprefsyacc.c winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c -CLEANFILES = $(BUILT_SOURCES) $(appman_DATA) $(fileman_DATA) XWin.man XWinrc.man +CLEANFILES = $(BUILT_SOURCES) AM_YFLAGS = -d AM_LFLAGS = -i @@ -165,34 +166,13 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ -I$(top_srcdir) \ -Wno-bad-function-cast -MAN_SRCS = XWin.man.pre XWinrc.man.pre - -appmandir = $(APP_MAN_DIR) -appman_DATA = XWin.$(APP_MAN_SUFFIX) - -filemandir = $(FILE_MAN_DIR) -fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX) - -XWin.$(APP_MAN_SUFFIX): XWin.man - -$(AM_V_at)rm -f XWin.$(APP_MAN_SUFFIX) - $(AM_V_at)$(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX) - -XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man - -$(AM_V_at)rm -f XWinrc.$(FILE_MAN_SUFFIX) - $(AM_V_at)$(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX) - -EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir) - xwinconfigdir = $(sysconfdir)/X11 xwinconfig_DATA = system.XWinrc -include $(top_srcdir)/cpprules.in - install-exec-hook: (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) XWin$(EXEEXT) X) EXTRA_DIST = \ - $(MAN_SRCS) \ $(xwinconfig_DATA) \ X.ico \ XWin.rc \ @@ -220,5 +200,5 @@ EXTRA_DIST = \ relink: $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) -SUBDIRS = $(GLX_DIR) . -DIST_SUBDIRS = glx . +SUBDIRS = man $(GLX_DIR) . +DIST_SUBDIRS = man glx . diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore index e7c7617e9..062fd8573 100644 --- a/hw/xwin/glx/.gitignore +++ b/hw/xwin/glx/.gitignore @@ -1,8 +1,3 @@ -# ignore downloaded and generated files +# ignore generated files generated_gl_wrappers.c generated_wgl_wrappers.c -gl.spec -gl.tm -wgl.tm -wglext.spec -wglext.h diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am index e9fea50a7..cdcba35c9 100644 --- a/hw/xwin/glx/Makefile.am +++ b/hw/xwin/glx/Makefile.am @@ -25,36 +25,16 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/hw/xwin/ -glwrap.c: generated_gl_wrappers.c -wgl_ext_api.c: generated_wgl_wrappers.c wglext.h -wgl_ext_api.h: wglext.h -indirect.c: wgl_ext_api.h +if XWIN_GLX_WINDOWS -SPEC_FILES = gl.spec gl.tm wglext.spec wgl.tm +generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm + $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c -gl.spec: - wget http://www.opengl.org/registry/api/gl.spec - -gl.tm: - wget http://www.opengl.org/registry/api/gl.tm - -wglext.spec: - wget http://www.opengl.org/registry/api/wglext.spec - -wgl.tm: - wget http://www.opengl.org/registry/api/wgl.tm - -generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm - $(srcdir)/gen_gl_wrappers.py --spec=$(srcdir)/gl.spec --typemap=$(srcdir)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c - -generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm - $(srcdir)/gen_gl_wrappers.py --spec=$(srcdir)/wglext.spec --typemap=$(srcdir)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c - -wglext.h: - wget http://www.opengl.org/registry/api/wglext.h +generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm + $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c +endif BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = $(SPEC_FILES) wglext.h -EXTRA_DIST = gen_gl_wrappers.py $(SPEC_FILES) wglext.h +EXTRA_DIST = gen_gl_wrappers.py diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 38918859a..bd2a1ad30 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -649,8 +649,6 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->base.createContext = glxWinCreateContext; screen->base.createDrawable = glxWinCreateDrawable; screen->base.swapInterval = glxWinScreenSwapInterval; - screen->base.hyperpipeFuncs = NULL; - screen->base.swapBarrierFuncs = NULL; screen->base.pScreen = pScreen; if (strstr(wgl_extensions, "WGL_ARB_pixel_format")) @@ -682,10 +680,7 @@ glxWinScreenProbe(ScreenPtr pScreen) unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); if (buffer_size > 0) { - if (screen->base.GLXextensions != NULL) - { - free(screen->base.GLXextensions); - } + free(screen->base.GLXextensions); screen->base.GLXextensions = xnfalloc(buffer_size); __glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions); @@ -864,7 +859,7 @@ glxWinDrawableDestroy(__GLXdrawable *base) // on the next context change) // (GLX core considers it an error when we try to select a new current context if the old one // has unflushed commands, but the window has disappeared..) - __GLX_NOTE_FLUSHED_CMDS(__glXLastContext); + __glXLastContext->hasUnflushedCommands = FALSE; __glXLastContext = NULL; } @@ -1485,13 +1480,6 @@ glxWinContextCopy(__GLXcontext *dst_base, __GLXcontext *src_base, unsigned long return ret; } -static int -glxWinContextForceCurrent(__GLXcontext *base) -{ - /* wglMakeCurrent always flushes the previous context, so this is equivalent to glxWinContextMakeCurrent */ - return glxWinContextMakeCurrent(base); -} - static void glxWinContextDestroy(__GLXcontext *base) { @@ -1546,7 +1534,6 @@ glxWinCreateContext(__GLXscreen *screen, context->base.makeCurrent = glxWinContextMakeCurrent; context->base.loseCurrent = glxWinContextLoseCurrent; context->base.copy = glxWinContextCopy; - context->base.forceCurrent = glxWinContextForceCurrent; context->base.textureFromPixmap = &glxWinTextureFromPixmap; context->base.config = modes; context->base.pGlxScreen = screen; diff --git a/hw/xwin/glx/wgl_ext_api.c b/hw/xwin/glx/wgl_ext_api.c index 4b8359fb1..1020916dc 100644 --- a/hw/xwin/glx/wgl_ext_api.c +++ b/hw/xwin/glx/wgl_ext_api.c @@ -35,7 +35,7 @@ #include #include #include -#include "wglext.h" +#include #include #include "glwindows.h" diff --git a/hw/xwin/glx/wgl_ext_api.h b/hw/xwin/glx/wgl_ext_api.h index e4462ac5c..77efd7069 100644 --- a/hw/xwin/glx/wgl_ext_api.h +++ b/hw/xwin/glx/wgl_ext_api.h @@ -29,7 +29,7 @@ #ifndef wgl_ext_api_h #define wgl_ext_api_h -#include "wglext.h" +#include void wglResolveExtensionProcs(void); diff --git a/hw/xwin/man/Makefile.am b/hw/xwin/man/Makefile.am new file mode 100644 index 000000000..d19c2729f --- /dev/null +++ b/hw/xwin/man/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/manpages.am +appman_PRE = XWin.man +fileman_PRE = XWinrc.man diff --git a/hw/xwin/XWin.man.pre b/hw/xwin/man/XWin.man similarity index 83% rename from hw/xwin/XWin.man.pre rename to hw/xwin/man/XWin.man index 51268f69a..aad29cf25 100644 --- a/hw/xwin/XWin.man.pre +++ b/hw/xwin/man/XWin.man @@ -67,7 +67,7 @@ The default behaviour is to create a single screen 0 that is roughly the size of useful area of the primary monitor (allowing for any window decorations and the task-bar). -Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a +Screen specific parameters can be applied as a default to all screens by placing those screen specific parameters before any \fB\-screen\fP parameter. Screen specific parameters placed after the first \fB\-screen\fP parameter will apply only to the immediately @@ -103,11 +103,12 @@ Examples: .SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS These parameters only apply to windowed mode screens i.e. not -in \fB-multwindow\fP or \fB-rootless\fP mode +in \fB-multiwindow\fP or \fB-rootless\fP mode. .TP 8 .B "\-fullscreen" The X server window takes the full screen, covering completely the \fIWindows\fP desktop. +Currently \fB\-fullscreen\fP may only be applied to one X screen. .TP 8 .B \-nodecoration Do not give the Cygwin/X window a \fIWindows\fP window border, title bar, @@ -115,10 +116,52 @@ etc. This parameter is ignored when the \fB\-fullscreen\fP parameter is specified. .TP 8 .B \-scrollbars -In windowed mode, allow screens bigger than the \fIWindows\fP desktop. -Moreover, if the window has decorations, one can now resize it. -This parameter is ignored when the \fB\-fullscreen\fP parameter is specified. +Alternative name for \fB\-resize=scrollbars\fP. + +.SH OPTIONS CONTROLLING RESIZE BEHAVIOUR +.TP 8 +.B \-resize[=none|scrollbars|randr] +Select the resize mode of an X screen. + +.RS +.IP \fB\-resize=none\fP 8 +(default). The screen is not resizable. + +In windowed mode, if the window has decorations, a fixed frame is used. + +.IP \fB\-resize=scrollbars\fP 8 +The screen window is resizeable, but the screen is not resizable. + +In windowed mode, if the window has decorations, a resizing frame is used. +Scrollbars are drawn when needed to allow the entire X screen +to viewed by adjusting them. + +This also permits screens bigger than the \fIWindows\fP virtual desktop to be used. + +This parameter is ignored in \fB-multiwindow\fP or \fB-rootless\fP mode. +Alternative name is \fB\-scrollbars\fP. + +.IP \fB\-resize=randr\fP 8 +The screen is resizable and the screen window is resizeable. +In windowed mode, if the window has decorations, a resizing frame is used. + +Resizing the \fIWindows\fP window will use the RANDR extension to change +the size of the X screen. Likewise, changing the size of +the X screen using the RANDR extension will cause the size +of the \fIWindows\fP window containing the X screen to be changed. + +In \fB-multiwindow\fP or \fB-rootless\fP mode, if the X screen is +of the same dimensions as a Windows monitor or the virtual desktop, +the X server will respond to the WM_DISPLAYCHANGED sent when those +dimensions change by resizing the X screen. Changing the size +of the X screen using the RANDR extension is not permitted. + +The maximum dimensions of the screen are the dimensions of the \fIWindows\fP virtual desktop. + +.IP \fB\--resize\fP 8 +on its own is equivalent to \fB\--resize=randr\fP +.RE .SH OPTIONS CONTROLLING WINDOWS INTEGRATION .TP 8 @@ -190,15 +233,27 @@ respectively). .TP 8 .B "\-engine \fIengine_type_id\fP" This option, which is intended for Cygwin/X developers, -overrides the server's automatically selected engine type. This -parameter will be ignored if the specified engine type is not -supported on the current system. The supported engine type ids are 1 -- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw Non-Locking. -Additionally, there are engines with type ids -8 - Primary DirectDraw (obsolete) and 16 - Native GDI (experimental and barely functional). -Default behavior is to determine the engine with optimum performance that +overrides the server's automatically selected drawing engine type. This +parameter will be ignored if the specified drawing engine type is not +supported on the current system. + +Default behavior is to select the drawing engine with optimum performance that supports the specified depth and window configuration. +The engine type ids are: +.RS +.IP 1 4 +Shadow GDI +.IP 2 4 +Shadow DirectDraw +.IP 4 4 +Shadow DirectDraw Non-Locking +.IP 8 4 +Primary DirectDraw (unsupported, obsolete) +.IP 16 4 +Native GDI (unsupported, experimental and barely functional) +.RE + .SH FULLSCREEN OPTIONS .TP 8 .B "\-depth \fIdepth\fP" @@ -322,12 +377,9 @@ X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), s .SH BUGS .I XWin -and this man page still have many limitations. Some of the more obvious -ones are: -.br -- The display mode can not be changed once the X server has started. -.br -- The \fIXWin\fP software is continuously developing; it is therefore possible that +and this man page still have many limitations. + +The \fIXWin\fP software is continuously developing; it is therefore possible that this man page is not up to date. It is always prudent to look also at the output of \fIXWin -help\fP in order to check the options that are operative. diff --git a/hw/xwin/XWinrc.man.pre b/hw/xwin/man/XWinrc.man similarity index 100% rename from hw/xwin/XWinrc.man.pre rename to hw/xwin/man/XWinrc.man diff --git a/hw/xwin/win.h b/hw/xwin/win.h index f22a2d576..9bee9b64f 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -74,9 +74,6 @@ #endif #define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE -#define WIN_DIB_MAXIMUM_SIZE 0x08000000 /* 16 MB on Windows 95, 98, Me */ -#define WIN_DIB_MAXIMUM_SIZE_MB (WIN_DIB_MAXIMUM_SIZE / 8 / 1024 / 1024) - /* * Windows only supports 256 color palettes */ @@ -175,7 +172,6 @@ #include "input.h" #include "mipointer.h" #include "X11/keysym.h" -#include "mibstore.h" #include "micoord.h" #include "dix.h" #include "miline.h" @@ -221,9 +217,10 @@ if (fDebugProcMsg) \ { \ char *pszTemp; \ int iLength; \ - pszTemp = Xprintf (str, ##__VA_ARGS__); \ - MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \ - free(pszTemp); \ + if (asprintf (&pszTemp, str, ##__VA_ARGS__) != -1) { \ + MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \ + free (pszTemp); \ + } \ } #else #define DEBUG_MSG(str,...) @@ -275,8 +272,12 @@ static Atom func (void) { \ typedef Bool (*winAllocateFBProcPtr)(ScreenPtr); +typedef void (*winFreeFBProcPtr)(ScreenPtr); + typedef void (*winShadowUpdateProcPtr)(ScreenPtr, shadowBufPtr); +typedef Bool (*winInitScreenProcPtr)(ScreenPtr); + typedef Bool (*winCloseScreenProcPtr)(int, ScreenPtr); typedef Bool (*winInitVisualsProcPtr)(ScreenPtr); @@ -314,6 +315,12 @@ typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin); typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr); +#ifdef XWIN_NATIVEGDI +/* Typedefs for native GDI wrappers */ +typedef Bool (*RealizeFontPtr) (ScreenPtr pScreen, FontPtr pFont); +typedef Bool (*UnrealizeFontPtr)(ScreenPtr pScreen, FontPtr pFont); +#endif + /* * GC (graphics context) privates @@ -367,6 +374,15 @@ typedef struct { miPointerSpriteFuncPtr spriteFuncs; } winCursorRec; +/* + * Resize modes + */ +typedef enum { + notAllowed, + resizeWithScrollbars, + resizeWithRandr +} winResizeMode; + /* * Screen information structure that we need before privates are available * in the server startup sequence. @@ -380,12 +396,12 @@ typedef struct Bool fUserGaveHeightAndWidth; DWORD dwScreen; + + int iMonitor; DWORD dwUserWidth; DWORD dwUserHeight; DWORD dwWidth; DWORD dwHeight; - DWORD dwWidth_mm; - DWORD dwHeight_mm; DWORD dwPaddedWidth; /* Did the user specify a screen position? */ @@ -430,7 +446,7 @@ typedef struct #endif Bool fMultipleMonitors; Bool fLessPointer; - Bool fScrollbars; + winResizeMode iResizeMode; Bool fNoTrayIcon; int iE3BTimeout; /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */ @@ -472,11 +488,6 @@ typedef struct _winPrivScreenRec /* Handle to icons that must be freed */ HICON hiconNotifyIcon; - /* Last width, height, and depth of the Windows display */ - DWORD dwLastWindowsWidth; - DWORD dwLastWindowsHeight; - DWORD dwLastWindowsBitsPixel; - /* Palette management */ ColormapPtr pcmapInstalled; @@ -492,7 +503,8 @@ typedef struct _winPrivScreenRec HDC hdcScreen; HDC hdcShadow; HWND hwndScreen; - + BITMAPINFOHEADER *pbmih; + /* Privates used by shadow fb and primary fb DirectDraw servers */ LPDIRECTDRAW pdd; LPDIRECTDRAWSURFACE2 pddsPrimary; @@ -542,7 +554,9 @@ typedef struct _winPrivScreenRec /* Engine specific functions */ winAllocateFBProcPtr pwinAllocateFB; + winFreeFBProcPtr pwinFreeFB; winShadowUpdateProcPtr pwinShadowUpdate; + winInitScreenProcPtr pwinInitScreen; winCloseScreenProcPtr pwinCloseScreen; winInitVisualsProcPtr pwinInitVisuals; winAdjustVideoModeProcPtr pwinAdjustVideoMode; @@ -587,6 +601,12 @@ typedef struct _winPrivScreenRec SetShapeProcPtr SetShape; winCursorRec cursor; + +#ifdef XWIN_NATIVEGDI + RealizeFontPtr RealizeFont; + UnrealizeFontPtr UnrealizeFont; +#endif + } winPrivScreenRec; @@ -1450,6 +1470,18 @@ winInitCursor (ScreenPtr pScreen); void winInitializeScreens(int maxscreens); +/* + * winrandr.c + */ +Bool +winRandRInit (ScreenPtr pScreen); +void +winDoRandRScreenSetSize (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD32 mmWidth, + CARD32 mmHeight); + /* * END DDX and DIX Function Prototypes */ diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c index 2f042fd0b..b0006a01f 100644 --- a/hw/xwin/winclipboardxevents.c +++ b/hw/xwin/winclipboardxevents.c @@ -636,11 +636,14 @@ winClipboardFlushXEvents (HWND hwnd, case XNoMemory: ErrorF ("XNoMemory\n"); break; + case XLocaleNotSupported: + ErrorF ("XLocaleNotSupported\n"); + break; case XConverterNotFound: ErrorF ("XConverterNotFound\n"); break; default: - ErrorF ("%d", iReturn); + ErrorF ("%d\n", iReturn); break; } pszReturnData = malloc (1); @@ -789,6 +792,9 @@ winClipboardFlushXEvents (HWND hwnd, case PropertyNotify: break; + case MappingNotify: + break; + default: ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type); break; diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c index 9da03888d..d526a9201 100644 --- a/hw/xwin/wincmap.c +++ b/hw/xwin/wincmap.c @@ -516,11 +516,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) pScreen->blackPixel = 0; /* Free colormap */ - if (ppeColors != NULL) - { - free (ppeColors); - ppeColors = NULL; - } + free(ppeColors); + ppeColors = NULL; /* Free the DC */ if (hdc != NULL) diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 758c54d89..76bf8e2de 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -240,6 +240,7 @@ Bool winConfigKeyboard (DeviceIntPtr pDevice) { char layoutName[KL_NAMELENGTH]; + unsigned char layoutFriendlyName[256]; static unsigned int layoutNum = 0; int keyboardType; #ifdef XWIN_XF86CONFIG @@ -299,11 +300,32 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL) winMsg (X_INFO, "Loading US keyboard layout.\n"); else - winMsg (X_ERROR, "LoadKeyboardLaout failed.\n"); + winMsg (X_ERROR, "LoadKeyboardLayout failed.\n"); } } - winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n", - layoutName, layoutNum); + + /* Discover the friendly name of the current layout */ + { + HKEY regkey = NULL; + const char regtempl[] = "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; + char *regpath; + DWORD namesize = sizeof(layoutFriendlyName); + + regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); + strcpy(regpath, regtempl); + strcat(regpath, layoutName); + + if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key)) + RegQueryValueEx(regkey, "Layout Text", 0, NULL, layoutFriendlyName, &namesize); + + /* Close registry key */ + if (regkey) + RegCloseKey (regkey); + free(regpath); + } + + winMsg (X_PROBED, "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n", + layoutName, layoutNum, layoutFriendlyName, keyboardType); for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) { @@ -311,46 +333,35 @@ winConfigKeyboard (DeviceIntPtr pDevice) continue; if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType) continue; - + bfound = TRUE; winMsg (X_PROBED, - "Using preset keyboard for \"%s\" (%x), type \"%d\"\n", - pLayout->layoutname, pLayout->winlayout, keyboardType); - + "Found matching XKB configuration \"%s\"\n", + pLayout->layoutname); + + winMsg(X_PROBED, + "Model = \"%s\" Layout = \"%s\"" + " Variant = \"%s\" Options = \"%s\"\n", + pLayout->xkbmodel ? pLayout->xkbmodel : "none", + pLayout->xkblayout ? pLayout->xkblayout : "none", + pLayout->xkbvariant ? pLayout->xkbvariant : "none", + pLayout->xkboptions ? pLayout->xkboptions : "none"); + g_winInfo.xkb.model = pLayout->xkbmodel; g_winInfo.xkb.layout = pLayout->xkblayout; g_winInfo.xkb.variant = pLayout->xkbvariant; - g_winInfo.xkb.options = pLayout->xkboptions; + g_winInfo.xkb.options = pLayout->xkboptions; + + break; } - + if (!bfound) { - HKEY regkey = NULL; - const char regtempl[] = - "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; - char *regpath; - unsigned char lname[256]; - DWORD namesize = sizeof(lname); - - regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); - strcpy(regpath, regtempl); - strcat(regpath, layoutName); - - if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key) && - !RegQueryValueEx(regkey, "Layout Text", 0, NULL, lname, &namesize)) - { - winMsg (X_ERROR, - "Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName); - } - - /* Close registry key */ - if (regkey) - RegCloseKey (regkey); - free(regpath); + winMsg (X_ERROR, "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName); } - } - + } + /* parse the configuration */ #ifdef XWIN_XF86CONFIG if (g_cmdline.keyboard) diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c index 0c342e1ae..755373965 100644 --- a/hw/xwin/wincreatewnd.c +++ b/hw/xwin/wincreatewnd.c @@ -192,7 +192,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) fForceShowWindow = TRUE; } dwWindowStyle |= WS_CAPTION; - if (pScreenInfo->fScrollbars) + if (pScreenInfo->iResizeMode != notAllowed) dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX; } else @@ -233,6 +233,22 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) iPosY = rcWorkArea.top; } + /* Clean up the scrollbars flag, if necessary */ + if ((!pScreenInfo->fDecoration +#ifdef XWIN_MULTIWINDOWEXTWM + || pScreenInfo->fMWExtWM +#endif + || pScreenInfo->fRootless +#ifdef XWIN_MULTIWINDOW + || pScreenInfo->fMultiWindow +#endif + ) + && (pScreenInfo->iResizeMode == resizeWithScrollbars)) + { + /* We cannot have scrollbars if we do not have a window border */ + pScreenInfo->iResizeMode = notAllowed; + } + /* Did the user specify a height and width? */ if (pScreenInfo->fUserGaveHeightAndWidth) { @@ -256,12 +272,12 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) #if CYGDEBUG winDebug ("winCreateBoundingWindowWindowed - Window has decoration\n"); #endif - /* Are we using scrollbars? */ - if (pScreenInfo->fScrollbars) + + /* Are we resizable */ + if (pScreenInfo->iResizeMode != notAllowed) { #if CYGDEBUG - winDebug ("winCreateBoundingWindowWindowed - Window has " - "scrollbars\n"); + winDebug ("winCreateBoundingWindowWindowed - Window is resizable\n"); #endif iWidth += 2 * GetSystemMetrics (SM_CXSIZEFRAME); @@ -271,8 +287,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) else { #if CYGDEBUG - winDebug ("winCreateBoundingWindowWindowed - Window does not have " - "scrollbars\n"); + winDebug ("winCreateBoundingWindowWindowed - Window is not resizable\n"); #endif iWidth += 2 * GetSystemMetrics (SM_CXFIXEDFRAME); @@ -296,22 +311,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) } } - /* Clean up the scrollbars flag, if necessary */ - if ((!pScreenInfo->fDecoration -#ifdef XWIN_MULTIWINDOWEXTWM - || pScreenInfo->fMWExtWM -#endif - || pScreenInfo->fRootless -#ifdef XWIN_MULTIWINDOW - || pScreenInfo->fMultiWindow -#endif - ) - && pScreenInfo->fScrollbars) - { - /* We cannot have scrollbars if we do not have a window border */ - pScreenInfo->fScrollbars = FALSE; - } - + /* Make sure window is no bigger than work area */ if (TRUE #ifdef XWIN_MULTIWINDOWEXTWM && !pScreenInfo->fMWExtWM @@ -396,7 +396,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) rcClient.bottom, rcClient.top); /* We adjust the visual size if the user did not specify it */ - if (!(pScreenInfo->fScrollbars && pScreenInfo->fUserGaveHeightAndWidth)) + if (!((pScreenInfo->iResizeMode == resizeWithScrollbars) && pScreenInfo->fUserGaveHeightAndWidth)) { /* * User did not give a height and width with scrollbars enabled, diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 22d8cd7f7..c3a149762 100644 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -341,11 +341,10 @@ winExitDlgProc (HWND hDialog, UINT message, winInitDialog (hDialog); /* Format the connected clients string */ - pszConnectedClients = Xprintf (CONNECTED_CLIENTS_FORMAT, + if (asprintf (&pszConnectedClients, CONNECTED_CLIENTS_FORMAT, (s_pScreenPriv->iConnectedClients == 1) ? "is" : "are", s_pScreenPriv->iConnectedClients, - (s_pScreenPriv->iConnectedClients == 1) ? "" : "s"); - if (!pszConnectedClients) + (s_pScreenPriv->iConnectedClients == 1) ? "" : "s") == -1) return TRUE; @@ -483,11 +482,11 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message, #if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, " - "last bpp: %d\n", + "current bpp: %d\n", s_pScreenInfo->dwBPP, - s_pScreenPriv->dwLastWindowsBitsPixel); + GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); #endif - + winInitDialog( hwndDialog ); return TRUE; @@ -495,14 +494,13 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message, case WM_DISPLAYCHANGE: #if CYGDEBUG winDebug ("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, " - "last bpp: %d, new bpp: %d\n", + "new bpp: %d\n", s_pScreenInfo->dwBPP, - s_pScreenPriv->dwLastWindowsBitsPixel, - wParam); + GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL)); #endif /* Dismiss the dialog if the display returns to the original depth */ - if (wParam == s_pScreenInfo->dwBPP) + if (GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL) == s_pScreenInfo->dwBPP) { ErrorF ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n"); diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index aadfd2858..5e32d090d 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -101,12 +101,15 @@ winMessageBoxF (const char *pszError, UINT uType, ...) char * pszErrorF = NULL; char * pszMsgBox = NULL; va_list args; + int size; va_start(args, uType); - pszErrorF = Xvprintf(pszError, args); + size = vasprintf (&pszErrorF, pszError, args); va_end(args); - if (!pszErrorF) + if (size == -1) { + pszErrorF = NULL; goto winMessageBoxF_Cleanup; + } #define MESSAGEBOXF \ "%s\n" \ @@ -117,15 +120,18 @@ winMessageBoxF (const char *pszError, UINT uType, ...) "XWin was started with the following command-line:\n\n" \ "%s\n" - pszMsgBox = Xprintf (MESSAGEBOXF, - pszErrorF, XVENDORNAME, - XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT, - BUILDERADDR, - BUILDERSTRING, - g_pszCommandLine); + size = asprintf (&pszMsgBox, MESSAGEBOXF, + pszErrorF, XVENDORNAME, + XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, + XORG_VERSION_SNAP, XORG_VERSION_CURRENT, + BUILDERADDR, + BUILDERSTRING, + g_pszCommandLine); - if (!pszMsgBox) + if (size == -1) { + pszMsgBox = NULL; goto winMessageBoxF_Cleanup; + } /* Display the message box string */ MessageBox (NULL, diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 83fea21cd..a3112fffe 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -73,6 +73,8 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) int iParam = HIWORD (lParam); int iParamScanCode = LOBYTE (iParam); + winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); + /* WM_ key messages faked by Vista speech recognition (WSR) don't have a * scan code. * @@ -470,9 +472,6 @@ winKeybdReleaseKeys (void) void winSendKeyEvent (DWORD dwKey, Bool fDown) { - EventListPtr events; - int i, nevents; - /* * When alt-tabing between screens we can get phantom key up messages * Here we only pass them through it we think we should! @@ -482,16 +481,10 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) /* Update the keyState map */ g_winKeyState[dwKey] = fDown; - GetEventList(&events); - nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE); + QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event); - -#if CYGDEBUG - ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", - dwKey, fDown, nevents); -#endif + winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n", + dwKey, fDown); } BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam) diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h index 5b2a5892f..4e4c35c37 100644 --- a/hw/xwin/winkeybd.h +++ b/hw/xwin/winkeybd.h @@ -216,13 +216,13 @@ g_iKeyMap [] = { /* 170 */ 0, 0, 0, /* 171 */ 0, 0, 0, /* 172 */ 0, 0, 0, - /* 173 */ 0, 0, 0, - /* 174 */ 0, 0, 0, - /* 175 */ 0, 0, 0, - /* 176 */ 0, 0, 0, - /* 177 */ 0, 0, 0, - /* 178 */ 0, 0, 0, - /* 179 */ 0, 0, 0, + /* 173 */ VK_VOLUME_MUTE, 0, KEY_Mute, + /* 174 */ VK_VOLUME_DOWN, 0, KEY_AudioLower, + /* 175 */ VK_VOLUME_UP, 0, KEY_AudioRaise, + /* 176 */ VK_MEDIA_NEXT_TRACK, 0, KEY_NEXTSONG, + /* 177 */ VK_MEDIA_PREV_TRACK, 0, KEY_PREVIOUSSONG, + /* 178 */ VK_MEDIA_STOP, 0, KEY_STOPCD, + /* 179 */ VK_MEDIA_PLAY_PAUSE, 0, KEY_PLAYPAUSE, /* 180 */ 0, 0, 0, /* 181 */ 0, 0, 0, /* 182 */ 0, 0, 0, @@ -266,7 +266,7 @@ g_iKeyMap [] = { /* 220 */ 0, 0, 0, /* 221 */ 0, 0, 0, /* 222 */ 0, 0, 0, - /* 223 */ 0, 0, 0, + /* 223 */ VK_OEM_8, 0, KEY_RCtrl, /* at least on Candian Multilingual Standard layout */ /* 224 */ 0, 0, 0, /* 225 */ 0, 0, 0, /* 226 */ 0, 0, 0, diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c index fe1156dcf..cbee7cbda 100644 --- a/hw/xwin/winkeyhook.c +++ b/hw/xwin/winkeyhook.c @@ -88,9 +88,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam) /* Pass keystrokes on to our main message loop */ if (iCode == HC_ACTION) { -#if 0 - ErrorF ("vkCode: %08x\tscanCode: %08x\n", p->vkCode, p->scanCode); -#endif + winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n", p->vkCode, p->scanCode); switch (wParam) { diff --git a/hw/xwin/winkeynames.h b/hw/xwin/winkeynames.h index 3d5938348..914016a76 100644 --- a/hw/xwin/winkeynames.h +++ b/hw/xwin/winkeynames.h @@ -23,10 +23,6 @@ * */ -#define XK_TECHNICAL -#define XK_KATAKANA -#include - #define GLYPHS_PER_KEY 4 #define NUM_KEYCODES 248 #define MIN_KEYCODE 8 @@ -194,6 +190,15 @@ #define KEY_HKTG /* Hirugana/Katakana tog 0xc8 */ 200 #define KEY_BSlash2 /* \ _ 0xcb */ 203 +#define KEY_Mute /* Audio Mute */ 152 +#define KEY_AudioLower /* Audio Lower */ 168 +#define KEY_AudioRaise /* Audio Raise */ 166 + +#define KEY_NEXTSONG /* Media next */ 145 +#define KEY_PLAYPAUSE /* Media play/pause toggle */ 154 +#define KEY_PREVIOUSSONG /* Media previous */ 136 +#define KEY_STOPCD /* Media stop */ 156 + /* These are for "notused" and "unknown" entries in translation maps. */ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h index 9500689bc..ce502a005 100644 --- a/hw/xwin/winlayouts.h +++ b/hw/xwin/winlayouts.h @@ -55,13 +55,15 @@ WinKBLayoutRec winKBLayouts[] = { 0x00010409, -1, "pc105", "dvorak", NULL, NULL, "English (USA,Dvorak)"}, { 0x00020409, -1, "pc105", "us_intl", NULL, NULL, "English (USA,International)"}, { 0x00000809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, + { 0x00001009, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00011009, -1, "pc105", "ca", "multix", NULL, "Canadian Multilingual Standard"}, { 0x00001809, -1, "pc105", "ie", NULL, NULL, "Irish"}, { 0x0000040a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain,Traditional Sort)"}, { 0x0000080a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, { 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, { 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, { 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, - { 0x00000c0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada, Legacy)"}, { 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, { 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, { 0x0000040e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, @@ -79,6 +81,8 @@ WinKBLayoutRec winKBLayouts[] = { 0x00000816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"}, { 0x0000041a, -1, "pc105", "hr", NULL, NULL, "Croatian"}, { 0x0000041d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"}, + { 0x0000041f, -1, "pc105", "tr", NULL, NULL, "Turkish (Q)"}, + { 0x0001041f, -1, "pc105", "tr", "f", NULL, "Turkish (F)"}, { 0x00000424, -1, "pc105", "si", NULL, NULL, "Slovenian"}, { 0x00000425, -1, "pc105", "ee", NULL, NULL, "Estonian"}, { 0x00000452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"}, @@ -89,5 +93,3 @@ WinKBLayoutRec winKBLayouts[] = See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx for a listing of input locale (keyboard layout) codes */ - - diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c new file mode 100644 index 000000000..a9d46f90e --- /dev/null +++ b/hw/xwin/winmonitors.c @@ -0,0 +1,92 @@ +/* + +Copyright 1993, 1998 The Open Group +Copyright (C) Colin Harrison 2005-2008 + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + + +#include "win.h" +#include "winmonitors.h" + +/* + * getMonitorInfo - callback function used to return information from the enumeration of monitors attached + */ + +static +wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data) +{ + struct GetMonitorInfoData* data = (struct GetMonitorInfoData*)_data; + // only get data for monitor number specified in + data->monitorNum++; + if (data->monitorNum == data->requestedMonitor) + { + data->bMonitorSpecifiedExists = TRUE; + data->monitorOffsetX = rect->left; + data->monitorOffsetY = rect->top; + data->monitorHeight = rect->bottom - rect->top; + data->monitorWidth = rect->right - rect->left; + return FALSE; + } + return TRUE; +} + +typedef WINAPI wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); +ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors; + +wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data); + +Bool QueryMonitor(int index, struct GetMonitorInfoData *data) +{ + /* Load EnumDisplayMonitors from DLL */ + HMODULE user32; + FARPROC func; + user32 = LoadLibrary("user32.dll"); + if (user32 == NULL) + { + winW32Error(2, "Could not open user32.dll"); + return FALSE; + } + func = GetProcAddress(user32, "EnumDisplayMonitors"); + if (func == NULL) + { + winW32Error(2, "Could not resolve EnumDisplayMonitors: "); + return FALSE; + } + _EnumDisplayMonitors = (ENUMDISPLAYMONITORSPROC)func; + + /* prepare data */ + if (data == NULL) + return FALSE; + memset(data, 0, sizeof(*data)); + data->requestedMonitor = index; + + /* query information */ + _EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); + + /* cleanup */ + FreeLibrary(user32); + return TRUE; +} diff --git a/hw/xwin/winmonitors.h b/hw/xwin/winmonitors.h new file mode 100644 index 000000000..180566b00 --- /dev/null +++ b/hw/xwin/winmonitors.h @@ -0,0 +1,14 @@ + +/* data returned for monitor information */ +struct GetMonitorInfoData { + int requestedMonitor; + int monitorNum; + Bool bUserSpecifiedMonitor; + Bool bMonitorSpecifiedExists; + int monitorOffsetX; + int monitorOffsetY; + int monitorHeight; + int monitorWidth; +}; + +Bool QueryMonitor(int index, struct GetMonitorInfoData *data); diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index af499d94b..752334a31 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -39,6 +39,7 @@ #include "inputstr.h" #include "exevents.h" /* for button/axes labels */ #include "xserver-properties.h" +#include "inpututils.h" /* Peek the internal button mapping */ static CARD8 const *g_winMouseButtonMap = NULL; @@ -233,22 +234,18 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ) void winMouseButtonsSendEvent (int iEventType, int iButton) { - EventListPtr events; - int i, nevents; + ValuatorMask mask; if (g_winMouseButtonMap) iButton = g_winMouseButtonMap[iButton]; - GetEventList(&events); - nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton, - POINTER_RELATIVE, 0, 0, NULL); - - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); + valuator_mask_zero(&mask); + QueuePointerEvents(g_pwinPointer, iEventType, iButton, + POINTER_RELATIVE, &mask); #if CYGDEBUG - ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n", - iEventType, iButton, nevents); + ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n", + iEventType, iButton); #endif } @@ -364,18 +361,15 @@ winMouseButtonsHandle (ScreenPtr pScreen, */ void winEnqueueMotion(int x, int y) { - int i, nevents; int valuators[2]; - EventListPtr events; + ValuatorMask mask; - miPointerSetPosition(g_pwinPointer, &x, &y); + miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y); valuators[0] = x; valuators[1] = y; - GetEventList(&events); - nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators); + valuator_mask_set_range(&mask, 0, 2, valuators); + QueuePointerEvents(g_pwinPointer, MotionNotify, 0, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); } diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c index 1ca3f9141..763cb7e08 100644 --- a/hw/xwin/winmultiwindowicons.c +++ b/hw/xwin/winmultiwindowicons.c @@ -36,8 +36,6 @@ #include "winmultiwindowclass.h" #include "winprefs.h" -#include "propertyst.h" - #include "propertyst.h" #include "windowstr.h" @@ -624,6 +622,7 @@ void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon) *pIcon = hIcon; else winDestroyIcon(hIcon); + if (pSmallIcon) *pSmallIcon = hSmallIcon; else @@ -632,7 +631,7 @@ void winSelectIcons(WindowPtr pWin, HICON *pIcon, HICON *pSmallIcon) void winDestroyIcon(HICON hIcon) { - /* Delete the icon if its not the default */ + /* Delete the icon if its not one of the application defaults or an override */ if (hIcon && hIcon != g_hIconX && hIcon != g_hSmallIconX && diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 7efc360a4..21b818b89 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -506,12 +506,16 @@ winCreateWindowsWindow (WindowPtr pWin) iWidth = pWin->drawable.width; iHeight = pWin->drawable.height; - /* ensure window actually ends up somewhere visible */ - if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)) - iX = CW_USEDEFAULT; + /* If it's an InputOutput window, and so is going to end up being made visible, + make sure the window actually ends up somewhere where it will be visible */ + if (pWin->drawable.class != InputOnly) + { + if ((iX < GetSystemMetrics (SM_XVIRTUALSCREEN)) || (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))) + iX = CW_USEDEFAULT; - if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)) - iY = CW_USEDEFAULT; + if ((iY < GetSystemMetrics (SM_YVIRTUALSCREEN)) || (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))) + iY = CW_USEDEFAULT; + } if (winMultiWindowGetTransientFor (pWin, &pDaddy)) { @@ -592,7 +596,9 @@ winDestroyWindowsWindow (WindowPtr pWin) MSG msg; winWindowPriv(pWin); BOOL oldstate = winInDestroyWindowsWindow; - + HICON hIcon; + HICON hIconSm; + #if CYGMULTIWINDOW_DEBUG ErrorF ("winDestroyWindowsWindow\n"); #endif @@ -603,13 +609,22 @@ winDestroyWindowsWindow (WindowPtr pWin) winInDestroyWindowsWindow = TRUE; + /* Store the info we need to destroy after this window is gone */ + hIcon = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_BIG, 0); + hIconSm = (HICON)SendMessage(pWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0); + SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL); + /* Destroy the Windows window */ DestroyWindow (pWinPriv->hWnd); /* Null our handle to the Window so referencing it will cause an error */ pWinPriv->hWnd = NULL; + /* Destroy any icons we created for this window */ + winDestroyIcon(hIcon); + winDestroyIcon(hIconSm); + /* Process all messages on our queue */ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { @@ -655,7 +670,8 @@ winUpdateWindowsWindow (WindowPtr pWin) } /* Display the window without activating it */ - ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE); + if (pWin->drawable.class != InputOnly) + ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE); /* Send first paint message */ UpdateWindow (pWinPriv->hWnd); diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index c9b1584f8..67a58a076 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1114,6 +1114,30 @@ winMultiWindowXMsgProc (void *pArg) } } } + else if (event.type == ConfigureNotify) + { + if (!event.xconfigure.send_event) + { + /* + Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT + doesn't explicitly know about (See sun bug #6434227) + + XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic + ConfigureNotify events to update window location if it's identified the + WM as a non-reparenting WM it knows about (compiz or lookingglass) + + Rather than tell all sorts of lies to get XWM to recognize us as one of + those, simply send a synthetic ConfigureNotify for every non-synthetic one + */ + XEvent event_send = event; + event_send.xconfigure.send_event = TRUE; + event_send.xconfigure.event = event.xconfigure.window; + XSendEvent(event.xconfigure.display, + event.xconfigure.window, + True, StructureNotifyMask, + &event_send); + } + } else if (event.type == PropertyNotify && event.xproperty.atom == atmWmName) { @@ -1552,7 +1576,6 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) Atom type, *pAtom = NULL; int format; unsigned long hint = 0, maxmin = 0, style, nitems = 0 , left = 0; - WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP); MwmHints *mwm_hint = NULL; if (!hWnd) return; @@ -1645,7 +1668,26 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle) } /* Override hint settings from above with settings from config file */ - style = winOverrideStyle((unsigned long)pWin); + { + XClassHint class_hint = {0,0}; + char *window_name = 0; + + if (XGetClassHint(pDisplay, iWindow, &class_hint)) + { + XFetchName(pDisplay, iWindow, &window_name); + + style = winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name); + + if (class_hint.res_name) XFree(class_hint.res_name); + if (class_hint.res_class) XFree(class_hint.res_class); + if (window_name) XFree(window_name); + } + else + { + style = STYLE_NONE; + } + } + if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST; else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX; else if (style & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN; diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c index b8d2d351b..4d7afe898 100644 --- a/hw/xwin/winnativegdi.c +++ b/hw/xwin/winnativegdi.c @@ -92,6 +92,18 @@ winAllocateFBNativeGDI (ScreenPtr pScreen) return TRUE; } +static void +winFreeFBNativeGDI (ScreenPtr pScreen) +{ + FatalError ("winFreeFBNativeGDI\n"); +} + + +static Bool +winInitScreenNativeGDI(ScreenPtr pScreen) +{ + FatalError ("winInitScreenNativeGDI\n"); +} /* * We wrap whatever CloseScreen procedure was specified by fb; @@ -289,28 +301,9 @@ winAdjustVideoModeNativeGDI (ScreenPtr pScreen) break; } - /* GDI cannot change the screen depth */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) - { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeNativeGDI - Using Windows display " - "depth of %d bits per pixel, %d depth\n", - (int) dwBPP, (int) pScreenInfo->dwDepth); + /* GDI cannot change the screen depth, so we'll use GDI's depth */ + pScreenInfo->dwBPP = dwBPP; - /* Use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Warn user if GDI depth is different than -depth parameter */ - ErrorF ("winAdjustVideoModeNativeGDI - Command line bpp: %d, "\ - "using bpp: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); @@ -506,7 +499,9 @@ winSetEngineFunctionsNativeGDI (ScreenPtr pScreen) /* Set our pointers */ pScreenPriv->pwinAllocateFB = winAllocateFBNativeGDI; + pScreenPriv->pwinFreeFB = winFreeFBNativeGDI; pScreenPriv->pwinShadowUpdate = winShadowUpdateNativeGDI; + pScreenPriv->pwinInitScreen = winInitScreenNativeGDI; pScreenPriv->pwinCloseScreen = winCloseScreenNativeGDI; pScreenPriv->pwinInitVisuals = winInitVisualsNativeGDI; pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeNativeGDI; diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c index 7859c6b19..a3990208d 100644 --- a/hw/xwin/winpfbdd.c +++ b/hw/xwin/winpfbdd.c @@ -233,32 +233,11 @@ winAllocateFBPrimaryDD (ScreenPtr pScreen) return TRUE; } - -/* - * Call the wrapped CloseScreen function. - * - * Free our resources and private structures. - */ - -static Bool -winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) +static void +winFreeFBPrimaryDD (ScreenPtr pScreen) { winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - - ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n"); - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; /* Free the offscreen surface, if there is one */ if (pScreenPriv->pddsOffscreen) @@ -284,6 +263,45 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) pScreenPriv->pdd = NULL; } + /* Invalidate the ScreenInfo's fb pointer */ + pScreenInfo->pfb = NULL; +} + +static Bool +winInitScreenPrimaryDD(ScreenPtr pScreen) +{ + return winAllocateFBPrimaryDD(pScreen); +} + +/* + * Call the wrapped CloseScreen function. + * + * Free our resources and private structures. + */ + +static Bool +winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + Bool fReturn; + + ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n"); + + /* Flag that the screen is closed */ + pScreenPriv->fClosed = TRUE; + pScreenPriv->fActive = FALSE; + + /* Call the wrapped CloseScreen procedure */ + WIN_UNWRAP(CloseScreen); + if (pScreen->CloseScreen) + fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + + /* Delete the window property */ + RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); + + winFreeFBPrimaryDD(pScreen); + /* Delete tray icon, if we have one */ if (!pScreenInfo->fNoTrayIcon) winDeleteNotifyIcon (pScreenPriv); @@ -305,9 +323,6 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; - /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); @@ -422,33 +437,13 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModePrimaryDD - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModePrimaryDD - FullScreen, using command " - "line depth: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModePrimaryDD - Windowed, command line " - "depth: %d, using depth: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); @@ -653,8 +648,9 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen) /* Set our pointers */ pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD; - pScreenPriv->pwinShadowUpdate - = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA; + pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD; + pScreenPriv->pwinShadowUpdate = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA; + pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD; pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD; pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD; pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD; @@ -663,10 +659,17 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen) else pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions - = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA; + pScreenPriv->pwinBltExposedRegions = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA; pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; + pScreenPriv->pwinRedrawScreen = NULL; + pScreenPriv->pwinRealizeInstalledPalette = NULL; + pScreenPriv->pwinInstallColormap = NULL; + pScreenPriv->pwinStoreColors = NULL; + pScreenPriv->pwinCreateColormap = NULL; + pScreenPriv->pwinDestroyColormap = NULL; pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD; + pScreenPriv->pwinCreatePrimarySurface = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; + pScreenPriv->pwinReleasePrimarySurface = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; #ifdef XWIN_MULTIWINDOW pScreenPriv->pwinFinishCreateWindowsWindow = (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA; diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c index 050c71a7f..8bd8e3478 100644 --- a/hw/xwin/winpixmap.c +++ b/hw/xwin/winpixmap.c @@ -163,11 +163,8 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap); /* Free the bitmap info header memory */ - if (pPixmapPriv->pbmih != NULL) - { - free (pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - } + free(pPixmapPriv->pbmih); + pPixmapPriv->pbmih = NULL; /* Free the pixmap memory */ free (pPixmap); diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 4ccb4ffc2..d941c5169 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -813,40 +813,20 @@ LoadPreferences (void) * STYLES{} section in the prefs file, and return the style type */ unsigned long -winOverrideStyle (unsigned long longpWin) +winOverrideStyle (char *res_name, char *res_class, char *wmName) { - WindowPtr pWin = (WindowPtr) longpWin; - char *res_name, *res_class; int i; - char *wmName; - - if (pWin==NULL) - return STYLE_NONE; - - /* If we can't find the class, we can't override from default! */ - if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class)) - return STYLE_NONE; - - winMultiWindowGetWMName (pWin, &wmName); for (i=0; irequestedMonitor = index; - - /* query information */ - _EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); - - /* cleanup */ - FreeLibrary(user32); - return TRUE; -} /* * Function prototypes @@ -143,6 +95,7 @@ winInitializeScreenDefaults(void) if (monitorResolution == 0) monitorResolution = WIN_DEFAULT_DPI; + defaultScreenInfo.iMonitor = 1; defaultScreenInfo.dwWidth = dwWidth; defaultScreenInfo.dwHeight = dwHeight; defaultScreenInfo.dwUserWidth = dwWidth; @@ -171,11 +124,9 @@ winInitializeScreenDefaults(void) #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.fScrollbars = FALSE; + defaultScreenInfo.iResizeMode = notAllowed; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_OFF; - defaultScreenInfo.dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI) * 25.4; - defaultScreenInfo.dwHeight_mm = (dwHeight / WIN_DEFAULT_DPI) * 25.4; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; defaultScreenInfo.fUseUnixKillKey = WIN_DEFAULT_UNIX_KILL; defaultScreenInfo.fIgnoreInput = FALSE; @@ -368,6 +319,7 @@ ddxProcessArgument (int argc, char *argv[], int i) iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; + g_ScreenInfo[nScreenNum].iMonitor = iMonitor; g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth; g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight; g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth; @@ -420,6 +372,7 @@ ddxProcessArgument (int argc, char *argv[], int i) "Querying monitors is not supported on NT4 and Win95\n"); } else if (data.bMonitorSpecifiedExists == TRUE) { + g_ScreenInfo[nScreenNum].iMonitor = iMonitor; g_ScreenInfo[nScreenNum].dwInitialX += data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY += data.monitorOffsetY; } @@ -449,6 +402,7 @@ ddxProcessArgument (int argc, char *argv[], int i) { winErrorFVerb (2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; + g_ScreenInfo[nScreenNum].iMonitor = iMonitor; g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY; } @@ -500,17 +454,6 @@ ddxProcessArgument (int argc, char *argv[], int i) g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; } - /* Calculate the screen width and height in millimeters */ - if (g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth) - { - g_ScreenInfo[nScreenNum].dwWidth_mm - = (g_ScreenInfo[nScreenNum].dwWidth - / monitorResolution) * 25.4; - g_ScreenInfo[nScreenNum].dwHeight_mm - = (g_ScreenInfo[nScreenNum].dwHeight - / monitorResolution) * 25.4; - } - /* Flag that this screen was explicity specified by the user */ g_ScreenInfo[nScreenNum].fExplicitScreen = TRUE; @@ -717,12 +660,51 @@ ddxProcessArgument (int argc, char *argv[], int i) */ if (IS_OPTION ("-scrollbars")) { - screenInfoPtr->fScrollbars = TRUE; + + screenInfoPtr->iResizeMode = resizeWithScrollbars; /* Indicate that we have processed this argument */ return 1; } + /* + * Look for the '-resize' argument + */ + if (IS_OPTION ("-resize") || IS_OPTION ("-noresize") || + (strncmp(argv[i], "-resize=",strlen("-resize=")) == 0)) + { + winResizeMode mode; + + if (IS_OPTION ("-resize")) + mode = resizeWithRandr; + else if (IS_OPTION ("-noresize")) + mode = notAllowed; + else if (strncmp(argv[i], "-resize=",strlen("-resize=")) == 0) + { + char *option = argv[i] + strlen("-resize="); + if (strcmp(option, "randr") == 0) + mode = resizeWithRandr; + else if (strcmp(option, "scrollbars") == 0) + mode = resizeWithScrollbars; + else if (strcmp(option, "none") == 0) + mode = notAllowed; + else + { + ErrorF ("ddxProcessArgument - resize - Invalid resize mode %s\n", option); + return 0; + } + } + else + { + ErrorF ("ddxProcessArgument - resize - Invalid resize option %s\n", argv[i]); + return 0; + } + + screenInfoPtr->iResizeMode = mode; + + /* Indicate that we have processed this argument */ + return 1; + } #ifdef XWIN_CLIPBOARD /* @@ -1233,24 +1215,3 @@ winLogVersionInfo (void) ErrorF ("%s\n\n", BUILDERSTRING); ErrorF ("Contact: %s\n", BUILDERADDR); } - -/* - * getMonitorInfo - callback function used to return information from the enumeration of monitors attached - */ - -wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data) -{ - struct GetMonitorInfoData* data = (struct GetMonitorInfoData*)_data; - // only get data for monitor number specified in - data->monitorNum++; - if (data->monitorNum == data->requestedMonitor) - { - data->bMonitorSpecifiedExists = TRUE; - data->monitorOffsetX = rect->left; - data->monitorOffsetY = rect->top; - data->monitorHeight = rect->bottom - rect->top; - data->monitorWidth = rect->right - rect->left; - return FALSE; - } - return TRUE; -} diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 7b5b1359c..c58119360 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -1,8 +1,9 @@ /* *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. + *Copyright (C) 2009-2010 Jon TURNEY * *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the + *a copy of this software and associated documentation files (the *"Software"), to deal in the Software without restriction, including *without limitation the rights to use, copy, modify, merge, publish, *distribute, sublicense, and/or sell copies of the Software, and to @@ -20,101 +21,180 @@ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - *Except as contained in this notice, the name of Harold L Hunt II + *Except as contained in this notice, the name of the author(s) *shall not be used in advertising or otherwise to promote the sale, use *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. + *from the author(s) * * Authors: Harold L Hunt II + * Jon TURNEY */ #ifdef HAVE_XWIN_CONFIG_H #include #endif #include "win.h" +#include "mivalidate.h" // for union _Validate used by windowstr.h + +#ifndef RANDR_12_INTERFACE +#error X server must have RandR 1.2 interface +#endif /* - * Local prototypes + * Answer queries about the RandR features supported. */ static Bool -winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations); +winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations) +{ + winDebug ("winRandRGetInfo ()\n"); -static Bool -winRandRSetConfig (ScreenPtr pScreen, - Rotation rotateKind, - int rate, - RRScreenSizePtr pSize); + /* Don't support rotations */ + *pRotations = RR_Rotate_0; -Bool -winRandRInit (ScreenPtr pScreen); + /* + The screen doesn't have to be limited to the actual + monitor size (we can have scrollbars :-), so what is + the upper limit? + */ + RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096); + return TRUE; +} /* - * Answer queries about the RandR features supported. - */ -static Bool -winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations) +*/ +void +winDoRandRScreenSetSize (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD32 mmWidth, + CARD32 mmHeight) { winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - int n; - Rotation rotateKind; - RRScreenSizePtr pSize; + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + WindowPtr pRoot = pScreen->root; - winDebug ("winRandRGetInfo ()\n"); + // Prevent screen updates while we change things around + SetRootClip(pScreen, FALSE); - /* Don't support rotations, yet */ - *pRotations = RR_Rotate_0; + /* Update the screen size as requested */ + pScreenInfo->dwWidth = width; + pScreenInfo->dwHeight = height; - /* Bail if no depth has a visual associated with it */ - for (n = 0; n < pScreen->numDepths; n++) - if (pScreen->allowedDepths[n].numVids) - break; - if (n == pScreen->numDepths) - return FALSE; + /* Reallocate the framebuffer used by the drawing engine */ + (*pScreenPriv->pwinFreeFB)(pScreen); + if (!(*pScreenPriv->pwinAllocateFB)(pScreen)) + { + ErrorF ("winDoRandRScreenSetSize - Could not reallocate framebuffer\n"); + } - /* Only one allowed rotation for now */ - rotateKind = RR_Rotate_0; + pScreen->width = width; + pScreen->height = height; + pScreen->mmWidth = mmWidth; + pScreen->mmHeight = mmHeight; - /* - * Register supported sizes. This can be called many times, but - * we only support one size for now. - */ - pSize = RRRegisterSize (pScreen, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwWidth_mm, - pScreenInfo->dwHeight_mm); - - /* Tell RandR what the current config is */ - RRSetCurrentConfig (pScreen, - rotateKind, - 0, /* refresh rate, not needed */ - pSize); - - return TRUE; -} + /* Update the screen pixmap to point to the new framebuffer */ + winUpdateFBPointer(pScreen, pScreenInfo->pfb); + + // pScreen->devPrivate == pScreen->GetScreenPixmap(screen) ? + // resize the root window + //pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); + // does this emit a ConfigureNotify?? + // Restore the ability to update screen, now with new dimensions + SetRootClip(pScreen, TRUE); + + // and arrange for it to be repainted + miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); + + /* Indicate that a screen size change took place */ + RRScreenSizeNotify(pScreen); +} /* - * Respond to resize/rotate request from either X Server or X client app + * Respond to resize request */ - -static Bool -winRandRSetConfig (ScreenPtr pScreen, - Rotation rotateKind, - int rate, - RRScreenSizePtr pSize) +static +Bool +winRandRScreenSetSize (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD16 pixWidth, + CARD16 pixHeight, + CARD32 mmWidth, + CARD32 mmHeight) { - winDebug ("winRandRSetConfig ()\n"); + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + winDebug ("winRandRScreenSetSize ()\n"); + + /* + It doesn't currently make sense to allow resize in fullscreen mode + (we'd actually have to list the supported resolutions) + */ + if (pScreenInfo->fFullScreen) + { + ErrorF ("winRandRScreenSetSize - resize not supported in fullscreen mode\n"); + return FALSE; + } + + /* + Client resize requests aren't allowed in rootless modes, even if + the X screen is monitor or virtual desktop size, we'd need to + resize the native display size + */ + if (FALSE +#ifdef XWIN_MULTIWINDOWEXTWM + || pScreenInfo->fMWExtWM +#endif + || pScreenInfo->fRootless +#ifdef XWIN_MULTIWINDOW + || pScreenInfo->fMultiWindow +#endif + ) + { + ErrorF ("winRandRScreenSetSize - resize not supported in rootless modes\n"); + return FALSE; + } + + winDoRandRScreenSetSize(pScreen, width, height, mmWidth, mmHeight); + + /* Cause the native window for the screen to resize itself */ + { + DWORD dwStyle, dwExStyle; + RECT rcClient; + + rcClient.left = 0; + rcClient.top = 0; + rcClient.right = width; + rcClient.bottom = height; + + ErrorF ("winRandRScreenSetSize new client area w: %d h: %d\n", width, height); + + /* Get the Windows window style and extended style */ + dwExStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_EXSTYLE); + dwStyle = GetWindowLongPtr(pScreenPriv->hwndScreen, GWL_STYLE); + + /* + * Calculate the window size needed for the given client area + * adjusting for any decorations it will have + */ + AdjustWindowRectEx(&rcClient, dwStyle, FALSE, dwExStyle); + + ErrorF ("winRandRScreenSetSize new window area w: %ld h: %ld\n", rcClient.right-rcClient.left, rcClient.bottom-rcClient.top); + + SetWindowPos(pScreenPriv->hwndScreen, NULL, + 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top, + SWP_NOZORDER | SWP_NOMOVE); + } return TRUE; } - /* * Initialize the RandR layer. */ @@ -122,8 +202,7 @@ winRandRSetConfig (ScreenPtr pScreen, Bool winRandRInit (ScreenPtr pScreen) { - rrScrPrivPtr pRRScrPriv; - + rrScrPrivPtr pRRScrPriv; winDebug ("winRandRInit ()\n"); if (!RRScreenInit (pScreen)) @@ -135,7 +214,10 @@ winRandRInit (ScreenPtr pScreen) /* Set some RandR function pointers */ pRRScrPriv = rrGetScrPriv (pScreen); pRRScrPriv->rrGetInfo = winRandRGetInfo; - pRRScrPriv->rrSetConfig = winRandRSetConfig; + pRRScrPriv->rrSetConfig = NULL; + pRRScrPriv->rrScreenSetSize = winRandRScreenSetSize; + pRRScrPriv->rrCrtcSet = NULL; + pRRScrPriv->rrCrtcSetGamma = NULL; return TRUE; } diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index 57a08846b..983ff5730 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -69,10 +69,6 @@ winMWExtWMProcs = { * Prototypes */ -Bool -winRandRInit (ScreenPtr pScreen); - - /* * Local functions */ @@ -95,6 +91,7 @@ winScreenInit (int index, winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; winPrivScreenPtr pScreenPriv; HDC hdc; + DWORD dwInitialBPP; #if CYGDEBUG || YES winDebug ("winScreenInit - dwWidth: %ld dwHeight: %ld\n", @@ -130,13 +127,30 @@ winScreenInit (int index, return FALSE; } - /* Adjust the video mode for our engine type */ + /* Horribly misnamed function: Allow engine to adjust BPP for screen */ + dwInitialBPP = pScreenInfo->dwBPP; + if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen)) { ErrorF ("winScreenInit - winAdjustVideoMode () failed\n"); return FALSE; } + if (dwInitialBPP == WIN_DEFAULT_BPP) + { + /* No -depth parameter was passed, let the user know the depth being used */ + ErrorF ("winScreenInit - Using Windows display depth of %d bits per pixel\n", (int) pScreenInfo->dwBPP); + } + else if (dwInitialBPP != pScreenInfo->dwBPP) + { + /* Warn user if engine forced a depth different to -depth parameter */ + ErrorF ("winScreenInit - Command line depth of %d bpp overidden by engine, using %d bpp\n", (int) dwInitialBPP, (int) pScreenInfo->dwBPP); + } + else + { + ErrorF ("winScreenInit - Using command line depth of %d bpp\n", (int) pScreenInfo->dwBPP); + } + /* Check for supported display depth */ if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1)))) { @@ -155,13 +169,20 @@ winScreenInit (int index, * Check that all monitors have the same display depth if we are using * multiple monitors */ - if (pScreenInfo->fMultipleMonitors + if (pScreenInfo->fMultipleMonitors && !GetSystemMetrics (SM_SAMEDISPLAYFORMAT)) { ErrorF ("winScreenInit - Monitors do not all have same pixel format / " - "display depth.\n" - "Using primary display only.\n"); - pScreenInfo->fMultipleMonitors = FALSE; + "display depth.\n"); + if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI) + { + ErrorF ("winScreenInit - Performance may suffer off primary display.\n"); + } + else + { + ErrorF ("winScreenInit - Using primary display only.\n"); + pScreenInfo->fMultipleMonitors = FALSE; + } } /* Create display window */ @@ -175,13 +196,9 @@ winScreenInit (int index, /* Get a device context */ hdc = GetDC (pScreenPriv->hwndScreen); - /* Store the initial height, width, and depth of the display */ /* Are we using multiple monitors? */ if (pScreenInfo->fMultipleMonitors) { - pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); - pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); - /* * In this case, some of the defaults set in * winInitializeScreenDefaults() are not correct ... @@ -190,35 +207,23 @@ winScreenInit (int index, { pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); - pScreenInfo->dwWidth_mm = (pScreenInfo->dwWidth / - WIN_DEFAULT_DPI) * 25.4; - pScreenInfo->dwHeight_mm = (pScreenInfo->dwHeight / - WIN_DEFAULT_DPI) * 25.4; } } - else - { - pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN); - pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN); - } - - /* Save the original bits per pixel */ - pScreenPriv->dwLastWindowsBitsPixel = GetDeviceCaps (hdc, BITSPIXEL); /* Release the device context */ ReleaseDC (pScreenPriv->hwndScreen, hdc); /* Clear the visuals list */ miClearVisualTypes (); - - /* Set the padded screen width */ - pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth, - pScreenInfo->dwBPP); /* Call the engine dependent screen initialization procedure */ if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) { ErrorF ("winScreenInit - winFinishScreenInit () failed\n"); + + /* call the engine dependent screen close procedure to clean up from a failure */ + pScreenPriv->pwinCloseScreen(index, pScreen); + return FALSE; } @@ -279,14 +284,15 @@ winFinishScreenInitFB (int index, #endif /* Create framebuffer */ - if (!(*pScreenPriv->pwinAllocateFB) (pScreen)) + if (!(*pScreenPriv->pwinInitScreen) (pScreen)) { ErrorF ("winFinishScreenInitFB - Could not allocate framebuffer\n"); return FALSE; } /* - * Grab the number of bits that are used to represent color in each pixel. + * Calculate the number of bits that are used to represent color in each pixel, + * the color depth for the screen */ if (pScreenInfo->dwBPP == 8) pScreenInfo->dwDepth = 8; @@ -294,7 +300,7 @@ winFinishScreenInitFB (int index, pScreenInfo->dwDepth = winCountBits (pScreenPriv->dwRedMask) + winCountBits (pScreenPriv->dwGreenMask) + winCountBits (pScreenPriv->dwBlueMask); - + winErrorFVerb (2, "winFinishScreenInitFB - Masks: %08x %08x %08x\n", (unsigned int) pScreenPriv->dwRedMask, (unsigned int) pScreenPriv->dwGreenMask, @@ -394,13 +400,6 @@ winFinishScreenInitFB (int index, } #endif - /* - * Backing store support should reduce network traffic and increase - * performance. - */ - miInitializeBackingStore (pScreen); - - /* KDrive does miDCInitialize right after miInitializeBackingStore */ /* Setup the cursor routines */ #if CYGDEBUG winDebug ("winFinishScreenInitFB - Calling miDCInitialize ()\n"); diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 4e284b9c1..6dad2782f 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -239,9 +239,6 @@ winAllocateFBShadowDD (ScreenPtr pScreen) winDebug ("winAllocateFBShadowDD - Created a clipper\n"); #endif - /* Get a device context for the screen */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - /* Attach the clipper to our display window */ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary, 0, @@ -503,6 +500,48 @@ winAllocateFBShadowDD (ScreenPtr pScreen) return TRUE; } +static void +winFreeFBShadowDD (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Free the shadow surface, if there is one */ + if (pScreenPriv->pddsShadow) + { + IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL); + IDirectDrawSurface2_Release (pScreenPriv->pddsShadow); + pScreenPriv->pddsShadow = NULL; + } + + /* Detach the clipper from the primary surface and release the primary surface, if there is one */ + winReleasePrimarySurfaceShadowDD(pScreen); + + /* Release the clipper object */ + if (pScreenPriv->pddcPrimary) + { + IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); + pScreenPriv->pddcPrimary = NULL; + } + + /* Free the DirectDraw2 object, if there is one */ + if (pScreenPriv->pdd2) + { + IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2); + IDirectDraw2_Release (pScreenPriv->pdd2); + pScreenPriv->pdd2 = NULL; + } + + /* Free the DirectDraw object, if there is one */ + if (pScreenPriv->pdd) + { + IDirectDraw_Release (pScreenPriv->pdd); + pScreenPriv->pdd = NULL; + } + + /* Invalidate the ScreenInfo's fb pointer */ + pScreenInfo->pfb = NULL; +} /* * Transfer the damaged regions of the shadow framebuffer to the display. @@ -529,6 +568,10 @@ winShadowUpdateDD (ScreenPtr pScreen, if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen) || pScreenPriv->fBadDepth) return; + /* Return immediately if we didn't get needed surfaces */ + if (!pScreenPriv->pddsPrimary || !pScreenPriv->pddsShadow) + return; + /* Get the origin of the window in the screen coords */ ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; @@ -647,25 +690,20 @@ winShadowUpdateDD (ScreenPtr pScreen, "%s file to " BUILDERADDR "\n", g_pszLogFile); /* Location of shadow framebuffer has changed */ - pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface; - - /* Update the screen pixmap */ - if (!(*pScreen->ModifyPixmapHeader)(pScreen->devPrivate, - pScreen->width, - pScreen->height, - pScreen->rootDepth, - BitsPerPixel (pScreen->rootDepth), - PixmapBytePad (pScreenInfo->dwStride, - pScreenInfo->dwBPP), - pScreenInfo->pfb)) - { - ErrorF ("winShadowUpdateDD - Bits changed, could not " - "notify fb.\n"); - return; - } + winUpdateFBPointer(pScreen, pScreenPriv->pddsdShadow->lpSurface); } } +static Bool +winInitScreenShadowDD (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + + /* Get a device context for the screen */ + pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); + + return winAllocateFBShadowDD(pScreen); +} /* * Call the wrapped CloseScreen function. @@ -690,7 +728,10 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + if (pScreen->CloseScreen) + fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + + winFreeFBShadowDD(pScreen); /* Free the screen DC */ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); @@ -698,52 +739,10 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - /* Free the shadow surface, if there is one */ - if (pScreenPriv->pddsShadow) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsShadow); - pScreenPriv->pddsShadow = NULL; - } - - /* Detach the clipper from the primary surface and release the clipper. */ - if (pScreenPriv->pddcPrimary) - { - /* Detach the clipper */ - IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary, - NULL); - - /* Release the clipper object */ - IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); - pScreenPriv->pddcPrimary = NULL; - } - - /* Release the primary surface, if there is one */ - if (pScreenPriv->pddsPrimary) - { - IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary); - pScreenPriv->pddsPrimary = NULL; - } - - /* Free the DirectDraw2 object, if there is one */ - if (pScreenPriv->pdd2) - { - IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2); - IDirectDraw2_Release (pScreenPriv->pdd2); - pScreenPriv->pdd2 = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - /* Delete tray icon, if we have one */ if (!pScreenInfo->fNoTrayIcon) winDeleteNotifyIcon (pScreenPriv); - + /* Free the exit confirmation dialog box, if it exists */ if (g_hDlgExit != NULL) { @@ -766,9 +765,6 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; - /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); @@ -909,43 +905,12 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeShadowDD - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModeShadowDD - FullScreen, using command line " - "bpp: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - ErrorF ("winAdjustVideoModeShadowDD - Windowed, command line bpp: " - "%d, using bpp: %d\n", (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - - /* See if the shadow bitmap will be larger than the DIB size limit */ - if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP - >= WIN_DIB_MAXIMUM_SIZE) - { - ErrorF ("winAdjustVideoModeShadowDD - Requested DirectDraw surface " - "will be larger than %d MB. The surface may fail to be " - "allocated on Windows 95, 98, or Me, due to a %d MB limit in " - "DIB size. This limit does not apply to Windows NT/2000, and " - "this message may be ignored on those platforms.\n", - WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB); - } /* Release our DC */ ReleaseDC (NULL, hdc); @@ -1370,7 +1335,9 @@ winSetEngineFunctionsShadowDD (ScreenPtr pScreen) /* Set our pointers */ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD; + pScreenPriv->pwinFreeFB = winFreeFBShadowDD; pScreenPriv->pwinShadowUpdate = winShadowUpdateDD; + pScreenPriv->pwinInitScreen = winInitScreenShadowDD; pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD; pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD; pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD; diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 82fe4be36..63d48adb6 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -237,6 +237,10 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth); #endif + /* Set the padded screen width */ + pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth, + pScreenInfo->dwBPP); + /* Allocate memory for our shadow surface */ lpSurface = malloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); if (lpSurface == NULL) @@ -266,9 +270,6 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) winDebug ("winAllocateFBShadowDDNL - Created a clipper\n"); #endif - /* Get a device context for the screen */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - /* Attach the clipper to our display window */ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary, 0, @@ -530,6 +531,49 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) return TRUE; } +static void +winFreeFBShadowDDNL(ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Free the shadow surface, if there is one */ + if (pScreenPriv->pddsShadow4) + { + IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); + free (pScreenInfo->pfb); + pScreenInfo->pfb = NULL; + pScreenPriv->pddsShadow4 = NULL; + } + + /* Detach the clipper from the primary surface and release the primary surface, if there is one */ + winReleasePrimarySurfaceShadowDDNL(pScreen); + + /* Release the clipper object */ + if (pScreenPriv->pddcPrimary) + { + IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); + pScreenPriv->pddcPrimary = NULL; + } + + /* Free the DirectDraw4 object, if there is one */ + if (pScreenPriv->pdd4) + { + IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); + IDirectDraw4_Release (pScreenPriv->pdd4); + pScreenPriv->pdd4 = NULL; + } + + /* Free the DirectDraw object, if there is one */ + if (pScreenPriv->pdd) + { + IDirectDraw_Release (pScreenPriv->pdd); + pScreenPriv->pdd = NULL; + } + + /* Invalidate the ScreenInfo's fb pointer */ + pScreenInfo->pfb = NULL; +} #if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) /* @@ -605,6 +649,10 @@ winShadowUpdateDDNL (ScreenPtr pScreen, if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen) || pScreenPriv->fBadDepth) return; + /* Return immediately if we didn't get needed surfaces */ + if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4) + return; + /* Get the origin of the window in the screen coords */ ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; @@ -720,6 +768,16 @@ winShadowUpdateDDNL (ScreenPtr pScreen, } } +static Bool +winInitScreenShadowDDNL(ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + + /* Get a device context for the screen */ + pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); + + return winAllocateFBShadowDDNL(pScreen); +} /* * Call the wrapped CloseScreen function. @@ -744,7 +802,10 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + if (pScreen->CloseScreen) + fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + + winFreeFBShadowDDNL(pScreen); /* Free the screen DC */ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); @@ -752,49 +813,6 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - /* Free the shadow surface, if there is one */ - if (pScreenPriv->pddsShadow4) - { - IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); - free (pScreenInfo->pfb); - pScreenInfo->pfb = NULL; - pScreenPriv->pddsShadow4 = NULL; - } - - /* Detach the clipper from the primary surface and release the clipper. */ - if (pScreenPriv->pddcPrimary) - { - /* Detach the clipper */ - IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, - NULL); - - /* Release the clipper object */ - IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); - pScreenPriv->pddcPrimary = NULL; - } - - /* Release the primary surface, if there is one */ - if (pScreenPriv->pddsPrimary4) - { - IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4); - pScreenPriv->pddsPrimary4 = NULL; - } - - /* Free the DirectDraw4 object, if there is one */ - if (pScreenPriv->pdd4) - { - IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); - IDirectDraw4_Release (pScreenPriv->pdd4); - pScreenPriv->pdd4 = NULL; - } - - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; - } - /* Delete tray icon, if we have one */ if (!pScreenInfo->fNoTrayIcon) winDeleteNotifyIcon (pScreenPriv); @@ -821,9 +839,6 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; - /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); @@ -964,45 +979,13 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen) dwBPP = GetDeviceCaps (hdc, BITSPIXEL); /* DirectDraw can only change the depth in fullscreen mode */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) + if (!(pScreenInfo->fFullScreen && + (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { - /* No -depth parameter passed, let the user know the depth being used */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); - - /* Use GDI's depth */ + /* Otherwise, We'll use GDI's depth */ pScreenInfo->dwBPP = dwBPP; } - else if (pScreenInfo->fFullScreen - && pScreenInfo->dwBPP != dwBPP) - { - /* FullScreen, and GDI depth differs from -depth parameter */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - FullScreen, using command " - "line bpp: %d\n", (int) pScreenInfo->dwBPP); - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Windowed, and GDI depth differs from -depth parameter */ - winErrorFVerb (2, "winAdjustVideoModeShadowDDNL - Windowed, command line " - "bpp: %d, using bpp: %d\n", - (int) pScreenInfo->dwBPP, (int) dwBPP); - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - - /* See if the shadow bitmap will be larger than the DIB size limit */ - if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP - >= WIN_DIB_MAXIMUM_SIZE) - { - winErrorFVerb (1, "winAdjustVideoModeShadowDDNL - Requested DirectDraw surface " - "will be larger than %d MB. The surface may fail to be " - "allocated on Windows 95, 98, or Me, due to a %d MB limit in " - "DIB size. This limit does not apply to Windows NT/2000, and " - "this message may be ignored on those platforms.\n", - WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB); - } - /* Release our DC */ ReleaseDC (NULL, hdc); @@ -1382,7 +1365,9 @@ winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen) /* Set our pointers */ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDDNL; + pScreenPriv->pwinFreeFB = winFreeFBShadowDDNL; pScreenPriv->pwinShadowUpdate = winShadowUpdateDDNL; + pScreenPriv->pwinInitScreen = winInitScreenShadowDDNL; pScreenPriv->pwinCloseScreen = winCloseScreenShadowDDNL; pScreenPriv->pwinInitVisuals = winInitVisualsShadowDDNL; pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDDNL; diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 4971851e5..1e7cb006c 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -338,37 +338,20 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - BITMAPINFOHEADER *pbmih = NULL; DIBSECTION dibsection; Bool fReturn = TRUE; - /* Get device contexts for the screen and shadow bitmap */ - pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); - pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen); - - /* Allocate bitmap info header */ - pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER) - + 256 * sizeof (RGBQUAD)); - if (pbmih == NULL) - { - ErrorF ("winAllocateFBShadowGDI - malloc () failed\n"); - return FALSE; - } - - /* Query the screen format */ - fReturn = winQueryScreenDIBFormat (pScreen, pbmih); - /* Describe shadow bitmap to be created */ - pbmih->biWidth = pScreenInfo->dwWidth; - pbmih->biHeight = -pScreenInfo->dwHeight; - + pScreenPriv->pbmih->biWidth = pScreenInfo->dwWidth; + pScreenPriv->pbmih->biHeight = -pScreenInfo->dwHeight; + ErrorF ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d " "depth: %d\n", - (int) pbmih->biWidth, (int) -pbmih->biHeight, pbmih->biBitCount); + (int) pScreenPriv->pbmih->biWidth, (int) -pScreenPriv->pbmih->biHeight, pScreenPriv->pbmih->biBitCount); /* Create a DI shadow bitmap with a bit pointer */ pScreenPriv->hbmpShadow = CreateDIBSection (pScreenPriv->hdcScreen, - (BITMAPINFO *) pbmih, + (BITMAPINFO *) pScreenPriv->pbmih, DIB_RGB_COLORS, (VOID**) &pScreenInfo->pfb, NULL, @@ -449,25 +432,6 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) (int) pScreenInfo->dwStride); #endif - /* See if the shadow bitmap will be larger than the DIB size limit */ - if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP - >= WIN_DIB_MAXIMUM_SIZE) - { - ErrorF ("winAllocateFBShadowGDI - Requested DIB (bitmap) " - "will be larger than %d MB. The surface may fail to be " - "allocated on Windows 95, 98, or Me, due to a %d MB limit in " - "DIB size. This limit does not apply to Windows NT/2000, and " - "this message may be ignored on those platforms.\n", - WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB); - } - - /* Determine our color masks */ - if (!winQueryRGBBitsAndMasks (pScreen)) - { - ErrorF ("winAllocateFBShadowGDI - winQueryRGBBitsAndMasks failed\n"); - return FALSE; - } - #ifdef XWIN_MULTIWINDOW /* Redraw all windows */ if (pScreenInfo->fMultiWindow) @@ -477,6 +441,18 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) return fReturn; } +static void +winFreeFBShadowGDI (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Free the shadow bitmap */ + DeleteObject (pScreenPriv->hbmpShadow); + + /* Invalidate the ScreenInfo's fb pointer */ + pScreenInfo->pfb = NULL; +} /* * Blit the damaged regions of the shadow fb to the screen @@ -602,6 +578,41 @@ winShadowUpdateGDI (ScreenPtr pScreen, } +static Bool +winInitScreenShadowGDI (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + + /* Get device contexts for the screen and shadow bitmap */ + pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen); + pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen); + + /* Allocate bitmap info header */ + pScreenPriv->pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER) + + 256 * sizeof (RGBQUAD)); + if (pScreenPriv->pbmih == NULL) + { + ErrorF ("winInitScreenShadowGDI - malloc () failed\n"); + return FALSE; + } + + /* Query the screen format */ + if (!winQueryScreenDIBFormat (pScreen, pScreenPriv->pbmih)) + { + ErrorF ("winInitScreenShadowGDI - winQueryScreenDIBFormat failed\n"); + return FALSE; + } + + /* Determine our color masks */ + if (!winQueryRGBBitsAndMasks (pScreen)) + { + ErrorF ("winInitScreenShadowGDI - winQueryRGBBitsAndMasks failed\n"); + return FALSE; + } + + return winAllocateFBShadowGDI(pScreen); +} + /* See Porting Layer Definition - p. 33 */ /* * We wrap whatever CloseScreen procedure was specified by fb; @@ -625,16 +636,16 @@ winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + if (pScreen->CloseScreen) + fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); /* Free the shadow DC; which allows the bitmap to be freed */ DeleteDC (pScreenPriv->hdcShadow); - - /* Free the shadow bitmap */ - DeleteObject (pScreenPriv->hbmpShadow); + + winFreeFBShadowGDI(pScreen); /* Free the screen DC */ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); @@ -665,9 +676,6 @@ winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen) /* Invalidate our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; - /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); @@ -791,26 +799,9 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen) /* Query GDI for current display depth */ dwBPP = GetDeviceCaps (hdc, BITSPIXEL); - /* GDI cannot change the screen depth */ - if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP) - { - /* No -depth parameter passed, let the user know the depth being used */ - ErrorF ("winAdjustVideoModeShadowGDI - Using Windows display " - "depth of %d bits per pixel\n", (int) dwBPP); + /* GDI cannot change the screen depth, so always use GDI's depth */ + pScreenInfo->dwBPP = dwBPP; - /* Use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - else if (dwBPP != pScreenInfo->dwBPP) - { - /* Warn user if GDI depth is different than -depth parameter */ - ErrorF ("winAdjustVideoModeShadowGDI - Command line bpp: %d, "\ - "using bpp: %d\n", (int) pScreenInfo->dwBPP, (int) dwBPP); - - /* We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; - } - /* Release our DC */ ReleaseDC (NULL, hdc); hdc = NULL; @@ -1235,7 +1226,9 @@ winSetEngineFunctionsShadowGDI (ScreenPtr pScreen) /* Set our pointers */ pScreenPriv->pwinAllocateFB = winAllocateFBShadowGDI; + pScreenPriv->pwinFreeFB = winFreeFBShadowGDI; pScreenPriv->pwinShadowUpdate = winShadowUpdateGDI; + pScreenPriv->pwinInitScreen = winInitScreenShadowGDI; pScreenPriv->pwinCloseScreen = winCloseScreenShadowGDI; pScreenPriv->pwinInitVisuals = winInitVisualsShadowGDI; pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowGDI; diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c index 357d3d70a..04db777b0 100644 --- a/hw/xwin/winvalargs.c +++ b/hw/xwin/winvalargs.c @@ -154,8 +154,8 @@ winValidateArgs (void) /* Check for !fullscreen and any fullscreen-only parameters */ if (!g_ScreenInfo[i].fFullScreen - && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_BPP - || g_ScreenInfo[i].dwBPP != WIN_DEFAULT_REFRESH)) + && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_REFRESH + || g_ScreenInfo[i].dwBPP != WIN_DEFAULT_BPP)) { ErrorF ("winValidateArgs - -refresh and -depth are only valid " "with -fullscreen.\n"); @@ -164,12 +164,12 @@ winValidateArgs (void) /* Check for fullscreen and any non-fullscreen parameters */ if (g_ScreenInfo[i].fFullScreen - && (g_ScreenInfo[i].fScrollbars + && ((g_ScreenInfo[i].iResizeMode != notAllowed) || !g_ScreenInfo[i].fDecoration || g_ScreenInfo[i].fLessPointer)) { ErrorF ("winValidateArgs - -fullscreen is invalid with " - "-scrollbars, -nodecoration, or -lesspointer.\n"); + "-scrollbars, -resize, -nodecoration, or -lesspointer.\n"); return FALSE; } } diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c index 0438e5f54..ed205448d 100644 --- a/hw/xwin/winvideo.c +++ b/hw/xwin/winvideo.c @@ -69,8 +69,6 @@ winInitVideo (ScreenPtr pScreen) #include #endif -#include "win.h" - #if 0 diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c index 75142f15b..8f9917a7b 100644 --- a/hw/xwin/winwin32rootless.c +++ b/hw/xwin/winwin32rootless.c @@ -366,8 +366,8 @@ void winMWExtWMDestroyFrame (RootlessFrameID wid) { win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid; - HICON hiconClass; - HICON hiconSmClass; + HICON hIcon; + HICON hIconSm; HMODULE hInstance; int iReturn; char pszClass[CLASS_NAME_LENGTH]; @@ -398,8 +398,8 @@ winMWExtWMDestroyFrame (RootlessFrameID wid) /* Store the info we need to destroy after this window is gone */ hInstance = (HINSTANCE) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HMODULE); - hiconClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICON); - hiconSmClass = (HICON) GetClassLongPtr (pRLWinPriv->hWnd, GCLP_HICONSM); + hIcon = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0); + hIconSm = (HICON)SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0); iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH); pRLWinPriv->fClose = TRUE; @@ -415,14 +415,14 @@ winMWExtWMDestroyFrame (RootlessFrameID wid) winDebug ("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass); #endif iReturn = UnregisterClass (pszClass, hInstance); - + } + #if CYGMULTIWINDOW_DEBUG - winDebug ("winMWExtWMDestroyFramew - %d Deleting Icon: ", iReturn); + winDebug ("winMWExtWMDestroyFramew - Deleting Icon\n"); #endif - - winDestroyIcon(hiconClass); - winDestroyIcon(hiconSmClass); - } + + winDestroyIcon(hIcon); + winDestroyIcon(hIconSm); #if CYGMULTIWINDOW_DEBUG winDebug ("winMWExtWMDestroyFrame - done\n"); diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index 783760f4b..7975d71a9 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -58,6 +58,7 @@ winReshapeRootless (WindowPtr pWin); Bool winCreateWindowNativeGDI (WindowPtr pWin) { + Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; winWindowPriv(pWin); winScreenPriv(pScreen); diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 6d2270a20..bccd6f9f2 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -40,6 +40,7 @@ #include "winprefs.h" #include "winconfig.h" #include "winmsg.h" +#include "winmonitors.h" #include "inputstr.h" /* @@ -148,6 +149,13 @@ winWindowProc (HWND hwnd, UINT message, return 0; case WM_DISPLAYCHANGE: + /* + WM_DISPLAYCHANGE seems to be sent when the monitor layout or + any monitor's resolution or depth changes, but it's lParam and + wParam always indicate the resolution and bpp for the primary + monitor (so ignore that as we could be on any monitor...) + */ + /* We cannot handle a display mode change during initialization */ if (s_pScreenInfo == NULL) FatalError ("winWindowProc - WM_DISPLAYCHANGE - The display " @@ -167,150 +175,153 @@ winWindowProc (HWND hwnd, UINT message, #endif )) { - /* - * Store the new display dimensions and depth. - * We do this here for future compatibility in case we - * ever allow switching from fullscreen to windowed mode. - */ - s_pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN); - s_pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN); - s_pScreenPriv->dwLastWindowsBitsPixel - = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL); break; } - - ErrorF ("winWindowProc - WM_DISPLAYCHANGE - orig bpp: %d, last bpp: %d, " - "new bpp: %d\n", - (int) s_pScreenInfo->dwBPP, - (int) s_pScreenPriv->dwLastWindowsBitsPixel, - wParam); ErrorF ("winWindowProc - WM_DISPLAYCHANGE - new width: %d " - "new height: %d\n", - LOWORD (lParam), HIWORD (lParam)); - - /* - * TrueColor --> TrueColor depth changes are disruptive for: - * Windowed: - * Shadow DirectDraw - * Shadow DirectDraw Non-Locking - * Primary DirectDraw - * - * TrueColor --> TrueColor depth changes are non-optimal for: - * Windowed: - * Shadow GDI - * - * FullScreen: - * Shadow GDI - * - * TrueColor --> PseudoColor or vice versa are disruptive for: - * Windowed: - * Shadow DirectDraw - * Shadow DirectDraw Non-Locking - * Primary DirectDraw - * Shadow GDI - */ + "new height: %d new bpp: %d\n", + LOWORD (lParam), HIWORD (lParam), wParam); /* * Check for a disruptive change in depth. * We can only display a message for a disruptive depth change, * we cannot do anything to correct the situation. */ - if ((s_pScreenInfo->dwBPP != wParam) - && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD - || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL + /* + XXX: maybe we need to check if GetSystemMetrics(SM_SAMEDISPLAYFORMAT) + has changed as well... + */ + if (s_pScreenInfo->dwBPP != GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL)) + { + if ((s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD + || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL #ifdef XWIN_PRIMARYFB - || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD + || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD #endif - )) - { - /* Cannot display the visual until the depth is restored */ - ErrorF ("winWindowProc - Disruptive change in depth\n"); - - /* Display Exit dialog */ - winDisplayDepthChangeDialog (s_pScreenPriv); - - /* Flag that we have an invalid screen depth */ - s_pScreenPriv->fBadDepth = TRUE; - - /* Minimize the display window */ - ShowWindow (hwnd, SW_MINIMIZE); - } + )) + { + /* Cannot display the visual until the depth is restored */ + ErrorF ("winWindowProc - Disruptive change in depth\n"); + + /* Display depth change dialog */ + winDisplayDepthChangeDialog (s_pScreenPriv); + + /* Flag that we have an invalid screen depth */ + s_pScreenPriv->fBadDepth = TRUE; + + /* Minimize the display window */ + ShowWindow (hwnd, SW_MINIMIZE); + } + else + { + /* For GDI, performance may suffer until original depth is restored */ + ErrorF ("winWindowProc - Performance may be non-optimal after change in depth\n"); + } + } else - { - /* Flag that we have a valid screen depth */ - s_pScreenPriv->fBadDepth = FALSE; - } - + { + /* Flag that we have a valid screen depth */ + s_pScreenPriv->fBadDepth = FALSE; + } + /* - * Check for a change in display dimensions. - * We can simply recreate the same-sized primary surface when - * the display dimensions change. - */ - if (s_pScreenPriv->dwLastWindowsWidth != LOWORD (lParam) - || s_pScreenPriv->dwLastWindowsHeight != HIWORD (lParam)) + If we could cheaply check if this WM_DISPLAYCHANGE change + affects the monitor(s) which this X screen is displayed on + then we should do so here. For the moment, assume it does. + (this is probably usually the case so that might be an + overoptimization) + */ { /* - * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface - * and CreatePrimarySurface function pointers to point - * to the no operation function, NoopDDA. This allows us - * to blindly call these functions, even if they are not - * relevant to the current engine (e.g., Shadow GDI). - */ - -#if CYGDEBUG - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Dimensions changed\n"); -#endif - - /* Release the old primary surface */ - (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); - -#if CYGDEBUG - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Released " - "primary surface\n"); + In rootless modes which are monitor or virtual desktop size + use RandR to resize the X screen + */ + if ((!s_pScreenInfo->fUserGaveHeightAndWidth) && + (s_pScreenInfo->iResizeMode == resizeWithRandr) && + (FALSE +#ifdef XWIN_MULTIWINDOWEXTWM + || s_pScreenInfo->fMWExtWM #endif - - /* Create the new primary surface */ - (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); - -#if CYGDEBUG - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Recreated " - "primary surface\n"); + || s_pScreenInfo->fRootless +#ifdef XWIN_MULTIWINDOW + || s_pScreenInfo->fMultiWindow #endif - -#if 0 - /* Multi-Window mode uses RandR for resizes */ - if (s_pScreenInfo->fMultiWindow) + )) { - RRSetScreenConfig (); + DWORD dwWidth, dwHeight; + + if (s_pScreenInfo->fMultipleMonitors) + { + /* resize to new virtual desktop size */ + dwWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN); + dwHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN); + } + else + { + /* resize to new size of specified monitor */ + struct GetMonitorInfoData data; + if (QueryMonitor(s_pScreenInfo->iMonitor, &data)) + { + if (data.bMonitorSpecifiedExists == TRUE) + { + dwWidth = data.monitorWidth; + dwHeight = data.monitorHeight; + /* + XXX: monitor may have changed position, + so we might need to update xinerama data + */ + } + else + { + ErrorF ("Monitor number %d no longer exists!\n", s_pScreenInfo->iMonitor); + } + } + } + + /* + XXX: probably a small bug here: we don't compute the work area + and allow for task bar + + XXX: generally, we don't allow for the task bar being moved after + the server is started + */ + + /* Set screen size to match new size, if it is different to current */ + if ((s_pScreenInfo->dwWidth != dwWidth) || + (s_pScreenInfo->dwHeight != dwHeight)) + { + winDoRandRScreenSetSize(s_pScreen, + dwWidth, + dwHeight, + (dwWidth * 25.4) / monitorResolution, + (dwHeight * 25.4) / monitorResolution); + } } -#endif - } - else - { -#if CYGDEBUG - winDebug ("winWindowProc - WM_DISPLAYCHANGE - Dimensions did not " - "change\n"); -#endif + else + { + /* + * We can simply recreate the same-sized primary surface when + * the display dimensions change. + */ + + /* + * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface + * and CreatePrimarySurface function pointers to point + * to the no operation function, NoopDDA. This allows us + * to blindly call these functions, even if they are not + * relevant to the current engine (e.g., Shadow GDI). + */ + + winDebug ("winWindowProc - WM_DISPLAYCHANGE - Releasing and recreating primary surface\n"); + + /* Release the old primary surface */ + (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen); + + /* Create the new primary surface */ + (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen); + } } - /* Store the new display dimensions and depth */ - if (s_pScreenInfo->fMultipleMonitors) - { - s_pScreenPriv->dwLastWindowsWidth - = GetSystemMetrics (SM_CXVIRTUALSCREEN); - s_pScreenPriv->dwLastWindowsHeight - = GetSystemMetrics (SM_CYVIRTUALSCREEN); - } - else - { - s_pScreenPriv->dwLastWindowsWidth - = GetSystemMetrics (SM_CXSCREEN); - s_pScreenPriv->dwLastWindowsHeight - = GetSystemMetrics (SM_CYSCREEN); - } - s_pScreenPriv->dwLastWindowsBitsPixel - = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL); break; case WM_SIZE: @@ -323,8 +334,8 @@ winWindowProc (HWND hwnd, UINT message, winDebug ("winWindowProc - WM_SIZE\n"); #endif - /* Break if we do not use scrollbars */ - if (!s_pScreenInfo->fScrollbars + /* Break if we do not allow resizing */ + if ((s_pScreenInfo->iResizeMode == notAllowed) || !s_pScreenInfo->fDecoration #ifdef XWIN_MULTIWINDOWEXTWM || s_pScreenInfo->fMWExtWM @@ -340,6 +351,17 @@ winWindowProc (HWND hwnd, UINT message, if (wParam == SIZE_MINIMIZED) return 0; + ErrorF ("winWindowProc - WM_SIZE - new client area w: %d h: %d\n", + LOWORD (lParam), HIWORD (lParam)); + + if (s_pScreenInfo->iResizeMode == resizeWithRandr) + { + /* Actual resizing is done on WM_EXITSIZEMOVE */ + return 0; + } + + /* Otherwise iResizeMode == resizeWithScrollbars */ + /* * Get the size of the whole window, including client area, * scrollbars, and non-client area decorations (caption, borders). @@ -357,10 +379,6 @@ winWindowProc (HWND hwnd, UINT message, iWidth = rcWindow.right - rcWindow.left; iHeight = rcWindow.bottom - rcWindow.top; - ErrorF ("winWindowProc - WM_SIZE - window w: %d h: %d, " - "new client area w: %d h: %d\n", - iWidth, iHeight, LOWORD (lParam), HIWORD (lParam)); - /* Subtract the frame size from the window size. */ iWidth -= 2 * GetSystemMetrics (SM_CXSIZEFRAME); iHeight -= (2 * GetSystemMetrics (SM_CYSIZEFRAME) @@ -416,6 +434,37 @@ winWindowProc (HWND hwnd, UINT message, } return 0; + case WM_ENTERSIZEMOVE: + ErrorF("winWindowProc - WM_ENTERSIZEMOVE\n"); + break; + + case WM_EXITSIZEMOVE: + ErrorF("winWindowProc - WM_EXITSIZEMOVE\n"); + + if (s_pScreenInfo->iResizeMode == resizeWithRandr) + { + /* Set screen size to match new client area, if it is different to current */ + RECT rcClient; + DWORD dwWidth, dwHeight; + + GetClientRect (hwnd, &rcClient); + dwWidth = rcClient.right - rcClient.left; + dwHeight = rcClient.bottom - rcClient.top; + + if ((s_pScreenInfo->dwWidth != dwWidth) || + (s_pScreenInfo->dwHeight != dwHeight)) + { + /* mm = dots * (25.4 mm / inch) / (dots / inch) */ + winDoRandRScreenSetSize(s_pScreen, + dwWidth, + dwHeight, + (dwWidth * 25.4) / monitorResolution, + (dwHeight * 25.4) / monitorResolution); + } + } + + break; + case WM_VSCROLL: { SCROLLINFO si; @@ -599,7 +648,7 @@ winWindowProc (HWND hwnd, UINT message, /* Can't do anything without screen info */ if (s_pScreenInfo == NULL - || !s_pScreenInfo->fScrollbars + || (s_pScreenInfo->iResizeMode != resizeWithScrollbars) || s_pScreenInfo->fFullScreen || !s_pScreenInfo->fDecoration #ifdef XWIN_MULTIWINDOWEXTWM diff --git a/include/Makefile.am b/include/Makefile.am index e76de05c3..6f63c764f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,9 +1,9 @@ if XORG sdk_HEADERS = \ XIstubs.h \ - bstore.h \ - bstorestr.h \ + Xprintf.h \ callback.h \ + client.h \ closestr.h \ closure.h \ colormap.h \ @@ -67,6 +67,6 @@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h \ + eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ xsha1.h diff --git a/include/XIstubs.h b/include/XIstubs.h index ba2f861cd..6ab82dff9 100644 --- a/include/XIstubs.h +++ b/include/XIstubs.h @@ -26,20 +26,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef XI_STUBS_H #define XI_STUBS_H 1 -extern _X_EXPORT void -CloseInputDevice ( - DeviceIntPtr /* d */, - ClientPtr /* client */); - -extern _X_EXPORT void -AddOtherInputDevices (void); - -extern _X_EXPORT void -OpenInputDevice ( - DeviceIntPtr /* dev */, - ClientPtr /* client */, - int * /* status */); - extern _X_EXPORT int SetDeviceMode ( ClientPtr /* client */, diff --git a/include/Xprintf.h b/include/Xprintf.h new file mode 100644 index 000000000..5177122c9 --- /dev/null +++ b/include/Xprintf.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef XPRINTF_H +#define XPRINTF_H + +#include +#include +#include + +#ifndef _X_RESTRICT_KYWD +# if defined(restrict) /* assume autoconf set it correctly */ || \ + (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ +# define _X_RESTRICT_KYWD restrict +# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ +# define _X_RESTRICT_KYWD __restrict__ +# else +# define _X_RESTRICT_KYWD +# endif +#endif + +/* + * These functions provide a portable implementation of the common (but not + * yet universal) asprintf & vasprintf routines to allocate a buffer big + * enough to sprintf the arguments to. The XNF variants terminate the server + * if the allocation fails. + * The buffer allocated is returned in the pointer provided in the first + * argument. The return value is the size of the allocated buffer, or -1 + * on failure. + */ +extern _X_EXPORT int Xasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + ...) _X_ATTRIBUTE_PRINTF(2,3); +extern _X_EXPORT int Xvasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + va_list va) _X_ATTRIBUTE_PRINTF(2,0); +extern _X_EXPORT int XNFasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + ...) _X_ATTRIBUTE_PRINTF(2,3); +extern _X_EXPORT int XNFvasprintf (char **ret, + const char * _X_RESTRICT_KYWD fmt, + va_list va) _X_ATTRIBUTE_PRINTF(2,0); + +#if !defined(HAVE_ASPRINTF) && !defined(HAVE_VASPRINTF) +# define asprintf Xasprintf +# define vasprintf Xvasprintf +#endif + +#endif /* XPRINTF_H */ diff --git a/include/bstore.h b/include/bstore.h deleted file mode 100644 index 843d6bb35..000000000 --- a/include/bstore.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies. The University of - * California makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - */ - -/* - * Moved here from mi to allow wrapping of lower level backing store functions. - * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org) - */ - -#ifndef _BSTORE_H_ -#define _BSTORE_H_ - -#include "bstorestr.h" - -#endif /* _BSTORE_H_ */ diff --git a/include/bstorestr.h b/include/bstorestr.h deleted file mode 100644 index cf7820ba4..000000000 --- a/include/bstorestr.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies. The University of - * California makes no representations about the suitability of this software - * for any purpose. It is provided "as is" without express or implied - * warranty. - */ - -/* - * Moved here from mi to allow wrapping of lower level backing store functions. - * -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org) - */ - -#ifndef _BSTORESTR_H_ -#define _BSTORESTR_H_ - -#include "gc.h" -#include "pixmap.h" -#include "region.h" -#include "window.h" - -typedef void (* BackingStoreSaveAreasProcPtr)( - PixmapPtr /*pBackingPixmap*/, - RegionPtr /*pObscured*/, - int /*x*/, - int /*y*/, - WindowPtr /*pWin*/); - -typedef void (* BackingStoreRestoreAreasProcPtr)( - PixmapPtr /*pBackingPixmap*/, - RegionPtr /*pExposed*/, - int /*x*/, - int /*y*/, - WindowPtr /*pWin*/); - -typedef void (* BackingStoreSetClipmaskRgnProcPtr)( - GCPtr /*pBackingGC*/, - RegionPtr /*pbackingCompositeClip*/); - -typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)(void); - -typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)(void); - -typedef struct _BSFuncs { - BackingStoreSaveAreasProcPtr SaveAreas; - BackingStoreRestoreAreasProcPtr RestoreAreas; - BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn; - BackingStoreGetImagePixmapProcPtr GetImagePixmap; - BackingStoreGetSpansPixmapProcPtr GetSpansPixmap; -} BSFuncRec, *BSFuncPtr; - -#endif /* _BSTORESTR_H_ */ diff --git a/include/client.h b/include/client.h new file mode 100644 index 000000000..aaafc7da6 --- /dev/null +++ b/include/client.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All + * rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* Author: Rami Ylimäki */ + +#ifndef CLIENT_H +#define CLIENT_H + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif /* HAVE_DIX_CONFIG_H */ +#include +#include + +/* Client IDs. Use GetClientPid, GetClientCmdName and GetClientCmdArgs + * instead of accessing the fields directly. */ +typedef struct { + pid_t pid; /* process ID, -1 if not available */ + const char *cmdname; /* process name, NULL if not available */ + const char *cmdargs; /* process arguments, NULL if not available */ +} ClientIdRec, *ClientIdPtr; + +struct _Client; + +/* Initialize and clean up. */ +void ReserveClientIds(struct _Client *client); +void ReleaseClientIds(struct _Client *client); + +/* Determine client IDs for caching. Exported on purpose for + * extensions such as SELinux. */ +extern _X_EXPORT pid_t DetermineClientPid(struct _Client *client); +extern _X_EXPORT void DetermineClientCmd(pid_t, const char **cmdname, const char **cmdargs); + +/* Query cached client IDs. Exported on purpose for drivers. */ +extern _X_EXPORT pid_t GetClientPid(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdName(struct _Client *client); +extern _X_EXPORT const char *GetClientCmdArgs(struct _Client *client); + +#endif /* CLIENT_H */ diff --git a/include/colormapst.h b/include/colormapst.h index 0ba5bd0b5..b597e2c60 100644 --- a/include/colormapst.h +++ b/include/colormapst.h @@ -103,12 +103,12 @@ typedef struct _ColormapRec { VisualPtr pVisual; short class; /* PseudoColor or DirectColor */ -#if defined(_XSERVER64) +#if defined(_LP64) short pad0; XID pad1; #endif XID mid; /* client's name for colormap */ -#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) +#if defined(_LP64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) XID pad2; #endif ScreenPtr pScreen; /* screen map is associated with */ diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 56baf020d..89a7c7354 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -33,8 +33,8 @@ /* Build for darwin with Quartz support */ #undef DARWIN_WITH_QUARTZ -/* Build kdrive-based fakelib server library */ -#undef XFAKELIB +/* Build the Android DDX */ +#undef DDXANDROID /* Use OsVendorVErrorF */ #undef DDXOSVERRORF @@ -130,8 +130,8 @@ /* Support application updating through sparkle. */ #undef XQUARTZ_SPARKLE -/* Prefix to use for launchd identifiers */ -#undef LAUNCHD_ID_PREFIX +/* Prefix to use for bundle identifiers */ +#undef BUNDLE_ID_PREFIX /* Build a standalone xpbproxy */ #undef STANDALONE_XPBPROXY @@ -139,6 +139,9 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM +/* Define to 1 if you have the libdispatch (GCD) available */ +#undef HAVE_LIBDISPATCH + /* Define to 1 if you have the `link' function. */ #undef HAVE_LINK @@ -246,6 +249,9 @@ /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + /* Support IPv6 for TCP connections */ #undef IPv6 @@ -279,6 +285,9 @@ /* Support X resource extension */ #undef RES +/* Support client ID tracking in X resource extension */ +#undef CLIENTIDS + /* Support MIT-SCREEN-SAVER extension */ #undef SCREENSAVER @@ -441,6 +450,9 @@ /* Define to 1 if you have the `ffs' function. */ #undef HAVE_FFS +/* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ +#undef TLS + /* Correctly set _XSERVER64 for OSX fat binaries */ #ifdef __APPLE__ #include "dix-config-apple-verbatim.h" diff --git a/include/dix.h b/include/dix.h index 7485e8ed4..9a111e8a7 100644 --- a/include/dix.h +++ b/include/dix.h @@ -372,6 +372,13 @@ extern void AllowSome( extern void ReleaseActiveGrabs( ClientPtr client); +extern GrabPtr CheckPassiveGrabsOnWindow( + WindowPtr /* pWin */, + DeviceIntPtr /* device */, + InternalEvent * /* event */, + BOOL /* checkCore */, + BOOL /* activate */); + extern _X_EXPORT int DeliverEventsToWindow( DeviceIntPtr /* pWin */, WindowPtr /* pWin */, @@ -408,7 +415,7 @@ extern void DeliverFocusedEvent( InternalEvent* /* event */, WindowPtr /* window */); -extern void DeliverGrabbedEvent( +extern int DeliverGrabbedEvent( InternalEvent* /* event */, DeviceIntPtr /* thisDev */, Bool /* deactivateGrab */); @@ -563,40 +570,10 @@ extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev); extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev); extern Bool IsPointerEvent(InternalEvent *event); extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev); +extern _X_EXPORT Bool IsFloating(DeviceIntPtr dev); extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what); extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what); - -/* - * These are deprecated compatibility functions and will be removed soon! - * Please use the noted replacements instead. - */ -/* replaced by dixLookupWindow */ -extern _X_EXPORT WindowPtr SecurityLookupWindow( - XID id, - ClientPtr client, - Mask access_mode); -/* replaced by dixLookupWindow */ -extern _X_EXPORT WindowPtr LookupWindow( - XID id, - ClientPtr client); - -/* replaced by dixLookupDrawable */ -extern _X_EXPORT pointer SecurityLookupDrawable( - XID id, - ClientPtr client, - Mask access_mode); - -/* replaced by dixLookupDrawable */ -extern _X_EXPORT pointer LookupDrawable( - XID id, - ClientPtr client); - -/* replaced by dixLookupClient */ -extern _X_EXPORT ClientPtr LookupClient( - XID id, - ClientPtr client); - #endif /* DIX_H */ diff --git a/include/dixstruct.h b/include/dixstruct.h index 8547b16ce..443e8b0ae 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -24,6 +24,7 @@ SOFTWARE. #ifndef DIXSTRUCT_H #define DIXSTRUCT_H +#include "client.h" #include "dix.h" #include "resource.h" #include "cursor.h" @@ -121,6 +122,7 @@ typedef struct _Client { long smart_check_tick; DeviceIntPtr clientPtr; + ClientIdPtr clientIds; } ClientRec; /* diff --git a/include/eventconvert.h b/include/eventconvert.h index b1196a00e..b000abc4b 100644 --- a/include/eventconvert.h +++ b/include/eventconvert.h @@ -30,7 +30,7 @@ #define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16)) -_X_EXPORT int EventToCore(InternalEvent *event, xEvent *core); +_X_EXPORT int EventToCore(InternalEvent *event, xEvent **core, int *count); _X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count); _X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi); _X_INTERNAL int GetCoreType(InternalEvent* ev); diff --git a/include/eventstr.h b/include/eventstr.h index 377cceba2..049688ca0 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -68,10 +68,6 @@ enum EventType { ET_Internal = 0xFF /* First byte */ }; -#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \ - FatalError("Wrong event type %d.\n", \ - ((InternalEvent*)(ev))->any.header); - /** * Used for ALL input device events internal in the server until * copied into the matching protocol event. @@ -177,7 +173,7 @@ struct _DGAEvent Time time; /**< Time in ms */ int subtype; /**< KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify */ - int detail; /**< Relative x coordinate */ + int detail; /**< Button number or key code */ int dx; /**< Relative x coordinate */ int dy; /**< Relative y coordinate */ int screen; /**< Screen number this event applies to */ diff --git a/include/exevents.h b/include/exevents.h index 39e1c70fe..2b226986b 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -48,7 +48,8 @@ extern _X_EXPORT void InitValuatorAxisStruct( int /* maxval */, int /* resolution */, int /* min_res */, - int /* max_res */); + int /* max_res */, + int /* mode */); /* Input device properties */ extern _X_EXPORT void XIDeleteAllDeviceProperties( @@ -68,7 +69,7 @@ extern _X_EXPORT int XIChangeDeviceProperty( int /* format*/, int /* mode*/, unsigned long /* len*/, - pointer /* value*/, + const pointer /* value*/, Bool /* sendevent*/ ); @@ -146,10 +147,6 @@ typedef struct _GrabParameters { } GrabParameters; -extern void -RegisterOtherDevice ( - DeviceIntPtr /* device */); - extern int UpdateDeviceState ( DeviceIntPtr /* device */, @@ -310,6 +307,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, unsigned int len, unsigned char* mask); extern int -XICheckInvalidMaskBits(unsigned char *mask, int len); +XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len); #endif /* EXEVENTS_H */ diff --git a/include/input.h b/include/input.h index ffb1c33fa..56847ed8d 100644 --- a/include/input.h +++ b/include/input.h @@ -102,22 +102,15 @@ typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; typedef struct _DeviceIntRec *DeviceIntPtr; +typedef struct _ValuatorClassRec *ValuatorClassPtr; typedef struct _ClassesRec *ClassesPtr; +typedef struct _SpriteRec *SpritePtr; typedef union _GrabMask GrabMask; -typedef struct _EventList { - xEvent* event; - int evlen; /* length of allocated memory for event in bytes. This is not - the actual length of the event. The event's actual length is - 32 for standard events or 32 + - ((xGenericEvent*)event)->length * 4 for GenericEvents. - For events in the EQ, the length is - ((InternalEvent*)event)->u.any.length */ -} EventList, *EventListPtr; +typedef struct _ValuatorMask ValuatorMask; /* The DIX stores incoming input events in this list */ -extern EventListPtr InputEventList; -extern int InputEventListLen; +extern InternalEvent* InputEventList; typedef int (*DeviceProc)( DeviceIntPtr /*device*/, @@ -140,15 +133,18 @@ typedef void (*DeviceUnwrapProc)( /* pointer acceleration handling */ typedef void (*PointerAccelSchemeProc)( - DeviceIntPtr /*pDev*/, - int /*first_valuator*/, - int /*num_valuators*/, - int* /*valuators*/, - int /*evtime*/); + DeviceIntPtr /*device*/, + ValuatorMask* /*valuators*/, + CARD32 /*evtime*/); typedef void (*DeviceCallbackProc)( DeviceIntPtr /*pDev*/); +struct _ValuatorAccelerationRec; +typedef Bool (*PointerAccelSchemeInitProc)( + DeviceIntPtr /*dev*/, + struct _ValuatorAccelerationRec* /*protoScheme*/); + typedef struct _DeviceRec { pointer devicePrivate; ProcessInputProc processInputProc; /* current */ @@ -274,12 +270,6 @@ extern _X_EXPORT int RemoveDevice( extern _X_EXPORT int NumMotionEvents(void); -extern void RegisterPointerDevice( - DeviceIntPtr /*device*/); - -extern void RegisterKeyboardDevice( - DeviceIntPtr /*device*/); - extern _X_EXPORT int dixLookupDevice( DeviceIntPtr * /* dev */, int /* id */, @@ -300,6 +290,10 @@ extern _X_EXPORT Bool InitButtonClassDeviceStruct( Atom* /* labels */, CARD8* /*map*/); +extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass( + ValuatorClassPtr src, + int numAxes); + extern _X_EXPORT Bool InitValuatorClassDeviceStruct( DeviceIntPtr /*device*/, int /*numAxes*/, @@ -311,9 +305,6 @@ extern _X_EXPORT Bool InitPointerAccelerationScheme( DeviceIntPtr /*dev*/, int /*scheme*/); -extern _X_EXPORT Bool InitAbsoluteClassDeviceStruct( - DeviceIntPtr /*device*/); - extern _X_EXPORT Bool InitFocusClassDeviceStruct( DeviceIntPtr /*device*/); @@ -431,52 +422,57 @@ extern _X_EXPORT void CloseInput(void); extern _X_EXPORT int GetMaximumEventsNum(void); -extern _X_EXPORT int GetEventList(EventListPtr* list); -extern _X_EXPORT EventListPtr InitEventList(int num_events); -extern _X_EXPORT void FreeEventList(EventListPtr list, int num_events); +extern _X_EXPORT InternalEvent *InitEventList(int num_events); +extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events); -extern void CreateClassesChangedEvent(EventListPtr event, +extern void CreateClassesChangedEvent(InternalEvent *event, DeviceIntPtr master, DeviceIntPtr slave, int type); -extern EventListPtr UpdateFromMaster( - EventListPtr events, +extern InternalEvent * UpdateFromMaster( + InternalEvent *events, DeviceIntPtr pDev, int type, int *num_events); extern _X_EXPORT int GetPointerEvents( - EventListPtr events, + InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, int flags, - int first_valuator, - int num_valuators, - int *valuators); + const ValuatorMask *mask); + +extern _X_EXPORT void QueuePointerEvents( + DeviceIntPtr pDev, + int type, + int buttons, + int flags, + const ValuatorMask *mask); extern _X_EXPORT int GetKeyboardEvents( - EventListPtr events, + InternalEvent *events, DeviceIntPtr pDev, int type, - int key_code); + int key_code, + const ValuatorMask *mask); -extern int GetKeyboardValuatorEvents( - EventListPtr events, +extern _X_EXPORT void QueueKeyboardEvents( DeviceIntPtr pDev, int type, int key_code, - int first_valuator, - int num_valuator, - int *valuators); + const ValuatorMask *mask); extern int GetProximityEvents( - EventListPtr events, + InternalEvent *events, + DeviceIntPtr pDev, + int type, + const ValuatorMask *mask); + +extern void QueueProximityEvents( DeviceIntPtr pDev, int type, - int first_valuator, - int num_valuators, - int *valuators); + const ValuatorMask *mask); extern void PostSyntheticMotion( DeviceIntPtr pDev, @@ -499,6 +495,8 @@ extern _X_EXPORT int GetMotionHistory( ScreenPtr pScreen, BOOL core); +extern void ReleaseButtonsAndKeys(DeviceIntPtr dev); + extern int AttachDevice(ClientPtr client, DeviceIntPtr slave, DeviceIntPtr master); @@ -535,13 +533,28 @@ extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attr extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs); /* misc event helpers */ +extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients); extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event); extern Mask GetWindowXI2Mask(DeviceIntPtr dev, WindowPtr win, xEvent* ev); -void FixUpEventFromWindow(DeviceIntPtr pDev, +void FixUpEventFromWindow(SpritePtr pSprite, xEvent *xE, WindowPtr pWin, Window child, Bool calcChild); +extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y); +extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, + WindowPtr win); +/** + * Masks specifying the type of event to deliver for an InternalEvent; used + * by EventIsDeliverable. + * @defgroup EventIsDeliverable return flags + * @{ + */ +#define EVENT_XI1_MASK (1 << 0) /**< XI1.x event */ +#define EVENT_CORE_MASK (1 << 1) /**< Core event */ +#define EVENT_DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set */ +#define EVENT_XI2_MASK (1 << 3) /**< XI2 mask set on window */ +/* @} */ /* Implemented by the DDX. */ extern _X_EXPORT int NewInputDeviceRequest( @@ -556,8 +569,29 @@ extern _X_EXPORT void DDXRingBell( int pitch, int duration); +#define VALUATOR_MODE_ALL_AXES -1 +extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis); +extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode); + /* Set to TRUE by default - os/utils.c sets it to FALSE on user request, xfixes/cursor.c uses it to determine if the cursor is enabled */ extern Bool EnableCursor; +extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators); +extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask); +extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask, + int first_valuator, int num_valuators, + const int* valuators); +extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, + int valuator, + int data); +extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask); +extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask); +extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit); +extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit); +extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask); +extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest, + const ValuatorMask *src); +extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum); + #endif /* INPUT_H */ diff --git a/include/inputstr.h b/include/inputstr.h index 1b504e939..00f72c260 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -57,9 +57,10 @@ SOFTWARE. #include "geext.h" #include "privates.h" -#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) +#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) +extern _X_EXPORT int CountBits(const uint8_t *mask, int len); #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) @@ -202,6 +203,47 @@ typedef struct _GrabRec { unsigned char xi2mask[EMASKSIZE][XI2MASKSIZE]; } GrabRec; +/** + * Sprite information for a device. + */ +typedef struct _SpriteRec { + CursorPtr current; + BoxRec hotLimits; /* logical constraints of hot spot */ + Bool confined; /* confined to screen */ + RegionPtr hotShape; /* additional logical shape constraint */ + BoxRec physLimits; /* physical constraints of hot spot */ + WindowPtr win; /* window of logical position */ + HotSpot hot; /* logical pointer position */ + HotSpot hotPhys; /* physical pointer position */ +#ifdef PANORAMIX + ScreenPtr screen; /* all others are in Screen 0 coordinates */ + RegionRec Reg1; /* Region 1 for confining motion */ + RegionRec Reg2; /* Region 2 for confining virtual motion */ + WindowPtr windows[MAXSCREENS]; + WindowPtr confineWin; /* confine window */ +#endif + /* The window trace information is used at dix/events.c to avoid having + * to compute all the windows between the root and the current pointer + * window each time a button or key goes down. The grabs on each of those + * windows must be checked. + * spriteTraces should only be used at dix/events.c! */ + WindowPtr *spriteTrace; + int spriteTraceSize; + int spriteTraceGood; + + /* Due to delays between event generation and event processing, it is + * possible that the pointer has crossed screen boundaries between the + * time in which it begins generating events and the time when + * those events are processed. + * + * pEnqueueScreen: screen the pointer was on when the event was generated + * pDequeueScreen: screen the pointer was on when the event is processed + */ + ScreenPtr pEnqueueScreen; + ScreenPtr pDequeueScreen; + +} SpriteRec; + typedef struct _KeyClassRec { int sourceid; CARD8 down[DOWN_LENGTH]; @@ -217,12 +259,14 @@ typedef struct _AxisInfo { int min_value; int max_value; Atom label; + CARD8 mode; } AxisInfo, *AxisInfoPtr; typedef struct _ValuatorAccelerationRec { int number; PointerAccelSchemeProc AccelSchemeProc; void *accelData; /* at disposal of AccelScheme */ + PointerAccelSchemeInitProc AccelInitProc; DeviceCallbackProc AccelCleanupProc; } ValuatorAccelerationRec, *ValuatorAccelerationPtr; @@ -238,9 +282,8 @@ typedef struct _ValuatorClassRec { AxisInfoPtr axes; unsigned short numAxes; double *axisVal; /* always absolute, but device-coord system */ - CARD8 mode; ValuatorAccelerationRec accelScheme; -} ValuatorClassRec, *ValuatorClassPtr; +} ValuatorClassRec; typedef struct _ButtonClassRec { int sourceid; @@ -271,30 +314,9 @@ typedef struct _FocusClassRec { typedef struct _ProximityClassRec { int sourceid; - char pad; + char in_proximity; } ProximityClassRec, *ProximityClassPtr; -typedef struct _AbsoluteClassRec { - int sourceid; - /* Calibration. */ - int min_x; - int max_x; - int min_y; - int max_y; - int flip_x; - int flip_y; - int rotation; - int button_threshold; - - /* Area. */ - int offset_x; - int offset_y; - int width; - int height; - int screen; - XID following; -} AbsoluteClassRec, *AbsoluteClassPtr; - typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr; typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr; typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr; @@ -349,7 +371,6 @@ typedef struct _ClassesRec { ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; - AbsoluteClassPtr absolute; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; @@ -359,47 +380,6 @@ typedef struct _ClassesRec { } ClassesRec; -/** - * Sprite information for a device. - */ -typedef struct { - CursorPtr current; - BoxRec hotLimits; /* logical constraints of hot spot */ - Bool confined; /* confined to screen */ - RegionPtr hotShape; /* additional logical shape constraint */ - BoxRec physLimits; /* physical constraints of hot spot */ - WindowPtr win; /* window of logical position */ - HotSpot hot; /* logical pointer position */ - HotSpot hotPhys; /* physical pointer position */ -#ifdef PANORAMIX - ScreenPtr screen; /* all others are in Screen 0 coordinates */ - RegionRec Reg1; /* Region 1 for confining motion */ - RegionRec Reg2; /* Region 2 for confining virtual motion */ - WindowPtr windows[MAXSCREENS]; - WindowPtr confineWin; /* confine window */ -#endif - /* The window trace information is used at dix/events.c to avoid having - * to compute all the windows between the root and the current pointer - * window each time a button or key goes down. The grabs on each of those - * windows must be checked. - * spriteTraces should only be used at dix/events.c! */ - WindowPtr *spriteTrace; - int spriteTraceSize; - int spriteTraceGood; - - /* Due to delays between event generation and event processing, it is - * possible that the pointer has crossed screen boundaries between the - * time in which it begins generating events and the time when - * those events are processed. - * - * pEnqueueScreen: screen the pointer was on when the event was generated - * pDequeueScreen: screen the pointer was on when the event is processed - */ - ScreenPtr pEnqueueScreen; - ScreenPtr pDequeueScreen; - -} SpriteRec, *SpritePtr; - /* Device properties */ typedef struct _XIPropertyValue { @@ -492,6 +472,7 @@ typedef struct _SpriteInfoRec { #define MASTER_POINTER 1 #define MASTER_KEYBOARD 2 #define SLAVE 3 +#define MASTER_ATTACHED 4 /* special type for GetMaster */ typedef struct _DeviceIntRec { DeviceRec public; @@ -514,7 +495,6 @@ typedef struct _DeviceIntRec { ButtonClassPtr button; FocusClassPtr focus; ProximityClassPtr proximity; - AbsoluteClassPtr absolute; KbdFeedbackPtr kbdfeed; PtrFeedbackPtr ptrfeed; IntegerFeedbackPtr intfeed; @@ -528,10 +508,8 @@ typedef struct _DeviceIntRec { PrivateRec *devPrivates; DeviceUnwrapProc unwrapProc; SpriteInfoPtr spriteInfo; - union { - DeviceIntPtr master; /* master device */ - DeviceIntPtr lastSlave; /* last slave device used */ - } u; + DeviceIntPtr master; /* master device */ + DeviceIntPtr lastSlave; /* last slave device used */ /* last valuator values recorded, not posted to client; * for slave devices, valuators is in device coordinates @@ -611,4 +589,14 @@ typedef struct _EventSyncInfo { extern EventSyncInfoRec syncEvents; +/** + * Given a sprite, returns the window at the bottom of the trace (i.e. the + * furthest window from the root). + */ +static inline WindowPtr DeepestSpriteWin(SpritePtr sprite) +{ + assert(sprite->spriteTraceGood > 0); + return sprite->spriteTrace[sprite->spriteTraceGood - 1]; +} + #endif /* INPUTSTRUCT_H */ diff --git a/hw/xfree86/xf8_16bpp/cfb8_16.h b/include/inpututils.h similarity index 73% rename from hw/xfree86/xf8_16bpp/cfb8_16.h rename to include/inpututils.h index b6ab955f3..92a754327 100644 --- a/hw/xfree86/xf8_16bpp/cfb8_16.h +++ b/include/inpututils.h @@ -1,5 +1,5 @@ /* - * Copyright 2006 Adam Jackson. + * Copyright © 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -19,19 +19,24 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. + * */ -#ifndef _CFB8_16_H -#define _CFB8_16_H +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + +#ifndef INPUTUTILS_H +#define INPUTUTILS_H -#include "regionstr.h" -#include "windowstr.h" +#include "input.h" -/* this has to stay misnamed for ABI reasons */ +struct _ValuatorMask { + int8_t last_bit; /* highest bit set in mask */ + uint8_t mask[(MAX_VALUATORS + 7)/8]; + int valuators[MAX_VALUATORS]; /* valuator data */ +}; -extern _X_EXPORT Bool -cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8, - int xsize, int ysize, int dpix, int dpiy, - int width16, int width8); +extern void verify_internal_event(const InternalEvent *ev); -#endif /* _CFB8_16_H */ +#endif diff --git a/include/list.h b/include/list.h index 4ce20a866..5933b973d 100644 --- a/include/list.h +++ b/include/list.h @@ -26,11 +26,102 @@ #ifndef _LIST_H_ #define _LIST_H_ -/* classic doubly-link circular list */ +/** + * @file Classic doubly-link circular list implementation. + * + * Example: + * We need to keep a list of struct foo in the parent struct bar, i.e. what + * we want is something like this. + * + * struct bar { + * ... + * struct foo *foos; -----> struct foo {}, struct foo {}, struct foo{} + * ... + * } + * + * We need one list head in bar and a list element in all foos (both are of + * data type 'struct list'). + * + * struct bar { + * ... + * struct list foos; + * ... + * } + * + * struct foo { + * ... + * struct list entry; + * ... + * } + * + * Now we initialize the list head: + * + * struct bar bar; + * ... + * list_init(&bar.foos); + * + * Then we create the first element and add it to this list: + * + * struct foo *foo = malloc(...); + * .... + * list_add(&foo->entry, &bar.foos); + * + * Repeat the above for each element you want to add to the list. Deleting + * works with the element itself. + * list_del(&foo->entry); + * free(foo); + * + * Note: calling list_del(&bar.foos) will set bar.foos to an empty + * list again. + * + * Looping through the list requires a 'struct foo' as iterator and the + * name of the field the subnodes use. + * + * struct foo *iterator; + * list_for_each_entry(iterator, &bar.foos, entry) { + * if (iterator->something == ...) + * ... + * } + * + * Note: You must not call list_del() on the iterator if you continue the + * loop. You need to run the safe for-each loop instead: + * + * struct foo *iterator, *next; + * list_for_each_entry_safe(iterator, next, &bar.foos, entry) { + * if (...) + * list_del(&iterator->entry); + * } + * + */ + +/** + * The linkage struct for list nodes. This struct must be part of your + * to-be-linked struct. + * + * Example: + * struct foo { + * int a; + * void *b; + * struct list *mylist; + * } + * + * Position and name of the struct list field is irrelevant. + * There are no requirements that elements of a list are of the same type. + * There are no requirements for a list head, any struct list can be a list + * head. + */ struct list { struct list *next, *prev; }; +/** + * Initialize the list as an empty list. + * + * Example: + * list_init(&foo->mylist); + * + * @param The list to initialized. + */ static void list_init(struct list *list) { @@ -48,6 +139,20 @@ __list_add(struct list *entry, prev->next = entry; } +/** + * Insert a new element after the given list head. + * The list changes from: + * head → some element → ... + * to + * head → new element → older element → ... + * + * Example: + * struct foo *newfoo = malloc(...); + * list_add(&newfoo->mylist, &foo->mylist); + * + * @param entry The new element to prepend to the list. + * @param head The existing list. + */ static inline void list_add(struct list *entry, struct list *head) { @@ -61,6 +166,20 @@ __list_del(struct list *prev, struct list *next) prev->next = next; } +/** + * Remove the element from the list it is in. Using this function will reset + * the pointers to/from this element so it is removed from the list. It does + * NOT free the element itself or manipulate it otherwise. + * + * Using list_del on a pure list head (like in the example at the top of + * this file) will NOT remove the first element from + * the list but rather reset the list as empty list. + * + * Example: + * list_del(&newfoo->mylist); + * + * @param entry The element to remove. + */ static inline void list_del(struct list *entry) { @@ -68,32 +187,91 @@ list_del(struct list *entry) list_init(entry); } +/** + * Check if the list is empty. + * + * Example: + * list_is_empty(&foo->mylist); + * + * @return True if the list contains one or more elements or False otherwise. + */ static inline Bool list_is_empty(struct list *head) { return head->next == head; } +/** + * Returns a pointer to the container of this list element. + * + * Example: + * struct foo* f; + * f = container_of(&foo->mylist, struct foo, mylist); + * assert(f == foo); + * + * @param ptr Pointer to the struct list. + * @param type Data type of the list element. + * @param member Member name of the struct list field in the list element. + * @return A pointer to the data struct containing the list head. + */ #ifndef container_of #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - (char *) &((type *)0)->member) #endif +/** + * Alias of container_of + */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) +/** + * Retrieve the first list entry for the given list pointer. + * + * Example: + * struct foo *first; + * first = list_first_entry(&foo->mylist, struct foo, mylist); + * + * @param ptr The list head + * @param type Data type of the list element to retrieve + * @param member Member name of the struct list field in the list element. + * @return A pointer to the first list element. + */ #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) #define __container_of(ptr, sample, member) \ (void *)((char *)(ptr) \ - ((char *)&(sample)->member - (char *)(sample))) - +/** + * Loop through the list given by head and set pos to struct in the list. + * + * Example: + * struct foo *iterator; + * list_for_each_entry(iterator, &foo->mylist, mylist) { + * [modify iterator] + * } + * + * This macro is not safe for node deletion. Use list_for_each_entry_safe + * instead. + * + * @param pos Iterator variable of the type of the list elements. + * @param head List head + * @param member Member name of the struct list in the list elements. + * + */ #define list_for_each_entry(pos, head, member) \ for (pos = __container_of((head)->next, pos, member); \ &pos->member != (head); \ pos = __container_of(pos->member.next, pos, member)) +/** + * Loop through the list, keeping a backup pointer to the element. This + * macro allows for the deletion of a list element while looping through the + * list. + * + * See list_for_each_entry for more details. + */ #define list_for_each_entry_safe(pos, tmp, head, member) \ for (pos = __container_of((head)->next, pos, member), \ tmp = __container_of(pos->member.next, pos, member); \ diff --git a/include/misc.h b/include/misc.h index 62d813e0c..bdcc8cc1e 100644 --- a/include/misc.h +++ b/include/misc.h @@ -79,6 +79,7 @@ OF THIS SOFTWARE. #include #include +#include #ifndef MAXSCREENS #define MAXSCREENS 16 @@ -91,9 +92,7 @@ OF THIS SOFTWARE. #define EXTENSION_EVENT_BASE 64 #define EXTENSION_BASE 128 -typedef unsigned long PIXEL; -typedef unsigned long ATOM; - +typedef uint32_t ATOM; #ifndef TRUE #define TRUE 1 @@ -180,6 +179,17 @@ typedef struct _xReq *xReqPtr; #endif +#ifndef PATH_MAX +#include +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif +#endif + /** * Calculate the number of bytes needed to hold bits. * @param bits The minimum number of bits needed. @@ -213,6 +223,24 @@ pad_to_int32(const int bytes) { extern char** xstrtokenize(const char *str, const char* separators); +/** + * Compare the two version numbers comprising of major.minor. + * + * @return A value less than 0 if a is less than b, 0 if a is equal to b, + * or a value greater than 0 + */ +static inline int +version_compare(uint16_t a_major, uint16_t a_minor, + uint16_t b_major, uint16_t b_minor) +{ + int a, b; + + a = a_major << 16 | a_minor; + b = b_major << 16 | b_minor; + + return (a - b); +} + /* some macros to help swap requests, replies, and events */ #define LengthRestB(stuff) \ diff --git a/include/opaque.h b/include/opaque.h index dfe440cdc..5c707172c 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -56,9 +56,6 @@ extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore; extern _X_EXPORT Bool PartialNetwork; extern _X_EXPORT Bool RunFromSigStopParent; -#ifndef NOLOGOHACK -extern _X_EXPORT int logoScreenSaver; -#endif #ifdef RLIMIT_DATA extern _X_EXPORT int limitDataSpace; #endif @@ -72,6 +69,7 @@ extern _X_EXPORT Bool defeatAccessControl; extern _X_EXPORT long maxBigRequestSize; extern _X_EXPORT Bool party_like_its_1989; extern _X_EXPORT Bool whiteRoot; +extern _X_EXPORT Bool bgNoneRoot; extern _X_EXPORT Bool CoreDump; diff --git a/include/os.h b/include/os.h index efa202c6c..506dc5d2a 100644 --- a/include/os.h +++ b/include/os.h @@ -51,6 +51,7 @@ SOFTWARE. #include "misc.h" #include +#include #define SCREEN_SAVER_ON 0 #define SCREEN_SAVER_OFF 1 @@ -263,10 +264,14 @@ extern _X_EXPORT char *Xstrdup(const char *s); */ extern _X_EXPORT char *XNFstrdup(const char *s); -extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va); -extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va); +/* Include new X*asprintf API */ +#include "Xprintf.h" + +/* Older api deprecated in favor of the asprintf versions */ +extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; +extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_DEPRECATED; +extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va)_X_ATTRIBUTE_PRINTF(1,0) _X_DEPRECATED; typedef void (*OsSigHandlerPtr)(int /* sig */); typedef int (*OsSigWrapperPtr)(int /* sig */); @@ -441,29 +446,6 @@ extern _X_EXPORT int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /* extern _X_EXPORT void ddxUseMsg(void); -/* int ReqLen(xReq *req, ClientPtr client) - * Given a pointer to a *complete* request, return its length in bytes. - * Note that if the request is a big request (as defined in the Big - * Requests extension), the macro lies by returning 4 less than the - * length that it actually occupies in the request buffer. This is so you - * can blindly compare the length with the various sz_ constants - * in Xproto.h without having to know/care about big requests. - */ -#define ReqLen(_pxReq, _client) \ - ((_pxReq->length ? \ - (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \ - : ((_client->swapped ? \ - lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \ - ) << 2) - -/* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr) - * Cast the given request to one of type otherReqTypePtr to access - * fields beyond the length field. - */ -#define CastxReq(_pxReq, otherReqTypePtr) \ - (_pxReq->length ? (otherReqTypePtr)_pxReq \ - : (otherReqTypePtr)(((CARD32*)_pxReq)+1)) - /* stuff for ReplyCallback */ extern _X_EXPORT CallbackListPtr ReplyCallback; typedef struct { @@ -528,17 +510,17 @@ typedef enum { extern _X_EXPORT const char *LogInit(const char *fname, const char *backup); extern _X_EXPORT void LogClose(void); extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value); -extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args); +extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args) _X_ATTRIBUTE_PRINTF(2,0); extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3); extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format, - va_list args); + va_list args) _X_ATTRIBUTE_PRINTF(3,0); extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3); extern _X_EXPORT void FreeAuditTimer(void); extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT void VAuditF(const char *f, va_list args); +extern _X_EXPORT void VAuditF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1,0); extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN; #ifdef DEBUG @@ -547,9 +529,9 @@ extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X #define DebugF(...) /* */ #endif -extern _X_EXPORT void VErrorF(const char *f, va_list args); +extern _X_EXPORT void VErrorF(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1,0); extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); -extern _X_EXPORT void Error(char *str); +extern _X_EXPORT void Error(const char *str); extern _X_EXPORT void LogPrintMarkers(void); extern _X_EXPORT void xorg_backtrace(void); diff --git a/include/privates.h b/include/privates.h index 9fb6ae84e..2b0040cba 100644 --- a/include/privates.h +++ b/include/privates.h @@ -51,6 +51,7 @@ typedef enum { PRIVATE_GLYPH, PRIVATE_GLYPHSET, PRIVATE_PICTURE, + PRIVATE_SYNC_FENCE, /* last private type */ PRIVATE_LAST, @@ -194,7 +195,7 @@ dixGetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenP static inline void dixSetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen, pointer val) { - return dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val); + dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val); } static inline pointer diff --git a/include/propertyst.h b/include/propertyst.h index fd1148eb7..1edd11d5d 100644 --- a/include/propertyst.h +++ b/include/propertyst.h @@ -58,8 +58,8 @@ typedef struct _Property { struct _Property *next; ATOM propertyName; ATOM type; /* ignored by server */ - short format; /* format of data for swapping - 8,16,32 */ - long size; /* size of data in (format/8) bytes */ + uint32_t format; /* format of data for swapping - 8,16,32 */ + uint32_t size; /* size of data in (format/8) bytes */ pointer data; /* private to client */ PrivateRec *devPrivates; } PropertyRec; diff --git a/include/protocol-versions.h b/include/protocol-versions.h index c67446548..7b7a9f53c 100644 --- a/include/protocol-versions.h +++ b/include/protocol-versions.h @@ -95,15 +95,15 @@ #define SERVER_SHM_MAJOR_VERSION 1 #define SERVER_SHM_MINOR_VERSION 1 +/* Sync */ +#define SERVER_SYNC_MAJOR_VERSION 3 +#define SERVER_SYNC_MINOR_VERSION 1 + /* Windows WM */ #define SERVER_WINDOWSWM_MAJOR_VERSION 1 #define SERVER_WINDOWSWM_MINOR_VERSION 0 #define SERVER_WINDOWSWM_PATCH_VERSION 0 -/* Xcalibrate */ -#define SERVER_XCALIBRATE_MAJOR_VERSION 0 -#define SERVER_XCALIBRATE_MINOR_VERSION 1 - /* DGA */ #define SERVER_XDGA_MAJOR_VERSION 2 #define SERVER_XDGA_MINOR_VERSION 0 @@ -122,7 +122,7 @@ #define SERVER_XF86VIDMODE_MINOR_VERSION 2 /* Fixes */ -#define SERVER_XFIXES_MAJOR_VERSION 4 +#define SERVER_XFIXES_MAJOR_VERSION 5 #define SERVER_XFIXES_MINOR_VERSION 0 /* X Input */ diff --git a/include/ptrveloc.h b/include/ptrveloc.h index 6f999a88f..6ca309c8c 100644 --- a/include/ptrveloc.h +++ b/include/ptrveloc.h @@ -1,6 +1,6 @@ /* * - * Copyright © 2006-2009 Simon Thum simon dot thum at gmx dot de + * Copyright © 2006-2011 Simon Thum simon dot thum at gmx dot de * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -25,7 +25,7 @@ #ifndef POINTERVELOCITY_H #define POINTERVELOCITY_H -#include /* DeviceIntPtr */ +#include /* constants for acceleration profiles */ @@ -62,9 +62,6 @@ typedef struct _MotionTracker { int dir; /* initial direction bitfield */ } MotionTracker, *MotionTrackerPtr; -/* number of properties for predictable acceleration */ -#define NPROPS_PREDICTABLE_ACCEL 4 - /** * Contains all data needed to implement mouse ballistics */ @@ -91,16 +88,25 @@ typedef struct _DeviceVelocityRec { struct { /* to be able to query this information */ int profile_number; } statistics; - long prop_handlers[NPROPS_PREDICTABLE_ACCEL]; } DeviceVelocityRec, *DeviceVelocityPtr; +/** + * contains the run-time data for the predictable scheme, that is, a + * DeviceVelocityPtr and the property handlers. + */ +typedef struct _PredictableAccelSchemeRec { + DeviceVelocityPtr vel; + long* prop_handlers; + int num_prop_handlers; +} PredictableAccelSchemeRec, *PredictableAccelSchemePtr; + extern _X_EXPORT void InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void InitTrackers(DeviceVelocityPtr vel, int ntracker); -extern _X_EXPORT short +extern _X_EXPORT BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, int dx, int dy, int time); extern _X_EXPORT float @@ -110,12 +116,6 @@ BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, extern _X_EXPORT void FreeVelocityData(DeviceVelocityPtr vel); -extern _X_INTERNAL BOOL -InitializePredictableAccelerationProperties(DeviceIntPtr dev); - -extern _X_INTERNAL BOOL -DeletePredictableAccelerationProperties(DeviceIntPtr dev); - extern _X_EXPORT int SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); @@ -129,12 +129,16 @@ SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, extern _X_INTERNAL void AccelerationDefaultCleanup(DeviceIntPtr dev); +extern _X_INTERNAL Bool +InitPredictableAccelerationScheme(DeviceIntPtr dev, + struct _ValuatorAccelerationRec* protoScheme); + extern _X_INTERNAL void -acceleratePointerPredictable(DeviceIntPtr dev, int first_valuator, - int num_valuators, int *valuators, int evtime); +acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val, + CARD32 evtime); extern _X_INTERNAL void -acceleratePointerLightweight(DeviceIntPtr dev, int first_valuator, - int num_valuators, int *valuators, int ignored); +acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val, + CARD32 evtime); #endif /* POINTERVELOCITY_H */ diff --git a/include/regionstr.h b/include/regionstr.h index 627941b36..3dfef5c83 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -132,6 +132,11 @@ static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) } } +static inline Bool RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes) +{ + return pixman_region_init_rects (pReg, boxes, nBoxes); +} + static inline void RegionUninit(RegionPtr _pReg) { if ((_pReg)->data && (_pReg)->data->size) { @@ -318,16 +323,6 @@ extern _X_EXPORT Bool RegionIsValid( extern _X_EXPORT void RegionPrint( RegionPtr /*pReg*/); -extern _X_EXPORT int RegionClipSpans( - RegionPtr /*prgnDst*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - DDXPointPtr /*pptNew*/, - int * /*pwidthNew*/, - int /*fSorted*/ -); - #define INCLUDE_LEGACY_REGION_DEFINES #ifdef INCLUDE_LEGACY_REGION_DEFINES diff --git a/include/resource.h b/include/resource.h index 0c5a59dbc..772b7b877 100644 --- a/include/resource.h +++ b/include/resource.h @@ -56,7 +56,7 @@ SOFTWARE. /* classes for Resource routines */ -typedef unsigned long RESTYPE; +typedef uint32_t RESTYPE; #define RC_VANILLA ((RESTYPE)0) #define RC_CACHED ((RESTYPE)1<<31) @@ -121,6 +121,8 @@ typedef unsigned long RESTYPE; #define BAD_RESOURCE 0xe0000000 +#define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) + /* Resource state callback */ extern _X_EXPORT CallbackListPtr ResourceStateCallback; @@ -249,34 +251,5 @@ extern _X_EXPORT unsigned int GetXIDList( extern _X_EXPORT RESTYPE lastResourceType; extern _X_EXPORT RESTYPE TypeMask; -/* - * These are deprecated compatibility functions and will be removed soon! - * Please use the noted replacements instead. - */ - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer SecurityLookupIDByType( - ClientPtr client, - XID id, - RESTYPE rtype, - Mask access_mode) _X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer SecurityLookupIDByClass( - ClientPtr client, - XID id, - RESTYPE classes, - Mask access_mode) _X_DEPRECATED; - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer LookupIDByType( - XID id, - RESTYPE rtype) _X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer LookupIDByClass( - XID id, - RESTYPE classes) _X_DEPRECATED; - #endif /* RESOURCE_H */ diff --git a/include/scrnintstr.h b/include/scrnintstr.h index e36b15f5e..a9357e8a5 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -50,7 +50,6 @@ SOFTWARE. #include "screenint.h" #include "regionstr.h" -#include "bstore.h" #include "colormap.h" #include "cursor.h" #include "validate.h" @@ -136,7 +135,8 @@ typedef void (* SourceValidateProcPtr)( int /*x*/, int /*y*/, int /*width*/, - int /*height*/); + int /*height*/, + unsigned int /*subWindowMode*/); typedef Bool (* CreateWindowProcPtr)( WindowPtr /*pWindow*/); @@ -213,48 +213,6 @@ typedef PixmapPtr (* CreatePixmapProcPtr)( typedef Bool (* DestroyPixmapProcPtr)( PixmapPtr /*pPixmap*/); -typedef void (* SaveDoomedAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/); - -typedef RegionPtr (* RestoreAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnRestore*/); - -typedef void (* ExposeCopyProcPtr)( - WindowPtr /*pSrc*/, - DrawablePtr /*pDst*/, - GCPtr /*pGC*/, - RegionPtr /*prgnExposed*/, - int /*srcx*/, - int /*srcy*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*plane*/); - -typedef RegionPtr (* TranslateBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*windx*/, - int /*windy*/, - RegionPtr /*oldClip*/, - int /*oldx*/, - int /*oldy*/); - -typedef RegionPtr (* ClearBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - Bool /*generateExposures*/); - -typedef void (* DrawGuaranteeProcPtr)( - WindowPtr /*pWindow*/, - GCPtr /*pGC*/, - int /*guarantee*/); - typedef Bool (* RealizeFontProcPtr)( ScreenPtr /*pScreen*/, FontPtr /*pFont*/); @@ -388,14 +346,6 @@ typedef Bool (* MarkOverlappedWindowsProcPtr)( WindowPtr /*firstChild*/, WindowPtr * /*pLayerWin*/); -typedef Bool (* ChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - -typedef void (* PostChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - typedef int (* ConfigNotifyProcPtr)( WindowPtr /*pWin*/, int /*x*/, @@ -453,6 +403,9 @@ typedef void (* DeviceCursorCleanupProcPtr)( DeviceIntPtr /* pDev */, ScreenPtr /* pScreen */); +typedef void (*ConstrainCursorHarderProcPtr)( + DeviceIntPtr, ScreenPtr, int, int *, int *); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -511,20 +464,6 @@ typedef struct _Screen { CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; - /* Backing store procedures */ - - SaveDoomedAreasProcPtr SaveDoomedAreas; - RestoreAreasProcPtr RestoreAreas; - ExposeCopyProcPtr ExposeCopy; - TranslateBackingStoreProcPtr TranslateBackingStore; - ClearBackingStoreProcPtr ClearBackingStore; - DrawGuaranteeProcPtr DrawGuarantee; - /* - * A read/write copy of the lower level backing store vector is needed now - * that the functions can be wrapped. - */ - BSFuncRec BackingStoreFuncs; - /* Font procedures */ RealizeFontProcPtr RealizeFont; @@ -533,6 +472,7 @@ typedef struct _Screen { /* Cursor Procedures */ ConstrainCursorProcPtr ConstrainCursor; + ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; @@ -584,8 +524,6 @@ typedef struct _Screen { MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; - ChangeSaveUnderProcPtr ChangeSaveUnder; - PostChangeSaveUnderProcPtr PostChangeSaveUnder; ConfigNotifyProcPtr ConfigNotify; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; @@ -601,6 +539,12 @@ typedef struct _Screen { /* Device cursor procedures */ DeviceCursorInitializeProcPtr DeviceCursorInitialize; DeviceCursorCleanupProcPtr DeviceCursorCleanup; + + /* set it in driver side if X server can copy the framebuffer content. + * Meant to be used together with '-background none' option, avoiding + * malicious users to steal framebuffer's content if that would be the + * default */ + Bool canDoBGNoneRoot; } ScreenRec; static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) { diff --git a/include/site.h b/include/site.h index b13421231..9c2836f21 100644 --- a/include/site.h +++ b/include/site.h @@ -112,9 +112,6 @@ SOFTWARE. #define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000)) #define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking #define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures -#ifndef NOLOGOHACK -#define DEFAULT_LOGO_SCREEN_SAVER 1 -#endif #ifndef DEFAULT_ACCESS_CONTROL #define DEFAULT_ACCESS_CONTROL TRUE #endif diff --git a/include/window.h b/include/window.h index 6fb2f8c18..1e4e9bfa4 100644 --- a/include/window.h +++ b/include/window.h @@ -266,4 +266,5 @@ extern _X_EXPORT void DisableMapUnmapEvents( extern _X_EXPORT void EnableMapUnmapEvents( WindowPtr /* pWin */ ); +extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable); #endif /* WINDOW_H */ diff --git a/include/windowstr.h b/include/windowstr.h index 29b95fc37..4a7a0f488 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -79,8 +79,8 @@ typedef struct _DevCursorNode { } DevCursNodeRec, *DevCursNodePtr, *DevCursorList; typedef struct _WindowOpt { - VisualID visual; /* default: same as parent */ CursorPtr cursor; /* default: window.cursorNone */ + VisualID visual; /* default: same as parent */ Colormap colormap; /* default: same as parent */ Mask dontPropagateMask; /* default: window.dontPropagate */ Mask otherEventMasks; /* default: 0 */ @@ -167,6 +167,9 @@ typedef struct _Window { #ifdef ROOTLESS unsigned rootlessUnhittable:1; /* doesn't hit-test */ #endif +#ifdef COMPOSITE + unsigned damagedDescendants:1; /* some descendants are damaged */ +#endif } WindowRec; /* diff --git a/include/xkbsrv.h b/include/xkbsrv.h index 9f1507e8e..c6f86f544 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -447,6 +447,11 @@ extern _X_EXPORT void XkbFreeKeyboard( Bool /* freeDesc */ ); +extern _X_EXPORT void XkbFreeComponentNames( + XkbComponentNamesPtr /* names */, + Bool /* freeNames */ +); + extern _X_EXPORT void XkbSetActionKeyMods( XkbDescPtr /* xkb */, XkbAction * /* act */, @@ -846,10 +851,6 @@ extern _X_EXPORT XkbGeometryPtr XkbLookupNamedGeometry( Bool * /* shouldFree */ ); -extern _X_EXPORT char * _XkbDupString( - const char * /* str */ -); - extern _X_EXPORT void XkbConvertCase( KeySym /* sym */, KeySym * /* lower */, diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index 76cab16b6..b10b9949e 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -157,9 +157,6 @@ /* Name of X server */ #undef __XSERVERNAME__ -/* Define to 1 if unsigned long is 64 bits. */ -#undef _XSERVER64 - /* Building vgahw module */ #undef WITH_VGAHW @@ -187,4 +184,8 @@ /* X Access Control Extension */ #undef XACE +#ifdef _LP64 +#define _XSERVER64 1 +#endif + #endif /* _XORG_SERVER_H_ */ diff --git a/include/xserver-properties.h b/include/xserver-properties.h index c6259aee1..2b1feabb6 100644 --- a/include/xserver-properties.h +++ b/include/xserver-properties.h @@ -35,6 +35,11 @@ /* BOOL. If present, device is a virtual XTEST device */ #define XI_PROP_XTEST_DEVICE "XTEST Device" +/* CARD32, 2 values, vendor, product. + * This property is set by the driver and may not be available for some + * drivers. Read-Only */ +#define XI_PROP_PRODUCT_ID "Device Product ID" + /* Coordinate transformation matrix for absolute input devices * FLOAT, 9 values in row-major order, coordinates in 0..1 range: * [c0 c1 c2] [x] @@ -42,6 +47,9 @@ * [c6 c7 c8] [1] */ #define XI_PROP_TRANSFORM "Coordinate Transformation Matrix" +/* STRING. Device node path of device */ +#define XI_PROP_DEVICE_NODE "Device Node" + /* Pointer acceleration properties */ /* INTEGER of any format */ #define ACCEL_PROP_PROFILE_NUMBER "Device Accel Profile" diff --git a/m4/xorg-tls.m4 b/m4/xorg-tls.m4 new file mode 100644 index 000000000..237fdcd9e --- /dev/null +++ b/m4/xorg-tls.m4 @@ -0,0 +1,55 @@ +dnl Copyright © 2011 Apple Inc. +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the "Software"), +dnl to deal in the Software without restriction, including without limitation +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, +dnl and/or sell copies of the Software, and to permit persons to whom the +dnl Software is furnished to do so, subject to the following conditions: +dnl +dnl The above copyright notice and this permission notice (including the next +dnl paragraph) shall be included in all copies or substantial portions of the +dnl Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +dnl DEALINGS IN THE SOFTWARE. +dnl +dnl Authors: Jeremy Huddleston + +AC_DEFUN([XORG_TLS], [ + AC_REQUIRE([XORG_STRICT_OPTION]) + AC_MSG_CHECKING(for thread local storage (TLS) support) + AC_CACHE_VAL(ac_cv_tls, [ + ac_cv_tls=none + keywords="__thread __declspec(thread)" + for kw in $keywords ; do + AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw) + done + ]) + AC_MSG_RESULT($ac_cv_tls) + + if test "$ac_cv_tls" != "none"; then + AC_MSG_CHECKING(for tls_model attribute support) + AC_CACHE_VAL(ac_cv_tls_model, [ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $STRICT_CFLAGS" + AC_TRY_COMPILE([int $ac_cv_tls __attribute__((tls_model("initial-exec"))) test;], [], + ac_cv_tls_model=yes, ac_cv_tls_model=no) + CFLAGS="$save_CFLAGS" + ]) + AC_MSG_RESULT($ac_cv_tls_model) + + if test "x$ac_cv_tls_model" = "xyes" ; then + xorg_tls=$ac_cv_tls' __attribute__((tls_model("initial-exec")))' + else + xorg_tls=$ac_cv_tls + fi + + AC_DEFINE_UNQUOTED([TLS], $xorg_tls, [The compiler supported TLS storage class, prefering initial-exec if tls_model is supported]) + fi +]) diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 000000000..71d704917 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,6 @@ +# Xserver.man covers options generic to all X servers built in this tree +# (i.e. those handled in the os/utils.c options processing instead of in +# the DDX-level options processing) + +include $(top_srcdir)/manpages.am +appman_PRE = Xserver.man diff --git a/doc/Xserver.man.pre b/man/Xserver.man similarity index 97% rename from doc/Xserver.man.pre rename to man/Xserver.man index ce3b3a10b..b7259490d 100644 --- a/doc/Xserver.man.pre +++ b/man/Xserver.man @@ -38,7 +38,7 @@ is the generic name for the X Window System display server. It is frequently a link or a copy of the appropriate server binary for driving the most frequently used server on a given machine. .SH "STARTING THE SERVER" -The X server is usually started from the X Display Manager program +The X server is usually started from the X Display Manager program \fIxdm\fP(1) or a similar display manager program. This utility is run from the system boot files and takes care of keeping the server running, prompting for usernames and passwords, and starting up @@ -97,7 +97,7 @@ Audit lines are sent as standard error output. .TP 8 .B \-auth \fIauthorization-file\fP specifies a file which contains a collection of authorization records used -to authenticate access. See also the \fIxdm\fP(1) and +to authenticate access. See also the \fIxdm\fP(1) and \fIXsecurity\fP(__miscmansuffix__) manual pages. .TP 8 .B \-br @@ -285,27 +285,19 @@ sets the stack space limit of the server to the specified number of kilobytes. A value of zero makes the stack size as large as possible. The default value of \-1 leaves the stack space limit unchanged. .TP 8 -.B \-logo -turns on the X Window System logo display in the screen-saver. -There is currently no way to change this from a client. -.TP 8 -.B nologo -turns off the X Window System logo display in the screen-saver. -There is currently no way to change this from a client. -.TP 8 -.B \-render +.B \-render .BR default | mono | gray | color sets the color allocation policy that will be used by the render extension. .RS 8 .TP 8 .I default selects the default policy defined for the display depth of the X -server. +server. .TP 8 .I mono -don't use any color cell. +don't use any color cell. .TP 8 -.I gray +.I gray use a gray map of 13 color cells for the X render extension. .TP 8 .I color @@ -333,13 +325,13 @@ enable XDMCP and broadcasts BroadcastQuery packets to the network. The first responding display manager will be chosen for the session. .TP 8 .B \-multicast [\fIaddress\fP [\fIhop count\fP]] -Enable XDMCP and multicast BroadcastQuery packets to the network. -The first responding display manager is chosen for the session. If an -address is specified, the multicast is sent to that address. If no -address is specified, the multicast is sent to the default XDMCP IPv6 -multicast group. If a hop count is specified, it is used as the maximum -hop count for the multicast. If no hop count is specified, the multicast -is set to a maximum of 1 hop, to prevent the multicast from being routed +Enable XDMCP and multicast BroadcastQuery packets to the network. +The first responding display manager is chosen for the session. If an +address is specified, the multicast is sent to that address. If no +address is specified, the multicast is sent to the default XDMCP IPv6 +multicast group. If a hop count is specified, it is used as the maximum +hop count for the multicast. If no hop count is specified, the multicast +is set to a maximum of 1 hop, to prevent the multicast from being routed beyond the local network. .TP 8 .B \-indirect \fIhostname\fP @@ -376,7 +368,7 @@ Yet another XDMCP specific value, this one allows the display manager to identify each display so that it can locate the shared key. .SH XKEYBOARD OPTIONS X servers that support the XKEYBOARD (a.k.a. \*qXKB\*q) extension accept the -following options. All layout files specified on the command line must be +following options. All layout files specified on the command line must be located in the XKB base directory or a subdirectory, and specified as the relative path from the XKB base directory. The default XKB base directory is .IR __projectroot__/lib/X11/xkb . @@ -408,8 +400,8 @@ specify which transport type clients should try to use. .SH GRANTING ACCESS The X server implements a platform-dependent subset of the following authorization protocols: MIT-MAGIC-COOKIE-1, XDM-AUTHORIZATION-1, -XDM-AUTHORIZATION-2, SUN-DES-1, and MIT-KERBEROS-5. See the -\fIXsecurity\fP(__miscmansuffix__) manual page for information on the +XDM-AUTHORIZATION-2, SUN-DES-1, and MIT-KERBEROS-5. See the +\fIXsecurity\fP(__miscmansuffix__) manual page for information on the operation of these protocols. .PP Authorization data required by the above protocols is passed to the @@ -494,7 +486,7 @@ is possible. The X server can obtain fonts from directories and/or from font servers. The list of directories and font servers the X server uses when trying to open a font is controlled -by the \fIfont path\fP. +by the \fIfont path\fP. .LP The default font path is __default_font_path__ . @@ -569,7 +561,7 @@ Fonts: \fIbdftopcf\fP(1), \fImkfontdir\fP(1), \fImkfontscale\fP(1), \fIxfs\fP(1), \fIxlsfonts\fP(1), \fIxfontsel\fP(1), \fIxfd\fP(1), .I "X Logical Font Description Conventions" .PP -Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1), +Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1), \fIxdm\fP(1), \fIxhost\fP(1), \fIxfwp\fP(1), .I "Security Extension Specification" .PP diff --git a/manpages.am b/manpages.am new file mode 100644 index 000000000..ea969cc5f --- /dev/null +++ b/manpages.am @@ -0,0 +1,37 @@ +appmandir = $(APP_MAN_DIR) +#appman_PRE = list of application man page files set by calling Makefile.am +appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) + +drivermandir = $(DRIVER_MAN_DIR) +#driverman_PRE = list of driver man page files set by calling Makefile.am +driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) + +filemandir = $(FILE_MAN_DIR) +#fileman_PRE = list of file man page files set by calling Makefile.am +fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) + +# The calling Makefile should only contain man page targets +# Otherwise the following three global variables may conflict +EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) +CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) +SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man + +# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS +# 's|/,|/, |g' will add a space to help font path formatting +MAN_SUBSTS += -e 's|__logdir__|$(logdir)|g' \ + -e 's|__datadir__|$(datadir)|g' \ + -e 's|__mandir__|$(mandir)|g' \ + -e 's|__sysconfdir__|$(sysconfdir)|g' \ + -e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \ + -e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \ + -e 's|__bundle_id_prefix__|$(BUNDLE_ID_PREFIX)|g' \ + -e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \ + -e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \ + -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' + +.man.$(APP_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(DRIVER_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(FILE_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff --git a/mi/Makefile.am b/mi/Makefile.am index f6dabda67..96ceeaa8a 100644 --- a/mi/Makefile.am +++ b/mi/Makefile.am @@ -12,9 +12,7 @@ libmi_la_SOURCES = \ mi.h \ miarc.c \ mibitblt.c \ - mibstore.c \ mibstore.h \ - mibstorest.h \ micmap.c \ micmap.h \ micoord.h \ diff --git a/mi/mi.h b/mi/mi.h index 57837c450..c186940ff 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -456,10 +456,6 @@ extern _X_EXPORT Bool miScreenInit( VisualPtr /*visuals*/ ); -extern _X_EXPORT DevPrivateKey miAllocateGCPrivateIndex( - void -); - /* mivaltree.c */ extern _X_EXPORT int miShapedWindowIn( diff --git a/mi/mibstore.c b/mi/mibstore.c index 262b4944d..827b9b23c 100644 --- a/mi/mibstore.c +++ b/mi/mibstore.c @@ -40,10 +40,4 @@ void miInitializeBackingStore (ScreenPtr pScreen) { - pScreen->SaveDoomedAreas = NULL; - pScreen->RestoreAreas = NULL; - pScreen->ExposeCopy = NULL; - pScreen->TranslateBackingStore = NULL; - pScreen->ClearBackingStore = NULL; - pScreen->DrawGuarantee = NULL; } diff --git a/mi/mibstore.h b/mi/mibstore.h index ef7e18790..c23caac2f 100644 --- a/mi/mibstore.h +++ b/mi/mibstore.h @@ -18,8 +18,6 @@ #include "screenint.h" -extern _X_EXPORT void miInitializeBackingStore( - ScreenPtr /*pScreen*/ -); +#define miInitializeBackingStore(x) do {} while (0) #endif /* _MIBSTORE_H */ diff --git a/mi/mibstorest.h b/mi/mibstorest.h deleted file mode 100644 index ccf4fb701..000000000 --- a/mi/mibstorest.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * mibstorest.h - * - * internal structure definitions for mi backing store - */ - - -/* - -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. -*/ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "mibstore.h" -#include "regionstr.h" - -/* - * One of these structures is allocated per GC used with a backing-store - * drawable. - */ - -typedef struct { - GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures - * set FALSE and the clientClip set to - * clip output to the valid regions of the - * backing pixmap. */ - int guarantee; /* GuaranteeNothing, etc. */ - unsigned long serialNumber; /* clientClip computed time */ - unsigned long stateChanges; /* changes in parent gc since last copy */ - GCOps *wrapOps; /* wrapped ops */ - GCFuncs *wrapFuncs; /* wrapped funcs */ -} miBSGCRec, *miBSGCPtr; - -/* - * one of these structures is allocated per Window with backing store - */ - -typedef struct { - PixmapPtr pBackingPixmap; /* Pixmap for saved areas */ - short x; /* origin of pixmap relative to window */ - short y; - RegionRec SavedRegion; /* Valid area in pBackingPixmap */ - char viewable; /* Tracks pWin->viewable so SavedRegion may - * be initialized correctly when the window - * is first mapped */ - char status; /* StatusNoPixmap, etc. */ - char backgroundState; /* background type */ - PixUnion background; /* background pattern */ -} miBSWindowRec, *miBSWindowPtr; - -#define StatusNoPixmap 1 /* pixmap has not been created */ -#define StatusVirtual 2 /* pixmap is virtual, tiled with background */ -#define StatusVDirty 3 /* pixmap is virtual, visiblt has contents */ -#define StatusBadAlloc 4 /* pixmap create failed, do not try again */ -#define StatusContents 5 /* pixmap is created, has valid contents */ - -typedef struct { - /* - * screen func wrappers - */ - CloseScreenProcPtr CloseScreen; - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - CreateGCProcPtr CreateGC; - DestroyWindowProcPtr DestroyWindow; -} miBSScreenRec, *miBSScreenPtr; diff --git a/mi/micmap.c b/mi/micmap.c index 8d76f4df7..7448ef8fd 100644 --- a/mi/micmap.c +++ b/mi/micmap.c @@ -1,5 +1,5 @@ /* - * Copyright © 1987 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 1987, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -564,6 +564,8 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp, { vid = malloc(nvtype * sizeof (VisualID)); if (!vid) { + free(depth); + free(visual); free(preferredCVCs); return FALSE; } diff --git a/mi/micopy.c b/mi/micopy.c index 027c461fe..652c6207e 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -183,10 +183,10 @@ miDoCopy (DrawablePtr pSrcDrawable, return NULL; } - if ((pSrcDrawable != pDstDrawable) && - pSrcDrawable->pScreen->SourceValidate) + if (pSrcDrawable->pScreen->SourceValidate) { - (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc); + (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn, widthSrc, heightSrc, + pGC->subWindowMode); } /* Compute source clip region */ diff --git a/mi/midispcur.c b/mi/midispcur.c index 48feb8823..32c5c9df6 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -76,7 +76,7 @@ typedef struct { #define miGetDCDevice(dev, screen) \ ((DevHasCursor(dev)) ? \ (miDCBufferPtr)dixLookupScreenPrivate(&dev->devPrivates, miDCDeviceKey, screen) : \ - (miDCBufferPtr)dixLookupScreenPrivate(&dev->u.master->devPrivates, miDCDeviceKey, screen)) + (miDCBufferPtr)dixLookupScreenPrivate(&GetMaster(dev, MASTER_POINTER)->devPrivates, miDCDeviceKey, screen)) /* * The core pointer buffer will point to the index of the virtual core pointer @@ -397,7 +397,6 @@ Bool miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y, unsigned long source, unsigned long mask) { - miDCScreenPtr pScreenPriv; miDCCursorPtr pPriv; miDCBufferPtr pBuffer; WindowPtr pWin; @@ -410,8 +409,7 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, if (!pPriv) return FALSE; } - pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miDCScreenKey); + pWin = pScreen->root; pBuffer = miGetDCDevice(pDev, pScreen); @@ -444,14 +442,11 @@ Bool miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h) { - miDCScreenPtr pScreenPriv; miDCBufferPtr pBuffer; PixmapPtr pSave; WindowPtr pWin; GCPtr pGC; - pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miDCScreenKey); pBuffer = miGetDCDevice(pDev, pScreen); pSave = pBuffer->pSave; @@ -478,14 +473,11 @@ Bool miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, int w, int h) { - miDCScreenPtr pScreenPriv; miDCBufferPtr pBuffer; PixmapPtr pSave; WindowPtr pWin; GCPtr pGC; - pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, - miDCScreenKey); pBuffer = miGetDCDevice(pDev, pScreen); pSave = pBuffer->pSave; diff --git a/mi/mieq.c b/mi/mieq.c index d1441e285..d6590826a 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. # include "windowstr.h" # include "pixmapstr.h" # include "inputstr.h" +# include "inpututils.h" # include "mi.h" # include "mipointer.h" # include "scrnintstr.h" @@ -64,7 +65,7 @@ in this Software without prior written authorization from The Open Group. #define DequeueScreen(dev) dev->spriteInfo->sprite->pDequeueScreen typedef struct _Event { - EventListPtr events; + InternalEvent* events; ScreenPtr pScreen; DeviceIntPtr pDev; /* device this event _originated_ from */ } EventRec, *EventPtr; @@ -79,21 +80,22 @@ typedef struct _EventQueue { static EventQueueRec miEventQueue; -#ifdef XQUARTZ +#if defined(XQUARTZ) || defined(DDXANDROID) +#define MIEQ_LOCKING #include static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER; -extern BOOL serverInitComplete; -extern pthread_mutex_t serverInitCompleteMutex; -extern pthread_cond_t serverInitCompleteCond; +extern BOOL serverRunning; +extern pthread_mutex_t serverRunningMutex; +extern pthread_cond_t serverRunningCond; static inline void wait_for_server_init(void) { /* If the server hasn't finished initializing, wait for it... */ - if(!serverInitComplete) { - pthread_mutex_lock(&serverInitCompleteMutex); - while(!serverInitComplete) - pthread_cond_wait(&serverInitCompleteCond, &serverInitCompleteMutex); - pthread_mutex_unlock(&serverInitCompleteMutex); + if(!serverRunning) { + pthread_mutex_lock(&serverRunningMutex); + while(!serverRunning) + pthread_cond_wait(&serverRunningCond, &serverRunningMutex); + pthread_mutex_unlock(&serverRunningMutex); } } #endif @@ -111,7 +113,7 @@ mieqInit(void) for (i = 0; i < QUEUE_SIZE; i++) { if (miEventQueue.events[i].events == NULL) { - EventListPtr evlist = InitEventList(1); + InternalEvent* evlist = InitEventList(1); if (!evlist) FatalError("Could not allocate event queue.\n"); miEventQueue.events[i].events = evlist; @@ -146,17 +148,17 @@ void mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) { unsigned int oldtail = miEventQueue.tail; - EventListPtr evt; + InternalEvent* evt; int isMotion = 0; int evlen; Time time; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING wait_for_server_init(); pthread_mutex_lock(&miEventQueueMutex); #endif - CHECKEVENT(e); + verify_internal_event(e); /* avoid merging events from different devices */ if (e->any.type == ET_Motion) @@ -178,7 +180,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) xorg_backtrace(); stuck = 1; } -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif return; @@ -188,21 +190,7 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) evlen = e->any.length; evt = miEventQueue.events[oldtail].events; - if (evt->evlen < evlen) - { - evt->evlen = evlen; - evt->event = realloc(evt->event, evt->evlen); - if (!evt->event) - { - ErrorF("[mi] Running out of memory. Tossing event.\n"); -#ifdef XQUARTZ - pthread_mutex_unlock(&miEventQueueMutex); -#endif - return; - } - } - - memcpy(evt->event, e, evlen); + memcpy(evt, e, evlen); time = e->any.time; /* Make sure that event times don't go backwards - this @@ -211,13 +199,13 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) miEventQueue.lastEventTime - time < 10000) e->any.time = miEventQueue.lastEventTime; - miEventQueue.lastEventTime = ((InternalEvent*)evt->event)->any.time; + miEventQueue.lastEventTime = evt->any.time; miEventQueue.events[oldtail].pScreen = pDev ? EnqueueScreen(pDev) : NULL; miEventQueue.events[oldtail].pDev = pDev; miEventQueue.lastMotion = isMotion; miEventQueue.tail = (oldtail + 1) % QUEUE_SIZE; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif } @@ -225,13 +213,13 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) void mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX) { -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_lock(&miEventQueueMutex); #endif EnqueueScreen(pDev) = pScreen; if (fromDIX) DequeueScreen(pDev) = pScreen; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif } @@ -239,7 +227,7 @@ mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX) void mieqSetHandler(int event, mieqHandler handler) { -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_lock(&miEventQueueMutex); #endif if (handler && miEventQueue.handlers[event]) @@ -247,7 +235,7 @@ mieqSetHandler(int event, mieqHandler handler) "event %d\n", miEventQueue.handlers[event], handler, event); miEventQueue.handlers[event] = handler; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif } @@ -292,8 +280,8 @@ static void FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, InternalEvent* original, InternalEvent *master) { - CHECKEVENT(original); - CHECKEVENT(master); + verify_internal_event(original); + verify_internal_event(master); /* Ensure chained button mappings, i.e. that the detail field is the * value of the mapped button on the SD, not the physical button */ if (original->any.type == ET_ButtonPress || @@ -320,31 +308,39 @@ CopyGetMasterEvent(DeviceIntPtr sdev, { DeviceIntPtr mdev; int len = original->any.length; + int type = original->any.type; + int mtype; /* which master type? */ - CHECKEVENT(original); + verify_internal_event(original); /* ET_XQuartz has sdev == NULL */ - if (!sdev || !sdev->u.master) + if (!sdev || IsMaster(sdev) || IsFloating(sdev)) return NULL; - switch(original->any.type) +#if XFreeXDGA + if (type == ET_DGAEvent) + type = original->dga_event.subtype; +#endif + + switch(type) { case ET_KeyPress: case ET_KeyRelease: - mdev = GetMaster(sdev, MASTER_KEYBOARD); + mtype = MASTER_KEYBOARD; break; case ET_ButtonPress: case ET_ButtonRelease: case ET_Motion: case ET_ProximityIn: case ET_ProximityOut: - mdev = GetMaster(sdev, MASTER_POINTER); + mtype = MASTER_POINTER; break; default: - mdev = sdev->u.master; + mtype = MASTER_ATTACHED; break; } + mdev = GetMaster(sdev, mtype); memcpy(copy, original, len); ChangeDeviceID(mdev, copy); FixUpEventForMaster(mdev, sdev, original, copy); @@ -368,7 +364,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, DeviceIntPtr master; InternalEvent mevent; /* master event */ - CHECKEVENT(event); + verify_internal_event(event); /* Custom event handler */ handler = miEventQueue.handlers[event->any.type]; @@ -394,7 +390,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, master = CopyGetMasterEvent(dev, event, &mevent); if (master) - master->u.lastSlave = dev; + master->lastSlave = dev; /* If someone's registered a custom event handler, let them * steal it. */ @@ -404,7 +400,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, handler(screenNum, event, dev); /* Check for the SD's master in case the device got detached * during event processing */ - if (master && dev->u.master) + if (master && !IsFloating(dev)) handler(screenNum, &mevent, master); } else { @@ -413,7 +409,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, /* Check for the SD's master in case the device got detached * during event processing */ - if (master && dev->u.master) + if (master && !IsFloating(dev)) master->public.processInputProc(&mevent, master); } } @@ -423,44 +419,29 @@ void mieqProcessInputEvents(void) { EventRec *e = NULL; - int evlen; ScreenPtr screen; - static InternalEvent *event = NULL; - static size_t event_size = 0; + static InternalEvent event; DeviceIntPtr dev = NULL, master = NULL; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_lock(&miEventQueueMutex); #endif while (miEventQueue.head != miEventQueue.tail) { e = &miEventQueue.events[miEventQueue.head]; - evlen = e->events->evlen; - if(evlen > event_size) - { - event = realloc(event, evlen); - event_size = evlen; - } - - - if (!event) - FatalError("[mi] No memory left for event processing.\n"); - - memcpy(event, e->events->event, evlen); - - + event = *e->events; dev = e->pDev; screen = e->pScreen; miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE; -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif - master = (dev && !IsMaster(dev) && dev->u.master) ? dev->u.master : NULL; + master = (dev) ? GetMaster(dev, MASTER_ATTACHED) : NULL; if (screenIsSaved == SCREEN_SAVER_ON) dixSaveScreens (serverClient, SCREEN_SAVER_OFF, ScreenSaverReset); @@ -472,17 +453,17 @@ mieqProcessInputEvents(void) DPMSSet(serverClient, DPMSModeOn); #endif - mieqProcessDeviceEvent(dev, event, screen); + mieqProcessDeviceEvent(dev, &event, screen); /* Update the sprite now. Next event may be from different device. */ - if (event->any.type == ET_Motion && master) + if (event.any.type == ET_Motion && master) miPointerUpdateSprite(dev); -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_lock(&miEventQueueMutex); #endif } -#ifdef XQUARTZ +#ifdef MIEQ_LOCKING pthread_mutex_unlock(&miEventQueueMutex); #endif } diff --git a/mi/miinitext.c b/mi/miinitext.c index a7441c9a8..4499f377c 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -389,9 +389,7 @@ InitExtensions(int argc, char *argv[]) if (!noGEExtension) GEExtensionInit(); #ifdef PANORAMIX -# if !defined(NO_PANORAMIX) if (!noPanoramiXExtension) PanoramiXExtensionInit(); -# endif #endif #ifdef INXQUARTZ if(!noPseudoramiXExtension) PseudoramiXExtensionInit(); diff --git a/mi/mipointer.c b/mi/mipointer.c index d8aaf8c51..322be9e44 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -23,6 +23,29 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/** + * @file + * This file contains functions to move the pointer on the screen and/or + * restrict its movement. These functions are divided into two sets: + * Screen-specific functions that are used as function pointers from other + * parts of the server (and end up heavily wrapped by e.g. animcur and + * xfixes): + * miPointerConstrainCursor + * miPointerCursorLimits + * miPointerDisplayCursor + * miPointerRealizeCursor + * miPointerUnrealizeCursor + * miPointerSetCursorPosition + * miRecolorCursor + * miPointerDeviceInitialize + * miPointerDeviceCleanup + * If wrapped, these are the last element in the wrapping chain. They may + * call into sprite-specific code through further function pointers though. + * + * The second type of functions are those that are directly called by the + * DIX, DDX and some drivers. + */ + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -39,6 +62,8 @@ in this Software without prior written authorization from The Open Group. # include "cursorstr.h" # include "dixstruct.h" # include "inputstr.h" +# include "inpututils.h" +# include "eventstr.h" DevPrivateKeyRec miPointerScreenKeyRec; @@ -49,7 +74,7 @@ DevPrivateKeyRec miPointerScreenKeyRec; DevPrivateKeyRec miPointerPrivKeyRec; #define MIPOINTER(dev) \ - ((!IsMaster(dev) && !dev->u.master) ? \ + (IsFloating(dev) ? \ (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey)) @@ -75,7 +100,7 @@ static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); static void miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -static EventList* events; /* for WarpPointer MotionNotifies */ +static InternalEvent* events; /* for WarpPointer MotionNotifies */ Bool miPointerInitialize (ScreenPtr pScreen, @@ -125,36 +150,17 @@ miPointerInitialize (ScreenPtr pScreen, return TRUE; } +/** + * Destroy screen-specific information. + * + * @param index Screen index of the screen in screenInfo.screens[] + * @param pScreen The actual screen pointer + */ static Bool miPointerCloseScreen (int index, ScreenPtr pScreen) { -#if 0 - miPointerPtr pPointer; - DeviceIntPtr pDev; -#endif - SetupScreen(pScreen); -#if 0 - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) - { - if (DevHasCursor(pDev)) - { - pPointer = MIPOINTER(pDev); - - if (pScreen == pPointer->pScreen) - pPointer->pScreen = 0; - if (pScreen == pPointer->pSpriteScreen) - pPointer->pSpriteScreen = 0; - } - } - - if (MIPOINTER(inputInfo.pointer)->pScreen == pScreen) - MIPOINTER(inputInfo.pointer)->pScreen = 0; - if (MIPOINTER(inputInfo.pointer)->pSpriteScreen == pScreen) - MIPOINTER(inputInfo.pointer)->pSpriteScreen = 0; -#endif - pScreen->CloseScreen = pScreenPriv->CloseScreen; free((pointer) pScreenPriv); FreeEventList(events, GetMaximumEventsNum()); @@ -188,8 +194,7 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miPointerPtr pPointer; /* return for keyboards */ - if ((IsMaster(pDev) && !DevHasCursor(pDev)) || - (!IsMaster(pDev) && pDev->u.master && !DevHasCursor(pDev->u.master))) + if (!IsPointerDevice(pDev)) return FALSE; pPointer = MIPOINTER(pDev); @@ -200,6 +205,15 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) return TRUE; } +/** + * Set up the constraints for the given device. This function does not + * actually constrain the cursor but merely copies the given box to the + * internal constraint storage. + * + * @param pDev The device to constrain to the box + * @param pBox The rectangle to constrain the cursor to + * @param pScreen Used for copying screen confinement + */ static void miPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox) { @@ -211,7 +225,17 @@ miPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox) pPointer->confined = PointerConfinedToScreen(pDev); } -/*ARGSUSED*/ +/** + * Should calculate the box for the given cursor, based on screen and the + * confinement given. But we assume that whatever box is passed in is valid + * anyway. + * + * @param pDev The device to calculate the cursor limits for + * @param pScreen The screen the confinement happens on + * @param pCursor The screen the confinement happens on + * @param pHotBox The confinement box for the cursor + * @param[out] pTopLeftBox The new confinement box, always *pHotBox. + */ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox) @@ -219,15 +243,39 @@ miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, *pTopLeftBox = *pHotBox; } -static Bool GenerateEvent; - +/** + * Set the device's cursor position to the x/y position on the given screen. + * Generates and event if required. + * + * This function is called from: + * - sprite init code to place onto initial position + * - the various WarpPointer implementations (core, XI, Xinerama, dmx,…) + * - during the cursor update path in CheckMotion + * - in the Xinerama part of NewCurrentScreen + * - when a RandR/RandR1.2 mode was applied (it may have moved the pointer, so + * it's set back to the original pos) + * + * @param pDev The device to move + * @param pScreen The screen the device is on + * @param x The x coordinate in per-screen coordinates + * @param y The y coordinate in per-screen coordinates + * @param generateEvent True if the pointer movement should generate an + * event. + * + * @return TRUE in all cases + */ static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent) { SetupScreen (pScreen); + miPointerPtr pPointer = MIPOINTER(pDev); + + pPointer->generateEvent = generateEvent; + + if (pScreen->ConstrainCursorHarder) + pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y); - GenerateEvent = generateEvent; /* device dependent - must pend signal and call miPointerWarpCursor */ (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y); if (!generateEvent) @@ -235,9 +283,13 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, return TRUE; } -/* Set up sprite information for the device. - This function will be called once for each device after it is initialized - in the DIX. +/** + * Set up sprite information for the device. + * This function will be called once for each device after it is initialized + * in the DIX. + * + * @param pDev The newly created device + * @param pScreen The initial sprite scree. */ static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) @@ -260,6 +312,7 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) pPointer->confined = FALSE; pPointer->x = 0; pPointer->y = 0; + pPointer->generateEvent = FALSE; if (!((*pScreenPriv->spriteFuncs->DeviceCursorInitialize)(pDev, pScreen))) { @@ -271,15 +324,19 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) return TRUE; } -/* Clean up after device. - This function will be called once before the device is freed in the DIX +/** + * Clean up after device. + * This function will be called once before the device is freed in the DIX + * + * @param pDev The device to be removed from the server + * @param pScreen Current screen of the device */ static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { SetupScreen(pScreen); - if (!IsMaster(pDev) && pDev->u.master) + if (!IsMaster(pDev) && !IsFloating(pDev)) return; (*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen); @@ -288,7 +345,17 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) } -/* Once signals are ignored, the WarpCursor function can call this */ +/** + * Warp the pointer to the given position on the given screen. May generate + * an event, depending on whether we're coming from miPointerSetPosition. + * + * Once signals are ignored, the WarpCursor function can call this + * + * @param pDev The device to warp + * @param pScreen Screen to warp on + * @param x The x coordinate in per-screen coordinates + * @param y The y coordinate in per-screen coordinates + */ void miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) @@ -305,7 +372,7 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) changedScreen = TRUE; } - if (GenerateEvent) + if (pPointer->generateEvent) miPointerMove (pDev, pScreen, x, y); else miPointerMoveNoEvent(pDev, pScreen, x, y); @@ -321,16 +388,11 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) UpdateSpriteForScreen (pDev, pScreen) ; } -/* - * Pointer/CursorDisplay interface routines - */ - -/* - * miPointerUpdateSprite +/** + * Syncronize the sprite with the cursor. * - * Syncronize the sprite with the cursor - called from ProcessInputEvents + * @param pDev The device to sync */ - void miPointerUpdateSprite (DeviceIntPtr pDev) { @@ -407,6 +469,14 @@ miPointerUpdateSprite (DeviceIntPtr pDev) } } +/** + * Set the device to the coordinates on the given screen. + * + * @param pDev The device to move + * @param screen_no Index of the screen to move to + * @param x The x coordinate in per-screen coordinates + * @param y The y coordinate in per-screen coordinates + */ void miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) { @@ -425,12 +495,18 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) pPointer->limits.y2 = pScreen->height; } +/** + * @return The current screen of the VCP + */ ScreenPtr miPointerCurrentScreen (void) { return miPointerGetScreen(inputInfo.pointer); } +/** + * @return The current screen of the given device or NULL. + */ ScreenPtr miPointerGetScreen(DeviceIntPtr pDev) { @@ -468,7 +544,7 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen, * VCP, as this may cause a non-HW rendered cursor to be rendered during * SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT. */ - if ((pDev == inputInfo.pointer || (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer)) + if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer && !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen) { pPointer->devx = x; @@ -482,8 +558,24 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen, pPointer->pScreen = pScreen; } +/** + * Set the devices' cursor position to the given x/y position. + * + * This function is called during the pointer update path in + * GetPointerEvents and friends (and the same in the xwin DDX). + * + * The coordinates provided are always absolute. The parameter mode whether + * it was relative or absolute movement that landed us at those coordinates. + * + * @param pDev The device to move + * @param mode Movement mode (Absolute or Relative) + * @param[in,out] x The x coordiante in screen coordinates (in regards to total + * desktop size) + * @param[in,out] y The y coordiante in screen coordinates (in regards to total + * desktop size) + */ void -miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) +miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y) { miPointerScreenPtr pScreenPriv; ScreenPtr pScreen; @@ -511,7 +603,6 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) pScreen = newScreen; (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE); - pScreenPriv = GetScreenPrivate (pScreen); /* Smash the confine to the new screen */ pPointer->limits.x2 = pScreen->width; pPointer->limits.y2 = pScreen->height; @@ -528,6 +619,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) if (*y >= pPointer->limits.y2) *y = pPointer->limits.y2 - 1; + if (pScreen->ConstrainCursorHarder) + pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y); + if (pPointer->x == *x && pPointer->y == *y && pPointer->pScreen == pScreen) return; @@ -535,6 +629,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y) miPointerMoveNoEvent(pDev, pScreen, *x, *y); } +/** + * Get the current position of the device in desktop coordinates. + * + * @param x Return value for the current x coordinate in desktop coordiates. + * @param y Return value for the current y coordinate in desktop coordiates. + */ void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { @@ -548,11 +648,21 @@ void darwinEvents_lock(void); void darwinEvents_unlock(void); #endif +/** + * Move the device's pointer to the x/y coordinates on the given screen. + * This function generates and enqueues pointer events. + * + * @param pDev The device to move + * @param pScreen The screen the device is on + * @param x The x coordinate in per-screen coordinates + * @param y The y coordinate in per-screen coordinates + */ void miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { int i, nevents; int valuators[2]; + ValuatorMask mask; miPointerMoveNoEvent(pDev, pScreen, x, y); @@ -571,14 +681,16 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) } } - nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE, 0, 2, valuators); + valuator_mask_set_range(&mask, 0, 2, valuators); + nevents = GetPointerEvents(events, pDev, MotionNotify, 0, + POINTER_SCREEN | POINTER_ABSOLUTE, &mask); OsBlockSignals(); #ifdef XQUARTZ darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) - mieqEnqueue(pDev, (InternalEvent*)events[i].event); + mieqEnqueue(pDev, &events[i]); #ifdef XQUARTZ darwinEvents_unlock(); #endif diff --git a/mi/mipointer.h b/mi/mipointer.h index 3c8611022..539096e78 100644 --- a/mi/mipointer.h +++ b/mi/mipointer.h @@ -133,6 +133,7 @@ extern _X_EXPORT void miPointerGetPosition( * x and y are modified in-place. */ extern _X_EXPORT void miPointerSetPosition( DeviceIntPtr pDev, + int mode, int *x, int *y); diff --git a/mi/mipointrst.h b/mi/mipointrst.h index bd9c24a00..c912a17da 100644 --- a/mi/mipointrst.h +++ b/mi/mipointrst.h @@ -44,6 +44,7 @@ typedef struct { Bool confined; /* pointer can't change screens */ int x, y; /* hot spot location */ int devx, devy; /* sprite position */ + Bool generateEvent; /* generate an event during warping? */ } miPointerRec, *miPointerPtr; typedef struct { diff --git a/mi/miscrinit.c b/mi/miscrinit.c index 661ecb239..fb01c6810 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -269,8 +269,6 @@ miScreenInit( pScreen->wakeupData = (pointer)0; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; - pScreen->ChangeSaveUnder = NULL; - pScreen->PostChangeSaveUnder = NULL; pScreen->MoveWindow = miMoveWindow; pScreen->ResizeWindow = miSlideAndSizeWindow; pScreen->GetLayerWindow = miGetLayerWindow; @@ -280,29 +278,11 @@ miScreenInit( pScreen->SetShape = miSetShape; pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow; - pScreen->SaveDoomedAreas = 0; - pScreen->RestoreAreas = 0; - pScreen->ExposeCopy = 0; - pScreen->TranslateBackingStore = 0; - pScreen->ClearBackingStore = 0; - pScreen->DrawGuarantee = 0; - miSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS); return miScreenDevPrivateInit(pScreen, width, pbits); } -static DevPrivateKeyRec privateKeyRec; -#define privateKey (&privateKeyRec) - -DevPrivateKey -miAllocateGCPrivateIndex(void) -{ - if (!dixRegisterPrivateKey(&privateKeyRec, PRIVATE_GC, 0)) - return NULL; - return privateKey; -} - DevPrivateKeyRec miZeroLineScreenKeyRec; void diff --git a/mi/mispans.c b/mi/mispans.c index 9f56e3c3d..21ba4da4f 100644 --- a/mi/mispans.c +++ b/mi/mispans.c @@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) void miFreeSpanGroup(SpanGroup *spanGroup) { - if (spanGroup->group != NULL) free(spanGroup->group); + free(spanGroup->group); } static void QuickSortSpansX( @@ -458,6 +458,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup) } free(yspans); free(ysizes); + free(newpoints); + free(newwidths); miDisposeSpanGroup (spanGroup); return; } diff --git a/mi/misprite.c b/mi/misprite.c index 38a6b939a..1cfcdf6ee 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -96,6 +96,7 @@ typedef struct { VisualPtr pVisual; DamagePtr pDamage; /* damage tracking structure */ Bool damageRegistered; + int numberOfCursors; } miSpriteScreenRec, *miSpriteScreenPtr; #define SOURCE_COLOR 0 @@ -142,7 +143,7 @@ typedef struct { #endif #define MISPRITE(dev) \ - ((!IsMaster(dev) && !dev->u.master) ? \ + (IsFloating(dev) ? \ (miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \ (miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey)) @@ -184,6 +185,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor) static DevPrivateKeyRec miSpriteScreenKeyRec; #define miSpriteScreenKey (&miSpriteScreenKeyRec) +#define GetSpriteScreen(pScreen) \ + (dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey)) static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec) @@ -195,7 +198,8 @@ static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, - int width, int height); + int width, int height, + unsigned int subWindowMode); static void miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); @@ -214,11 +218,10 @@ static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); -#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ - ((miSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \ - miSpriteScreenKey))->field) -#define SCREEN_EPILOGUE(pScreen, field)\ - ((pScreen)->field = miSprite##field) +#define SCREEN_PROLOGUE(pPriv, pScreen, field) ((pScreen)->field = \ + (pPriv)->field) +#define SCREEN_EPILOGUE(pPriv, pScreen, field)\ + ((pPriv)->field = (pScreen)->field, (pScreen)->field = miSprite##field) /* * pointer-sprite method table @@ -253,6 +256,15 @@ static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, static void miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen); +static void +miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) +{ + if (!pScreenPriv->BlockHandler) { + pScreenPriv->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = miSpriteBlockHandler; + } +} + static void miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) { @@ -296,7 +308,7 @@ miSpriteInitialize (ScreenPtr pScreen, if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; - if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, 0)) + if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec))) return FALSE; pScreenPriv = malloc(sizeof (miSpriteScreenRec)); @@ -330,7 +342,7 @@ miSpriteInitialize (ScreenPtr pScreen, pScreenPriv->InstallColormap = pScreen->InstallColormap; pScreenPriv->StoreColors = pScreen->StoreColors; - pScreenPriv->BlockHandler = pScreen->BlockHandler; + pScreenPriv->BlockHandler = NULL; pScreenPriv->DeviceCursorInitialize = pScreen->DeviceCursorInitialize; pScreenPriv->DeviceCursorCleanup = pScreen->DeviceCursorCleanup; @@ -344,6 +356,7 @@ miSpriteInitialize (ScreenPtr pScreen, pScreenPriv->colors[MASK_COLOR].green = 0; pScreenPriv->colors[MASK_COLOR].blue = 0; pScreenPriv->damageRegistered = 0; + pScreenPriv->numberOfCursors = 0; dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv); @@ -356,8 +369,6 @@ miSpriteInitialize (ScreenPtr pScreen, pScreen->InstallColormap = miSpriteInstallColormap; pScreen->StoreColors = miSpriteStoreColors; - pScreen->BlockHandler = miSpriteBlockHandler; - return TRUE; } @@ -373,14 +384,12 @@ miSpriteInitialize (ScreenPtr pScreen, static Bool miSpriteCloseScreen (int i, ScreenPtr pScreen) { - miSpriteScreenPtr pScreenPriv; + miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); - pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; pScreen->SourceValidate = pScreenPriv->SourceValidate; - pScreen->BlockHandler = pScreenPriv->BlockHandler; pScreen->InstallColormap = pScreenPriv->InstallColormap; pScreen->StoreColors = pScreenPriv->StoreColors; @@ -396,11 +405,12 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine) { - ScreenPtr pScreen = pDrawable->pScreen; - DeviceIntPtr pDev; - miCursorInfoPtr pCursorInfo; + ScreenPtr pScreen = pDrawable->pScreen; + DeviceIntPtr pDev; + miCursorInfoPtr pCursorInfo; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); - SCREEN_PROLOGUE (pScreen, GetImage); + SCREEN_PROLOGUE (pPriv, pScreen, GetImage); if (pDrawable->type == DRAWABLE_WINDOW) { @@ -423,7 +433,7 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); - SCREEN_EPILOGUE (pScreen, GetImage); + SCREEN_EPILOGUE (pPriv, pScreen, GetImage); } static void @@ -433,8 +443,9 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, ScreenPtr pScreen = pDrawable->pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); - SCREEN_PROLOGUE (pScreen, GetSpans); + SCREEN_PROLOGUE (pPriv, pScreen, GetSpans); if (pDrawable->type == DRAWABLE_WINDOW) { @@ -474,18 +485,19 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - SCREEN_EPILOGUE (pScreen, GetSpans); + SCREEN_EPILOGUE (pPriv, pScreen, GetSpans); } static void miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, - int height) + int height, unsigned int subWindowMode) { ScreenPtr pScreen = pDrawable->pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); - SCREEN_PROLOGUE (pScreen, SourceValidate); + SCREEN_PROLOGUE (pPriv, pScreen, SourceValidate); if (pDrawable->type == DRAWABLE_WINDOW) { @@ -506,9 +518,9 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, } if (pScreen->SourceValidate) - (*pScreen->SourceValidate) (pDrawable, x, y, width, height); + (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode); - SCREEN_EPILOGUE (pScreen, SourceValidate); + SCREEN_EPILOGUE (pPriv, pScreen, SourceValidate); } static void @@ -517,8 +529,9 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) ScreenPtr pScreen = pWindow->drawable.pScreen; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); - SCREEN_PROLOGUE (pScreen, CopyWindow); + SCREEN_PROLOGUE (pPriv, pScreen, CopyWindow); for(pDev = inputInfo.devices; pDev; pDev = pDev->next) { @@ -538,7 +551,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); - SCREEN_EPILOGUE (pScreen, CopyWindow); + SCREEN_EPILOGUE (pPriv, pScreen, CopyWindow); } static void @@ -546,16 +559,10 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout, pointer pReadmask) { ScreenPtr pScreen = screenInfo.screens[i]; - miSpriteScreenPtr pPriv; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; - - pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); - SCREEN_PROLOGUE(pScreen, BlockHandler); - - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); - - SCREEN_EPILOGUE(pScreen, BlockHandler); + Bool WorkToDo = FALSE; for(pDev = inputInfo.devices; pDev; pDev = pDev->next) { @@ -566,7 +573,7 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout, && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) { - SPRITE_DEBUG (("BlockHandler restore\n")); + SPRITE_DEBUG (("BlockHandler save")); miSpriteSaveUnderCursor (pDev, pScreen); } } @@ -582,23 +589,33 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout, { SPRITE_DEBUG (("BlockHandler restore\n")); miSpriteRestoreCursor (pDev, pScreen); + if (!pCursorInfo->isUp) + WorkToDo = TRUE; } } } + + SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); + + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + + if (WorkToDo) + SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); + else + pPriv->BlockHandler = NULL; } static void miSpriteInstallColormap (ColormapPtr pMap) { ScreenPtr pScreen = pMap->pScreen; - miSpriteScreenPtr pPriv; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); - pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); - SCREEN_PROLOGUE(pScreen, InstallColormap); + SCREEN_PROLOGUE(pPriv, pScreen, InstallColormap); (*pScreen->InstallColormap) (pMap); - SCREEN_EPILOGUE(pScreen, InstallColormap); + SCREEN_EPILOGUE(pPriv, pScreen, InstallColormap); /* InstallColormap can be called before devices are initialized. */ pPriv->pInstalledMap = pMap; @@ -624,19 +641,18 @@ static void miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) { ScreenPtr pScreen = pMap->pScreen; - miSpriteScreenPtr pPriv; + miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); int i; int updated; VisualPtr pVisual; DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; - pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); - SCREEN_PROLOGUE(pScreen, StoreColors); + SCREEN_PROLOGUE(pPriv, pScreen, StoreColors); (*pScreen->StoreColors) (pMap, ndef, pdef); - SCREEN_EPILOGUE(pScreen, StoreColors); + SCREEN_EPILOGUE(pPriv, pScreen, StoreColors); if (pPriv->pColormap == pMap) { @@ -706,8 +722,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) static void miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen) { - miSpriteScreenPtr pScreenPriv = - dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); CursorPtr pCursor; xColorItem *sourceColor, *maskColor; @@ -751,7 +766,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { miCursorInfoPtr pCursorInfo; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return FALSE; pCursorInfo = MISPRITE(pDev); @@ -772,22 +787,32 @@ static void miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y) { - miCursorInfoPtr pPointer; + miCursorInfoPtr pPointer; + miSpriteScreenPtr pScreenPriv; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; pPointer = MISPRITE(pDev); + pScreenPriv = GetSpriteScreen(pScreen); if (!pCursor) { + if (pPointer->shouldBeUp) + --pScreenPriv->numberOfCursors; pPointer->shouldBeUp = FALSE; if (pPointer->isUp) miSpriteRemoveCursor (pDev, pScreen); + if (pScreenPriv->numberOfCursors == 0) + miSpriteDisableDamage(pScreen, pScreenPriv); pPointer->pCursor = 0; return; } + if (!pPointer->shouldBeUp) + pScreenPriv->numberOfCursors++; pPointer->shouldBeUp = TRUE; + if (!pPointer->isUp) + miSpriteRegisterBlockHandler(pScreen, pScreenPriv); if (pPointer->x == x && pPointer->y == y && pPointer->pCursor == pCursor && @@ -823,7 +848,7 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { CursorPtr pCursor; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; pCursor = MISPRITE(pDev)->pCursor; @@ -835,38 +860,35 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) { - miCursorInfoPtr pCursorInfo; - int ret = FALSE; + int ret = miDCDeviceInitialize(pDev, pScreen); - pCursorInfo = malloc(sizeof(miCursorInfoRec)); - if (!pCursorInfo) - return FALSE; - - pCursorInfo->pCursor = NULL; - pCursorInfo->x = 0; - pCursorInfo->y = 0; - pCursorInfo->isUp = FALSE; - pCursorInfo->shouldBeUp = FALSE; - pCursorInfo->pCacheWin = NullWindow; - pCursorInfo->isInCacheWin = FALSE; - pCursorInfo->checkPixels = TRUE; - pCursorInfo->pScreen = FALSE; - - ret = miDCDeviceInitialize(pDev, pScreen); - if (!ret) + if (ret) { - free(pCursorInfo); - pCursorInfo = NULL; + miCursorInfoPtr pCursorInfo; + pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); + pCursorInfo->pCursor = NULL; + pCursorInfo->x = 0; + pCursorInfo->y = 0; + pCursorInfo->isUp = FALSE; + pCursorInfo->shouldBeUp = FALSE; + pCursorInfo->pCacheWin = NullWindow; + pCursorInfo->isInCacheWin = FALSE; + pCursorInfo->checkPixels = TRUE; + pCursorInfo->pScreen = FALSE; } - dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, pCursorInfo); + return ret; } static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) { + miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey); + if (DevHasCursor(pDev)) miDCDeviceCleanup(pDev, pScreen); + + memset(pCursorInfo, 0, sizeof(miCursorInfoRec)); } /* @@ -880,14 +902,15 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen) miCursorInfoPtr pCursorInfo; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; DamageDrawInternal (pScreen, TRUE); - pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteIsDown(pCursorInfo); + miSpriteRegisterBlockHandler(pScreen, pScreenPriv); pCursorInfo->pCacheWin = NullWindow; miSpriteDisableDamage(pScreen, pScreenPriv); if (!miDCRestoreUnderCursor(pDev, @@ -918,11 +941,11 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; DamageDrawInternal (pScreen, TRUE); - pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved (pDev, pScreen); @@ -959,11 +982,11 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; DamageDrawInternal (pScreen, TRUE); - pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); + pScreenPriv = GetSpriteScreen(pScreen); pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved (pDev, pScreen); @@ -999,7 +1022,7 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen) CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - if (!IsMaster(pDev) && !pDev->u.master) + if (IsFloating(pDev)) return; pCursorInfo = MISPRITE(pDev); diff --git a/mi/mivalidate.h b/mi/mivalidate.h index ef258c0f8..18700ac79 100644 --- a/mi/mivalidate.h +++ b/mi/mivalidate.h @@ -40,8 +40,7 @@ typedef union _Validate { DDXPointRec oldAbsCorner; /* old window position */ RegionPtr borderVisible; /* visible region of border, */ /* non-null when size changes */ - Bool resized; /* unclipped winSize has changed - */ - /* don't call SaveDoomedAreas */ + Bool resized; /* unclipped winSize has changed */ } before; struct AfterValidate { RegionRec exposed; /* exposed regions, absolute pos */ diff --git a/mi/miwideline.c b/mi/miwideline.c index b11b40bd2..bc5ee74c2 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -403,7 +403,7 @@ miPolyBuildPoly ( i = top; j = StepAround (top, -1, count); - if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx) + if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx) { clockwise = -1; slopeoff = -1; diff --git a/mi/mizerline.c b/mi/mizerline.c index 07cfbe113..7077b5198 100644 --- a/mi/mizerline.c +++ b/mi/mizerline.c @@ -157,9 +157,11 @@ miZeroLine( list_len = (height >= width) ? height : width; pspanInit = malloc(list_len * sizeof(DDXPointRec)); pwidthInit = malloc(list_len * sizeof(int)); - if (!pspanInit || !pwidthInit) + if (!pspanInit || !pwidthInit) { + free(pspanInit); + free(pwidthInit); return; - + } Nspans = 0; new_span = TRUE; spans = pspanInit - 1; diff --git a/miext/Makefile.am b/miext/Makefile.am index 84ab70855..bbedac2b5 100644 --- a/miext/Makefile.am +++ b/miext/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = damage shadow +SUBDIRS = sync damage shadow if COMPOSITE SUBDIRS += cw endif @@ -8,4 +8,4 @@ endif if XWIN_MULTIWINDOWEXTWM SUBDIRS += rootless endif -DIST_SUBDIRS = damage shadow cw rootless +DIST_SUBDIRS = sync damage shadow cw rootless diff --git a/miext/cw/cw.h b/miext/cw/cw.h index 31eb9e57c..e2bb9ad88 100644 --- a/miext/cw/cw.h +++ b/miext/cw/cw.h @@ -106,8 +106,6 @@ typedef struct { TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; RasterizeTrapezoidProcPtr RasterizeTrapezoid; } cwScreenRec, *cwScreenPtr; diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c index 165c44f46..1f990aefa 100644 --- a/miext/cw/cw_render.c +++ b/miext/cw/cw_render.c @@ -371,66 +371,6 @@ cwTriangles (CARD8 op, cwPsWrap(Triangles, cwTriangles); } -static void -cwTriStrip (CARD8 op, - PicturePtr pSrcPicture, - PicturePtr pDstPicture, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - cwPsDecl(pScreen); - cwSrcPictureDecl; - cwDstPictureDecl; - int i; - - cwPsUnwrap(TriStrip); - if (dst_picture_x_off || dst_picture_y_off) { - for (i = 0; i < npoint; i++) - { - points[i].x += dst_picture_x_off << 16; - points[i].y += dst_picture_y_off << 16; - } - } - (*ps->TriStrip) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat, - xSrc + src_picture_x_off, ySrc + src_picture_y_off, - npoint, points); - cwPsWrap(TriStrip, cwTriStrip); -} - -static void -cwTriFan (CARD8 op, - PicturePtr pSrcPicture, - PicturePtr pDstPicture, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - cwPsDecl(pScreen); - cwSrcPictureDecl; - cwDstPictureDecl; - int i; - - cwPsUnwrap(TriFan); - if (dst_picture_x_off || dst_picture_y_off) { - for (i = 0; i < npoint; i++) - { - points[i].x += dst_picture_x_off << 16; - points[i].y += dst_picture_y_off << 16; - } - } - (*ps->TriFan) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat, - xSrc + src_picture_x_off, ySrc + src_picture_y_off, - npoint, points); - cwPsWrap(TriFan, cwTriFan); -} - void cwInitializeRender (ScreenPtr pScreen) { @@ -443,8 +383,6 @@ cwInitializeRender (ScreenPtr pScreen) cwPsWrap(CompositeRects, cwCompositeRects); cwPsWrap(Trapezoids, cwTrapezoids); cwPsWrap(Triangles, cwTriangles); - cwPsWrap(TriStrip, cwTriStrip); - cwPsWrap(TriFan, cwTriFan); /* There is no need to wrap AddTraps as far as we can tell. AddTraps can * only be done on alpha-only pictures, and we won't be getting * alpha-only window pictures, so there's no need to translate. @@ -463,7 +401,5 @@ cwFiniRender (ScreenPtr pScreen) cwPsUnwrap(CompositeRects); cwPsUnwrap(Trapezoids); cwPsUnwrap(Triangles); - cwPsUnwrap(TriStrip); - cwPsUnwrap(TriFan); } diff --git a/miext/damage/Makefile.am b/miext/damage/Makefile.am index 595835731..767a65aee 100644 --- a/miext/damage/Makefile.am +++ b/miext/damage/Makefile.am @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libdamage.la AM_CFLAGS = $(DIX_CFLAGS) -INCLUDES = -I$(srcdir)/../cw -I$(top_srcdir)/hw/xfree86/os-support +INCLUDES = -I$(srcdir)/../cw if XORG sdk_HEADERS = damage.h damagestr.h diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 21cbb78c9..d79121165 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -89,7 +89,11 @@ getDrawableDamageRef (DrawablePtr pDrawable) ScreenPtr pScreen = pDrawable->pScreen; pPixmap = 0; - if (pScreen->GetWindowPixmap) + if (pScreen->GetWindowPixmap +#ifdef ROOTLESS_WORKAROUND + && ((WindowPtr)pDrawable)->viewable +#endif + ) pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable); if (!pPixmap) @@ -116,54 +120,6 @@ getDrawableDamageRef (DrawablePtr pDrawable) DamagePtr *pPrev = (DamagePtr *) \ dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey) -static void -damageReportDamage (DamagePtr pDamage, RegionPtr pDamageRegion) -{ - BoxRec tmpBox; - RegionRec tmpRegion; - Bool was_empty; - - switch (pDamage->damageLevel) { - case DamageReportRawRegion: - RegionUnion(&pDamage->damage, &pDamage->damage, - pDamageRegion); - (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); - break; - case DamageReportDeltaRegion: - RegionNull(&tmpRegion); - RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); - if (RegionNotEmpty(&tmpRegion)) { - RegionUnion(&pDamage->damage, &pDamage->damage, - pDamageRegion); - (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); - } - RegionUninit(&tmpRegion); - break; - case DamageReportBoundingBox: - tmpBox = *RegionExtents(&pDamage->damage); - RegionUnion(&pDamage->damage, &pDamage->damage, - pDamageRegion); - if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage))) { - (*pDamage->damageReport) (pDamage, &pDamage->damage, - pDamage->closure); - } - break; - case DamageReportNonEmpty: - was_empty = !RegionNotEmpty(&pDamage->damage); - RegionUnion(&pDamage->damage, &pDamage->damage, - pDamageRegion); - if (was_empty && RegionNotEmpty(&pDamage->damage)) { - (*pDamage->damageReport) (pDamage, &pDamage->damage, - pDamage->closure); - } - break; - case DamageReportNone: - RegionUnion(&pDamage->damage, &pDamage->damage, - pDamageRegion); - break; - } -} - static void damageReportDamagePostRendering (DamagePtr pDamage, RegionPtr pOldDamage, RegionPtr pDamageRegion) { @@ -356,7 +312,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, /* Report damage now, if desired. */ if (!pDamage->reportAfter) { if (pDamage->damageReport) - damageReportDamage (pDamage, pDamageRegion); + DamageReportDamage (pDamage, pDamageRegion); else RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); @@ -389,7 +345,7 @@ damageRegionProcessPending (DrawablePtr pDrawable) if (pDamage->reportAfter) { /* It's possible that there is only interest in postRendering reporting. */ if (pDamage->damageReport) - damageReportDamage (pDamage, &pDamage->pendingDamage); + DamageReportDamage (pDamage, &pDamage->pendingDamage); else RegionUnion(&pDamage->damage, &pDamage->damage, &pDamage->pendingDamage); @@ -891,16 +847,6 @@ damageCopyArea(DrawablePtr pSrc, RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - if (checkGCDamage (pDst, pGC)) { BoxRec box; @@ -937,16 +883,6 @@ damageCopyPlane(DrawablePtr pSrc, RegionPtr ret; DAMAGE_GC_OP_PROLOGUE(pGC, pDst); - /* The driver will only call SourceValidate() when pSrc != pDst, - * but the software sprite (misprite.c) always need to know when a - * drawable is copied so it can remove the sprite. See #1030. */ - if ((pSrc == pDst) && pSrc->pScreen->SourceValidate && - pSrc->type == DRAWABLE_WINDOW && - ((WindowPtr)pSrc)->viewable) - { - (*pSrc->pScreen->SourceValidate) (pSrc, srcx, srcy, width, height); - } - if (checkGCDamage (pDst, pGC)) { BoxRec box; @@ -2141,3 +2077,52 @@ DamageGetScreenFuncs (ScreenPtr pScreen) damageScrPriv(pScreen); return &pScrPriv->funcs; } + +void +DamageReportDamage (DamagePtr pDamage, RegionPtr pDamageRegion) +{ + BoxRec tmpBox; + RegionRec tmpRegion; + Bool was_empty; + + switch (pDamage->damageLevel) { + case DamageReportRawRegion: + RegionUnion(&pDamage->damage, &pDamage->damage, + pDamageRegion); + (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); + break; + case DamageReportDeltaRegion: + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); + if (RegionNotEmpty(&tmpRegion)) { + RegionUnion(&pDamage->damage, &pDamage->damage, + pDamageRegion); + (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); + } + RegionUninit(&tmpRegion); + break; + case DamageReportBoundingBox: + tmpBox = *RegionExtents(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, + pDamageRegion); + if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage))) { + (*pDamage->damageReport) (pDamage, &pDamage->damage, + pDamage->closure); + } + break; + case DamageReportNonEmpty: + was_empty = !RegionNotEmpty(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, + pDamageRegion); + if (was_empty && RegionNotEmpty(&pDamage->damage)) { + (*pDamage->damageReport) (pDamage, &pDamage->damage, + pDamage->closure); + } + break; + case DamageReportNone: + RegionUnion(&pDamage->damage, &pDamage->damage, + pDamageRegion); + break; + } +} + diff --git a/miext/damage/damage.h b/miext/damage/damage.h index 067016f38..0c7fc316c 100644 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -110,6 +110,10 @@ DamageRegionProcessPending (DrawablePtr pDrawable); extern _X_EXPORT void DamageRegionRendered (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDamage, RegionPtr pRegion); +/* Call this when you create a new Damage and you wish to send an initial damage message (to it). */ +extern _X_EXPORT void +DamageReportDamage (DamagePtr pDamage, RegionPtr pDamageRegion); + /* Avoid using this call, it only exists for API compatibility. */ extern _X_EXPORT void DamageDamageRegion (DrawablePtr pDrawable, diff --git a/miext/rootless/Makefile.am b/miext/rootless/Makefile.am index f09300d5c..c97bebebe 100644 --- a/miext/rootless/Makefile.am +++ b/miext/rootless/Makefile.am @@ -1,5 +1,4 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS) -AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support noinst_LTLIBRARIES = librootless.la librootless_la_SOURCES = \ diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 43b9cbb53..0801e7206 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -92,8 +92,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth); if (s->pixmap_data_size < rowbytes) { - if (s->pixmap_data != NULL) - free(s->pixmap_data); + free(s->pixmap_data); s->pixmap_data_size = rowbytes; s->pixmap_data = malloc(s->pixmap_data_size); @@ -224,7 +223,8 @@ RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, * here and leave StopDrawing for the block handler. */ static void -RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h) +RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h, + unsigned int subWindowMode) { SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate); if (pDrawable->type == DRAWABLE_WINDOW) { @@ -232,7 +232,7 @@ RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h) RootlessStartDrawing(pWin); } if (pDrawable->pScreen->SourceValidate) { - pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h); + pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h, subWindowMode); } SCREEN_WRAP(pDrawable->pScreen, SourceValidate); } @@ -325,7 +325,7 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, box.x1 = x - glyph->info.x; box.y1 = y - glyph->info.y; box.x2 = box.x1 + glyph->info.width; - box.y2 = box.y2 + glyph->info.height; + box.y2 = box.y1 + glyph->info.height; x += glyph->info.xOff; y += glyph->info.yOff; @@ -453,7 +453,6 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, pChild = pChild->nextSib; } anyMarked = TRUE; - pFirst = pFirst->nextSib; } if (anyMarked) (* MarkWindow)(pWin->parent); diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index e2c4ffe87..9aa881423 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -200,7 +200,6 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, RegionRec childUnion; Bool overlap; RegionPtr borderVisible; - Bool resized; /* * Figure out the new visibility of this window. * The extent of the universe should be the same as the extent of @@ -340,7 +339,6 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, } borderVisible = pParent->valdata->before.borderVisible; - resized = pParent->valdata->before.resized; RegionNull(&pParent->valdata->after.borderExposed); RegionNull(&pParent->valdata->after.exposed); @@ -471,18 +469,6 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, universe, &pParent->clipList); } - /* - * One last thing: backing storage. We have to try to save what parts of - * the window are about to be obscured. We can just subtract the universe - * from the old clipList and get the areas that were in the old but aren't - * in the new and, hence, are about to be obscured. - */ - if (pParent->backStorage && !resized) - { - RegionSubtract(exposed, &pParent->clipList, universe); - (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy); - } - /* HACK ALERT - copying contents of regions, instead of regions */ { RegionRec tmp; diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 42ab8dab2..c4a32aa0d 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1140,10 +1140,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, } } - if (gResizeDeathBits != NULL) { - free(gResizeDeathBits); - gResizeDeathBits = NULL; - } + free(gResizeDeathBits); + gResizeDeathBits = NULL; if (gravity) { pScreen->CopyWindow = gResizeOldCopyWindowProc; diff --git a/miext/shadow/Makefile.am b/miext/shadow/Makefile.am index a73d0ec78..30f7bda96 100644 --- a/miext/shadow/Makefile.am +++ b/miext/shadow/Makefile.am @@ -2,8 +2,6 @@ noinst_LTLIBRARIES = libshadow.la AM_CFLAGS = $(DIX_CFLAGS) -INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support - if XORG sdk_HEADERS = shadow.h endif diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c index 20d2ea19e..06606bcf3 100644 --- a/miext/shadow/shpacked.c +++ b/miext/shadow/shpacked.c @@ -102,8 +102,8 @@ shadowUpdatePacked (ScreenPtr pScreen, width -= i; scr += i; #define PickBit(a,i) (((a) >> (i)) & 1) - while (i--) - *win++ = *sha++; + memcpy(win, sha, i * sizeof(FbBits)); + sha += i; } shaLine += shaStride; y++; diff --git a/miext/sync/Makefile.am b/miext/sync/Makefile.am new file mode 100644 index 000000000..36b2816d7 --- /dev/null +++ b/miext/sync/Makefile.am @@ -0,0 +1,14 @@ +noinst_LTLIBRARIES = libsync.la + +AM_CFLAGS = $(DIX_CFLAGS) + +INCLUDES = + +if XORG +sdk_HEADERS = misync.h misyncstr.h +endif + +libsync_la_SOURCES = \ + misync.c \ + misync.h \ + misyncstr.h diff --git a/miext/sync/misync.c b/miext/sync/misync.c new file mode 100644 index 000000000..50226d9e3 --- /dev/null +++ b/miext/sync/misync.c @@ -0,0 +1,200 @@ +/* + * Copyright © 2010 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "scrnintstr.h" +#include "misync.h" +#include "misyncstr.h" + +static DevPrivateKeyRec syncScreenPrivateKeyRec; +static DevPrivateKey syncScreenPrivateKey = &syncScreenPrivateKeyRec; + +#define SYNC_SCREEN_PRIV(pScreen) \ + (SyncScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, \ + syncScreenPrivateKey) + +typedef struct _syncScreenPriv { + /* Wrappable sync-specific screen functions */ + SyncScreenFuncsRec funcs; + + /* Wrapped screen functions */ + CloseScreenProcPtr CloseScreen; +} SyncScreenPrivRec, *SyncScreenPrivPtr; + +/* Default implementations of the sync screen functions */ +void +miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence* pFence, + Bool initially_triggered) +{ + (void)pScreen; + + pFence->triggered = initially_triggered; +} + +void miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence* pFence) +{ + (void)pScreen; + (void)pFence; +} + +/* Default implementations of the per-object functions */ +static void +miSyncFenceSetTriggered(SyncFence* pFence) +{ + pFence->triggered = TRUE; +} + +static void +miSyncFenceReset(SyncFence* pFence) +{ + pFence->triggered = FALSE; +} + +static Bool +miSyncFenceCheckTriggered(SyncFence* pFence) +{ + return pFence->triggered; +} + +static void +miSyncFenceAddTrigger(SyncTrigger* pTrigger) +{ + (void)pTrigger; + + return; +} + +static void +miSyncFenceDeleteTrigger(SyncTrigger* pTrigger) +{ + (void)pTrigger; + + return; +} + +/* Machine independent portion of the fence sync object implementation */ +void +miSyncInitFence(ScreenPtr pScreen, SyncFence* pFence, Bool initially_triggered) +{ + SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); + static const SyncFenceFuncsRec miSyncFenceFuncs = { + &miSyncFenceSetTriggered, + &miSyncFenceReset, + &miSyncFenceCheckTriggered, + &miSyncFenceAddTrigger, + &miSyncFenceDeleteTrigger + }; + + pFence->pScreen = pScreen; + pFence->funcs = miSyncFenceFuncs; + + pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered); +} + +void +miSyncDestroyFence(SyncFence* pFence) +{ + ScreenPtr pScreen = pFence->pScreen; + SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); + SyncTriggerList *ptl, *pNext; + + pFence->sync.beingDestroyed = TRUE; + /* tell all the fence's triggers that the counter has been destroyed */ + for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) + { + (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger); + pNext = ptl->next; + free(ptl); /* destroy the trigger list as we go */ + } + + pScreenPriv->funcs.DestroyFence(pScreen, pFence); + + dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE); +} + +void +miSyncTriggerFence(SyncFence* pFence) +{ + SyncTriggerList *ptl, *pNext; + CARD64 unused; + + pFence->funcs.SetTriggered(pFence); + + XSyncIntToValue(&unused, 0L); + + /* run through triggers to see if any fired */ + for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) + { + pNext = ptl->next; + if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, unused)) + (*ptl->pTrigger->TriggerFired)(ptl->pTrigger); + } +} + +SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen) +{ + SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); + + return &pScreenPriv->funcs; +} + +static Bool +SyncCloseScreen (int i, ScreenPtr pScreen) +{ + SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); + + pScreen->CloseScreen = pScreenPriv->CloseScreen; + + return (*pScreen->CloseScreen) (i, pScreen); +} + +Bool +miSyncSetup(ScreenPtr pScreen) +{ + SyncScreenPrivPtr pScreenPriv; + + static const SyncScreenFuncsRec miSyncScreenFuncs = { + &miSyncScreenCreateFence, + &miSyncScreenDestroyFence + }; + + if (dixPrivateKeyRegistered(syncScreenPrivateKey)) + return TRUE; + + if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN, + sizeof(SyncScreenPrivRec))) + return FALSE; + + pScreenPriv = SYNC_SCREEN_PRIV(pScreen); + + pScreenPriv->funcs = miSyncScreenFuncs; + + /* Wrap CloseScreen to clean up */ + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = SyncCloseScreen; + + return TRUE; +} diff --git a/miext/sync/misync.h b/miext/sync/misync.h new file mode 100644 index 000000000..1c82ea516 --- /dev/null +++ b/miext/sync/misync.h @@ -0,0 +1,77 @@ +/* + * Copyright © 2010 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#ifndef _MISYNC_H_ +#define _MISYNC_H_ + +typedef struct _SyncFence SyncFence; +typedef struct _SyncTrigger SyncTrigger; + +typedef void (*SyncScreenCreateFenceFunc) (ScreenPtr pScreen, + SyncFence* pFence, + Bool initially_triggered); +typedef void (*SyncScreenDestroyFenceFunc) (ScreenPtr pScreen, + SyncFence* pFence); + +typedef struct _syncScreenFuncs { + SyncScreenCreateFenceFunc CreateFence; + SyncScreenDestroyFenceFunc DestroyFence; +} SyncScreenFuncsRec, *SyncScreenFuncsPtr; + +extern _X_EXPORT void +miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence* pFence, + Bool initially_triggered); +extern _X_EXPORT void +miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence* pFence); + +typedef void (*SyncFenceSetTriggeredFunc) (SyncFence* pFence); +typedef void (*SyncFenceResetFunc) (SyncFence* pFence); +typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence* pFence); +typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger* pTrigger); +typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger* pTrigger); + +typedef struct _syncFenceFuncs { + SyncFenceSetTriggeredFunc SetTriggered; + SyncFenceResetFunc Reset; + SyncFenceCheckTriggeredFunc CheckTriggered; + SyncFenceAddTriggerFunc AddTrigger; + SyncFenceDeleteTriggerFunc DeleteTrigger; +} SyncFenceFuncsRec, *SyncFenceFuncsPtr; + +extern _X_EXPORT void +miSyncInitFence(ScreenPtr pScreen, SyncFence* pFence, Bool initially_triggered); +extern _X_EXPORT void +miSyncDestroyFence(SyncFence* pFence); +extern _X_EXPORT void +miSyncTriggerFence(SyncFence* pFence); + +extern _X_EXPORT SyncScreenFuncsPtr +miSyncGetScreenFuncs(ScreenPtr pScreen); +extern _X_EXPORT Bool +miSyncSetup(ScreenPtr pScreen); + +#endif /* _MISYNC_H_ */ diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h new file mode 100644 index 000000000..40a865c9c --- /dev/null +++ b/miext/sync/misyncstr.h @@ -0,0 +1,86 @@ +/* + * Copyright © 2010 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#ifndef _MISYNCSTR_H_ +#define _MISYNCSTR_H_ + +#include "dix.h" +#include + +#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */ + +/* Sync object types */ +#define SYNC_COUNTER 0 +#define SYNC_FENCE 1 + +typedef struct _SyncObject { + ClientPtr client; /* Owning client. 0 for system counters */ + struct _SyncTriggerList *pTriglist; /* list of triggers */ + XID id; /* resource ID */ + unsigned char type; /* SYNC_* */ + Bool beingDestroyed; /* in process of going away */ +} SyncObject; + +typedef struct _SyncCounter { + SyncObject sync; /* Common sync object data */ + CARD64 value; /* counter value */ + struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */ +} SyncCounter; + +struct _SyncFence { + SyncObject sync; /* Common sync object data */ + ScreenPtr pScreen; /* Screen of this fence object */ + SyncFenceFuncsRec funcs; /* Funcs for performing ops on fence */ + Bool triggered; /* fence state */ + PrivateRec *devPrivates; /* driver-specific per-fence data */ +}; + +struct _SyncTrigger { + SyncObject *pSync; + CARD64 wait_value; /* wait value */ + unsigned int value_type; /* Absolute or Relative */ + unsigned int test_type; /* transition or Comparision type */ + CARD64 test_value; /* trigger event threshold value */ + Bool (*CheckTrigger)( + struct _SyncTrigger * /*pTrigger*/, + CARD64 /*newval*/ + ); + void (*TriggerFired)( + struct _SyncTrigger * /*pTrigger*/ + ); + void (*CounterDestroyed)( + struct _SyncTrigger * /*pTrigger*/ + ); +}; + +typedef struct _SyncTriggerList { + SyncTrigger *pTrigger; + struct _SyncTriggerList *next; +} SyncTriggerList; + +#endif /* _MISYNCSTR_H_ */ + diff --git a/os/Makefile.am b/os/Makefile.am index 3e4f2c591..91ca110f4 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -1,25 +1,18 @@ -noinst_LTLIBRARIES = libos.la liblog.la +noinst_LTLIBRARIES = libos.la AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c STRLCAT_SRCS = strlcat.c strlcpy.c - -# Build a convenience library liblog.la that will be added into -# libos.la. The split is done so that log.c can be built with -# different compiler options. -liblog_la_SOURCES = log.c -# Add flags needed for proper backtraces of functions marked with GCC -# __attribute__((noreturn)). Currently those flags are needed for -# FatalError and AbortServer in log.c. -liblog_la_CFLAGS = $(AM_CFLAGS) $(ARM_BACKTRACE_CFLAGS) +XORG_SRCS = log.c libos_la_SOURCES = \ WaitFor.c \ access.c \ auth.c \ backtrace.c \ + client.c \ connection.c \ io.c \ mitauth.c \ @@ -32,8 +25,9 @@ libos_la_SOURCES = \ xdmauth.c \ xsha1.c \ xstrans.c \ - xprintf.c -libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) liblog.la + xprintf.c \ + $(XORG_SRCS) +libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) diff --git a/os/WaitFor.c b/os/WaitFor.c index e66300490..867cb04b8 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -153,13 +153,17 @@ WaitForSomething(int *pClientsReady) fd_set clientsWritable; int curclient; int selecterr; - int nready; + static int nready; fd_set devicesReadable; CARD32 now = 0; Bool someReady = FALSE; FD_ZERO(&clientsReadable); + if (nready) + SmartScheduleStopTimer(); + nready = 0; + /* We need a while loop here to handle crashed connections and the screen saver timeout */ while (1) @@ -211,7 +215,6 @@ WaitForSomething(int *pClientsReady) } XFD_COPYSET(&AllSockets, &LastSelectMask); } - SmartScheduleStopTimer (); BlockHandler((pointer)&wt, (pointer)&LastSelectMask); if (NewOutputPending) @@ -230,7 +233,6 @@ WaitForSomething(int *pClientsReady) } selecterr = GetErrno(); WakeupHandler(i, (pointer)&LastSelectMask); - SmartScheduleStartTimer (); if (i <= 0) /* An error or timeout occurred */ { if (dispatchException) @@ -388,6 +390,10 @@ WaitForSomething(int *pClientsReady) #endif } } + + if (nready) + SmartScheduleStartTimer(); + return nready; } diff --git a/os/access.c b/os/access.c index d9de2649d..b7b19279f 100644 --- a/os/access.c +++ b/os/access.c @@ -54,7 +54,7 @@ SOFTWARE. ******************************************************************/ /* - * Copyright © 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -102,9 +102,9 @@ SOFTWARE. #include #include -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(__SCO__) +#if defined(TCPCONN) || defined(STREAMSCONN) #include -#endif /* TCPCONN || STREAMSCONN || __SCO__ */ +#endif /* TCPCONN || STREAMSCONN */ #ifdef HAS_GETPEERUCRED # include @@ -165,21 +165,6 @@ SOFTWARE. #endif /* WIN32 */ -#ifndef PATH_MAX -#include -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif -#endif - -#ifdef __SCO__ -/* The system defined value is wrong. MAXPATHLEN is set in sco5.cf. */ -#undef PATH_MAX -#endif #define X_INCLUDE_NETDB_H #include @@ -189,14 +174,6 @@ SOFTWARE. #include "xace.h" -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif - Bool defeatAccessControl = FALSE; #define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len) @@ -297,7 +274,7 @@ AccessUsingXdmcp (void) } -#if defined(SVR4) && !defined(SCO325) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if defined(SVR4) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -327,7 +304,7 @@ ifioctl (int fd, int cmd, char *arg) #endif return ret; } -#else /* Case sun, SCO325 and others */ +#else #define ifioctl ioctl #endif @@ -1032,20 +1009,19 @@ ResetHosts (char *display) } /* Is client on the local host */ -Bool LocalClient(ClientPtr client) +Bool +ComputeLocalClient(ClientPtr client) { int alen, family, notused; Xtransaddr *from = NULL; pointer addr; register HOST *host; + OsCommPtr oc = (OsCommPtr) client->osPrivate; - if (!client->osPrivate) - return FALSE; - if (!((OsCommPtr)client->osPrivate)->trans_conn) + if (!oc->trans_conn) return FALSE; - if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn, - ¬used, &alen, &from)) + if (!_XSERVTransGetPeerAddr (oc->trans_conn, ¬used, &alen, &from)) { family = ConvertAddr ((struct sockaddr *) from, &alen, (pointer *)&addr); @@ -1061,14 +1037,23 @@ Bool LocalClient(ClientPtr client) } for (host = selfhosts; host; host = host->next) { - if (addrEqual (family, addr, alen, host)) + if (addrEqual (family, addr, alen, host)) { + free(from); return TRUE; + } } free(from); } return FALSE; } +Bool LocalClient(ClientPtr client) +{ + if (!client->osPrivate) + return FALSE; + return ((OsCommPtr)client->osPrivate)->local_client; +} + /* * Return the uid and gid of a connected local client * @@ -1504,7 +1489,7 @@ InvalidHost ( } for (host = validhosts; host; host = host->next) { - if ((host->family == FamilyServerInterpreted)) { + if (host->family == FamilyServerInterpreted) { if (siAddrMatch (family, addr, len, host, client)) { return 0; } diff --git a/os/client.c b/os/client.c new file mode 100644 index 000000000..b5349778b --- /dev/null +++ b/os/client.c @@ -0,0 +1,309 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All + * rights reserved. + * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file + * + * This file contains functionality for identifying clients by various + * means. The primary purpose of identification is to simply aid in + * finding out which clients are using X server and how they are using + * it. For example, it's often necessary to monitor what requests + * clients are executing (to spot bad behaviour) and how they are + * allocating resources in X server (to spot excessive resource + * usage). + * + * This framework automatically allocates information, that can be + * used for client identification, when a client connects to the + * server. The information is freed when the client disconnects. The + * allocated information is just a collection of various IDs, such as + * PID and process name for local clients, that are likely to be + * useful in analyzing X server usage. + * + * Users of the framework can query ID information about clients at + * any time. To avoid repeated polling of IDs the users can also + * subscribe for notifications about the availability of ID + * information. IDs have been allocated before ClientStateCallback is + * called with ClientStateInitial state. Similarly the IDs will be + * released after ClientStateCallback is called with ClientStateGone + * state. + * + * Author: Rami Ylimäki + */ + +#include +#include +#include + +#include "client.h" +#include "os.h" +#include "dixstruct.h" + +/** + * Try to determine a PID for a client from its connection + * information. This should be called only once when new client has + * connected, use GetClientPid to determine the PID at other times. + * + * @param[in] client Connection linked to some process. + * + * @return PID of the client. Error (-1) if PID can't be determined + * for the client. + * + * @see GetClientPid + */ +pid_t DetermineClientPid(struct _Client *client) +{ + LocalClientCredRec *lcc = NULL; + pid_t pid = -1; + + if (client == NullClient) + return pid; + + if (client == serverClient) + return getpid(); + + if (GetLocalClientCreds(client, &lcc) != -1) + { + if (lcc->fieldsSet & LCC_PID_SET) + pid = lcc->pid; + FreeLocalClientCreds(lcc); + } + + return pid; +} + +/** + * Try to determine a command line string for a client based on its + * PID. Note that mapping PID to a command hasn't been implemented for + * some operating systems. This should be called only once when a new + * client has connected, use GetClientCmdName/Args to determine the + * string at other times. + * + * @param[in] pid Process ID of a client. + + * @param[out] cmdname Client process name without arguments. You must + * release this by calling free. On error NULL is + * returned. Pass NULL if you aren't interested in + * this value. + * @param[out] cmdargs Arguments to client process. Useful for + * identifying a client that is executed from a + * launcher program. You must release this by + * calling free. On error NULL is returned. Pass + * NULL if you aren't interested in this value. + * + * @see GetClientCmdName/Args + */ +void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) +{ + char path[PATH_MAX + 1]; + int totsize = 0; + int cmdsize = 0; + int argsize = 0; + int fd = 0; + + if (cmdname) + *cmdname = NULL; + if (cmdargs) + *cmdargs = NULL; + + if (pid == -1) + return; + + /* Check if /proc/pid/cmdline exists. It's not supported on all + * operating systems. */ + if (snprintf(path, sizeof(path), "/proc/%d/cmdline", pid) < 0) + return; + fd = open(path, O_RDONLY); + if (fd < 0) + return; + + /* Read the contents of /proc/pid/cmdline. It should contain the + * process name and arguments. */ + totsize = read(fd, path, sizeof(path)); + close(fd); + if (totsize <= 0) + return; + path[totsize - 1] = '\0'; + + /* Contruct the process name without arguments. */ + cmdsize = strlen(path) + 1; + if (cmdname) + { + char *name = malloc(cmdsize); + if (name) + { + strncpy(name, path, cmdsize); + name[cmdsize - 1] = '\0'; + *cmdname = name; + } + } + + /* Construct the arguments for client process. */ + argsize = totsize - cmdsize; + if (cmdargs && (argsize > 0)) + { + char *args = malloc(argsize); + if (args) + { + int i = 0; + for (i = 0; i < (argsize - 1); ++i) + { + const char c = path[cmdsize + i]; + args[i] = (c == '\0') ? ' ' : c; + } + args[argsize - 1] = '\0'; + *cmdargs = args; + } + } +} + +/** + * Called when a new client connects. Allocates client ID information. + * + * @param[in] client Recently connected client. + */ +void ReserveClientIds(struct _Client *client) +{ +#ifdef CLIENTIDS + if (client == NullClient) + return; + + assert(!client->clientIds); + client->clientIds = calloc(1, sizeof(ClientIdRec)); + if (!client->clientIds) + return; + + client->clientIds->pid = DetermineClientPid(client); + if (client->clientIds->pid != -1) + DetermineClientCmd(client->clientIds->pid, &client->clientIds->cmdname, &client->clientIds->cmdargs); + + DebugF("client(%lx): Reserved pid(%d).\n", + client->clientAsMask, client->clientIds->pid); + DebugF("client(%lx): Reserved cmdname(%s) and cmdargs(%s).\n", + client->clientAsMask, + client->clientIds->cmdname ? client->clientIds->cmdname : "NULL", + client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL"); +#endif /* CLIENTIDS */ +} + +/** + * Called when an existing client disconnects. Frees client ID + * information. + * + * @param[in] client Recently disconnected client. + */ +void ReleaseClientIds(struct _Client *client) +{ +#ifdef CLIENTIDS + if (client == NullClient) + return; + + if (!client->clientIds) + return; + + DebugF("client(%lx): Released pid(%d).\n", + client->clientAsMask, client->clientIds->pid); + DebugF("client(%lx): Released cmdline(%s) and cmdargs(%s).\n", + client->clientAsMask, + client->clientIds->cmdname ? client->clientIds->cmdname : "NULL", + client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL"); + + free((void *) client->clientIds->cmdname); /* const char * */ + free((void *) client->clientIds->cmdargs); /* const char * */ + free(client->clientIds); + client->clientIds = NULL; +#endif /* CLIENTIDS */ +} + +/** + * Get cached PID of a client. + * + * param[in] client Client whose PID has been already cached. + * + * @return Cached client PID. Error (-1) if called: + * - before ClientStateInitial client state notification + * - after ClientStateGone client state notification + * - for remote clients + * + * @see DetermineClientPid + */ +pid_t GetClientPid(struct _Client *client) +{ + if (client == NullClient) + return -1; + + if (!client->clientIds) + return -1; + + return client->clientIds->pid; +} + +/** + * Get cached command name string of a client. + * + * param[in] client Client whose command line string has been already + * cached. + * + * @return Cached client command name. Error (NULL) if called: + * - before ClientStateInitial client state notification + * - after ClientStateGone client state notification + * - for remote clients + * - on OS that doesn't support mapping of PID to command line + * + * @see DetermineClientCmd + */ +const char *GetClientCmdName(struct _Client *client) +{ + if (client == NullClient) + return NULL; + + if (!client->clientIds) + return NULL; + + return client->clientIds->cmdname; +} + +/** + * Get cached command arguments string of a client. + * + * param[in] client Client whose command line string has been already + * cached. + * + * @return Cached client command arguments. Error (NULL) if called: + * - before ClientStateInitial client state notification + * - after ClientStateGone client state notification + * - for remote clients + * - on OS that doesn't support mapping of PID to command line + * + * @see DetermineClientCmd + */ +const char *GetClientCmdArgs(struct _Client *client) +{ + if (client == NullClient) + return NULL; + + if (!client->clientIds) + return NULL; + + return client->clientIds->cmdargs; +} diff --git a/os/connection.c b/os/connection.c index 5452ae112..0c580ab5e 100644 --- a/os/connection.c +++ b/os/connection.c @@ -746,6 +746,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) free(oc); return NullClient; } + oc->local_client = ComputeLocalClient(client); #if !defined(WIN32) ConnectionTranslation[fd] = client->index; #else @@ -851,15 +852,14 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure) _XSERVTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); + if(trans_conn->flags & TRANS_NOXAUTH) + new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; + if (!AllocNewConnection (new_trans_conn, newconn, connect_time)) { ErrorConnMax(new_trans_conn); _XSERVTransClose(new_trans_conn); } - - if(trans_conn->flags & TRANS_NOXAUTH) - new_trans_conn->flags = new_trans_conn->flags | TRANS_NOXAUTH; - } #ifndef WIN32 } diff --git a/os/io.c b/os/io.c index fb9f76207..421023807 100644 --- a/os/io.c +++ b/os/io.c @@ -410,16 +410,29 @@ ReadRequestFromClient(ClientPtr client) else needed = sizeof(xReq); } - oci->lenLastReq = needed; /* If there are bytes to ignore, ignore them now. */ if (oci->ignoreBytes > 0) { assert(needed == oci->ignoreBytes || needed == oci->size); - oci->ignoreBytes -= gotnow; - needed = gotnow = 0; + /* + * The _XSERVTransRead call above may return more or fewer bytes than we + * want to ignore. Ignore the smaller of the two sizes. + */ + if (gotnow < needed) { + oci->ignoreBytes -= gotnow; + oci->bufptr += gotnow; + gotnow = 0; + } else { + oci->ignoreBytes -= needed; + oci->bufptr += needed; + gotnow -= needed; + } + needed = 0; } + oci->lenLastReq = needed; + /* * Check to see if client has at least one whole request in the * buffer beyond the request we're returning to the caller. diff --git a/os/log.c b/os/log.c index 0f90106df..03d8ec718 100644 --- a/os/log.c +++ b/os/log.c @@ -102,6 +102,10 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "xf86bigfontsrv.h" #endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif + #ifdef DDXOSVERRORF void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL; #endif @@ -121,7 +125,7 @@ static Bool needBuffer = TRUE; #include static char __crashreporter_info_buff__[4096] = {0}; -static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0]; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 // This is actually a toolchain requirement, but I'm not sure the correct check, // but it should be fine to just only include it for Leopard and later. This line @@ -185,11 +189,8 @@ LogInit(const char *fname, const char *backup) char *logFileName = NULL; if (fname && *fname) { - /* malloc() can't be used yet. */ - logFileName = malloc(strlen(fname) + strlen(display) + 1); - if (!logFileName) + if (asprintf(&logFileName, fname, display) == -1) FatalError("Cannot allocate space for the log file name\n"); - sprintf(logFileName, fname, display); if (backup && *backup) { struct stat buf; @@ -198,13 +199,9 @@ LogInit(const char *fname, const char *backup) char *suffix; char *oldLog; - oldLog = malloc(strlen(logFileName) + strlen(backup) + - strlen(display) + 1); - suffix = malloc(strlen(backup) + strlen(display) + 1); - if (!oldLog || !suffix) + if ((asprintf(&suffix, backup, display) == -1) || + (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1)) FatalError("Cannot allocate space for the log file name\n"); - sprintf(suffix, backup, display); - sprintf(oldLog, "%s%s", logFileName, suffix); free(suffix); if (rename(logFileName, oldLog) == -1) { FatalError("Cannot move old log file \"%s\" to \"%s\"\n", @@ -286,7 +283,7 @@ LogVWrite(int verb, const char *f, va_list args) if (logFile) fwrite(tmpBuffer, len, 1, logFile); #ifdef ANDROID - LOG(tmpBuffer); + // LOG(tmpBuffer); #endif } @@ -302,6 +299,9 @@ LogVWrite(int verb, const char *f, va_list args) newline = (tmpBuffer[len-1] == '\n'); if ((verb < 0 || logVerbosity >= verb) && len > 0) fwrite(tmpBuffer, len, 1, stderr); +#ifdef ANDROID + LOG(tmpBuffer); +#endif if ((verb < 0 || logFileVerbosity >= verb) && len > 0) { if (logFile) { fwrite(tmpBuffer, len, 1, logFile); @@ -313,17 +313,10 @@ LogVWrite(int verb, const char *f, va_list args) #endif } } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * malloc() and friends can't be used. - */ if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); + saveBuffer = realloc(saveBuffer, bufferSize); if (!saveBuffer) FatalError("realloc() failed while saving log messages\n"); } @@ -332,7 +325,7 @@ LogVWrite(int verb, const char *f, va_list args) bufferPos += len; } #ifdef ANDROID - LOG(tmpBuffer); + //LOG(tmpBuffer); #endif } } @@ -503,8 +496,7 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) ErrorF("%slast message repeated %d times\n", prefix != NULL ? prefix : "", nrepeat); nrepeat = 0; - if (prefix != NULL) - free(prefix); + free(prefix); return AUDIT_TIMEOUT; } else { /* if the timer expires without anything to print, flush the message */ @@ -537,8 +529,7 @@ VAuditF(const char *f, va_list args) nrepeat = 0; auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); } - if (prefix != NULL) - free(prefix); + free(prefix); } void @@ -554,7 +545,12 @@ FatalError(const char *f, ...) va_start(args, f); #ifdef __APPLE__ - (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args); + { + va_list args2; + va_copy(args2, args); + (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args2); + va_end(args2); + } #endif VErrorF(f, args); va_end(args); @@ -595,21 +591,14 @@ ErrorF(const char * f, ...) /* A perror() workalike. */ void -Error(char *str) +Error(const char *str) { - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); + const char *err = strerror(errno); + + if (str) + LogWrite(-1, "%s: %s", str, err); + else LogWrite(-1, "%s", err); - free(err); - } else - LogWrite(-1, "%s", strerror(saveErrno)); } void diff --git a/os/osdep.h b/os/osdep.h index 3c0e78f06..087e36d06 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -172,6 +172,7 @@ typedef struct _osComm { XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ + Bool local_client; } OsCommRec, *OsCommPtr; extern int FlushClient( @@ -217,6 +218,9 @@ typedef long int fd_mask; #define ffs mffs extern int mffs(fd_mask); +/* in access.c */ +extern Bool ComputeLocalClient(ClientPtr client); + /* in auth.c */ extern void GenerateRandomData (int len, char *buf); diff --git a/os/osinit.c b/os/osinit.c index c83c32cf5..45d202def 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -63,20 +63,10 @@ SOFTWARE. #include #endif +#include "misc.h" #include "dixstruct.h" -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif - -#if defined(__SCO__) -#include -#endif #if !defined(SYSV) && !defined(WIN32) #include @@ -209,7 +199,7 @@ OsInit(void) dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); #endif -#if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__) +#if !defined(__CYGWIN__) fclose(stdin); fclose(stdout); #endif diff --git a/os/strlcat.c b/os/strlcat.c index 91ceabb1c..7d53b0a6a 100644 --- a/os/strlcat.c +++ b/os/strlcat.c @@ -15,8 +15,8 @@ */ -#ifdef HAVE_XORG_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include diff --git a/os/strlcpy.c b/os/strlcpy.c index e8e1b0217..2e55b2e63 100644 --- a/os/strlcpy.c +++ b/os/strlcpy.c @@ -14,8 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_XORG_CONFIG_H -#include +#ifdef HAVE_DIX_CONFIG_H +#include #endif #include diff --git a/os/utils.c b/os/utils.c index ccbb7eb71..f22922e96 100644 --- a/os/utils.c +++ b/os/utils.c @@ -236,17 +236,6 @@ OsSignal(int sig, OsSigHandlerPtr handler) #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" -#ifndef PATH_MAX -#include -#ifndef PATH_MAX -#ifdef MAXPATHLEN -#define PATH_MAX MAXPATHLEN -#else -#define PATH_MAX 1024 -#endif -#endif -#endif - static Bool StillLocking = FALSE; static char LockFile[PATH_MAX]; static Bool nolock = FALSE; @@ -432,7 +421,21 @@ GetTimeInMillis(void) #ifdef MONOTONIC_CLOCK struct timespec tp; - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + static clockid_t clockid; + if (!clockid) { +#ifdef CLOCK_MONOTONIC_COARSE + if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 && + (tp.tv_nsec / 1000) <= 1000 && + clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0) + clockid = CLOCK_MONOTONIC_COARSE; + else +#endif + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + clockid = CLOCK_MONOTONIC; + else + clockid = ~0L; + } + if (clockid != ~0L && clock_gettime(clockid, &tp) == 0) return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L); #endif @@ -501,12 +504,9 @@ void UseMsg(void) ErrorF("-ls int limit stack space to N Kb\n"); #endif ErrorF("-nolock disable the locking mechanism\n"); -#ifndef NOLOGOHACK - ErrorF("-logo enable logo in screen saver\n"); - ErrorF("nologo disable logo in screen saver\n"); -#endif ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); + ErrorF("-background [none] create root window with no background\n"); ErrorF("-reset reset after last client exists\n"); ErrorF("-p # screen-saver pattern duration (minutes)\n"); ErrorF("-pn accept failure to listen on all ports\n"); @@ -760,16 +760,6 @@ ProcessCommandLine(int argc, char *argv[]) #endif nolock = TRUE; } -#ifndef NOLOGOHACK - else if ( strcmp( argv[i], "-logo") == 0) - { - logoScreenSaver = 1; - } - else if ( strcmp( argv[i], "nologo") == 0) - { - logoScreenSaver = 0; - } -#endif else if ( strcmp( argv[i], "-nolisten") == 0) { if(++i < argc) { @@ -847,6 +837,14 @@ ProcessCommandLine(int argc, char *argv[]) defaultBackingStore = WhenMapped; else if ( strcmp( argv[i], "-wr") == 0) whiteRoot = TRUE; + else if ( strcmp( argv[i], "-background") == 0) { + if(++i < argc) { + if (!strcmp ( argv[i], "none")) + bgNoneRoot = TRUE; + else + UseMsg(); + } + } else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { if(++i < argc) { long reqSizeArg = atol(argv[i]); @@ -1263,10 +1261,7 @@ System(char *command) perror("signal"); return -1; } - -#ifdef DEBUG - ErrorF("System: `%s'\n", command); -#endif + DebugF("System: `%s'\n", command); switch (pid = fork()) { case -1: /* error */ @@ -1325,6 +1320,9 @@ Popen(char *command, char *type) /* Ignore the smart scheduler while this is going on */ old_alarm = OsSignal(SIGALRM, SIG_IGN); if (old_alarm == SIG_ERR) { + close(pdes[0]); + close(pdes[1]); + free(cur); perror("signal"); return NULL; } @@ -1357,7 +1355,11 @@ Popen(char *command, char *type) } close(pdes[1]); } + #ifndef ANDROID execl("/bin/sh", "sh", "-c", command, (char *)NULL); + #else + execl("/system/bin/sh", "sh", "-c", command, (char *)NULL); + #endif _exit(127); } @@ -1378,9 +1380,7 @@ Popen(char *command, char *type) cur->next = pidlist; pidlist = cur; -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif + DebugF("Popen: `%s', fp = %p\n", command, iop); return iop; } @@ -1455,9 +1455,7 @@ Fopen(char *file, char *type) cur->next = pidlist; pidlist = cur; -#ifdef DEBUG - ErrorF("Fopen(%s), fp = %p\n", file, iop); -#endif + DebugF("Fopen(%s), fp = %p\n", file, iop); return iop; #else @@ -1486,10 +1484,7 @@ Pclose(pointer iop) int pstat; int pid; -#ifdef DEBUG - ErrorF("Pclose: fp = %p\n", iop); -#endif - + DebugF("Pclose: fp = %p\n", iop); fclose(iop); for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) diff --git a/os/xdmcp.c b/os/xdmcp.c index 877b11c15..f5331e1b9 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -486,7 +486,7 @@ XdmcpRegisterConnection ( } } #endif - if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) { + if (!fromAddr || memcmp(regAddr, fromAddr, regAddrlen) != 0) { return; } } diff --git a/os/xprintf.c b/os/xprintf.c index 71a4424f7..254b7374a 100644 --- a/os/xprintf.c +++ b/os/xprintf.c @@ -1,6 +1,13 @@ -/* - * printf routines which xalloc their buffer - */ +/** + * @file + * + * @section DESCRIPTION + * + * These functions provide a portable implementation of the common (but not + * yet universal) asprintf & vasprintf routines to allocate a buffer big + * enough to sprintf the arguments to. The XNF variants terminate the server + * if the allocation fails. + */ /* * Copyright (c) 2004 Alexander Gottwald * @@ -26,6 +33,29 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -35,6 +65,13 @@ #include #include +#ifdef asprintf +# undef asprintf +#endif +#ifdef vasprintf +# undef vasprintf +#endif + #ifndef va_copy # ifdef __va_copy # define va_copy __va_copy @@ -42,11 +79,23 @@ # error "no working va_copy was found" # endif #endif - -char * -Xvprintf(const char *format, va_list va) + +/** + * Varargs sprintf that allocates a string buffer the right size for + * the pattern & data provided and prints the requested data to it. + * + * @param ret Pointer to which the newly allocated buffer is written + * (contents undefined on error) + * @param format printf style format string + * @param va variable argument list + * @return size of allocated buffer, or -1 on error. + */ +int +Xvasprintf(char **ret, const char * _X_RESTRICT_KYWD format, va_list va) { - char *ret; +#ifdef HAVE_VASPRINTF + return vasprintf(ret, format, va); +#else int size; va_list va2; @@ -54,12 +103,94 @@ Xvprintf(const char *format, va_list va) size = vsnprintf(NULL, 0, format, va2); va_end(va2); - ret = (char *)malloc(size + 1); - if (ret == NULL) - return NULL; + *ret = malloc(size + 1); + if (*ret == NULL) + return -1; + + vsnprintf(*ret, size + 1, format, va); + (*ret)[size] = 0; + return size; +#endif +} + +#ifndef HAVE_VASPRINTF +# define vasprintf Xvasprintf +#endif + +/** + * sprintf that allocates a string buffer the right size for + * the pattern & data provided and prints the requested data to it. + * + * @param ret Pointer to which the newly allocated buffer is written + * (contents undefined on error) + * @param format printf style format string + * @param ... arguments for specified format + * @return size of allocated buffer, or -1 on error. + */ +int +Xasprintf(char ** ret, const char * _X_RESTRICT_KYWD format, ...) +{ + int size; + va_list va; + va_start(va, format); + size = vasprintf(ret, format, va); + va_end(va); + return size; +} + +/** + * Varargs sprintf that allocates a string buffer the right size for + * the pattern & data provided and prints the requested data to it. + * On failure, issues a FatalError message and aborts the server. + * + * @param ret Pointer to which the newly allocated buffer is written + * (contents undefined on error) + * @param format printf style format string + * @param va variable argument list + * @return size of allocated buffer + */ +int +XNFvasprintf(char **ret, const char * _X_RESTRICT_KYWD format, va_list va) +{ + int size = vasprintf(ret, format, va); + if ((size == -1) || (*ret == NULL)) { + Error("XNFvasprintf"); + FatalError("XNFvasprintf failed"); + } + return size; +} + +/** + * sprintf that allocates a string buffer the right size for + * the pattern & data provided and prints the requested data to it. + * On failure, issues a FatalError message and aborts the server. + * + * @param ret Pointer to which the newly allocated buffer is written + * (contents undefined on error) + * @param format printf style format string + * @param ... arguments for specified format + * @return size of allocated buffer + */ +int +XNFasprintf(char ** ret, const char * _X_RESTRICT_KYWD format, ...) +{ + int size; + va_list va; + va_start(va, format); + size = XNFvasprintf(ret, format, va); + va_end(va); + return size; +} + +/* Old api, now deprecated, may be removed in the future */ +char * +Xvprintf(const char *format, va_list va) +{ + char *ret; + + if (vasprintf(&ret, format, va) == -1) + ret = NULL; - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; return ret; } @@ -68,7 +199,8 @@ char *Xprintf(const char *format, ...) char *ret; va_list va; va_start(va, format); - ret = Xvprintf(format, va); + if (vasprintf(&ret, format, va) == -1) + ret = NULL; va_end(va); return ret; } @@ -77,19 +209,9 @@ char * XNFvprintf(const char *format, va_list va) { char *ret; - int size; - va_list va2; - - va_copy(va2, va); - size = vsnprintf(NULL, 0, format, va2); - va_end(va2); - ret = (char *)xnfalloc(size + 1); - if (ret == NULL) - return NULL; + XNFvasprintf(&ret, format, va); - vsnprintf(ret, size + 1, format, va); - ret[size] = 0; return ret; } @@ -98,7 +220,7 @@ char *XNFprintf(const char *format, ...) char *ret; va_list va; va_start(va, format); - ret = XNFvprintf(format, va); + XNFvasprintf(&ret, format, va); va_end(va); return ret; } diff --git a/os/xstrans.c b/os/xstrans.c index c086e225b..44ff976a9 100644 --- a/os/xstrans.c +++ b/os/xstrans.c @@ -2,6 +2,11 @@ #include #endif +#include + +/* ErrorF is used by xtrans */ +extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2); + #define TRANS_REOPEN #define TRANS_SERVER #define XSERV_t diff --git a/randr/randr.c b/randr/randr.c index 607770520..d33712928 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -270,6 +270,8 @@ Bool RRScreenInit(ScreenPtr pScreen) wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); + pScreen->ConstrainCursorHarder = RRConstrainCursorHarder; + pScrPriv->numOutputs = 0; pScrPriv->outputs = NULL; pScrPriv->numCrtcs = 0; diff --git a/randr/randrstr.h b/randr/randrstr.h index 7ea608003..d8dd37d96 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -297,6 +297,7 @@ typedef struct _rrScrPriv { int rate; int size; #endif + Bool discontiguous; } rrScrPrivRec, *rrScrPrivPtr; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; @@ -700,6 +701,9 @@ ProcRRGetPanning (ClientPtr client); int ProcRRSetPanning (ClientPtr client); +void +RRConstrainCursorHarder (DeviceIntPtr, ScreenPtr, int, int *, int *); + /* rrdispatch.c */ extern _X_EXPORT Bool RRClientKnowsRates (ClientPtr pClient); diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 98206a2b9..d4d8f2ad2 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1,5 +1,6 @@ /* * Copyright © 2006 Keith Packard + * Copyright 2010 Red Hat, Inc * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,6 +23,7 @@ #include "randrstr.h" #include "swaprep.h" +#include "mipointer.h" RESTYPE RRCrtcType; @@ -292,6 +294,92 @@ RRCrtcPendingProperties (RRCrtcPtr crtc) return FALSE; } +static void +crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom) +{ + *left = crtc->x; + *top = crtc->y; + + switch (crtc->rotation) { + case RR_Rotate_0: + case RR_Rotate_180: + default: + *right = crtc->x + crtc->mode->mode.width; + *bottom = crtc->y + crtc->mode->mode.height; + return; + case RR_Rotate_90: + case RR_Rotate_270: + *right = crtc->x + crtc->mode->mode.height; + *bottom = crtc->y + crtc->mode->mode.width; + return; + } +} + +/* overlapping counts as adjacent */ +static Bool +crtcs_adjacent(const RRCrtcPtr a, const RRCrtcPtr b) +{ + /* left, right, top, bottom... */ + int al, ar, at, ab; + int bl, br, bt, bb; + int cl, cr, ct, cb; /* the overlap, if any */ + + crtc_bounds(a, &al, &ar, &at, &ab); + crtc_bounds(b, &bl, &br, &bt, &bb); + + cl = max(al, bl); + cr = min(ar, br); + ct = max(at, bt); + cb = min(ab, bb); + + return (cl <= cr) && (ct <= cb); +} + +/* Depth-first search and mark all CRTCs reachable from cur */ +static void +mark_crtcs (rrScrPrivPtr pScrPriv, int *reachable, int cur) +{ + int i; + reachable[cur] = TRUE; + for (i = 0; i < pScrPriv->numCrtcs; ++i) { + if (reachable[i] || !pScrPriv->crtcs[i]->mode) + continue; + if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i])) + mark_crtcs(pScrPriv, reachable, i); + } +} + +static void +RRComputeContiguity (ScreenPtr pScreen) +{ + rrScrPriv(pScreen); + Bool discontiguous = TRUE; + int i, n = pScrPriv->numCrtcs; + + int *reachable = calloc(n, sizeof(int)); + if (!reachable) + goto out; + + /* Find first enabled CRTC and start search for reachable CRTCs from it */ + for (i = 0; i < n; ++i) { + if (pScrPriv->crtcs[i]->mode) { + mark_crtcs(pScrPriv, reachable, i); + break; + } + } + + /* Check that all enabled CRTCs were marked as reachable */ + for (i = 0; i < n; ++i) + if (pScrPriv->crtcs[i]->mode && !reachable[i]) + goto out; + + discontiguous = FALSE; + +out: + free(reachable); + pScrPriv->discontiguous = discontiguous; +} + /* * Request that the Crtc be reconfigured */ @@ -306,6 +394,7 @@ RRCrtcSet (RRCrtcPtr crtc, { ScreenPtr pScreen = crtc->pScreen; Bool ret = FALSE; + Bool recompute = TRUE; rrScrPriv(pScreen); /* See if nothing changed */ @@ -318,6 +407,7 @@ RRCrtcSet (RRCrtcPtr crtc, !RRCrtcPendingProperties (crtc) && !RRCrtcPendingTransform (crtc)) { + recompute = FALSE; ret = TRUE; } else @@ -381,6 +471,10 @@ RRCrtcSet (RRCrtcPtr crtc, RRPostPendingProperties (outputs[o]); } } + + if (recompute) + RRComputeContiguity(pScreen); + return ret; } @@ -1349,3 +1443,64 @@ ProcRRGetCrtcTransform (ClientPtr client) free(reply); return Success; } + +void +RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, int *y) +{ + rrScrPriv (pScreen); + int i; + + /* intentional dead space -> let it float */ + if (pScrPriv->discontiguous) + return; + + /* if we're moving inside a crtc, we're fine */ + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + int left, right, top, bottom; + + if (!crtc->mode) + continue; + + crtc_bounds(crtc, &left, &right, &top, &bottom); + + if ((*x >= left) && (*x <= right) && (*y >= top) && (*y <= bottom)) + return; + } + + /* if we're trying to escape, clamp to the CRTC we're coming from */ + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + int nx, ny; + int left, right, top, bottom; + + if (!crtc->mode) + continue; + + crtc_bounds(crtc, &left, &right, &top, &bottom); + miPointerGetPosition(pDev, &nx, &ny); + + if ((nx >= left) && (nx <= right) && (ny >= top) && (ny <= bottom)) { + if ((*x <= left) || (*x >= right)) { + int dx = *x - nx; + + if (dx > 0) + *x = right; + else if (dx < 0) + *x = left; + } + + if ((*y <= top) || (*y >= bottom)) { + int dy = *y - ny; + + if (dy > 0) + *y = bottom; + else if (dy < 0) + *y = top; + } + + return; + } + } +} diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index ebfda5717..d1c99c288 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -28,14 +28,14 @@ RRClientKnowsRates (ClientPtr pClient) { rrClientPriv(pClient); - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); + return version_compare(pRRClient->major_version, pRRClient->minor_version, + 1, 1) >= 0; } static int ProcRRQueryVersion (ClientPtr client) { - xRRQueryVersionReply rep; + xRRQueryVersionReply rep = {0}; register int n; REQUEST(xRRQueryVersionReq); rrClientPriv(client); @@ -47,8 +47,8 @@ ProcRRQueryVersion (ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; - if ((stuff->majorVersion * 1000 + stuff->minorVersion) < - (SERVER_RANDR_MAJOR_VERSION * 1000 + SERVER_RANDR_MINOR_VERSION)) + if (version_compare(stuff->majorVersion, stuff->minorVersion, + SERVER_RANDR_MAJOR_VERSION, SERVER_RANDR_MINOR_VERSION) < 0) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; @@ -146,7 +146,7 @@ ProcRRSelectInput (ClientPtr client) /* * Now see if the client needs an event */ - if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask)) + if (pScrPriv) { pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; if (CompareTimeStamps (pTimes->setTime, @@ -154,7 +154,35 @@ ProcRRSelectInput (ClientPtr client) CompareTimeStamps (pTimes->configTime, pScrPriv->lastConfigTime) != 0) { - RRDeliverScreenEvent (client, pWin, pScreen); + if (pRREvent->mask & RRScreenChangeNotifyMask) + { + RRDeliverScreenEvent (client, pWin, pScreen); + } + + if (pRREvent->mask & RRCrtcChangeNotifyMask) + { + int i; + + for (i = 0; i < pScrPriv->numCrtcs; i++) + { + RRDeliverCrtcEvent (client, pWin, pScrPriv->crtcs[i]); + } + } + + if (pRREvent->mask & RROutputChangeNotifyMask) + { + int i; + + for (i = 0; i < pScrPriv->numOutputs; i++) + { + RRDeliverOutputEvent (client, pWin, pScrPriv->outputs[i]); + } + } + + /* We don't check for RROutputPropertyNotifyMask, as randrproto.txt doesn't + * say if there ought to be notifications of changes to output properties + * if those changes occurred before the time RRSelectInput is called. + */ } } } diff --git a/randr/rrmode.c b/randr/rrmode.c index 5ffa4006f..d7560dcb2 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -288,7 +288,7 @@ int ProcRRCreateMode (ClientPtr client) { REQUEST(xRRCreateModeReq); - xRRCreateModeReply rep; + xRRCreateModeReply rep = {0}; WindowPtr pWin; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; diff --git a/randr/rrscreen.c b/randr/rrscreen.c index f58e6578a..da6d48d6e 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -910,11 +910,23 @@ ProcRRSetScreenConfig (ClientPtr client) */ width = mode->mode.width; height = mode->mode.height; + if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) { + client->errorValue = width; + free(pData); + return BadValue; + } + if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) { + client->errorValue = height; + free(pData); + return BadValue; + } + if (rotation & (RR_Rotate_90|RR_Rotate_270)) { width = mode->mode.height; height = mode->mode.width; } + if (width != pScreen->width || height != pScreen->height) { int c; diff --git a/record/record.c b/record/record.c index 6a93d7a5c..69fca727e 100644 --- a/record/record.c +++ b/record/record.c @@ -77,6 +77,7 @@ typedef struct { char bufCategory; /* category of protocol in replyBuffer */ int numBufBytes; /* number of bytes in replyBuffer */ char replyBuffer[REPLY_BUF_SIZE]; /* buffered recorded protocol */ + int inFlush; /* are we inside RecordFlushReplyBuffer */ } RecordContextRec, *RecordContextPtr; /* RecordMinorOpRec - to hold minor opcode selections for extension requests @@ -245,8 +246,9 @@ RecordFlushReplyBuffer( int len2 ) { - if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone) + if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone || pContext->inFlush) return; + ++pContext->inFlush; if (pContext->numBufBytes) WriteToClient(pContext->pRecordingClient, pContext->numBufBytes, (char *)pContext->replyBuffer); @@ -255,6 +257,7 @@ RecordFlushReplyBuffer( WriteToClient(pContext->pRecordingClient, len1, (char *)data1); if (len2) WriteToClient(pContext->pRecordingClient, len2, (char *)data2); + --pContext->inFlush; } /* RecordFlushReplyBuffer */ @@ -818,9 +821,11 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) /* TODO check return values */ if (IsMaster(pei->device)) { - xEvent xE; - EventToCore(pei->event, &xE); - RecordSendProtocolEvents(pRCAP, pContext, &xE, 1); + xEvent *core_events; + EventToCore(pei->event, &core_events, &count); + RecordSendProtocolEvents(pRCAP, pContext, core_events, + count); + free(core_events); } EventToXI(pei->event, &xi_events, &count); @@ -1938,6 +1943,7 @@ ProcRecordCreateContext(ClientPtr client) pContext->numBufBytes = 0; pContext->pBufClient = NULL; pContext->continuedReply = 0; + pContext->inFlush = 0; err = RecordRegisterClients(pContext, client, (xRecordRegisterClientsReq *)stuff); @@ -1952,7 +1958,7 @@ ProcRecordCreateContext(ClientPtr client) else { RecordDeleteContext((pointer)pContext, pContext->id); - err = BadAlloc; + return BadAlloc; } bailout: free(pContext); diff --git a/render/Makefile.am b/render/Makefile.am index 216c6134e..d02028b3b 100644 --- a/render/Makefile.am +++ b/render/Makefile.am @@ -13,9 +13,8 @@ librender_la_SOURCES = \ mitrap.c \ mitri.c \ picture.c \ - render.c \ - renderedge.c + render.c if XORG -sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h renderedge.h +sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h endif diff --git a/render/animcur.c b/render/animcur.c index 2160f5043..31cbab9a6 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -95,8 +95,6 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen) Bool ret; Unwrap(as, pScreen, CloseScreen); - - Unwrap(as, pScreen, BlockHandler); Unwrap(as, pScreen, CursorLimits); Unwrap(as, pScreen, DisplayCursor); @@ -150,6 +148,7 @@ AnimCurScreenBlockHandler (int screenNum, ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; + Bool activeDevice = FALSE; CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ @@ -157,7 +156,10 @@ AnimCurScreenBlockHandler (int screenNum, { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { - if (!now) now = GetTimeInMillis (); + if (!activeDevice) { + now = GetTimeInMillis (); + activeDevice = TRUE; + } if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { @@ -187,12 +189,15 @@ AnimCurScreenBlockHandler (int screenNum, } } - if (now) + if (activeDevice) AdjustWaitForDelay (pTimeout, soonest - now); Unwrap (as, pScreen, BlockHandler); (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); - Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + if (activeDevice) + Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + else + as->BlockHandler = NULL; } static Bool @@ -218,6 +223,9 @@ AnimCurDisplayCursor (DeviceIntPtr pDev, pDev->spriteInfo->anim.time = GetTimeInMillis () + ac->elts[0].delay; pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; + + if (!as->BlockHandler) + Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); } } else @@ -244,8 +252,12 @@ AnimCurSetCursorPosition (DeviceIntPtr pDev, Bool ret; Unwrap (as, pScreen, SetCursorPosition); - if (pDev->spriteInfo->anim.pCursor) + if (pDev->spriteInfo->anim.pCursor) { pDev->spriteInfo->anim.pScreen = pScreen; + + if (!as->BlockHandler) + Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + } ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); return ret; @@ -330,7 +342,7 @@ AnimCurInit (ScreenPtr pScreen) return FALSE; Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); - Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); + as->BlockHandler = NULL; Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); diff --git a/render/glyphstr.h b/render/glyphstr.h index 6c1a837e0..cc9f2843f 100644 --- a/render/glyphstr.h +++ b/render/glyphstr.h @@ -71,10 +71,9 @@ typedef struct _GlyphHash { typedef struct _GlyphSet { CARD32 refcnt; - PictFormatPtr format; int fdepth; + PictFormatPtr format; GlyphHashRec hash; - int maxPrivate; PrivateRec *devPrivates; } GlyphSetRec, *GlyphSetPtr; diff --git a/render/miindex.c b/render/miindex.c index 5e2e06c35..4603136a4 100644 --- a/render/miindex.c +++ b/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen, PictFormatPtr pFormat) { - if (pFormat->index.devPrivate) - { - free(pFormat->index.devPrivate); - pFormat->index.devPrivate = 0; - } - if (pFormat->index.pValues) - { - free(pFormat->index.pValues); - pFormat->index.pValues = 0; - } + free(pFormat->index.devPrivate); + pFormat->index.devPrivate = NULL; + free(pFormat->index.pValues); + pFormat->index.pValues = NULL; } void diff --git a/render/mipict.c b/render/mipict.c index b5b897037..08b2fa722 100644 --- a/render/mipict.c +++ b/render/mipict.c @@ -333,12 +333,8 @@ miClipPictureSrc (RegionPtr pRegion, return TRUE; } -void -miCompositeSourceValidate (PicturePtr pPicture, - INT16 x, - INT16 y, - CARD16 width, - CARD16 height) +static void +SourceValidateOnePicture (PicturePtr pPicture) { DrawablePtr pDrawable = pPicture->pDrawable; ScreenPtr pScreen; @@ -347,49 +343,22 @@ miCompositeSourceValidate (PicturePtr pPicture, return; pScreen = pDrawable->pScreen; - + if (pScreen->SourceValidate) { - if (pPicture->transform) - { - xPoint points[4]; - int i; - int xmin, ymin, xmax, ymax; - -#define VectorSet(i,_x,_y) { points[i].x = _x; points[i].y = _y; } - VectorSet (0, x, y); - VectorSet (1, x + width, y); - VectorSet (2, x, y + height); - VectorSet (3, x + width, y + height); - xmin = ymin = 32767; - xmax = ymax = -32737; - for (i = 0; i < 4; i++) - { - PictVector t; - t.vector[0] = IntToxFixed (points[i].x); - t.vector[1] = IntToxFixed (points[i].y); - t.vector[2] = xFixed1; - if (pixman_transform_point (pPicture->transform, &t)) - { - int tx = xFixedToInt (t.vector[0]); - int ty = xFixedToInt (t.vector[1]); - if (tx < xmin) xmin = tx; - if (tx > xmax) xmax = tx; - if (ty < ymin) ymin = ty; - if (ty > ymax) ymax = ty; - } - } - x = xmin; - y = ymin; - width = xmax - xmin; - height = ymax - ymin; - } - x += pPicture->pDrawable->x; - y += pPicture->pDrawable->y; - (*pScreen->SourceValidate) (pDrawable, x, y, width, height); + pScreen->SourceValidate ( + pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode); } } +void +miCompositeSourceValidate (PicturePtr pPicture) +{ + SourceValidateOnePicture (pPicture); + if (pPicture->alphaMap) + SourceValidateOnePicture (pPicture->alphaMap); +} + /* * returns FALSE if the final region is empty. Indistinguishable from * an allocation failure, but rendering ignores those anyways. @@ -479,9 +448,9 @@ miComputeCompositeRegion (RegionPtr pRegion, } - miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height); + miCompositeSourceValidate (pSrc); if (pMask) - miCompositeSourceValidate (pMask, xMask, yMask, width, height); + miCompositeSourceValidate (pMask); return TRUE; } @@ -630,10 +599,8 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->Composite = 0; /* requires DDX support */ ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; - ps->Trapezoids = miTrapezoids; - ps->Triangles = miTriangles; - ps->TriStrip = miTriStrip; - ps->TriFan = miTriFan; + ps->Trapezoids = 0; + ps->Triangles = 0; ps->RasterizeTrapezoid = 0; /* requires DDX support */ ps->AddTraps = 0; /* requires DDX support */ diff --git a/render/mipict.h b/render/mipict.h index eb6b6645d..f6d9deefd 100644 --- a/render/mipict.h +++ b/render/mipict.h @@ -81,11 +81,8 @@ miChangePictureFilter (PicturePtr pPicture, int nparams); extern _X_EXPORT void -miCompositeSourceValidate (PicturePtr pPicture, - INT16 x, - INT16 y, - CARD16 width, - CARD16 height); +miCompositeSourceValidate (PicturePtr pPicture); + extern _X_EXPORT Bool miComputeCompositeRegion (RegionPtr pRegion, PicturePtr pSrc, @@ -145,59 +142,12 @@ miCompositeRects (CARD8 op, extern _X_EXPORT void miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box); -extern _X_EXPORT void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps); - extern _X_EXPORT void miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds); extern _X_EXPORT void miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds); -extern _X_EXPORT void -miTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris); - -extern _X_EXPORT void -miTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -extern _X_EXPORT void -miTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -extern _X_EXPORT PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height); - extern _X_EXPORT Bool miInitIndexed (ScreenPtr pScreen, PictFormatPtr pFormat); diff --git a/render/mitrap.c b/render/mitrap.c index 8bdc8a8d0..445f23630 100644 --- a/render/mitrap.c +++ b/render/mitrap.c @@ -34,55 +34,6 @@ #include "picturestr.h" #include "mipict.h" -PicturePtr -miCreateAlphaPicture (ScreenPtr pScreen, - PicturePtr pDst, - PictFormatPtr pPictFormat, - CARD16 width, - CARD16 height) -{ - PixmapPtr pPixmap; - PicturePtr pPicture; - GCPtr pGC; - int error; - xRectangle rect; - - if (width > 32767 || height > 32767) - return 0; - - if (!pPictFormat) - { - if (pDst->polyEdge == PolyEdgeSharp) - pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - if (!pPictFormat) - return 0; - } - - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth, 0); - if (!pPixmap) - return 0; - pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); - if (!pGC) - { - (*pScreen->DestroyPixmap) (pPixmap); - return 0; - } - ValidateGC (&pPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat, - 0, 0, serverClient, &error); - (*pScreen->DestroyPixmap) (pPixmap); - return pPicture; -} - static xFixed miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) { @@ -126,64 +77,3 @@ miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) box->x2 = x2; } } - -void -miTrapezoids (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntrap, - xTrapezoid *traps) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - /* - * Check for solid alpha add - */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) - { - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); - } - else if (maskFormat) - { - PicturePtr pPicture; - BoxRec bounds; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = traps[0].left.p1.x >> 16; - yDst = traps[0].left.p1.y >> 16; - - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - for (; ntrap; ntrap--, traps++) - (*ps->RasterizeTrapezoid) (pPicture, traps, - -bounds.x1, -bounds.y1); - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - else - { - if (pDst->polyEdge == PolyEdgeSharp) - maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - for (; ntrap; ntrap--, traps++) - miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); - } -} diff --git a/render/mitri.c b/render/mitri.c index a805a717c..b322a7c62 100644 --- a/render/mitri.c +++ b/render/mitri.c @@ -66,126 +66,3 @@ miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds) { miPointFixedBounds (ntri * 3, (xPointFixed *) tris, bounds); } - -void -miTriangles (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int ntri, - xTriangle *tris) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - - /* - * Check for solid alpha add - */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) - { - (*ps->AddTriangles) (pDst, 0, 0, ntri, tris); - } - else if (maskFormat) - { - BoxRec bounds; - PicturePtr pPicture; - INT16 xDst, yDst; - INT16 xRel, yRel; - - xDst = tris[0].p1.x >> 16; - yDst = tris[0].p1.y >> 16; - - miTriangleBounds (ntri, tris, &bounds); - if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1) - return; - pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat, - bounds.x2 - bounds.x1, - bounds.y2 - bounds.y1); - if (!pPicture) - return; - (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); - - xRel = bounds.x1 + xSrc - xDst; - yRel = bounds.y1 + ySrc - yDst; - CompositePicture (op, pSrc, pPicture, pDst, - xRel, yRel, 0, 0, bounds.x1, bounds.y1, - bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); - FreePicture (pPicture, 0); - } - else - { - if (pDst->polyEdge == PolyEdgeSharp) - maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); - else - maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); - - for (; ntri; ntri--, tris++) - miTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris); - } -} - -void -miTriStrip (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - xTriangle *tris, *tri; - int ntri; - - if (npoint < 3) - return; - ntri = npoint - 2; - tris = malloc(ntri * sizeof (xTriangle)); - if (!tris) - return; - for (tri = tris; npoint >= 3; npoint--, points++, tri++) - { - tri->p1 = points[0]; - tri->p2 = points[1]; - tri->p3 = points[2]; - } - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - free(tris); -} - -void -miTriFan (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); - xTriangle *tris, *tri; - xPointFixed *first; - int ntri; - - if (npoint < 3) - return; - ntri = npoint - 2; - tris = malloc(ntri * sizeof (xTriangle)); - if (!tris) - return; - first = points++; - for (tri = tris; npoint >= 3; npoint--, points++, tri++) - { - tri->p1 = *first; - tri->p2 = points[0]; - tri->p3 = points[1]; - } - (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - free(tris); -} diff --git a/render/picture.c b/render/picture.c index 7fda6b93a..5640c4d96 100644 --- a/render/picture.c +++ b/render/picture.c @@ -158,7 +158,7 @@ addFormat (FormatInitRec formats[256], return ++nformat; } -#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) +#define Mask(n) ((1 << (n)) - 1) PictFormatPtr PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) @@ -735,13 +735,12 @@ SetPictureToDefaults (PicturePtr pPicture) pPicture->transform = 0; - pPicture->dither = None; pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); pPicture->filter_params = 0; pPicture->filter_nparams = 0; pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; - pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; + pPicture->stateChanges = -1; pPicture->pSourcePict = 0; } @@ -812,51 +811,6 @@ static CARD32 xRenderColorToCard32(xRenderColor c) (c.blue >> 8); } -static unsigned int premultiply(unsigned int x) -{ - unsigned int a = x >> 24; - unsigned int t = (x & 0xff00ff) * a + 0x800080; - t = (t + ((t >> 8) & 0xff00ff)) >> 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff) * a + 0x80; - x = (x + ((x >> 8) & 0xff)); - x &= 0xff00; - x |= t | (a << 24); - return x; -} - -static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a, - unsigned int y, unsigned int b) -{ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t >>= 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x &= 0xff00ff00; - x |= t; - return x; -} - -CARD32 -PictureGradientColor (PictGradientStopPtr stop1, - PictGradientStopPtr stop2, - CARD32 x) -{ - CARD32 current_color, next_color; - int dist, idist; - - current_color = xRenderColorToCard32 (stop1->color); - next_color = xRenderColorToCard32 (stop2->color); - - dist = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x)); - idist = 256 - dist; - - return premultiply (INTERPOLATE_PIXEL_256 (current_color, idist, - next_color, dist)); -} - static void initGradient(SourcePictPtr pGradient, int stopCount, xFixed *stopPoints, xRenderColor *stopColors, int *error) { @@ -889,11 +843,6 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, pGradient->gradient.stops[i].x = stopPoints[i]; pGradient->gradient.stops[i].color = stopColors[i]; } - - pGradient->gradient.class = SourcePictClassUnknown; - pGradient->gradient.stopRange = 0xffff; - pGradient->gradient.colorTable = NULL; - pGradient->gradient.colorTableSize = 0; } static PicturePtr createSourcePicture(void) @@ -968,8 +917,6 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, return pPicture; } -#define FixedToDouble(x) ((x)/65536.) - PicturePtr CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer, xFixed innerRadius, xFixed outerRadius, @@ -1005,12 +952,6 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer radial->c2.x = outer->x; radial->c2.y = outer->y; radial->c2.radius = outerRadius; - radial->cdx = (radial->c2.x - radial->c1.x) / 65536.; - radial->cdy = (radial->c2.y - radial->c1.y) / 65536.; - radial->dr = (radial->c2.radius - radial->c1.radius) / 65536.; - radial->A = ( radial->cdx * radial->cdx - + radial->cdy * radial->cdy - - radial->dr * radial->dr); initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { @@ -1261,7 +1202,7 @@ ChangePicture (PicturePtr pPicture, } break; case CPDither: - pPicture->dither = NEXT_VAL(Atom); + (void) NEXT_VAL(Atom); /* unimplemented */ break; case CPComponentAlpha: { @@ -1391,11 +1332,8 @@ SetPictureTransform (PicturePtr pPicture, } else { - if (pPicture->transform) - { - free(pPicture->transform); - pPicture->transform = 0; - } + free(pPicture->transform); + pPicture->transform = NULL; } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; @@ -1483,7 +1421,6 @@ CopyPicture (PicturePtr pSrc, pDst->polyMode = pSrc->polyMode; break; case CPDither: - pDst->dither = pSrc->dither; break; case CPComponentAlpha: pDst->componentAlpha = pSrc->componentAlpha; @@ -1778,11 +1715,23 @@ CompositeTriStrip (CARD8 op, int npoints, xPointFixed *points) { - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); + xTriangle *tris, *tri; + int ntri; - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); + if (npoints < 3) + return; + ntri = npoints - 2; + tris = malloc(ntri * sizeof (xTriangle)); + if (!tris) + return; + for (tri = tris; npoints >= 3; npoints--, points++, tri++) + { + tri->p1 = points[0]; + tri->p2 = points[1]; + tri->p3 = points[2]; + } + CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); + free(tris); } void @@ -1795,11 +1744,25 @@ CompositeTriFan (CARD8 op, int npoints, xPointFixed *points) { - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); + xTriangle *tris, *tri; + xPointFixed *first; + int ntri; - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points); + if (npoints < 3) + return; + ntri = npoints - 2; + tris = malloc(ntri * sizeof (xTriangle)); + if (!tris) + return; + first = points++; + for (tri = tris; npoints >= 3; npoints--, points++, tri++) + { + tri->p1 = *first; + tri->p2 = points[0]; + tri->p3 = points[1]; + } + CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); + free(tris); } void diff --git a/render/picturestr.h b/render/picturestr.h index 5c6c41e23..7b7f9112d 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -65,13 +65,8 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr; #define SourcePictTypeRadial 2 #define SourcePictTypeConical 3 -#define SourcePictClassUnknown 0 -#define SourcePictClassHorizontal 1 -#define SourcePictClassVertical 2 - typedef struct _PictSolidFill { unsigned int type; - unsigned int class; CARD32 color; } PictSolidFill, *PictSolidFillPtr; @@ -82,22 +77,14 @@ typedef struct _PictGradientStop { typedef struct _PictGradient { unsigned int type; - unsigned int class; int nstops; PictGradientStopPtr stops; - int stopRange; - CARD32 *colorTable; - int colorTableSize; } PictGradient, *PictGradientPtr; typedef struct _PictLinearGradient { unsigned int type; - unsigned int class; int nstops; PictGradientStopPtr stops; - int stopRange; - CARD32 *colorTable; - int colorTableSize; xPointFixed p1; xPointFixed p2; } PictLinearGradient, *PictLinearGradientPtr; @@ -110,28 +97,16 @@ typedef struct _PictCircle { typedef struct _PictRadialGradient { unsigned int type; - unsigned int class; int nstops; PictGradientStopPtr stops; - int stopRange; - CARD32 *colorTable; - int colorTableSize; PictCircle c1; PictCircle c2; - double cdx; - double cdy; - double dr; - double A; } PictRadialGradient, *PictRadialGradientPtr; typedef struct _PictConicalGradient { unsigned int type; - unsigned int class; int nstops; PictGradientStopPtr stops; - int stopRange; - CARD32 *colorTable; - int colorTableSize; xPointFixed center; xFixed angle; } PictConicalGradient, *PictConicalGradientPtr; @@ -151,8 +126,6 @@ typedef struct _Picture { PictFormatShort format; /* PICT_FORMAT */ int refcnt; CARD32 id; - PicturePtr pNext; /* chain on same drawable */ - unsigned int repeat : 1; unsigned int graphicsExposures : 1; unsigned int subWindowMode : 1; @@ -162,7 +135,11 @@ typedef struct _Picture { unsigned int clientClipType : 2; unsigned int componentAlpha : 1; unsigned int repeatType : 2; - unsigned int unused : 21; + unsigned int filter : 3; + unsigned int stateChanges : CPLastBit; + unsigned int unused : 18 - CPLastBit; + + PicturePtr pNext; /* chain on same drawable */ PicturePtr alphaMap; DDXPointRec alphaOrigin; @@ -170,9 +147,6 @@ typedef struct _Picture { DDXPointRec clipOrigin; pointer clientClip; - Atom dither; - - unsigned long stateChanges; unsigned long serialNumber; RegionPtr pCompositeClip; @@ -181,10 +155,9 @@ typedef struct _Picture { PictTransform *transform; - int filter; + SourcePictPtr pSourcePict; xFixed *filter_params; int filter_nparams; - SourcePictPtr pSourcePict; } PictureRec; typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, @@ -205,6 +178,7 @@ typedef struct { #define PictFilterBest 4 #define PictFilterConvolution 5 +/* if you add an 8th filter, expand the filter bitfield above */ typedef struct { char *alias; @@ -286,24 +260,6 @@ typedef void (*TrianglesProcPtr) (CARD8 op, int ntri, xTriangle *tris); -typedef void (*TriStripProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - -typedef void (*TriFanProcPtr) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int npoint, - xPointFixed *points); - typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat); @@ -382,8 +338,6 @@ typedef struct _PictureScreen { TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; - TriStripProcPtr TriStrip; - TriFanProcPtr TriFan; RasterizeTrapezoidProcPtr RasterizeTrapezoid; @@ -617,11 +571,6 @@ CompositeTriFan (CARD8 op, int npoints, xPointFixed *points); -extern _X_EXPORT CARD32 -PictureGradientColor (PictGradientStopPtr stop1, - PictGradientStopPtr stop2, - CARD32 x); - extern _X_EXPORT void RenderExtensionInit (void); Bool diff --git a/render/render.c b/render/render.c index 00241f9af..ebb1d630a 100644 --- a/render/render.c +++ b/render/render.c @@ -47,6 +47,11 @@ #include "xace.h" #include "protocol-versions.h" +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" +#endif + #if HAVE_STDINT_H #include #elif !defined(UINT32_MAX) @@ -234,7 +239,7 @@ RenderClientCallback (CallbackListPtr *list, } #ifdef PANORAMIX -unsigned long XRT_PICTURE; +RESTYPE XRT_PICTURE; #endif void @@ -1079,8 +1084,10 @@ ProcRenderAddGlyphs (ClientPtr client) remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs; /* protect against bad nglyphs */ - if (gi < stuff || gi > ((CARD32 *)stuff + client->req_len) || - bits < stuff || bits > ((CARD32 *)stuff + client->req_len)) { + if (gi < ((xGlyphInfo *)stuff) || + gi > ((xGlyphInfo *)((CARD32 *)stuff + client->req_len)) || + bits < ((CARD8 *)stuff) || + bits > ((CARD8 *)((CARD32 *)stuff + client->req_len))) { err = BadLength; goto bail; } @@ -1365,8 +1372,10 @@ ProcRenderCompositeGlyphs (ClientPtr client) else { listsBase = (GlyphListPtr) malloc(nlist * sizeof (GlyphListRec)); - if (!listsBase) - return BadAlloc; + if (!listsBase) { + rc = BadAlloc; + goto bail; + } } buffer = (CARD8 *) (stuff + 1); glyphs = glyphsBase; @@ -1385,13 +1394,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) GlyphSetType, client, DixUseAccess); if (rc != Success) - { - if (glyphsBase != glyphsLocal) - free(glyphsBase); - if (listsBase != listsLocal) - free(listsBase); - return rc; - } + goto bail; } buffer += 4; } @@ -1429,8 +1432,10 @@ ProcRenderCompositeGlyphs (ClientPtr client) lists++; } } - if (buffer > end) - return BadLength; + if (buffer > end) { + rc = BadLength; + goto bail; + } CompositeGlyphs (stuff->op, pSrc, @@ -1441,13 +1446,14 @@ ProcRenderCompositeGlyphs (ClientPtr client) nlist, listsBase, glyphsBase); + rc = Success; +bail: if (glyphsBase != glyphsLocal) free(glyphsBase); if (listsBase != listsLocal) free(listsBase); - - return Success; + return rc; } static int @@ -1699,11 +1705,17 @@ ProcRenderCreateCursor (ClientPtr client) GetColor(twocolor[1], 0), &pCursor, client, stuff->cid); if (rc != Success) - return rc; - if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) - return BadAlloc; + goto bail; + if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) { + rc = BadAlloc; + goto bail; + } return Success; +bail: + free(srcbits); + free(mskbits); + return rc; } static int @@ -2552,8 +2564,8 @@ static void swapStops(void *stuff, int num) } colors = (CARD16 *)(stops); for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; + swaps(colors, n); + ++colors; } } @@ -2651,9 +2663,6 @@ SProcRenderDispatch (ClientPtr client) } #ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" - #define VERIFY_XIN_PICTURE(pPicture, pid, client, mode) {\ int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\ XRT_PICTURE, client, mode);\ @@ -2686,7 +2695,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); if (refDraw->type == XRT_WINDOW && stuff->drawable == screenInfo.screens[0]->root->drawable.id) @@ -2695,9 +2704,6 @@ PanoramiXRenderCreatePicture (ClientPtr client) } else newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; @@ -3221,11 +3227,8 @@ PanoramiXRenderCreateSolidFill (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; @@ -3254,12 +3257,9 @@ PanoramiXRenderCreateLinearGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client); @@ -3287,12 +3287,9 @@ PanoramiXRenderCreateRadialGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client); @@ -3320,12 +3317,9 @@ PanoramiXRenderCreateConicalGradient (ClientPtr client) return BadAlloc; newPict->type = XRT_PICTURE; - newPict->info[0].id = stuff->pid; + panoramix_setup_ids(newPict, client, stuff->pid); newPict->u.pict.root = FALSE; - for(j = 1; j < PanoramiXNumScreens; j++) - newPict->info[j].id = FakeClientID(client->index); - FOR_NSCREENS_BACKWARD(j) { stuff->pid = newPict->info[j].id; result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client); diff --git a/render/renderedge.c b/render/renderedge.c deleted file mode 100644 index 8771fe164..000000000 --- a/render/renderedge.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - return pixman_sample_ceil_y (y, n); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - return pixman_sample_floor_y (y, n); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - pixman_edge_step (e, n); -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off); -} - diff --git a/render/renderedge.h b/render/renderedge.h deleted file mode 100644 index 6585aeb90..000000000 --- a/render/renderedge.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _RENDEREDGE_H_ -#define _RENDEREDGE_H_ - -#include "picturestr.h" - -#define MAX_ALPHA(n) ((1 << (n)) - 1) -#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1) -#define N_X_FRAC(n) ((1 << ((n)/2)) + 1) - -#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n)) -#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2) -#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n)) -#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2) -#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n)) - -/* - * An edge structure. This represents a single polygon edge - * and can be quickly stepped across small or large gaps in the - * sample grid - */ -typedef pixman_edge_t RenderEdge; - -/* - * Step across a small sample grid gap - */ -#define RenderEdgeStepSmall(edge) { \ - edge->x += edge->stepx_small; \ - edge->e += edge->dx_small; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -/* - * Step across a large sample grid gap - */ -#define RenderEdgeStepBig(edge) { \ - edge->x += edge->stepx_big; \ - edge->e += edge->dx_big; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -extern _X_EXPORT xFixed -RenderSampleCeilY (xFixed y, int bpp); - -extern _X_EXPORT xFixed -RenderSampleFloorY (xFixed y, int bpp); - -extern _X_EXPORT void -RenderEdgeStep (RenderEdge *e, int n); - -extern _X_EXPORT void -RenderEdgeInit (RenderEdge *e, - int bpp, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot); - -extern _X_EXPORT void -RenderLineFixedEdgeInit (RenderEdge *e, - int bpp, - xFixed y, - xLineFixed *line, - int x_off, - int y_off); - -#endif /* _RENDEREDGE_H_ */ diff --git a/test/.gitignore b/test/.gitignore index db8c5f398..86e687fc7 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1,7 +1,7 @@ -# Add & Override for this directory and it's subdirectories libxservertest.c input +list xkb xtest xi2/protocol-eventconvert diff --git a/test/Makefile.am b/test/Makefile.am index 456221e46..5574e7d1e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,13 +1,14 @@ -if UNITTESTS +if ENABLE_UNIT_TESTS +if HAVE_LD_WRAP SUBDIRS= . xi2 -check_PROGRAMS = xkb input xtest +noinst_PROGRAMS = xkb input xtest list misc fixes check_LTLIBRARIES = libxservertest.la -TESTS=$(check_PROGRAMS) +TESTS=$(noinst_PROGRAMS) -AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@ +AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ -TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS) +TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) @@ -16,6 +17,9 @@ endif xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) xtest_LDADD=$(TEST_LDADD) +list_LDADD=$(TEST_LDADD) +misc_LDADD=$(TEST_LDADD) +fixes_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = \ $(XSERVER_LIBS) \ @@ -34,6 +38,7 @@ libxservertest_la_LIBADD = \ $(top_builddir)/os/libos.la \ @XORG_LIBS@ endif +endif CLEANFILES=libxservertest.c diff --git a/test/fixes.c b/test/fixes.c new file mode 100644 index 000000000..8c804ba26 --- /dev/null +++ b/test/fixes.c @@ -0,0 +1,327 @@ +/** + * Copyright © 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +static void +_fixes_test_direction(struct PointerBarrier *barrier, int d[4], int permitted) +{ + BOOL blocking; + int i, j; + int dir = barrier_get_direction(d[0], d[1], d[2], d[3]); + + barrier->directions = 0; + blocking = barrier_is_blocking_direction(barrier, dir); + assert(blocking); + + for (j = 0; j <= BarrierNegativeY; j++) + { + for (i = 0; i <= BarrierNegativeY; i++) + { + barrier->directions |= 1 << i; + blocking = barrier_is_blocking_direction(barrier, dir); + assert((barrier->directions & permitted) == permitted ? !blocking : blocking); + } + } + +} + +static void +fixes_pointer_barrier_direction_test(void) +{ + struct PointerBarrier barrier; + + int x = 100; + int y = 100; + + int directions[8][4] = { + { x, y, x, y + 100}, /* S */ + { x + 50, y, x - 50, y + 100}, /* SW */ + { x + 100, y, x, y}, /* W */ + { x + 100, y + 50, x, y - 50}, /* NW */ + { x, y + 100, x, y}, /* N */ + { x - 50, y + 100, x + 50, y}, /* NE */ + { x, y, x + 100, y}, /* E */ + { x, y - 50, x + 100, y + 50}, /* SE */ + }; + + barrier.x1 = x; + barrier.x2 = x; + barrier.y1 = y - 50; + barrier.y2 = y + 49; + + + _fixes_test_direction(&barrier, directions[0], BarrierPositiveY); + _fixes_test_direction(&barrier, directions[1], BarrierPositiveY | BarrierNegativeX); + _fixes_test_direction(&barrier, directions[2], BarrierNegativeX); + _fixes_test_direction(&barrier, directions[3], BarrierNegativeY | BarrierNegativeX); + _fixes_test_direction(&barrier, directions[4], BarrierNegativeY); + _fixes_test_direction(&barrier, directions[5], BarrierPositiveX | BarrierNegativeY); + _fixes_test_direction(&barrier, directions[6], BarrierPositiveX); + _fixes_test_direction(&barrier, directions[7], BarrierPositiveY | BarrierPositiveX); + + +} + + +static void +fixes_pointer_barriers_test(void) +{ + struct PointerBarrier barrier; + int x1, y1, x2, y2; + double distance; + + int x = 100; + int y = 100; + + /* vert barrier */ + barrier.x1 = x; + barrier.x2 = x; + barrier.y1 = y - 50; + barrier.y2 = y + 50; + + /* across at half-way */ + x1 = x + 1; + x2 = x - 1; + y1 = y; + y2 = y; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + assert(distance == 1); + + /* definitely not across */ + x1 = x + 10; + x2 = x + 5; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across, but outside of y range */ + x1 = x + 1; + x2 = x -1; + y1 = y + 100; + y2 = y + 100; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across, diagonally */ + x1 = x + 5; + x2 = x - 5; + y1 = y + 5; + y2 = y - 5; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across but outside boundary, diagonally */ + x1 = x + 5; + x2 = x - 5; + y1 = y + 100; + y2 = y + 50; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → blocking */ + x1 = x; + x2 = x - 1; + y1 = y; + y2 = y; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → not blocking, positive */ + x1 = x; + x2 = x + 1; + y1 = y; + y2 = y; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → not blocking, negative */ + x1 = x - 1; + x2 = x - 2; + y1 = y; + y2 = y; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: endpoint of movement on barrier → blocking */ + x1 = x + 1; + x2 = x; + y1 = y; + y2 = y; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* startpoint on barrier but outside y range */ + x1 = x; + x2 = x - 1; + y1 = y + 100; + y2 = y + 100; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint on barrier but outside y range */ + x1 = x + 1; + x2 = x; + y1 = y + 100; + y2 = y + 100; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + + /* horizontal barrier */ + barrier.x1 = x - 50; + barrier.x2 = x + 50; + barrier.y1 = y; + barrier.y2 = y; + + /* across at half-way */ + x1 = x; + x2 = x; + y1 = y - 1; + y2 = y + 1; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* definitely not across */ + y1 = y + 10; + y2 = y + 5; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across, but outside of y range */ + x1 = x + 100; + x2 = x + 100; + y1 = y + 1; + y2 = y -1; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across, diagonally */ + y1 = y + 5; + y2 = y - 5; + x1 = x + 5; + x2 = x - 5; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* across but outside boundary, diagonally */ + y1 = y + 5; + y2 = y - 5; + x1 = x + 100; + x2 = x + 50; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → blocking */ + y1 = y; + y2 = y - 1; + x1 = x; + x2 = x; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → not blocking, positive */ + y1 = y; + y2 = y + 1; + x1 = x; + x2 = x; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: startpoint of movement on barrier → not blocking, negative */ + y1 = y - 1; + y2 = y - 2; + x1 = x; + x2 = x; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* edge case: endpoint of movement on barrier → blocking */ + y1 = y + 1; + y2 = y; + x1 = x; + x2 = x; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* startpoint on barrier but outside y range */ + y1 = y; + y2 = y - 1; + x1 = x + 100; + x2 = x + 100; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint on barrier but outside y range */ + y1 = y + 1; + y2 = y; + x1 = x + 100; + x2 = x + 100; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + +} + +static void fixes_pointer_barrier_clamp_test(void) +{ + struct PointerBarrier barrier; + + int x = 100; + int y = 100; + + int cx, cy; /* clamped */ + + /* vert barrier */ + barrier.x1 = x; + barrier.x2 = x; + barrier.y1 = y - 50; + barrier.y2 = y + 49; + barrier.directions = 0; + + cx = INT_MAX; + cy = INT_MAX; + barrier_clamp_to_barrier(&barrier, BarrierPositiveX, &cx, &cy); + assert(cx == barrier.x1 - 1); + assert(cy == INT_MAX); + + cx = 0; + cy = INT_MAX; + barrier_clamp_to_barrier(&barrier, BarrierNegativeX, &cx, &cy); + assert(cx == barrier.x1); + assert(cy == INT_MAX); + + /* horiz barrier */ + barrier.x1 = x - 50; + barrier.x2 = x + 49; + barrier.y1 = y; + barrier.y2 = y; + barrier.directions = 0; + + cx = INT_MAX; + cy = INT_MAX; + barrier_clamp_to_barrier(&barrier, BarrierPositiveY, &cx, &cy); + assert(cx == INT_MAX); + assert(cy == barrier.y1 - 1); + + cx = INT_MAX; + cy = 0; + barrier_clamp_to_barrier(&barrier, BarrierNegativeY, &cx, &cy); + assert(cx == INT_MAX); + assert(cy == barrier.y1); +} + +int main(int argc, char** argv) +{ + + fixes_pointer_barriers_test(); + fixes_pointer_barrier_direction_test(); + fixes_pointer_barrier_clamp_test(); + + return 0; +} diff --git a/test/input.c b/test/input.c index b90d3b4fd..ac37d67a1 100644 --- a/test/input.c +++ b/test/input.c @@ -36,9 +36,11 @@ #include "inputstr.h" #include "eventconvert.h" #include "exevents.h" +#include "exglobals.h" #include "dixgrabs.h" #include "eventstr.h" -#include +#include "inpututils.h" +#include "assert.h" /** * Init a device with axes. @@ -58,24 +60,24 @@ static void dix_init_valuators(void) memset(&dev, 0, sizeof(DeviceIntRec)); dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */ - g_assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE); - g_assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute)); + assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE); + assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute)); val = dev.valuator; - g_assert(val); - g_assert(val->numAxes == num_axes); - g_assert(val->numMotionEvents == 0); - g_assert(val->mode == Absolute); - g_assert(val->axisVal); + assert(val); + assert(val->numAxes == num_axes); + assert(val->numMotionEvents == 0); + assert(val->axisVal); for (i = 0; i < num_axes; i++) { - g_assert(val->axisVal[i] == 0); - g_assert(val->axes->min_value == NO_AXIS_LIMITS); - g_assert(val->axes->max_value == NO_AXIS_LIMITS); + assert(val->axisVal[i] == 0); + assert(val->axes->min_value == NO_AXIS_LIMITS); + assert(val->axes->max_value == NO_AXIS_LIMITS); + assert(val->axes->mode == Absolute); } - g_assert(dev.last.numValuators == num_axes); + assert(dev.last.numValuators == num_axes); } /* just check the known success cases, and that error cases set the client's @@ -95,48 +97,48 @@ static void dix_check_grab_values(void) param.ownerEvents = FALSE; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == Success); + assert(rc == Success); param.this_device_mode = GrabModeAsync; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == Success); + assert(rc == Success); param.this_device_mode = GrabModeAsync + 1; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == BadValue); - g_assert(client.errorValue == param.this_device_mode); - g_assert(client.errorValue == GrabModeAsync + 1); + assert(rc == BadValue); + assert(client.errorValue == param.this_device_mode); + assert(client.errorValue == GrabModeAsync + 1); param.this_device_mode = GrabModeSync; param.other_devices_mode = GrabModeAsync; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == Success); + assert(rc == Success); param.other_devices_mode = GrabModeAsync + 1; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == BadValue); - g_assert(client.errorValue == param.other_devices_mode); - g_assert(client.errorValue == GrabModeAsync + 1); + assert(rc == BadValue); + assert(client.errorValue == param.other_devices_mode); + assert(client.errorValue == GrabModeAsync + 1); param.other_devices_mode = GrabModeSync; param.modifiers = 1 << 13; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == BadValue); - g_assert(client.errorValue == param.modifiers); - g_assert(client.errorValue == (1 << 13)); + assert(rc == BadValue); + assert(client.errorValue == param.modifiers); + assert(client.errorValue == (1 << 13)); param.modifiers = AnyModifier; param.ownerEvents = TRUE; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == Success); + assert(rc == Success); param.ownerEvents = 3; rc = CheckGrabValues(&client, ¶m); - g_assert(rc == BadValue); - g_assert(client.errorValue == param.ownerEvents); - g_assert(client.errorValue == 3); + assert(rc == BadValue); + assert(client.errorValue == param.ownerEvents); + assert(client.errorValue == 3); } @@ -147,29 +149,32 @@ static void dix_check_grab_values(void) static void dix_event_to_core(int type) { DeviceEvent ev; - xEvent core; + xEvent *core; int time; int x, y; int rc; int state; int detail; + int count; const int ROOT_WINDOW_ID = 0x100; /* EventToCore memsets the event to 0 */ #define test_event() \ - g_assert(rc == Success); \ - g_assert(core.u.u.type == type); \ - g_assert(core.u.u.detail == detail); \ - g_assert(core.u.keyButtonPointer.time == time); \ - g_assert(core.u.keyButtonPointer.rootX == x); \ - g_assert(core.u.keyButtonPointer.rootY == y); \ - g_assert(core.u.keyButtonPointer.state == state); \ - g_assert(core.u.keyButtonPointer.eventX == 0); \ - g_assert(core.u.keyButtonPointer.eventY == 0); \ - g_assert(core.u.keyButtonPointer.root == ROOT_WINDOW_ID); \ - g_assert(core.u.keyButtonPointer.event == 0); \ - g_assert(core.u.keyButtonPointer.child == 0); \ - g_assert(core.u.keyButtonPointer.sameScreen == FALSE); + assert(rc == Success); \ + assert(core); \ + assert(count == 1); \ + assert(core->u.u.type == type); \ + assert(core->u.u.detail == detail); \ + assert(core->u.keyButtonPointer.time == time); \ + assert(core->u.keyButtonPointer.rootX == x); \ + assert(core->u.keyButtonPointer.rootY == y); \ + assert(core->u.keyButtonPointer.state == state); \ + assert(core->u.keyButtonPointer.eventX == 0); \ + assert(core->u.keyButtonPointer.eventY == 0); \ + assert(core->u.keyButtonPointer.root == ROOT_WINDOW_ID); \ + assert(core->u.keyButtonPointer.event == 0); \ + assert(core->u.keyButtonPointer.child == 0); \ + assert(core->u.keyButtonPointer.sameScreen == FALSE); x = 0; y = 0; @@ -182,36 +187,41 @@ static void dix_event_to_core(int type) ev.time = time; ev.root_y = x; ev.root_x = y; + SetBit(ev.valuators.mask, 0); + SetBit(ev.valuators.mask, 1); ev.root = ROOT_WINDOW_ID; ev.corestate = state; ev.detail.key = detail; ev.type = type; ev.detail.key = 0; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); x = 1; y = 2; ev.root_x = x; ev.root_y = y; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); x = 0x7FFF; y = 0x7FFF; ev.root_x = x; ev.root_y = y; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); x = 0x8000; /* too high */ y = 0x8000; /* too high */ ev.root_x = x; ev.root_y = y; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(core.u.keyButtonPointer.rootX != x); - g_assert(core.u.keyButtonPointer.rootY != y); + rc = EventToCore((InternalEvent*)&ev, &core, &count); + assert(rc == Success); + assert(core); + assert(count == 1); + assert(core->u.keyButtonPointer.rootX != x); + assert(core->u.keyButtonPointer.rootY != y); x = 0x7FFF; y = 0x7FFF; @@ -219,68 +229,65 @@ static void dix_event_to_core(int type) ev.root_y = y; time = 0; ev.time = time; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); detail = 1; ev.detail.key = detail; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); detail = 0xFF; /* highest value */ ev.detail.key = detail; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); detail = 0xFFF; /* too big */ ev.detail.key = detail; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadMatch); + rc = EventToCore((InternalEvent*)&ev, &core, &count); + assert(rc == BadMatch); detail = 0xFF; /* too big */ ev.detail.key = detail; state = 0xFFFF; /* highest value */ ev.corestate = state; - rc = EventToCore((InternalEvent*)&ev, &core); + rc = EventToCore((InternalEvent*)&ev, &core, &count); test_event(); state = 0x10000; /* too big */ ev.corestate = state; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(core.u.keyButtonPointer.state != state); - g_assert(core.u.keyButtonPointer.state == (state & 0xFFFF)); + rc = EventToCore((InternalEvent*)&ev, &core, &count); + assert(rc == Success); + assert(core); + assert(count == 1); + assert(core->u.keyButtonPointer.state != state); + assert(core->u.keyButtonPointer.state == (state & 0xFFFF)); #undef test_event } -static void dix_event_to_core_conversion(void) +static void dix_event_to_core_fail(int evtype, int expected_rc) { DeviceEvent ev; - xEvent core; + xEvent *core; int rc; + int count; ev.header = 0xFF; ev.length = sizeof(DeviceEvent); - ev.type = 0; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadImplementation); - - ev.type = 1; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadImplementation); - - ev.type = ET_ProximityOut + 1; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadImplementation); - - ev.type = ET_ProximityIn; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadMatch); + ev.type = evtype; + rc = EventToCore((InternalEvent*)&ev, &core, &count); + assert(rc == expected_rc); +} - ev.type = ET_ProximityOut; - rc = EventToCore((InternalEvent*)&ev, &core); - g_assert(rc == BadMatch); +static void dix_event_to_core_conversion(void) +{ + dix_event_to_core_fail(0, BadImplementation); + dix_event_to_core_fail(1, BadImplementation); + dix_event_to_core_fail(ET_ProximityOut + 1, BadImplementation); + dix_event_to_core_fail(ET_ProximityIn, BadMatch); + dix_event_to_core_fail(ET_ProximityOut, BadMatch); dix_event_to_core(ET_KeyPress); dix_event_to_core(ET_KeyRelease); @@ -289,10 +296,147 @@ static void dix_event_to_core_conversion(void) dix_event_to_core(ET_Motion); } +static void +_dix_test_xi_convert(DeviceEvent *ev, int expected_rc, int expected_count) +{ + xEvent *xi; + int count = 0; + int rc; + + rc = EventToXI((InternalEvent*)ev, &xi, &count); + assert(rc == expected_rc); + assert(count >= expected_count); + if (count > 0){ + deviceKeyButtonPointer *kbp = (deviceKeyButtonPointer*)xi; + assert(kbp->type == IEventBase + ev->type); + assert(kbp->detail == ev->detail.key); + assert(kbp->time == ev->time); + assert((kbp->deviceid & ~MORE_EVENTS) == ev->deviceid); + assert(kbp->root_x == ev->root_x); + assert(kbp->root_y == ev->root_y); + assert(kbp->state == ev->corestate); + assert(kbp->event_x == 0); + assert(kbp->event_y == 0); + assert(kbp->root == ev->root); + assert(kbp->event == 0); + assert(kbp->child == 0); + assert(kbp->same_screen == FALSE); + + while (--count > 0) { + deviceValuator *v = (deviceValuator*)&xi[count]; + assert(v->type == DeviceValuator); + assert(v->num_valuators <= 6); + } + + + free(xi); + } +} + +/** + * This tests for internal event → XI1 event conversion + * - all conversions should generate the right XI event type + * - right number of events generated + * - extra events are valuators + */ +static void dix_event_to_xi1_conversion(void) +{ + DeviceEvent ev = {0}; + int time; + int x, y; + int state; + int detail; + const int ROOT_WINDOW_ID = 0x100; + int deviceid; + + IEventBase = 80; + DeviceValuator = IEventBase - 1; + DeviceKeyPress = IEventBase + ET_KeyPress; + DeviceKeyRelease = IEventBase + ET_KeyRelease; + DeviceButtonPress = IEventBase + ET_ButtonPress; + DeviceButtonRelease = IEventBase + ET_ButtonRelease; + DeviceMotionNotify = IEventBase + ET_Motion; + DeviceFocusIn = IEventBase + ET_FocusIn; + DeviceFocusOut = IEventBase + ET_FocusOut; + ProximityIn = IEventBase + ET_ProximityIn; + ProximityOut = IEventBase + ET_ProximityOut; + + /* EventToXI callocs */ + x = 0; + y = 0; + time = 12345; + state = 0; + detail = 0; + deviceid = 4; + + ev.header = 0xFF; + + ev.header = 0xFF; + ev.length = sizeof(DeviceEvent); + ev.time = time; + ev.root_y = x; + ev.root_x = y; + SetBit(ev.valuators.mask, 0); + SetBit(ev.valuators.mask, 1); + ev.root = ROOT_WINDOW_ID; + ev.corestate = state; + ev.detail.key = detail; + ev.deviceid = deviceid; + + /* test all types for bad match */ + ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_Motion; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, Success, 1); + + /* No axes */ + ClearBit(ev.valuators.mask, 0); + ClearBit(ev.valuators.mask, 1); + ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 1); + ev.type = ET_Motion; _dix_test_xi_convert(&ev, BadMatch, 0); + ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, BadMatch, 0); + ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, BadMatch, 0); + + /* more than 6 axes → 2 valuator events */ + SetBit(ev.valuators.mask, 0); + SetBit(ev.valuators.mask, 1); + SetBit(ev.valuators.mask, 2); + SetBit(ev.valuators.mask, 3); + SetBit(ev.valuators.mask, 4); + SetBit(ev.valuators.mask, 5); + SetBit(ev.valuators.mask, 6); + ev.type = ET_KeyPress; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_KeyRelease; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_ButtonPress; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_ButtonRelease; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_Motion; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_ProximityIn; _dix_test_xi_convert(&ev, Success, 2); + ev.type = ET_ProximityOut; _dix_test_xi_convert(&ev, Success, 2); + + + /* keycode too high */ + ev.type = ET_KeyPress; + ev.detail.key = 256; + _dix_test_xi_convert(&ev, Success, 0); + + /* deviceid too high */ + ev.type = ET_KeyPress; + ev.detail.key = 18; + ev.deviceid = 128; + _dix_test_xi_convert(&ev, Success, 0); +} + + static void xi2_struct_sizes(void) { #define compare(req) \ - g_assert(sizeof(req) == sz_##req); + assert(sizeof(req) == sz_##req); compare(xXIQueryVersionReq); compare(xXIWarpPointerReq); @@ -332,23 +476,23 @@ static void dix_grab_matching(void) a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_XI2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_CORE; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* XI2 grabs for different devices must fail, regardless of ignoreDevice * XI2 grabs for master devices must fail against a slave */ @@ -372,28 +516,28 @@ static void dix_grab_matching(void) b.device = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.device = &dev2; b.device = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.device = inputInfo.all_master_devices; b.device = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.device = &dev1; b.device = inputInfo.all_master_devices; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* ignoreDevice FALSE must fail for different devices for CORE and XI */ a.grabtype = GRABTYPE_XI; @@ -403,7 +547,7 @@ static void dix_grab_matching(void) a.modifierDevice = &dev1; b.modifierDevice = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; @@ -412,7 +556,7 @@ static void dix_grab_matching(void) a.modifierDevice = &dev1; b.modifierDevice = &dev1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* ignoreDevice FALSE must fail for different modifier devices for CORE * and XI */ @@ -423,7 +567,7 @@ static void dix_grab_matching(void) a.modifierDevice = &dev1; b.modifierDevice = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; @@ -432,7 +576,7 @@ static void dix_grab_matching(void) a.modifierDevice = &dev1; b.modifierDevice = &dev2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* different event type must fail */ a.grabtype = GRABTYPE_XI2; @@ -444,9 +588,9 @@ static void dix_grab_matching(void) a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; @@ -457,9 +601,9 @@ static void dix_grab_matching(void) a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; @@ -470,9 +614,9 @@ static void dix_grab_matching(void) a.type = XI_KeyPress; b.type = XI_KeyRelease; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&a, &b, TRUE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* different modifiers must fail */ a.grabtype = GRABTYPE_XI2; @@ -486,23 +630,23 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 2; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* AnyModifier must fail for XI2 */ a.grabtype = GRABTYPE_XI2; @@ -510,9 +654,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* XIAnyModifier must fail for CORE and XI */ a.grabtype = GRABTYPE_XI; @@ -520,18 +664,18 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* different detail must fail */ a.grabtype = GRABTYPE_XI2; @@ -541,23 +685,23 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* detail of AnyModifier must fail */ a.grabtype = GRABTYPE_XI2; @@ -567,23 +711,23 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* detail of XIAnyModifier must fail */ a.grabtype = GRABTYPE_XI2; @@ -593,23 +737,23 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == FALSE); + assert(rc == FALSE); /* XIAnyModifier or AnyModifer must succeed */ a.grabtype = GRABTYPE_XI2; @@ -619,9 +763,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = XIAnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; @@ -630,9 +774,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; @@ -641,9 +785,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = AnyModifier; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); /* AnyKey or XIAnyKeycode must succeed */ a.grabtype = GRABTYPE_XI2; @@ -653,9 +797,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); a.grabtype = GRABTYPE_CORE; b.grabtype = GRABTYPE_CORE; @@ -664,9 +808,9 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); a.grabtype = GRABTYPE_XI; b.grabtype = GRABTYPE_XI; @@ -675,47 +819,87 @@ static void dix_grab_matching(void) a.modifiersDetail.exact = 1; b.modifiersDetail.exact = 1; rc = GrabMatchesSecond(&a, &b, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); rc = GrabMatchesSecond(&b, &a, FALSE); - g_assert(rc == TRUE); + assert(rc == TRUE); } -static void include_byte_padding_macros(void) +static void test_bits_to_byte(int i) { - int i; - g_test_message("Testing bits_to_bytes()"); - - /* the macros don't provide overflow protection */ - for (i = 0; i < INT_MAX - 7; i++) - { int expected_bytes; expected_bytes = (i + 7)/8; - g_assert(bits_to_bytes(i) >= i/8); - g_assert((bits_to_bytes(i) * 8) - i <= 7); - } + assert(bits_to_bytes(i) >= i/8); + assert((bits_to_bytes(i) * 8) - i <= 7); + assert(expected_bytes == bits_to_bytes(i)); +} - g_test_message("Testing bytes_to_int32()"); - for (i = 0; i < INT_MAX - 3; i++) - { +static void test_bytes_to_int32(int i) +{ int expected_4byte; expected_4byte = (i + 3)/4; - g_assert(bytes_to_int32(i) <= i); - g_assert((bytes_to_int32(i) * 4) - i <= 3); - } - - g_test_message("Testing pad_to_int32"); + assert(bytes_to_int32(i) <= i); + assert((bytes_to_int32(i) * 4) - i <= 3); + assert(expected_4byte == bytes_to_int32(i)); +} - for (i = 0; i < INT_MAX - 3; i++) - { +static void test_pad_to_int32(int i) +{ int expected_bytes; expected_bytes = ((i + 3)/4) * 4; - g_assert(pad_to_int32(i) >= i); - g_assert(pad_to_int32(i) - i <= 3); - } + assert(pad_to_int32(i) >= i); + assert(pad_to_int32(i) - i <= 3); + assert(expected_bytes == pad_to_int32(i)); +} +static void include_byte_padding_macros(void) +{ + printf("Testing bits_to_bytes()\n"); + /* the macros don't provide overflow protection */ + test_bits_to_byte(0); + test_bits_to_byte(1); + test_bits_to_byte(2); + test_bits_to_byte(7); + test_bits_to_byte(8); + test_bits_to_byte(0xFF); + test_bits_to_byte(0x100); + test_bits_to_byte(INT_MAX - 9); + test_bits_to_byte(INT_MAX - 8); + + printf("Testing bytes_to_int32()\n"); + + test_bytes_to_int32(0); + test_bytes_to_int32(1); + test_bytes_to_int32(2); + test_bytes_to_int32(7); + test_bytes_to_int32(8); + test_bytes_to_int32(0xFF); + test_bytes_to_int32(0x100); + test_bytes_to_int32(0xFFFF); + test_bytes_to_int32(0x10000); + test_bytes_to_int32(0xFFFFFF); + test_bytes_to_int32(0x1000000); + test_bytes_to_int32(INT_MAX - 4); + test_bytes_to_int32(INT_MAX - 3); + + printf("Testing pad_to_int32\n"); + + test_pad_to_int32(0); + test_pad_to_int32(0); + test_pad_to_int32(1); + test_pad_to_int32(2); + test_pad_to_int32(7); + test_pad_to_int32(8); + test_pad_to_int32(0xFF); + test_pad_to_int32(0x100); + test_pad_to_int32(0xFFFF); + test_pad_to_int32(0x10000); + test_pad_to_int32(0xFFFFFF); + test_pad_to_int32(0x1000000); + test_pad_to_int32(INT_MAX - 4); + test_pad_to_int32(INT_MAX - 3); } static void xi_unregister_handlers(void) @@ -726,47 +910,47 @@ static void xi_unregister_handlers(void) memset(&dev, 0, sizeof(dev)); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 1); + assert(handler == 1); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 2); + assert(handler == 2); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 3); + assert(handler == 3); - g_test_message("Unlinking from front."); + printf("Unlinking from front.\n"); XIUnregisterPropertyHandler(&dev, 4); /* NOOP */ - g_assert(dev.properties.handlers->id == 3); + assert(dev.properties.handlers->id == 3); XIUnregisterPropertyHandler(&dev, 3); - g_assert(dev.properties.handlers->id == 2); + assert(dev.properties.handlers->id == 2); XIUnregisterPropertyHandler(&dev, 2); - g_assert(dev.properties.handlers->id == 1); + assert(dev.properties.handlers->id == 1); XIUnregisterPropertyHandler(&dev, 1); - g_assert(dev.properties.handlers == NULL); + assert(dev.properties.handlers == NULL); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 4); + assert(handler == 4); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 5); + assert(handler == 5); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 6); + assert(handler == 6); XIUnregisterPropertyHandler(&dev, 3); /* NOOP */ - g_assert(dev.properties.handlers->next->next->next == NULL); + assert(dev.properties.handlers->next->next->next == NULL); XIUnregisterPropertyHandler(&dev, 4); - g_assert(dev.properties.handlers->next->next == NULL); + assert(dev.properties.handlers->next->next == NULL); XIUnregisterPropertyHandler(&dev, 5); - g_assert(dev.properties.handlers->next == NULL); + assert(dev.properties.handlers->next == NULL); XIUnregisterPropertyHandler(&dev, 6); - g_assert(dev.properties.handlers == NULL); + assert(dev.properties.handlers == NULL); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 7); + assert(handler == 7); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 8); + assert(handler == 8); handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL); - g_assert(handler == 9); + assert(handler == 9); XIDeleteAllDeviceProperties(&dev); - g_assert(dev.properties.handlers == NULL); + assert(dev.properties.handlers == NULL); XIUnregisterPropertyHandler(&dev, 7); /* NOOP */ } @@ -776,44 +960,44 @@ static void cmp_attr_fields(InputAttributes *attr1, { char **tags1, **tags2; - g_assert(attr1 && attr2); - g_assert(attr1 != attr2); - g_assert(attr1->flags == attr2->flags); + assert(attr1 && attr2); + assert(attr1 != attr2); + assert(attr1->flags == attr2->flags); if (attr1->product != NULL) { - g_assert(attr1->product != attr2->product); - g_assert(strcmp(attr1->product, attr2->product) == 0); + assert(attr1->product != attr2->product); + assert(strcmp(attr1->product, attr2->product) == 0); } else - g_assert(attr2->product == NULL); + assert(attr2->product == NULL); if (attr1->vendor != NULL) { - g_assert(attr1->vendor != attr2->vendor); - g_assert(strcmp(attr1->vendor, attr2->vendor) == 0); + assert(attr1->vendor != attr2->vendor); + assert(strcmp(attr1->vendor, attr2->vendor) == 0); } else - g_assert(attr2->vendor == NULL); + assert(attr2->vendor == NULL); if (attr1->device != NULL) { - g_assert(attr1->device != attr2->device); - g_assert(strcmp(attr1->device, attr2->device) == 0); + assert(attr1->device != attr2->device); + assert(strcmp(attr1->device, attr2->device) == 0); } else - g_assert(attr2->device == NULL); + assert(attr2->device == NULL); if (attr1->pnp_id != NULL) { - g_assert(attr1->pnp_id != attr2->pnp_id); - g_assert(strcmp(attr1->pnp_id, attr2->pnp_id) == 0); + assert(attr1->pnp_id != attr2->pnp_id); + assert(strcmp(attr1->pnp_id, attr2->pnp_id) == 0); } else - g_assert(attr2->pnp_id == NULL); + assert(attr2->pnp_id == NULL); if (attr1->usb_id != NULL) { - g_assert(attr1->usb_id != attr2->usb_id); - g_assert(strcmp(attr1->usb_id, attr2->usb_id) == 0); + assert(attr1->usb_id != attr2->usb_id); + assert(strcmp(attr1->usb_id, attr2->usb_id) == 0); } else - g_assert(attr2->usb_id == NULL); + assert(attr2->usb_id == NULL); tags1 = attr1->tags; tags2 = attr2->tags; @@ -821,25 +1005,25 @@ static void cmp_attr_fields(InputAttributes *attr1, /* if we don't have any tags, skip the tag checking bits */ if (!tags1) { - g_assert(!tags2); + assert(!tags2); return; } /* Don't lug around empty arrays */ - g_assert(*tags1); - g_assert(*tags2); + assert(*tags1); + assert(*tags2); /* check for identical content, but duplicated */ while (*tags1) { - g_assert(*tags1 != *tags2); - g_assert(strcmp(*tags1, *tags2) == 0); + assert(*tags1 != *tags2); + assert(strcmp(*tags1, *tags2) == 0); tags1++; tags2++; } /* ensure tags1 and tags2 have the same no of elements */ - g_assert(!*tags2); + assert(!*tags2); /* check for not sharing memory */ tags1 = attr1->tags; @@ -847,7 +1031,7 @@ static void cmp_attr_fields(InputAttributes *attr1, { tags2 = attr2->tags; while (*tags2) - g_assert(*tags1 != *tags2++); + assert(*tags1 != *tags2++); tags1++; } @@ -860,10 +1044,10 @@ static void dix_input_attributes(void) char *tags[4] = {"tag1", "tag2", "tag2", NULL}; new = DuplicateInputAttributes(NULL); - g_assert(!new); + assert(!new); new = DuplicateInputAttributes(&orig); - g_assert(memcmp(&orig, new, sizeof(InputAttributes)) == 0); + assert(memcmp(&orig, new, sizeof(InputAttributes)) == 0); orig.product = "product name"; new = DuplicateInputAttributes(&orig); @@ -901,21 +1085,167 @@ static void dix_input_attributes(void) FreeInputAttributes(new); } +static void dix_input_valuator_masks(void) +{ + ValuatorMask *mask = NULL, *copy; + int nvaluators = MAX_VALUATORS; + int valuators[nvaluators]; + int i; + int first_val, num_vals; + + for (i = 0; i < nvaluators; i++) + valuators[i] = i; + + mask = valuator_mask_new(nvaluators); + assert(mask != NULL); + assert(valuator_mask_size(mask) == 0); + assert(valuator_mask_num_valuators(mask) == 0); + + for (i = 0; i < nvaluators; i++) + { + assert(!valuator_mask_isset(mask, i)); + valuator_mask_set(mask, i, valuators[i]); + assert(valuator_mask_isset(mask, i)); + assert(valuator_mask_get(mask, i) == valuators[i]); + assert(valuator_mask_size(mask) == i + 1); + assert(valuator_mask_num_valuators(mask) == i + 1); + } + + for (i = 0; i < nvaluators; i++) + { + assert(valuator_mask_isset(mask, i)); + valuator_mask_unset(mask, i); + /* we're removing valuators from the front, so size should stay the + * same until the last bit is removed */ + if (i < nvaluators - 1) + assert(valuator_mask_size(mask) == nvaluators); + assert(!valuator_mask_isset(mask, i)); + } + + assert(valuator_mask_size(mask) == 0); + valuator_mask_zero(mask); + assert(valuator_mask_size(mask) == 0); + assert(valuator_mask_num_valuators(mask) == 0); + for (i = 0; i < nvaluators; i++) + assert(!valuator_mask_isset(mask, i)); + + first_val = 5; + num_vals = 6; + + valuator_mask_set_range(mask, first_val, num_vals, valuators); + assert(valuator_mask_size(mask) == first_val + num_vals); + assert(valuator_mask_num_valuators(mask) == num_vals); + for (i = 0; i < nvaluators; i++) + { + if (i < first_val || i >= first_val + num_vals) + assert(!valuator_mask_isset(mask, i)); + else + { + assert(valuator_mask_isset(mask, i)); + assert(valuator_mask_get(mask, i) == valuators[i - first_val]); + } + } + + copy = valuator_mask_new(nvaluators); + valuator_mask_copy(copy, mask); + assert(mask != copy); + assert(valuator_mask_size(mask) == valuator_mask_size(copy)); + assert(valuator_mask_num_valuators(mask) == valuator_mask_num_valuators(copy)); + + for (i = 0; i < nvaluators; i++) + { + assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i)); + assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i)); + } + + valuator_mask_free(&mask); + assert(mask == NULL); +} + +static void dix_valuator_mode(void) +{ + DeviceIntRec dev; + const int num_axes = MAX_VALUATORS; + int i; + Atom atoms[MAX_VALUATORS] = { 0 }; -int main(int argc, char** argv) + memset(&dev, 0, sizeof(DeviceIntRec)); + dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */ + + assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE); + assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute)); + + for (i = 0; i < num_axes; i++) + { + assert(valuator_get_mode(&dev, i) == Absolute); + valuator_set_mode(&dev, i, Relative); + assert(dev.valuator->axes[i].mode == Relative); + assert(valuator_get_mode(&dev, i) == Relative); + } + + valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Absolute); + for (i = 0; i < num_axes; i++) + assert(valuator_get_mode(&dev, i) == Absolute); + + valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Relative); + for (i = 0; i < num_axes; i++) + assert(valuator_get_mode(&dev, i) == Relative); +} + +static void include_bit_test_macros(void) +{ + uint8_t mask[9] = { 0 }; + int i; + + for (i = 0; i < sizeof(mask)/sizeof(mask[0]); i++) + { + assert(BitIsOn(mask, i) == 0); + SetBit(mask, i); + assert(BitIsOn(mask, i) == 1); + assert(!!(mask[i/8] & (1 << (i % 8)))); + assert(CountBits(mask, sizeof(mask)) == 1); + ClearBit(mask, i); + assert(BitIsOn(mask, i) == 0); + } +} + +/** + * Ensure that val->axisVal and val->axes are aligned on doubles. + */ +static void dix_valuator_alloc(void) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); + ValuatorClassPtr v = NULL; + int num_axes = 0; - g_test_add_func("/dix/input/attributes", dix_input_attributes); - g_test_add_func("/dix/input/init-valuators", dix_init_valuators); - g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion); - g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values); - g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes); - g_test_add_func("/dix/input/grab_matching", dix_grab_matching); - g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros); - g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers); + while (num_axes < 5) + { + v = AllocValuatorClass(v, num_axes); + + assert(v); + assert(v->numAxes == num_axes); + assert(((void*)v->axisVal - (void*)v) % sizeof(double) == 0); + assert(((void*)v->axes - (void*)v) % sizeof(double) == 0); + num_axes ++; + } + free(v); +} - return g_test_run(); +int main(int argc, char** argv) +{ + dix_input_valuator_masks(); + dix_input_attributes(); + dix_init_valuators(); + dix_event_to_core_conversion(); + dix_event_to_xi1_conversion(); + dix_check_grab_values(); + xi2_struct_sizes(); + dix_grab_matching(); + dix_valuator_mode(); + include_byte_padding_macros(); + include_bit_test_macros(); + xi_unregister_handlers(); + dix_valuator_alloc(); + + return 0; } diff --git a/test/list.c b/test/list.c new file mode 100644 index 000000000..b101c7619 --- /dev/null +++ b/test/list.c @@ -0,0 +1,173 @@ +/** + * Copyright © 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +struct parent { + int a; + struct list children; + int b; +}; + +struct child { + int foo; + int bar; + struct list node; +}; + +static void +test_list_init(void) +{ + struct parent parent, tmp; + + memset(&parent, 0, sizeof(parent)); + parent.a = 0xa5a5a5; + parent.b = ~0xa5a5a5; + + tmp = parent; + + list_init(&parent.children); + + /* test we haven't touched anything else. */ + assert(parent.a == tmp.a); + assert(parent.b == tmp.b); + + assert(list_is_empty(&parent.children)); +} + +static void +test_list_add(void) +{ + struct parent parent = {0}; + struct child child[3]; + struct child *c; + + list_init(&parent.children); + + list_add(&child[0].node, &parent.children); + assert(!list_is_empty(&parent.children)); + + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[0], sizeof(struct child)) == 0); + + /* note: list_add prepends */ + list_add(&child[1].node, &parent.children); + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[1], sizeof(struct child)) == 0); + + list_add(&child[2].node, &parent.children); + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[2], sizeof(struct child)) == 0); +}; + +static void +test_list_del(void) +{ + struct parent parent = {0}; + struct child child[3]; + struct child *c; + + list_init(&parent.children); + + list_add(&child[0].node, &parent.children); + assert(!list_is_empty(&parent.children)); + + list_del(&parent.children); + assert(list_is_empty(&parent.children)); + + list_add(&child[0].node, &parent.children); + list_del(&child[0].node); + assert(list_is_empty(&parent.children)); + + list_add(&child[0].node, &parent.children); + list_add(&child[1].node, &parent.children); + + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[1], sizeof(struct child)) == 0); + + /* delete first node */ + list_del(&child[1].node); + assert(!list_is_empty(&parent.children)); + assert(list_is_empty(&child[1].node)); + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[0], sizeof(struct child)) == 0); + + /* delete last node */ + list_add(&child[1].node, &parent.children); + list_del(&child[0].node); + c = list_first_entry(&parent.children, struct child, node); + assert(memcmp(c, &child[1], sizeof(struct child)) == 0); + + /* delete list head */ + list_add(&child[0].node, &parent.children); + list_del(&parent.children); + assert(list_is_empty(&parent.children)); + assert(!list_is_empty(&child[1].node)); + assert(!list_is_empty(&child[2].node)); +} + +static void +test_list_for_each(void) +{ + struct parent parent = {0}; + struct child child[3]; + struct child *c; + int i = 0; + + list_init(&parent.children); + + list_add(&child[2].node, &parent.children); + list_add(&child[1].node, &parent.children); + list_add(&child[0].node, &parent.children); + + list_for_each_entry(c, &parent.children, node) { + assert(memcmp(c, &child[i], sizeof(struct child)) == 0); + i++; + } + + /* foreach on empty list */ + list_del(&parent.children); + assert(list_is_empty(&parent.children)); + + list_for_each_entry(c, &parent.children, node) { + assert(0); /* we must not get here */ + } +} + + +int main(int argc, char** argv) +{ + test_list_init(); + test_list_add(); + test_list_del(); + test_list_for_each(); + + return 0; +} diff --git a/test/misc.c b/test/misc.c new file mode 100644 index 000000000..3d3b1a1e3 --- /dev/null +++ b/test/misc.c @@ -0,0 +1,62 @@ +/** + * Copyright © 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include "misc.h" + +static void dix_version_compare(void) +{ + int rc; + + rc = version_compare(0, 0, 1, 0); + assert(rc < 0); + rc = version_compare(1, 0, 0, 0); + assert(rc > 0); + rc = version_compare(0, 0, 0, 0); + assert(rc == 0); + rc = version_compare(1, 0, 1, 0); + assert(rc == 0); + rc = version_compare(1, 0, 0, 9); + assert(rc > 0); + rc = version_compare(0, 9, 1, 0); + assert(rc < 0); + rc = version_compare(1, 0, 1, 9); + assert(rc < 0); + rc = version_compare(1, 9, 1, 0); + assert(rc > 0); + rc = version_compare(2, 0, 1, 9); + assert(rc > 0); + rc = version_compare(1, 9, 2, 0); + assert(rc < 0); +} + +int main(int argc, char** argv) +{ + dix_version_compare(); + + return 0; +} diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am index d8dc7e9ce..b15d8ba02 100644 --- a/test/xi2/Makefile.am +++ b/test/xi2/Makefile.am @@ -1,20 +1,22 @@ -if UNITTESTS -check_PROGRAMS = \ +if ENABLE_UNIT_TESTS +if HAVE_LD_WRAP +noinst_PROGRAMS = \ protocol-xiqueryversion \ protocol-xiquerydevice \ protocol-xiselectevents \ protocol-xigetselectedevents \ protocol-xisetclientpointer \ protocol-xigetclientpointer \ + protocol-xipassivegrabdevice \ protocol-xiquerypointer \ protocol-xiwarppointer \ protocol-eventconvert -TESTS=$(check_PROGRAMS) +TESTS=$(noinst_PROGRAMS) -AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@ +AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS) +TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) COMMON_SOURCES=protocol-common.h protocol-common.c if SPECIAL_DTRACE_OBJECTS @@ -28,6 +30,7 @@ protocol_xigetselectedevents_LDADD=$(TEST_LDADD) protocol_xisetclientpointer_LDADD=$(TEST_LDADD) protocol_xigetclientpointer_LDADD=$(TEST_LDADD) protocol_xiquerypointer_LDADD=$(TEST_LDADD) +protocol_xipassivegrabdevice_LDADD=$(TEST_LDADD) protocol_xiwarppointer_LDADD=$(TEST_LDADD) protocol_eventconvert_LDADD=$(TEST_LDADD) @@ -37,6 +40,7 @@ protocol_xiselectevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wra protocol_xigetselectedevents_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource protocol_xisetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,dixLookupClient protocol_xigetclientpointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient +protocol_xipassivegrabdevice_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,GrabButton -Wl,-wrap,dixLookupWindow -Wl,-wrap,WriteToClient protocol_xiquerypointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow protocol_xiwarppointer_LDFLAGS=$(AM_LDFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow @@ -47,5 +51,7 @@ protocol_xigetselectedevents_SOURCES=$(COMMON_SOURCES) protocol-xigetselectedeve protocol_xisetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xisetclientpointer.c protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointer.c protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c +protocol_xipassivegrabdevice_SOURCES=$(COMMON_SOURCES) protocol-xipassivegrabdevice.c protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c endif +endif diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index 50f2b8698..6ffc69721 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -28,7 +28,7 @@ #include #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" -#include +#include "xkbsrv.h" /* for XkbInitPrivates */ #include "protocol-common.h" @@ -133,7 +133,7 @@ void init_window(WindowPtr window, WindowPtr parent, int id) } window->parent = parent; window->optional = calloc(1, sizeof(WindowOptRec)); - g_assert(window->optional); + assert(window->optional); } extern DevPrivateKeyRec miPointerScreenKeyRec; @@ -170,7 +170,7 @@ void init_simple(void) void __wrap_WriteToClient(ClientPtr client, int len, void *data) { - g_assert(reply_handler != NULL); + assert(reply_handler != NULL); (*reply_handler)(client, len, data, userdata); } diff --git a/test/xi2/protocol-common.h b/test/xi2/protocol-common.h index afa08780c..b55f57c05 100644 --- a/test/xi2/protocol-common.h +++ b/test/xi2/protocol-common.h @@ -27,8 +27,8 @@ #include "scrnintstr.h" #include "windowstr.h" -#include "scrnintstr.h" #include "exevents.h" +#include #ifndef PROTOCOL_COMMON_H #define PROTOCOL_COMMON_H @@ -38,11 +38,11 @@ extern int BadDevice; /* Check default values in a reply */ #define reply_check_defaults(rep, len, type) \ { \ - g_assert((len) >= sz_x##type##Reply); \ - g_assert((rep)->repType == X_Reply); \ - g_assert((rep)->RepType == X_##type); \ - g_assert((rep)->sequenceNumber == CLIENT_SEQUENCE); \ - g_assert((rep)->length >= (sz_x##type##Reply - 32)/4); \ + assert((len) >= sz_x##type##Reply); \ + assert((rep)->repType == X_Reply); \ + assert((rep)->RepType == X_##type); \ + assert((rep)->sequenceNumber == CLIENT_SEQUENCE); \ + assert((rep)->length >= (sz_x##type##Reply - 32)/4); \ } /* initialise default values for request */ diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c index 211cce6ad..edba974bf 100644 --- a/test/xi2/protocol-eventconvert.c +++ b/test/xi2/protocol-eventconvert.c @@ -25,7 +25,6 @@ #endif #include -#include #include "inputstr.h" #include "eventstr.h" @@ -33,7 +32,6 @@ #include "exevents.h" #include - static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, BOOL swap) { @@ -58,21 +56,21 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, } - g_assert(out->type == GenericEvent); - g_assert(out->extension == 0); /* IReqCode defaults to 0 */ - g_assert(out->evtype == GetXI2Type((InternalEvent*)in)); - g_assert(out->time == in->time); - g_assert(out->detail == in->detail.button); - g_assert(out->deviceid == in->deviceid); - g_assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(sizeof(in->valuators.mask)))); - g_assert(out->flags == 0); /* FIXME: we don't set the flags yet */ + assert(out->type == GenericEvent); + assert(out->extension == 0); /* IReqCode defaults to 0 */ + assert(out->evtype == GetXI2Type((InternalEvent*)in)); + assert(out->time == in->time); + assert(out->detail == in->detail.button); + assert(out->deviceid == in->deviceid); + assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(sizeof(in->valuators.mask)))); + assert(out->flags == 0); /* FIXME: we don't set the flags yet */ ptr = (unsigned char*)&out[1]; bits_set = 0; for (i = 0; out->valuators_len && i < sizeof(in->valuators.mask) * 8; i++) { - g_assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); + assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(in->valuators.mask, i)) bits_set++; } @@ -81,13 +79,13 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, * set. Each bit set represents 2 8-byte values, hence the * 'bits_set * 4' */ len = out->valuators_len + bits_set * 4; - g_assert(out->length == len); + assert(out->length == len); nvals = 0; for (i = 0; out->valuators_len && i < MAX_VALUATORS; i++) { - g_assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); + assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(in->valuators.mask, i)) { FP3232 vi, vo; @@ -106,8 +104,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, swapl(&vo.frac, n); } - g_assert(vi.integral == vo.integral); - g_assert(vi.frac == vo.frac); + assert(vi.integral == vo.integral); + assert(vi.frac == vo.frac); raw_value = value + bits_set; @@ -123,8 +121,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, swapl(&vo.frac, n); } - g_assert(vi.integral == vo.integral); - g_assert(vi.frac == vo.frac); + assert(vi.integral == vo.integral); + assert(vi.frac == vo.frac); nvals++; } @@ -137,7 +135,7 @@ static void test_XIRawEvent(RawDeviceEvent *in) int rc; rc = EventToXI2((InternalEvent*)in, (xEvent**)&out); - g_assert(rc == Success); + assert(rc == Success); test_values_XIRawEvent(in, out, FALSE); @@ -158,24 +156,24 @@ static void test_convert_XIFocusEvent(void) in.header = ET_Internal; in.type = ET_Enter; rc = EventToXI2((InternalEvent*)&in, &out); - g_assert(rc == Success); - g_assert(out == NULL); + assert(rc == Success); + assert(out == NULL); in.header = ET_Internal; in.type = ET_FocusIn; rc = EventToXI2((InternalEvent*)&in, &out); - g_assert(rc == Success); - g_assert(out == NULL); + assert(rc == Success); + assert(out == NULL); in.header = ET_Internal; in.type = ET_FocusOut; rc = EventToXI2((InternalEvent*)&in, &out); - g_assert(rc == BadImplementation); + assert(rc == BadImplementation); in.header = ET_Internal; in.type = ET_Leave; rc = EventToXI2((InternalEvent*)&in, &out); - g_assert(rc == BadImplementation); + assert(rc == BadImplementation); } @@ -186,7 +184,7 @@ static void test_convert_XIRawEvent(void) memset(&in, 0, sizeof(in)); - g_test_message("Testing all event types"); + printf("Testing all event types\n"); in.header = ET_Internal; in.type = ET_RawMotion; test_XIRawEvent(&in); @@ -207,7 +205,7 @@ static void test_convert_XIRawEvent(void) in.type = ET_RawButtonRelease; test_XIRawEvent(&in); - g_test_message("Testing details and other fields"); + printf("Testing details and other fields\n"); in.detail.button = 1L; test_XIRawEvent(&in); in.detail.button = 1L << 8; @@ -239,7 +237,7 @@ static void test_convert_XIRawEvent(void) in.deviceid = ~0 & 0xFF; test_XIRawEvent(&in); - g_test_message("Testing valuator masks"); + printf("Testing valuator masks\n"); for (i = 0; i < sizeof(in.valuators.mask) * 8; i++) { XISetMask(in.valuators.mask, i); @@ -272,6 +270,7 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, int buttons, valuators; int i; unsigned char *ptr; + uint32_t flagmask = 0; FP3232 *values; if (swap) { @@ -297,52 +296,61 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, swapl(&out->mods.latched_mods, n); swapl(&out->mods.locked_mods, n); swapl(&out->mods.effective_mods, n); + swapl(&out->flags, n); } - g_assert(out->extension == 0); /* IReqCode defaults to 0 */ - g_assert(out->evtype == GetXI2Type((InternalEvent*)in)); - g_assert(out->time == in->time); - g_assert(out->detail == in->detail.button); - g_assert(out->length >= 12); - - g_assert(out->deviceid == in->deviceid); - g_assert(out->sourceid == in->sourceid); - - g_assert(out->flags == 0); /* FIXME: we don't set the flags yet */ + assert(out->extension == 0); /* IReqCode defaults to 0 */ + assert(out->evtype == GetXI2Type((InternalEvent*)in)); + assert(out->time == in->time); + assert(out->detail == in->detail.button); + assert(out->length >= 12); + + assert(out->deviceid == in->deviceid); + assert(out->sourceid == in->sourceid); + + switch (in->type) { + case ET_KeyPress: + flagmask = XIKeyRepeat; + break; + default: + flagmask = 0; + break; + } + assert((out->flags & ~flagmask) == 0); - g_assert(out->root == in->root); - g_assert(out->event == None); /* set in FixUpEventFromWindow */ - g_assert(out->child == None); /* set in FixUpEventFromWindow */ + assert(out->root == in->root); + assert(out->event == None); /* set in FixUpEventFromWindow */ + assert(out->child == None); /* set in FixUpEventFromWindow */ - g_assert(out->mods.base_mods == in->mods.base); - g_assert(out->mods.latched_mods == in->mods.latched); - g_assert(out->mods.locked_mods == in->mods.locked); - g_assert(out->mods.effective_mods == in->mods.effective); + assert(out->mods.base_mods == in->mods.base); + assert(out->mods.latched_mods == in->mods.latched); + assert(out->mods.locked_mods == in->mods.locked); + assert(out->mods.effective_mods == in->mods.effective); - g_assert(out->group.base_group == in->group.base); - g_assert(out->group.latched_group == in->group.latched); - g_assert(out->group.locked_group == in->group.locked); - g_assert(out->group.effective_group == in->group.effective); + assert(out->group.base_group == in->group.base); + assert(out->group.latched_group == in->group.latched); + assert(out->group.locked_group == in->group.locked); + assert(out->group.effective_group == in->group.effective); - g_assert(out->event_x == 0); /* set in FixUpEventFromWindow */ - g_assert(out->event_y == 0); /* set in FixUpEventFromWindow */ + assert(out->event_x == 0); /* set in FixUpEventFromWindow */ + assert(out->event_y == 0); /* set in FixUpEventFromWindow */ - g_assert(out->root_x == FP1616(in->root_x, in->root_x_frac)); - g_assert(out->root_y == FP1616(in->root_y, in->root_y_frac)); + assert(out->root_x == FP1616(in->root_x, in->root_x_frac)); + assert(out->root_y == FP1616(in->root_y, in->root_y_frac)); buttons = 0; for (i = 0; i < bits_to_bytes(sizeof(in->buttons)); i++) { if (XIMaskIsSet(in->buttons, i)) { - g_assert(out->buttons_len >= bytes_to_int32(bits_to_bytes(i))); + assert(out->buttons_len >= bytes_to_int32(bits_to_bytes(i))); buttons++; } } ptr = (unsigned char*)&out[1]; for (i = 0; i < sizeof(in->buttons) * 8; i++) - g_assert(XIMaskIsSet(in->buttons, i) == XIMaskIsSet(ptr, i)); + assert(XIMaskIsSet(in->buttons, i) == XIMaskIsSet(ptr, i)); valuators = 0; @@ -350,7 +358,7 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, if (XIMaskIsSet(in->valuators.mask, i)) valuators++; - g_assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(valuators))); + assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(valuators))); ptr += out->buttons_len * 4; values = (FP3232*)(ptr + out->valuators_len * 4); @@ -358,11 +366,11 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, i < (out->valuators_len * 4) * 8; i++) { if (i > sizeof(in->valuators.mask) * 8) - g_assert(!XIMaskIsSet(ptr, i)); + assert(!XIMaskIsSet(ptr, i)); else if (i > out->valuators_len * 4 * 8) - g_assert(!XIMaskIsSet(in->valuators.mask, i)); + assert(!XIMaskIsSet(in->valuators.mask, i)); else { - g_assert(XIMaskIsSet(in->valuators.mask, i) == + assert(XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i)); if (XIMaskIsSet(ptr, i)) @@ -382,8 +390,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, } - g_assert(vi.integral == vo.integral); - g_assert(vi.frac == vo.frac); + assert(vi.integral == vo.integral); + assert(vi.frac == vo.frac); values++; } } @@ -396,7 +404,7 @@ static void test_XIDeviceEvent(DeviceEvent *in) int rc; rc = EventToXI2((InternalEvent*)in, (xEvent**)&out); - g_assert(rc == Success); + assert(rc == Success); test_values_XIDeviceEvent(in, out, FALSE); @@ -415,7 +423,7 @@ static void test_convert_XIDeviceEvent(void) memset(&in, 0, sizeof(in)); - g_test_message("Testing simple field values"); + printf("Testing simple field values\n"); in.header = ET_Internal; in.type = ET_Motion; in.length = sizeof(DeviceEvent); @@ -439,7 +447,7 @@ static void test_convert_XIDeviceEvent(void) test_XIDeviceEvent(&in); - g_test_message("Testing field ranges"); + printf("Testing field ranges\n"); /* 32 bit */ in.detail.button = 1L; test_XIDeviceEvent(&in); @@ -587,7 +595,7 @@ static void test_convert_XIDeviceEvent(void) in.mods.effective = ~0 & 0xFF; test_XIDeviceEvent(&in); - g_test_message("Testing button masks"); + printf("Testing button masks\n"); for (i = 0; i < sizeof(in.buttons) * 8; i++) { XISetMask(in.buttons, i); @@ -601,7 +609,7 @@ static void test_convert_XIDeviceEvent(void) test_XIDeviceEvent(&in); } - g_test_message("Testing valuator masks"); + printf("Testing valuator masks\n"); for (i = 0; i < sizeof(in.valuators.mask) * 8; i++) { XISetMask(in.valuators.mask, i); @@ -646,12 +654,12 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, swaps(&out->num_classes, n); } - g_assert(out->type == GenericEvent); - g_assert(out->extension == 0); /* IReqCode defaults to 0 */ - g_assert(out->evtype == GetXI2Type((InternalEvent*)in)); - g_assert(out->time == in->time); - g_assert(out->deviceid == in->deviceid); - g_assert(out->sourceid == in->sourceid); + assert(out->type == GenericEvent); + assert(out->extension == 0); /* IReqCode defaults to 0 */ + assert(out->evtype == GetXI2Type((InternalEvent*)in)); + assert(out->time == in->time); + assert(out->deviceid == in->deviceid); + assert(out->sourceid == in->sourceid); ptr = (unsigned char*)&out[1]; for (i = 0; i < out->num_classes; i++) @@ -679,11 +687,11 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, swaps(&b->num_buttons, n); } - g_assert(b->length == + assert(b->length == bytes_to_int32(sizeof(xXIButtonInfo)) + bytes_to_int32(bits_to_bytes(b->num_buttons)) + b->num_buttons); - g_assert(b->num_buttons == in->buttons.num_buttons); + assert(b->num_buttons == in->buttons.num_buttons); names = (Atom*)((char*)&b[1] + pad_to_int32(bits_to_bytes(b->num_buttons))); @@ -694,7 +702,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, char n; swapl(&names[j], n); } - g_assert(names[j] == in->buttons.names[j]); + assert(names[j] == in->buttons.names[j]); } } break; @@ -709,10 +717,10 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, swaps(&k->num_keycodes, n); } - g_assert(k->length == + assert(k->length == bytes_to_int32(sizeof(xXIKeyInfo)) + k->num_keycodes); - g_assert(k->num_keycodes == in->keys.max_keycode - + assert(k->num_keycodes == in->keys.max_keycode - in->keys.min_keycode + 1); kc = (uint32_t*)&k[1]; @@ -723,21 +731,22 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, char n; swapl(&kc[j], n); } - g_assert(kc[j] >= in->keys.min_keycode); - g_assert(kc[j] <= in->keys.max_keycode); + assert(kc[j] >= in->keys.min_keycode); + assert(kc[j] <= in->keys.max_keycode); } } break; case XIValuatorClass: { xXIValuatorInfo *v = (xXIValuatorInfo*)any; - g_assert(v->length == + assert(v->length == bytes_to_int32(sizeof(xXIValuatorInfo))); } break; default: - g_error("Invalid class type.\n"); + printf("Invalid class type.\n\n"); + assert(1); break; } @@ -752,7 +761,7 @@ static void test_XIDeviceChangedEvent(DeviceChangedEvent *in) int rc; rc = EventToXI2((InternalEvent*)in, (xEvent**)&out); - g_assert(rc == Success); + assert(rc == Success); test_values_XIDeviceChangedEvent(in, out, FALSE); @@ -769,7 +778,7 @@ static void test_convert_XIDeviceChangedEvent(void) DeviceChangedEvent in; int i; - g_test_message("Testing simple field values"); + printf("Testing simple field values\n"); memset(&in, 0, sizeof(in)); in.header = ET_Internal; in.type = ET_DeviceChanged; @@ -895,13 +904,10 @@ static void test_convert_XIDeviceChangedEvent(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - - g_test_add_func("/xi2/eventconvert/XIRawEvent", test_convert_XIRawEvent); - g_test_add_func("/xi2/eventconvert/XIFocusEvent", test_convert_XIFocusEvent); - g_test_add_func("/xi2/eventconvert/XIDeviceEvent", test_convert_XIDeviceEvent); - g_test_add_func("/xi2/eventconvert/XIDeviceChangedEvent", test_convert_XIDeviceChangedEvent); + test_convert_XIRawEvent(); + test_convert_XIFocusEvent(); + test_convert_XIDeviceEvent(); + test_convert_XIDeviceChangedEvent(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c index 6b4d04957..5e45e7b32 100644 --- a/test/xi2/protocol-xigetclientpointer.c +++ b/test/xi2/protocol-xigetclientpointer.c @@ -39,7 +39,6 @@ #include "exevents.h" #include "protocol-common.h" -#include struct { int cp_is_set; @@ -79,9 +78,9 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void reply_check_defaults(rep, len, XIGetClientPointer); - g_assert(rep->set == test_data.cp_is_set); + assert(rep->set == test_data.cp_is_set); if (rep->set) - g_assert(rep->deviceid == test_data.dev->id); + assert(rep->deviceid == test_data.dev->id); } static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error) @@ -92,19 +91,19 @@ static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* test_data.win = req->win; rc = ProcXIGetClientPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadWindow) - g_assert(client_request.errorValue == req->win); + assert(client_request.errorValue == req->win); client_request.swapped = TRUE; swapl(&req->win, n); swaps(&req->length, n); rc = SProcXIGetClientPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadWindow) - g_assert(client_request.errorValue == req->win); + assert(client_request.errorValue == req->win); } @@ -121,21 +120,21 @@ static void test_XIGetClientPointer(void) client_request = init_client(request.length, &request); - g_test_message("Testing invalid window"); + printf("Testing invalid window\n"); request.win = INVALID_WINDOW_ID; request_XIGetClientPointer(&client_request, &request, BadWindow); test_data.cp_is_set = FALSE; - g_test_message("Testing window None, unset ClientPointer."); + printf("Testing window None, unset ClientPointer.\n"); request.win = None; request_XIGetClientPointer(&client_request, &request, Success); - g_test_message("Testing valid window, unset ClientPointer."); + printf("Testing valid window, unset ClientPointer.\n"); request.win = CLIENT_WINDOW_ID; request_XIGetClientPointer(&client_request, &request, Success); - g_test_message("Testing valid window, set ClientPointer."); + printf("Testing valid window, set ClientPointer.\n"); client_window.clientPtr = devices.vcp; test_data.dev = devices.vcp; test_data.cp_is_set = TRUE; @@ -144,7 +143,7 @@ static void test_XIGetClientPointer(void) client_window.clientPtr = NULL; - g_test_message("Testing window None, set ClientPointer."); + printf("Testing window None, set ClientPointer.\n"); client_request.clientPtr = devices.vcp; test_data.dev = devices.vcp; test_data.cp_is_set = TRUE; @@ -154,14 +153,10 @@ static void test_XIGetClientPointer(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); client_window = init_client(0, NULL); + test_XIGetClientPointer(); - g_test_add_func("/xi2/protocol/XIGetClientPointer", test_XIGetClientPointer); - - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c index 97aae159f..55de77356 100644 --- a/test/xi2/protocol-xigetselectedevents.c +++ b/test/xi2/protocol-xigetselectedevents.c @@ -48,7 +48,6 @@ #include "exevents.h" #include "protocol-common.h" -#include static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, void *userdata); static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata); @@ -100,7 +99,7 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, voi reply_check_defaults(rep, len, XIGetSelectedEvents); - g_assert(rep->num_masks == test_data.num_masks_expected); + assert(rep->num_masks == test_data.num_masks_expected); reply_handler = reply_XIGetSelectedEvents_data; } @@ -121,11 +120,11 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data swaps(&mask->mask_len, n); } - g_assert(mask->deviceid < 6); - g_assert(mask->mask_len <= (((XI2LASTEVENT + 8)/8) + 3)/4) ; + assert(mask->deviceid < 6); + assert(mask->mask_len <= (((XI2LASTEVENT + 8)/8) + 3)/4) ; bitmask = (unsigned char*)&mask[1]; - g_assert(memcmp(bitmask, + assert(memcmp(bitmask, test_data.mask[mask->deviceid], mask->mask_len * 4) == 0); @@ -145,14 +144,14 @@ static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error) reply_handler = reply_XIGetSelectedEvents; rc = ProcXIGetSelectedEvents(&client); - g_assert(rc == error); + assert(rc == error); reply_handler = reply_XIGetSelectedEvents; client.swapped = TRUE; swapl(&req->win, n); swaps(&req->length, n); rc = SProcXIGetSelectedEvents(&client); - g_assert(rc == error); + assert(rc == error); } static void test_XIGetSelectedEvents(void) @@ -165,11 +164,11 @@ static void test_XIGetSelectedEvents(void) request_init(&request, XIGetSelectedEvents); - g_test_message("Testing for BadWindow on invalid window."); + printf("Testing for BadWindow on invalid window.\n"); request.win = None; request_XIGetSelectedEvents(&request, BadWindow); - g_test_message("Testing for zero-length (unset) masks."); + printf("Testing for zero-length (unset) masks.\n"); /* No masks set yet */ test_data.num_masks_expected = 0; request.win = ROOT_WINDOW_ID; @@ -181,7 +180,7 @@ static void test_XIGetSelectedEvents(void) memset(test_data.mask, 0, sizeof(test_data.mask)); - g_test_message("Testing for valid masks"); + printf("Testing for valid masks\n"); memset(&dev, 0, sizeof(dev)); /* dev->id is enough for XISetEventMask */ request.win = ROOT_WINDOW_ID; @@ -210,7 +209,7 @@ static void test_XIGetSelectedEvents(void) } } - g_test_message("Testing removing all masks"); + printf("Testing removing all masks\n"); /* Unset all masks one-by-one */ for (j = MAXDEVICES - 1; j >= 0; j--) { @@ -229,13 +228,10 @@ static void test_XIGetSelectedEvents(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); - g_test_add_func("/xi2/protocol/XIGetSelectedEvents", test_XIGetSelectedEvents); + test_XIGetSelectedEvents(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c new file mode 100644 index 000000000..a61c1549c --- /dev/null +++ b/test/xi2/protocol-xipassivegrabdevice.c @@ -0,0 +1,234 @@ +/** + * Copyright © 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +/* + * Protocol testing for XIPassiveGrab request. + */ +#include +#include +#include +#include +#include "inputstr.h" +#include "windowstr.h" +#include "scrnintstr.h" +#include "xipassivegrab.h" +#include "exevents.h" + +#include "protocol-common.h" + +static ClientRec client_request; +#define N_MODS 7 +static uint32_t modifiers[N_MODS] = {1, 2, 3, 4, 5, 6, 7}; + +struct test_data { + int num_modifiers; +} testdata; + +int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, + int button, GrabParameters *param, GrabType grabtype, + GrabMask *mask); +static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata); + +int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) +{ + if (id == root.drawable.id) + { + *win = &root; + return Success; + } else if (id == window.drawable.id) + { + *win = &window; + return Success; + } + + return __real_dixLookupWindow(win, id, client, access); +} + +int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, + int button, GrabParameters *param, GrabType grabtype, + GrabMask *mask) +{ + /* Fail every odd modifier */ + if (param->modifiers % 2) + return BadAccess; + + return Success; +} + +static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata) +{ + xXIPassiveGrabDeviceReply *rep = (xXIPassiveGrabDeviceReply*)data; + + if (client->swapped) + { + char n; + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swaps(&rep->num_modifiers, n); + + testdata.num_modifiers = rep->num_modifiers; + } + + reply_check_defaults(rep, len, XIPassiveGrabDevice); + + /* ProcXIPassiveGrabDevice sends the data in two batches, let the second + * handler handle the modifier data */ + if (rep->num_modifiers > 0) + reply_handler = reply_XIPassiveGrabDevice_data; +} + +static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata) +{ + int i; + int n; + + xXIGrabModifierInfo *mods = (xXIGrabModifierInfo*)data; + + for (i = 0; i < testdata.num_modifiers; i++, mods++) + { + if (client->swapped) + swapl(&mods->modifiers, n); + + /* 1 - 7 is the range we use for the global modifiers array + * above */ + assert(mods->modifiers > 0); + assert(mods->modifiers <= 7); + assert(mods->modifiers % 2 == 1); /* because we fail odd ones */ + assert(mods->status != Success); + assert(mods->pad0 == 0); + assert(mods->pad1 == 0); + } + + reply_handler = reply_XIPassiveGrabDevice; +} + +static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq* req, int error, int errval) +{ + char n; + int rc; + int modifiers; + + rc = ProcXIPassiveGrabDevice(&client_request); + assert(rc == error); + + if (rc != Success) + assert(client_request.errorValue == errval); + + client_request.swapped = TRUE; + swaps(&req->length, n); + swapl(&req->time, n); + swapl(&req->grab_window, n); + swapl(&req->cursor, n); + swapl(&req->detail, n); + swaps(&req->deviceid, n); + modifiers = req->num_modifiers; + swaps(&req->num_modifiers, n); + swaps(&req->mask_len, n); + + while(modifiers--) + { + CARD32 *mod = ((CARD32*)(req + 1)) + modifiers; + swapl(mod, n); + } + + rc = SProcXIPassiveGrabDevice(&client_request); + assert(rc == error); + + if (rc != Success) + assert(client_request.errorValue == errval); +} + +static unsigned char *data[4096]; /* the request buffer */ +static void test_XIPassiveGrabDevice(void) +{ + int i; + xXIPassiveGrabDeviceReq *request = (xXIPassiveGrabDeviceReq*)data; + unsigned char *mask; + + request_init(request, XIPassiveGrabDevice); + + request->grab_window = CLIENT_WINDOW_ID; + + reply_handler = reply_XIPassiveGrabDevice; + client_request = init_client(request->length, request); + + printf("Testing invalid device\n"); + request->deviceid = 12; + request_XIPassiveGrabDevice(&client_request, request, BadDevice, request->deviceid); + + request->deviceid = XIAllMasterDevices; + + printf("Testing invalid grab types\n"); + for (i = XIGrabtypeFocusIn + 1; i < 0xFF; i++) + { + request->grab_type = i; + request_XIPassiveGrabDevice(&client_request, request, BadValue, request->grab_type); + } + + printf("Testing invalid grab type + detail combinations\n"); + request->grab_type = XIGrabtypeEnter; + request->detail = 1; + request_XIPassiveGrabDevice(&client_request, request, BadValue, request->detail); + + request->grab_type = XIGrabtypeFocusIn; + request_XIPassiveGrabDevice(&client_request, request, BadValue, request->detail); + + request->detail = 0; + + printf("Testing invalid masks\n"); + mask = (unsigned char*)&request[1]; + + request->mask_len = bytes_to_int32(XI2LASTEVENT + 1); + request->length += request->mask_len; + SetBit(mask, XI2LASTEVENT + 1); + request_XIPassiveGrabDevice(&client_request, request, BadValue, XI2LASTEVENT + 1); + + ClearBit(mask, XI2LASTEVENT + 1); + + /* tested all special cases now, test a few valid cases */ + + /* no modifiers */ + request->deviceid = XIAllDevices; + request->grab_type = XIGrabtypeButton; + request->detail = XIAnyButton; + request_XIPassiveGrabDevice(&client_request, request, Success, 0); + + /* some modifiers */ + request->num_modifiers = N_MODS; + request->length += N_MODS; + memcpy((uint32_t*)(request + 1) + request->mask_len, modifiers, sizeof(modifiers)); + request_XIPassiveGrabDevice(&client_request, request, Success, 0); +} + +int main(int argc, char** argv) +{ + init_simple(); + + test_XIPassiveGrabDevice(); + + return 0; +} diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c index 508fc4dfb..cb1cc8130 100644 --- a/test/xi2/protocol-xiquerydevice.c +++ b/test/xi2/protocol-xiquerydevice.c @@ -38,7 +38,6 @@ #include "xiquerydevice.h" #include "protocol-common.h" -#include /* * Protocol testing for XIQueryDevice request and reply. * @@ -74,11 +73,11 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use reply_check_defaults(rep, len, XIQueryDevice); if (querydata->which_device == XIAllDevices) - g_assert(rep->num_devices == devices.num_devices); + assert(rep->num_devices == devices.num_devices); else if (querydata->which_device == XIAllMasterDevices) - g_assert(rep->num_devices == devices.num_master_devices); + assert(rep->num_devices == devices.num_master_devices); else - g_assert(rep->num_devices == 1); + assert(rep->num_devices == 1); querydata->num_devices_in_reply = rep->num_devices; reply_handler = reply_XIQueryDevice_data; @@ -107,46 +106,46 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void } if (querydata->which_device > XIAllMasterDevices) - g_assert(info->deviceid == querydata->which_device); + assert(info->deviceid == querydata->which_device); - g_assert(info->deviceid >= 2); /* 0 and 1 is reserved */ + assert(info->deviceid >= 2); /* 0 and 1 is reserved */ switch(info->deviceid) { case 2: /* VCP */ dev = devices.vcp; - g_assert(info->use == XIMasterPointer); - g_assert(info->attachment == devices.vck->id); - g_assert(info->num_classes == 3); /* 2 axes + button */ + assert(info->use == XIMasterPointer); + assert(info->attachment == devices.vck->id); + assert(info->num_classes == 3); /* 2 axes + button */ break; case 3: /* VCK */ dev = devices.vck; - g_assert(info->use == XIMasterKeyboard); - g_assert(info->attachment == devices.vcp->id); - g_assert(info->num_classes == 1); + assert(info->use == XIMasterKeyboard); + assert(info->attachment == devices.vcp->id); + assert(info->num_classes == 1); break; case 4: /* mouse */ dev = devices.mouse; - g_assert(info->use == XISlavePointer); - g_assert(info->attachment == devices.vcp->id); - g_assert(info->num_classes == 3); /* 2 axes + button */ + assert(info->use == XISlavePointer); + assert(info->attachment == devices.vcp->id); + assert(info->num_classes == 3); /* 2 axes + button */ break; case 5: /* keyboard */ dev = devices.kbd; - g_assert(info->use == XISlaveKeyboard); - g_assert(info->attachment == devices.vck->id); - g_assert(info->num_classes == 1); + assert(info->use == XISlaveKeyboard); + assert(info->attachment == devices.vck->id); + assert(info->num_classes == 1); break; default: /* We shouldn't get here */ - g_assert(0); + assert(0); break; } - g_assert(info->enabled == dev->enabled); - g_assert(info->name_len == strlen(dev->name)); - g_assert(strncmp((char*)&info[1], dev->name, info->name_len) == 0); + assert(info->enabled == dev->enabled); + assert(info->name_len == strlen(dev->name)); + assert(strncmp((char*)&info[1], dev->name, info->name_len) == 0); any = (xXIAnyInfo*)((char*)&info[1] + ((info->name_len + 3)/4) * 4); for (j = 0; j < info->num_classes; j++) @@ -171,9 +170,9 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void if (client->swapped) swaps(&ki->num_keycodes, n); - g_assert(any->type == XIKeyClass); - g_assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1)); - g_assert(any->length == (2 + ki->num_keycodes)); + assert(any->type == XIKeyClass); + assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1)); + assert(any->length == (2 + ki->num_keycodes)); kc = (uint32_t*)&ki[1]; for (k = 0; k < ki->num_keycodes; k++, kc++) @@ -181,15 +180,15 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void if (client->swapped) swapl(kc, n); - g_assert(*kc >= xkb->min_key_code); - g_assert(*kc <= xkb->max_key_code); + assert(*kc >= xkb->min_key_code); + assert(*kc <= xkb->max_key_code); } break; } case 2: /* VCP and mouse have the same properties */ case 4: { - g_assert(any->type == XIButtonClass || + assert(any->type == XIButtonClass || any->type == XIValuatorClass); if (any->type == XIButtonClass) @@ -200,10 +199,10 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void if (client->swapped) swaps(&bi->num_buttons, n); - g_assert(bi->num_buttons == devices.vcp->button->numButtons); + assert(bi->num_buttons == devices.vcp->button->numButtons); len = 2 + bi->num_buttons + bytes_to_int32(bits_to_bytes(bi->num_buttons)); - g_assert(bi->length == len); + assert(bi->length == len); } else if (any->type == XIValuatorClass) { xXIValuatorInfo *vi = (xXIValuatorInfo*)any; @@ -219,17 +218,17 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void swapl(&vi->resolution, n); } - g_assert(vi->length == 11); - g_assert(vi->number == 0 || + assert(vi->length == 11); + assert(vi->number == 0 || vi->number == 1); - g_assert(vi->mode == XIModeRelative); + assert(vi->mode == XIModeRelative); /* device was set up as relative, so standard * values here. */ - g_assert(vi->min.integral == -1); - g_assert(vi->min.frac == 0); - g_assert(vi->max.integral == -1); - g_assert(vi->max.frac == 0); - g_assert(vi->resolution == 0); + assert(vi->min.integral == -1); + assert(vi->min.frac == 0); + assert(vi->max.integral == -1); + assert(vi->max.frac == 0); + assert(vi->resolution == 0); } } break; @@ -257,10 +256,10 @@ static void request_XIQueryDevice(struct test_data *querydata, request.deviceid = deviceid; rc = ProcXIQueryDevice(&client); - g_assert(rc == error); + assert(rc == error); if (rc != Success) - g_assert(client.errorValue == deviceid); + assert(client.errorValue == deviceid); reply_handler = reply_XIQueryDevice; @@ -268,10 +267,10 @@ static void request_XIQueryDevice(struct test_data *querydata, swaps(&request.length, n); swaps(&request.deviceid, n); rc = SProcXIQueryDevice(&client); - g_assert(rc == error); + assert(rc == error); if (rc != Success) - g_assert(client.errorValue == deviceid); + assert(client.errorValue == deviceid); } static void test_XIQueryDevice(void) @@ -284,16 +283,16 @@ static void test_XIQueryDevice(void) userdata = &data; request_init(&request, XIQueryDevice); - g_test_message("Testing XIAllDevices."); + printf("Testing XIAllDevices.\n"); request_XIQueryDevice(&data, XIAllDevices, Success); - g_test_message("Testing XIAllMasterDevices."); + printf("Testing XIAllMasterDevices.\n"); request_XIQueryDevice(&data, XIAllMasterDevices, Success); - g_test_message("Testing existing device ids."); + printf("Testing existing device ids.\n"); for (i = 2; i < 6; i++) request_XIQueryDevice(&data, i, Success); - g_test_message("Testing non-existing device ids."); + printf("Testing non-existing device ids.\n"); for (i = 6; i <= 0xFFFF; i++) request_XIQueryDevice(&data, i, BadDevice); @@ -304,13 +303,10 @@ static void test_XIQueryDevice(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); - g_test_add_func("/dix/xi2protocol/XIQueryDevice", test_XIQueryDevice); + test_XIQueryDevice(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c index 810c61575..0985ec70d 100644 --- a/test/xi2/protocol-xiquerypointer.c +++ b/test/xi2/protocol-xiquerypointer.c @@ -39,7 +39,6 @@ #include "exevents.h" #include "protocol-common.h" -#include static ClientRec client_request; static void reply_XIQueryPointer_data(ClientPtr client, int len, @@ -96,18 +95,18 @@ static void reply_XIQueryPointer(ClientPtr client, int len, char *data, reply_check_defaults(rep, len, XIQueryPointer); - g_assert(rep->root == root.drawable.id); - g_assert(rep->same_screen == xTrue); + assert(rep->root == root.drawable.id); + assert(rep->same_screen == xTrue); sprite = test_data.dev->spriteInfo->sprite; - g_assert((rep->root_x >> 16) == sprite->hot.x); - g_assert((rep->root_y >> 16) == sprite->hot.y); + assert((rep->root_x >> 16) == sprite->hot.x); + assert((rep->root_y >> 16) == sprite->hot.y); if (test_data.win == &root) { - g_assert(rep->root_x == rep->win_x); - g_assert(rep->root_y == rep->win_y); - g_assert(rep->child == window.drawable.id); + assert(rep->root_x == rep->win_x); + assert(rep->root_y == rep->win_y); + assert(rep->child == window.drawable.id); } else { int x, y; @@ -115,13 +114,13 @@ static void reply_XIQueryPointer(ClientPtr client, int len, char *data, x = sprite->hot.x - window.drawable.x; y = sprite->hot.y - window.drawable.y; - g_assert((rep->win_x >> 16) == x); - g_assert((rep->win_y >> 16) == y); - g_assert(rep->child == None); + assert((rep->win_x >> 16) == x); + assert((rep->win_y >> 16) == y); + assert(rep->child == None); } - g_assert(rep->same_screen == xTrue); + assert(rep->same_screen == xTrue); reply_handler = reply_XIQueryPointer_data; } @@ -137,19 +136,19 @@ static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, in int rc; rc = ProcXIQueryPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client_request.errorValue == req->deviceid); + assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; swaps(&req->deviceid, n); swaps(&req->length, n); rc = SProcXIQueryPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client_request.errorValue == req->deviceid); + assert(client_request.errorValue == req->deviceid); } static void test_XIQueryPointer(void) @@ -185,7 +184,7 @@ static void test_XIQueryPointer(void) request_XIQueryPointer(&client_request, &request, BadDevice); test_data.dev = devices.mouse; - devices.mouse->u.master = NULL; /* Float, kind-of */ + devices.mouse->master = NULL; /* Float, kind-of */ request.deviceid = devices.mouse->id; request_XIQueryPointer(&client_request, &request, Success); @@ -209,12 +208,9 @@ static void test_XIQueryPointer(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); - g_test_add_func("/xi2/protocol/XIQueryPointer", test_XIQueryPointer); + test_XIQueryPointer(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c index 46e62acbd..3bb356e7f 100644 --- a/test/xi2/protocol-xiqueryversion.c +++ b/test/xi2/protocol-xiqueryversion.c @@ -46,7 +46,6 @@ #include "xiqueryversion.h" #include "protocol-common.h" -#include extern XExtensionVersion XIVersion; @@ -74,14 +73,14 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us reply_check_defaults(rep, len, XIQueryVersion); - g_assert(rep->length == 0); + assert(rep->length == 0); sver = versions->major_server * 1000 + versions->minor_server; cver = versions->major_client * 1000 + versions->minor_client; ver = rep->major_version * 1000 + rep->minor_version; - g_assert(ver >= 2000); - g_assert((sver > cver) ? ver == cver : ver == sver); + assert(ver >= 2000); + assert((sver > cver) ? ver == cver : ver == sver); } /** @@ -115,7 +114,7 @@ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int e request.major_version = versions.major_client; request.minor_version = versions.minor_client; rc = ProcXIQueryVersion(&client); - g_assert(rc == error); + assert(rc == error); client.swapped = TRUE; @@ -124,7 +123,7 @@ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int e swaps(&request.minor_version, n); rc = SProcXIQueryVersion(&client); - g_assert(rc == error); + assert(rc == error); } /* Client version less than 2.0 must return BadValue, all other combinations @@ -133,23 +132,23 @@ static void test_XIQueryVersion(void) { reply_handler = reply_XIQueryVersion; - g_test_message("Server version 2.0 - client versions [1..3].0"); + printf("Server version 2.0 - client versions [1..3].0\n"); /* some simple tests to catch common errors quickly */ request_XIQueryVersion(2, 0, 1, 0, BadValue); request_XIQueryVersion(2, 0, 2, 0, Success); request_XIQueryVersion(2, 0, 3, 0, Success); - g_test_message("Server version 3.0 - client versions [1..3].0"); + printf("Server version 3.0 - client versions [1..3].0\n"); request_XIQueryVersion(3, 0, 1, 0, BadValue); request_XIQueryVersion(3, 0, 2, 0, Success); request_XIQueryVersion(3, 0, 3, 0, Success); - g_test_message("Server version 2.0 - client versions [1..3].[1..3]"); + printf("Server version 2.0 - client versions [1..3].[1..3]\n"); request_XIQueryVersion(2, 0, 1, 1, BadValue); request_XIQueryVersion(2, 0, 2, 2, Success); request_XIQueryVersion(2, 0, 3, 3, Success); - g_test_message("Server version 2.2 - client versions [1..3].0"); + printf("Server version 2.2 - client versions [1..3].0\n"); request_XIQueryVersion(2, 2, 1, 0, BadValue); request_XIQueryVersion(2, 2, 2, 0, Success); request_XIQueryVersion(2, 2, 3, 0, Success); @@ -158,7 +157,7 @@ static void test_XIQueryVersion(void) /* this one takes a while */ unsigned int cmin, cmaj, smin, smaj; - g_test_message("Testing all combinations."); + printf("Testing all combinations.\n"); for (smaj = 2; smaj <= 0xFFFF; smaj++) for (smin = 0; smin <= 0xFFFF; smin++) for (cmin = 0; cmin <= 0xFFFF; cmin++) @@ -175,12 +174,9 @@ static void test_XIQueryVersion(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); - g_test_add_func("/xi2/protocol/XIQueryVersion", test_XIQueryVersion); + test_XIQueryVersion(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c index fe1c26df8..fa422e2cb 100644 --- a/test/xi2/protocol-xiselectevents.c +++ b/test/xi2/protocol-xiselectevents.c @@ -58,7 +58,6 @@ #include "xiselectev.h" #include "protocol-common.h" -#include static unsigned char *data[4096 * 20]; /* the request data buffer */ @@ -107,7 +106,7 @@ static void request_XISelectEvent(xXISelectEventsReq *req, int error) client = init_client(req->length, req); rc = ProcXISelectEvents(&client); - g_assert(rc == error); + assert(rc == error); client.swapped = TRUE; @@ -124,14 +123,14 @@ static void request_XISelectEvent(xXISelectEventsReq *req, int error) swaps(&req->length, n); swaps(&req->num_masks, n); rc = SProcXISelectEvents(&client); - g_assert(rc == error); + assert(rc == error); } static void request_XISelectEvents_masks(xXISelectEventsReq *req) { int i, j; xXIEventMask *mask; - int nmasks = (XI_LASTEVENT + 7)/8; + int nmasks = (XI2LASTEVENT + 7)/8; unsigned char *bits; mask = (xXIEventMask*)&req[1]; @@ -150,14 +149,14 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req) request_XISelectEvent(req, Success); /* Test 1: - * mask may be larger than needed for XI_LASTEVENT. + * mask may be larger than needed for XI2LASTEVENT. * Test setting each valid mask bit, while leaving unneeded bits 0. * -> Success */ bits = (unsigned char*)&mask[1]; mask->mask_len = (nmasks + 3)/4 * 10; memset(bits, 0, mask->mask_len * 4); - for (j = 0; j <= XI_LASTEVENT; j++) + for (j = 0; j <= XI2LASTEVENT; j++) { SetBit(bits, j); request_XISelectEvent(req, Success); @@ -165,7 +164,7 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req) } /* Test 2: - * mask may be larger than needed for XI_LASTEVENT. + * mask may be larger than needed for XI2LASTEVENT. * Test setting all valid mask bits, while leaving unneeded bits 0. * -> Success */ @@ -173,21 +172,21 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req) mask->mask_len = (nmasks + 3)/4 * 10; memset(bits, 0, mask->mask_len * 4); - for (j = 0; j <= XI_LASTEVENT; j++) + for (j = 0; j <= XI2LASTEVENT; j++) { SetBit(bits, j); request_XISelectEvent(req, Success); } /* Test 3: - * mask is larger than needed for XI_LASTEVENT. If any unneeded bit + * mask is larger than needed for XI2LASTEVENT. If any unneeded bit * is set -> BadValue */ bits = (unsigned char*)&mask[1]; mask->mask_len = (nmasks + 3)/4 * 10; memset(bits, 0, mask->mask_len * 4); - for (j = XI_LASTEVENT + 1; j < mask->mask_len * 4; j++) + for (j = XI2LASTEVENT + 1; j < mask->mask_len * 4; j++) { SetBit(bits, j); request_XISelectEvent(req, BadValue); @@ -200,7 +199,7 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req) bits = (unsigned char*)&mask[1]; mask->mask_len = (nmasks + 3)/4; memset(bits, 0, mask->mask_len * 4); - for (j = 0; j <= XI_LASTEVENT; j++) + for (j = 0; j <= XI2LASTEVENT; j++) { SetBit(bits, j); request_XISelectEvent(req, Success); @@ -228,7 +227,7 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req) bits = (unsigned char*)&mask[1]; mask->mask_len = (nmasks + 3)/4; memset(bits, 0, mask->mask_len * 4); - for (j = 0; j <= XI_LASTEVENT; j++) + for (j = 0; j <= XI2LASTEVENT; j++) SetBit(bits, j); ClearBit(bits, XI_HierarchyChanged); for (j = 1; j < 6; j++) @@ -250,7 +249,7 @@ static void test_XISelectEvents(void) request_init(req, XISelectEvents); - g_test_message("Testing for BadValue on zero-length masks"); + printf("Testing for BadValue on zero-length masks\n"); /* zero masks are BadValue, regardless of the window */ req->num_masks = 0; @@ -263,7 +262,7 @@ static void test_XISelectEvents(void) req->win = CLIENT_WINDOW_ID; request_XISelectEvent(req, BadValue); - g_test_message("Testing for BadWindow."); + printf("Testing for BadWindow.\n"); /* None window is BadWindow, regardless of the masks. * We don't actually need to set the masks here, BadWindow must occur * before checking the masks. @@ -283,7 +282,7 @@ static void test_XISelectEvents(void) req->num_masks = 0xFFFC; request_XISelectEvent(req, BadWindow); - g_test_message("Triggering num_masks/length overflow"); + printf("Triggering num_masks/length overflow\n"); req->win = ROOT_WINDOW_ID; /* Integer overflow - req->length can't hold that much */ req->num_masks = 0xFFFF; @@ -292,14 +291,14 @@ static void test_XISelectEvents(void) req->win = ROOT_WINDOW_ID; req->num_masks = 1; - g_test_message("Triggering bogus mask length error"); + printf("Triggering bogus mask length error\n"); mask = (xXIEventMask*)&req[1]; mask->deviceid = 0; mask->mask_len = 0xFFFF; request_XISelectEvent(req, BadLength); /* testing various device ids */ - g_test_message("Testing existing device ids."); + printf("Testing existing device ids.\n"); for (i = 0; i < 6; i++) { mask = (xXIEventMask*)&req[1]; @@ -310,7 +309,7 @@ static void test_XISelectEvents(void) request_XISelectEvent(req, Success); } - g_test_message("Testing non-existing device ids."); + printf("Testing non-existing device ids.\n"); for (i = 6; i <= 0xFFFF; i++) { req->win = ROOT_WINDOW_ID; @@ -326,13 +325,10 @@ static void test_XISelectEvents(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); - g_test_add_func("/xi2/protocol/XISelectEvents", test_XISelectEvents); + test_XISelectEvents(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c index 2e638eea7..c266b6560 100644 --- a/test/xi2/protocol-xisetclientpointer.c +++ b/test/xi2/protocol-xisetclientpointer.c @@ -46,7 +46,6 @@ #include "exevents.h" #include "protocol-common.h" -#include static ClientRec client_window; static ClientRec client_request; @@ -72,20 +71,20 @@ static void request_XISetClientPointer(xXISetClientPointerReq* req, int error) client_request = init_client(req->length, req); rc = ProcXISetClientPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client_request.errorValue == req->deviceid); + assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; swapl(&req->win, n); swaps(&req->length, n); swaps(&req->deviceid, n); rc = SProcXISetClientPointer(&client_request); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client_request.errorValue == req->deviceid); + assert(client_request.errorValue == req->deviceid); } @@ -98,36 +97,36 @@ static void test_XISetClientPointer(void) request.win = CLIENT_WINDOW_ID; - g_test_message("Testing BadDevice error for XIAllDevices and XIMasterDevices."); + printf("Testing BadDevice error for XIAllDevices and XIMasterDevices.\n"); request.deviceid = XIAllDevices; request_XISetClientPointer(&request, BadDevice); request.deviceid = XIAllMasterDevices; request_XISetClientPointer(&request, BadDevice); - g_test_message("Testing Success for VCP and VCK."); + printf("Testing Success for VCP and VCK.\n"); request.deviceid = devices.vcp->id; /* 2 */ request_XISetClientPointer(&request, Success); - g_assert(client_window.clientPtr->id == 2); + assert(client_window.clientPtr->id == 2); request.deviceid = devices.vck->id; /* 3 */ request_XISetClientPointer(&request, Success); - g_assert(client_window.clientPtr->id == 2); + assert(client_window.clientPtr->id == 2); - g_test_message("Testing BadDevice error for all other devices."); + printf("Testing BadDevice error for all other devices.\n"); for (i = 4; i <= 0xFFFF; i++) { request.deviceid = i; request_XISetClientPointer(&request, BadDevice); } - g_test_message("Testing window None"); + printf("Testing window None\n"); request.win = None; request.deviceid = devices.vcp->id; /* 2 */ request_XISetClientPointer(&request, Success); - g_assert(client_request.clientPtr->id == 2); + assert(client_request.clientPtr->id == 2); - g_test_message("Testing invalid window"); + printf("Testing invalid window\n"); request.win = INVALID_WINDOW_ID; request.deviceid = devices.vcp->id; request_XISetClientPointer(&request, BadWindow); @@ -137,13 +136,10 @@ static void test_XISetClientPointer(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); client_window = init_client(0, NULL); - g_test_add_func("/xi2/protocol/XISetClientPointer", test_XISetClientPointer); + test_XISetClientPointer(); - return g_test_run(); + return 0; } diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c index 4f8860ea0..0c8db453d 100644 --- a/test/xi2/protocol-xiwarppointer.c +++ b/test/xi2/protocol-xiwarppointer.c @@ -39,7 +39,6 @@ #include "exevents.h" #include "protocol-common.h" -#include static int expected_x = SPRITE_X; static int expected_y = SPRITE_Y; @@ -70,8 +69,8 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen, int x, int y, Bool generateEvent) { - g_assert(x == expected_x); - g_assert(y == expected_y); + assert(x == expected_x); + assert(y == expected_y); return TRUE; } @@ -83,12 +82,12 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, int rc; rc = ProcXIWarpPointer(client); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client->errorValue == req->deviceid); + assert(client->errorValue == req->deviceid); else if (rc == BadWindow) - g_assert(client->errorValue == req->dst_win || + assert(client->errorValue == req->dst_win || client->errorValue == req->src_win); @@ -105,12 +104,12 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, swaps(&req->deviceid, n); rc = SProcXIWarpPointer(client); - g_assert(rc == error); + assert(rc == error); if (rc == BadDevice) - g_assert(client->errorValue == req->deviceid); + assert(client->errorValue == req->deviceid); else if (rc == BadWindow) - g_assert(client->errorValue == req->dst_win || + assert(client->errorValue == req->dst_win || client->errorValue == req->src_win); client->swapped = FALSE; @@ -145,7 +144,7 @@ static void test_XIWarpPointer(void) request.deviceid = devices.kbd->id; request_XIWarpPointer(&client_request, &request, BadDevice); - devices.mouse->u.master = NULL; /* Float, kind-of */ + devices.mouse->master = NULL; /* Float, kind-of */ request.deviceid = devices.mouse->id; request_XIWarpPointer(&client_request, &request, Success); @@ -204,13 +203,10 @@ static void test_XIWarpPointer(void) int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - init_simple(); screen.SetCursorPosition = ScreenSetCursorPosition; - g_test_add_func("/xi2/protocol/XIWarpPointer", test_XIWarpPointer); + test_XIWarpPointer(); - return g_test_run(); + return 0; } diff --git a/test/xkb.c b/test/xkb.c index 6fbb26a01..421153cd1 100644 --- a/test/xkb.c +++ b/test/xkb.c @@ -46,8 +46,7 @@ #include #include "xkbfile.h" #include "../xkb/xkb.h" - -#include +#include /** * Initialize an empty XkbRMLVOSet. @@ -62,16 +61,16 @@ static void xkb_get_rules_test(void) XkbGetRulesDflts(&rmlvo); - g_assert(rmlvo.rules); - g_assert(rmlvo.model); - g_assert(rmlvo.layout); - g_assert(rmlvo.variant); - g_assert(rmlvo.options); - g_assert(strcmp(rmlvo.rules, XKB_DFLT_RULES) == 0); - g_assert(strcmp(rmlvo.model, XKB_DFLT_MODEL) == 0); - g_assert(strcmp(rmlvo.layout, XKB_DFLT_LAYOUT) == 0); - g_assert(strcmp(rmlvo.variant, XKB_DFLT_VARIANT) == 0); - g_assert(strcmp(rmlvo.options, XKB_DFLT_OPTIONS) == 0); + assert(rmlvo.rules); + assert(rmlvo.model); + assert(rmlvo.layout); + assert(rmlvo.variant); + assert(rmlvo.options); + assert(strcmp(rmlvo.rules, XKB_DFLT_RULES) == 0); + assert(strcmp(rmlvo.model, XKB_DFLT_MODEL) == 0); + assert(strcmp(rmlvo.layout, XKB_DFLT_LAYOUT) == 0); + assert(strcmp(rmlvo.variant, XKB_DFLT_VARIANT) == 0); + assert(strcmp(rmlvo.options, XKB_DFLT_OPTIONS) == 0); } /** @@ -95,17 +94,17 @@ static void xkb_set_rules_test(void) XkbGetRulesDflts(&rmlvo_new); /* XkbGetRulesDflts strdups the values */ - g_assert(rmlvo.rules != rmlvo_new.rules); - g_assert(rmlvo.model != rmlvo_new.model); - g_assert(rmlvo.layout != rmlvo_new.layout); - g_assert(rmlvo.variant != rmlvo_new.variant); - g_assert(rmlvo.options != rmlvo_new.options); - - g_assert(strcmp(rmlvo.rules, rmlvo_new.rules) == 0); - g_assert(strcmp(rmlvo.model, rmlvo_new.model) == 0); - g_assert(strcmp(rmlvo.layout, rmlvo_new.layout) == 0); - g_assert(strcmp(rmlvo.variant, rmlvo_new.variant) == 0); - g_assert(strcmp(rmlvo.options, rmlvo_new.options) == 0); + assert(rmlvo.rules != rmlvo_new.rules); + assert(rmlvo.model != rmlvo_new.model); + assert(rmlvo.layout != rmlvo_new.layout); + assert(rmlvo.variant != rmlvo_new.variant); + assert(rmlvo.options != rmlvo_new.options); + + assert(strcmp(rmlvo.rules, rmlvo_new.rules) == 0); + assert(strcmp(rmlvo.model, rmlvo_new.model) == 0); + assert(strcmp(rmlvo.layout, rmlvo_new.layout) == 0); + assert(strcmp(rmlvo.variant, rmlvo_new.variant) == 0); + assert(strcmp(rmlvo.options, rmlvo_new.options) == 0); } @@ -145,29 +144,26 @@ static void xkb_set_get_rules_test(void) /* This test is iffy, because strictly we may be comparing against already * freed memory */ - g_assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); - g_assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); - g_assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); - g_assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); - g_assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); + assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); + assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); + assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); + assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); + assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); XkbGetRulesDflts(&rmlvo); - g_assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); - g_assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); - g_assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); - g_assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); - g_assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); + assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0); + assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0); + assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0); + assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0); + assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0); } int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - - g_test_add_func("/xkb/set-get-rules", xkb_set_get_rules_test); - g_test_add_func("/xkb/get-rules", xkb_get_rules_test); - g_test_add_func("/xkb/set-rules", xkb_set_rules_test); + xkb_set_get_rules_test(); + xkb_get_rules_test(); + xkb_set_rules_test(); - return g_test_run(); + return 0; } diff --git a/test/xtest.c b/test/xtest.c index 6ea6862f7..2ab46505f 100644 --- a/test/xtest.c +++ b/test/xtest.c @@ -33,8 +33,6 @@ #include "xkbsrv.h" #include "xserver-properties.h" -#include - /** */ @@ -65,14 +63,14 @@ static void xtest_init_devices(void) /* this also inits the xtest devices */ InitCoreDevices(); - g_assert(xtestpointer); - g_assert(xtestkeyboard); - g_assert(IsXTestDevice(xtestpointer, NULL)); - g_assert(IsXTestDevice(xtestkeyboard, NULL)); - g_assert(IsXTestDevice(xtestpointer, inputInfo.pointer)); - g_assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard)); - g_assert(GetXTestDevice(inputInfo.pointer) == xtestpointer); - g_assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard); + assert(xtestpointer); + assert(xtestkeyboard); + assert(IsXTestDevice(xtestpointer, NULL)); + assert(IsXTestDevice(xtestkeyboard, NULL)); + assert(IsXTestDevice(xtestpointer, inputInfo.pointer)); + assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard)); + assert(GetXTestDevice(inputInfo.pointer) == xtestpointer); + assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard); } /** @@ -87,32 +85,29 @@ static void xtest_properties(void) Atom xtest_prop = XIGetKnownProperty(XI_PROP_XTEST_DEVICE); rc = XIGetDeviceProperty(xtestpointer, xtest_prop, &prop); - g_assert(rc == Success); - g_assert(prop); + assert(rc == Success); + assert(prop); rc = XIGetDeviceProperty(xtestkeyboard, xtest_prop, &prop); - g_assert(rc == Success); - g_assert(prop != NULL); + assert(rc == Success); + assert(prop != NULL); rc = XIChangeDeviceProperty(xtestpointer, xtest_prop, XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE); - g_assert(rc == BadAccess); + assert(rc == BadAccess); rc = XIChangeDeviceProperty(xtestkeyboard, xtest_prop, XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE); - g_assert(rc == BadAccess); + assert(rc == BadAccess); } int main(int argc, char** argv) { - g_test_init(&argc, &argv,NULL); - g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id="); - - g_test_add_func("/dix/xtest/init", xtest_init_devices); - g_test_add_func("/dix/xtest/properties", xtest_properties); + xtest_init_devices(); + xtest_properties(); - return g_test_run(); + return 0; } diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 41ba0fbac..01eb70d92 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -1,5 +1,6 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -50,13 +51,16 @@ #include "cursorstr.h" #include "dixevents.h" #include "servermd.h" +#include "mipointer.h" #include "inputstr.h" #include "windowstr.h" #include "xace.h" +#include "list.h" static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; +RESTYPE PointerBarrierType; static CursorPtr CursorCurrent[MAXDEVICES]; static DevPrivateKeyRec CursorScreenPrivateKeyRec; @@ -107,6 +111,14 @@ typedef struct _CursorHideCountRec { XID resource; } CursorHideCountRec; +typedef struct PointerBarrierClient *PointerBarrierClientPtr; + +struct PointerBarrierClient { + ScreenPtr screen; + struct PointerBarrier barrier; + struct list entry; +}; + /* * Wrap DisplayCursor to catch cursor change events */ @@ -114,7 +126,9 @@ typedef struct _CursorHideCountRec { typedef struct _CursorScreen { DisplayCursorProcPtr DisplayCursor; CloseScreenProcPtr CloseScreen; + ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorHideCountPtr pCursorHideCounts; + struct list barriers; } CursorScreenRec, *CursorScreenPtr; #define GetCursorScreen(s) ((CursorScreenPtr)dixLookupPrivate(&(s)->devPrivates, CursorScreenPrivateKey)) @@ -184,9 +198,11 @@ CursorCloseScreen (int index, ScreenPtr pScreen) Bool ret; CloseScreenProcPtr close_proc; DisplayCursorProcPtr display_proc; + ConstrainCursorHarderProcPtr constrain_proc; Unwrap (cs, pScreen, CloseScreen, close_proc); Unwrap (cs, pScreen, DisplayCursor, display_proc); + Unwrap (cs, pScreen, ConstrainCursorHarder, constrain_proc); deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (index, pScreen); free(cs); @@ -1029,6 +1045,382 @@ CursorFreeWindow (pointer data, XID id) return 1; } +static BOOL +barrier_is_horizontal(const struct PointerBarrier *barrier) +{ + return barrier->y1 == barrier->y2; +} + +static BOOL +barrier_is_vertical(const struct PointerBarrier *barrier) +{ + return barrier->x1 == barrier->x2; +} + +/** + * @return The set of barrier movement directions the movement vector + * x1/y1 → x2/y2 represents. + */ +int +barrier_get_direction(int x1, int y1, int x2, int y2) +{ + int direction = 0; + + /* which way are we trying to go */ + if (x2 > x1) + direction |= BarrierPositiveX; + if (x2 < x1) + direction |= BarrierNegativeX; + if (y2 > y1) + direction |= BarrierPositiveY; + if (y2 < y1) + direction |= BarrierNegativeY; + + return direction; +} + +/** + * Test if the barrier may block movement in the direction defined by + * x1/y1 → x2/y2. This function only tests whether the directions could be + * blocked, it does not test if the barrier actually blocks the movement. + * + * @return TRUE if the barrier blocks the direction of movement or FALSE + * otherwise. + */ +BOOL +barrier_is_blocking_direction(const struct PointerBarrier *barrier, int direction) +{ + /* Barriers define which way is ok, not which way is blocking */ + return (barrier->directions & direction) != direction; +} + +/** + * Test if the movement vector x1/y1 → x2/y2 is intersecting with the + * barrier. A movement vector with the startpoint or endpoint adjacent to + * the barrier itself counts as intersecting. + * + * @param x1 X start coordinate of movement vector + * @param y1 Y start coordinate of movement vector + * @param x2 X end coordinate of movement vector + * @param y2 Y end coordinate of movement vector + * @param[out] distance The distance between the start point and the + * intersection with the barrier (if applicable). + * @return TRUE if the barrier intersects with the given vector + */ +BOOL +barrier_is_blocking(const struct PointerBarrier *barrier, + int x1, int y1, int x2, int y2, + double *distance) +{ + BOOL rc = FALSE; + float ua, ub, ud; + int dir = barrier_get_direction(x1, y1, x2, y2); + + /* Algorithm below doesn't handle edge cases well, hence the extra + * checks. */ + if (barrier_is_vertical(barrier)) { + /* handle immediate barrier adjacency, moving away */ + if (dir & BarrierPositiveX && x1 == barrier->x1) + return FALSE; + if (dir & BarrierNegativeX && x1 == (barrier->x1 - 1)) + return FALSE; + /* startpoint adjacent to barrier, moving towards -> block */ + if (x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) { + *distance = 0; + return TRUE; + } + } else { + /* handle immediate barrier adjacency, moving away */ + if (dir & BarrierPositiveY && y1 == barrier->y1) + return FALSE; + if (dir & BarrierNegativeY && y1 == (barrier->y1 - 1)) + return FALSE; + /* startpoint adjacent to barrier, moving towards -> block */ + if (y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) { + *distance = 0; + return TRUE; + } + } + + /* not an edge case, compute distance */ + ua = 0; + ud = (barrier->y2 - barrier->y1) * (x2 - x1) - (barrier->x2 - barrier->x1) * (y2 - y1); + if (ud != 0) { + ua = ((barrier->x2 - barrier->x1) * (y1 - barrier->y1) - + (barrier->y2 - barrier->y1) * (x1 - barrier->x1)) / ud; + ub = ((x2 - x1) * (y1 - barrier->y1) - + (y2 - y1) * (x1 - barrier->x1)) / ud; + if (ua < 0 || ua > 1 || ub < 0 || ub > 1) + ua = 0; + } + + if (ua > 0 && ua <= 1) + { + double ix = barrier->x1 + ua * (barrier->x2 - barrier->x1); + double iy = barrier->y1 + ua * (barrier->y2 - barrier->y1); + + *distance = sqrt(pow(x1 - ix, 2) + pow(y1 - iy, 2)); + rc = TRUE; + } + + return rc; +} + +/** + * Find the nearest barrier that is blocking movement from x1/y1 to x2/y2. + * + * @param dir Only barriers blocking movement in direction dir are checked + * @param x1 X start coordinate of movement vector + * @param y1 Y start coordinate of movement vector + * @param x2 X end coordinate of movement vector + * @param y2 Y end coordinate of movement vector + * @return The barrier nearest to the movement origin that blocks this movement. + */ +static struct PointerBarrier* +barrier_find_nearest(CursorScreenPtr cs, int dir, + int x1, int y1, int x2, int y2) +{ + struct PointerBarrierClient *c; + struct PointerBarrier *nearest = NULL; + double min_distance = INT_MAX; /* can't get higher than that in X anyway */ + + list_for_each_entry(c, &cs->barriers, entry) { + struct PointerBarrier *b = &c->barrier; + double distance; + + if (!barrier_is_blocking_direction(b, dir)) + continue; + + if (barrier_is_blocking(b, x1, y1, x2, y2, &distance)) + { + if (min_distance > distance) + { + min_distance = distance; + nearest = b; + } + } + } + + return nearest; +} + +/** + * Clamp to the given barrier given the movement direction specified in dir. + * + * @param barrier The barrier to clamp to + * @param dir The movement direction + * @param[out] x The clamped x coordinate. + * @param[out] y The clamped x coordinate. + */ +void +barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, int *y) +{ + if (barrier_is_vertical(barrier)) + { + if ((dir & BarrierNegativeX) & ~barrier->directions) + *x = barrier->x1; + if ((dir & BarrierPositiveX) & ~barrier->directions) + *x = barrier->x1 - 1; + } + if (barrier_is_horizontal(barrier)) + { + if ((dir & BarrierNegativeY) & ~barrier->directions) + *y = barrier->y1; + if ((dir & BarrierPositiveY) & ~barrier->directions) + *y = barrier->y1 - 1; + } +} + +static void +CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y) +{ + CursorScreenPtr cs = GetCursorScreen(screen); + + if (!list_is_empty(&cs->barriers) && !IsFloating(dev) && mode == Relative) { + int ox, oy; + int dir; + struct PointerBarrier *nearest = NULL; + + /* where are we coming from */ + miPointerGetPosition(dev, &ox, &oy); + + /* How this works: + * Given the origin and the movement vector, get the nearest barrier + * to the origin that is blocking the movement. + * Clamp to that barrier. + * Then, check from the clamped intersection to the original + * destination, again finding the nearest barrier and clamping. + */ + dir = barrier_get_direction(ox, oy, *x, *y); + + nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y); + if (nearest) { + barrier_clamp_to_barrier(nearest, dir, x, y); + + if (barrier_is_vertical(nearest)) { + dir &= ~(BarrierNegativeX | BarrierPositiveX); + ox = *x; + } else if (barrier_is_horizontal(nearest)) { + dir &= ~(BarrierNegativeY | BarrierPositiveY); + oy = *y; + } + + nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y); + if (nearest) { + barrier_clamp_to_barrier(nearest, dir, x, y); + } + } + } + + if (cs->ConstrainCursorHarder) { + screen->ConstrainCursorHarder = cs->ConstrainCursorHarder; + screen->ConstrainCursorHarder(dev, screen, mode, x, y); + screen->ConstrainCursorHarder = CursorConstrainCursorHarder; + } +} + +static struct PointerBarrierClient * +CreatePointerBarrierClient(ScreenPtr screen, ClientPtr client, + xXFixesCreatePointerBarrierReq *stuff) +{ + CursorScreenPtr cs = GetCursorScreen(screen); + struct PointerBarrierClient *ret = malloc(sizeof(*ret)); + + if (ret) { + ret->screen = screen; + ret->barrier.x1 = min(stuff->x1, stuff->x2); + ret->barrier.x2 = max(stuff->x1, stuff->x2); + ret->barrier.y1 = min(stuff->y1, stuff->y2); + ret->barrier.y2 = max(stuff->y1, stuff->y2); + ret->barrier.directions = stuff->directions & 0x0f; + if (barrier_is_horizontal(&ret->barrier)) + ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX); + if (barrier_is_vertical(&ret->barrier)) + ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY); + list_add(&ret->entry, &cs->barriers); + } + + return ret; +} + +int +ProcXFixesCreatePointerBarrier (ClientPtr client) +{ + int err; + WindowPtr pWin; + struct PointerBarrierClient *barrier; + struct PointerBarrier b; + REQUEST (xXFixesCreatePointerBarrierReq); + + REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); + LEGAL_NEW_RESOURCE(stuff->barrier, client); + + err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); + if (err != Success) { + client->errorValue = stuff->window; + return err; + } + + /* This sure does need fixing. */ + if (stuff->num_devices) + return BadImplementation; + + b.x1 = stuff->x1; + b.x2 = stuff->x2; + b.y1 = stuff->y1; + b.y2 = stuff->y2; + + if (!barrier_is_horizontal(&b) && !barrier_is_vertical(&b)) + return BadValue; + + /* no 0-sized barriers */ + if (barrier_is_horizontal(&b) && barrier_is_vertical(&b)) + return BadValue; + + if (!(barrier = CreatePointerBarrierClient(pWin->drawable.pScreen, + client, stuff))) + return BadAlloc; + + if (!AddResource(stuff->barrier, PointerBarrierType, &barrier->barrier)) + return BadAlloc; + + return Success; +} + +int +SProcXFixesCreatePointerBarrier (ClientPtr client) +{ + int n; + REQUEST(xXFixesCreatePointerBarrierReq); + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); + swapl(&stuff->barrier, n); + swapl(&stuff->window, n); + swaps(&stuff->x1, n); + swaps(&stuff->y1, n); + swaps(&stuff->x2, n); + swaps(&stuff->y2, n); + swapl(&stuff->directions, n); + return ProcXFixesVector[stuff->xfixesReqType](client); +} + +static int +CursorFreeBarrier(void *data, XID id) +{ + struct PointerBarrierClient *b = NULL, *barrier; + ScreenPtr screen; + CursorScreenPtr cs; + + barrier = container_of(data, struct PointerBarrierClient, barrier); + screen = barrier->screen; + cs = GetCursorScreen(screen); + + /* find and unlink from the screen private */ + list_for_each_entry(b, &cs->barriers, entry) { + if (b == barrier) { + list_del(&b->entry); + break; + } + } + + free(barrier); + return Success; +} + +int +ProcXFixesDestroyPointerBarrier (ClientPtr client) +{ + int err; + void *barrier; + REQUEST (xXFixesDestroyPointerBarrierReq); + + REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq); + + err = dixLookupResourceByType((void **)&barrier, stuff->barrier, + PointerBarrierType, client, + DixDestroyAccess); + if (err != Success) { + client->errorValue = stuff->barrier; + return err; + } + + FreeResource(stuff->barrier, RT_NONE); + return Success; +} + +int +SProcXFixesDestroyPointerBarrier (ClientPtr client) +{ + int n; + REQUEST(xXFixesDestroyPointerBarrierReq); + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq); + swapl(&stuff->barrier, n); + return ProcXFixesVector[stuff->xfixesReqType](client); +} + Bool XFixesCursorInit (void) { @@ -1045,11 +1437,13 @@ XFixesCursorInit (void) ScreenPtr pScreen = screenInfo.screens[i]; CursorScreenPtr cs; - cs = (CursorScreenPtr) malloc(sizeof (CursorScreenRec)); + cs = (CursorScreenPtr) calloc(1, sizeof (CursorScreenRec)); if (!cs) return FALSE; + list_init(&cs->barriers); Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor); + Wrap (cs, pScreen, ConstrainCursorHarder, CursorConstrainCursorHarder); cs->pCursorHideCounts = NULL; SetCursorScreen (pScreen, cs); } @@ -1059,7 +1453,10 @@ XFixesCursorInit (void) "XFixesCursorHideCount"); CursorWindowType = CreateNewResourceType(CursorFreeWindow, "XFixesCursorWindow"); + PointerBarrierType = CreateNewResourceType(CursorFreeBarrier, + "XFixesPointerBarrier"); - return CursorClientType && CursorHideCountType && CursorWindowType; + return CursorClientType && CursorHideCountType && CursorWindowType && + PointerBarrierType; } diff --git a/xfixes/region.c b/xfixes/region.c index 42d5d7c54..f49349629 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -757,13 +757,11 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) PicturePtr pPicture; RegionPtr pRegion; ScreenPtr pScreen; - PictureScreenPtr ps; REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); pScreen = pPicture->pDrawable->pScreen; - ps = GetPictureScreen (pScreen); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, @@ -842,3 +840,81 @@ SProcXFixesExpandRegion (ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" + +int +PanoramiXFixesSetGCClipRegion (ClientPtr client) +{ + REQUEST(xXFixesSetGCClipRegionReq); + int result = Success, j; + PanoramiXRes *gc; + REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); + + if ((result = dixLookupResourceByType((void **)&gc, stuff->gc, XRT_GC, + client, DixWriteAccess))) { + client->errorValue = stuff->gc; + return result; + } + + FOR_NSCREENS_BACKWARD(j) { + stuff->gc = gc->info[j].id; + result = (*PanoramiXSaveXFixesVector[X_XFixesSetGCClipRegion]) (client); + if(result != Success) break; + } + + return result; +} + +int +PanoramiXFixesSetWindowShapeRegion (ClientPtr client) +{ + int result = Success, j; + PanoramiXRes *win; + REQUEST(xXFixesSetWindowShapeRegionReq); + + REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); + + if ((result = dixLookupResourceByType((void **)&win, stuff->dest, + XRT_WINDOW, client, + DixWriteAccess))) { + client->errorValue = stuff->dest; + return result; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->dest = win->info[j].id; + result = (*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client); + if(result != Success) break; + } + + return result; +} + +int +PanoramiXFixesSetPictureClipRegion (ClientPtr client) +{ + REQUEST(xXFixesSetPictureClipRegionReq); + int result = Success, j; + PanoramiXRes *pict; + + REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); + + if ((result = dixLookupResourceByType((void **)&pict, stuff->picture, + XRT_PICTURE, client, + DixWriteAccess))) { + client->errorValue = stuff->picture; + return result; + } + + FOR_NSCREENS_BACKWARD(j) { + stuff->picture = pict->info[j].id; + result = (*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client); + if(result != Success) break; + } + + return result; +} + +#endif diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index 215909df1..e0ebedd80 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -1,5 +1,6 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -47,10 +48,6 @@ #include "xfixesint.h" #include "protocol-versions.h" -/* - * Must use these instead of the constants from xfixeswire.h. They advertise - * what we implement, not what the protocol headers define. - */ static unsigned char XFixesReqCode; int XFixesEventBase; @@ -72,17 +69,17 @@ ProcXFixesQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < SERVER_XFIXES_MAJOR_VERSION) { + + if (version_compare(stuff->majorVersion, stuff->minorVersion, + SERVER_XFIXES_MAJOR_VERSION, SERVER_XFIXES_MAJOR_VERSION) < 0) + { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { rep.majorVersion = SERVER_XFIXES_MAJOR_VERSION; - if (stuff->majorVersion == SERVER_XFIXES_MAJOR_VERSION && - stuff->minorVersion < SERVER_XFIXES_MINOR_VERSION) - rep.minorVersion = stuff->minorVersion; - else - rep.minorVersion = SERVER_XFIXES_MINOR_VERSION; + rep.minorVersion = SERVER_XFIXES_MINOR_VERSION; } + pXFixesClient->major_version = rep.majorVersion; pXFixesClient->minor_version = rep.minorVersion; if (client->swapped) { @@ -97,11 +94,12 @@ ProcXFixesQueryVersion(ClientPtr client) /* Major version controls available requests */ static const int version_requests[] = { - X_XFixesQueryVersion, /* before client sends QueryVersion */ - X_XFixesGetCursorImage, /* Version 1 */ - X_XFixesChangeCursorByName, /* Version 2 */ - X_XFixesExpandRegion, /* Version 3 */ - X_XFixesShowCursor, /* Version 4 */ + X_XFixesQueryVersion, /* before client sends QueryVersion */ + X_XFixesGetCursorImage, /* Version 1 */ + X_XFixesChangeCursorByName, /* Version 2 */ + X_XFixesExpandRegion, /* Version 3 */ + X_XFixesShowCursor, /* Version 4 */ + X_XFixesDestroyPointerBarrier, /* Version 5 */ }; #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) @@ -142,6 +140,9 @@ int (*ProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { /*************** Version 4 ****************/ ProcXFixesHideCursor, ProcXFixesShowCursor, +/*************** Version 5 ****************/ + ProcXFixesCreatePointerBarrier, + ProcXFixesDestroyPointerBarrier, }; static int @@ -205,6 +206,9 @@ static int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = { /*************** Version 4 ****************/ SProcXFixesHideCursor, SProcXFixesShowCursor, +/*************** Version 5 ****************/ + SProcXFixesCreatePointerBarrier, + SProcXFixesDestroyPointerBarrier, }; static int @@ -260,5 +264,37 @@ XFixesExtensionInit(void) EventSwapVector[XFixesEventBase + XFixesCursorNotify] = (EventSwapPtr) SXFixesCursorNotifyEvent; SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion); + SetResourceTypeErrorValue(PointerBarrierType, + XFixesErrorBase + BadBarrier); } } + +#ifdef PANORAMIX + +int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr); + +void +PanoramiXFixesInit (void) +{ + int i; + + for (i = 0; i < XFixesNumberRequests; i++) + PanoramiXSaveXFixesVector[i] = ProcXFixesVector[i]; + /* + * Stuff in Xinerama aware request processing hooks + */ + ProcXFixesVector[X_XFixesSetGCClipRegion] = PanoramiXFixesSetGCClipRegion; + ProcXFixesVector[X_XFixesSetWindowShapeRegion] = PanoramiXFixesSetWindowShapeRegion; + ProcXFixesVector[X_XFixesSetPictureClipRegion] = PanoramiXFixesSetPictureClipRegion; +} + +void +PanoramiXFixesReset (void) +{ + int i; + + for (i = 0; i < XFixesNumberRequests; i++) + ProcXFixesVector[i] = PanoramiXSaveXFixesVector[i]; +} + +#endif diff --git a/xfixes/xfixes.h b/xfixes/xfixes.h index 1638350c2..5765e64b5 100644 --- a/xfixes/xfixes.h +++ b/xfixes/xfixes.h @@ -30,6 +30,7 @@ #include "resource.h" extern _X_EXPORT RESTYPE RegionResType; +extern _X_EXPORT RESTYPE PointerBarrierType; extern _X_EXPORT int XFixesErrorBase; #define VERIFY_REGION(pRegion, rid, client, mode) \ @@ -51,5 +52,21 @@ extern _X_EXPORT int XFixesErrorBase; extern _X_EXPORT RegionPtr XFixesRegionCopy (RegionPtr pRegion); +struct PointerBarrier { + CARD16 x1, x2, y1, y2; + CARD32 directions; +}; + + +extern int +barrier_get_direction(int, int, int, int); +extern BOOL +barrier_is_blocking(const struct PointerBarrier*, int, int, int, int, double*); +extern BOOL +barrier_is_blocking_direction(const struct PointerBarrier*, int); +extern void +barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, int *y); + + #endif /* _XFIXES_H_ */ diff --git a/xfixes/xfixesint.h b/xfixes/xfixesint.h index f3d53614f..6ba276e8c 100644 --- a/xfixes/xfixesint.h +++ b/xfixes/xfixesint.h @@ -1,5 +1,6 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -255,6 +256,15 @@ ProcXFixesExpandRegion (ClientPtr client); int SProcXFixesExpandRegion (ClientPtr client); +int +PanoramiXFixesSetGCClipRegion (ClientPtr client); + +int +PanoramiXFixesSetWindowShapeRegion (ClientPtr client); + +int +PanoramiXFixesSetPictureClipRegion (ClientPtr client); + /* Cursor Visibility (Version 4) */ int @@ -269,4 +279,23 @@ ProcXFixesShowCursor (ClientPtr client); int SProcXFixesShowCursor (ClientPtr client); +/* Version 5 */ + +int +ProcXFixesCreatePointerBarrier (ClientPtr client); + +int +SProcXFixesCreatePointerBarrier (ClientPtr client); + +int +ProcXFixesDestroyPointerBarrier (ClientPtr client); + +int +SProcXFixesDestroyPointerBarrier (ClientPtr client); + +/* Xinerama */ +extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr); +void PanoramiXFixesInit (void); +void PanoramiXFixesReset (void); + #endif /* _XFIXESINT_H_ */ diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index c52e091da..b70ac1705 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -212,10 +212,8 @@ XkbNamesPtr names; register XkbKeyTypePtr type; type= map->types; for (i=0;inum_types;i++,type++) { - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } } @@ -335,3 +333,22 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll) free(xkb); return; } + + +/***====================================================================***/ + +void +XkbFreeComponentNames(XkbComponentNamesPtr names, Bool freeNames) +{ + if (names) + { + free(names->keycodes); + free(names->types); + free(names->compat); + free(names->symbols); + free(names->geometry); + memset(names, 0, sizeof(XkbComponentNamesRec)); + } + if (freeNames) + free(names); +} diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index d1adea34e..dd2b04696 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll, { if ((freeAll)||(*elems==NULL)) { *num_inout= *sz_inout= 0; - if (*elems!=NULL) { - free(*elems); - *elems= NULL; - } + free(*elems); + *elems = NULL; return; } @@ -373,22 +371,16 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; switch (doodad->any.type) { case XkbTextDoodad: { - if (doodad->text.text!=NULL) { - free(doodad->text.text); - doodad->text.text= NULL; - } - if (doodad->text.font!=NULL) { - free(doodad->text.font); - doodad->text.font= NULL; - } + free(doodad->text.text); + doodad->text.text = NULL; + free(doodad->text.font); + doodad->text.font = NULL; } break; case XkbLogoDoodad: { - if (doodad->logo.logo_name!=NULL) { - free(doodad->logo.logo_name); - doodad->logo.logo_name= NULL; - } + free(doodad->logo.logo_name); + doodad->logo.logo_name = NULL; } break; } @@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL)) XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE); if (freeMap) { - if (geom->label_font!=NULL) { - free(geom->label_font); - geom->label_font= NULL; - } + free(geom->label_font); + geom->label_font = NULL; free(geom); } return; @@ -445,6 +435,57 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) /***====================================================================***/ +/** + * Resize and clear an XKB geometry item array. The array size may + * grow or shrink unlike in _XkbGeomAlloc. + * + * @param buffer[in,out] buffer to reallocate and clear + * @param szItems[in] currently allocated item count for "buffer" + * @param nrItems[in] required item count for "buffer" + * @param itemSize[in] size of a single item in "buffer" + * @param clearance[in] items to clear after reallocation + * + * @see _XkbGeomAlloc + * + * @return TRUE if reallocation succeeded. Otherwise FALSE is returned + * and contents of "buffer" aren't touched. + */ +Bool +XkbGeomRealloc(void **buffer, int szItems, int nrItems, + int itemSize, XkbGeomClearance clearance) +{ + void *items; + int clearBegin; + /* Check validity of arguments. */ + if (!buffer) + return FALSE; + items = *buffer; + if (!((items && (szItems > 0)) || (!items && !szItems))) + return FALSE; + /* Check if there is need to resize. */ + if (nrItems != szItems) + if (!(items = realloc(items, nrItems * itemSize))) + return FALSE; + /* Clear specified items to zero. */ + switch (clearance) + { + case XKB_GEOM_CLEAR_EXCESS: + clearBegin = szItems; + break; + case XKB_GEOM_CLEAR_ALL: + clearBegin = 0; + break; + case XKB_GEOM_CLEAR_NONE: + default: + clearBegin = nrItems; + break; + } + if (items && (clearBegin < nrItems)) + memset((char *)items + (clearBegin * itemSize), 0, (nrItems - clearBegin) * itemSize); + *buffer = items; + return TRUE; +} + static Status _XkbGeomAlloc( void ** old, unsigned short * num, @@ -461,18 +502,15 @@ _XkbGeomAlloc( void ** old, return Success; *total= (*num)+num_new; - if ((*old)!=NULL) - (*old)= realloc((*old),(*total)*sz_elem); - else (*old)= calloc((*total),sz_elem); - if ((*old)==NULL) { + + if (!XkbGeomRealloc(old, *num, *total, sz_elem, XKB_GEOM_CLEAR_EXCESS)) + { + free(*old); + (*old)= NULL; *total= *num= 0; return BadAlloc; } - if (*num>0) { - char *tmp= (char *)(*old); - memset(&tmp[sz_elem*(*num)], 0, (num_new*sz_elem)); - } return Success; } @@ -657,9 +695,7 @@ register XkbPropertyPtr prop; for (i=0,prop=geom->properties;inum_properties;i++,prop++) { if ((prop->name)&&(strcmp(name,prop->name)==0)) { free(prop->value); - prop->value= malloc(strlen(value)+1); - if (prop->value) - strcpy(prop->value,value); + prop->value= strdup(value); return prop; } } @@ -668,17 +704,15 @@ register XkbPropertyPtr prop; return NULL; } prop= &geom->properties[geom->num_properties]; - prop->name= malloc(strlen(name)+1); - if (!name) + prop->name= strdup(name); + if (!prop->name) return NULL; - strcpy(prop->name,name); - prop->value= malloc(strlen(value)+1); - if (!value) { + prop->value= strdup(value); + if (!prop->value) { free(prop->name); prop->name= NULL; return NULL; } - strcpy(prop->value,value); geom->num_properties++; return prop; } @@ -730,10 +764,9 @@ register XkbColorPtr color; } color= &geom->colors[geom->num_colors]; color->pixel= pixel; - color->spec= malloc(strlen(spec)+1); + color->spec= strdup(spec); if (!color->spec) return NULL; - strcpy(color->spec,spec); geom->num_colors++; return color; } diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 6b186c1ad..2681ba3c3 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; } type= &xkb->map->types[type_ndx]; if (map_count==0) { - if (type->map!=NULL) - free(type->map); + free(type->map); type->map= NULL; - if (type->preserve!=NULL) - free(type->preserve); + free(type->preserve); type->preserve= NULL; type->map_count= 0; } @@ -321,9 +319,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; return BadAlloc; } } - else if (type->preserve!=NULL) { + else { free(type->preserve); - type->preserve= NULL; + type->preserve = NULL; } type->map_count= map_count; } @@ -807,19 +805,13 @@ XkbClientMapPtr map; register int i; XkbKeyTypePtr type; for (i=0,type=map->types;inum_types;i++,type++) { - if (type->map!=NULL) { - free(type->map); - type->map= NULL; - } - if (type->preserve!=NULL) { - free(type->preserve); - type->preserve= NULL; - } + free(type->map); + type->map = NULL; + free(type->preserve); + type->preserve = NULL; type->map_count= 0; - if (type->level_names!=NULL) { - free(type->level_names); - type->level_names= NULL; - } + free(type->level_names); + type->level_names = NULL; } } free(map->types); @@ -828,10 +820,8 @@ XkbClientMapPtr map; } } if (what&XkbKeySymsMask) { - if (map->key_sym_map!=NULL) { - free(map->key_sym_map); - map->key_sym_map= NULL; - } + free(map->key_sym_map); + map->key_sym_map = NULL; if (map->syms!=NULL) { free(map->syms); map->size_syms= map->num_syms= 0; @@ -864,10 +854,8 @@ XkbServerMapPtr map; map->explicit= NULL; } if (what&XkbKeyActionsMask) { - if (map->key_acts!=NULL) { - free(map->key_acts); - map->key_acts= NULL; - } + free(map->key_acts); + map->key_acts = NULL; if (map->acts!=NULL) { free(map->acts); map->num_acts= map->size_acts= 0; diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c index efe291103..96688be18 100644 --- a/xkb/XKBMisc.c +++ b/xkb/XKBMisc.c @@ -454,11 +454,12 @@ unsigned changed,tmp; } if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) { CARD8 old; - old= xkb->ctrls->per_key_repeat[key/8]; + old= BitIsOn(xkb->ctrls->per_key_repeat, key); if (interps[0]->flags&XkbSI_AutoRepeat) - xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8)); - else xkb->ctrls->per_key_repeat[key/8]&= ~(1<<(key%8)); - if (changes && (old!=xkb->ctrls->per_key_repeat[key/8])) + SetBit(xkb->ctrls->per_key_repeat, key); + else + ClearBit(xkb->ctrls->per_key_repeat, key); + if (changes && old != BitIsOn(xkb->ctrls->per_key_repeat, key)) changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask; } } @@ -466,9 +467,9 @@ unsigned changed,tmp; if ((!found)||(interps[0]==NULL)) { if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) { CARD8 old; - old= xkb->ctrls->per_key_repeat[key/8]; - xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8)); - if (changes && (old!=xkb->ctrls->per_key_repeat[key/8])) + old = BitIsOn(xkb->ctrls->per_key_repeat, key); + SetBit(xkb->ctrls->per_key_repeat, key); + if (changes && (old != BitIsOn(xkb->ctrls->per_key_repeat, key))) changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask; } if (((explicit&XkbExplicitBehaviorMask)==0)&& diff --git a/xkb/ddxList.c b/xkb/ddxList.c index c1ada5c6d..3d301d88e 100644 --- a/xkb/ddxList.c +++ b/xkb/ddxList.c @@ -156,34 +156,45 @@ char tmpname[PATH_MAX]; #endif if (XkbBaseDirectory!=NULL) { if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { - buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]); - in= fopen(buf,"r"); + if (asprintf(&buf, "%s/%s.dir", XkbBaseDirectory, + componentDirs[what]) == -1) + buf = NULL; + else + in = fopen(buf,"r"); } if (!in) { haveDir= FALSE; free(buf); - buf = Xprintf( - "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, - XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long) - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)), - file W32_tmpfile - ); + if (asprintf + (&buf, + "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, + XkbBinDirectory, XkbBaseDirectory, componentDirs[what], + (long) ((xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)), + file W32_tmpfile + ) == -1) + buf = NULL; } } else { if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { - buf = Xprintf("%s.dir",componentDirs[what]); - in= fopen(buf,"r"); + if (asprintf(&buf, "%s.dir", componentDirs[what]) == -1) + buf = NULL; + else + in = fopen(buf,"r"); } if (!in) { haveDir= FALSE; free(buf); - buf = Xprintf( - "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, - componentDirs[what],(long) - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)), - file W32_tmpfile - ); + if (asprintf + (&buf, + "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, + componentDirs[what], + (long) ((xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)), + file W32_tmpfile + ) == -1) + buf = NULL; } } status= Success; @@ -211,8 +222,10 @@ char tmpname[PATH_MAX]; list->nFound[what]= 0; free(buf); buf = malloc(PATH_MAX * sizeof(char)); - if (!buf) + if (!buf) { + fclose(in); return BadAlloc; + } while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) { unsigned flags; register unsigned int i; diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index 5e6ab8770..e1020358a 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -45,10 +45,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "xkb.h" -#if defined(CSRG_BASED) || defined(linux) || defined(__GNU__) -#include -#endif - /* * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is * relative to the top-level XKB configuration directory. @@ -210,7 +206,8 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, #endif if (XkbBaseDirectory != NULL) { - xkbbasedirflag = Xprintf("\"-R%s\"", XkbBaseDirectory); + if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1) + xkbbasedirflag = NULL; } if (XkbBinDirectory != NULL) { @@ -225,14 +222,16 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, } } - buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " + if (asprintf(&buf, + "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", - xkbbindir, xkbbindirsep, - ( (xkbDebugFlags < 2) ? 1 : - ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ), - xkbbasedirflag ? xkbbasedirflag : "", xkmfile, - PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, - xkm_output_dir, keymap); + xkbbindir, xkbbindirsep, + ((xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), + xkbbasedirflag ? xkbbasedirflag : "", xkmfile, + PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, + xkm_output_dir, keymap) == -1) + buf = NULL; free(xkbbasedirflag); @@ -267,8 +266,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, strncpy(nameRtrn,keymap,nameRtrnLen); nameRtrn[nameRtrnLen-1]= '\0'; } - if (buf != NULL) - free(buf); + free(buf); return TRUE; } else @@ -287,8 +285,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, } if (nameRtrn) nameRtrn[0]= '\0'; - if (buf != NULL) - free(buf); + free(buf); return FALSE; } @@ -306,15 +303,16 @@ FILE * file; &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') #endif ) { - if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) - +strlen(mapName)+6 <= PATH_MAX) - { - sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, - xkm_output_dir,mapName); - } + if (snprintf(buf, PATH_MAX, "%s/%s%s.xkm", XkbBaseDirectory, + xkm_output_dir, mapName) >= PATH_MAX) + buf[0] = '\0'; + } + else + { + if (snprintf(buf, PATH_MAX, "%s%s.xkm", xkm_output_dir, mapName) + >= PATH_MAX) + buf[0] = '\0'; } - else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) - sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); if (buf[0] != '\0') file= fopen(buf,"rb"); else file= NULL; @@ -391,11 +389,11 @@ XkbRF_RulesPtr rules; if (!rules_name) return FALSE; - if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) { + if (snprintf(buf, PATH_MAX, "%s/rules/%s", XkbBaseDirectory, rules_name) + >= PATH_MAX) { LogMessage(X_ERROR, "XKB: Rules name is too long\n"); return FALSE; } - sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name); file = fopen(buf, "r"); if (!file) { @@ -428,34 +426,78 @@ XkbRF_RulesPtr rules; return complete; } +static Bool +XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbComponentNamesPtr kccgst) +{ + XkbRF_VarDefsRec mlvo; + + mlvo.model = rmlvo->model; + mlvo.layout = rmlvo->layout; + mlvo.variant = rmlvo->variant; + mlvo.options = rmlvo->options; + + return XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, kccgst); +} + +/** + * Compile the given RMLVO keymap and return it. Returns the XkbDescPtr on + * success or NULL on failure. If the components compiled are not a superset + * or equal to need, the compiliation is treated as failure. + */ +static XkbDescPtr +XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, int need) +{ + XkbDescPtr xkb = NULL; + unsigned int provided; + XkbComponentNamesRec kccgst = {0}; + char name[PATH_MAX]; + + if (XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) { + provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need, + &xkb, name, PATH_MAX); + if ((need & provided) != need) { + if (xkb) { + XkbFreeKeyboard(xkb, 0, TRUE); + xkb = NULL; + } + } + } + + XkbFreeComponentNames(&kccgst, FALSE); + return xkb; +} + XkbDescPtr XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo) { - XkbComponentNamesRec kccgst; - XkbRF_VarDefsRec mlvo; XkbDescPtr xkb; - char name[PATH_MAX]; + unsigned int need; if (!dev || !rmlvo) { LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n"); return NULL; } - mlvo.model = rmlvo->model; - mlvo.layout = rmlvo->layout; - mlvo.variant = rmlvo->variant; - mlvo.options = rmlvo->options; + /* These are the components we really really need */ + need = XkmSymbolsMask | XkmCompatMapMask | XkmTypesMask | + XkmKeyNamesMask | XkmVirtualModsMask; - /* XDNFR already logs for us. */ - if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst)) - return NULL; - /* XDLKBN too, but it might return 0 as well as allocating. */ - if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name, - PATH_MAX)) { - if (xkb) - XkbFreeKeyboard(xkb, 0, TRUE); - return NULL; + xkb = XkbCompileKeymapForDevice(dev, rmlvo, need); + + if (!xkb) { + XkbRMLVOSet dflts; + + /* we didn't get what we really needed. And that will likely leave + * us with a keyboard that doesn't work. Use the defaults instead */ + LogMessage(X_ERROR, "XKB: Failed to load keymap. Loading default " + "keymap instead.\n"); + + XkbGetRulesDflts(&dflts); + + xkb = XkbCompileKeymapForDevice(dev, &dflts, 0); + + XkbFreeRMLVOSet(&dflts, FALSE); } return xkb; diff --git a/xkb/maprules.c b/xkb/maprules.c index c683c0d4f..f94089982 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -391,8 +391,8 @@ Bool append = FALSE; } if (*words == '\0') return FALSE; - group->name = _XkbDupString(gname); - group->words = _XkbDupString(words); + group->name = Xstrdup(gname); + group->words = Xstrdup(words); for (i = 1, words = group->words; *words; words++) { if ( *words == ' ') { *words++ = '\0'; @@ -443,16 +443,16 @@ Bool append = FALSE; rule->flags|= XkbRF_Append; else rule->flags|= XkbRF_Normal; - rule->model= _XkbDupString(tmp.name[MODEL]); - rule->layout= _XkbDupString(tmp.name[LAYOUT]); - rule->variant= _XkbDupString(tmp.name[VARIANT]); - rule->option= _XkbDupString(tmp.name[OPTION]); + rule->model= Xstrdup(tmp.name[MODEL]); + rule->layout= Xstrdup(tmp.name[LAYOUT]); + rule->variant= Xstrdup(tmp.name[VARIANT]); + rule->option= Xstrdup(tmp.name[OPTION]); - rule->keycodes= _XkbDupString(tmp.name[KEYCODES]); - rule->symbols= _XkbDupString(tmp.name[SYMBOLS]); - rule->types= _XkbDupString(tmp.name[TYPES]); - rule->compat= _XkbDupString(tmp.name[COMPAT]); - rule->geometry= _XkbDupString(tmp.name[GEOMETRY]); + rule->keycodes= Xstrdup(tmp.name[KEYCODES]); + rule->symbols= Xstrdup(tmp.name[SYMBOLS]); + rule->types= Xstrdup(tmp.name[TYPES]); + rule->compat= Xstrdup(tmp.name[COMPAT]); + rule->geometry= Xstrdup(tmp.name[GEOMETRY]); rule->layout_num = rule->variant_num = 0; for (i = 0; i < nread; i++) { @@ -497,7 +497,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) memset((char *)mdefs, 0, sizeof(XkbRF_MultiDefsRec)); mdefs->model = defs->model; - mdefs->options = _XkbDupString(defs->options); + mdefs->options = Xstrdup(defs->options); if (mdefs->options) squeeze_spaces(mdefs->options); if (defs->layout) { @@ -506,7 +506,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) } else { char *p; int i; - mdefs->layout[1] = _XkbDupString(defs->layout); + mdefs->layout[1] = Xstrdup(defs->layout); if (mdefs->layout[1] == NULL) return FALSE; squeeze_spaces(mdefs->layout[1]); @@ -530,7 +530,7 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) } else { char *p; int i; - mdefs->variant[1] = _XkbDupString(defs->variant); + mdefs->variant[1] = Xstrdup(defs->variant); if (mdefs->variant[1] == NULL) return FALSE; squeeze_spaces(mdefs->variant[1]); @@ -566,7 +566,7 @@ Apply(char *src, char **dst) *dst= _Concat(*dst, src); } else { if (*dst == NULL) - *dst= _XkbDupString(src); + *dst= Xstrdup(src); } } } @@ -945,9 +945,8 @@ Bool ok; if ((!base)||(!rules)) return FALSE; if (locale) { - if (strlen(base)+strlen(locale)+2 > PATH_MAX) + if (snprintf(buf, PATH_MAX, "%s-%s", base, locale) >= PATH_MAX) return FALSE; - sprintf(buf,"%s-%s", base, locale); } else { if (strlen(base)+1 > PATH_MAX) diff --git a/xkb/xkb.c b/xkb/xkb.c index bbb1d9df8..86231a895 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -915,9 +915,14 @@ ProcXkbSetControls(ClientPtr client) stuff->axtOptsMask); } - if (stuff->changeCtrls & XkbPerKeyRepeatMask) + if (stuff->changeCtrls & XkbPerKeyRepeatMask) { memcpy(new.per_key_repeat, stuff->perKeyRepeat, XkbPerKeyBitArraySize); + if (xkbi->repeatKey && + !BitIsOn(new.per_key_repeat, xkbi->repeatKey)) { + AccessXCancelRepeatKey(xkbi, xkbi->repeatKey); + } + } old= *ctrl; *ctrl= new; @@ -3639,7 +3644,7 @@ register int n; swapl(&rep->indicators,n); } - start = desc = malloc(length); + start = desc = calloc(1, length); if ( !start ) return BadAlloc; if (xkb->names) { @@ -4302,10 +4307,21 @@ ProcXkbSetNames(ClientPtr client) #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) +/** + * Write the zero-terminated string str into wire as a pascal string with a + * 16-bit length field prefixed before the actual string. + * + * @param wire The destination array, usually the wire struct + * @param str The source string as zero-terminated C string + * @param swap If TRUE, the length field is swapped. + * + * @return The input string in the format with a + * (swapped) 16 bit string length, non-zero terminated. + */ static char * XkbWriteCountedString(char *wire,char *str,Bool swap) { - CARD16 len,*pLen; + CARD16 len,*pLen, paddedLen; if (!str) return wire; @@ -4317,8 +4333,9 @@ XkbWriteCountedString(char *wire,char *str,Bool swap) register int n; swaps(pLen,n); } - memcpy(&wire[2],str,len); - wire+= ((2+len+3)/4)*4; + paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len); + strncpy(&wire[sizeof(len)],str,paddedLen); + wire+= sizeof(len)+paddedLen; return wire; } @@ -4429,6 +4446,7 @@ xkbShapeWireDesc * shapeWire; if (shape->approx!=NULL) shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); else shapeWire->approxNdx= XkbNoShape; + shapeWire->pad= 0; if (swap) { register int n; swapl(&shapeWire->name,n); @@ -4441,6 +4459,7 @@ xkbShapeWireDesc * shapeWire; olWire= (xkbOutlineWireDesc *)wire; olWire->nPoints= ol->num_points; olWire->cornerRadius= ol->corner_radius; + olWire->pad= 0; wire= (char *)&olWire[1]; ptWire= (xkbPointWireDesc *)wire; for (p=0,pt=ol->points;pnum_points;p++,pt++) { @@ -4554,6 +4573,8 @@ xkbOverlayWireDesc * olWire; olWire= (xkbOverlayWireDesc *)wire; olWire->name= ol->name; olWire->nRows= ol->num_rows; + olWire->pad1= 0; + olWire->pad2= 0; if (swap) { register int n; swapl(&olWire->name,n); @@ -4566,6 +4587,7 @@ xkbOverlayWireDesc * olWire; rowWire= (xkbOverlayRowWireDesc *)wire; rowWire->rowUnder= row->row_under; rowWire->nKeys= row->num_keys; + rowWire->pad1= 0; wire= (char *)&rowWire[1]; for (k=0,key=row->keys;knum_keys;k++,key++) { xkbOverlayKeyWireDesc * keyWire; @@ -5564,13 +5586,14 @@ ProcXkbGetKbdByName(ClientPtr client) { DeviceIntPtr dev; DeviceIntPtr tmpd; - xkbGetKbdByNameReply rep; - xkbGetMapReply mrep; - xkbGetCompatMapReply crep; - xkbGetIndicatorMapReply irep; - xkbGetNamesReply nrep; - xkbGetGeometryReply grep; - XkbComponentNamesRec names; + DeviceIntPtr master; + xkbGetKbdByNameReply rep = {0}; + xkbGetMapReply mrep = {0}; + xkbGetCompatMapReply crep = {0}; + xkbGetIndicatorMapReply irep = {0}; + xkbGetNamesReply nrep = {0}; + xkbGetGeometryReply grep = {0}; + XkbComponentNamesRec names = {0}; XkbDescPtr xkb, new; unsigned char * str; char mapFile[PATH_MAX]; @@ -5589,6 +5612,7 @@ ProcXkbGetKbdByName(ClientPtr client) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); + master = GetMaster(dev, MASTER_KEYBOARD); xkb = dev->key->xkbInfo->desc; status= Success; @@ -5614,17 +5638,17 @@ ProcXkbGetKbdByName(ClientPtr client) else fwant= stuff->want|stuff->need; if ((!names.compat)&& (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) { - names.compat= _XkbDupString("%"); + names.compat= Xstrdup("%"); } if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) { - names.types= _XkbDupString("%"); + names.types= Xstrdup("%"); } if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) { - names.symbols= _XkbDupString("%"); + names.symbols= Xstrdup("%"); } geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0)); if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) { - names.geometry= _XkbDupString("%"); + names.geometry= Xstrdup("%"); geom_changed= FALSE; } @@ -5847,25 +5871,6 @@ ProcXkbGetKbdByName(ClientPtr client) } xkb->ctrls->num_groups= nTG; - for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { - if (tmpd != dev) - XkbCopyDeviceKeymap(tmpd, dev); - - if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) { - old_sli = tmpd->kbdfeed->xkb_sli; - tmpd->kbdfeed->xkb_sli = NULL; - sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0); - if (sli) { - sli->explicitState = old_sli->explicitState; - sli->effectiveState = old_sli->effectiveState; - } - tmpd->kbdfeed->xkb_sli = sli; - XkbFreeSrvLedInfo(old_sli); - } - } - } - nkn.deviceID= nkn.oldDeviceID= dev->id; nkn.minKeyCode= new->min_key_code; nkn.maxKeyCode= new->max_key_code; @@ -5878,30 +5883,35 @@ ProcXkbGetKbdByName(ClientPtr client) nkn.changed|= XkbNKN_GeometryMask; XkbSendNewKeyboardNotify(dev,&nkn); - if (!IsMaster(dev) && dev->u.master) - { - DeviceIntPtr master = dev->u.master; - if (master->u.lastSlave == dev) - { - XkbCopyDeviceKeymap(dev->u.master, dev); - XkbSendNewKeyboardNotify(dev,&nkn); - } - } + /* Update the map and LED info on the device itself, as well as + * any slaves if it's an MD, or its MD if it's an SD and was the + * last device used on that MD. */ + for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if (tmpd != dev && GetMaster(tmpd, MASTER_KEYBOARD) != dev && + (tmpd != master || dev != master->lastSlave)) + continue; + + if (tmpd != dev) + XkbCopyDeviceKeymap(tmpd, dev); + + if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) { + old_sli = tmpd->kbdfeed->xkb_sli; + tmpd->kbdfeed->xkb_sli = NULL; + sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0); + if (sli) { + sli->explicitState = old_sli->explicitState; + sli->effectiveState = old_sli->effectiveState; + } + tmpd->kbdfeed->xkb_sli = sli; + XkbFreeSrvLedInfo(old_sli); + } + } } if ((new!=NULL)&&(new!=xkb)) { XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE); new= NULL; } - free(names.keycodes); - names.keycodes = NULL; - free(names.types); - names.types = NULL; - free(names.compat); - names.compat = NULL; - free(names.symbols); - names.symbols = NULL; - free(names.geometry); - names.geometry = NULL; + XkbFreeComponentNames(&names, FALSE); return Success; } diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 10c38ca47..12fe2a1f5 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -694,7 +694,7 @@ ProcessInputProc backupproc; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); DeviceEvent *event = &ev->device_event; - dev = (IsMaster(mouse) || mouse->u.master) ? GetMaster(mouse, MASTER_KEYBOARD) : mouse; + dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); if (dev && dev->key) { diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index c0204441f..4b5405ab0 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -42,6 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "mi.h" #include "mipointer.h" +#include "inpututils.h" #define EXTENSION_EVENT_BASE 64 DevPrivateKeyRec xkbDevicePrivateKeyRec; @@ -67,20 +68,13 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, Bool XkbInitPrivates(void) { - return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, 0); + return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec)); } void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) { - xkbDeviceInfoPtr xkbPrivPtr; - - xkbPrivPtr = (xkbDeviceInfoPtr) calloc(1, sizeof(xkbDeviceInfoRec)); - if (!xkbPrivPtr) - return; - xkbPrivPtr->unwrapProc = NULL; - - dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr); + xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc); } @@ -1354,19 +1348,19 @@ xkbStateNotify sn; * First one on drinking island wins! */ static void -InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int num_valuators, int *valuators) +InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, ValuatorMask *mask) { ScreenPtr pScreen; - EventListPtr events; + InternalEvent* events; int nevents, i; DeviceIntPtr ptr, mpointer, lastSlave = NULL; Bool saveWait; if (IsMaster(dev)) { mpointer = GetMaster(dev, MASTER_POINTER); - lastSlave = mpointer->u.lastSlave; + lastSlave = mpointer->lastSlave; ptr = GetXTestDevice(mpointer); - } else if (!dev->u.master) + } else if (IsFloating(dev)) ptr = dev; else return; @@ -1376,15 +1370,14 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu OsBlockSignals(); pScreen = miPointerGetScreen(ptr); saveWait = miPointerSetWaitForUpdate(pScreen, FALSE); - nevents = GetPointerEvents(events, ptr, type, button, flags, 0, - num_valuators, valuators); + nevents = GetPointerEvents(events, ptr, type, button, flags, mask); if (IsMaster(dev) && (lastSlave && lastSlave != ptr)) UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents); miPointerSetWaitForUpdate(pScreen, saveWait); OsReleaseSignals(); for (i = 0; i < nevents; i++) - mieqProcessDeviceEvent(ptr, (InternalEvent*)events[i].event, NULL); + mieqProcessDeviceEvent(ptr, &events[i], NULL); FreeEventList(events, GetMaximumEventsNum()); @@ -1393,10 +1386,11 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y) { + ValuatorMask mask; int gpe_flags = 0; /* ignore attached SDs */ - if (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) != NULL) + if (!IsMaster(dev) && !IsFloating(dev)) return; if (flags & XkbSA_MoveAbsoluteX || flags & XkbSA_MoveAbsoluteY) @@ -1404,7 +1398,9 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y) else gpe_flags = POINTER_RELATIVE; - InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, 2, (int[]){x, y}); + valuator_mask_set_range(&mask, 0, 2, (int[]){x, y}); + + InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, &mask); } void @@ -1424,7 +1420,7 @@ XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) if (IsMaster(dev)) { DeviceIntPtr mpointer = GetMaster(dev, MASTER_POINTER); ptr = GetXTestDevice(mpointer); - } else if (!dev->u.master) + } else if (IsFloating(dev)) ptr = dev; else return; @@ -1434,5 +1430,5 @@ XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) return; InjectPointerKeyEvents(dev, press ? ButtonPress : ButtonRelease, - button, 0, 0, NULL); + button, 0, NULL); } diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index c020e5e2a..dfbf7f2b3 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -38,7 +38,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "exevents.h" #include "exglobals.h" #include "windowstr.h" -#include "exevents.h" #include #include "xkb.h" @@ -89,11 +88,15 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, if (!clients[i] || clients[i]->clientState != ClientStateRunning) continue; - /* Ignore clients which will have already received this. - * Inconsistent with themselves, but consistent with previous - * behaviour.*/ - if (xkb_event == XkbMapNotify && (clients[i]->mapNotifyMask & changed)) + /* XKB allows clients to restrict the MappingNotify events sent to + * them. This was broken for three years. Sorry. */ + if (xkb_event == XkbMapNotify && + (clients[i]->xkbClientFlags & _XkbClientInitialized) && + !(clients[i]->mapNotifyMask & changed)) continue; + /* Emulate previous server behaviour: any client which has activated + * XKB will not receive core events emulated from a NewKeyboardNotify + * at all. */ if (xkb_event == XkbNewKeyboardNotify && (clients[i]->xkbClientFlags & _XkbClientInitialized)) continue; @@ -165,9 +168,6 @@ XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN) if (!(clients[i]->newKeyboardNotifyMask & changed)) continue; - if (!XIShouldNotify(clients[i], kbd)) - continue; - pNKN->sequenceNumber = clients[i]->sequence; pNKN->time = time; pNKN->changed = changed; @@ -233,8 +233,7 @@ register CARD16 changed,bState; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->stateNotifyMask&changed) && - XIShouldNotify(interest->client,kbd)) { + (interest->stateNotifyMask&changed)) { pSN->sequenceNumber = interest->client->sequence; pSN->time = time; pSN->changed = changed; @@ -281,9 +280,6 @@ XkbSendMapNotify(DeviceIntPtr kbd, xkbMapNotify *pMN) if (!(clients[i]->mapNotifyMask & changed)) continue; - if (!XIShouldNotify(clients[i], kbd)) - continue; - pMN->time = time; pMN->sequenceNumber = clients[i]->sequence; pMN->changed = changed; @@ -402,8 +398,7 @@ Time time = 0; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->ctrlsNotifyMask&changedControls) && - XIShouldNotify(interest->client, kbd)) { + (interest->ctrlsNotifyMask&changedControls)) { if (!initialized) { pCN->type = XkbEventCode + XkbEventBase; pCN->xkbType = XkbControlsNotify; @@ -451,7 +446,6 @@ CARD32 state,changed; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - XIShouldNotify(interest->client, kbd) && (((xkbType==XkbIndicatorStateNotify)&& (interest->iStateNotifyMask&changed))|| ((xkbType==XkbIndicatorMapNotify)&& @@ -535,8 +529,7 @@ XID winID = 0; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->bellNotifyMask) && - XIShouldNotify(interest->client,kbd)) { + (interest->bellNotifyMask)) { if (!initialized) { time = GetTimeInMillis(); bn.type = XkbEventCode + XkbEventBase; @@ -590,8 +583,7 @@ CARD16 sk_delay,db_delay; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->accessXNotifyMask&(1<detail)) && - XIShouldNotify(interest->client, kbd)) { + (interest->accessXNotifyMask&(1<detail))) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbAccessXNotify; @@ -638,8 +630,7 @@ CARD32 changedIndicators; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->namesNotifyMask&pEv->changed) && - XIShouldNotify(interest->client, kbd)) { + (interest->namesNotifyMask&pEv->changed)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbNamesNotify; @@ -684,8 +675,7 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->compatNotifyMask) && - XIShouldNotify(interest->client, kbd)) { + (interest->compatNotifyMask)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbCompatMapNotify; @@ -737,8 +727,7 @@ Time time = 0; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->actionMessageMask) && - XIShouldNotify(interest->client, kbd)) { + (interest->actionMessageMask)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbActionMessage; @@ -784,8 +773,7 @@ CARD16 reason; if ((!interest->client->clientGone) && (interest->client->requestVector != InitialVector) && (interest->client->xkbClientFlags&_XkbClientInitialized) && - (interest->extDevNotifyMask&reason) && - XIShouldNotify(interest->client, dev)) { + (interest->extDevNotifyMask&reason)) { if (!initialized) { pEv->type = XkbEventCode + XkbEventBase; pEv->xkbType = XkbExtensionDeviceNotify; diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index fbf8f14b8..3d3febb4f 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -221,15 +221,15 @@ static void XkbSetRulesUsed(XkbRMLVOSet *rmlvo) { free(XkbRulesUsed); - XkbRulesUsed= (rmlvo->rules?_XkbDupString(rmlvo->rules):NULL); + XkbRulesUsed= (rmlvo->rules?Xstrdup(rmlvo->rules):NULL); free(XkbModelUsed); - XkbModelUsed= (rmlvo->model?_XkbDupString(rmlvo->model):NULL); + XkbModelUsed= (rmlvo->model?Xstrdup(rmlvo->model):NULL); free(XkbLayoutUsed); - XkbLayoutUsed= (rmlvo->layout?_XkbDupString(rmlvo->layout):NULL); + XkbLayoutUsed= (rmlvo->layout?Xstrdup(rmlvo->layout):NULL); free(XkbVariantUsed); - XkbVariantUsed= (rmlvo->variant?_XkbDupString(rmlvo->variant):NULL); + XkbVariantUsed= (rmlvo->variant?Xstrdup(rmlvo->variant):NULL); free(XkbOptionsUsed); - XkbOptionsUsed= (rmlvo->options?_XkbDupString(rmlvo->options):NULL); + XkbOptionsUsed= (rmlvo->options?Xstrdup(rmlvo->options):NULL); if (XkbWantRulesProp) QueueWorkProc(XkbWriteRulesProp,NULL,NULL); return; @@ -240,23 +240,23 @@ XkbSetRulesDflts(XkbRMLVOSet *rmlvo) { if (rmlvo->rules) { free(XkbRulesDflt); - XkbRulesDflt= _XkbDupString(rmlvo->rules); + XkbRulesDflt= Xstrdup(rmlvo->rules); } if (rmlvo->model) { free(XkbModelDflt); - XkbModelDflt= _XkbDupString(rmlvo->model); + XkbModelDflt= Xstrdup(rmlvo->model); } if (rmlvo->layout) { free(XkbLayoutDflt); - XkbLayoutDflt= _XkbDupString(rmlvo->layout); + XkbLayoutDflt= Xstrdup(rmlvo->layout); } if (rmlvo->variant) { free(XkbVariantDflt); - XkbVariantDflt= _XkbDupString(rmlvo->variant); + XkbVariantDflt= Xstrdup(rmlvo->variant); } if (rmlvo->options) { free(XkbOptionsDflt); - XkbOptionsDflt= _XkbDupString(rmlvo->options); + XkbOptionsDflt= Xstrdup(rmlvo->options); } return; } diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 14dc784b8..cc9aaa75a 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -342,15 +342,18 @@ CARD8 * repeat; xkb= xkbi->desc; repeat= xkb->ctrls->per_key_repeat; + /* before letting XKB do any changes, copy the current core values */ if (pXDev->kbdfeed) memcpy(repeat,pXDev->kbdfeed->ctrl.autoRepeats,XkbPerKeyBitArraySize); XkbUpdateDescActions(xkb,first,num,changes); if ((pXDev->kbdfeed)&& - (changes->ctrls.enabled_ctrls_changes&XkbPerKeyRepeatMask)) { - memcpy(pXDev->kbdfeed->ctrl.autoRepeats,repeat, XkbPerKeyBitArraySize); - (*pXDev->kbdfeed->CtrlProc)(pXDev, &pXDev->kbdfeed->ctrl); + (changes->ctrls.changed_ctrls&XkbPerKeyRepeatMask)) { + /* now copy the modified changes back to core */ + memcpy(pXDev->kbdfeed->ctrl.autoRepeats,repeat, XkbPerKeyBitArraySize); + if (pXDev->kbdfeed->CtrlProc) + (*pXDev->kbdfeed->CtrlProc)(pXDev, &pXDev->kbdfeed->ctrl); } return; } @@ -1395,42 +1398,26 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) /* properties */ if (src->geom->num_properties) { - if (src->geom->num_properties != dst->geom->sz_properties) { - /* If we've got more properties in the destination than - * the source, run through and free all the excess ones - * first. */ - if (src->geom->num_properties < dst->geom->sz_properties) { - for (i = src->geom->num_properties, - dprop = dst->geom->properties + i; - i < dst->geom->num_properties; - i++, dprop++) { - free(dprop->name); - free(dprop->value); - } + /* If we've got more properties in the destination than + * the source, run through and free all the excess ones + * first. */ + if (src->geom->num_properties < dst->geom->sz_properties) { + for (i = src->geom->num_properties, dprop = dst->geom->properties + i; + i < dst->geom->num_properties; + i++, dprop++) { + free(dprop->name); + free(dprop->value); } - - if (dst->geom->sz_properties) - tmp = realloc(dst->geom->properties, - src->geom->num_properties * - sizeof(XkbPropertyRec)); - else - tmp = malloc(src->geom->num_properties * - sizeof(XkbPropertyRec)); - if (!tmp) - return FALSE; - dst->geom->properties = tmp; } + /* Reallocate and clear all new items if the buffer grows. */ + if (!XkbGeomRealloc((void **)&dst->geom->properties, dst->geom->sz_properties, src->geom->num_properties, + sizeof(XkbPropertyRec), XKB_GEOM_CLEAR_EXCESS)) + return FALSE; /* We don't set num_properties as we need it to try and avoid * too much reallocing. */ dst->geom->sz_properties = src->geom->num_properties; - if (dst->geom->sz_properties > dst->geom->num_properties) { - memset(dst->geom->properties + dst->geom->num_properties, 0, - (dst->geom->sz_properties - dst->geom->num_properties) * - sizeof(XkbPropertyRec)); - } - for (i = 0, sprop = src->geom->properties, dprop = dst->geom->properties; @@ -1479,36 +1466,20 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) /* colors */ if (src->geom->num_colors) { - if (src->geom->num_colors != dst->geom->sz_colors) { - if (src->geom->num_colors < dst->geom->sz_colors) { - for (i = src->geom->num_colors, - dcolor = dst->geom->colors + i; - i < dst->geom->num_colors; - i++, dcolor++) { - free(dcolor->spec); - } + if (src->geom->num_colors < dst->geom->sz_colors) { + for (i = src->geom->num_colors, dcolor = dst->geom->colors + i; + i < dst->geom->num_colors; + i++, dcolor++) { + free(dcolor->spec); } - - if (dst->geom->sz_colors) - tmp = realloc(dst->geom->colors, - src->geom->num_colors * - sizeof(XkbColorRec)); - else - tmp = malloc(src->geom->num_colors * - sizeof(XkbColorRec)); - if (!tmp) - return FALSE; - dst->geom->colors = tmp; } + /* Reallocate and clear all new items if the buffer grows. */ + if (!XkbGeomRealloc((void **)&dst->geom->colors, dst->geom->sz_colors, src->geom->num_colors, + sizeof(XkbColorRec), XKB_GEOM_CLEAR_EXCESS)) + return FALSE; dst->geom->sz_colors = src->geom->num_colors; - if (dst->geom->sz_colors > dst->geom->num_colors) { - memset(dst->geom->colors + dst->geom->num_colors, 0, - (dst->geom->sz_colors - dst->geom->num_colors) * - sizeof(XkbColorRec)); - } - for (i = 0, scolor = src->geom->colors, dcolor = dst->geom->colors; @@ -1570,10 +1541,10 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) } if (src->geom->num_shapes) { - tmp = calloc(src->geom->num_shapes, sizeof(XkbShapeRec)); - if (!tmp) + /* Reallocate and clear all items. */ + if (!XkbGeomRealloc((void **)&dst->geom->shapes, dst->geom->sz_shapes, src->geom->num_shapes, + sizeof(XkbShapeRec), XKB_GEOM_CLEAR_ALL)) return FALSE; - dst->geom->shapes = tmp; for (i = 0, sshape = src->geom->shapes, dshape = dst->geom->shapes; i < src->geom->num_shapes; @@ -1690,20 +1661,13 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) } dst->geom->num_sections = 0; - dst->geom->sections = NULL; } if (src->geom->num_sections) { - if (dst->geom->sz_sections) - tmp = realloc(dst->geom->sections, - src->geom->num_sections * - sizeof(XkbSectionRec)); - else - tmp = malloc(src->geom->num_sections * sizeof(XkbSectionRec)); - if (!tmp) + /* Reallocate and clear all items. */ + if (!XkbGeomRealloc((void **)&dst->geom->sections, dst->geom->sz_sections, src->geom->num_sections, + sizeof(XkbSectionRec), XKB_GEOM_CLEAR_ALL)) return FALSE; - memset(tmp, 0, src->geom->num_sections * sizeof(XkbSectionRec)); - dst->geom->sections = tmp; dst->geom->num_sections = src->geom->num_sections; dst->geom->sz_sections = src->geom->num_sections; @@ -1806,21 +1770,13 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) } } dst->geom->num_doodads = 0; - dst->geom->doodads = NULL; } if (src->geom->num_doodads) { - if (dst->geom->sz_doodads) - tmp = realloc(dst->geom->doodads, - src->geom->num_doodads * - sizeof(XkbDoodadRec)); - else - tmp = malloc(src->geom->num_doodads * - sizeof(XkbDoodadRec)); - if (!tmp) + /* Reallocate and clear all items. */ + if (!XkbGeomRealloc((void **)&dst->geom->doodads, dst->geom->sz_doodads, src->geom->num_doodads, + sizeof(XkbDoodadRec), XKB_GEOM_CLEAR_ALL)) return FALSE; - memset(tmp, 0, src->geom->num_doodads * sizeof(XkbDoodadRec)); - dst->geom->doodads = tmp; dst->geom->sz_doodads = src->geom->num_doodads; @@ -1857,20 +1813,14 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) /* key aliases */ if (src->geom->num_key_aliases) { - if (src->geom->num_key_aliases != dst->geom->sz_key_aliases) { - if (dst->geom->sz_key_aliases) - tmp = realloc(dst->geom->key_aliases, - src->geom->num_key_aliases * - 2 * XkbKeyNameLength); - else - tmp = malloc(src->geom->num_key_aliases * - 2 * XkbKeyNameLength); - if (!tmp) - return FALSE; - dst->geom->key_aliases = tmp; + /* Reallocate but don't clear any items. There is no need + * to clear anything because data is immediately copied + * over the whole memory area with memcpy. */ + if (!XkbGeomRealloc((void **)&dst->geom->key_aliases, dst->geom->sz_key_aliases, src->geom->num_key_aliases, + 2 * XkbKeyNameLength, XKB_GEOM_CLEAR_NONE)) + return FALSE; - dst->geom->sz_key_aliases = src->geom->num_key_aliases; - } + dst->geom->sz_key_aliases = src->geom->num_key_aliases; memcpy(dst->geom->key_aliases, src->geom->key_aliases, src->geom->num_key_aliases * 2 * XkbKeyNameLength); diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 7aa9863f2..dea347335 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -241,7 +241,7 @@ unsigned wantNames,wantConfig,wantDflts; if (wantNames&XkmTypesMask) { if (old_names->types!=None) { tmp= NameForAtom(old_names->types); - names->types= _XkbDupString(tmp); + names->types= Xstrdup(tmp); } else { wantDflts|= XkmTypesMask; @@ -251,7 +251,7 @@ unsigned wantNames,wantConfig,wantDflts; if (wantNames&XkmCompatMapMask) { if (old_names->compat!=None) { tmp= NameForAtom(old_names->compat); - names->compat= _XkbDupString(tmp); + names->compat= Xstrdup(tmp); } else wantDflts|= XkmCompatMapMask; complete|= XkmCompatMapMask; @@ -260,13 +260,13 @@ unsigned wantNames,wantConfig,wantDflts; if (old_names->symbols==None) return FALSE; tmp= NameForAtom(old_names->symbols); - names->symbols= _XkbDupString(tmp); + names->symbols= Xstrdup(tmp); complete|= XkmSymbolsMask; } if (wantNames&XkmKeyNamesMask) { if (old_names->keycodes!=None) { tmp= NameForAtom(old_names->keycodes); - names->keycodes= _XkbDupString(tmp); + names->keycodes= Xstrdup(tmp); } else wantDflts|= XkmKeyNamesMask; complete|= XkmKeyNamesMask; @@ -275,7 +275,7 @@ unsigned wantNames,wantConfig,wantDflts; if (old_names->geometry==None) return FALSE; tmp= NameForAtom(old_names->geometry); - names->geometry= _XkbDupString(tmp); + names->geometry= Xstrdup(tmp); complete|= XkmGeometryMask; wantNames&= ~XkmGeometryMask; } diff --git a/xkb/xkbgeom.h b/xkb/xkbgeom.h index fe4da3806..d10b956a6 100644 --- a/xkb/xkbgeom.h +++ b/xkb/xkbgeom.h @@ -311,6 +311,17 @@ typedef struct _XkbGeometrySizes { unsigned short num_key_aliases; } XkbGeometrySizesRec,*XkbGeometrySizesPtr; +/** + * Specifies which items should be cleared in an XKB geometry array + * when the array is reallocated. + */ +typedef enum +{ + XKB_GEOM_CLEAR_NONE, /* Don't clear any items, just reallocate. */ + XKB_GEOM_CLEAR_EXCESS, /* Clear new extra items after reallocation. */ + XKB_GEOM_CLEAR_ALL /* Clear all items after reallocation. */ +} XkbGeomClearance; + extern XkbPropertyPtr XkbAddGeomProperty( XkbGeometryPtr /* geom */, @@ -507,6 +518,15 @@ XkbFreeGeometry( Bool /* freeMap */ ); +extern Bool +XkbGeomRealloc( + void ** /* buffer */, + int /* szItems */, + int /* nrItems */, + int /* itemSize */, + XkbGeomClearance /* clearance */ +); + extern Status XkbAllocGeomProps( XkbGeometryPtr /* geom */, diff --git a/xkb/xkmread.c b/xkb/xkmread.c index b564195bc..e8b97dcda 100644 --- a/xkb/xkmread.c +++ b/xkb/xkmread.c @@ -51,19 +51,6 @@ XkbInternAtom(char *str,Bool only_if_exists) return MakeAtom(str,strlen(str),!only_if_exists); } -char * -_XkbDupString(const char *str) -{ -char *new; - - if (str==NULL) - return NULL; - new= calloc(strlen(str)+1,sizeof(char)); - if (new) - strcpy(new,str); - return new; -} - /***====================================================================***/ static void * @@ -845,9 +832,9 @@ int nRead=0; doodad->text.height= doodadWire.text.height; doodad->text.color_ndx= doodadWire.text.color_ndx; nRead+= XkmGetCountedString(file,buf,100); - doodad->text.text= _XkbDupString(buf); + doodad->text.text= Xstrdup(buf); nRead+= XkmGetCountedString(file,buf,100); - doodad->text.font= _XkbDupString(buf); + doodad->text.font= Xstrdup(buf); break; case XkbIndicatorDoodad: doodad->indicator.shape_ndx= doodadWire.indicator.shape_ndx; @@ -859,7 +846,7 @@ int nRead=0; doodad->logo.color_ndx= doodadWire.logo.color_ndx; doodad->logo.shape_ndx= doodadWire.logo.shape_ndx; nRead+= XkmGetCountedString(file,buf,100); - doodad->logo.logo_name= _XkbDupString(buf); + doodad->logo.logo_name= Xstrdup(buf); break; default: /* report error? */ @@ -1021,7 +1008,7 @@ XkbGeometrySizesRec sizes; geom->width_mm= wireGeom.width_mm; geom->height_mm= wireGeom.height_mm; nRead+= XkmGetCountedString(file,buf,100); - geom->label_font= _XkbDupString(buf); + geom->label_font= Xstrdup(buf); if (wireGeom.num_properties>0) { char val[1024]; for (i=0;i