< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Component.cpp

Print this page




3869         return;
3870     }
3871     COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}};
3872     ImmSetCompositionWindow(hIMC, &cf);
3873     ImmReleaseContext(hwnd, hIMC);
3874 }
3875 
3876 void AwtComponent::OpenCandidateWindow(int x, int y)
3877 {
3878     UINT bits = 1;
3879     POINT p = {0, 0}; // upper left corner of the client area
3880     HWND hWnd = ImmGetHWnd();
3881     if (!::IsWindowVisible(hWnd)) {
3882         return;
3883     }
3884     HWND hTop = GetTopLevelParentForWindow(hWnd);
3885     ::ClientToScreen(hTop, &p);
3886     int sx = ScaleUpX(x) - p.x;
3887     int sy = ScaleUpY(y) - p.y;
3888     if (!m_bitsCandType) {
3889         SetCandidateWindow(m_bitsCandType, sx, sy);
3890         return;
3891     }
3892     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
3893         if ( m_bitsCandType & bits )
3894             SetCandidateWindow(iCandType, sx, sy);
3895     }
3896 }
3897 
3898 void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
3899 {
3900     HWND hwnd = ImmGetHWnd();
3901     HIMC hIMC = ImmGetContext(hwnd);
3902     if (hIMC) {
3903         CANDIDATEFORM cf;
3904         cf.dwStyle = CFS_POINT;
3905         ImmGetCandidateWindow(hIMC, 0, &cf);
3906         if (x != cf.ptCurrentPos.x || y != cf.ptCurrentPos.y) {
3907             cf.dwIndex = iCandType;
3908             cf.dwStyle = CFS_POINT;
3909             cf.ptCurrentPos = {x, y};
3910             cf.rcArea = {0, 0, 0, 0};
3911             ImmSetCandidateWindow(hIMC, &cf);
3912         }
3913         COMPOSITIONFORM cfr;
3914         cfr.dwStyle = CFS_POINT;




3869         return;
3870     }
3871     COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}};
3872     ImmSetCompositionWindow(hIMC, &cf);
3873     ImmReleaseContext(hwnd, hIMC);
3874 }
3875 
3876 void AwtComponent::OpenCandidateWindow(int x, int y)
3877 {
3878     UINT bits = 1;
3879     POINT p = {0, 0}; // upper left corner of the client area
3880     HWND hWnd = ImmGetHWnd();
3881     if (!::IsWindowVisible(hWnd)) {
3882         return;
3883     }
3884     HWND hTop = GetTopLevelParentForWindow(hWnd);
3885     ::ClientToScreen(hTop, &p);
3886     int sx = ScaleUpX(x) - p.x;
3887     int sy = ScaleUpY(y) - p.y;
3888     if (!m_bitsCandType) {
3889         SetCandidateWindow(static_cast<int>(m_bitsCandType), sx, sy);
3890         return;
3891     }
3892     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
3893         if ( m_bitsCandType & bits )
3894             SetCandidateWindow(static_cast<int>(iCandType), sx, sy);
3895     }
3896 }
3897 
3898 void AwtComponent::SetCandidateWindow(int iCandType, int x, int y)
3899 {
3900     HWND hwnd = ImmGetHWnd();
3901     HIMC hIMC = ImmGetContext(hwnd);
3902     if (hIMC) {
3903         CANDIDATEFORM cf;
3904         cf.dwStyle = CFS_POINT;
3905         ImmGetCandidateWindow(hIMC, 0, &cf);
3906         if (x != cf.ptCurrentPos.x || y != cf.ptCurrentPos.y) {
3907             cf.dwIndex = iCandType;
3908             cf.dwStyle = CFS_POINT;
3909             cf.ptCurrentPos = {x, y};
3910             cf.rcArea = {0, 0, 0, 0};
3911             ImmSetCandidateWindow(hIMC, &cf);
3912         }
3913         COMPOSITIONFORM cfr;
3914         cfr.dwStyle = CFS_POINT;


< prev index next >