diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
commit | d568221710959cf7d783e6ff0fb80fb43a231124 (patch) | |
tree | 8d6f039393294c6ffac8533639afdebe5d68bfc1 /record | |
parent | 9508a382f8a9f241dab097d921b6d290c1c3a776 (diff) |
XFree86 4.3.0.1
Diffstat (limited to 'record')
-rw-r--r-- | record/record.c | 76 | ||||
-rw-r--r-- | record/set.c | 12 |
2 files changed, 65 insertions, 23 deletions
diff --git a/record/record.c b/record/record.c index bcc019f27..2baba3694 100644 --- a/record/record.c +++ b/record/record.c @@ -32,16 +32,29 @@ This work benefited from earlier work done by Martha Zimet of NCD and Jim Haggerty of Metheus. */ +/* $XFree86: xc/programs/Xserver/record/record.c,v 1.10 2002/09/17 01:15:14 dawes Exp $ */ -#include <stdio.h> -#include <assert.h> #define NEED_EVENTS #include "dixstruct.h" #include "extnsionst.h" #define _XRECORD_SERVER_ -#include "X11/extensions/recordstr.h" +#include "recordstr.h" #include "set.h" +#ifndef XFree86LOADER +#include <stdio.h> +#include <assert.h> +#else +#include "xf86_ansic.h" +#endif + +#ifdef PANORAMIX +#include "globals.h" +#include "panoramiX.h" +#include "panoramiXsrv.h" +#include "cursor.h" +#endif + static RESTYPE RTContext; /* internal resource type for Record contexts */ static int RecordErrorBase; /* first Record error number */ @@ -286,7 +299,7 @@ RecordAProtocolElement(pContext, pClient, category, data, datalen, futurelen) int numElemHeaders = 0; Bool recordingClientSwapped = pContext->pRecordingClient->swapped; int n; - CARD32 serverTime; + CARD32 serverTime = 0; Bool gotServerTime = FALSE; int replylen; @@ -864,11 +877,31 @@ RecordADeviceEvent(pcbl, nulldata, calldata) { xEvent swappedEvent; xEvent *pEvToRecord = pev; +#ifdef PANORAMIX + xEvent shiftedEvent; + + if (!noPanoramiXExtension && + (pev->u.u.type == MotionNotify || + pev->u.u.type == ButtonPress || + pev->u.u.type == ButtonRelease || + pev->u.u.type == KeyPress || + pev->u.u.type == KeyRelease)) { + int scr = XineramaGetCursorScreen(); + memcpy(&shiftedEvent, pev, sizeof(xEvent)); + shiftedEvent.u.keyButtonPointer.rootX += + panoramiXdataPtr[scr].x - + panoramiXdataPtr[0].x; + shiftedEvent.u.keyButtonPointer.rootY += + panoramiXdataPtr[scr].y - + panoramiXdataPtr[0].y; + pEvToRecord = &shiftedEvent; + } +#endif /* PANORAMIX */ if (pContext->pRecordingClient->swapped) { - (*EventSwapVector[pev->u.u.type & 0177]) - (pev, &swappedEvent); + (*EventSwapVector[pEvToRecord->u.u.type & 0177]) + (pEvToRecord, &swappedEvent); pEvToRecord = &swappedEvent; } @@ -979,8 +1012,8 @@ RecordInstallHooks(pRCAP, oneclient) (pointer)pClientPriv; pClient->requestVector = pClientPriv->recordVector; } - while (pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet, - pIter, &interval)) + while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet, + pIter, &interval))) { unsigned int j; for (j = interval.first; j <= interval.last; j++) @@ -1078,9 +1111,9 @@ RecordUninstallHooks(pRCAP, oneclient) RecordSetInterval interval; otherRCAPwantsProcVector = TRUE; - while (pIter = RecordIterateSet( + while ((pIter = RecordIterateSet( pOtherRCAP->pRequestMajorOpSet, - pIter, &interval)) + pIter, &interval))) { unsigned int j; for (j = interval.first; j <= interval.last; j++) @@ -1241,7 +1274,7 @@ RecordDeleteClientFromContext(pContext, clientspec) RecordClientsAndProtocolPtr pRCAP; int position; - if (pRCAP = RecordFindClientOnContext(pContext, clientspec, &position)) + if ((pRCAP = RecordFindClientOnContext(pContext, clientspec, &position))) RecordDeleteClientFromRCAP(pRCAP, position); } /* RecordDeleteClientFromContext */ @@ -1696,8 +1729,8 @@ RecordRegisterClients(pContext, client, stuff) int maxSets; int nExtReqSets = 0; int nExtRepSets = 0; - int extReqSetsOffset; - int extRepSetsOffset; + int extReqSetsOffset = 0; + int extRepSetsOffset = 0; SetInfoPtr pExtReqSets, pExtRepSets; int clientListOffset; XID *pCanonClients; @@ -1964,7 +1997,7 @@ static int ProcRecordQueryVersion(client) ClientPtr client; { - REQUEST(xRecordQueryVersionReq); + /* REQUEST(xRecordQueryVersionReq); */ xRecordQueryVersionReply rep; int n; @@ -2186,7 +2219,7 @@ RecordConvertSetToRanges(pSet, pri, byteoffset, card8, imax, pStartIndex) return Success; nRanges = pStartIndex ? *pStartIndex : 0; - while (pIter = RecordIterateSet(pSet, pIter, &interval)) + while ((pIter = RecordIterateSet(pSet, pIter, &interval))) { if (interval.first > imax) break; if (interval.last > imax) interval.last = imax; @@ -2602,7 +2635,7 @@ RecordDeleteContext(value, id) * As a result, the RCAPs will be freed. */ - while (pRCAP = pContext->pListOfRCAP) + while ((pRCAP = pContext->pListOfRCAP)) { int numClients = pRCAP->numClients; /* when the last client is deleted, the RCAP will go away. */ @@ -2926,8 +2959,8 @@ RecordAClientStateChange(pcbl, nulldata, calldata) RecordClientsAndProtocolPtr pRCAP; RecordContextPtr pContext = ppAllContexts[i]; - if (pRCAP = RecordFindClientOnContext(pContext, - XRecordFutureClients, NULL)) + if ((pRCAP = RecordFindClientOnContext(pContext, + XRecordFutureClients, NULL))) { RecordAddClientToRCAP(pRCAP, pClient->clientAsMask); if (pContext->pRecordingClient && pRCAP->clientStarted) @@ -2946,8 +2979,8 @@ RecordAClientStateChange(pcbl, nulldata, calldata) if (pContext->pRecordingClient == pClient) RecordDisableContext(pContext); - if (pRCAP = RecordFindClientOnContext(pContext, - pClient->clientAsMask, &pos)) + if ((pRCAP = RecordFindClientOnContext(pContext, + pClient->clientAsMask, &pos))) { if (pContext->pRecordingClient && pRCAP->clientDied) RecordAProtocolElement(pContext, pClient, @@ -2957,6 +2990,8 @@ RecordAClientStateChange(pcbl, nulldata, calldata) } break; + default: + break; } /* end switch on client state */ } /* RecordAClientStateChange */ @@ -3019,3 +3054,4 @@ RecordExtensionInit() RecordErrorBase = extentry->errorBase; } /* RecordExtensionInit */ + diff --git a/record/set.c b/record/set.c index dbaac4f54..c17e7cfab 100644 --- a/record/set.c +++ b/record/set.c @@ -27,6 +27,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/record/set.c,v 1.7 2001/12/14 20:00:37 dawes Exp $ */ /* @@ -88,6 +89,11 @@ void *Xcalloc(size) #include "set.h" +#ifdef XFree86LOADER +#include "xf86_libc.h" +#include "xf86_ansic.h" +#endif + static int maxMemberInInterval(pIntervals, nIntervals) RecordSetInterval *pIntervals; @@ -197,7 +203,7 @@ BitVectorIterateSet(pSet, pIter, pInterval) RecordSetIteratePtr pIter; RecordSetInterval *pInterval; { - int iterbit = (int)pIter; + int iterbit = (int)(long)pIter; int b; b = BitVectorFindBit(pSet, iterbit, TRUE); @@ -206,7 +212,7 @@ BitVectorIterateSet(pSet, pIter, pInterval) b = BitVectorFindBit(pSet, b, FALSE); pInterval->last = (b < 0) ? ((BitVectorSetPtr)pSet)->maxMember : b - 1; - return (RecordSetIteratePtr)(pInterval->last + 1); + return (RecordSetIteratePtr)(long)(pInterval->last + 1); } RecordSetOperations BitVectorSetOperations = { @@ -515,7 +521,7 @@ RecordCreateSet(pIntervals, nIntervals, pMem, memsize) &pCreateSet); if (pMem) { - if ( ((int)pMem & (alignment-1) ) || memsize < size) + if ( ((long)pMem & (alignment-1) ) || memsize < size) return NULL; } return (*pCreateSet)(pIntervals, nIntervals, pMem, size); |