~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to hw/xwin/winpfbdd.c

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
 
40
40
/*
41
 
 * External symbols
42
 
 */
43
 
 
44
 
extern const GUID               _IID_IDirectDraw2;
45
 
extern HWND                     g_hDlgExit;
46
 
 
47
 
 
48
 
/*
49
41
 * Local function prototypes
50
42
 */
51
43
 
241
233
  return TRUE;
242
234
}
243
235
 
244
 
 
245
 
/*
246
 
 * Call the wrapped CloseScreen function.
247
 
 * 
248
 
 * Free our resources and private structures.
249
 
 */
250
 
 
251
 
static Bool
252
 
winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
 
236
static void
 
237
winFreeFBPrimaryDD (ScreenPtr pScreen)
253
238
{
254
239
  winScreenPriv(pScreen);
255
 
  winScreenInfo         *pScreenInfo = pScreenPriv->pScreenInfo;
256
 
  Bool                  fReturn;
257
 
  
258
 
  ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n");
259
 
 
260
 
  /* Flag that the screen is closed */
261
 
  pScreenPriv->fClosed = TRUE;
262
 
  pScreenPriv->fActive = FALSE;
263
 
 
264
 
  /* Call the wrapped CloseScreen procedure */
265
 
  WIN_UNWRAP(CloseScreen);
266
 
  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
267
 
 
268
 
  /* Delete the window property */
269
 
  RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
 
240
  winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
270
241
 
271
242
  /* Free the offscreen surface, if there is one */
272
243
  if (pScreenPriv->pddsOffscreen)
292
263
      pScreenPriv->pdd = NULL;
293
264
    }
294
265
 
 
266
  /* Invalidate the ScreenInfo's fb pointer */
 
267
  pScreenInfo->pfb = NULL;
 
268
}
 
269
 
 
270
static Bool
 
271
winInitScreenPrimaryDD(ScreenPtr pScreen)
 
272
{
 
273
  return winAllocateFBPrimaryDD(pScreen);
 
274
}
 
275
 
 
276
/*
 
277
 * Call the wrapped CloseScreen function.
 
278
 * 
 
279
 * Free our resources and private structures.
 
280
 */
 
281
 
 
282
static Bool
 
283
winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
 
284
{
 
285
  winScreenPriv(pScreen);
 
286
  winScreenInfo         *pScreenInfo = pScreenPriv->pScreenInfo;
 
287
  Bool                  fReturn;
 
288
  
 
289
  ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n");
 
290
 
 
291
  /* Flag that the screen is closed */
 
292
  pScreenPriv->fClosed = TRUE;
 
293
  pScreenPriv->fActive = FALSE;
 
294
 
 
295
  /* Call the wrapped CloseScreen procedure */
 
296
  WIN_UNWRAP(CloseScreen);
 
297
  fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
 
298
 
 
299
  /* Delete the window property */
 
300
  RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
 
301
 
 
302
  winFreeFBPrimaryDD(pScreen);
 
303
 
295
304
  /* Delete tray icon, if we have one */
296
305
  if (!pScreenInfo->fNoTrayIcon)
297
306
    winDeleteNotifyIcon (pScreenPriv);
313
322
  /* Kill our screeninfo's pointer to the screen */
314
323
  pScreenInfo->pScreen = NULL;
315
324
 
316
 
  /* Invalidate the ScreenInfo's fb pointer */
317
 
  pScreenInfo->pfb = NULL;
318
 
 
319
325
  /* Free the screen privates for this screen */
320
326
  free ((pointer) pScreenPriv);
321
327
 
430
436
  dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
431
437
 
432
438
  /* DirectDraw can only change the depth in fullscreen mode */
433
 
  if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
434
 
    {
435
 
      /* No -depth parameter passed, let the user know the depth being used */
436
 
      ErrorF ("winAdjustVideoModePrimaryDD - Using Windows display "
437
 
              "depth of %d bits per pixel\n", (int) dwBPP);
438
 
 
439
 
      /* Use GDI's depth */
440
 
      pScreenInfo->dwBPP = dwBPP;
441
 
    }
442
 
  else if (pScreenInfo->fFullScreen
443
 
           && pScreenInfo->dwBPP != dwBPP)
444
 
    {
445
 
      /* FullScreen, and GDI depth differs from -depth parameter */
446
 
      ErrorF ("winAdjustVideoModePrimaryDD - FullScreen, using command "
447
 
              "line depth: %d\n", (int) pScreenInfo->dwBPP);
448
 
    }
449
 
  else if (dwBPP != pScreenInfo->dwBPP)
450
 
    {
451
 
      /* Windowed, and GDI depth differs from -depth parameter */
452
 
      ErrorF ("winAdjustVideoModePrimaryDD - Windowed, command line "
453
 
              "depth: %d, using depth: %d\n",
454
 
              (int) pScreenInfo->dwBPP, (int) dwBPP);
455
 
 
456
 
      /* We'll use GDI's depth */
457
 
      pScreenInfo->dwBPP = dwBPP;
458
 
    }
459
 
  
 
439
  if (!(pScreenInfo->fFullScreen &&
 
440
        (pScreenInfo->dwBPP != WIN_DEFAULT_BPP)))
 
441
    {
 
442
      /* Otherwise, We'll use GDI's depth */
 
443
      pScreenInfo->dwBPP = dwBPP;
 
444
    }
 
445
 
460
446
  /* Release our DC */
461
447
  ReleaseDC (NULL, hdc);
462
448
 
661
647
  
662
648
  /* Set our pointers */
663
649
  pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD;
664
 
  pScreenPriv->pwinShadowUpdate
665
 
    = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA;
 
650
  pScreenPriv->pwinFreeFB = winFreeFBPrimaryDD;
 
651
  pScreenPriv->pwinShadowUpdate = (winShadowUpdateProcPtr) (void (*)(void))NoopDDA;
 
652
  pScreenPriv->pwinInitScreen = winInitScreenPrimaryDD;
666
653
  pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD;
667
654
  pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD;
668
655
  pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD;
671
658
  else
672
659
    pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
673
660
  pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
674
 
  pScreenPriv->pwinBltExposedRegions
675
 
    = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA;
 
661
  pScreenPriv->pwinBltExposedRegions = (winBltExposedRegionsProcPtr) (void (*)(void))NoopDDA;
676
662
  pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
 
663
  pScreenPriv->pwinRedrawScreen = NULL;
 
664
  pScreenPriv->pwinRealizeInstalledPalette = NULL;
 
665
  pScreenPriv->pwinInstallColormap = NULL;
 
666
  pScreenPriv->pwinStoreColors = NULL;
 
667
  pScreenPriv->pwinCreateColormap = NULL;
 
668
  pScreenPriv->pwinDestroyColormap = NULL;
677
669
  pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD;
 
670
  pScreenPriv->pwinCreatePrimarySurface = (winCreatePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
 
671
  pScreenPriv->pwinReleasePrimarySurface = (winReleasePrimarySurfaceProcPtr) (void (*)(void))NoopDDA;
678
672
#ifdef XWIN_MULTIWINDOW
679
673
  pScreenPriv->pwinFinishCreateWindowsWindow =
680
674
    (winFinishCreateWindowsWindowProcPtr) (void (*)(void))NoopDDA;