aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/misprite.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-20 15:26:41 +0000
committermarha <marha@users.sourceforge.net>2010-05-20 15:26:41 +0000
commitf5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23 (patch)
treec76e9cb708483e65b114c08ed008880f478cae15 /xorg-server/mi/misprite.c
parentb16c0295c9f95426980d567e93ae00c52545b3fa (diff)
parent3319741e6f9fc3232eb40462a261271b9af2dcb2 (diff)
downloadvcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.tar.gz
vcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.tar.bz2
vcxsrv-f5fb2d27f1fd4976f0e77d97461a5e57ba6c9a23.zip
svn merge "^/branches/released" .
Diffstat (limited to 'xorg-server/mi/misprite.c')
-rw-r--r--xorg-server/mi/misprite.c86
1 files changed, 24 insertions, 62 deletions
diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c
index a7041b8ba..7dce00672 100644
--- a/xorg-server/mi/misprite.c
+++ b/xorg-server/mi/misprite.c
@@ -94,7 +94,6 @@ typedef struct {
ColormapPtr pInstalledMap;
ColormapPtr pColormap;
VisualPtr pVisual;
- miSpriteCursorFuncPtr funcs;
DamagePtr pDamage; /* damage tracking structure */
Bool damageRegistered;
} miSpriteScreenRec, *miSpriteScreenPtr;
@@ -258,12 +257,9 @@ static void
miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
ScreenPtr pScreen = closure;
- miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
DeviceIntPtr pDev;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
-
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (DevHasCursor(pDev))
@@ -289,7 +285,6 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
Bool
miSpriteInitialize (ScreenPtr pScreen,
- miSpriteCursorFuncPtr cursorFuncs,
miPointerScreenFuncPtr screenFuncs)
{
miSpriteScreenPtr pScreenPriv;
@@ -336,7 +331,6 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->pInstalledMap = NULL;
pScreenPriv->pColormap = NULL;
- pScreenPriv->funcs = cursorFuncs;
pScreenPriv->colors[SOURCE_COLOR].red = 0;
pScreenPriv->colors[SOURCE_COLOR].green = 0;
pScreenPriv->colors[SOURCE_COLOR].blue = 0;
@@ -397,7 +391,6 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
char *pdstLine)
{
ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
@@ -405,7 +398,6 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
if (pDrawable->type == DRAWABLE_WINDOW)
{
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (DevHasCursor(pDev))
@@ -433,7 +425,6 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
int *pwidth, int nspans, char *pdstStart)
{
ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
@@ -441,8 +432,6 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
if (pDrawable->type == DRAWABLE_WINDOW)
{
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
-
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (DevHasCursor(pDev))
@@ -487,7 +476,6 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
int height)
{
ScreenPtr pScreen = pDrawable->pScreen;
- miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
@@ -495,8 +483,6 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
if (pDrawable->type == DRAWABLE_WINDOW)
{
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
-
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (DevHasCursor(pDev))
@@ -523,14 +509,11 @@ static void
miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
ScreenPtr pScreen = pWindow->drawable.pScreen;
- miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
SCREEN_PROLOGUE (pScreen, CopyWindow);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
-
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
if (DevHasCursor(pDev))
@@ -763,10 +746,8 @@ miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
static Bool
miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
- miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!IsMaster(pDev) && !pDev->u.master)
return FALSE;
@@ -775,27 +756,21 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
if (pCursor == pCursorInfo->pCursor)
pCursorInfo->checkPixels = TRUE;
- return (*pScreenPriv->funcs->RealizeCursor) (pScreen, pCursor);
+ return miDCRealizeCursor(pScreen, pCursor);
}
static Bool
miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
- miSpriteScreenPtr pScreenPriv;
-
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
- return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor);
+ return miDCUnrealizeCursor(pScreen, pCursor);
}
static void
miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y)
{
- miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pPointer;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
-
if (!IsMaster(pDev) && !pDev->u.master)
return;
@@ -864,7 +839,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pointer->saved.y1 -= dy;
pointer->saved.x2 -= dx;
pointer->saved.y2 -= dy;
- (void) (*pScreenPriv->funcs->ChangeSave) (pScreen,
+ (void) miDCChangeSave(pScreen,
pointer->saved.x1,
pointer->saved.y1,
pointer->saved.x2 -
@@ -873,7 +848,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pointer->saved.y1,
dx, dy);
}
- (void) (*pScreenPriv->funcs->MoveCursor) (pScreen, pCursor,
+ (void) miDCMoveCursor(pScreen, pCursor,
pointer->saved.x1,
pointer->saved.y1,
pointer->saved.x2 -
@@ -907,10 +882,8 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
static void
miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
- miSpriteScreenPtr pScreenPriv;
CursorPtr pCursor;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!IsMaster(pDev) && !pDev->u.master)
return;
@@ -923,12 +896,9 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
static Bool
miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo;
int ret = FALSE;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
-
pCursorInfo = malloc(sizeof(miCursorInfoRec));
if (!pCursorInfo)
return FALSE;
@@ -943,7 +913,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->checkPixels = TRUE;
pCursorInfo->pScreen = FALSE;
- ret = (*pScreenPriv->funcs->DeviceCursorInitialize)(pDev, pScreen);
+ ret = miDCDeviceInitialize(pDev, pScreen);
if (!ret)
{
free(pCursorInfo);
@@ -957,13 +927,7 @@ static void
miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
if (DevHasCursor(pDev))
- {
- miSpriteScreenPtr pScreenPriv;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,
- miSpriteScreenKey);
-
- (*pScreenPriv->funcs->DeviceCursorCleanup)(pDev, pScreen);
- }
+ miDCDeviceCleanup(pDev, pScreen);
}
/*
@@ -987,16 +951,16 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
miSpriteIsDown(pCursorInfo);
pCursorInfo->pCacheWin = NullWindow;
miSpriteDisableDamage(pScreen, pScreenPriv);
- if (!(*pScreenPriv->funcs->RestoreUnderCursor) (pDev,
- pScreen,
- pCursorInfo->saved.x1,
- pCursorInfo->saved.y1,
- pCursorInfo->saved.x2 -
- pCursorInfo->saved.x1,
- pCursorInfo->saved.y2 -
- pCursorInfo->saved.y1))
+ if (!miDCRestoreUnderCursor(pDev,
+ pScreen,
+ pCursorInfo->saved.x1,
+ pCursorInfo->saved.y1,
+ pCursorInfo->saved.x2 -
+ pCursorInfo->saved.x1,
+ pCursorInfo->saved.y2 -
+ pCursorInfo->saved.y1))
{
- miSpriteIsUp(pCursorInfo);
+ miSpriteIsUp(pCursorInfo);
}
miSpriteEnableDamage(pScreen, pScreenPriv);
DamageDrawInternal (pScreen, FALSE);
@@ -1029,14 +993,14 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
y = pCursorInfo->y - (int)pCursor->bits->yhot;
miSpriteDisableDamage(pScreen, pScreenPriv);
- (*pScreenPriv->funcs->SaveUnderCursor) (pDev,
- pScreen,
- pCursorInfo->saved.x1,
- pCursorInfo->saved.y1,
- pCursorInfo->saved.x2 -
- pCursorInfo->saved.x1,
- pCursorInfo->saved.y2 -
- pCursorInfo->saved.y1);
+ miDCSaveUnderCursor(pDev,
+ pScreen,
+ pCursorInfo->saved.x1,
+ pCursorInfo->saved.y1,
+ pCursorInfo->saved.x2 -
+ pCursorInfo->saved.x1,
+ pCursorInfo->saved.y2 -
+ pCursorInfo->saved.y1);
SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id));
miSpriteEnableDamage(pScreen, pScreenPriv);
DamageDrawInternal (pScreen, FALSE);
@@ -1072,7 +1036,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id));
if (pCursorInfo->checkPixels)
miSpriteFindColors (pCursorInfo, pScreen);
- if ((*pScreenPriv->funcs->PutUpCursor) (pDev, pScreen,
+ if (miDCPutUpCursor(pDev, pScreen,
pCursor, x, y,
pScreenPriv->colors[SOURCE_COLOR].pixel,
pScreenPriv->colors[MASK_COLOR].pixel))
@@ -1091,7 +1055,6 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
static void
miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
int x, y, w, h;
int wpad, hpad;
CursorPtr pCursor;
@@ -1100,7 +1063,6 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
if (!IsMaster(pDev) && !pDev->u.master)
return;
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev);
pCursor = pCursorInfo->pCursor;