mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-01 03:03:58 +00:00
devPrivates rework: since API is already broken, switch everything
over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates.
This commit is contained in:
parent
8554707326
commit
4017d31902
261 changed files with 1642 additions and 3957 deletions
|
|
@ -39,9 +39,8 @@
|
|||
pScreen->x = y;}
|
||||
#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
|
||||
|
||||
#define SCREEN_PROLOG(x) \
|
||||
pScreen->x = \
|
||||
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->x
|
||||
#define SCREEN_PROLOG(x) pScreen->x = ((RACScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->x
|
||||
#define SCREEN_EPILOG(x,y) pScreen->x = y;
|
||||
|
||||
#define WRAP_PICT_COND(x,y,cond) if (ps)\
|
||||
|
|
@ -50,9 +49,8 @@
|
|||
ps->x = y;}
|
||||
#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
|
||||
|
||||
#define PICTURE_PROLOGUE(field) \
|
||||
ps->field = \
|
||||
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->field
|
||||
#define PICTURE_PROLOGUE(field) ps->field = \
|
||||
((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->field
|
||||
#define PICTURE_EPILOGUE(field, wrap) \
|
||||
ps->field = wrap
|
||||
|
||||
|
|
@ -65,9 +63,9 @@
|
|||
#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
|
||||
|
||||
#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
|
||||
(miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;\
|
||||
RACScreenPtr pScreenPriv = \
|
||||
((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr);\
|
||||
(miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); \
|
||||
RACScreenPtr pScreenPriv = \
|
||||
((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey));\
|
||||
PointPriv->spriteFuncs = pScreenPriv->miSprite;
|
||||
#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
|
||||
PointPriv->spriteFuncs = &RACSpriteFuncs;
|
||||
|
|
@ -82,7 +80,7 @@
|
|||
(x)->ops = &RACGCOps;\
|
||||
(x)->funcs = &RACGCFuncs;
|
||||
#define GC_UNWRAP(x)\
|
||||
RACGCPtr pGCPriv = (RACGCPtr) (x)->devPrivates[RACGCIndex].ptr;\
|
||||
RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&(x)->devPrivates, RACGCKey);\
|
||||
(x)->ops = pGCPriv->wrapOps;\
|
||||
(x)->funcs = pGCPriv->wrapFuncs;
|
||||
|
||||
|
|
@ -255,9 +253,8 @@ static miPointerSpriteFuncRec RACSpriteFuncs = {
|
|||
RACSpriteMoveCursor
|
||||
};
|
||||
|
||||
static int RACScreenIndex = -1;
|
||||
static int RACGCIndex = -1;
|
||||
static unsigned long RACGeneration = 0;
|
||||
static DevPrivateKey RACScreenKey = &RACScreenKey;
|
||||
static DevPrivateKey RACGCKey = &RACGCKey;
|
||||
|
||||
|
||||
Bool
|
||||
|
|
@ -271,24 +268,17 @@ xf86RACInit(ScreenPtr pScreen, unsigned int flag)
|
|||
#endif
|
||||
|
||||
pScrn = xf86Screens[pScreen->myNum];
|
||||
PointPriv = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
|
||||
|
||||
PointPriv = (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miPointerScreenKey);
|
||||
DPRINT_S("RACInit",pScreen->myNum);
|
||||
if (RACGeneration != serverGeneration) {
|
||||
if ( ((RACScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
|
||||
((RACGCIndex = AllocateGCPrivateIndex()) < 0))
|
||||
return FALSE;
|
||||
|
||||
RACGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
if (!AllocateGCPrivate(pScreen, RACGCIndex, sizeof(RACGCRec)))
|
||||
if (!dixRequestPrivate(RACGCKey, sizeof(RACGCRec)))
|
||||
return FALSE;
|
||||
|
||||
if (!(pScreenPriv = xalloc(sizeof(RACScreenRec))))
|
||||
return FALSE;
|
||||
|
||||
pScreen->devPrivates[RACScreenIndex].ptr = (pointer)pScreenPriv;
|
||||
dixSetPrivate(&pScreen->devPrivates, RACScreenKey, pScreenPriv);
|
||||
|
||||
WRAP_SCREEN(CloseScreen, RACCloseScreen);
|
||||
WRAP_SCREEN(SaveScreen, RACSaveScreen);
|
||||
|
|
@ -327,10 +317,10 @@ static Bool
|
|||
RACCloseScreen (int i, ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
miPointerScreenPtr PointPriv
|
||||
= (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, miPointerScreenKey);
|
||||
#ifdef RENDER
|
||||
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
||||
#endif
|
||||
|
|
@ -620,8 +610,8 @@ static void
|
|||
RACAdjustFrame(int index, int x, int y, int flags)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
|
||||
DPRINT_S("RACAdjustFrame",index);
|
||||
xf86EnableAccess(xf86Screens[index]);
|
||||
|
|
@ -633,8 +623,8 @@ static Bool
|
|||
RACSwitchMode(int index, DisplayModePtr mode, int flags)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
|
||||
DPRINT_S("RACSwitchMode",index);
|
||||
xf86EnableAccess(xf86Screens[index]);
|
||||
|
|
@ -646,8 +636,8 @@ static Bool
|
|||
RACEnterVT(int index, int flags)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
|
||||
DPRINT_S("RACEnterVT",index);
|
||||
xf86EnableAccess(xf86Screens[index]);
|
||||
|
|
@ -659,8 +649,8 @@ static void
|
|||
RACLeaveVT(int index, int flags)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
|
||||
DPRINT_S("RACLeaveVT",index);
|
||||
xf86EnableAccess(xf86Screens[index]);
|
||||
|
|
@ -672,8 +662,8 @@ static void
|
|||
RACFreeScreen(int index, int flags)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
RACScreenPtr pScreenPriv =
|
||||
(RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
|
||||
RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate(
|
||||
&pScreen->devPrivates, RACScreenKey);
|
||||
|
||||
DPRINT_S("RACFreeScreen",index);
|
||||
xf86EnableAccess(xf86Screens[index]);
|
||||
|
|
@ -685,7 +675,7 @@ static Bool
|
|||
RACCreateGC(GCPtr pGC)
|
||||
{
|
||||
ScreenPtr pScreen = pGC->pScreen;
|
||||
RACGCPtr pGCPriv = (RACGCPtr) (pGC)->devPrivates[RACGCIndex].ptr;
|
||||
RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&pGC->devPrivates, RACGCKey);
|
||||
Bool ret;
|
||||
|
||||
DPRINT_S("RACCreateGC",pScreen->myNum);
|
||||
|
|
|
|||
Loading…
Reference in a new issue