Changeset 190


Ignore:
Timestamp:
Dec 3, 2010, 9:26:07 PM (15 years ago)
Author:
dmik
Message:

jdk: awt: Continuing.

Location:
trunk/openjdk/jdk/src/windows/native/sun/windows
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_CustomPaletteDef.h

    r2 r190  
    272272};
    273273
    274 #endif _AWT_CUSTOMPALETTEDEF_H
     274#endif // _AWT_CUSTOMPALETTEDEF_H
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp

    r187 r190  
    3636#include "locale_str.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 )
     38#ifdef __WIN32OS2__
     39#include <minivcrt.h>
    4340#endif
    4441
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp

    r187 r190  
    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 )
     38#ifdef __WIN32OS2__
     39#include <minivcrt.h>
    4340#endif
    4441
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp

    r2 r190  
    704704        LPMETAFILEPICT lpMfpOld = (LPMETAFILEPICT)lpbMfpBuffer;
    705705
    706         HMETAFILEPICT hmfp = ::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
     706        HMETAFILEPICT hmfp = (HMETAFILEPICT)::GlobalAlloc(GALLOCFLG, sizeof(METAFILEPICT));
    707707        if (hmfp == NULL) {
    708708            VERIFY(::DeleteMetaFile(hmf));
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp

    r187 r190  
    151151        case WM_NOTIFY: {
    152152#ifdef __WIN32OS2__
    153             OFNOTIFY *notifyEx = (OFNOTIFY *)lParam;
     153            OFNOTIFY *notify = (OFNOTIFY *)lParam;
     154            if (notify) {
     155                jobject peer = (jobject)(::GetProp(parent, ModalDialogPeerProp));
     156                if (notify->hdr.code == CDN_FILEOK) {
     157                    // This notification is sent when user selects some file and presses
     158                    // OK button; it is not sent when no file is selected. So it's time
     159                    // to unblock all the windows blocked by this dialog as it will
     160                    // be closed soon
     161                    env->CallVoidMethod(peer, AwtFileDialog::setHWndMID, (jlong)0);
     162                }
     163            }
    154164#else
    155165            OFNOTIFYEX *notifyEx = (OFNOTIFYEX *)lParam;
    156 #endif
    157166            if (notifyEx) {
    158167                jobject peer = (jobject)(::GetProp(parent, ModalDialogPeerProp));
     
    178187                }
    179188            }
     189#endif
    180190            break;
    181191        }
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Font.cpp

    r2 r190  
    3838#include "awt_Component.h"
    3939#include "Disposer.h"
     40
     41#ifdef __WIN32OS2__
     42#include <minivcrt.h>
     43#include <wctype.h>
     44#endif
    4045
    4146/* IMPORTANT! Read the README.JNI file for notes on JNI converted AWT code.
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Frame.cpp

    r2 r190  
    12571257
    12581258    PDATA pData;
     1259    HWND hwnd;
    12591260    JNI_CHECK_PEER_GOTO(self, ret);
    12601261    f = (AwtFrame *)pData;
    1261     HWND hwnd = f->GetHWnd();
     1262    hwnd = f->GetHWnd();
    12621263    if (::IsWindow(hwnd))
    12631264    {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp

    r2 r190  
    188188    if (env == NULL || lpStrW == NULL || cStrW == 0) return NULL;
    189189
    190     return env->NewString(lpStrW, cStrW);
     190    return env->NewString((jchar*)lpStrW, cStrW);
    191191}
    192192
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_List.cpp

    r2 r190  
    198198    AwtComponent::Reshape(x, y, w, h);
    199199
    200 /*
     200#if 0
    201201    HWND hList = GetListHandle();
    202202    if (hList != NULL) {
     
    204204        /*
    205205         * Fix for bug 4046446.
    206          * /
     206         */
    207207        SetWindowPos(hList, 0, 0, 0, w, h, flags);
    208208    }
    209 */
     209#endif
    210210}
    211211
     
    10931093    ses->index = index;
    10941094
    1095     return (jboolean)AwtToolkit::GetInstance().SyncCall(
     1095    return (jboolean)(bool)AwtToolkit::GetInstance().SyncCall(
    10961096        (void *(*)(void *))AwtList::_IsSelected, ses);
    10971097    // global ref and ses are deleted in _IsSelected
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp

    r2 r190  
    3333#include <tchar.h>
    3434#include <imm.h>
     35#ifndef __WIN32OS2__
    3536#include <ime.h>
     37#else
     38#include <minivcrt.h>
     39#endif
    3640// End -- Win32 SDK include files
    3741
     
    302306    */
    303307    AwtMenu* menu = GetMenuContainer();
    304     DASSERT(menu != NULL && GetID() >= 0);
     308    DASSERT(menu != NULL /*&& GetID() >= 0*/);
    305309
    306310    //Check whether the MenuItem is disabled.
     
    615619    */
    616620    if (menu == NULL) return;
    617     DASSERT(menu != NULL && GetID() >= 0);
     621    DASSERT(menu != NULL /*&& GetID() >= 0*/);
    618622
    619623/*
     
    662666    if (menu == NULL) return;
    663667    isEnabled = isEnabled && !menu->IsDisabledAndPopup();
    664     DASSERT(menu != NULL && GetID() >= 0);
     668    DASSERT(menu != NULL /*&& GetID() >= 0*/);
    665669    VERIFY(::EnableMenuItem(menu->GetHMenu(), GetID(),
    666670                            MF_BYCOMMAND | (isEnabled ? MF_ENABLED : MF_GRAYED))
     
    680684    */
    681685    if (menu == NULL) return;
    682     DASSERT(menu != NULL && GetID() >= 0);
     686    DASSERT(menu != NULL /*&& GetID() >= 0*/);
    683687    VERIFY(::CheckMenuItem(menu->GetHMenu(), GetID(),
    684688                           MF_BYCOMMAND | (isChecked ? MF_CHECKED : MF_UNCHECKED))
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Panel.cpp

    r2 r190  
    3939static char* AWTPANEL_RESTACK_MSG_3 = "Native resources unavailable";
    4040static char* AWTPANEL_RESTACK_MSG_4 = "Child peer is null";
     41static char* AWTPANEL_RESTACK_MSG_5 = "Allocation error";
    4142
    4243void* AwtPanel::Restack(void * param) {
     
    9596    env->DeleteLocalRef(self);
    9697
    97     CATCH_BAD_ALLOC_RET("Allocation error");
     98    CATCH_BAD_ALLOC_RET(AWTPANEL_RESTACK_MSG_5);
    9899    return NULL;
    99100}
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp

    r2 r190  
    3131#include <float.h>
    3232#include <math.h>
     33
     34#ifdef __WIN32OS2__
     35#include <minivcrt.h>
     36#endif
    3337
    3438#define ROUNDTOINT(x) ((int)((x)+0.5))
     
    947951        DEVNAMES *devnames = (DEVNAMES*)::GlobalLock(pd.hDevNames);
    948952        DASSERT(!IsBadReadPtr(devnames, sizeof(DEVNAMES)));
    949         LPTSTR lpcNames = (LPTSTR)devnames;
    950         LPTSTR pbuf = (_tcslen(lpcNames + devnames->wDeviceOffset) == 0 ?
    951                       TEXT("") : lpcNames + devnames->wDeviceOffset);
     953        LPCTSTR lpcNames = (LPTSTR)devnames;
     954        LPCTSTR pbuf = (_tcslen(lpcNames + devnames->wDeviceOffset) == 0 ?
     955                        TEXT("") : lpcNames + devnames->wDeviceOffset);
    952956        if (pbuf != NULL) {
    953957            jstring jstr = JNU_NewStringPlatform(env, pbuf);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp

    r2 r190  
    4545#include <float.h>
    4646
     47#ifdef __WIN32OS2__
     48#include <minivcrt.h>
     49#endif
     50
    4751#define DEBUG_PRINTING  0
    4852
     
    6064 * WPrintJob native methods
    6165 */
     66
     67jfieldID AwtPrintDialog::pageID;
    6268
    6369extern "C" {
     
    208214 */
    209215static const double POINTS_TO_LOMETRIC = (254.0 / 72.0);
    210 
    211 jfieldID AwtPrintDialog::pageID;
    212216
    213217
     
    22812285JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut
    22822286(JNIEnv *env, jobject self, jlong printDC, jstring text, jint strLen,
    2283      boolean glyphCodes, jfloat x, jfloat y, jfloatArray positions)
     2287     jboolean glyphCodes, jfloat x, jfloat y, jfloatArray positions)
    22842288{
    22852289
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Robot.cpp

    r2 r190  
    229229    // CAPTUREBLT flag is required to capture WS_EX_LAYERED windows' contents
    230230    // correctly on Win2K/XP
     231#ifdef __WIN32OS2__
     232    #define CAPTUREBLT 0
     233#endif
    231234    VERIFY(::BitBlt(hdcMem, 0, 0, width, height, hdcScreen, x, y,
    232235                                                SRCCOPY|CAPTUREBLT) != 0);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.cpp

    r2 r190  
    3333#include "awt_Window.h"
    3434
     35#ifdef __WIN32OS2__
     36#include <minivcrt.h>
     37#endif
     38
    3539/* IMPORTANT! Read the README.JNI file for notes on JNI converted AWT code.
    3640 */
     
    191195          VERIFY(::RevokeDragDrop(c->GetHWnd()) != DRAGDROP_E_INVALIDHWND);
    192196
     197#ifndef __WIN32OS2__
    193198          /* To enforce CF_TEXT format for paste operations. */
    194199          VERIFY(c->SendMessage(EM_SETOLECALLBACK, 0,
    195200                                (LPARAM)&GetOleCallback()));
     201#endif
    196202
    197203          c->SendMessage(EM_SETEVENTMASK, 0, ENM_CHANGE);
     
    245251    size_t length = env->GetStringLength(jStr) + 1;
    246252    WCHAR *string = new WCHAR[length];
    247     env->GetStringRegion(jStr, 0, static_cast<jsize>(length - 1), string);
     253    env->GetStringRegion(jStr, 0, static_cast<jsize>(length - 1),
     254                         reinterpret_cast<jchar*>(string));
    248255    string[length-1] = '\0';
    249256    for (size_t i = 0; i < maxlen && i < length - 1; i++) {
     
    988995      // WCHAR* buffer = TO_WSTRING(text);
    989996      WCHAR *buffer = new WCHAR[length];
    990       env->GetStringRegion(text, 0, length-1, buffer);
     997      env->GetStringRegion(text, 0, length-1, reinterpret_cast<jchar*>(buffer));
    991998      buffer[length-1] = '\0';
    992999
     
    11081115
    11091116
     1117#ifndef __WIN32OS2__
    11101118AwtTextArea::OleCallback AwtTextArea::sm_oleCallback;
    11111119
     
    12391247    return E_NOTIMPL;
    12401248}
     1249#endif
     1250
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextArea.h

    r2 r190  
    3434#include <ole2.h>
    3535#include <richedit.h>
     36#ifndef __WIN32OS2__
    3637#include <richole.h>
     38#endif
    3739
    3840/************************************************************************
     
    4244class AwtTextArea : public AwtTextComponent {
    4345
     46#ifndef __WIN32OS2__
    4447    // inner classes
    4548    class OleCallback;
     49#endif
    4650
    4751public:
     
    9296
    9397protected:
     98#ifndef __WIN32OS2__
    9499    INLINE static OleCallback& GetOleCallback() { return sm_oleCallback; }
     100#endif
    95101    void EditSetSel(CHARRANGE &cr);
    96102    void EditGetSel(CHARRANGE &cr);
     
    119125
    120126
     127#ifndef __WIN32OS2__
    121128    static OleCallback sm_oleCallback;
    122129
     
    125132     */
    126133
    127     class AwtTextArea::OleCallback : public IRichEditOleCallback {
     134    class OleCallback : public IRichEditOleCallback {
    128135    public:
    129136        OleCallback();
     
    151158        ULONG             m_refs; // Reference count
    152159    };
    153 
     160#endif
    154161};
    155162
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp

    r2 r190  
    327327            c->GetText(buf, len + 1);
    328328            c->RemoveCR(buf);
    329             result = env->NewString(buf, static_cast<jsize>(wcslen(buf)));
     329            result = env->NewString(reinterpret_cast<jchar*>(buf),
     330                                    static_cast<jsize>(wcslen(buf)));
    330331            delete [] buf;
    331332        }
     
    363364        int length = env->GetStringLength(text);
    364365        WCHAR* buffer = new WCHAR[length + 1];
    365         env->GetStringRegion(text, 0, length, buffer);
     366        env->GetStringRegion(text, 0, length, reinterpret_cast<jchar*>(buffer));
    366367        buffer[length] = 0;
    367368        c->CheckLineSeparator(buffer);
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextField.cpp

    r2 r190  
    3131#include "awt_Canvas.h"
    3232
     33#ifdef __WIN32OS2__
     34#include <minivcrt.h>
     35#endif
     36
    3337/* IMPORTANT! Read the README.JNI file for notes on JNI converted AWT code.
    3438 */
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TextField.h

    r2 r190  
    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_Toolkit.cpp

    r2 r190  
    6666#include <java_awt_peer_ComponentPeer.h>
    6767
     68#ifdef __WIN32OS2__
     69#include <minivcrt.h>
     70#endif
     71
    6872extern void initScreens(JNIEnv *env);
    6973extern "C" void awt_dnd_initialize();
     
    268272        DTrace_DisableMutex();
    269273        DMem_DisableMutex();
    270 #endif DEBUG
     274#endif // DEBUG
    271275        // Release any resources that have not yet been released
    272276        // Note that releasing DirectX objects is necessary for some
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Unicode.cpp

    r2 r190  
    3636    int len = env->GetStringLength(jstr);
    3737
    38     env->GetStringRegion(jstr, 0, len, lpwstr);
     38    env->GetStringRegion(jstr, 0, len, reinterpret_cast<jchar*>(lpwstr));
    3939    lpwstr[len] = '\0';
    4040
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp

    r2 r190  
    3333#include "WindowsFlags.h"
    3434#include "dxInit.h"
     35
     36#ifdef __WIN32OS2__
     37#include <minivcrt.h>
     38#endif
    3539
    3640void initScreens(JNIEnv *env) {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp

    r2 r190  
    4444#include "sun_awt_windows_WCanvasPeer.h"
    4545
    46 #if !defined(__int3264)
     46#if !defined(__int3264) && !defined(__WIN32OS2__)
    4747typedef __int32 LONG_PTR;
    4848#endif // __int3264
     
    5858jint windowTYPES[TYPES_COUNT];
    5959
     60#ifdef __WIN32OS2__
     61#include <minivcrt.h>
     62#endif
    6063
    6164/* IMPORTANT! Read the README.JNI file for notes on JNI converted AWT code.
     
    15001503
    15011504void AwtWindow::FlashWindowEx(HWND hWnd, UINT count, DWORD timeout, DWORD flags) {
     1505#ifndef __WIN32OS2__
    15021506    FLASHWINFO fi;
    15031507    fi.cbSize = sizeof(fi);
     
    15071511    fi.dwTimeout = timeout;
    15081512    ::FlashWindowEx(&fi);
     1513#endif
    15091514}
    15101515
     
    16721677        int length = env->GetStringLength(title);
    16731678        WCHAR *buffer = new WCHAR[length + 1];
    1674         env->GetStringRegion(title, 0, length, buffer);
     1679        env->GetStringRegion(title, 0, length, reinterpret_cast<jchar*>(buffer));
    16751680        buffer[length] = L'\0';
    16761681        VERIFY(::SetWindowTextW(w->GetHWnd(), buffer));
     
    20432048    AwtWindow *window = NULL;
    20442049    HWND windowHWnd = 0;
     2050    PDATA pData;
    20452051
    20462052    JNI_CHECK_NULL_GOTO(self, "peer", ret);
    2047     PDATA pData = JNI_GET_PDATA(self);
     2053    pData = JNI_GET_PDATA(self);
    20482054    if (pData == NULL) {
    20492055        env->DeleteGlobalRef(self);
     
    20722078    AwtWindow *window = NULL;
    20732079    HWND windowHWnd = 0;
     2080    PDATA pData;
    20742081
    20752082    JNI_CHECK_NULL_GOTO(self, "peer", ret);
    2076     PDATA pData = JNI_GET_PDATA(self);
     2083    pData = JNI_GET_PDATA(self);
    20772084    if (pData == NULL) {
    20782085        env->DeleteGlobalRef(self);
Note: See TracChangeset for help on using the changeset viewer.