< prev index next >

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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -526,10 +526,27 @@
     return locales;
 
     CATCH_BAD_ALLOC_RET(NULL);
 }
 
+/*
+ * Class:     sun_awt_windows_WInputMethod
+ * Method:    isCompositionStringAvailable
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WInputMethod_isCompositionStringAvailable
+  (JNIEnv *env, jobject self, jint context)
+{
+    LONG length;
+    length = ImmGetCompositionString((HIMC)IntToPtr(context), GCS_COMPSTR, NULL, 0);
+    if (length > 0) {
+        return JNI_TRUE;
+    } else {
+        return JNI_FALSE;
+    }
+}
+
 /**
  * Class:     sun_awt_windows_WInputMethod
  * Method:    getNativeIMMDescription
  * Signature: ()Ljava/lang/String;
  *
< prev index next >