< prev index next >

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

Print this page




3862     return mrDoDefault;
3863 }
3864 
3865 // support IME Composition messages
3866 void AwtComponent::SetCompositionWindow(RECT& r)
3867 {
3868     HWND hwnd = ImmGetHWnd();
3869     HIMC hIMC = ImmGetContext(hwnd);
3870     if (hIMC == NULL) {
3871         return;
3872     }
3873     COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}};
3874     ImmSetCompositionWindow(hIMC, &cf);
3875     ImmReleaseContext(hwnd, hIMC);
3876 }
3877 
3878 void AwtComponent::OpenCandidateWindow(int x, int y)
3879 {
3880     UINT bits = 1;
3881     POINT p = {0, 0}; // upper left corner of the client area
3882     HWND hWnd = GetHWnd();
3883     if (!::IsWindowVisible(hWnd)) {
3884         return;
3885     }
3886     HWND hTop = GetTopLevelParentForWindow(hWnd);
3887     ::ClientToScreen(hTop, &p);


3888     if (!m_bitsCandType) {
3889         SetCandidateWindow(m_bitsCandType, x - p.x, y - p.y);
3890         return;
3891     }
3892     for (int iCandType=0; iCandType<32; iCandType++, bits<<=1) {
3893         if ( m_bitsCandType & bits )
3894             SetCandidateWindow(iCandType, x - p.x, y - p.y);
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;




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


< prev index next >