dbe: Fold the window private private into the window private
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
1489637d56
commit
dbe10ef0e3
|
@ -9,5 +9,4 @@ endif
|
||||||
libdbe_la_SOURCES = \
|
libdbe_la_SOURCES = \
|
||||||
dbe.c \
|
dbe.c \
|
||||||
midbe.c \
|
midbe.c \
|
||||||
midbe.h \
|
midbe.h
|
||||||
midbestr.h
|
|
||||||
|
|
|
@ -229,8 +229,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
||||||
* Allocate a window priv.
|
* Allocate a window priv.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pDbeWindowPriv =
|
pDbeWindowPriv = calloc(1, sizeof(DbeWindowPrivRec));
|
||||||
dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW);
|
|
||||||
if (!pDbeWindowPriv)
|
if (!pDbeWindowPriv)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
@ -1222,7 +1221,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* We are done with the window priv. */
|
/* We are done with the window priv. */
|
||||||
dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW);
|
free(pDbeWindowPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -143,6 +143,20 @@ typedef struct _DbeWindowPrivRec {
|
||||||
*/
|
*/
|
||||||
XID initIDs[DBE_INIT_MAX_IDS];
|
XID initIDs[DBE_INIT_MAX_IDS];
|
||||||
|
|
||||||
|
/* Pointer to a drawable that contains the contents of the back buffer.
|
||||||
|
*/
|
||||||
|
PixmapPtr pBackBuffer;
|
||||||
|
|
||||||
|
/* Pointer to a drawable that contains the contents of the front buffer.
|
||||||
|
* This pointer is only used for the XdbeUntouched swap action. For that
|
||||||
|
* swap action, we need to copy the front buffer (window) contents into
|
||||||
|
* this drawable, copy the contents of current back buffer drawable (the
|
||||||
|
* back buffer) into the window, swap the front and back drawable pointers,
|
||||||
|
* and then swap the drawable/resource associations in the resource
|
||||||
|
* database.
|
||||||
|
*/
|
||||||
|
PixmapPtr pFrontBuffer;
|
||||||
|
|
||||||
/* Device-specific private information.
|
/* Device-specific private information.
|
||||||
*/
|
*/
|
||||||
PrivateRec *devPrivates;
|
PrivateRec *devPrivates;
|
||||||
|
|
99
dbe/midbe.c
99
dbe/midbe.c
|
@ -48,7 +48,6 @@
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "dbestruct.h"
|
#include "dbestruct.h"
|
||||||
#include "midbestr.h"
|
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
@ -57,9 +56,6 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static DevPrivateKeyRec miDbeWindowPrivPrivKeyRec;
|
|
||||||
|
|
||||||
#define miDbeWindowPrivPrivKey (&miDbeWindowPrivPrivKeyRec)
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -138,7 +134,6 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
DbeWindowPrivPtr pDbeWindowPriv;
|
DbeWindowPrivPtr pDbeWindowPriv;
|
||||||
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
|
|
||||||
DbeScreenPrivPtr pDbeScreenPriv;
|
DbeScreenPrivPtr pDbeScreenPriv;
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
xRectangle clearRect;
|
xRectangle clearRect;
|
||||||
|
@ -156,12 +151,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
|
|
||||||
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
|
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
/* Setup the window priv priv. */
|
|
||||||
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
|
|
||||||
pDbeWindowPrivPriv->pDbeWindowPriv = pDbeWindowPriv;
|
|
||||||
|
|
||||||
/* Get a front pixmap. */
|
/* Get a front pixmap. */
|
||||||
if (!(pDbeWindowPrivPriv->pFrontBuffer =
|
if (!(pDbeWindowPriv->pFrontBuffer =
|
||||||
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
|
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
|
||||||
pDbeWindowPriv->height,
|
pDbeWindowPriv->height,
|
||||||
pWin->drawable.depth, 0))) {
|
pWin->drawable.depth, 0))) {
|
||||||
|
@ -169,22 +160,22 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a back pixmap. */
|
/* Get a back pixmap. */
|
||||||
if (!(pDbeWindowPrivPriv->pBackBuffer =
|
if (!(pDbeWindowPriv->pBackBuffer =
|
||||||
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
|
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
|
||||||
pDbeWindowPriv->height,
|
pDbeWindowPriv->height,
|
||||||
pWin->drawable.depth, 0))) {
|
pWin->drawable.depth, 0))) {
|
||||||
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer);
|
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Security creation/labeling check. */
|
/* Security creation/labeling check. */
|
||||||
rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId,
|
rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId,
|
||||||
dbeDrawableResType, pDbeWindowPrivPriv->pBackBuffer,
|
dbeDrawableResType, pDbeWindowPriv->pBackBuffer,
|
||||||
RT_WINDOW, pWin, DixCreateAccess);
|
RT_WINDOW, pWin, DixCreateAccess);
|
||||||
|
|
||||||
/* Make the back pixmap a DBE drawable resource. */
|
/* Make the back pixmap a DBE drawable resource. */
|
||||||
if (rc != Success || !AddResource(bufId, dbeDrawableResType,
|
if (rc != Success || !AddResource(bufId, dbeDrawableResType,
|
||||||
pDbeWindowPrivPriv->pBackBuffer)) {
|
pDbeWindowPriv->pBackBuffer)) {
|
||||||
/* free the buffer and the drawable resource */
|
/* free the buffer and the drawable resource */
|
||||||
FreeResource(bufId, RT_NONE);
|
FreeResource(bufId, RT_NONE);
|
||||||
return (rc == Success) ? BadAlloc : rc;
|
return (rc == Success) ? BadAlloc : rc;
|
||||||
|
@ -193,11 +184,11 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
/* Clear the back buffer. */
|
/* Clear the back buffer. */
|
||||||
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
|
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
|
||||||
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
|
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
|
||||||
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC);
|
ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC);
|
||||||
clearRect.x = clearRect.y = 0;
|
clearRect.x = clearRect.y = 0;
|
||||||
clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width;
|
clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width;
|
||||||
clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height;
|
clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height;
|
||||||
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv->
|
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv->
|
||||||
pBackBuffer, pGC, 1, &clearRect);
|
pBackBuffer, pGC, 1, &clearRect);
|
||||||
}
|
}
|
||||||
FreeScratchGC(pGC);
|
FreeScratchGC(pGC);
|
||||||
|
@ -210,9 +201,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Associate the new ID with an existing pixmap. */
|
/* Associate the new ID with an existing pixmap. */
|
||||||
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
|
|
||||||
if (!AddResource(bufId, dbeDrawableResType,
|
if (!AddResource(bufId, dbeDrawableResType,
|
||||||
(pointer) pDbeWindowPrivPriv->pBackBuffer)) {
|
(pointer) pDbeWindowPriv->pBackBuffer)) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,12 +227,10 @@ static void
|
||||||
miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv)
|
miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv =
|
|
||||||
MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
|
|
||||||
|
|
||||||
for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) {
|
for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) {
|
||||||
ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType,
|
ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType,
|
||||||
(pointer) pDbeWindowPrivPriv->pBackBuffer);
|
(pointer) pDbeWindowPriv->pBackBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* miDbeAliasBuffers() */
|
} /* miDbeAliasBuffers() */
|
||||||
|
@ -261,15 +249,15 @@ static int
|
||||||
miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
||||||
{
|
{
|
||||||
DbeScreenPrivPtr pDbeScreenPriv;
|
DbeScreenPrivPtr pDbeScreenPriv;
|
||||||
|
DbeWindowPrivPtr pDbeWindowPriv;
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
|
|
||||||
PixmapPtr pTmpBuffer;
|
PixmapPtr pTmpBuffer;
|
||||||
xRectangle clearRect;
|
xRectangle clearRect;
|
||||||
|
|
||||||
pWin = swapInfo[0].pWindow;
|
pWin = swapInfo[0].pWindow;
|
||||||
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
|
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
|
||||||
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin);
|
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
|
||||||
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
|
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -286,9 +274,9 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XdbeUntouched:
|
case XdbeUntouched:
|
||||||
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer, pGC);
|
ValidateGC((DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC);
|
||||||
(*pGC->ops->CopyArea) ((DrawablePtr) pWin,
|
(*pGC->ops->CopyArea) ((DrawablePtr) pWin,
|
||||||
(DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer,
|
(DrawablePtr) pDbeWindowPriv->pFrontBuffer,
|
||||||
pGC, 0, 0, pWin->drawable.width,
|
pGC, 0, 0, pWin->drawable.width,
|
||||||
pWin->drawable.height, 0, 0);
|
pWin->drawable.height, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -305,7 +293,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ValidateGC((DrawablePtr) pWin, pGC);
|
ValidateGC((DrawablePtr) pWin, pGC);
|
||||||
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer,
|
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer,
|
||||||
(DrawablePtr) pWin, pGC, 0, 0,
|
(DrawablePtr) pWin, pGC, 0, 0,
|
||||||
pWin->drawable.width, pWin->drawable.height, 0, 0);
|
pWin->drawable.width, pWin->drawable.height, 0, 0);
|
||||||
|
|
||||||
|
@ -321,23 +309,23 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
||||||
|
|
||||||
case XdbeBackground:
|
case XdbeBackground:
|
||||||
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
|
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
|
||||||
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC);
|
ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC);
|
||||||
clearRect.x = 0;
|
clearRect.x = 0;
|
||||||
clearRect.y = 0;
|
clearRect.y = 0;
|
||||||
clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width;
|
clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width;
|
||||||
clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height;
|
clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height;
|
||||||
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv->
|
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv->
|
||||||
pBackBuffer, pGC, 1, &clearRect);
|
pBackBuffer, pGC, 1, &clearRect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XdbeUntouched:
|
case XdbeUntouched:
|
||||||
/* Swap pixmap pointers. */
|
/* Swap pixmap pointers. */
|
||||||
pTmpBuffer = pDbeWindowPrivPriv->pBackBuffer;
|
pTmpBuffer = pDbeWindowPriv->pBackBuffer;
|
||||||
pDbeWindowPrivPriv->pBackBuffer = pDbeWindowPrivPriv->pFrontBuffer;
|
pDbeWindowPriv->pBackBuffer = pDbeWindowPriv->pFrontBuffer;
|
||||||
pDbeWindowPrivPriv->pFrontBuffer = pTmpBuffer;
|
pDbeWindowPriv->pFrontBuffer = pTmpBuffer;
|
||||||
|
|
||||||
miDbeAliasBuffers(pDbeWindowPrivPriv->pDbeWindowPriv);
|
miDbeAliasBuffers(pDbeWindowPriv);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -427,8 +415,6 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
|
||||||
static void
|
static void
|
||||||
miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
|
miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
|
||||||
{
|
{
|
||||||
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
|
|
||||||
|
|
||||||
if (pDbeWindowPriv->nBufferIDs != 0) {
|
if (pDbeWindowPriv->nBufferIDs != 0) {
|
||||||
/* We still have at least one more buffer ID associated with this
|
/* We still have at least one more buffer ID associated with this
|
||||||
* window.
|
* window.
|
||||||
|
@ -440,18 +426,15 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
|
||||||
* free some stuff.
|
* free some stuff.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
|
|
||||||
|
|
||||||
/* Destroy the front and back pixmaps. */
|
/* Destroy the front and back pixmaps. */
|
||||||
if (pDbeWindowPrivPriv->pFrontBuffer) {
|
if (pDbeWindowPriv->pFrontBuffer) {
|
||||||
(*pDbeWindowPriv->pWindow->drawable.pScreen->
|
(*pDbeWindowPriv->pWindow->drawable.pScreen->
|
||||||
DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer);
|
DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
|
||||||
}
|
}
|
||||||
if (pDbeWindowPrivPriv->pBackBuffer) {
|
if (pDbeWindowPriv->pBackBuffer) {
|
||||||
(*pDbeWindowPriv->pWindow->drawable.pScreen->
|
(*pDbeWindowPriv->pWindow->drawable.pScreen->
|
||||||
DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer);
|
DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* miDbeWinPrivDelete() */
|
} /* miDbeWinPrivDelete() */
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -627,10 +610,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
else {
|
else {
|
||||||
/* Clear out the new DBE buffer pixmaps. */
|
/* Clear out the new DBE buffer pixmaps. */
|
||||||
|
|
||||||
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
|
|
||||||
|
|
||||||
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
|
|
||||||
|
|
||||||
/* I suppose this could avoid quite a bit of work if
|
/* I suppose this could avoid quite a bit of work if
|
||||||
* it computed the minimal area required.
|
* it computed the minimal area required.
|
||||||
*/
|
*/
|
||||||
|
@ -641,9 +620,9 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
}
|
}
|
||||||
/* Copy the contents of the old front pixmap to the new one. */
|
/* Copy the contents of the old front pixmap to the new one. */
|
||||||
if (pWin->bitGravity != ForgetGravity) {
|
if (pWin->bitGravity != ForgetGravity) {
|
||||||
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv->
|
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pFrontBuffer,
|
||||||
pFrontBuffer, (DrawablePtr) pFrontBuffer,
|
(DrawablePtr) pFrontBuffer, pGC,
|
||||||
pGC, sourcex, sourcey, savewidth, saveheight,
|
sourcex, sourcey, savewidth, saveheight,
|
||||||
destx, desty);
|
destx, desty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -654,8 +633,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
}
|
}
|
||||||
/* Copy the contents of the old back pixmap to the new one. */
|
/* Copy the contents of the old back pixmap to the new one. */
|
||||||
if (pWin->bitGravity != ForgetGravity) {
|
if (pWin->bitGravity != ForgetGravity) {
|
||||||
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv->
|
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer,
|
||||||
pBackBuffer, (DrawablePtr) pBackBuffer, pGC,
|
(DrawablePtr) pBackBuffer, pGC,
|
||||||
sourcex, sourcey, savewidth, saveheight,
|
sourcex, sourcey, savewidth, saveheight,
|
||||||
destx, desty);
|
destx, desty);
|
||||||
}
|
}
|
||||||
|
@ -664,11 +643,11 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
* pixmaps.
|
* pixmaps.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer);
|
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
|
||||||
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer);
|
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
|
||||||
|
|
||||||
pDbeWindowPrivPriv->pFrontBuffer = pFrontBuffer;
|
pDbeWindowPriv->pFrontBuffer = pFrontBuffer;
|
||||||
pDbeWindowPrivPriv->pBackBuffer = pBackBuffer;
|
pDbeWindowPriv->pBackBuffer = pBackBuffer;
|
||||||
|
|
||||||
/* Make sure all XID are associated with the new back pixmap. */
|
/* Make sure all XID are associated with the new back pixmap. */
|
||||||
miDbeAliasBuffers(pDbeWindowPriv);
|
miDbeAliasBuffers(pDbeWindowPriv);
|
||||||
|
@ -693,10 +672,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
|
||||||
Bool
|
Bool
|
||||||
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
|
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
|
||||||
{
|
{
|
||||||
if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
|
|
||||||
sizeof(MiDbeWindowPrivPrivRec)))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
/* Wrap functions. */
|
/* Wrap functions. */
|
||||||
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
|
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
|
||||||
pScreen->PositionWindow = miDbePositionWindow;
|
pScreen->PositionWindow = miDbePositionWindow;
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright (c) 1994, 1995 Hewlett-Packard Company
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included
|
|
||||||
* in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
* IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
|
|
||||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
||||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* Except as contained in this notice, the name of the Hewlett-Packard
|
|
||||||
* Company shall not be used in advertising or otherwise to promote the
|
|
||||||
* sale, use or other dealings in this Software without prior written
|
|
||||||
* authorization from the Hewlett-Packard Company.
|
|
||||||
*
|
|
||||||
* Header file for users of machine-independent DBE code
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
|
||||||
#include <dix-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MIDBE_STRUCT_H
|
|
||||||
#define MIDBE_STRUCT_H
|
|
||||||
|
|
||||||
/* DEFINES */
|
|
||||||
|
|
||||||
#define MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv) \
|
|
||||||
(!(pDbeWindowPriv) ? NULL : (MiDbeWindowPrivPrivPtr) \
|
|
||||||
dixLookupPrivate(&(pDbeWindowPriv)->devPrivates, miDbeWindowPrivPrivKey))
|
|
||||||
|
|
||||||
#define MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin)\
|
|
||||||
MI_DBE_WINDOW_PRIV_PRIV(DBE_WINDOW_PRIV(pWin))
|
|
||||||
|
|
||||||
/* TYPEDEFS */
|
|
||||||
|
|
||||||
typedef struct _MiDbeWindowPrivPrivRec {
|
|
||||||
/* Place machine-specific fields in here.
|
|
||||||
* Since this is mi code, we do not really have machine-specific fields.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Pointer to a drawable that contains the contents of the back buffer.
|
|
||||||
*/
|
|
||||||
PixmapPtr pBackBuffer;
|
|
||||||
|
|
||||||
/* Pointer to a drawable that contains the contents of the front buffer.
|
|
||||||
* This pointer is only used for the XdbeUntouched swap action. For that
|
|
||||||
* swap action, we need to copy the front buffer (window) contents into
|
|
||||||
* this drawable, copy the contents of current back buffer drawable (the
|
|
||||||
* back buffer) into the window, swap the front and back drawable pointers,
|
|
||||||
* and then swap the drawable/resource associations in the resource
|
|
||||||
* database.
|
|
||||||
*/
|
|
||||||
PixmapPtr pFrontBuffer;
|
|
||||||
|
|
||||||
/* Pointer back to our window private with which we are associated. */
|
|
||||||
DbeWindowPrivPtr pDbeWindowPriv;
|
|
||||||
|
|
||||||
} MiDbeWindowPrivPrivRec, *MiDbeWindowPrivPrivPtr;
|
|
||||||
|
|
||||||
#endif /* MIDBE_STRUCT_H */
|
|
|
@ -105,7 +105,6 @@ static const char *key_names[PRIVATE_LAST] = {
|
||||||
[PRIVATE_CURSOR_BITS] = "CURSOR_BITS",
|
[PRIVATE_CURSOR_BITS] = "CURSOR_BITS",
|
||||||
|
|
||||||
/* extension privates */
|
/* extension privates */
|
||||||
[PRIVATE_DBE_WINDOW] = "DBE_WINDOW",
|
|
||||||
[PRIVATE_DAMAGE] = "DAMAGE",
|
[PRIVATE_DAMAGE] = "DAMAGE",
|
||||||
[PRIVATE_GLYPH] = "GLYPH",
|
[PRIVATE_GLYPH] = "GLYPH",
|
||||||
[PRIVATE_GLYPHSET] = "GLYPHSET",
|
[PRIVATE_GLYPHSET] = "GLYPHSET",
|
||||||
|
|
|
@ -46,7 +46,6 @@ typedef enum {
|
||||||
PRIVATE_CURSOR_BITS,
|
PRIVATE_CURSOR_BITS,
|
||||||
|
|
||||||
/* extension privates */
|
/* extension privates */
|
||||||
PRIVATE_DBE_WINDOW,
|
|
||||||
PRIVATE_DAMAGE,
|
PRIVATE_DAMAGE,
|
||||||
PRIVATE_GLYPH,
|
PRIVATE_GLYPH,
|
||||||
PRIVATE_GLYPHSET,
|
PRIVATE_GLYPHSET,
|
||||||
|
|
Loading…
Reference in New Issue