summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-02-12 14:29:22 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-02-12 14:29:22 +0000
commit8e2017cc91e6ff3105b3b2762d19c7c9beb4c139 (patch)
treeb9d53e79ab39a14c5013baa27d400da498c88f31
parent38806526bbb9d03a7917e2a035bf42fb3288fe2e (diff)
win.h
winfont.c winmultiwindowshape.c winmultiwindowwindow.c winpfbdd.c winshaddd.c winshadddnl.c winshadgdi.c Fix incorrect wrapping of functions. Ensure the pointers from pScreen point to the called function even if wrapped functions changed it Set the window properties to NULL to avoid referencing freed memory because of timing problems after deleting a window Do not wrap ChangeWindowAttributes. All functions are noops currently
-rw-r--r--hw/xwin/ChangeLog21
-rw-r--r--hw/xwin/win.h15
-rw-r--r--hw/xwin/winfont.c26
-rwxr-xr-xhw/xwin/winmultiwindowshape.c10
-rw-r--r--hw/xwin/winmultiwindowwindow.c108
-rw-r--r--hw/xwin/winpfbdd.c2
-rw-r--r--hw/xwin/winscrinit.c6
-rw-r--r--hw/xwin/winshaddd.c2
-rw-r--r--hw/xwin/winshadddnl.c2
-rw-r--r--hw/xwin/winshadgdi.c2
-rw-r--r--hw/xwin/winwindow.c173
11 files changed, 281 insertions, 86 deletions
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog
index 7092834b8..0631cf16b 100644
--- a/hw/xwin/ChangeLog
+++ b/hw/xwin/ChangeLog
@@ -1,5 +1,26 @@
2005-02-12 Alexander Gottwald <ago at freedesktop dot org>
+ * win.h
+ * winfont.c
+ * winmultiwindowshape.c
+ * winmultiwindowwindow.c
+ * winpfbdd.c
+ * winshaddd.c
+ * winshadddnl.c
+ * winshadgdi.c
+ * winwindow.c:
+ Fix incorrect wrapping of functions. Ensure the pointers from pScreen
+ point to the called function even if wrapped functions changed it
+
+ * winmultiwindowwindow.c:
+ Set the window properties to NULL to avoid referencing freed memory
+ because of timing problems after deleting a window
+
+ * winscrinit.c:
+ Do not wrap ChangeWindowAttributes. All functions are noops currently
+
+2005-02-12 Alexander Gottwald <ago at freedesktop dot org>
+
* winmsg.h
* winmsg.c:
New function winTrace
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index f1d85af3e..50231afbf 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -725,6 +725,21 @@ extern FARPROC g_fpTrackMouseEvent;
#define winWindowPriv(pWin) \
winPrivWinPtr pWinPriv = winGetWindowPriv(pWin)
+/*
+ * wrapper macros
+ */
+#define _WIN_WRAP(priv, real, mem, func) {\
+ priv->mem = real->mem; \
+ real->mem = func; \
+}
+
+#define _WIN_UNWRAP(priv, real, mem) {\
+ real->mem = priv->mem; \
+}
+
+#define WIN_WRAP(mem, func) _WIN_WRAP(pScreenPriv, pScreen, mem, func)
+
+#define WIN_UNWRAP(mem) _WIN_UNWRAP(pScreenPriv, pScreen, mem)
/*
* BEGIN DDX and DIX Function Prototypes
diff --git a/hw/xwin/winfont.c b/hw/xwin/winfont.c
index 4c633af80..64c6cd233 100644
--- a/hw/xwin/winfont.c
+++ b/hw/xwin/winfont.c
@@ -35,10 +35,19 @@
Bool
winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
{
+ BOOL fResult = TRUE;
+ winScreenPriv(pScreen);
+
#if CYGDEBUG
- winDebug ("winRealizeFont()\n");
+ winTrace ("winRealizeFont (%p, %p)\n", pScreen, pFont);
#endif
- return TRUE;
+
+ WIN_UNWRAP(RealizeFont);
+ if (pScreen->RealizeFont)
+ fResult = (*pScreen->RealizeFont) (pScreen, pFont);
+ WIN_WRAP(RealizeFont, winRealizeFontNativeGDI);
+
+ return fResult;
}
/* See Porting Layer Definition - p. 32 */
@@ -46,6 +55,19 @@ winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
Bool
winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
{
+ BOOL fResult = TRUE;
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winUnrealizeFont (%p, %p)\n", pScreen, pFont);
+#endif
+
+ WIN_UNWRAP(UnrealizeFont);
+ if (pScreen->UnrealizeFont)
+ fResult = (*pScreen->UnrealizeFont) (pScreen, pFont);
+ WIN_WRAP(UnrealizeFont, winUnrealizeFontNativeGDI);
+
+ return fResult;
#if CYGDEBUG
winDebug ("winUnrealizeFont()\n");
#endif
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
index bfec1a1ea..e2996a81e 100755
--- a/hw/xwin/winmultiwindowshape.c
+++ b/hw/xwin/winmultiwindowshape.c
@@ -42,13 +42,17 @@
void
winSetShapeMultiWindow (WindowPtr pWin)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped SetShape function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->SetShape)
- winGetScreenPriv(pWin->drawable.pScreen)->SetShape (pWin);
+ WIN_UNWRAP(SetShape);
+ (*pScreen->SetShape)(pWin);
+ WIN_WRAP(SetShape, winSetShapeMultiWindow);
/* Update the Windows window's shape */
winReshapeMultiWindow (pWin);
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 475fa7ddc..95843654f 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -88,15 +88,17 @@ Bool
winCreateWindowMultiWindow (WindowPtr pWin)
{
Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winCreateWindowMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped CreateWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow (pWin);
+ WIN_UNWRAP(CreateWindow);
+ fResult = (*pScreen->CreateWindow) (pWin);
+ WIN_WRAP(CreateWindow, winCreateWindowMultiWindow);
/* Initialize some privates values */
pWinPriv->hRgn = NULL;
@@ -116,15 +118,17 @@ Bool
winDestroyWindowMultiWindow (WindowPtr pWin)
{
Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winDestroyWindowMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped DestroyWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow (pWin);
+ WIN_UNWRAP(DestroyWindow);
+ fResult = (*pScreen->DestroyWindow)(pWin);
+ WIN_WRAP(DestroyWindow, winDestroyWindowMultiWindow);
/* Flag that the window has been destroyed */
pWinPriv->fXKilled = TRUE;
@@ -149,7 +153,10 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
{
Bool fResult = TRUE;
int iX, iY, iWidth, iHeight;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
HWND hWnd = pWinPriv->hWnd;
RECT rcNew;
RECT rcOld;
@@ -164,9 +171,9 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
ErrorF ("winPositionWindowMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped PositionWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow (pWin, x, y);
+ WIN_UNWRAP(PositionWindow);
+ fResult = (*pScreen->PositionWindow)(pWin, x, y);
+ WIN_WRAP(PositionWindow, winPositionWindowMultiWindow);
#if CYGWINDOWING_DEBUG
ErrorF ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n",
@@ -265,14 +272,17 @@ Bool
winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
{
Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped ChangeWindowAttributes function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes (pWin, mask);
+ WIN_UNWRAP(ChangeWindowAttributes);
+ fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask);
+ WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesMultiWindow);
/*
* NOTE: We do not currently need to do anything here.
@@ -291,15 +301,17 @@ Bool
winUnmapWindowMultiWindow (WindowPtr pWin)
{
Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped UnrealizeWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow (pWin);
+ WIN_UNWRAP(UnrealizeWindow);
+ fResult = (*pScreen->UnrealizeWindow)(pWin);
+ WIN_WRAP(UnrealizeWindow, winUnmapWindowMultiWindow);
/* Flag that the window has been killed */
pWinPriv->fXKilled = TRUE;
@@ -320,15 +332,17 @@ Bool
winMapWindowMultiWindow (WindowPtr pWin)
{
Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped RealizeWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow)
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow (pWin);
+ WIN_UNWRAP(RealizeWindow);
+ fResult = (*pScreen->RealizeWindow)(pWin);
+ WIN_WRAP(RealizeWindow, winMapWindowMultiWindow);
/* Flag that this window has not been destroyed */
pWinPriv->fXKilled = FALSE;
@@ -353,14 +367,18 @@ winMapWindowMultiWindow (WindowPtr pWin)
void
winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin);
#endif
- /* Call any wrapped ReparentWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow (pWin,
- pPriorParent);
+ WIN_UNWRAP(ReparentWindow);
+ if (pScreen->ReparentWindow)
+ (*pScreen->ReparentWindow)(pWin, pPriorParent);
+ WIN_WRAP(ReparentWindow, winReparentWindowMultiWindow);
/* Update the Windows window associated with this X window */
winUpdateWindowsWindow (pWin);
@@ -378,16 +396,18 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
UINT uFlags;
HWND hInsertAfter;
HWND hWnd = NULL;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG
ErrorF ("winRestackMultiWindow - %08x\n", pWin);
#endif
- /* Call any wrapped RestackWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow (pWin,
- pOldNextSib);
+ WIN_UNWRAP(RestackWindow);
+ if (pScreen->RestackWindow)
+ (*pScreen->RestackWindow)(pWin, pOldNextSib);
+ WIN_WRAP(RestackWindow, winRestackWindowMultiWindow);
#if 1
/*
@@ -619,6 +639,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
hiconSmClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICONSM);
iReturn = GetClassName (pWinPriv->hWnd, pszClass, 512);
+ SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, NULL);
/* Destroy the Windows window */
DestroyWindow (pWinPriv->hWnd);
@@ -834,14 +855,16 @@ void
winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt,
RegionPtr oldRegion)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGWINDOWING_DEBUG
ErrorF ("CopyWindowMultiWindow\n");
#endif
- /* Call any wrapped CopyWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->CopyWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->CopyWindow (pWin,
- oldpt,
- oldRegion);
+ WIN_UNWRAP(CopyWindow);
+ (*pScreen->CopyWindow)(pWin, oldpt, oldRegion);
+ WIN_WRAP(CopyWindow, winCopyWindowMultiWindow);
}
@@ -852,13 +875,17 @@ void
winMoveWindowMultiWindow (WindowPtr pWin, int x, int y,
WindowPtr pSib, VTKind kind)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGWINDOWING_DEBUG
ErrorF ("MoveWindowMultiWindow to (%d, %d)\n", x, y);
#endif
- /* Call any wrapped MoveWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->MoveWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->MoveWindow (pWin, x, y,
- pSib, kind);
+
+ WIN_UNWRAP(MoveWindow);
+ (*pScreen->MoveWindow)(pWin, x, y, pSib, kind);
+ WIN_WRAP(MoveWindow, winMoveWindowMultiWindow);
}
@@ -869,13 +896,16 @@ void
winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
unsigned int h, WindowPtr pSib)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGWINDOWING_DEBUG
ErrorF ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
#endif
- /* Call any wrapped MoveWindow function */
- if (winGetScreenPriv(pWin->drawable.pScreen)->ResizeWindow)
- winGetScreenPriv(pWin->drawable.pScreen)->ResizeWindow (pWin, x, y,
- w, h, pSib);
+ WIN_UNWRAP(ResizeWindow);
+ (*pScreen->ResizeWindow)(pWin, x, y, w, h, pSib);
+ WIN_WRAP(ResizeWindow, winResizeWindowMultiWindow);
}
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index 959fef991..9a34cfb33 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -260,7 +260,7 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
pScreenPriv->fActive = FALSE;
/* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ WIN_UNWRAP(CloseScreen);
fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
/* Delete the window property */
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 6dd37cf04..6fbfc96e5 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -475,7 +475,7 @@ winFinishScreenInitFB (int index,
pScreen->CreateWindow = winCreateWindowRootless;
pScreen->DestroyWindow = winDestroyWindowRootless;
pScreen->PositionWindow = winPositionWindowRootless;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesRootless;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesRootless;*/
pScreen->RealizeWindow = winMapWindowRootless;
pScreen->UnrealizeWindow = winUnmapWindowRootless;
#ifdef SHAPE
@@ -520,7 +520,7 @@ winFinishScreenInitFB (int index,
pScreen->CreateWindow = winCreateWindowMultiWindow;
pScreen->DestroyWindow = winDestroyWindowMultiWindow;
pScreen->PositionWindow = winPositionWindowMultiWindow;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;*/
pScreen->RealizeWindow = winMapWindowMultiWindow;
pScreen->UnrealizeWindow = winUnmapWindowMultiWindow;
pScreen->ReparentWindow = winReparentWindowMultiWindow;
@@ -685,7 +685,7 @@ winFinishScreenInitNativeGDI (int index,
pScreen->CreateWindow = winCreateWindowNativeGDI;
pScreen->DestroyWindow = winDestroyWindowNativeGDI;
pScreen->PositionWindow = winPositionWindowNativeGDI;
- pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;
+ /*pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;*/
pScreen->RealizeWindow = winMapWindowNativeGDI;
pScreen->UnrealizeWindow = winUnmapWindowNativeGDI;
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 7aa553560..02e202ddc 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -681,7 +681,7 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
pScreenPriv->fActive = FALSE;
/* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ WIN_UNWRAP(CloseScreen);
fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
/* Free the screen DC */
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 2ec28c957..d7204d358 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -733,7 +733,7 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
pScreenPriv->fActive = FALSE;
/* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ WIN_UNWRAP(CloseScreen);
fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
/* Free the screen DC */
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 71a993acf..54a703f23 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -630,7 +630,7 @@ winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
pScreenPriv->fActive = FALSE;
/* Call the wrapped CloseScreen procedure */
- pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ WIN_UNWRAP(CloseScreen);
fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
/* Delete the window property */
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index 86dd71178..de8f3a680 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -58,8 +58,19 @@ winReshapeRootless (WindowPtr pWin);
Bool
winCreateWindowNativeGDI (WindowPtr pWin)
{
- ErrorF ("winCreateWindowNativeGDI ()\n");
- return TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winCreateWindowNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(CreateWindow);
+ fResult = (*pScreen->CreateWindow) (pWin);
+ WIN_WRAP(CreateWindow, winCreateWindowNativeGDI);
+
+ return fResult;
}
@@ -69,8 +80,20 @@ winCreateWindowNativeGDI (WindowPtr pWin)
Bool
winDestroyWindowNativeGDI (WindowPtr pWin)
{
- ErrorF ("winDestroyWindowNativeGDI ()\n");
- return TRUE;
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winDestroyWindowNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(DestroyWindow);
+ fResult = (*pScreen->DestroyWindow)(pWin);
+ WIN_WRAP(DestroyWindow, winDestroyWindowNativeGDI);
+
+ return fResult;
}
@@ -80,8 +103,20 @@ winDestroyWindowNativeGDI (WindowPtr pWin)
Bool
winPositionWindowNativeGDI (WindowPtr pWin, int x, int y)
{
- ErrorF ("winPositionWindowNativeGDI ()\n");
- return TRUE;
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winPositionWindowNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(PositionWindow);
+ fResult = (*pScreen->PositionWindow)(pWin, x, y);
+ WIN_WRAP(PositionWindow, winPositionWindowNativeGDI);
+
+ return fResult;
}
@@ -180,8 +215,24 @@ winCopyWindowNativeGDI (WindowPtr pWin,
Bool
winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask)
{
- ErrorF ("winChangeWindowAttributesNativeGDI ()\n");
- return TRUE;
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winChangeWindowAttributesNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(ChangeWindowAttributes);
+ fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask);
+ WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesNativeGDI);
+
+ /*
+ * NOTE: We do not currently need to do anything here.
+ */
+
+ return fResult;
}
@@ -190,13 +241,22 @@ winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask)
*/
Bool
-winUnmapWindowNativeGDI (WindowPtr pWindow)
+winUnmapWindowNativeGDI (WindowPtr pWin)
{
- ErrorF ("winUnmapWindowNativeGDI ()\n");
- /* This functions is empty in the CFB,
- * we probably won't need to do anything
- */
- return TRUE;
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winUnmapWindowNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(UnrealizeWindow);
+ fResult = (*pScreen->UnrealizeWindow)(pWin);
+ WIN_WRAP(UnrealizeWindow, winUnmapWindowNativeGDI);
+
+ return fResult;
}
@@ -205,13 +265,22 @@ winUnmapWindowNativeGDI (WindowPtr pWindow)
*/
Bool
-winMapWindowNativeGDI (WindowPtr pWindow)
+winMapWindowNativeGDI (WindowPtr pWin)
{
- ErrorF ("winMapWindowNativeGDI ()\n");
- /* This function is empty in the CFB,
- * we probably won't need to do anything
- */
- return TRUE;
+ Bool fResult = TRUE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ winTrace ("winMapWindowNativeGDI (%p)\n", pWin);
+#endif
+
+ WIN_UNWRAP(RealizeWindow);
+ fResult = (*pScreen->RealizeWindow)(pWin);
+ WIN_WRAP(RealizeWindow, winMapWindowMultiWindow);
+
+ return fResult;
}
#endif
@@ -224,13 +293,17 @@ Bool
winCreateWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGDEBUG
- winDebug ("winCreateWindowRootless ()\n");
+ winTrace ("winCreateWindowRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow(pWin);
+ WIN_UNWRAP(CreateWindow);
+ fResult = (*pScreen->CreateWindow) (pWin);
+ WIN_WRAP(CreateWindow, winCreateWindowRootless);
pWinPriv->hRgn = NULL;
@@ -245,13 +318,17 @@ Bool
winDestroyWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGDEBUG
- winDebug ("winDestroyWindowRootless ()\n");
+ winTrace ("winDestroyWindowRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow(pWin);
+ WIN_UNWRAP(DestroyWindow);
+ fResult = (*pScreen->DestroyWindow)(pWin);
+ WIN_WRAP(DestroyWindow, winDestroyWindowRootless);
if (pWinPriv->hRgn != NULL)
{
@@ -272,12 +349,18 @@ Bool
winPositionWindowRootless (WindowPtr pWin, int x, int y)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGDEBUG
- winDebug ("winPositionWindowRootless ()\n");
+ winTrace ("winPositionWindowRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow(pWin, x, y);
+ WIN_UNWRAP(PositionWindow);
+ fResult = (*pScreen->PositionWindow)(pWin, x, y);
+ WIN_WRAP(PositionWindow, winPositionWindowRootless);
winUpdateRgnRootless (pWin);
@@ -292,13 +375,18 @@ Bool
winChangeWindowAttributesRootless (WindowPtr pWin, unsigned long mask)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGDEBUG
- winDebug ("winChangeWindowAttributesRootless ()\n");
+ winTrace ("winChangeWindowAttributesRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes(pWin, mask);
-
+ WIN_UNWRAP(ChangeWindowAttributes);
+ fResult = (*pScreen->ChangeWindowAttributes)(pWin, mask);
+ WIN_WRAP(ChangeWindowAttributes, winChangeWindowAttributesRootless);
+
winUpdateRgnRootless (pWin);
return fResult;
@@ -313,13 +401,17 @@ Bool
winUnmapWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGDEBUG
- winDebug ("winUnmapWindowRootless ()\n");
+ winTrace ("winUnmapWindowRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow(pWin);
+ WIN_UNWRAP(UnrealizeWindow);
+ fResult = (*pScreen->UnrealizeWindow)(pWin);
+ WIN_WRAP(UnrealizeWindow, winUnmapWindowRootless);
if (pWinPriv->hRgn != NULL)
{
@@ -341,12 +433,17 @@ Bool
winMapWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
#if CYGDEBUG
- winDebug ("winMapWindowRootless ()\n");
+ winTrace ("winMapWindowRootless (%p)\n", pWin);
#endif
- fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow(pWin);
+ WIN_UNWRAP(RealizeWindow);
+ fResult = (*pScreen->RealizeWindow)(pWin);
+ WIN_WRAP(RealizeWindow, winMapWindowRootless);
#ifdef SHAPE
winReshapeRootless (pWin);
@@ -362,11 +459,17 @@ winMapWindowRootless (WindowPtr pWin)
void
winSetShapeRootless (WindowPtr pWin)
{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+
#if CYGDEBUG
- winDebug ("winSetShapeRootless ()\n");
+ winTrace ("winSetShapeRootless (%p)\n", pWin);
#endif
- winGetScreenPriv(pWin->drawable.pScreen)->SetShape(pWin);
+ WIN_UNWRAP(SetShape);
+ (*pScreen->SetShape)(pWin);
+ WIN_WRAP(SetShape, winSetShapeRootless);
winReshapeRootless (pWin);
winUpdateRgnRootless (pWin);