Changeset 187
- Timestamp:
- Dec 2, 2010, 3:22:33 AM (15 years ago)
- Location:
- trunk/openjdk/jdk/src/windows/native/sun/windows
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.h
r183 r187 77 77 // to proper JNI functions. 78 78 #ifdef __WIN32OS2__ 79 #define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast< jchar*>(x), static_cast<jsize>(_tcslen(reinterpret_cast<LPTSTR>(x))))79 #define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast<const jchar*>(x), static_cast<jsize>(_tcslen(reinterpret_cast<LPCTSTR>(x)))) 80 80 #define JNU_GetStringPlatformChars(env, x, y) (LPWSTR)env->GetStringChars(x, y) 81 #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast< jchar*>(y))81 #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast<const jchar*>(y)) 82 82 #else 83 83 #define JNU_NewStringPlatform(env, x) env->NewString(x, static_cast<jsize>(_tcslen(x))) -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Button.cpp
r2 r187 107 107 labelStr = L""; 108 108 } else { 109 labelStr = env->GetStringChars(label, JNI_FALSE);109 labelStr = (LPCWSTR)env->GetStringChars(label, JNI_FALSE); 110 110 } 111 111 style = 0; … … 129 129 c->UpdateBackground(env, target); 130 130 if (label != NULL) 131 env->ReleaseStringChars(label, labelStr);131 env->ReleaseStringChars(label, (jchar*)labelStr); 132 132 } catch (...) { 133 133 env->DeleteLocalRef(target); -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Canvas.cpp
r2 r187 212 212 213 213 PDATA pData; 214 AwtCanvas *c; 214 215 JNI_CHECK_PEER_GOTO(canvas, ret); 215 216 216 AwtCanvas *c = (AwtCanvas*)pData;217 c = (AwtCanvas*)pData; 217 218 c->m_eraseBackground = doErase; 218 219 c->m_eraseBackgroundOnResize = doEraseOnResize; -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp
r2 r187 107 107 label = (jstring)env->GetObjectField(target, AwtCheckbox::labelID); 108 108 if (label != NULL) { 109 labelStr = env->GetStringChars(label, 0);109 labelStr = (LPCWSTR)env->GetStringChars(label, 0); 110 110 } 111 111 if (labelStr != 0) { … … 124 124 125 125 if (labelStr != defaultLabelStr) { 126 env->ReleaseStringChars(label, labelStr);126 env->ReleaseStringChars(label, (jchar*)labelStr); 127 127 } 128 128 } else { -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Choice.h
r2 r187 77 77 78 78 BOOL ActMouseMessage(MSG * pMsg); 79 INLINE BOOL AwtChoice::IsChoiceOpened() {return SendMessage(CB_GETDROPPEDSTATE, 0, 0);}79 INLINE BOOL IsChoiceOpened() {return SendMessage(CB_GETDROPPEDSTATE, 0, 0);} 80 80 81 81 static BOOL mouseCapture; -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Clipboard.cpp
r2 r187 260 260 LPMETAFILEPICT lpMfpOld = (LPMETAFILEPICT)lpbMfpBuffer; 261 261 262 HMETAFILEPICT hmfp = ::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));262 HMETAFILEPICT hmfp = (HMETAFILEPICT)::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT)); 263 263 if (hmfp == NULL) { 264 264 VERIFY(::DeleteMetaFile(hmf)); -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp
r2 r187 28 28 #include <zmouse.h> 29 29 30 #ifdef __WIN32OS2__ 31 #include <minivcrt.h> 32 #endif 33 30 34 #include "jlong.h" 31 35 #include "awt_AWTEvent.h" … … 71 75 #include <tchar.h> 72 76 #include <imm.h> 77 #ifndef __WIN32OS2__ 73 78 #include <ime.h> 79 #endif 74 80 // End -- Win32 SDK include files 75 81 … … 83 89 84 90 // <XXX> <!-- TEMPORARY HACK TO TEST AGAINST OLD VC INLCUDES --> 85 #if !defined(__int3264) 91 #if !defined(__int3264) && !defined(__WIN32OS2__) 86 92 #define GetWindowLongPtr GetWindowLong 87 93 #define SetWindowLongPtr SetWindowLong … … 3077 3083 {java_awt_event_KeyEvent_VK_NONCONVERT, VK_NONCONVERT}, 3078 3084 {java_awt_event_KeyEvent_VK_INPUT_METHOD_ON_OFF, VK_KANJI}, 3085 #ifndef __WIN32OS2__ 3079 3086 {java_awt_event_KeyEvent_VK_ALPHANUMERIC, VK_DBE_ALPHANUMERIC}, 3080 3087 {java_awt_event_KeyEvent_VK_KATAKANA, VK_DBE_KATAKANA}, … … 3083 3090 {java_awt_event_KeyEvent_VK_HALF_WIDTH, VK_DBE_SBCSCHAR}, 3084 3091 {java_awt_event_KeyEvent_VK_ROMAN_CHARACTERS, VK_DBE_ROMAN}, 3092 #endif 3085 3093 3086 3094 {java_awt_event_KeyEvent_VK_UNDEFINED, 0} … … 3328 3336 *modifiers = java_awt_event_InputEvent_SHIFT_DOWN_MASK; 3329 3337 return; 3338 #ifndef __WIN32OS2__ 3330 3339 case java_awt_event_KeyEvent_VK_CODE_INPUT: 3331 3340 *windowsKey = VK_DBE_ALPHANUMERIC; 3332 3341 *modifiers = java_awt_event_InputEvent_ALT_DOWN_MASK; 3333 3342 return; 3343 #endif 3334 3344 case java_awt_event_KeyEvent_VK_KANA_LOCK: 3335 3345 if (isKanaLockAvailable()) { … … 3398 3408 } 3399 3409 break; 3410 #ifndef __WIN32OS2__ 3400 3411 case VK_DBE_ALPHANUMERIC: 3401 3412 if ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) != 0) { … … 3403 3414 } 3404 3415 break; 3416 #endif 3405 3417 case VK_KANA: 3406 3418 if (isKanaLockAvailable()) { … … 3868 3880 return; 3869 3881 } 3870 COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, NULL};3882 COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, {0,0,0,0}}; 3871 3883 // Place the composition window right below the client Window 3872 3884 ImmSetCompositionWindow(hIMC, &cf); … … 5335 5347 void AwtComponent::BeginValidate() 5336 5348 { 5337 DASSERT( m_validationNestCount >= 0 &&5349 DASSERT(/*m_validationNestCount >= 0 &&*/ 5338 5350 m_validationNestCount < 1000); // sanity check 5339 5351 … … 6732 6744 rfs->cause = env->NewGlobalRef(cause); 6733 6745 6734 return (jboolean) AwtToolkit::GetInstance().SyncCall(6746 return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall( 6735 6747 (void*(*)(void*))AwtComponent::_RequestFocus, rfs); 6736 6748 // global refs and rfs are deleted in _RequestFocus … … 6919 6931 TRY; 6920 6932 6921 return (jboolean) AwtToolkit::GetInstance().SyncCall(6933 return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall( 6922 6934 (void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling, 6923 6935 env->NewGlobalRef(self)); … … 6940 6952 jobject selfGlobalRef = env->NewGlobalRef(self); 6941 6953 6942 return (jboolean) AwtToolkit::GetInstance().SyncCall(6954 return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall( 6943 6955 (void*(*)(void*))AwtComponent::_IsObscured, 6944 6956 (void *)selfGlobalRef); -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp
r2 r187 35 35 36 36 #include "locale_str.h" 37 38 #ifndef max 39 #define max(a,b) ( (a>b) ? a : b ) 40 #endif 41 #ifndef min 42 #define min(a,b) ( (a<b) ? a : b ) 43 #endif 37 44 38 45 #define GALLOCFLG (GMEM_DDESHARE | GMEM_MOVEABLE | GMEM_ZEROINIT) -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Desktop.cpp
r2 r187 41 41 (JNIEnv *env, jclass cls, jstring uri_j, jstring verb_j) 42 42 { 43 const WCHAR* uri_c = env->GetStringChars(uri_j, JNI_FALSE);44 const WCHAR* verb_c = env->GetStringChars(verb_j, JNI_FALSE);43 const WCHAR* uri_c = (const WCHAR*)env->GetStringChars(uri_j, JNI_FALSE); 44 const WCHAR* verb_c = (const WCHAR*)env->GetStringChars(verb_j, JNI_FALSE); 45 45 46 46 // 6457572: ShellExecute possibly changes FPU control word - saving it here … … 49 49 _control87(oldcontrol87, 0xffffffff); 50 50 51 env->ReleaseStringChars(uri_j, uri_c);52 env->ReleaseStringChars(verb_j, verb_c);51 env->ReleaseStringChars(uri_j, (jchar*)uri_c); 52 env->ReleaseStringChars(verb_j, (jchar*)verb_c); 53 53 54 54 if ((int)retval <= 32) { … … 66 66 NULL ); 67 67 68 jstring errmsg = env->NewString(( LPCWSTR)buffer, len);68 jstring errmsg = env->NewString((jchar*)buffer, len); 69 69 LocalFree(buffer); 70 70 return errmsg; -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp
r2 r187 36 36 #include "shellapi.h" 37 37 38 #ifndef max 39 #define max(a,b) ( (a>b) ? a : b ) 40 #endif 41 #ifndef min 42 #define min(a,b) ( (a<b) ? a : b ) 43 #endif 44 38 45 // WDesktopProperties fields 39 46 jfieldID AwtDesktopProperties::pDataID = 0; … … 668 675 669 676 void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { 670 jstring key = JNU_NewStringPlatform(GetEnv(), propName);677 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 671 678 GetEnv()->CallVoidMethod(self, 672 679 AwtDesktopProperties::setStringPropertyID, … … 676 683 677 684 void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { 678 jstring key = JNU_NewStringPlatform(GetEnv(), propName);685 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 679 686 GetEnv()->CallVoidMethod(self, 680 687 AwtDesktopProperties::setIntegerPropertyID, … … 684 691 685 692 void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { 686 jstring key = JNU_NewStringPlatform(GetEnv(), propName);693 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 687 694 GetEnv()->CallVoidMethod(self, 688 695 AwtDesktopProperties::setBooleanPropertyID, … … 692 699 693 700 void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) { 694 jstring key = JNU_NewStringPlatform(GetEnv(), propName);701 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 695 702 GetEnv()->CallVoidMethod(self, 696 703 AwtDesktopProperties::setColorPropertyID, … … 727 734 // fall back to Microsoft Sans Serif 728 735 fontName = JNU_NewStringPlatform(GetEnv(), 729 736 (const jchar*)L"Microsoft Sans Serif"); 730 737 } 731 738 } … … 744 751 } 745 752 746 jstring key = JNU_NewStringPlatform(GetEnv(), propName);753 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 747 754 GetEnv()->CallVoidMethod(self, 748 755 AwtDesktopProperties::setFontPropertyID, … … 785 792 } 786 793 787 jstring key = JNU_NewStringPlatform(GetEnv(), propName);794 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 788 795 GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, 789 796 key, fontName, style, pointSize); … … 794 801 795 802 void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventName) { 796 jstring key = JNU_NewStringPlatform(GetEnv(), propName);797 jstring event = JNU_NewStringPlatform(GetEnv(), winEventName);803 jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName); 804 jstring event = JNU_NewStringPlatform(GetEnv(), (const jchar*)winEventName); 798 805 GetEnv()->CallVoidMethod(self, 799 806 AwtDesktopProperties::setSoundPropertyID, -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp
r2 r187 150 150 } 151 151 case WM_NOTIFY: { 152 #ifdef __WIN32OS2__ 153 OFNOTIFY *notifyEx = (OFNOTIFY *)lParam; 154 #else 152 155 OFNOTIFYEX *notifyEx = (OFNOTIFYEX *)lParam; 156 #endif 153 157 if (notifyEx) { 154 158 jobject peer = (jobject)(::GetProp(parent, ModalDialogPeerProp)); … … 223 227 224 228 if (title == NULL || env->GetStringLength(title)==0) { 225 title = env->NewString( &unicodeChar, 1);229 title = env->NewString((const jchar*)&unicodeChar, 1); 226 230 } 227 231 -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.h
r2 r187 34 34 #include <ole2.h> 35 35 #include <richedit.h> 36 #ifndef __WIN32OS2__ 36 37 #include <richole.h> 38 #endif 37 39 38 40 -
trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.h
r2 r187 34 34 35 35 #include <malloc.h> 36 #ifdef __GNUC__ 37 #include <alloca.h> 38 #endif 36 39 37 40 // Get a Unicode string copy of a Java String object (Java String aren't
Note:
See TracChangeset
for help on using the changeset viewer.