Changeset 187


Ignore:
Timestamp:
Dec 2, 2010, 3:22:33 AM (15 years ago)
Author:
dmik
Message:

jdk/awt: Continued.

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  
    7777// to proper JNI functions.
    7878#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))))
    8080#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))
    8282#else
    8383#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  
    107107            labelStr = L"";
    108108        } else {
    109             labelStr = env->GetStringChars(label, JNI_FALSE);
     109            labelStr = (LPCWSTR)env->GetStringChars(label, JNI_FALSE);
    110110        }
    111111        style = 0;
     
    129129        c->UpdateBackground(env, target);
    130130        if (label != NULL)
    131             env->ReleaseStringChars(label, labelStr);
     131            env->ReleaseStringChars(label, (jchar*)labelStr);
    132132    } catch (...) {
    133133        env->DeleteLocalRef(target);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Canvas.cpp

    r2 r187  
    212212
    213213    PDATA pData;
     214    AwtCanvas *c;
    214215    JNI_CHECK_PEER_GOTO(canvas, ret);
    215216
    216     AwtCanvas *c = (AwtCanvas*)pData;
     217    c = (AwtCanvas*)pData;
    217218    c->m_eraseBackground = doErase;
    218219    c->m_eraseBackgroundOnResize = doEraseOnResize;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp

    r2 r187  
    107107            label = (jstring)env->GetObjectField(target, AwtCheckbox::labelID);
    108108            if (label != NULL) {
    109                 labelStr = env->GetStringChars(label, 0);
     109                labelStr = (LPCWSTR)env->GetStringChars(label, 0);
    110110            }
    111111            if (labelStr != 0) {
     
    124124
    125125                if (labelStr != defaultLabelStr) {
    126                     env->ReleaseStringChars(label, labelStr);
     126                    env->ReleaseStringChars(label, (jchar*)labelStr);
    127127                }
    128128            } else {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Choice.h

    r2 r187  
    7777
    7878    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);}
    8080
    8181    static BOOL mouseCapture;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Clipboard.cpp

    r2 r187  
    260260        LPMETAFILEPICT lpMfpOld = (LPMETAFILEPICT)lpbMfpBuffer;
    261261
    262         HMETAFILEPICT hmfp = ::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
     262        HMETAFILEPICT hmfp = (HMETAFILEPICT)::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
    263263        if (hmfp == NULL) {
    264264            VERIFY(::DeleteMetaFile(hmf));
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp

    r2 r187  
    2828#include <zmouse.h>
    2929
     30#ifdef __WIN32OS2__
     31#include <minivcrt.h>
     32#endif
     33
    3034#include "jlong.h"
    3135#include "awt_AWTEvent.h"
     
    7175#include <tchar.h>
    7276#include <imm.h>
     77#ifndef __WIN32OS2__
    7378#include <ime.h>
     79#endif
    7480// End -- Win32 SDK include files
    7581
     
    8389
    8490// <XXX> <!-- TEMPORARY HACK TO TEST AGAINST OLD VC INLCUDES -->
    85 #if !defined(__int3264)
     91#if !defined(__int3264) && !defined(__WIN32OS2__)
    8692#define GetWindowLongPtr GetWindowLong
    8793#define SetWindowLongPtr SetWindowLong
     
    30773083    {java_awt_event_KeyEvent_VK_NONCONVERT,       VK_NONCONVERT},
    30783084    {java_awt_event_KeyEvent_VK_INPUT_METHOD_ON_OFF, VK_KANJI},
     3085#ifndef __WIN32OS2__
    30793086    {java_awt_event_KeyEvent_VK_ALPHANUMERIC,     VK_DBE_ALPHANUMERIC},
    30803087    {java_awt_event_KeyEvent_VK_KATAKANA,         VK_DBE_KATAKANA},
     
    30833090    {java_awt_event_KeyEvent_VK_HALF_WIDTH,       VK_DBE_SBCSCHAR},
    30843091    {java_awt_event_KeyEvent_VK_ROMAN_CHARACTERS, VK_DBE_ROMAN},
     3092#endif
    30853093
    30863094    {java_awt_event_KeyEvent_VK_UNDEFINED,        0}
     
    33283336            *modifiers = java_awt_event_InputEvent_SHIFT_DOWN_MASK;
    33293337            return;
     3338#ifndef __WIN32OS2__
    33303339        case java_awt_event_KeyEvent_VK_CODE_INPUT:
    33313340            *windowsKey = VK_DBE_ALPHANUMERIC;
    33323341            *modifiers = java_awt_event_InputEvent_ALT_DOWN_MASK;
    33333342            return;
     3343#endif
    33343344        case java_awt_event_KeyEvent_VK_KANA_LOCK:
    33353345            if (isKanaLockAvailable()) {
     
    33983408            }
    33993409            break;
     3410#ifndef __WIN32OS2__
    34003411        case VK_DBE_ALPHANUMERIC:
    34013412            if ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) != 0) {
     
    34033414            }
    34043415            break;
     3416#endif
    34053417        case VK_KANA:
    34063418            if (isKanaLockAvailable()) {
     
    38683880        return;
    38693881    }
    3870     COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, NULL};
     3882    COMPOSITIONFORM cf = {CFS_POINT, {0, r.bottom}, {0,0,0,0}};
    38713883    // Place the composition window right below the client Window
    38723884    ImmSetCompositionWindow(hIMC, &cf);
     
    53355347void AwtComponent::BeginValidate()
    53365348{
    5337     DASSERT(m_validationNestCount >= 0 &&
     5349    DASSERT(/*m_validationNestCount >= 0 &&*/
    53385350           m_validationNestCount < 1000); // sanity check
    53395351
     
    67326744    rfs->cause = env->NewGlobalRef(cause);
    67336745
    6734     return (jboolean)AwtToolkit::GetInstance().SyncCall(
     6746    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
    67356747        (void*(*)(void*))AwtComponent::_RequestFocus, rfs);
    67366748    // global refs and rfs are deleted in _RequestFocus
     
    69196931    TRY;
    69206932
    6921     return (jboolean)AwtToolkit::GetInstance().SyncCall(
     6933    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
    69226934        (void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling,
    69236935        env->NewGlobalRef(self));
     
    69406952    jobject selfGlobalRef = env->NewGlobalRef(self);
    69416953
    6942     return (jboolean)AwtToolkit::GetInstance().SyncCall(
     6954    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
    69436955        (void*(*)(void*))AwtComponent::_IsObscured,
    69446956        (void *)selfGlobalRef);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp

    r2 r187  
    3535
    3636#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
    3744
    3845#define GALLOCFLG (GMEM_DDESHARE | GMEM_MOVEABLE | GMEM_ZEROINIT)
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Desktop.cpp

    r2 r187  
    4141  (JNIEnv *env, jclass cls, jstring uri_j, jstring verb_j)
    4242{
    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);
    4545
    4646    // 6457572: ShellExecute possibly changes FPU control word - saving it here
     
    4949    _control87(oldcontrol87, 0xffffffff);
    5050
    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);
    5353
    5454    if ((int)retval <= 32) {
     
    6666                    NULL );
    6767
    68         jstring errmsg = env->NewString((LPCWSTR)buffer, len);
     68        jstring errmsg = env->NewString((jchar*)buffer, len);
    6969        LocalFree(buffer);
    7070        return errmsg;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp

    r2 r187  
    3636#include "shellapi.h"
    3737
     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
    3845// WDesktopProperties fields
    3946jfieldID AwtDesktopProperties::pDataID = 0;
     
    668675
    669676void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) {
    670     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     677    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    671678    GetEnv()->CallVoidMethod(self,
    672679                             AwtDesktopProperties::setStringPropertyID,
     
    676683
    677684void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) {
    678     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     685    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    679686    GetEnv()->CallVoidMethod(self,
    680687                             AwtDesktopProperties::setIntegerPropertyID,
     
    684691
    685692void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) {
    686     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     693    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    687694    GetEnv()->CallVoidMethod(self,
    688695                             AwtDesktopProperties::setBooleanPropertyID,
     
    692699
    693700void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) {
    694     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     701    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    695702    GetEnv()->CallVoidMethod(self,
    696703                             AwtDesktopProperties::setColorPropertyID,
     
    727734                            // fall back to Microsoft Sans Serif
    728735                            fontName = JNU_NewStringPlatform(GetEnv(),
    729                                                     L"Microsoft Sans Serif");
     736                                         (const jchar*)L"Microsoft Sans Serif");
    730737                        }
    731738                    }
     
    744751                    }
    745752
    746                     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     753                    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    747754                    GetEnv()->CallVoidMethod(self,
    748755                              AwtDesktopProperties::setFontPropertyID,
     
    785792    }
    786793
    787     jstring key = JNU_NewStringPlatform(GetEnv(), propName);
     794    jstring key = JNU_NewStringPlatform(GetEnv(), (const jchar*)propName);
    788795    GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID,
    789796                             key, fontName, style, pointSize);
     
    794801
    795802void 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);
    798805    GetEnv()->CallVoidMethod(self,
    799806                             AwtDesktopProperties::setSoundPropertyID,
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp

    r2 r187  
    150150        }
    151151        case WM_NOTIFY: {
     152#ifdef __WIN32OS2__
     153            OFNOTIFY *notifyEx = (OFNOTIFY *)lParam;
     154#else
    152155            OFNOTIFYEX *notifyEx = (OFNOTIFYEX *)lParam;
     156#endif
    153157            if (notifyEx) {
    154158                jobject peer = (jobject)(::GetProp(parent, ModalDialogPeerProp));
     
    223227
    224228        if (title == NULL || env->GetStringLength(title)==0) {
    225             title = env->NewString(&unicodeChar, 1);
     229            title = env->NewString((const jchar*)&unicodeChar, 1);
    226230        }
    227231
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.h

    r2 r187  
    3434#include <ole2.h>
    3535#include <richedit.h>
     36#ifndef __WIN32OS2__
    3637#include <richole.h>
     38#endif
    3739
    3840
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.h

    r2 r187  
    3434
    3535#include <malloc.h>
     36#ifdef __GNUC__
     37#include <alloca.h>
     38#endif
    3639
    3740// Get a Unicode string copy of a Java String object (Java String aren't
Note: See TracChangeset for help on using the changeset viewer.