870 case WM_AWT_CREATECONTEXT: {
871 return reinterpret_cast<LRESULT>(
872 reinterpret_cast<void*>(ImmCreateContext()));
873 }
874 case WM_AWT_DESTROYCONTEXT: {
875 ImmDestroyContext((HIMC)wParam);
876 return 0;
877 }
878 case WM_AWT_ASSOCIATECONTEXT: {
879 EnableNativeIMEStruct *data = (EnableNativeIMEStruct*)wParam;
880
881 jobject peer = data->peer;
882 jobject self = data->self;
883 jint context = data->context;
884 jboolean useNativeCompWindow = data->useNativeCompWindow;
885
886 AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
887 if (comp != NULL)
888 {
889 comp->SetInputMethod(self, useNativeCompWindow);
890 comp->ImmAssociateContext((HIMC)context);
891 }
892
893 if (peer != NULL) {
894 env->DeleteGlobalRef(peer);
895 }
896 if (self != NULL) {
897 env->DeleteGlobalRef(self);
898 }
899
900 delete data;
901 return 0;
902 }
903 case WM_AWT_GET_DEFAULT_IME_HANDLER: {
904 LRESULT ret = (LRESULT)FALSE;
905 jobject peer = (jobject)wParam;
906
907 AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
908 if (comp != NULL) {
909 HWND defaultIMEHandler = ImmGetDefaultIMEWnd(comp->GetHWnd());
910 if (defaultIMEHandler != NULL) {
|
870 case WM_AWT_CREATECONTEXT: {
871 return reinterpret_cast<LRESULT>(
872 reinterpret_cast<void*>(ImmCreateContext()));
873 }
874 case WM_AWT_DESTROYCONTEXT: {
875 ImmDestroyContext((HIMC)wParam);
876 return 0;
877 }
878 case WM_AWT_ASSOCIATECONTEXT: {
879 EnableNativeIMEStruct *data = (EnableNativeIMEStruct*)wParam;
880
881 jobject peer = data->peer;
882 jobject self = data->self;
883 jint context = data->context;
884 jboolean useNativeCompWindow = data->useNativeCompWindow;
885
886 AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
887 if (comp != NULL)
888 {
889 comp->SetInputMethod(self, useNativeCompWindow);
890 comp->ImmAssociateContext((HIMC)(uintptr_t)context);
891 }
892
893 if (peer != NULL) {
894 env->DeleteGlobalRef(peer);
895 }
896 if (self != NULL) {
897 env->DeleteGlobalRef(self);
898 }
899
900 delete data;
901 return 0;
902 }
903 case WM_AWT_GET_DEFAULT_IME_HANDLER: {
904 LRESULT ret = (LRESULT)FALSE;
905 jobject peer = (jobject)wParam;
906
907 AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
908 if (comp != NULL) {
909 HWND defaultIMEHandler = ImmGetDefaultIMEWnd(comp->GetHWnd());
910 if (defaultIMEHandler != NULL) {
|