summaryrefslogtreecommitdiff
path: root/mi/misprite.c
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-12-30 19:19:36 +0200
committerDaniel Stone <daniel@fooishbar.org>2010-12-31 12:52:51 +0000
commit4be2a6d1b33fac7ceb50ad1de249a1acd5a46ab0 (patch)
tree1a1295d8abfd4966cee1a6dd8990f425b09b564c /mi/misprite.c
parented8db09b4bff5c4a8d8056808368650e1876547b (diff)
mi: Add GetSpriteScreen macro to hide dixLookupPrivate
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'mi/misprite.c')
-rw-r--r--mi/misprite.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/mi/misprite.c b/mi/misprite.c
index 38a6b939a..d1cf2bb3c 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -184,6 +184,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
static DevPrivateKeyRec miSpriteScreenKeyRec;
#define miSpriteScreenKey (&miSpriteScreenKeyRec)
+#define GetSpriteScreen(pScreen) \
+ (dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey))
static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
#define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
@@ -373,9 +375,8 @@ 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;
@@ -546,11 +547,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);
@@ -591,9 +591,8 @@ static void
miSpriteInstallColormap (ColormapPtr pMap)
{
ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, InstallColormap);
(*pScreen->InstallColormap) (pMap);
@@ -624,14 +623,13 @@ 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);
(*pScreen->StoreColors) (pMap, ndef, pdef);
@@ -706,8 +704,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;
@@ -884,7 +881,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteIsDown(pCursorInfo);
@@ -922,7 +919,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);
@@ -963,7 +960,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);