837 ::GetMonitorInfo(mon2, &mi2) != 0 ) 838 { 839 if (::EqualRect(&mi1.rcMonitor, &mi2.rcMonitor) && 840 ::EqualRect(&mi1.rcWork, &mi2.rcWork) && 841 (mi1.dwFlags == mi1.dwFlags)) 842 { 843 844 J2dTraceLn(J2D_TRACE_VERBOSE, " the monitors are the same"); 845 return TRUE; 846 } 847 } 848 J2dTraceLn(J2D_TRACE_VERBOSE, " the monitors are not the same"); 849 return FALSE; 850 } 851 852 int AwtWin32GraphicsDevice::GetScreenFromHMONITOR(HMONITOR mon) { 853 J2dTraceLn1(J2D_TRACE_INFO, 854 "AwtWin32GraphicsDevice::GetScreenFromHMONITOR mhnd=%x", mon); 855 856 DASSERT(mon != NULL); 857 Devices::InstanceAccess devices; 858 859 for (int i = 0; i < devices->GetNumDevices(); i++) { 860 HMONITOR mhnd = devices->GetDevice(i)->GetMonitor(); 861 if (AreSameMonitors(mon, mhnd)) { 862 J2dTraceLn1(J2D_TRACE_VERBOSE, " Found device: %d", i); 863 return i; 864 } 865 } 866 867 J2dTraceLn1(J2D_TRACE_WARNING, 868 "AwtWin32GraphicsDevice::GetScreenFromHMONITOR(): "\ 869 "couldn't find screen for HMONITOR %x, returning default", mon); 870 return AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); 871 } 872 873 874 /** 875 * End of static deviceIndex-based methods 876 */ | 837 ::GetMonitorInfo(mon2, &mi2) != 0 ) 838 { 839 if (::EqualRect(&mi1.rcMonitor, &mi2.rcMonitor) && 840 ::EqualRect(&mi1.rcWork, &mi2.rcWork) && 841 (mi1.dwFlags == mi1.dwFlags)) 842 { 843 844 J2dTraceLn(J2D_TRACE_VERBOSE, " the monitors are the same"); 845 return TRUE; 846 } 847 } 848 J2dTraceLn(J2D_TRACE_VERBOSE, " the monitors are not the same"); 849 return FALSE; 850 } 851 852 int AwtWin32GraphicsDevice::GetScreenFromHMONITOR(HMONITOR mon) { 853 J2dTraceLn1(J2D_TRACE_INFO, 854 "AwtWin32GraphicsDevice::GetScreenFromHMONITOR mhnd=%x", mon); 855 856 DASSERT(mon != NULL); 857 JNIEnv *env = (JNIEnv*) JNU_GetEnv(jvm, JNI_VERSION_1_2); 858 if (!Devices::GetInstance()) { 859 Devices::UpdateInstance(env); 860 } 861 Devices::InstanceAccess devices; 862 863 for (int i = 0; i < devices->GetNumDevices(); i++) { 864 HMONITOR mhnd = devices->GetDevice(i)->GetMonitor(); 865 if (AreSameMonitors(mon, mhnd)) { 866 J2dTraceLn1(J2D_TRACE_VERBOSE, " Found device: %d", i); 867 return i; 868 } 869 } 870 871 J2dTraceLn1(J2D_TRACE_WARNING, 872 "AwtWin32GraphicsDevice::GetScreenFromHMONITOR(): "\ 873 "couldn't find screen for HMONITOR %x, returning default", mon); 874 return AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); 875 } 876 877 878 /** 879 * End of static deviceIndex-based methods 880 */ |