< prev index next >

src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c

Print this page




 420     style = WS_POPUP;
 421     hWnd = CreateWindowEx(exStyle, (LPCSTR) wndClass, "", style,
 422             splash->x, splash->y, splash->width, splash->height, NULL, NULL,
 423             wcex.hInstance, NULL);
 424     SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) splash);
 425     return hWnd;
 426 }
 427 
 428 void
 429 SplashLock(Splash * splash)
 430 {
 431     EnterCriticalSection(&splash->lock);
 432 }
 433 
 434 void
 435 SplashUnlock(Splash * splash)
 436 {
 437     LeaveCriticalSection(&splash->lock);
 438 }
 439 
 440 void
 441 SplashInitPlatform(Splash * splash)
 442 {
 443     HDC hdc;
 444     int paletteMode;
 445 
 446     InitializeCriticalSection(&splash->lock);
 447     splash->isLayered = FALSE;
 448     hdc = GetDC(NULL);
 449     paletteMode = (GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) != 0;
 450     if (UpdateLayeredWindow && !paletteMode) {
 451         splash->isLayered = TRUE;
 452     }
 453     splash->byteAlignment = 4;
 454     if (splash->isLayered) {
 455         initFormat(&splash->screenFormat,
 456                 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
 457         splash->screenFormat.premultiplied = 1;
 458         splash->maskRequired = 0;
 459     }
 460     else {


 469             /*      FIXME: maybe remapping to non-reserved colors would improve performance */
 470             for (i = 0; i < numColors; i++) {
 471                 splash->colorIndex[i] = i;
 472             }
 473             numColors = quantizeColors(numColors, numComponents);
 474             initColorCube(numComponents, splash->colorMap, splash->dithers,
 475                     splash->colorIndex);
 476             splash->screenFormat.colorIndex = splash->colorIndex;
 477             splash->screenFormat.depthBytes = 1;
 478             splash->screenFormat.colorMap = splash->colorMap;
 479             splash->screenFormat.dithers = splash->dithers;
 480             splash->screenFormat.numColors = numColors;
 481             splash->hPalette = NULL;
 482         }
 483         else {
 484             initFormat(&splash->screenFormat,
 485                     0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
 486         }
 487     }
 488     ReleaseDC(NULL, hdc);

 489 }
 490 
 491 void
 492 SplashCleanupPlatform(Splash * splash)
 493 {
 494     int i;
 495 
 496     if (splash->frames) {
 497         for (i = 0; i < splash->frameCount; i++) {
 498             if (splash->frames[i].hRgn) {
 499                 DeleteObject(splash->frames[i].hRgn);
 500                 splash->frames[i].hRgn = NULL;
 501             }
 502         }
 503     }
 504     if (splash->hPalette)
 505         DeleteObject(splash->hPalette);
 506     splash->maskRequired = !splash->isLayered;
 507 }
 508 




 420     style = WS_POPUP;
 421     hWnd = CreateWindowEx(exStyle, (LPCSTR) wndClass, "", style,
 422             splash->x, splash->y, splash->width, splash->height, NULL, NULL,
 423             wcex.hInstance, NULL);
 424     SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) splash);
 425     return hWnd;
 426 }
 427 
 428 void
 429 SplashLock(Splash * splash)
 430 {
 431     EnterCriticalSection(&splash->lock);
 432 }
 433 
 434 void
 435 SplashUnlock(Splash * splash)
 436 {
 437     LeaveCriticalSection(&splash->lock);
 438 }
 439 
 440 int
 441 SplashInitPlatform(Splash * splash)
 442 {
 443     HDC hdc;
 444     int paletteMode;
 445 
 446     InitializeCriticalSection(&splash->lock);
 447     splash->isLayered = FALSE;
 448     hdc = GetDC(NULL);
 449     paletteMode = (GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) != 0;
 450     if (UpdateLayeredWindow && !paletteMode) {
 451         splash->isLayered = TRUE;
 452     }
 453     splash->byteAlignment = 4;
 454     if (splash->isLayered) {
 455         initFormat(&splash->screenFormat,
 456                 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
 457         splash->screenFormat.premultiplied = 1;
 458         splash->maskRequired = 0;
 459     }
 460     else {


 469             /*      FIXME: maybe remapping to non-reserved colors would improve performance */
 470             for (i = 0; i < numColors; i++) {
 471                 splash->colorIndex[i] = i;
 472             }
 473             numColors = quantizeColors(numColors, numComponents);
 474             initColorCube(numComponents, splash->colorMap, splash->dithers,
 475                     splash->colorIndex);
 476             splash->screenFormat.colorIndex = splash->colorIndex;
 477             splash->screenFormat.depthBytes = 1;
 478             splash->screenFormat.colorMap = splash->colorMap;
 479             splash->screenFormat.dithers = splash->dithers;
 480             splash->screenFormat.numColors = numColors;
 481             splash->hPalette = NULL;
 482         }
 483         else {
 484             initFormat(&splash->screenFormat,
 485                     0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
 486         }
 487     }
 488     ReleaseDC(NULL, hdc);
 489     return 1;
 490 }
 491 
 492 void
 493 SplashCleanupPlatform(Splash * splash)
 494 {
 495     int i;
 496 
 497     if (splash->frames) {
 498         for (i = 0; i < splash->frameCount; i++) {
 499             if (splash->frames[i].hRgn) {
 500                 DeleteObject(splash->frames[i].hRgn);
 501                 splash->frames[i].hRgn = NULL;
 502             }
 503         }
 504     }
 505     if (splash->hPalette)
 506         DeleteObject(splash->hPalette);
 507     splash->maskRequired = !splash->isLayered;
 508 }
 509 


< prev index next >