aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/misprite.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
committermarha <marha@users.sourceforge.net>2012-03-26 14:23:28 +0200
commit76bcc36ed305418a3ddc5752d287ede894243e1b (patch)
treebacb320c825768471ce56f058f17ce863d592376 /xorg-server/mi/misprite.c
parent7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff)
parent0f834b91a4768673833ab4917e87d86c237bb1a6 (diff)
downloadvcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2
vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip
Merge remote-tracking branch 'origin/released'
Conflicts: pixman/pixman/pixman-mmx.c xorg-server/Xext/shm.c xorg-server/Xext/syncsrv.h xorg-server/Xext/xvmain.c xorg-server/Xi/exevents.c xorg-server/Xi/opendev.c xorg-server/composite/compalloc.c xorg-server/composite/compoverlay.c xorg-server/dix/colormap.c xorg-server/dix/devices.c xorg-server/dix/dispatch.c xorg-server/dix/dixfonts.c xorg-server/dix/eventconvert.c xorg-server/dix/events.c xorg-server/dix/gc.c xorg-server/dix/getevents.c xorg-server/dix/main.c xorg-server/dix/privates.c xorg-server/dix/registry.c xorg-server/dix/resource.c xorg-server/exa/exa_accel.c xorg-server/exa/exa_migration_classic.c xorg-server/exa/exa_unaccel.c xorg-server/fb/fb.h xorg-server/fb/fbcopy.c xorg-server/fb/fbpixmap.c xorg-server/glx/dispatch.h xorg-server/glx/glapi.h xorg-server/glx/glapi_gentable.c xorg-server/glx/glapitable.h xorg-server/glx/glprocs.h xorg-server/glx/glxcmds.c xorg-server/glx/glxcmdsswap.c xorg-server/glx/glxdricommon.c xorg-server/glx/glxdriswrast.c xorg-server/glx/glxext.c xorg-server/glx/indirect_dispatch.c xorg-server/glx/indirect_dispatch.h xorg-server/glx/indirect_dispatch_swap.c xorg-server/glx/indirect_size.h xorg-server/glx/indirect_size_get.h xorg-server/glx/indirect_table.c xorg-server/glx/indirect_util.c xorg-server/glx/rensize.c xorg-server/glx/single2swap.c xorg-server/glx/singlepix.c xorg-server/glx/singlepixswap.c xorg-server/glx/singlesize.c xorg-server/hw/dmx/dmxinit.c xorg-server/hw/kdrive/ephyr/ephyr.c xorg-server/hw/kdrive/ephyr/hostx.c xorg-server/hw/kdrive/ephyr/hostx.h xorg-server/hw/kdrive/src/kinput.c xorg-server/hw/xfree86/common/compiler.h xorg-server/hw/xwin/InitInput.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/glx/glwrap.c xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/glx/wgl_ext_api.h xorg-server/hw/xwin/glx/winpriv.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winallpriv.c xorg-server/hw/xwin/winauth.c xorg-server/hw/xwin/winclipboard.h xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/winclipboardunicode.c xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winclipboardxevents.c xorg-server/hw/xwin/wincmap.c xorg-server/hw/xwin/winconfig.c xorg-server/hw/xwin/wincreatewnd.c xorg-server/hw/xwin/wincursor.c xorg-server/hw/xwin/windialogs.c xorg-server/hw/xwin/winengine.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/wingc.c xorg-server/hw/xwin/wingetsp.c xorg-server/hw/xwin/winkeybd.c xorg-server/hw/xwin/winkeybd.h xorg-server/hw/xwin/winlayouts.h xorg-server/hw/xwin/winmisc.c xorg-server/hw/xwin/winmonitors.c xorg-server/hw/xwin/winmouse.c xorg-server/hw/xwin/winmsg.c xorg-server/hw/xwin/winmsg.h xorg-server/hw/xwin/winmultiwindowclass.c xorg-server/hw/xwin/winmultiwindowicons.c xorg-server/hw/xwin/winmultiwindowshape.c xorg-server/hw/xwin/winmultiwindowwindow.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/hw/xwin/winnativegdi.c xorg-server/hw/xwin/winpfbdd.c xorg-server/hw/xwin/winpixmap.c xorg-server/hw/xwin/winpolyline.c xorg-server/hw/xwin/winprefs.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winregistry.c xorg-server/hw/xwin/winscrinit.c xorg-server/hw/xwin/winsetsp.c xorg-server/hw/xwin/winshaddd.c xorg-server/hw/xwin/winshadddnl.c xorg-server/hw/xwin/winshadgdi.c xorg-server/hw/xwin/wintrayicon.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/hw/xwin/winwin32rootlesswindow.c xorg-server/hw/xwin/winwin32rootlesswndproc.c xorg-server/hw/xwin/winwindow.c xorg-server/hw/xwin/winwindow.h xorg-server/hw/xwin/winwindowswm.c xorg-server/hw/xwin/winwndproc.c xorg-server/include/callback.h xorg-server/include/dixstruct.h xorg-server/include/misc.h xorg-server/include/os.h xorg-server/include/scrnintstr.h xorg-server/mi/micmap.c xorg-server/mi/miinitext.c xorg-server/mi/mioverlay.c xorg-server/mi/misprite.c xorg-server/mi/mivaltree.c xorg-server/mi/miwindow.c xorg-server/miext/damage/damage.c xorg-server/miext/rootless/rootlessGC.c xorg-server/miext/rootless/rootlessWindow.c xorg-server/os/WaitFor.c xorg-server/os/access.c xorg-server/os/connection.c xorg-server/os/io.c xorg-server/os/log.c xorg-server/os/osinit.c xorg-server/os/utils.c xorg-server/os/xdmcp.c xorg-server/os/xprintf.c xorg-server/os/xstrans.c xorg-server/render/mipict.c xorg-server/xkb/xkbActions.c xorg-server/xkb/xkbInit.c xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/mi/misprite.c')
-rw-r--r--xorg-server/mi/misprite.c700
1 files changed, 316 insertions, 384 deletions
diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c
index f0c008143..db35d667e 100644
--- a/xorg-server/mi/misprite.c
+++ b/xorg-server/mi/misprite.c
@@ -53,16 +53,16 @@ in this Software without prior written authorization from The Open Group.
#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;
+ 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;
/*
@@ -71,32 +71,32 @@ typedef struct {
typedef struct {
/* screen procedures */
- CloseScreenProcPtr CloseScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
-
+ CloseScreenProcPtr CloseScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+
/* window procedures */
- CopyWindowProcPtr CopyWindow;
-
+ CopyWindowProcPtr CopyWindow;
+
/* colormap procedures */
- InstallColormapProcPtr InstallColormap;
- StoreColorsProcPtr StoreColors;
-
+ InstallColormapProcPtr InstallColormap;
+ StoreColorsProcPtr StoreColors;
+
/* os layer procedures */
- ScreenBlockHandlerProcPtr BlockHandler;
-
+ ScreenBlockHandlerProcPtr BlockHandler;
+
/* device cursor procedures */
- DeviceCursorInitializeProcPtr DeviceCursorInitialize;
- DeviceCursorCleanupProcPtr DeviceCursorCleanup;
-
- xColorItem colors[2];
- ColormapPtr pInstalledMap;
- ColormapPtr pColormap;
- VisualPtr pVisual;
- DamagePtr pDamage; /* damage tracking structure */
- Bool damageRegistered;
- int numberOfCursors;
+ DeviceCursorInitializeProcPtr DeviceCursorInitialize;
+ DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ xColorItem colors[2];
+ ColormapPtr pInstalledMap;
+ ColormapPtr pColormap;
+ VisualPtr pVisual;
+ DamagePtr pDamage; /* damage tracking structure */
+ Bool damageRegistered;
+ int numberOfCursors;
} miSpriteScreenRec, *miSpriteScreenPtr;
#define SOURCE_COLOR 0
@@ -134,7 +134,6 @@ typedef struct {
#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
#if SPRITE_DEBUG_ENABLE
#define SPRITE_DEBUG(x) ErrorF x
@@ -151,9 +150,9 @@ static void
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
if (pScreenPriv->damageRegistered) {
- DamageUnregister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
- pScreenPriv->pDamage);
- pScreenPriv->damageRegistered = 0;
+ DamageUnregister(&(pScreen->GetScreenPixmap(pScreen)->drawable),
+ pScreenPriv->pDamage);
+ pScreenPriv->damageRegistered = 0;
}
}
@@ -161,9 +160,9 @@ static void
miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{
if (!pScreenPriv->damageRegistered) {
- pScreenPriv->damageRegistered = 1;
- DamageRegister (&(pScreen->GetScreenPixmap(pScreen)->drawable),
- pScreenPriv->pDamage);
+ pScreenPriv->damageRegistered = 1;
+ DamageRegister(&(pScreen->GetScreenPixmap(pScreen)->drawable),
+ pScreenPriv->pDamage);
}
}
@@ -184,39 +183,36 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
*/
static DevPrivateKeyRec miSpriteScreenKeyRec;
+
#define miSpriteScreenKey (&miSpriteScreenKeyRec)
#define GetSpriteScreen(pScreen) \
(dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey))
static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
+
#define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
-static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
-static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
- int w, int h, unsigned int format,
- unsigned long planemask, char *pdstLine);
-static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax,
- DDXPointPtr ppt, int *pwidth, int nspans,
- char *pdstStart);
-static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
- int width, int height,
- unsigned int subWindowMode);
-static void miSpriteCopyWindow (WindowPtr pWindow,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-static void miSpriteBlockHandler(int i, pointer blockData,
- pointer pTimeout,
- pointer pReadMask);
-static void miSpriteInstallColormap(ColormapPtr pMap);
-static void miSpriteStoreColors(ColormapPtr pMap, int ndef,
- xColorItem *pdef);
-
-static void miSpriteComputeSaved(DeviceIntPtr pDev,
- ScreenPtr pScreen);
-
-static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev,
- ScreenPtr pScreen);
-static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev,
- ScreenPtr pScreen);
+static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
+static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
+ int w, int h, unsigned int format,
+ unsigned long planemask, char *pdstLine);
+static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax,
+ DDXPointPtr ppt, int *pwidth, int nspans,
+ char *pdstStart);
+static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
+ int width, int height,
+ unsigned int subWindowMode);
+static void miSpriteCopyWindow(WindowPtr pWindow,
+ DDXPointRec ptOldOrg, RegionPtr prgnSrc);
+static void miSpriteBlockHandler(int i, pointer blockData,
+ pointer pTimeout, pointer pReadMask);
+static void miSpriteInstallColormap(ColormapPtr pMap);
+static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef);
+
+static void miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen);
+
+static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev,
+ ScreenPtr pScreen);
+static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
#define SCREEN_PROLOGUE(pPriv, pScreen, field) ((pScreen)->field = \
(pPriv)->field)
@@ -249,12 +245,9 @@ miPointerSpriteFuncRec miSpritePointerFuncs = {
* other misc functions
*/
-static void miSpriteRemoveCursor(DeviceIntPtr pDev,
- ScreenPtr pScreen);
-static void miSpriteSaveUnderCursor(DeviceIntPtr pDev,
- ScreenPtr pScreen);
-static void miSpriteRestoreCursor(DeviceIntPtr pDev,
- ScreenPtr pScreen);
+static void miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
+static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
+static void miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
static void
miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
@@ -266,24 +259,21 @@ miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
}
static void
-miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
+miSpriteReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
- ScreenPtr pScreen = closure;
- miCursorInfoPtr pCursorInfo;
- DeviceIntPtr pDev;
-
- for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ ScreenPtr pScreen = closure;
+ miCursorInfoPtr pCursorInfo;
+ DeviceIntPtr pDev;
+
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
if (pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen &&
- RegionContainsRect(pRegion, &pCursorInfo->saved) != rgnOUT)
- {
+ RegionContainsRect(pRegion, &pCursorInfo->saved) != rgnOUT) {
SPRITE_DEBUG(("Damage remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
+ miSpriteRemoveCursor(pDev, pScreen);
}
}
}
@@ -296,41 +286,36 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
*/
Bool
-miSpriteInitialize (ScreenPtr pScreen,
- miPointerScreenFuncPtr screenFuncs)
+miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
{
- miSpriteScreenPtr pScreenPriv;
- VisualPtr pVisual;
+ miSpriteScreenPtr pScreenPriv;
+ VisualPtr pVisual;
- if (!DamageSetup (pScreen))
- return FALSE;
+ if (!DamageSetup(pScreen))
+ return FALSE;
if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0))
- return FALSE;
+ return FALSE;
- if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
- return FALSE;
+ if (!dixRegisterPrivateKey
+ (&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
+ return FALSE;
- pScreenPriv = malloc(sizeof (miSpriteScreenRec));
+ pScreenPriv = malloc(sizeof(miSpriteScreenRec));
if (!pScreenPriv)
- return FALSE;
-
- pScreenPriv->pDamage = DamageCreate (miSpriteReportDamage,
- NULL,
- DamageReportRawRegion,
- TRUE,
- pScreen,
- pScreen);
-
- if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
- {
- free(pScreenPriv);
- return FALSE;
+ return FALSE;
+
+ pScreenPriv->pDamage = DamageCreate(miSpriteReportDamage,
+ NULL,
+ DamageReportRawRegion,
+ TRUE, pScreen, pScreen);
+
+ if (!miPointerInitialize(pScreen, &miSpritePointerFuncs, screenFuncs, TRUE)) {
+ free(pScreenPriv);
+ return FALSE;
}
for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
+ pVisual->vid != pScreen->rootVisual; pVisual++);
pScreenPriv->pVisual = pVisual;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreenPriv->GetImage = pScreen->GetImage;
@@ -382,9 +367,9 @@ miSpriteInitialize (ScreenPtr pScreen,
*/
static Bool
-miSpriteCloseScreen (int i, ScreenPtr pScreen)
+miSpriteCloseScreen(int i, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
+ miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
pScreen->GetImage = pScreenPriv->GetImage;
@@ -393,7 +378,7 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
pScreen->InstallColormap = pScreenPriv->InstallColormap;
pScreen->StoreColors = pScreenPriv->StoreColors;
- DamageDestroy (pScreenPriv->pDamage);
+ DamageDestroy(pScreenPriv->pDamage);
free(pScreenPriv);
@@ -401,80 +386,66 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
}
static void
-miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planemask,
- char *pdstLine)
+miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planemask, char *pdstLine)
{
- ScreenPtr pScreen = pDrawable->pScreen;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
-
- SCREEN_PROLOGUE (pPriv, pScreen, GetImage);
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- 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,
- sx, sy, w, h))
- {
- SPRITE_DEBUG (("GetImage remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
- }
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+
+ SCREEN_PROLOGUE(pPriv, pScreen, GetImage);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ 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,
+ sx, sy, w, h)) {
+ SPRITE_DEBUG(("GetImage remove\n"));
+ miSpriteRemoveCursor(pDev, pScreen);
+ }
}
}
}
- (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
- format, planemask, pdstLine);
+ (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
- SCREEN_EPILOGUE (pPriv, pScreen, GetImage);
+ SCREEN_EPILOGUE(pPriv, pScreen, GetImage);
}
static void
-miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
- int *pwidth, int nspans, char *pdstStart)
+miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
+ int *pwidth, int nspans, char *pdstStart)
{
- ScreenPtr pScreen = pDrawable->pScreen;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
-
- SCREEN_PROLOGUE (pPriv, pScreen, GetSpans);
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+
+ SCREEN_PROLOGUE(pPriv, pScreen, GetSpans);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
- if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
- {
- DDXPointPtr pts;
- int *widths;
- int nPts;
- int xorg,
- yorg;
+ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) {
+ 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++)
- {
- if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
- pts->x+xorg,*widths))
- {
- SPRITE_DEBUG (("GetSpans remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
+ nPts--; pts++, widths++) {
+ if (SPN_OVERLAP(&pCursorInfo->saved, pts->y + yorg,
+ pts->x + xorg, *widths)) {
+ SPRITE_DEBUG(("GetSpans remove\n"));
+ miSpriteRemoveCursor(pDev, pScreen);
break;
}
}
@@ -485,110 +456,96 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- SCREEN_EPILOGUE (pPriv, pScreen, GetSpans);
+ SCREEN_EPILOGUE(pPriv, pScreen, GetSpans);
}
static void
-miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
- int height, unsigned int subWindowMode)
+miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
+ int height, unsigned int subWindowMode)
{
- ScreenPtr pScreen = pDrawable->pScreen;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
-
- SCREEN_PROLOGUE (pPriv, pScreen, SourceValidate);
-
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
- pCursorInfo = MISPRITE(pDev);
- if (pCursorInfo && 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);
- }
- }
- }
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+
+ SCREEN_PROLOGUE(pPriv, pScreen, SourceValidate);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
+ pCursorInfo = MISPRITE(pDev);
+ if (pCursorInfo && 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)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height, subWindowMode);
+ (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+ subWindowMode);
- SCREEN_EPILOGUE (pPriv, pScreen, SourceValidate);
+ SCREEN_EPILOGUE(pPriv, pScreen, SourceValidate);
}
static void
-miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE (pPriv, pScreen, CopyWindow);
+ SCREEN_PROLOGUE(pPriv, pScreen, CopyWindow);
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
/*
* Damage will take care of destination check
*/
if (pCursorInfo && pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
- RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT)
- {
- SPRITE_DEBUG (("CopyWindow remove\n"));
- miSpriteRemoveCursor (pDev, pScreen);
+ RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT) {
+ SPRITE_DEBUG(("CopyWindow remove\n"));
+ miSpriteRemoveCursor(pDev, pScreen);
}
}
}
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
- SCREEN_EPILOGUE (pPriv, pScreen, CopyWindow);
+ SCREEN_EPILOGUE(pPriv, pScreen, CopyWindow);
}
static void
-miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
- pointer pReadmask)
+miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout,
+ pointer pReadmask)
{
- ScreenPtr pScreen = screenInfo.screens[i];
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- Bool WorkToDo = FALSE;
-
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ Bool WorkToDo = FALSE;
+
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
if (pCursorInfo && !pCursorInfo->isUp
- && pCursorInfo->pScreen == pScreen
- && pCursorInfo->shouldBeUp)
- {
- SPRITE_DEBUG (("BlockHandler save"));
- miSpriteSaveUnderCursor (pDev, pScreen);
+ && pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) {
+ SPRITE_DEBUG(("BlockHandler save"));
+ miSpriteSaveUnderCursor(pDev, pScreen);
}
}
}
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
if (pCursorInfo && !pCursorInfo->isUp &&
- pCursorInfo->pScreen == pScreen &&
- pCursorInfo->shouldBeUp)
- {
- SPRITE_DEBUG (("BlockHandler restore\n"));
- miSpriteRestoreCursor (pDev, pScreen);
+ pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) {
+ SPRITE_DEBUG(("BlockHandler restore\n"));
+ miSpriteRestoreCursor(pDev, pScreen);
if (!pCursorInfo->isUp)
WorkToDo = TRUE;
}
@@ -606,10 +563,10 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
}
static void
-miSpriteInstallColormap (ColormapPtr pMap)
+miSpriteInstallColormap(ColormapPtr pMap)
{
- ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+ ScreenPtr pScreen = pMap->pScreen;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
SCREEN_PROLOGUE(pPriv, pScreen, InstallColormap);
@@ -619,14 +576,12 @@ miSpriteInstallColormap (ColormapPtr pMap)
/* InstallColormap can be called before devices are initialized. */
pPriv->pInstalledMap = pMap;
- if (pPriv->pColormap != pMap)
- {
+ if (pPriv->pColormap != pMap) {
DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
- for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ miCursorInfoPtr pCursorInfo;
+
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
if (pCursorInfo)
{
@@ -641,15 +596,15 @@ miSpriteInstallColormap (ColormapPtr pMap)
}
static void
-miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
+miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef)
{
- ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- int i;
- int updated;
- VisualPtr pVisual;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
+ ScreenPtr pScreen = pMap->pScreen;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
+ int i;
+ int updated;
+ VisualPtr pVisual;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
SCREEN_PROLOGUE(pPriv, pScreen, StoreColors);
@@ -657,12 +612,10 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
SCREEN_EPILOGUE(pPriv, pScreen, StoreColors);
- if (pPriv->pColormap == pMap)
- {
+ if (pPriv->pColormap == pMap) {
updated = 0;
pVisual = pMap->pVisual;
- if (pVisual->class == DirectColor)
- {
+ if (pVisual->class == DirectColor) {
/* Direct color - match on any of the subfields */
#define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask)))
@@ -679,43 +632,33 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
UpdateDAC(dev, plane,green,greenMask) \
UpdateDAC(dev, plane,blue,blueMask)
- for (i = 0; i < ndef; i++)
- {
- CheckDirect (pPriv, SOURCE_COLOR)
- CheckDirect (pPriv, MASK_COLOR)
+ for (i = 0; i < ndef; i++) {
+ CheckDirect(pPriv, SOURCE_COLOR)
+ CheckDirect(pPriv, MASK_COLOR)
}
}
- else
- {
+ else {
/* PseudoColor/GrayScale - match on exact pixel */
- for (i = 0; i < ndef; i++)
- {
- if (pdef[i].pixel ==
- pPriv->colors[SOURCE_COLOR].pixel)
- {
+ for (i = 0; i < ndef; i++) {
+ if (pdef[i].pixel == pPriv->colors[SOURCE_COLOR].pixel) {
pPriv->colors[SOURCE_COLOR] = pdef[i];
if (++updated == 2)
break;
}
- if (pdef[i].pixel ==
- pPriv->colors[MASK_COLOR].pixel)
- {
+ if (pdef[i].pixel == pPriv->colors[MASK_COLOR].pixel) {
pPriv->colors[MASK_COLOR] = pdef[i];
if (++updated == 2)
break;
}
}
}
- if (updated)
- {
- for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
- {
- if (DevHasCursor(pDev))
- {
+ if (updated) {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
+ if (DevHasCursor(pDev)) {
pCursorInfo = MISPRITE(pDev);
pCursorInfo->checkPixels = TRUE;
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
- miSpriteRemoveCursor (pDev, pScreen);
+ miSpriteRemoveCursor(pDev, pScreen);
}
}
}
@@ -723,35 +666,34 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
}
static void
-miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
+miSpriteFindColors(miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
- CursorPtr pCursor;
- xColorItem *sourceColor, *maskColor;
+ miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
+ CursorPtr pCursor;
+ xColorItem *sourceColor, *maskColor;
pCursor = pDevCursor->pCursor;
sourceColor = &pScreenPriv->colors[SOURCE_COLOR];
maskColor = &pScreenPriv->colors[MASK_COLOR];
if (pScreenPriv->pColormap != pScreenPriv->pInstalledMap ||
- !(pCursor->foreRed == sourceColor->red &&
- pCursor->foreGreen == sourceColor->green &&
+ !(pCursor->foreRed == sourceColor->red &&
+ pCursor->foreGreen == sourceColor->green &&
pCursor->foreBlue == sourceColor->blue &&
- pCursor->backRed == maskColor->red &&
- pCursor->backGreen == maskColor->green &&
- pCursor->backBlue == maskColor->blue))
- {
- pScreenPriv->pColormap = pScreenPriv->pInstalledMap;
- sourceColor->red = pCursor->foreRed;
- sourceColor->green = pCursor->foreGreen;
- sourceColor->blue = pCursor->foreBlue;
- FakeAllocColor (pScreenPriv->pColormap, sourceColor);
- maskColor->red = pCursor->backRed;
- maskColor->green = pCursor->backGreen;
- maskColor->blue = pCursor->backBlue;
- FakeAllocColor (pScreenPriv->pColormap, maskColor);
- /* "free" the pixels right away, don't let this confuse you */
- FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel);
- FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel);
+ pCursor->backRed == maskColor->red &&
+ pCursor->backGreen == maskColor->green &&
+ pCursor->backBlue == maskColor->blue)) {
+ pScreenPriv->pColormap = pScreenPriv->pInstalledMap;
+ sourceColor->red = pCursor->foreRed;
+ sourceColor->green = pCursor->foreGreen;
+ sourceColor->blue = pCursor->foreBlue;
+ FakeAllocColor(pScreenPriv->pColormap, sourceColor);
+ maskColor->red = pCursor->backRed;
+ maskColor->green = pCursor->backGreen;
+ maskColor->blue = pCursor->backBlue;
+ FakeAllocColor(pScreenPriv->pColormap, maskColor);
+ /* "free" the pixels right away, don't let this confuse you */
+ FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel);
+ FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel);
}
pDevCursor->checkPixels = FALSE;
@@ -765,7 +707,7 @@ miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
#define SPRITE_PAD 8
static Bool
-miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
+miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
miCursorInfoPtr pCursorInfo;
@@ -775,7 +717,7 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
pCursorInfo = MISPRITE(pDev);
if (pCursor == pCursorInfo->pCursor)
- pCursorInfo->checkPixels = TRUE;
+ pCursorInfo->checkPixels = TRUE;
return miDCRealizeCursor(pScreen, pCursor);
}
@@ -787,11 +729,11 @@ miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
}
static void
-miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCursor, int x, int y)
+miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCursor, int x, int y)
{
- miCursorInfoPtr pPointer;
- miSpriteScreenPtr pScreenPriv;
+ miCursorInfoPtr pPointer;
+ miSpriteScreenPtr pScreenPriv;
if (IsFloating(pDev))
return;
@@ -799,55 +741,50 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pPointer = MISPRITE(pDev);
pScreenPriv = GetSpriteScreen(pScreen);
- if (!pCursor)
- {
- if (pPointer->shouldBeUp)
- --pScreenPriv->numberOfCursors;
- pPointer->shouldBeUp = FALSE;
- if (pPointer->isUp)
- miSpriteRemoveCursor (pDev, pScreen);
- if (pScreenPriv->numberOfCursors == 0)
- miSpriteDisableDamage(pScreen, pScreenPriv);
- pPointer->pCursor = 0;
- return;
+ if (!pCursor) {
+ if (pPointer->shouldBeUp)
+ --pScreenPriv->numberOfCursors;
+ pPointer->shouldBeUp = FALSE;
+ if (pPointer->isUp)
+ miSpriteRemoveCursor(pDev, pScreen);
+ if (pScreenPriv->numberOfCursors == 0)
+ miSpriteDisableDamage(pScreen, pScreenPriv);
+ pPointer->pCursor = 0;
+ return;
}
if (!pPointer->shouldBeUp)
- pScreenPriv->numberOfCursors++;
+ pScreenPriv->numberOfCursors++;
pPointer->shouldBeUp = TRUE;
if (!pPointer->isUp)
- miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
+ miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
if (pPointer->x == x &&
- pPointer->y == y &&
- pPointer->pCursor == pCursor &&
- !pPointer->checkPixels)
- {
- return;
+ pPointer->y == y &&
+ pPointer->pCursor == pCursor && !pPointer->checkPixels) {
+ return;
}
pPointer->x = x;
pPointer->y = y;
pPointer->pCacheWin = NullWindow;
- if (pPointer->checkPixels || pPointer->pCursor != pCursor)
- {
- pPointer->pCursor = pCursor;
- miSpriteFindColors (pPointer, pScreen);
+ if (pPointer->checkPixels || pPointer->pCursor != pCursor) {
+ pPointer->pCursor = pCursor;
+ miSpriteFindColors(pPointer, pScreen);
}
if (pPointer->isUp) {
- /* TODO: reimplement flicker-free MoveCursor */
- SPRITE_DEBUG (("SetCursor remove %d\n", pDev->id));
- miSpriteRemoveCursor (pDev, pScreen);
+ /* TODO: reimplement flicker-free MoveCursor */
+ SPRITE_DEBUG(("SetCursor remove %d\n", pDev->id));
+ miSpriteRemoveCursor(pDev, pScreen);
}
- if (!pPointer->isUp && pPointer->pCursor)
- {
- SPRITE_DEBUG (("SetCursor restore %d\n", pDev->id));
+ if (!pPointer->isUp && pPointer->pCursor) {
+ SPRITE_DEBUG(("SetCursor restore %d\n", pDev->id));
miSpriteSaveUnderCursor(pDev, pScreen);
- miSpriteRestoreCursor (pDev, pScreen);
+ miSpriteRestoreCursor(pDev, pScreen);
}
}
static void
-miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
+miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
CursorPtr pCursor;
@@ -856,19 +793,19 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
pCursor = MISPRITE(pDev)->pCursor;
- miSpriteSetCursor (pDev, pScreen, pCursor, x, y);
+ miSpriteSetCursor(pDev, pScreen, pCursor, x, y);
}
-
static Bool
miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
int ret = miDCDeviceInitialize(pDev, pScreen);
- if (ret)
- {
+ if (ret) {
miCursorInfoPtr pCursorInfo;
- pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+
+ pCursorInfo =
+ dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
pCursorInfo->pCursor = NULL;
pCursorInfo->x = 0;
pCursorInfo->y = 0;
@@ -886,7 +823,8 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
static void
miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+ miCursorInfoPtr pCursorInfo =
+ dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
if (DevHasCursor(pDev))
miDCDeviceCleanup(pDev, pScreen);
@@ -899,16 +837,15 @@ miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
*/
static void
-miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
+miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
- miCursorInfoPtr pCursorInfo;
-
+ miSpriteScreenPtr pScreenPriv;
+ miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
return;
- DamageDrawInternal (pScreen, TRUE);
+ DamageDrawInternal(pScreen, TRUE);
pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
@@ -923,12 +860,11 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->saved.x2 -
pCursorInfo->saved.x1,
pCursorInfo->saved.y2 -
- pCursorInfo->saved.y1))
- {
+ pCursorInfo->saved.y1)) {
miSpriteIsUp(pCursorInfo);
}
miSpriteEnableDamage(pScreen, pScreenPriv);
- DamageDrawInternal (pScreen, FALSE);
+ DamageDrawInternal(pScreen, FALSE);
}
/*
@@ -939,17 +875,17 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
static void
miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
- miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pScreenPriv;
+ miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
return;
- DamageDrawInternal (pScreen, TRUE);
+ DamageDrawInternal(pScreen, TRUE);
pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
- miSpriteComputeSaved (pDev, pScreen);
+ miSpriteComputeSaved(pDev, pScreen);
miSpriteDisableDamage(pScreen, pScreenPriv);
@@ -959,53 +895,50 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->saved.y1,
pCursorInfo->saved.x2 -
pCursorInfo->saved.x1,
- pCursorInfo->saved.y2 -
- pCursorInfo->saved.y1);
+ pCursorInfo->saved.y2 - pCursorInfo->saved.y1);
SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id));
miSpriteEnableDamage(pScreen, pScreenPriv);
- DamageDrawInternal (pScreen, FALSE);
+ DamageDrawInternal(pScreen, FALSE);
}
-
/*
* Called from the block handler, restores the cursor
* before waiting for something to do.
*/
static void
-miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
+miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
- int x, y;
- CursorPtr pCursor;
- miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pScreenPriv;
+ int x, y;
+ CursorPtr pCursor;
+ miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
return;
- DamageDrawInternal (pScreen, TRUE);
+ DamageDrawInternal(pScreen, TRUE);
pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
- miSpriteComputeSaved (pDev, pScreen);
+ miSpriteComputeSaved(pDev, pScreen);
pCursor = pCursorInfo->pCursor;
- x = pCursorInfo->x - (int)pCursor->bits->xhot;
- y = pCursorInfo->y - (int)pCursor->bits->yhot;
+ x = pCursorInfo->x - (int) pCursor->bits->xhot;
+ y = pCursorInfo->y - (int) pCursor->bits->yhot;
miSpriteDisableDamage(pScreen, pScreenPriv);
SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id));
if (pCursorInfo->checkPixels)
- miSpriteFindColors (pCursorInfo, pScreen);
+ miSpriteFindColors(pCursorInfo, pScreen);
if (miDCPutUpCursor(pDev, pScreen,
- pCursor, x, y,
- pScreenPriv->colors[SOURCE_COLOR].pixel,
- pScreenPriv->colors[MASK_COLOR].pixel))
- {
+ pCursor, x, y,
+ pScreenPriv->colors[SOURCE_COLOR].pixel,
+ pScreenPriv->colors[MASK_COLOR].pixel)) {
miSpriteIsUp(pCursorInfo);
pCursorInfo->pScreen = pScreen;
}
miSpriteEnableDamage(pScreen, pScreenPriv);
- DamageDrawInternal (pScreen, FALSE);
+ DamageDrawInternal(pScreen, FALSE);
}
/*
@@ -1013,11 +946,11 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
*/
static void
-miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
+miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen)
{
- int x, y, w, h;
- int wpad, hpad;
- CursorPtr pCursor;
+ int x, y, w, h;
+ int wpad, hpad;
+ CursorPtr pCursor;
miCursorInfoPtr pCursorInfo;
if (IsFloating(pDev))
@@ -1026,8 +959,8 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo = MISPRITE(pDev);
pCursor = pCursorInfo->pCursor;
- x = pCursorInfo->x - (int)pCursor->bits->xhot;
- y = pCursorInfo->y - (int)pCursor->bits->yhot;
+ x = pCursorInfo->x - (int) pCursor->bits->xhot;
+ y = pCursorInfo->y - (int) pCursor->bits->yhot;
w = pCursor->bits->width;
h = pCursor->bits->height;
wpad = SPRITE_PAD;
@@ -1037,4 +970,3 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->saved.x2 = pCursorInfo->saved.x1 + w + wpad * 2;
pCursorInfo->saved.y2 = pCursorInfo->saved.y1 + h + hpad * 2;
}
-