2340 case 24: nColor = 16777216; break; 2341 } 2342 ::DeleteDC(hIC); 2343 return nColor; 2344 2345 CATCH_BAD_ALLOC_RET(0); 2346 } 2347 2348 /* 2349 * Class: sun_awt_windows_WToolkit 2350 * Method: getScreenWidth 2351 * Signature: ()I 2352 */ 2353 JNIEXPORT jint JNICALL 2354 Java_sun_awt_windows_WToolkit_getScreenWidth(JNIEnv *env, jobject self) 2355 { 2356 TRY; 2357 2358 int width = ::GetSystemMetrics(SM_CXSCREEN); 2359 2360 Devices::InstanceAccess devices; 2361 AwtWin32GraphicsDevice *device = devices->GetDevice( 2362 AwtWin32GraphicsDevice::GetDefaultDeviceIndex()); 2363 2364 return (device == NULL) ? width : device->ScaleDownX(width); 2365 CATCH_BAD_ALLOC_RET(0); 2366 } 2367 2368 /* 2369 * Class: sun_awt_windows_WToolkit 2370 * Method: getScreenHeight 2371 * Signature: ()I 2372 */ 2373 JNIEXPORT jint JNICALL 2374 Java_sun_awt_windows_WToolkit_getScreenHeight(JNIEnv *env, jobject self) 2375 { 2376 TRY; 2377 2378 int height = ::GetSystemMetrics(SM_CYSCREEN); 2379 Devices::InstanceAccess devices; 2380 AwtWin32GraphicsDevice *device = devices->GetDevice( 2381 AwtWin32GraphicsDevice::GetDefaultDeviceIndex()); 2382 2383 return (device == NULL) ? height : device->ScaleDownY(height); 2384 2385 CATCH_BAD_ALLOC_RET(0); 2386 } 2387 2388 /* 2389 * Class: sun_awt_windows_WToolkit 2390 * Method: getSreenInsets 2391 * Signature: (I)Ljava/awt/Insets; 2392 */ 2393 JNIEXPORT jobject JNICALL 2394 Java_sun_awt_windows_WToolkit_getScreenInsets(JNIEnv *env, 2395 jobject self, 2396 jint screen) 2397 { 2398 jobject insets = NULL; | 2340 case 24: nColor = 16777216; break; 2341 } 2342 ::DeleteDC(hIC); 2343 return nColor; 2344 2345 CATCH_BAD_ALLOC_RET(0); 2346 } 2347 2348 /* 2349 * Class: sun_awt_windows_WToolkit 2350 * Method: getScreenWidth 2351 * Signature: ()I 2352 */ 2353 JNIEXPORT jint JNICALL 2354 Java_sun_awt_windows_WToolkit_getScreenWidth(JNIEnv *env, jobject self) 2355 { 2356 TRY; 2357 2358 int width = ::GetSystemMetrics(SM_CXSCREEN); 2359 2360 if (!Devices::GetInstance()) { 2361 Devices::UpdateInstance(env); 2362 } 2363 Devices::InstanceAccess devices; 2364 AwtWin32GraphicsDevice *device = devices->GetDevice( 2365 AwtWin32GraphicsDevice::GetDefaultDeviceIndex()); 2366 2367 return (device == NULL) ? width : device->ScaleDownX(width); 2368 CATCH_BAD_ALLOC_RET(0); 2369 } 2370 2371 /* 2372 * Class: sun_awt_windows_WToolkit 2373 * Method: getScreenHeight 2374 * Signature: ()I 2375 */ 2376 JNIEXPORT jint JNICALL 2377 Java_sun_awt_windows_WToolkit_getScreenHeight(JNIEnv *env, jobject self) 2378 { 2379 TRY; 2380 2381 int height = ::GetSystemMetrics(SM_CYSCREEN); 2382 2383 if (!Devices::GetInstance()) { 2384 Devices::UpdateInstance(env); 2385 } 2386 Devices::InstanceAccess devices; 2387 AwtWin32GraphicsDevice *device = devices->GetDevice( 2388 AwtWin32GraphicsDevice::GetDefaultDeviceIndex()); 2389 2390 return (device == NULL) ? height : device->ScaleDownY(height); 2391 2392 CATCH_BAD_ALLOC_RET(0); 2393 } 2394 2395 /* 2396 * Class: sun_awt_windows_WToolkit 2397 * Method: getSreenInsets 2398 * Signature: (I)Ljava/awt/Insets; 2399 */ 2400 JNIEXPORT jobject JNICALL 2401 Java_sun_awt_windows_WToolkit_getScreenInsets(JNIEnv *env, 2402 jobject self, 2403 jint screen) 2404 { 2405 jobject insets = NULL; |