diff options
author | Stuart Kreitman <stuart.kreitman@sun.com> | 2004-03-25 03:45:49 +0000 |
---|---|---|
committer | Stuart Kreitman <stuart.kreitman@sun.com> | 2004-03-25 03:45:49 +0000 |
commit | f0336f18ee4106050104cb060c38fe87541615da (patch) | |
tree | 9b5673bab03b39c18aca6c30e5a22fd0f3be2d9c | |
parent | 3c2e2d9ae0704931737bb0879a49a8575a07d13b (diff) |
built,working DAMAGE/XFIXES in mono tree
-rw-r--r-- | Xext/shape.c | 12 | ||||
-rw-r--r-- | dix/dispatch.c | 2 | ||||
-rw-r--r-- | dix/dixutils.c | 58 | ||||
-rw-r--r-- | dix/events.c | 5 | ||||
-rw-r--r-- | dix/window.c | 17 | ||||
-rw-r--r-- | include/cursorstr.h | 8 | ||||
-rw-r--r-- | include/dix.h | 33 | ||||
-rw-r--r-- | include/dixstruct.h | 28 | ||||
-rw-r--r-- | include/input.h | 15 | ||||
-rw-r--r-- | include/regionstr.h | 51 | ||||
-rw-r--r-- | include/window.h | 6 | ||||
-rw-r--r-- | mi/miinitext.c | 20 |
12 files changed, 192 insertions, 63 deletions
diff --git a/Xext/shape.c b/Xext/shape.c index 0407db90f..39ad44f34 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -61,7 +61,7 @@ static int ShapeFreeEvents( pointer /* data */, XID /* id */ ); -static void SendShapeNotify( +void SendShapeNotify( WindowPtr /* pWin */, int /* which */ ); @@ -87,8 +87,8 @@ RegionOperate ( #define CREATE_PROC(func) RegionPtr func(WindowPtr /* pWin */) -static CREATE_PROC(CreateBoundingShape); -static CREATE_PROC(CreateClipShape); +CREATE_PROC(CreateBoundingShape); +CREATE_PROC(CreateClipShape); #undef CREATE_PROC @@ -261,7 +261,7 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) return Success; } -static RegionPtr +RegionPtr CreateBoundingShape (pWin) WindowPtr pWin; { @@ -274,7 +274,7 @@ CreateBoundingShape (pWin) return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); } -static RegionPtr +RegionPtr CreateClipShape (pWin) WindowPtr pWin; { @@ -880,7 +880,7 @@ ProcShapeSelectInput (client) * deliver the event */ -static void +void SendShapeNotify (pWin, which) WindowPtr pWin; int which; diff --git a/dix/dispatch.c b/dix/dispatch.c index 0916f4c3d..afbb1b926 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -627,7 +627,7 @@ ProcChangeSaveSet(client) return BadMatch; if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete)) { - result = AlterSaveSetForClient(client, pWin, stuff->mode); + result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); if (client->noClientException != Success) return(client->noClientException); else diff --git a/dix/dixutils.c b/dix/dixutils.c index 40f80d348..7c2fe09e3 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -152,6 +152,21 @@ ClientTimeToServerTime(c) * beware of too-small buffers */ +static unsigned char +ISOLatin1ToLower (unsigned char source) +{ + unsigned char dest; + if ((source >= XK_A) && (source <= XK_Z)) + dest = source + (XK_a - XK_A); + else if ((source >= XK_Agrave) && (source <= XK_Odiaeresis)) + dest = source + (XK_agrave - XK_Agrave); + else if ((source >= XK_Ooblique) && (source <= XK_Thorn)) + dest = source + (XK_oslash - XK_Ooblique); + else + dest = source; + return dest; +} + void CopyISOLatin1Lowered(dest, source, length) register unsigned char *dest, *source; @@ -160,17 +175,27 @@ CopyISOLatin1Lowered(dest, source, length) register int i; for (i = 0; i < length; i++, source++, dest++) + *dest = ISOLatin1ToLower (*source); + *dest = '\0'; +} + +int +CompareISOLatin1Lowered(unsigned char *s1, int s1len, + unsigned char *s2, int s2len) +{ + unsigned char c1, c2; + + for (;;) { - if ((*source >= XK_A) && (*source <= XK_Z)) - *dest = *source + (XK_a - XK_A); - else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) - *dest = *source + (XK_agrave - XK_Agrave); - else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) - *dest = *source + (XK_oslash - XK_Ooblique); - else - *dest = *source; + /* note -- compare against zero so that -1 ignores len */ + c1 = s1len-- ? *s1++ : '\0'; + c2 = s2len-- ? *s2++ : '\0'; + if (!c1 || + (c1 != c2 && + (c1 = ISOLatin1ToLower (c1)) != (c2 = ISOLatin1ToLower (c2)))) + break; } - *dest = '\0'; + return (int) c1 - (int) c2; } #ifdef XCSECURITY @@ -321,10 +346,11 @@ LookupClient(rid, client) int -AlterSaveSetForClient(client, pWin, mode) - ClientPtr client; - WindowPtr pWin; - unsigned mode; +AlterSaveSetForClient(ClientPtr client, + WindowPtr pWin, + unsigned mode, + Bool toRoot, + Bool remap) { int numnow; pointer *pTmp = NULL; @@ -348,7 +374,9 @@ AlterSaveSetForClient(client, pWin, mode) return(BadAlloc); client->saveSet = pTmp; client->numSaved = numnow; - client->saveSet[numnow - 1] = (pointer)pWin; + SaveSetAssignWindow(client->saveSet[numnow - 1], pWin); + SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot); + SaveSetAssignRemap(client->saveSet[numnow - 1], remap); return(Success); } else if ((mode == SetModeDelete) && (j < numnow)) @@ -388,7 +416,7 @@ DeleteWindowFromAnySaveSet(pWin) { client = clients[i]; if (client && client->numSaved) - (void)AlterSaveSetForClient(client, pWin, SetModeDelete); + (void)AlterSaveSetForClient(client, pWin, SetModeDelete, FALSE, TRUE); } } diff --git a/dix/events.c b/dix/events.c index b659f0155..baff86954 100644 --- a/dix/events.c +++ b/dix/events.c @@ -181,11 +181,6 @@ static WindowPtr *spriteTrace = (WindowPtr *)NULL; static int spriteTraceSize = 0; static int spriteTraceGood; -typedef struct { - int x, y; - ScreenPtr pScreen; -} HotSpot; - static struct { CursorPtr current; BoxRec hotLimits; /* logical constraints of hot spot */ diff --git a/dix/window.c b/dix/window.c index b410bd948..7aea71e84 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3152,10 +3152,17 @@ HandleSaveSet(client) for (j=0; j<client->numSaved; j++) { - pWin = (WindowPtr)client->saveSet[j]; - pParent = pWin->parent; - while (pParent && (wClient (pParent) == client)) - pParent = pParent->parent; + pWin = SaveSetWindow(client->saveSet[j]); +#ifdef XFIXES + if (SaveSetToRoot(client->saveSet[j])) + pParent = WindowTable[pWin->drawable.pScreen->myNum]; + else +#endif + { + pParent = pWin->parent; + while (pParent && (wClient (pParent) == client)) + pParent = pParent->parent; + } if (pParent) { if (pParent != pWin->parent) @@ -3172,7 +3179,7 @@ HandleSaveSet(client) } xfree(client->saveSet); client->numSaved = 0; - client->saveSet = (pointer *)NULL; + client->saveSet = (SaveSetElt *)NULL; } Bool diff --git a/include/cursorstr.h b/include/cursorstr.h index 3984245ad..84f02164a 100644 --- a/include/cursorstr.h +++ b/include/cursorstr.h @@ -77,10 +77,18 @@ typedef struct _Cursor { unsigned short backRed, backGreen, backBlue; /* device-independent color */ int refcnt; pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ +#ifdef XFIXES + CARD32 serialNumber; + Atom name; +#endif } CursorRec; typedef struct _CursorMetric { unsigned short width, height, xhot, yhot; } CursorMetricRec; +typedef struct { + int x, y; + ScreenPtr pScreen; +} HotSpot; #endif /* CURSORSTRUCT_H */ diff --git a/include/dix.h b/include/dix.h index 0ca157ad4..fc0fab04f 100644 --- a/include/dix.h +++ b/include/dix.h @@ -379,6 +379,12 @@ extern void CopyISOLatin1Lowered( unsigned char * /*source*/, int /*length*/); +extern int CompareISOLatin1Lowered( + unsigned char * /*a*/, + int alen, + unsigned char * /*b*/, + int blen); + #ifdef XCSECURITY extern WindowPtr SecurityLookupWindow( @@ -423,12 +429,14 @@ extern ClientPtr LookupClient( extern void NoopDDA(void); -extern int AlterSaveSetForClient( +int AlterSaveSetForClient( ClientPtr /*client*/, WindowPtr /*pWin*/, - unsigned /*mode*/); - -extern void DeleteWindowFromAnySaveSet( + unsigned /*mode*/, + Bool /*toRoot*/, + Bool /*remap*/); + +void DeleteWindowFromAnySaveSet( WindowPtr /*pWin*/); extern void BlockHandler( @@ -785,4 +793,21 @@ typedef struct { int count; } DeviceEventInfoRec; +/* + * SelectionCallback stuff + */ + +extern CallbackListPtr SelectionCallback; + +typedef enum { + SelectionSetOwner, + SelectionWindowDestroy, + SelectionClientClose +} SelectionCallbackKind; + +typedef struct { + struct _Selection *selection; + SelectionCallbackKind kind; +} SelectionInfoRec; + #endif /* DIX_H */ diff --git a/include/dixstruct.h b/include/dixstruct.h index 9c39a8aec..030af501f 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -68,6 +68,28 @@ typedef enum {ClientStateInitial, ClientStateCheckingSecurity, ClientStateCheckedSecurity} ClientState; +#ifdef XFIXES +typedef struct _saveSet { + struct _Window *windowPtr; + Bool toRoot; + Bool remap; +} SaveSetElt; +#define SaveSetWindow(ss) ((ss).windowPtr) +#define SaveSetToRoot(ss) ((ss).toRoot) +#define SaveSetRemap(ss) ((ss).remap) +#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) +#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) +#define SaveSetAssignRemap(ss,rm) ((ss).remap = (rm)) +#else +typedef struct _Window *SaveSetElt; +#define SaveSetWindow(ss) (ss) +#define SaveSetToRoot(ss) FALSE +#define SaveSetRemap(ss) TRUE +#define SaveSetAssignWindow(ss,w) ((ss) = (w)) +#define SaveSetAssignToRoot(ss,tr) +#define SaveSetAssignRemap(ss,rm) +#endif + typedef struct _Client { int index; Mask clientAsMask; @@ -85,7 +107,7 @@ typedef struct _Client { Drawable lastDrawableID; GCPtr lastGC; GContext lastGCID; - pointer *saveSet; + SaveSetElt *saveSet; int numSaved; pointer screenPrivate[MAXSCREENS]; int (**requestVector) ( @@ -148,8 +170,8 @@ extern Bool SmartScheduleDisable; extern Bool SmartScheduleIdle; extern Bool SmartScheduleTimerStopped; extern Bool SmartScheduleStartTimer(void); -#define SMART_MAX_PRIORITY (20) -#define SMART_MIN_PRIORITY (-20) +#define SMART_MAX_PRIORITY 20 +#define SMART_MIN_PRIORITY -20 extern Bool SmartScheduleInit(void); diff --git a/include/input.h b/include/input.h index fa88febda..ff3ce1811 100644 --- a/include/input.h +++ b/include/input.h @@ -92,6 +92,17 @@ typedef void (*ProcessInputProc)( DeviceIntPtr /*device*/, int /*count*/); +typedef Bool (*DeviceHandleProc)( + DeviceIntPtr /*device*/, + void* /*data*/ + ); + +typedef void (*DeviceUnwrapProc)( + DeviceIntPtr /*device*/, + DeviceHandleProc /*proc*/, + void* /*data*/ + ); + typedef struct _DeviceRec { pointer devicePrivate; ProcessInputProc processInputProc; /* current */ @@ -145,6 +156,10 @@ typedef struct { unsigned char id; } LedCtrl; +extern int AllocateDevicePrivateIndex(void); +extern Bool AllocateDevicePrivate(DeviceIntPtr device, int index); +extern void ResetDevicePrivateIndex(void); + extern KeybdCtrl defaultKeyboardControl; extern PtrCtrl defaultPointerControl; diff --git a/include/regionstr.h b/include/regionstr.h index 192983dab..2f831488a 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -95,81 +95,84 @@ extern RegDataRec miBrokenData; #define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1) #define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) +/* Keith recommends weaning the region code of pScreen argument */ +#define REG_pScreen screenInfo.screens[0] + #ifdef NEED_SCREEN_REGIONS #define REGION_CREATE(_pScreen, _rect, _size) \ - (*(_pScreen)->RegionCreate)(_rect, _size) + (*(REG_pScreen)->RegionCreate)(_rect, _size) #define REGION_INIT(_pScreen, _pReg, _rect, _size) \ - (*(_pScreen)->RegionInit)(_pReg, _rect, _size) + (*(REG_pScreen)->RegionInit)(_pReg, _rect, _size) #define REGION_COPY(_pScreen, dst, src) \ - (*(_pScreen)->RegionCopy)(dst, src) + (*(REG_pScreen)->RegionCopy)(dst, src) #define REGION_DESTROY(_pScreen, _pReg) \ - (*(_pScreen)->RegionDestroy)(_pReg) + (*(REG_pScreen)->RegionDestroy)(_pReg) #define REGION_UNINIT(_pScreen, _pReg) \ - (*(_pScreen)->RegionUninit)(_pReg) + (*(REG_pScreen)->RegionUninit)(_pReg) #define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ - (*(_pScreen)->Intersect)(newReg, reg1, reg2) + (*(REG_pScreen)->Intersect)(newReg, reg1, reg2) #define REGION_UNION(_pScreen, newReg, reg1, reg2) \ - (*(_pScreen)->Union)(newReg, reg1, reg2) + (*(REG_pScreen)->Union)(newReg, reg1, reg2) #define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ - (*(_pScreen)->Subtract)(newReg, reg1, reg2) + (*(REG_pScreen)->Subtract)(newReg, reg1, reg2) #define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ - (*(_pScreen)->Inverse)(newReg, reg1, invRect) + (*(REG_pScreen)->Inverse)(newReg, reg1, invRect) #define REGION_RESET(_pScreen, _pReg, _pBox) \ - (*(_pScreen)->RegionReset)(_pReg, _pBox) + (*(REG_pScreen)->RegionReset)(_pReg, _pBox) #define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ - (*(_pScreen)->TranslateRegion)(_pReg, _x, _y) + (*(REG_pScreen)->TranslateRegion)(_pReg, _x, _y) #define RECT_IN_REGION(_pScreen, _pReg, prect) \ - (*(_pScreen)->RectIn)(_pReg, prect) + (*(REG_pScreen)->RectIn)(_pReg, prect) #define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ - (*(_pScreen)->PointInRegion)(_pReg, _x, _y, prect) + (*(REG_pScreen)->PointInRegion)(_pReg, _x, _y, prect) #define REGION_NOTEMPTY(_pScreen, _pReg) \ - (*(_pScreen)->RegionNotEmpty)(_pReg) + (*(REG_pScreen)->RegionNotEmpty)(_pReg) #define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ - (*(_pScreen)->RegionEqual)(_pReg1, _pReg2) + (*(REG_pScreen)->RegionEqual)(_pReg1, _pReg2) #define REGION_BROKEN(_pScreen, _pReg) \ - (*(_pScreen)->RegionBroken)(_pReg) + (*(REG_pScreen)->RegionBroken)(_pReg) #define REGION_BREAK(_pScreen, _pReg) \ - (*(_pScreen)->RegionBreak)(_pReg) + (*(REG_pScreen)->RegionBreak)(_pReg) #define REGION_EMPTY(_pScreen, _pReg) \ - (*(_pScreen)->RegionEmpty)(_pReg) + (*(REG_pScreen)->RegionEmpty)(_pReg) #define REGION_EXTENTS(_pScreen, _pReg) \ - (*(_pScreen)->RegionExtents)(_pReg) + (*(REG_pScreen)->RegionExtents)(_pReg) #define REGION_APPEND(_pScreen, dstrgn, rgn) \ - (*(_pScreen)->RegionAppend)(dstrgn, rgn) + (*(REG_pScreen)->RegionAppend)(dstrgn, rgn) #define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ - (*(_pScreen)->RegionValidate)(badreg, pOverlap) + (*(REG_pScreen)->RegionValidate)(badreg, pOverlap) #define BITMAP_TO_REGION(_pScreen, pPix) \ - (*(_pScreen)->BitmapToRegion)(pPix) + (*(REG_pScreen)->BitmapToRegion)(pPix) #define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ - (*(_pScreen)->RectsToRegion)(nrects, prect, ctype) + (*(REG_pScreen)->RectsToRegion)(nrects, prect, ctype) #else /* !NEED_SCREEN_REGIONS */ /* Reference _pScreen macro argument and check its type */ -#define REGION_SCREEN(_pScreen_) (void)((_pScreen_)->myNum) +#define REGION_SCREEN(_pScreen) (void)((REG_pScreen)->myNum) #define REGION_CREATE(_pScreen, _rect, _size) \ (REGION_SCREEN(_pScreen), miRegionCreate(_rect, _size)) diff --git a/include/window.h b/include/window.h index 5056512b8..cf019664a 100644 --- a/include/window.h +++ b/include/window.h @@ -252,4 +252,10 @@ void ResizeChildrenWinSize( int /*dw*/, int /*dh*/); +RegionPtr +CreateBoundingShape (WindowPtr pWin); + +RegionPtr +CreateClipShape (WindowPtr pWin); + #endif /* WINDOW_H */ diff --git a/mi/miinitext.c b/mi/miinitext.c index 6c8c20307..5dcfdc9e1 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -238,6 +238,12 @@ extern void RRExtensionInit(INITARGS); #ifdef RES extern void ResExtensionInit(INITARGS); #endif +#ifdef DAMAGE +extern void DamageExtensionInit(INITARGS); +#endif +#ifdef XFIXES +extern void XFixesExtensionInit(INITARGS); +#endif #ifndef XFree86LOADER @@ -377,6 +383,12 @@ InitExtensions(argc, argv) #ifdef RES ResExtensionInit(); #endif +#ifdef DAMAGE + DamageExtensionInit(); +#endif +#ifdef XFIXES + XFixesExtensionInit(); +#endif } void @@ -448,7 +460,15 @@ ExtensionModule extension[] = { NULL, "FontCache", NULL, NULL }, { NULL, "RENDER", NULL, NULL }, { NULL, "RANDR", NULL, NULL }, +#ifdef RES { NULL, "X-Resource", NULL, NULL }, +#endif +#ifdef DAMAGE + { NULL, "DAMAGE", NULL, NULL }, +#endif +#ifdef XFIXES + { NULL, "XFIXES", NULL, NULL }, +#endif { NULL, NULL, NULL, NULL } }; #endif |