Alloc sprite memory in devices' devPrivates, allow undisplaying cursors.

Improve memory usage by allocating the sprite's memory only to devices that
actually have a sprite and provide means to remove a device's cursor from the
screen (more hotplugging, yay!).
This commit breaks ScreenRec's ABI.
This commit is contained in:
Peter Hutterer 2007-04-09 19:31:59 +09:30
commit f1f8b562aa
12 changed files with 442 additions and 291 deletions

View file

@ -424,6 +424,10 @@ extern int DeliverDeviceEvents(
extern void DefineInitialRootWindow(
WindowPtr /* win */);
extern void SetupSprite(
DeviceIntPtr /* pDev */,
ScreenPtr /* pScreen */);
extern void InitializeSprite(
DeviceIntPtr /* pDev */,
WindowPtr /* pWin */);

View file

@ -190,6 +190,8 @@ extern int InitAndStartDevices(void);
extern void CloseDownDevices(void);
extern void UndisplayDevices(void);
extern int RemoveDevice(
DeviceIntPtr /*dev*/);

View file

@ -431,6 +431,18 @@ typedef void (* MarkUnrealizedWindowProcPtr)(
WindowPtr /*pWin*/,
Bool /*fromConfigure*/);
typedef void (* UndisplayCursorProcPtr)(
DeviceIntPtr /* pDev */,
ScreenPtr /* pScreen */);
typedef Bool (* DeviceCursorInitializeProcPtr)(
DeviceIntPtr /* pDev */,
ScreenPtr /* pScreen */);
typedef void (* DeviceCursorCleanupProcPtr)(
DeviceIntPtr /* pDev */,
ScreenPtr /* pScreen */);
typedef struct _Screen {
int myNum; /* index of this instance in Screens[] */
ATOM id;
@ -587,6 +599,10 @@ typedef struct _Screen {
ChangeBorderWidthProcPtr ChangeBorderWidth;
MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
/* Device cursor procedures */
UndisplayCursorProcPtr UndisplayCursor;
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
} ScreenRec;
typedef struct _ScreenInfo {