src/windows/native/sun/windows/awt_Component.cpp

Print this page




1455               windowMoveLockHeld = FALSE;
1456               windowMoveLock.Leave();
1457           }
1458           mr = WmWindowPosChanged(lParam);
1459           break;
1460       }
1461       case WM_MOVE: {
1462           RECT r;
1463           ::GetWindowRect(GetHWnd(), &r);
1464           mr = WmMove(r.left, r.top);
1465           break;
1466       }
1467       case WM_SIZE:
1468       {
1469           RECT r;
1470           // fix 4128317 : use GetClientRect for full 32-bit int precision and
1471           // to avoid negative client area dimensions overflowing 16-bit params - robi
1472           ::GetClientRect( GetHWnd(), &r );
1473           mr = WmSize(static_cast<UINT>(wParam), r.right - r.left, r.bottom - r.top);
1474           //mr = WmSize(wParam, LOWORD(lParam), HIWORD(lParam));
1475           if (ImmGetContext() != NULL) {
1476               SetCompositionWindow(r);
1477           }
1478           break;
1479       }
1480       case WM_SIZING:
1481           mr = WmSizing();
1482           break;
1483       case WM_SHOWWINDOW:
1484           mr = WmShowWindow(static_cast<BOOL>(wParam),
1485                             static_cast<UINT>(lParam)); break;
1486       case WM_SYSCOMMAND:
1487           mr = WmSysCommand(static_cast<UINT>(wParam & 0xFFF0),
1488                             GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
1489           break;
1490       case WM_EXITSIZEMOVE:
1491           mr = WmExitSizeMove();
1492           break;
1493       // Bug #4039858 (Selecting menu item causes bogus mouse click event)
1494       case WM_ENTERMENULOOP:
1495           mr = WmEnterMenuLoop((BOOL)wParam);
1496           sm_bMenuLoop = TRUE;
1497           // we need to release grab if menu is shown


1516       case WM_KILLFOCUS:
1517           if (sm_inSynthesizeFocus) {
1518               mr = WmKillFocus((HWND)wParam);
1519           } else {
1520               mr = mrConsume;
1521           }
1522           break;
1523       case WM_ACTIVATE: {
1524           UINT nState = LOWORD(wParam);
1525           BOOL fMinimized = (BOOL)HIWORD(wParam);
1526           mr = mrConsume;
1527 
1528           if (!sm_suppressFocusAndActivation &&
1529               (!fMinimized || (nState == WA_INACTIVE)))
1530           {
1531               mr = WmActivate(nState, fMinimized, (HWND)lParam);
1532 
1533               // When the window is deactivated, send WM_IME_ENDCOMPOSITION
1534               // message to deactivate the composition window so that
1535               // it won't receive keyboard input focus.
1536               if (ImmGetContext() != NULL) {



1537                   DefWindowProc(WM_IME_ENDCOMPOSITION, 0, 0);
1538               }
1539           }
1540           break;
1541       }
1542       case WM_MOUSEACTIVATE: {
1543           AwtWindow *window = GetContainer();
1544           if (window && window->IsFocusableWindow()) {
1545               // AWT/Swing will later request focus to a proper component
1546               // on handling the Java mouse event. Anyway, we have to
1547               // activate the window here as it works both for AWT & Swing.
1548               // Do it in our own fassion,
1549               window->AwtSetActiveWindow(TRUE, LOWORD(lParam)/*hittest*/);
1550           }
1551           mr = mrConsume;
1552           retValue = MA_NOACTIVATE;
1553           break;
1554       }
1555       case WM_CTLCOLORMSGBOX:
1556       case WM_CTLCOLOREDIT:


1699 
1700       case WM_KEYDOWN:
1701           mr = WmKeyDown(static_cast<UINT>(wParam),
1702                          LOWORD(lParam), HIWORD(lParam), FALSE);
1703           break;
1704       case WM_KEYUP:
1705           mr = WmKeyUp(static_cast<UINT>(wParam),
1706                        LOWORD(lParam), HIWORD(lParam), FALSE);
1707           break;
1708       case WM_SYSKEYDOWN:
1709           mr = WmKeyDown(static_cast<UINT>(wParam),
1710                          LOWORD(lParam), HIWORD(lParam), TRUE);
1711           break;
1712       case WM_SYSKEYUP:
1713           mr = WmKeyUp(static_cast<UINT>(wParam),
1714                        LOWORD(lParam), HIWORD(lParam), TRUE);
1715           break;
1716       case WM_IME_SETCONTEXT:
1717           // lParam is passed as pointer and it can be modified.
1718           mr = WmImeSetContext(static_cast<BOOL>(wParam), &lParam);
1719           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1720           break;
1721       case WM_IME_NOTIFY:
1722           mr = WmImeNotify(wParam, lParam);
1723           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1724           break;
1725       case WM_IME_STARTCOMPOSITION:
1726           mr = WmImeStartComposition();
1727           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1728           break;
1729       case WM_IME_ENDCOMPOSITION:
1730           mr = WmImeEndComposition();
1731           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1732           break;
1733       case WM_IME_COMPOSITION: {
1734           WORD dbcschar = static_cast<WORD>(wParam);
1735           mr = WmImeComposition(dbcschar, lParam);
1736           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1737           break;
1738       }
1739       case WM_IME_CONTROL:
1740       case WM_IME_COMPOSITIONFULL:
1741       case WM_IME_SELECT:
1742       case WM_IME_KEYUP:
1743       case WM_IME_KEYDOWN:


3704                              &msg);
3705     return mrConsume;
3706 }
3707 
3708 MsgRouting AwtComponent::WmForwardChar(WCHAR character, LPARAM lParam,
3709                                        BOOL synthetic)
3710 {
3711     // just post WM_CHAR with unicode key value
3712     DefWindowProc(WM_CHAR, (WPARAM)character, lParam);
3713     return mrConsume;
3714 }
3715 
3716 MsgRouting AwtComponent::WmPaste()
3717 {
3718     return mrDoDefault;
3719 }
3720 
3721 // support IME Composition messages
3722 void AwtComponent::SetCompositionWindow(RECT& r)
3723 {
3724     HIMC hIMC = ImmGetContext();

3725     if (hIMC == NULL) {
3726         return;
3727     }
3728     COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}};
3729     ImmSetCompositionWindow(hIMC, &cf);

