summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-07 19:36:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-07 19:36:27 +1000
commit6c3b633299f12051fcf37fb8439f358de876cf03 (patch)
tree91d35cc77632048d9cb2c0c932fdea0b98f5395e /mi
parentadf21dba7617542f08309415e315d4b2699c10e0 (diff)
parent0cfd48130842685828e0662a27272a3a65facd23 (diff)
Merge branch 'master' into xi2
Diffstat (limited to 'mi')
-rw-r--r--mi/Makefile.am1
-rw-r--r--mi/misprite.c319
-rw-r--r--mi/mispritest.h127
3 files changed, 189 insertions, 258 deletions
diff --git a/mi/Makefile.am b/mi/Makefile.am
index 979cc3980..9714a21ca 100644
--- a/mi/Makefile.am
+++ b/mi/Makefile.am
@@ -57,7 +57,6 @@ libmi_la_SOURCES = \
mispans.h \
misprite.c \
misprite.h \
- mispritest.h \
mistruct.h \
mivaltree.c \
mivalidate.h \
diff --git a/mi/misprite.c b/mi/misprite.c
index 1cf643a13..a2abbc222 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -33,29 +33,106 @@ in this Software without prior written authorization from The Open Group.
#include <dix-config.h>
#endif
-# include <X11/X.h>
-# include <X11/Xproto.h>
-# include "misc.h"
-# include "pixmapstr.h"
-# include "input.h"
-# include "mi.h"
-# include "cursorstr.h"
-# include <X11/fonts/font.h>
-# include "scrnintstr.h"
-# include "colormapst.h"
-# include "windowstr.h"
-# include "gcstruct.h"
-# include "mipointer.h"
-# include "mispritest.h"
-# include "dixfontstr.h"
-# include <X11/fonts/fontstruct.h>
-# include "inputstr.h"
-
-#ifdef RENDER
-# include "mipict.h"
-#endif
-# include "damage.h"
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "pixmapstr.h"
+#include "input.h"
+#include "mi.h"
+#include "cursorstr.h"
+#include <X11/fonts/font.h>
+#include "scrnintstr.h"
+#include "colormapst.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "mipointer.h"
+#include "misprite.h"
+#include "dixfontstr.h"
+#include <X11/fonts/fontstruct.h>
+#include "inputstr.h"
+#include "damage.h"
+
+typedef struct {
+ CursorPtr pCursor;
+ int x; /* cursor hotspot */
+ int y;
+ BoxRec saved; /* saved area from the screen */
+ Bool isUp; /* cursor in frame buffer */
+ Bool shouldBeUp; /* cursor should be displayed */
+ WindowPtr pCacheWin; /* window the cursor last seen in */
+ Bool isInCacheWin;
+ Bool checkPixels; /* check colormap collision */
+ ScreenPtr pScreen;
+} miCursorInfoRec, *miCursorInfoPtr;
+/*
+ * per screen information
+ */
+
+typedef struct {
+ /* screen procedures */
+ CloseScreenProcPtr CloseScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+
+ /* window procedures */
+ CopyWindowProcPtr CopyWindow;
+
+ /* colormap procedures */
+ InstallColormapProcPtr InstallColormap;
+ StoreColorsProcPtr StoreColors;
+
+ /* os layer procedures */
+ ScreenBlockHandlerProcPtr BlockHandler;
+
+ /* device cursor procedures */
+ DeviceCursorInitializeProcPtr DeviceCursorInitialize;
+ DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ xColorItem colors[2];
+ ColormapPtr pInstalledMap;
+ ColormapPtr pColormap;
+ VisualPtr pVisual;
+ miSpriteCursorFuncPtr funcs;
+ DamagePtr pDamage; /* damage tracking structure */
+ Bool damageRegistered;
+} miSpriteScreenRec, *miSpriteScreenPtr;
+
+#define SOURCE_COLOR 0
+#define MASK_COLOR 1
+
+/*
+ * Overlap BoxPtr and Box elements
+ */
+#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
+ (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
+ ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
+
+/*
+ * Overlap BoxPtr, origins, and rectangle
+ */
+#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
+ BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
+
+/*
+ * Overlap BoxPtr, origins and RectPtr
+ */
+#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
+ ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
+ (int)((pRect)->width), (int)((pRect)->height))
+/*
+ * Overlap BoxPtr and horizontal span
+ */
+#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
+
+#define LINE_SORT(x1,y1,x2,y2) \
+{ int _t; \
+ if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
+ if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
+
+#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
+ BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
#define SPRITE_DEBUG_ENABLE 0
@@ -65,29 +142,26 @@ in this Software without prior written authorization from The Open Group.
#define SPRITE_DEBUG(x)
#endif
-
#define MISPRITE(dev) \
((DevHasCursor(dev)) ? \
(miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \
(miCursorInfoPtr)dixLookupPrivate(&dev->u.master->devPrivates, miSpriteDevPrivatesKey))
-static int damageRegister = 0;
-
static void
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
- if (damageRegister) {
+ if (pScreenPriv->damageRegistered) {
DamageUnregister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
pScreenPriv->pDamage);
- damageRegister = 0;
+ pScreenPriv->damageRegistered = 0;
}
}
static void
miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
- if (!damageRegister) {
- damageRegister = 1;
+ if (!pScreenPriv->damageRegistered) {
+ pScreenPriv->damageRegistered = 1;
DamageRegister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
pScreenPriv->pDamage);
}
@@ -111,8 +185,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
static int miSpriteScreenKeyIndex;
static DevPrivateKey miSpriteScreenKey = &miSpriteScreenKeyIndex;
-static int mmiSpriteDevPrivatesKeyIndex;
-static DevPrivateKey miSpriteDevPrivatesKey = &mmiSpriteDevPrivatesKeyIndex;
+static int miSpriteDevPrivatesKeyIndex;
+static DevPrivateKey miSpriteDevPrivatesKey = &miSpriteDevPrivatesKeyIndex;
static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
@@ -188,8 +262,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
miCursorInfoPtr pCursorInfo;
DeviceIntPtr pDev;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
@@ -199,8 +272,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
if (pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen &&
- RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved)
- != rgnOUT)
+ miRectIn(pRegion, &pCursorInfo->saved) != rgnOUT)
{
SPRITE_DEBUG(("Damage remove\n"));
miSpriteRemoveCursor (pDev, pScreen);
@@ -231,15 +303,15 @@ miSpriteInitialize (ScreenPtr pScreen,
return FALSE;
pScreenPriv->pDamage = DamageCreate (miSpriteReportDamage,
- (DamageDestroyFunc) 0,
+ NULL,
DamageReportRawRegion,
TRUE,
pScreen,
- (void *) pScreen);
+ pScreen);
if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
{
- xfree ((pointer) pScreenPriv);
+ xfree (pScreenPriv);
return FALSE;
}
for (pVisual = pScreen->visuals;
@@ -271,6 +343,8 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->colors[MASK_COLOR].red = 0;
pScreenPriv->colors[MASK_COLOR].green = 0;
pScreenPriv->colors[MASK_COLOR].blue = 0;
+ pScreenPriv->damageRegistered = 0;
+
dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv);
pScreen->CloseScreen = miSpriteCloseScreen;
@@ -284,8 +358,6 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreen->BlockHandler = miSpriteBlockHandler;
- damageRegister = 0;
-
return TRUE;
}
@@ -303,8 +375,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
{
miSpriteScreenPtr pScreenPriv;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
pScreen->GetImage = pScreenPriv->GetImage;
pScreen->GetSpans = pScreenPriv->GetSpans;
@@ -315,7 +386,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
DamageDestroy (pScreenPriv->pDamage);
- xfree ((pointer) pScreenPriv);
+ xfree (pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -332,22 +403,22 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
SCREEN_PROLOGUE (pScreen, GetImage);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if (pDrawable->type == DRAWABLE_WINDOW)
{
- if (DevHasCursor(pDev))
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
+ for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
- pCursorInfo = MISPRITE(pDev);
- if (pDrawable->type == DRAWABLE_WINDOW &&
- pCursorInfo->isUp &&
- pCursorInfo->pScreen == pScreen &&
- ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
- sx, sy, w, h))
- {
- SPRITE_DEBUG (("GetImage remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
- }
+ if (DevHasCursor(pDev))
+ {
+ pCursorInfo = MISPRITE(pDev);
+ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
+ ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
+ sx, sy, w, h))
+ {
+ SPRITE_DEBUG (("GetImage remove\n"));
+ miSpriteRemoveCursor (pDev, pScreen);
+ }
+ }
}
}
@@ -368,38 +439,38 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
SCREEN_PROLOGUE (pScreen, GetSpans);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
-
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if (pDrawable->type == DRAWABLE_WINDOW)
{
- if (DevHasCursor(pDev))
- {
- pCursorInfo = MISPRITE(pDev);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
- if (pDrawable->type == DRAWABLE_WINDOW &&
- pCursorInfo->isUp &&
- pCursorInfo->pScreen == pScreen)
+ for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ {
+ if (DevHasCursor(pDev))
{
- DDXPointPtr pts;
- int *widths;
- int nPts;
- int xorg,
- yorg;
-
- xorg = pDrawable->x;
- yorg = pDrawable->y;
-
- for (pts = ppt, widths = pwidth, nPts = nspans;
- nPts--;
- pts++, widths++)
+ pCursorInfo = MISPRITE(pDev);
+
+ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
{
- if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
- pts->x+xorg,*widths))
+ DDXPointPtr pts;
+ int *widths;
+ int nPts;
+ int xorg,
+ yorg;
+
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+
+ for (pts = ppt, widths = pwidth, nPts = nspans;
+ nPts--;
+ pts++, widths++)
{
- SPRITE_DEBUG (("GetSpans remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
- break;
+ if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
+ pts->x+xorg,*widths))
+ {
+ SPRITE_DEBUG (("GetSpans remove\n"));
+ miSpriteRemoveCursor (pDev, pScreen);
+ break;
+ }
}
}
}
@@ -422,23 +493,24 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
SCREEN_PROLOGUE (pScreen, SourceValidate);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
-
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if (pDrawable->type == DRAWABLE_WINDOW)
{
- if (DevHasCursor(pDev))
- {
- pCursorInfo = MISPRITE(pDev);
- if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
- pCursorInfo->pScreen == pScreen &&
- ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
- x, y, width, height))
- {
- SPRITE_DEBUG (("SourceValidate remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
- }
- }
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
+
+ for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ {
+ if (DevHasCursor(pDev))
+ {
+ pCursorInfo = MISPRITE(pDev);
+ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
+ ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
+ x, y, width, height))
+ {
+ SPRITE_DEBUG (("SourceValidate remove\n"));
+ miSpriteRemoveCursor (pDev, pScreen);
+ }
+ }
+ }
}
if (pScreen->SourceValidate)
@@ -457,8 +529,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
SCREEN_PROLOGUE (pScreen, CopyWindow);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
@@ -469,7 +540,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
* Damage will take care of destination check
*/
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
- RECT_IN_REGION (pScreen, prgnSrc, &pCursorInfo->saved) != rgnOUT)
+ miRectIn(prgnSrc, &pCursorInfo->saved) != rgnOUT)
{
SPRITE_DEBUG (("CopyWindow remove\n"));
miSpriteRemoveCursor (pDev, pScreen);
@@ -490,8 +561,7 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, BlockHandler);
(*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
@@ -534,8 +604,7 @@ miSpriteInstallColormap (ColormapPtr pMap)
ScreenPtr pScreen = pMap->pScreen;
miSpriteScreenPtr pPriv;
- pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, InstallColormap);
(*pScreen->InstallColormap) (pMap);
@@ -573,8 +642,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, StoreColors);
(*pScreen->StoreColors) (pMap, ndef, pdef);
@@ -649,7 +717,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
static void
miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv = (miSpriteScreenPtr)
+ miSpriteScreenPtr pScreenPriv =
dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
CursorPtr pCursor;
xColorItem *sourceColor, *maskColor;
@@ -695,8 +763,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!pDev->isMaster && !pDev->u.master)
{
ErrorF("[mi] miSpriteRealizeCursor called for floating device.\n");
@@ -715,8 +782,7 @@ miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
miSpriteScreenPtr pScreenPriv;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor);
}
@@ -727,8 +793,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pPointer;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!pDev->isMaster && !pDev->u.master)
{
@@ -846,8 +911,7 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
miSpriteScreenPtr pScreenPriv;
CursorPtr pCursor;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!pDev->isMaster && !pDev->u.master)
{
ErrorF("[mi] miSpriteMoveCursor called for floating device.\n");
@@ -866,8 +930,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
miCursorInfoPtr pCursorInfo;
int ret = FALSE;
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = xalloc(sizeof(miCursorInfoRec));
if (!pCursorInfo)
@@ -899,8 +962,8 @@ miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
if (DevHasCursor(pDev))
{
miSpriteScreenPtr pScreenPriv;
- pScreenPriv = (miSpriteScreenPtr)
- dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,
+ miSpriteScreenKey);
(*pScreenPriv->funcs->DeviceCursorCleanup)(pDev, pScreen);
}
@@ -923,8 +986,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
return;
}
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev);
miSpriteIsDown(pCursorInfo);
@@ -964,8 +1026,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
return;
}
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);
@@ -1009,8 +1070,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
}
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);
@@ -1052,8 +1112,7 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
ErrorF("[mi] miSpriteComputeSaved called for floating device.\n");
return;
}
- pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
+ pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev);
pCursor = pCursorInfo->pCursor;
diff --git a/mi/mispritest.h b/mi/mispritest.h
deleted file mode 100644
index 232cdaffe..000000000
--- a/mi/mispritest.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * mispritest.h
- *
- * mi sprite structures
- */
-
-
-/*
-
-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 <dix-config.h>
-#endif
-
-#ifndef _MISPRITEST_H_
-#define _MISPRITEST_H_
-
-# include "misprite.h"
-#ifdef RENDER
-# include "picturestr.h"
-#endif
-# include "damage.h"
-
-typedef struct {
- CursorPtr pCursor;
- int x; /* cursor hotspot */
- int y;
- BoxRec saved; /* saved area from the screen */
- Bool isUp; /* cursor in frame buffer */
- Bool shouldBeUp; /* cursor should be displayed */
- WindowPtr pCacheWin; /* window the cursor last seen in */
- Bool isInCacheWin;
- Bool checkPixels; /* check colormap collision */
- ScreenPtr pScreen;
-} miCursorInfoRec, *miCursorInfoPtr;
-
-/*
- * per screen information
- */
-
-typedef struct {
- /* screen procedures */
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
-
- /* window procedures */
- CopyWindowProcPtr CopyWindow;
-
- /* colormap procedures */
- InstallColormapProcPtr InstallColormap;
- StoreColorsProcPtr StoreColors;
-
- /* os layer procedures */
- ScreenBlockHandlerProcPtr BlockHandler;
-
- /* device cursor procedures */
- DeviceCursorInitializeProcPtr DeviceCursorInitialize;
- DeviceCursorCleanupProcPtr DeviceCursorCleanup;
-
- xColorItem colors[2];
- ColormapPtr pInstalledMap;
- ColormapPtr pColormap;
- VisualPtr pVisual;
- miSpriteCursorFuncPtr funcs;
- DamagePtr pDamage; /* damage tracking structure */
-} miSpriteScreenRec, *miSpriteScreenPtr;
-
-#define SOURCE_COLOR 0
-#define MASK_COLOR 1
-
-/*
- * Overlap BoxPtr and Box elements
- */
-#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
- (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
- ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
-
-/*
- * Overlap BoxPtr, origins, and rectangle
- */
-#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
- BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
-
-/*
- * Overlap BoxPtr, origins and RectPtr
- */
-#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
- ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
- (int)((pRect)->width), (int)((pRect)->height))
-/*
- * Overlap BoxPtr and horizontal span
- */
-#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
-
-#define LINE_SORT(x1,y1,x2,y2) \
-{ int _t; \
- if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
- if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
-
-#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
- BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
-
-#endif /* _MISPRITEST_H_ */