diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/xwin/winpfbdd.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-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/hw/xwin/winpfbdd.c')
-rw-r--r-- | xorg-server/hw/xwin/winpfbdd.c | 972 |
1 files changed, 463 insertions, 509 deletions
diff --git a/xorg-server/hw/xwin/winpfbdd.c b/xorg-server/hw/xwin/winpfbdd.c index 3ea61ade2..d9b095f3a 100644 --- a/xorg-server/hw/xwin/winpfbdd.c +++ b/xorg-server/hw/xwin/winpfbdd.c @@ -36,241 +36,225 @@ #endif #include "win.h" - /* * Local function prototypes */ static Bool -winAllocateFBPrimaryDD (ScreenPtr pScreen); + winAllocateFBPrimaryDD(ScreenPtr pScreen); static Bool -winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen); + winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen); static Bool -winInitVisualsPrimaryDD (ScreenPtr pScreen); + winInitVisualsPrimaryDD(ScreenPtr pScreen); static Bool -winAdjustVideoModePrimaryDD (ScreenPtr pScreen); + winAdjustVideoModePrimaryDD(ScreenPtr pScreen); static Bool -winActivateAppPrimaryDD (ScreenPtr pScreen); + winActivateAppPrimaryDD(ScreenPtr pScreen); static Bool -winHotKeyAltTabPrimaryDD (ScreenPtr pScreen); - + winHotKeyAltTabPrimaryDD(ScreenPtr pScreen); /* * Create a DirectDraw primary surface */ static Bool -winAllocateFBPrimaryDD (ScreenPtr pScreen) +winAllocateFBPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HRESULT ddrval = DD_OK; - DDSURFACEDESC ddsd; - DDSURFACEDESC *pddsdPrimary = NULL; - DDSURFACEDESC *pddsdOffscreen = NULL; - RECT rcClient; - - winDebug ("winAllocateFBPrimaryDD\n"); - - /* Get client area location in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Create a DirectDraw object, store the address at lpdd */ - ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); - if (ddrval != DD_OK) - FatalError ("winAllocateFBPrimaryDD - Could not start DirectDraw\n"); - - /* Get a DirectDraw2 interface pointer */ - ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd, - &IID_IDirectDraw2, - (LPVOID*) &pScreenPriv->pdd2); - if (FAILED (ddrval)) - { - ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n", - (unsigned int) ddrval); - return FALSE; + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + HRESULT ddrval = DD_OK; + DDSURFACEDESC ddsd; + DDSURFACEDESC *pddsdPrimary = NULL; + DDSURFACEDESC *pddsdOffscreen = NULL; + RECT rcClient; + + winDebug ("winAllocateFBPrimaryDD\n"); + + /* Get client area location in screen coords */ + GetClientRect(pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints(pScreenPriv->hwndScreen, + HWND_DESKTOP, (LPPOINT) & rcClient, 2); + + /* Create a DirectDraw object, store the address at lpdd */ + ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); + if (ddrval != DD_OK) + FatalError("winAllocateFBPrimaryDD - Could not start DirectDraw\n"); + + /* Get a DirectDraw2 interface pointer */ + ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd, + &IID_IDirectDraw2, + (LPVOID *) & pScreenPriv->pdd2); + if (FAILED(ddrval)) { + ErrorF("winAllocateFBShadowDD - Failed DD2 query: %08x\n", + (unsigned int) ddrval); + return FALSE; } - - winDebug ("winAllocateFBPrimaryDD - Created and initialized DD\n"); - - /* Are we windowed or fullscreen? */ - if (pScreenInfo->fFullScreen) - { - /* Full screen mode */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_FULLSCREEN - | DDSCL_EXCLUSIVE); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); - - /* Change the video mode to the mode requested */ - ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2, - pScreenInfo->dwWidth, - pScreenInfo->dwHeight, - pScreenInfo->dwBPP, - pScreenInfo->dwRefreshRate, - 0); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "full screen display mode\n"); + winDebug ("winAllocateFBPrimaryDD - Created and initialized DD\n"); + + /* Are we windowed or fullscreen? */ + if (pScreenInfo->fFullScreen) { + /* Full screen mode */ + ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2, + pScreenPriv->hwndScreen, + DDSCL_FULLSCREEN + | DDSCL_EXCLUSIVE); + if (FAILED(ddrval)) + FatalError("winAllocateFBPrimaryDD - Could not set " + "cooperative level\n"); + + /* Change the video mode to the mode requested */ + ddrval = IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2, + pScreenInfo->dwWidth, + pScreenInfo->dwHeight, + pScreenInfo->dwBPP, + pScreenInfo->dwRefreshRate, 0); + if (FAILED(ddrval)) + FatalError("winAllocateFBPrimaryDD - Could not set " + "full screen display mode\n"); } - else - { - /* Windowed mode */ - ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2, - pScreenPriv->hwndScreen, - DDSCL_NORMAL); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not set " - "cooperative level\n"); + else { + /* Windowed mode */ + ddrval = IDirectDraw2_SetCooperativeLevel(pScreenPriv->pdd2, + pScreenPriv->hwndScreen, + DDSCL_NORMAL); + if (FAILED(ddrval)) + FatalError("winAllocateFBPrimaryDD - Could not set " + "cooperative level\n"); } - /* Describe the primary surface */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - /* Create the primary surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - FatalError ("winAllocateFBPrimaryDD - Could not create primary " - "surface %08x\n", (unsigned int) ddrval); - - winDebug ("winAllocateFBPrimaryDD - Created primary\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdPrimary = pScreenPriv->pddsdPrimary - = malloc (sizeof (DDSURFACEDESC)); - if (pddsdPrimary == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory (pddsdPrimary, sizeof (*pddsdPrimary)); - pddsdPrimary->dwSize = sizeof (*pddsdPrimary); - - /* Describe the offscreen surface to be created */ - /* - * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - * as drawing, locking, and unlocking take forever - * with video memory surfaces. In addition, - * video memory is a somewhat scarce resource, - * so you shouldn't be allocating video memory when - * you have the option of using system memory instead. - */ - ZeroMemory (&ddsd, sizeof (ddsd)); - ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - ddsd.dwHeight = pScreenInfo->dwHeight; - ddsd.dwWidth = pScreenInfo->dwWidth; - - /* Create the shadow surface */ - ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2, - &ddsd, - &pScreenPriv->pddsOffscreen, - NULL); - if (ddrval != DD_OK) - FatalError ("winAllocateFBPrimaryDD - Could not create shadow " - "surface\n"); - - winDebug ("winAllocateFBPrimaryDD - Created offscreen\n"); - - /* Allocate a DD surface description for our screen privates */ - pddsdOffscreen = pScreenPriv->pddsdOffscreen - = malloc (sizeof (DDSURFACEDESC)); - if (pddsdOffscreen == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not allocate surface " - "description memory\n"); - ZeroMemory (pddsdOffscreen, sizeof (*pddsdOffscreen)); - pddsdOffscreen->dwSize = sizeof (*pddsdOffscreen); - - winDebug ("winAllocateFBPrimaryDD - Locking primary\n"); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary, - pScreenInfo->fFullScreen ? NULL:&rcClient, - pddsdPrimary, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL) - FatalError ("winAllocateFBPrimaryDD - Could not lock " - "primary surface\n"); - - winDebug ("winAllocateFBPrimaryDD - Locked primary\n"); - - /* We don't know how to deal with anything other than RGB */ - if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB)) - FatalError ("winAllocateFBPrimaryDD - Color format other than RGB\n"); - - /* Grab the pitch from the surface desc */ - pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8) - / pScreenInfo->dwBPP; - - /* Save the pointer to our surface memory */ - pScreenInfo->pfb = pddsdPrimary->lpSurface; - - /* Grab the color depth and masks from the surface description */ - pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask; - pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask; - pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask; - - winDebug ("winAllocateFBPrimaryDD - Returning\n"); - - return TRUE; + /* Describe the primary surface */ + ZeroMemory(&ddsd, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + + /* Create the primary surface */ + ddrval = IDirectDraw2_CreateSurface(pScreenPriv->pdd2, + &ddsd, &pScreenPriv->pddsPrimary, NULL); + if (FAILED(ddrval)) + FatalError("winAllocateFBPrimaryDD - Could not create primary " + "surface %08x\n", (unsigned int) ddrval); + + winDebug ("winAllocateFBPrimaryDD - Created primary\n"); + + /* Allocate a DD surface description for our screen privates */ + pddsdPrimary = pScreenPriv->pddsdPrimary = malloc(sizeof(DDSURFACEDESC)); + if (pddsdPrimary == NULL) + FatalError("winAllocateFBPrimaryDD - Could not allocate surface " + "description memory\n"); + ZeroMemory(pddsdPrimary, sizeof(*pddsdPrimary)); + pddsdPrimary->dwSize = sizeof(*pddsdPrimary); + + /* Describe the offscreen surface to be created */ + /* + * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, + * as drawing, locking, and unlocking take forever + * with video memory surfaces. In addition, + * video memory is a somewhat scarce resource, + * so you shouldn't be allocating video memory when + * you have the option of using system memory instead. + */ + ZeroMemory(&ddsd, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + ddsd.dwHeight = pScreenInfo->dwHeight; + ddsd.dwWidth = pScreenInfo->dwWidth; + + /* Create the shadow surface */ + ddrval = IDirectDraw2_CreateSurface(pScreenPriv->pdd2, + &ddsd, + &pScreenPriv->pddsOffscreen, NULL); + if (ddrval != DD_OK) + FatalError("winAllocateFBPrimaryDD - Could not create shadow " + "surface\n"); + + winDebug ("winAllocateFBPrimaryDD - Created offscreen\n"); + + /* Allocate a DD surface description for our screen privates */ + pddsdOffscreen = pScreenPriv->pddsdOffscreen + = malloc(sizeof(DDSURFACEDESC)); + if (pddsdOffscreen == NULL) + FatalError("winAllocateFBPrimaryDD - Could not allocate surface " + "description memory\n"); + ZeroMemory(pddsdOffscreen, sizeof(*pddsdOffscreen)); + pddsdOffscreen->dwSize = sizeof(*pddsdOffscreen); + + winDebug ("winAllocateFBPrimaryDD - Locking primary\n"); + + /* Lock the primary surface */ + ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsPrimary, + pScreenInfo-> + fFullScreen ? NULL : &rcClient, + pddsdPrimary, DDLOCK_WAIT, NULL); + if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL) + FatalError("winAllocateFBPrimaryDD - Could not lock " + "primary surface\n"); + + winDebug ("winAllocateFBPrimaryDD - Locked primary\n"); + + /* We don't know how to deal with anything other than RGB */ + if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB)) + FatalError("winAllocateFBPrimaryDD - Color format other than RGB\n"); + + /* Grab the pitch from the surface desc */ + pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8) + / pScreenInfo->dwBPP; + + /* Save the pointer to our surface memory */ + pScreenInfo->pfb = pddsdPrimary->lpSurface; + + /* Grab the color depth and masks from the surface description */ + pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask; + pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask; + pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask; + + winDebug ("winAllocateFBPrimaryDD - Returning\n"); + + return TRUE; } static void -winFreeFBPrimaryDD (ScreenPtr pScreen) +winFreeFBPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Free the offscreen surface, if there is one */ - if (pScreenPriv->pddsOffscreen) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsOffscreen); - pScreenPriv->pddsOffscreen = NULL; + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Free the offscreen surface, if there is one */ + if (pScreenPriv->pddsOffscreen) { + IDirectDrawSurface2_Unlock(pScreenPriv->pddsOffscreen, NULL); + IDirectDrawSurface2_Release(pScreenPriv->pddsOffscreen); + pScreenPriv->pddsOffscreen = NULL; } - /* Release the primary surface, if there is one */ - if (pScreenPriv->pddsPrimary) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, NULL); - IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary); - pScreenPriv->pddsPrimary = NULL; + /* Release the primary surface, if there is one */ + if (pScreenPriv->pddsPrimary) { + IDirectDrawSurface2_Unlock(pScreenPriv->pddsPrimary, NULL); + IDirectDrawSurface2_Release(pScreenPriv->pddsPrimary); + pScreenPriv->pddsPrimary = NULL; } - /* Free the DirectDraw object, if there is one */ - if (pScreenPriv->pdd) - { - IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd); - IDirectDraw2_Release (pScreenPriv->pdd); - pScreenPriv->pdd = NULL; + /* Free the DirectDraw object, if there is one */ + if (pScreenPriv->pdd) { + IDirectDraw2_RestoreDisplayMode(pScreenPriv->pdd); + IDirectDraw2_Release(pScreenPriv->pdd); + pScreenPriv->pdd = NULL; } - /* Invalidate the ScreenInfo's fb pointer */ - pScreenInfo->pfb = NULL; + /* Invalidate the ScreenInfo's fb pointer */ + pScreenInfo->pfb = NULL; } static Bool winInitScreenPrimaryDD(ScreenPtr pScreen) { - return winAllocateFBPrimaryDD(pScreen); + return winAllocateFBPrimaryDD(pScreen); } /* @@ -280,56 +264,53 @@ winInitScreenPrimaryDD(ScreenPtr pScreen) */ static Bool -winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) +winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - Bool fReturn; - - ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n"); - - /* Flag that the screen is closed */ - pScreenPriv->fClosed = TRUE; - pScreenPriv->fActive = FALSE; - - /* Call the wrapped CloseScreen procedure */ - WIN_UNWRAP(CloseScreen); - if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); - - /* Delete the window property */ - RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); - - winFreeFBPrimaryDD(pScreen); - - /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) - winDeleteNotifyIcon (pScreenPriv); - - /* Free the exit confirmation dialog box, if it exists */ - if (g_hDlgExit != NULL) - { - DestroyWindow (g_hDlgExit); - g_hDlgExit = NULL; + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + Bool fReturn; + + ErrorF("winCloseScreenPrimaryDD - Freeing screen resources\n"); + + /* Flag that the screen is closed */ + pScreenPriv->fClosed = TRUE; + pScreenPriv->fActive = FALSE; + + /* Call the wrapped CloseScreen procedure */ + WIN_UNWRAP(CloseScreen); + if (pScreen->CloseScreen) + fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + + /* Delete the window property */ + RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); + + winFreeFBPrimaryDD(pScreen); + + /* Delete tray icon, if we have one */ + if (!pScreenInfo->fNoTrayIcon) + winDeleteNotifyIcon(pScreenPriv); + + /* Free the exit confirmation dialog box, if it exists */ + if (g_hDlgExit != NULL) { + DestroyWindow(g_hDlgExit); + g_hDlgExit = NULL; } - /* Kill our window */ - if (pScreenPriv->hwndScreen) - { - DestroyWindow (pScreenPriv->hwndScreen); - pScreenPriv->hwndScreen = NULL; + /* Kill our window */ + if (pScreenPriv->hwndScreen) { + DestroyWindow(pScreenPriv->hwndScreen); + pScreenPriv->hwndScreen = NULL; } - /* Kill our screeninfo's pointer to the screen */ - pScreenInfo->pScreen = NULL; + /* Kill our screeninfo's pointer to the screen */ + pScreenInfo->pScreen = NULL; - /* Free the screen privates for this screen */ - free ((pointer) pScreenPriv); + /* Free the screen privates for this screen */ + free((pointer) pScreenPriv); - return fReturn; + return fReturn; } - /* * Tell mi what sort of visuals we need. * @@ -339,114 +320,106 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) */ static Bool -winInitVisualsPrimaryDD (ScreenPtr pScreen) +winInitVisualsPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - DWORD dwRedBits, dwGreenBits, dwBlueBits; - - /* Count the number of ones in each color mask */ - dwRedBits = winCountBits (pScreenPriv->dwRedMask); - dwGreenBits = winCountBits (pScreenPriv->dwGreenMask); - dwBlueBits = winCountBits (pScreenPriv->dwBlueMask); - - /* Store the maximum number of ones in a color mask as the bitsPerRGB */ - if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwRedBits; - else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) - pScreenPriv->dwBitsPerRGB = dwGreenBits; - else - pScreenPriv->dwBitsPerRGB = dwBlueBits; - - winDebug ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB); - - /* Create a single visual according to the Windows screen depth */ - switch (pScreenInfo->dwDepth) - { + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + DWORD dwRedBits, dwGreenBits, dwBlueBits; + + /* Count the number of ones in each color mask */ + dwRedBits = winCountBits(pScreenPriv->dwRedMask); + dwGreenBits = winCountBits(pScreenPriv->dwGreenMask); + dwBlueBits = winCountBits(pScreenPriv->dwBlueMask); + + /* Store the maximum number of ones in a color mask as the bitsPerRGB */ + if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits) + pScreenPriv->dwBitsPerRGB = dwRedBits; + else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits) + pScreenPriv->dwBitsPerRGB = dwGreenBits; + else + pScreenPriv->dwBitsPerRGB = dwBlueBits; + + winDebug ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n", + (unsigned int) pScreenPriv->dwRedMask, + (unsigned int) pScreenPriv->dwGreenMask, + (unsigned int) pScreenPriv->dwBlueMask, + (int) pScreenPriv->dwBitsPerRGB); + + /* Create a single visual according to the Windows screen depth */ + switch (pScreenInfo->dwDepth) { case 24: case 16: case 15: - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - TrueColorMask, - pScreenPriv->dwBitsPerRGB, - TrueColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - break; + if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, + TrueColorMask, + pScreenPriv->dwBitsPerRGB, + TrueColor, + pScreenPriv->dwRedMask, + pScreenPriv->dwGreenMask, + pScreenPriv->dwBlueMask)) { + ErrorF("winInitVisualsPrimaryDD - " + "miSetVisualTypesAndMasks failed\n"); + return FALSE; + } + break; case 8: - winDebug ("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); - if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, - PseudoColorMask, - pScreenPriv->dwBitsPerRGB, - PseudoColor, - pScreenPriv->dwRedMask, - pScreenPriv->dwGreenMask, - pScreenPriv->dwBlueMask)) - { - ErrorF ("winInitVisualsPrimaryDD - " - "miSetVisualTypesAndMasks failed\n"); - return FALSE; - } - winDebug ("winInitVisualsPrimaryDD - Returned from " - "miSetVisualTypesAndMasks\n"); - break; + winDebug("winInitVisuals - Calling miSetVisualTypesAndMasks\n"); + if (!miSetVisualTypesAndMasks(pScreenInfo->dwDepth, + PseudoColorMask, + pScreenPriv->dwBitsPerRGB, + PseudoColor, + pScreenPriv->dwRedMask, + pScreenPriv->dwGreenMask, + pScreenPriv->dwBlueMask)) { + ErrorF("winInitVisualsPrimaryDD - " + "miSetVisualTypesAndMasks failed\n"); + return FALSE; + } + winDebug("winInitVisualsPrimaryDD - Returned from " + "miSetVisualTypesAndMasks\n"); + break; default: - ErrorF ("winInitVisualsPrimaryDD - Unknown screen depth\n"); - return FALSE; + ErrorF("winInitVisualsPrimaryDD - Unknown screen depth\n"); + return FALSE; } - winDebug ("winInitVisualsPrimaryDD - Returning\n"); + winDebug ("winInitVisualsPrimaryDD - Returning\n"); - return TRUE; + return TRUE; } - static Bool -winAdjustVideoModePrimaryDD (ScreenPtr pScreen) +winAdjustVideoModePrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = NULL; - DWORD dwBPP; - - /* We're in serious trouble if we can't get a DC */ - hdc = GetDC (NULL); - if (hdc == NULL) - { - ErrorF ("winAdjustVideoModePrimaryDD - GetDC failed\n"); - return FALSE; + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + HDC hdc = NULL; + DWORD dwBPP; + + /* We're in serious trouble if we can't get a DC */ + hdc = GetDC(NULL); + if (hdc == NULL) { + ErrorF("winAdjustVideoModePrimaryDD - GetDC failed\n"); + return FALSE; } - /* Query GDI for current display depth */ - dwBPP = GetDeviceCaps (hdc, BITSPIXEL); + /* Query GDI for current display depth */ + dwBPP = GetDeviceCaps(hdc, BITSPIXEL); - /* DirectDraw can only change the depth in fullscreen mode */ - if (!(pScreenInfo->fFullScreen && - (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) - { - /* Otherwise, We'll use GDI's depth */ - pScreenInfo->dwBPP = dwBPP; + /* DirectDraw can only change the depth in fullscreen mode */ + if (!(pScreenInfo->fFullScreen && (pScreenInfo->dwBPP != WIN_DEFAULT_BPP))) { + /* Otherwise, We'll use GDI's depth */ + pScreenInfo->dwBPP = dwBPP; } - /* Release our DC */ - ReleaseDC (NULL, hdc); + /* Release our DC */ + ReleaseDC(NULL, hdc); - return TRUE; + return TRUE; } - /* * We need to blit our offscreen fb to * the screen when we are activated, and we need to point @@ -454,85 +427,76 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen) */ static Bool -winActivateAppPrimaryDD (ScreenPtr pScreen) +winActivateAppPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - RECT rcSrc, rcClient; - HRESULT ddrval = DD_OK; - - /* Check for errors */ - if (pScreenPriv == NULL - || pScreenPriv->pScreenInfo == NULL - || pScreenPriv->pddsPrimary == NULL - || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Check for do-nothing */ - if (!pScreenPriv->fActive) - return TRUE; - - /* We are activating */ - ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsOffscreen); - if (ddrval == DD_OK) - { - IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, - NULL); - /* - * We don't check for an error from Unlock, because it - * doesn't matter if the Unlock failed. - */ + winScreenPriv(pScreen); + RECT rcSrc, rcClient; + HRESULT ddrval = DD_OK; + + /* Check for errors */ + if (pScreenPriv == NULL + || pScreenPriv->pScreenInfo == NULL + || pScreenPriv->pddsPrimary == NULL + || pScreenPriv->pddsOffscreen == NULL) + return FALSE; + + /* Check for do-nothing */ + if (!pScreenPriv->fActive) + return TRUE; + + /* We are activating */ + ddrval = IDirectDrawSurface2_IsLost(pScreenPriv->pddsOffscreen); + if (ddrval == DD_OK) { + IDirectDrawSurface2_Unlock(pScreenPriv->pddsOffscreen, NULL); + /* + * We don't check for an error from Unlock, because it + * doesn't matter if the Unlock failed. + */ } - /* Restore both surfaces, just cause I like it that way */ - IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenPriv->pScreenInfo->dwWidth; - rcSrc.bottom = pScreenPriv->pScreenInfo->dwHeight; - - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsOffscreen, - &rcSrc, - DDBLT_WAIT, - NULL); - if (ddrval != DD_OK) - FatalError ("winActivateAppPrimaryDD () - Failed blitting offscreen " - "surface to primary surface %08x\n", (unsigned int) ddrval); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsdPrimary, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK - || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError ("winActivateAppPrimaryDD () - Could not lock " - "primary surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdPrimary->lpSurface); - - /* - * Register the Alt-Tab combo as a hotkey so we can copy - * the primary framebuffer before the display mode changes - */ - RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9); - - return TRUE; -} + /* Restore both surfaces, just cause I like it that way */ + IDirectDrawSurface2_Restore(pScreenPriv->pddsOffscreen); + IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary); + + /* Get client area in screen coords */ + GetClientRect(pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints(pScreenPriv->hwndScreen, + HWND_DESKTOP, (LPPOINT) & rcClient, 2); + + /* Setup a source rectangle */ + rcSrc.left = 0; + rcSrc.top = 0; + rcSrc.right = pScreenPriv->pScreenInfo->dwWidth; + rcSrc.bottom = pScreenPriv->pScreenInfo->dwHeight; + + ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsPrimary, + &rcClient, + pScreenPriv->pddsOffscreen, + &rcSrc, DDBLT_WAIT, NULL); + if (ddrval != DD_OK) + FatalError("winActivateAppPrimaryDD () - Failed blitting offscreen " + "surface to primary surface %08x\n", (unsigned int) ddrval); + + /* Lock the primary surface */ + ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsPrimary, + &rcClient, + pScreenPriv->pddsdPrimary, + DDLOCK_WAIT, NULL); + if (ddrval != DD_OK || pScreenPriv->pddsdPrimary->lpSurface == NULL) + FatalError("winActivateAppPrimaryDD () - Could not lock " + "primary surface\n"); + + /* Notify FB of the new memory pointer */ + winUpdateFBPointer(pScreen, pScreenPriv->pddsdPrimary->lpSurface); + + /* + * Register the Alt-Tab combo as a hotkey so we can copy + * the primary framebuffer before the display mode changes + */ + RegisterHotKey(pScreenPriv->hwndScreen, 1, MOD_ALT, 9); + return TRUE; +} /* * Handle the Alt+Tab hotkey. @@ -543,133 +507,123 @@ winActivateAppPrimaryDD (ScreenPtr pScreen) */ static Bool -winHotKeyAltTabPrimaryDD (ScreenPtr pScreen) +winHotKeyAltTabPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RECT rcClient, rcSrc; - HRESULT ddrval = DD_OK; - - winDebug ("\nwinHotKeyAltTabPrimaryDD\n\n"); - - /* Alt+Tab was pressed, we will lose focus very soon */ - pScreenPriv->fActive = FALSE; - - /* Check for error conditions */ - if (pScreenPriv->pddsPrimary == NULL - || pScreenPriv->pddsOffscreen == NULL) - return FALSE; - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Did we loose the primary surface? */ - ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsPrimary); - if (ddrval == DD_OK) - { - ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, - NULL); - if (FAILED (ddrval)) - FatalError ("winHotKeyAltTabPrimaryDD - Failed unlocking primary " - "surface\n"); + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + RECT rcClient, rcSrc; + HRESULT ddrval = DD_OK; + + winDebug ("\nwinHotKeyAltTabPrimaryDD\n\n"); + + /* Alt+Tab was pressed, we will lose focus very soon */ + pScreenPriv->fActive = FALSE; + + /* Check for error conditions */ + if (pScreenPriv->pddsPrimary == NULL || pScreenPriv->pddsOffscreen == NULL) + return FALSE; + + /* Get client area in screen coords */ + GetClientRect(pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints(pScreenPriv->hwndScreen, + HWND_DESKTOP, (LPPOINT) & rcClient, 2); + + /* Did we loose the primary surface? */ + ddrval = IDirectDrawSurface2_IsLost(pScreenPriv->pddsPrimary); + if (ddrval == DD_OK) { + ddrval = IDirectDrawSurface2_Unlock(pScreenPriv->pddsPrimary, NULL); + if (FAILED(ddrval)) + FatalError("winHotKeyAltTabPrimaryDD - Failed unlocking primary " + "surface\n"); } - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen, - NULL, /* should be rcDest */ - pScreenPriv->pddsPrimary, - NULL, - DDBLT_WAIT, - NULL); - if (ddrval == DDERR_SURFACELOST) - { - IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen); - IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary); - - /* Blit the primary surface to the offscreen surface */ - ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsPrimary, - NULL, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - FatalError ("winHotKeyAltTabPrimaryDD - Failed blitting primary " - "surface to offscreen surface: %08x\n", - (unsigned int) ddrval); + /* Setup a source rectangle */ + rcSrc.left = 0; + rcSrc.top = 0; + rcSrc.right = pScreenInfo->dwWidth; + rcSrc.bottom = pScreenInfo->dwHeight; + + /* Blit the primary surface to the offscreen surface */ + ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsOffscreen, NULL, /* should be rcDest */ + pScreenPriv->pddsPrimary, + NULL, DDBLT_WAIT, NULL); + if (ddrval == DDERR_SURFACELOST) { + IDirectDrawSurface2_Restore(pScreenPriv->pddsOffscreen); + IDirectDrawSurface2_Restore(pScreenPriv->pddsPrimary); + + /* Blit the primary surface to the offscreen surface */ + ddrval = IDirectDrawSurface2_Blt(pScreenPriv->pddsOffscreen, + NULL, + pScreenPriv->pddsPrimary, + NULL, DDBLT_WAIT, NULL); + if (FAILED(ddrval)) + FatalError("winHotKeyAltTabPrimaryDD - Failed blitting primary " + "surface to offscreen surface: %08x\n", + (unsigned int) ddrval); } - else - { - FatalError ("winHotKeyAltTabPrimaryDD - Unknown error from " - "Blt: %08dx\n", (unsigned int) ddrval); + else { + FatalError("winHotKeyAltTabPrimaryDD - Unknown error from " + "Blt: %08dx\n", (unsigned int) ddrval); } - /* Lock the offscreen surface */ - ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsOffscreen, - NULL, - pScreenPriv->pddsdOffscreen, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK - || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError ("winHotKeyAltTabPrimaryDD - Could not lock " - "offscreen surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdOffscreen->lpSurface); - - /* Unregister our hotkey */ - UnregisterHotKey (pScreenPriv->hwndScreen, 1); - - return TRUE; -} + /* Lock the offscreen surface */ + ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsOffscreen, + NULL, + pScreenPriv->pddsdOffscreen, + DDLOCK_WAIT, NULL); + if (ddrval != DD_OK || pScreenPriv->pddsdPrimary->lpSurface == NULL) + FatalError("winHotKeyAltTabPrimaryDD - Could not lock " + "offscreen surface\n"); + + /* Notify FB of the new memory pointer */ + winUpdateFBPointer(pScreen, pScreenPriv->pddsdOffscreen->lpSurface); + + /* Unregister our hotkey */ + UnregisterHotKey(pScreenPriv->hwndScreen, 1); + return TRUE; +} /* Set engine specific functions */ Bool -winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen) +winSetEngineFunctionsPrimaryDD(ScreenPtr pScreen) { - winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - - /* Set our pointers */ - pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD; - pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD; - pScreenPriv->pwinShadowUpdate = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD; - pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD; - pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD; - pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD; - if (pScreenInfo->fFullScreen) - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen; - else - pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; - pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; - pScreenPriv->pwinBltExposedRegions = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; - pScreenPriv->pwinRedrawScreen = NULL; - pScreenPriv->pwinRealizeInstalledPalette = NULL; - pScreenPriv->pwinInstallColormap = NULL; - pScreenPriv->pwinStoreColors = NULL; - pScreenPriv->pwinCreateColormap = NULL; - pScreenPriv->pwinDestroyColormap = NULL; - pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD; - pScreenPriv->pwinCreatePrimarySurface = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; - pScreenPriv->pwinReleasePrimarySurface = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA; + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Set our pointers */ + pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD; + pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD; + pScreenPriv->pwinShadowUpdate = + (winShadowUpdateProcPtr) (void (*)(void)) NoopDDA; + pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD; + pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD; + pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD; + pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD; + if (pScreenInfo->fFullScreen) + pScreenPriv->pwinCreateBoundingWindow = + winCreateBoundingWindowFullScreen; + else + pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; + pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; + pScreenPriv->pwinBltExposedRegions = + (winBltExposedRegionsProcPtr) (void (*)(void)) NoopDDA; + pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; + pScreenPriv->pwinRedrawScreen = NULL; + pScreenPriv->pwinRealizeInstalledPalette = NULL; + pScreenPriv->pwinInstallColormap = NULL; + pScreenPriv->pwinStoreColors = NULL; + pScreenPriv->pwinCreateColormap = NULL; + pScreenPriv->pwinDestroyColormap = NULL; + pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD; + pScreenPriv->pwinCreatePrimarySurface = + (winCreatePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; + pScreenPriv->pwinReleasePrimarySurface = + (winReleasePrimarySurfaceProcPtr) (void (*)(void)) NoopDDA; #ifdef XWIN_MULTIWINDOW - pScreenPriv->pwinFinishCreateWindowsWindow = - (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA; + pScreenPriv->pwinFinishCreateWindowsWindow = + (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; #endif - return TRUE; + return TRUE; } |