3730 }
3731 
3732 void AwtComponent::OpenCandidateWindow(int x, int y)
3733 {
3734     UINT bits = 1;
3735     RECT rc;
3736     GetWindowRect(GetHWnd(), &rc);
3737 
3738     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
3739         if ( m_bitsCandType & bits )
3740             SetCandidateWindow(iCandType, x-rc.left, y-rc.top);
3741     }
3742     if (m_bitsCandType != 0) {
3743         HWND proxy = GetProxyFocusOwner();
3744         // REMIND: is there any chance GetProxyFocusOwner() returns NULL here?
3745         ::DefWindowProc((proxy != NULL) ? proxy : GetHWnd(),
3746                         WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType);
3747     }
3748 }
3749 
3750 void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
3751 {
3752     HIMC hIMC = ImmGetContext();

3753     CANDIDATEFORM cf;
3754     cf.dwIndex = iCandType;
3755     cf.dwStyle = CFS_CANDIDATEPOS;
3756     cf.ptCurrentPos.x = x;
3757     cf.ptCurrentPos.y = y;
3758 
3759     ImmSetCandidateWindow(hIMC, &cf);


3760 }
3761 
3762 MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
3763 {
3764     // If the Windows input context is disabled, do not let Windows
3765     // display any UIs.
3766     HIMC hIMC = ImmGetContext();


3767     if (hIMC == NULL) {
3768         *lplParam = 0;
3769         return mrDoDefault;
3770     }
3771 
3772     if (fSet) {
3773         LPARAM lParam = *lplParam;
3774         if (!m_useNativeCompWindow) {
3775             // stop to draw native composing window.
3776             *lplParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
3777         }
3778     }
3779     return mrDoDefault;
3780 }
3781 
3782 MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType)
3783 {
3784     if (!m_useNativeCompWindow && subMsg == IMN_OPENCANDIDATE) {
3785         m_bitsCandType = bitsCandType;
3786         InquireCandidatePosition();


3805     if (m_useNativeCompWindow)   return mrDoDefault;
3806 
3807     SendInputMethodEvent(
3808         java_awt_event_InputMethodEvent_INPUT_METHOD_TEXT_CHANGED,
3809         NULL, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0 );
3810     return mrConsume;
3811 }
3812 
3813 MsgRouting AwtComponent::WmImeComposition(WORD wChar, LPARAM flags)
3814 {
3815     if (m_useNativeCompWindow)   return mrDoDefault;
3816 
3817     int*      bndClauseW = NULL;
3818     jstring*  readingClauseW = NULL;
3819     int*      bndAttrW = NULL;
3820     BYTE*     valAttrW = NULL;
3821     int       cClauseW = 0;
3822     AwtInputTextInfor* textInfor = NULL;
3823 
3824     try {
3825         HIMC hIMC = ImmGetContext();

3826         DASSERT(hIMC!=0);
3827 
3828         textInfor = new AwtInputTextInfor;
3829         textInfor->GetContextData(hIMC, flags);

3830 
3831         jstring jtextString = textInfor->GetText();
3832         /* The conditions to send the input method event to AWT EDT are:
3833            1. Whenever there is a composition message sent regarding whether
3834            the composition text is NULL or not. See details at bug 6222692.
3835            2. When there is a committed message sent, in which case, we have to
3836            check whether the committed string is NULL or not. If the committed string
3837            is NULL, there is no need to send any input method event.
3838            (Minor note: 'jtextString' returned is the merged string in the case of
3839            partial commit.)
3840         */
3841         if ((flags & GCS_RESULTSTR && jtextString != NULL) ||
3842             (flags & GCS_COMPSTR)) {
3843             int       cursorPosW = textInfor->GetCursorPosition();
3844             // In order not to delete the readingClauseW in the catch clause,
3845             // calling GetAttributeInfor before GetClauseInfor.
3846             int       cAttrW = textInfor->GetAttributeInfor(bndAttrW, valAttrW);
3847             cClauseW = textInfor->GetClauseInfor(bndClauseW, readingClauseW);
3848 
3849             /* Send INPUT_METHOD_TEXT_CHANGED event to the WInputMethod which in turn sends


3993             return;
3994         }
3995         wInputMethodCls = (jclass)env->NewGlobalRef(wInputMethodClsLocal);
3996         env->DeleteLocalRef(wInputMethodClsLocal);
3997     }
3998 
3999     // get method ID of sendInputMethodEvent() (run only once)
4000     static jmethodID inqCandPosMid = 0;
4001     if (inqCandPosMid == 0) {
4002         inqCandPosMid =  env->GetMethodID(wInputMethodCls, "inquireCandidatePosition",
4003                                            "()V");
4004         DASSERT(!safe_ExceptionOccurred(env));
4005         DASSERT(inqCandPosMid);
4006     }
4007 
4008     // call m_InputMethod.sendInputMethod()
4009     jobject candPos = env->CallObjectMethod(m_InputMethod, inqCandPosMid);
4010     DASSERT(!safe_ExceptionOccurred(env));
4011 }
4012 
4013 HIMC AwtComponent::ImmGetContext()
4014 {
4015     HWND proxy = GetProxyFocusOwner();
4016     return ::ImmGetContext((proxy != NULL) ? proxy : GetHWnd());
4017 }
4018 
4019 HIMC AwtComponent::ImmAssociateContext(HIMC himc)
4020 {
4021     HWND proxy = GetProxyFocusOwner();
4022     return ::ImmAssociateContext((proxy != NULL) ? proxy : GetHWnd(), himc);
4023 }
4024 
4025 HWND AwtComponent::GetProxyFocusOwner()
4026 {
4027     AwtWindow *window = GetContainer();
4028     if (window != 0) {
4029         AwtFrame *owner = window->GetOwningFrameOrDialog();
4030         if (owner != 0) {
4031             return owner->GetProxyFocusOwner();
4032         } else if (!window->IsSimpleWindow()) { // isn't an owned simple window
4033             return ((AwtFrame*)window)->GetProxyFocusOwner();
4034         }
4035     }
4036     return (HWND)NULL;
4037 }
4038 
4039 /* Call DefWindowProc for the focus proxy, if any */
4040 void AwtComponent::CallProxyDefWindowProc(UINT message, WPARAM wParam,
4041     LPARAM lParam, LRESULT &retVal, MsgRouting &mr)
4042 {




1455               windowMoveLockHeld = FALSE;
1456               windowMoveLock.Leave();
1457           }
1458           mr = WmWindowPosChanged(lParam);
1459           break;
1460       }
1461       case WM_MOVE: {
1462           RECT r;
1463           ::GetWindowRect(GetHWnd(), &r);
1464           mr = WmMove(r.left, r.top);
1465           break;
1466       }
1467       case WM_SIZE:
1468       {
1469           RECT r;
1470           // fix 4128317 : use GetClientRect for full 32-bit int precision and
1471           // to avoid negative client area dimensions overflowing 16-bit params - robi
1472           ::GetClientRect( GetHWnd(), &r );
1473           mr = WmSize(static_cast<UINT>(wParam), r.right - r.left, r.bottom - r.top);
1474           //mr = WmSize(wParam, LOWORD(lParam), HIWORD(lParam));

1475           SetCompositionWindow(r);

1476           break;
1477       }
1478       case WM_SIZING:
1479           mr = WmSizing();
1480           break;
1481       case WM_SHOWWINDOW:
1482           mr = WmShowWindow(static_cast<BOOL>(wParam),
1483                             static_cast<UINT>(lParam)); break;
1484       case WM_SYSCOMMAND:
1485           mr = WmSysCommand(static_cast<UINT>(wParam & 0xFFF0),
1486                             GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
1487           break;
1488       case WM_EXITSIZEMOVE:
1489           mr = WmExitSizeMove();
1490           break;
1491       // Bug #4039858 (Selecting menu item causes bogus mouse click event)
1492       case WM_ENTERMENULOOP:
1493           mr = WmEnterMenuLoop((BOOL)wParam);
1494           sm_bMenuLoop = TRUE;
1495           // we need to release grab if menu is shown


1514       case WM_KILLFOCUS:
1515           if (sm_inSynthesizeFocus) {
1516               mr = WmKillFocus((HWND)wParam);
1517           } else {
1518               mr = mrConsume;
1519           }
1520           break;
1521       case WM_ACTIVATE: {
1522           UINT nState = LOWORD(wParam);
1523           BOOL fMinimized = (BOOL)HIWORD(wParam);
1524           mr = mrConsume;
1525 
1526           if (!sm_suppressFocusAndActivation &&
1527               (!fMinimized || (nState == WA_INACTIVE)))
1528           {
1529               mr = WmActivate(nState, fMinimized, (HWND)lParam);
1530 
1531               // When the window is deactivated, send WM_IME_ENDCOMPOSITION
1532               // message to deactivate the composition window so that
1533               // it won't receive keyboard input focus.
1534               HIMC hIMC;
1535               HWND hwnd = ImmGetHWnd();
1536               if ((hIMC = ImmGetContext(hwnd)) != NULL) {
1537                   ImmReleaseContext(hwnd, hIMC);
1538                   DefWindowProc(WM_IME_ENDCOMPOSITION, 0, 0);
1539               }
1540           }
1541           break;
1542       }
1543       case WM_MOUSEACTIVATE: {
1544           AwtWindow *window = GetContainer();
1545           if (window && window->IsFocusableWindow()) {
1546               // AWT/Swing will later request focus to a proper component
1547               // on handling the Java mouse event. Anyway, we have to
1548               // activate the window here as it works both for AWT & Swing.
1549               // Do it in our own fassion,
1550               window->AwtSetActiveWindow(TRUE, LOWORD(lParam)/*hittest*/);
1551           }
1552           mr = mrConsume;
1553           retValue = MA_NOACTIVATE;
1554           break;
1555       }
1556       case WM_CTLCOLORMSGBOX:
1557       case WM_CTLCOLOREDIT:


1700 
1701       case WM_KEYDOWN:
1702           mr = WmKeyDown(static_cast<UINT>(wParam),
1703                          LOWORD(lParam), HIWORD(lParam), FALSE);
1704           break;
1705       case WM_KEYUP:
1706           mr = WmKeyUp(static_cast<UINT>(wParam),
1707                        LOWORD(lParam), HIWORD(lParam), FALSE);
1708           break;
1709       case WM_SYSKEYDOWN:
1710           mr = WmKeyDown(static_cast<UINT>(wParam),
1711                          LOWORD(lParam), HIWORD(lParam), TRUE);
1712           break;
1713       case WM_SYSKEYUP:
1714           mr = WmKeyUp(static_cast<UINT>(wParam),
1715                        LOWORD(lParam), HIWORD(lParam), TRUE);
1716           break;
1717       case WM_IME_SETCONTEXT:
1718           // lParam is passed as pointer and it can be modified.
1719           mr = WmImeSetContext(static_cast<BOOL>(wParam), &lParam);

1720           break;
1721       case WM_IME_NOTIFY:
1722           mr = WmImeNotify(wParam, lParam);

1723           break;
1724       case WM_IME_STARTCOMPOSITION:
1725           mr = WmImeStartComposition();
1726           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1727           break;
1728       case WM_IME_ENDCOMPOSITION:
1729           mr = WmImeEndComposition();
1730           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1731           break;
1732       case WM_IME_COMPOSITION: {
1733           WORD dbcschar = static_cast<WORD>(wParam);
1734           mr = WmImeComposition(dbcschar, lParam);
1735           CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
1736           break;
1737       }
1738       case WM_IME_CONTROL:
1739       case WM_IME_COMPOSITIONFULL:
1740       case WM_IME_SELECT:
1741       case WM_IME_KEYUP:
1742       case WM_IME_KEYDOWN:


3703                              &msg);
3704     return mrConsume;
3705 }
3706 
3707 MsgRouting AwtComponent::WmForwardChar(WCHAR character, LPARAM lParam,
3708                                        BOOL synthetic)
3709 {
3710     // just post WM_CHAR with unicode key value
3711     DefWindowProc(WM_CHAR, (WPARAM)character, lParam);
3712     return mrConsume;
3713 }
3714 
3715 MsgRouting AwtComponent::WmPaste()
3716 {
3717     return mrDoDefault;
3718 }
3719 
3720 // support IME Composition messages
3721 void AwtComponent::SetCompositionWindow(RECT& r)
3722 {
3723     HWND hwnd = ImmGetHWnd();
3724     HIMC hIMC = ImmGetContext(hwnd);
3725     if (hIMC == NULL) {
3726         return;
3727     }
3728     COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}};
3729     ImmSetCompositionWindow(hIMC, &cf);
3730     ImmReleaseContext(hwnd, hIMC);
3731 }
3732 
3733 void AwtComponent::OpenCandidateWindow(int x, int y)
3734 {
3735     UINT bits = 1;
3736     RECT rc;
3737     GetWindowRect(GetHWnd(), &rc);
3738 
3739     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
3740         if ( m_bitsCandType & bits )
3741             SetCandidateWindow(iCandType, x-rc.left, y-rc.top);
3742     }
3743     if (m_bitsCandType != 0) {

3744         // REMIND: is there any chance GetProxyFocusOwner() returns NULL here?
3745         ::DefWindowProc(ImmGetHWnd(),
3746                         WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType);
3747     }
3748 }
3749 
3750 void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
3751 {
3752     HWND hwnd = ImmGetHWnd();
3753     HIMC hIMC = ImmGetContext(hwnd);
3754     CANDIDATEFORM cf;
3755     cf.dwIndex = iCandType;
3756     cf.dwStyle = CFS_CANDIDATEPOS;
3757     cf.ptCurrentPos.x = x;
3758     cf.ptCurrentPos.y = y;
3759 
3760     ImmSetCandidateWindow(hIMC, &cf);
3761 
3762     ImmReleaseContext(hwnd, hIMC);
3763 }
3764 
3765 MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
3766 {
3767     // If the Windows input context is disabled, do not let Windows
3768     // display any UIs.
3769     HWND hwnd = ImmGetHWnd();
3770     HIMC hIMC = ImmGetContext(hwnd);
3771     ImmReleaseContext(hwnd, hIMC);
3772     if (hIMC == NULL) {
3773         *lplParam = 0;
3774         return mrDoDefault;
3775     }
3776 
3777     if (fSet) {
3778         LPARAM lParam = *lplParam;
3779         if (!m_useNativeCompWindow) {
3780             // stop to draw native composing window.
3781             *lplParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
3782         }
3783     }
3784     return mrDoDefault;
3785 }
3786 
3787 MsgRouting AwtComponent::WmImeNotify(WPARAM subMsg, LPARAM bitsCandType)
3788 {
3789     if (!m_useNativeCompWindow && subMsg == IMN_OPENCANDIDATE) {
3790         m_bitsCandType = bitsCandType;
3791         InquireCandidatePosition();


3810     if (m_useNativeCompWindow)   return mrDoDefault;
3811 
3812     SendInputMethodEvent(
3813         java_awt_event_InputMethodEvent_INPUT_METHOD_TEXT_CHANGED,
3814         NULL, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0 );
3815     return mrConsume;
3816 }
3817 
3818 MsgRouting AwtComponent::WmImeComposition(WORD wChar, LPARAM flags)
3819 {
3820     if (m_useNativeCompWindow)   return mrDoDefault;
3821 
3822     int*      bndClauseW = NULL;
3823     jstring*  readingClauseW = NULL;
3824     int*      bndAttrW = NULL;
3825     BYTE*     valAttrW = NULL;
3826     int       cClauseW = 0;
3827     AwtInputTextInfor* textInfor = NULL;
3828 
3829     try {
3830         HWND hwnd = ImmGetHWnd();
3831         HIMC hIMC = ImmGetContext(hwnd);
3832         DASSERT(hIMC!=0);
3833 
3834         textInfor = new AwtInputTextInfor;
3835         textInfor->GetContextData(hIMC, flags);
3836         ImmReleaseContext(hwnd, hIMC);
3837 
3838         jstring jtextString = textInfor->GetText();
3839         /* The conditions to send the input method event to AWT EDT are:
3840            1. Whenever there is a composition message sent regarding whether
3841            the composition text is NULL or not. See details at bug 6222692.
3842            2. When there is a committed message sent, in which case, we have to
3843            check whether the committed string is NULL or not. If the committed string
3844            is NULL, there is no need to send any input method event.
3845            (Minor note: 'jtextString' returned is the merged string in the case of
3846            partial commit.)
3847         */
3848         if ((flags & GCS_RESULTSTR && jtextString != NULL) ||
3849             (flags & GCS_COMPSTR)) {
3850             int       cursorPosW = textInfor->GetCursorPosition();
3851             // In order not to delete the readingClauseW in the catch clause,
3852             // calling GetAttributeInfor before GetClauseInfor.
3853             int       cAttrW = textInfor->GetAttributeInfor(bndAttrW, valAttrW);
3854             cClauseW = textInfor->GetClauseInfor(bndClauseW, readingClauseW);
3855 
3856             /* Send INPUT_METHOD_TEXT_CHANGED event to the WInputMethod which in turn sends


4000             return;
4001         }
4002         wInputMethodCls = (jclass)env->NewGlobalRef(wInputMethodClsLocal);
4003         env->DeleteLocalRef(wInputMethodClsLocal);
4004     }
4005 
4006     // get method ID of sendInputMethodEvent() (run only once)
4007     static jmethodID inqCandPosMid = 0;
4008     if (inqCandPosMid == 0) {
4009         inqCandPosMid =  env->GetMethodID(wInputMethodCls, "inquireCandidatePosition",
4010                                            "()V");
4011         DASSERT(!safe_ExceptionOccurred(env));
4012         DASSERT(inqCandPosMid);
4013     }
4014 
4015     // call m_InputMethod.sendInputMethod()
4016     jobject candPos = env->CallObjectMethod(m_InputMethod, inqCandPosMid);
4017     DASSERT(!safe_ExceptionOccurred(env));
4018 }
4019 
4020 HWND AwtComponent::ImmGetHWnd()
4021 {
4022     return GetHWnd();

4023 }
4024 
4025 HIMC AwtComponent::ImmAssociateContext(HIMC himc)
4026 {
4027     return ::ImmAssociateContext(ImmGetHWnd(), himc);

4028 }
4029 
4030 HWND AwtComponent::GetProxyFocusOwner()
4031 {
4032     AwtWindow *window = GetContainer();
4033     if (window != 0) {
4034         AwtFrame *owner = window->GetOwningFrameOrDialog();
4035         if (owner != 0) {
4036             return owner->GetProxyFocusOwner();
4037         } else if (!window->IsSimpleWindow()) { // isn't an owned simple window
4038             return ((AwtFrame*)window)->GetProxyFocusOwner();
4039         }
4040     }
4041     return (HWND)NULL;
4042 }
4043 
4044 /* Call DefWindowProc for the focus proxy, if any */
4045 void AwtComponent::CallProxyDefWindowProc(UINT message, WPARAM wParam,
4046     LPARAM lParam, LRESULT &retVal, MsgRouting &mr)
4047 {