[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz/gfx/jni GzzGL-jni.cxx |
Date: |
Wed, 25 Sep 2002 08:42:18 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 02/09/25 08:42:18
Modified files:
gfx/jni : GzzGL-jni.cxx
Log message:
Added function to convert jstrings to unistrings. (Should make tests for
"utf8 string non-null end bug" found by Benja.)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
Patches:
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.31 gzz/gfx/jni/GzzGL-jni.cxx:1.32
*** gzz/gfx/jni/GzzGL-jni.cxx:1.31 Wed Sep 25 08:27:59 2002
--- gzz/gfx/jni/GzzGL-jni.cxx Wed Sep 25 08:42:18 2002
***************
*** 69,74 ****
--- 69,90 ----
vector<int> contextStack;
+ /** Converts java.lang.String to C++ unistring
+ *
+ * typedef std::basic_string<unsigned short> unistring;
+ *
+ * @param env the JNI interface pointer
+ * @param jstr java.lang.String
+ * @return unistring
+ */
+ Renderables::unistring jstr2unistr(JNIEnv *env, jstring jstr) {
+ const jchar *strptr = env->GetStringChars(jstr, 0);
+ Renderables::unistring unistr(strptr);
+ // FIX PROP: Renderables::unistring unistr(strptr,
env->GetStringLength(jstr));
+ env->ReleaseStringChars(jstr, strptr);
+ return unistr;
+ }
+
Os::Window *getWindowByWID(int wid) {
return (wid<0 ? defaultWindow : windows.get(wid));
}