mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
JavaType as a return type for methods
This commit is contained in:
parent
e3f7cb9847
commit
2ddf4e5a01
4 changed files with 94 additions and 49 deletions
|
@ -28,6 +28,7 @@ JavaVM *AndroidUtil::ourJavaVM = 0;
|
|||
shared_ptr<JavaClass> AndroidUtil::Class_java_lang_RuntimeException;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_java_lang_String;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_java_util_Collection;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_java_util_List;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_java_util_Locale;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_java_io_InputStream;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_ZLibrary;
|
||||
|
@ -39,6 +40,7 @@ shared_ptr<JavaClass> AndroidUtil::Class_JavaEncodingCollection;
|
|||
shared_ptr<JavaClass> AndroidUtil::Class_Paths;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_ZLFile;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_ZLFileImage;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_ZLTextModel;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_Book;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_Tag;
|
||||
shared_ptr<JavaClass> AndroidUtil::Class_NativeBookModel;
|
||||
|
@ -125,64 +127,70 @@ bool AndroidUtil::init(JavaVM* jvm) {
|
|||
JNIEnv *env = getEnv();
|
||||
|
||||
Class_java_lang_RuntimeException = new JavaClass(env, "java/lang/RuntimeException");
|
||||
|
||||
Class_java_lang_String = new JavaClass(env, "java/lang/String");
|
||||
Class_java_util_Collection = new JavaClass(env, "java/util/Collection");
|
||||
Class_java_util_List = new JavaClass(env, "java/util/List");
|
||||
Class_java_util_Locale = new JavaClass(env, "java/util/Locale");
|
||||
Class_java_io_InputStream = new JavaClass(env, "java/io/InputStream");
|
||||
|
||||
Class_ZLibrary = new JavaClass(env, "org/geometerplus/zlibrary/core/library/ZLibrary");
|
||||
Class_ZLFile = new JavaClass(env, "org/geometerplus/zlibrary/core/filesystem/ZLFile");
|
||||
Class_ZLFileImage = new JavaClass(env, "org/geometerplus/zlibrary/core/image/ZLFileImage");
|
||||
Class_ZLTextModel = new JavaClass(env, "org/geometerplus/zlibrary/text/model/ZLTextModel");
|
||||
|
||||
Class_Encoding = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/Encoding");
|
||||
Class_EncodingConverter = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/EncodingConverter");
|
||||
Class_JavaEncodingCollection = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/JavaEncodingCollection");
|
||||
|
||||
Class_NativeFormatPlugin = new JavaClass(env, "org/geometerplus/fbreader/formats/NativeFormatPlugin");
|
||||
Class_PluginCollection = new JavaClass(env, "org/geometerplus/fbreader/formats/PluginCollection");
|
||||
Class_Paths = new JavaClass(env, "org/geometerplus/fbreader/Paths");
|
||||
Class_Book = new JavaClass(env, "org/geometerplus/fbreader/library/Book");
|
||||
Class_Tag = new JavaClass(env, "org/geometerplus/fbreader/library/Tag");
|
||||
Class_NativeBookModel = new JavaClass(env, "org/geometerplus/fbreader/bookmodel/NativeBookModel");
|
||||
|
||||
Method_java_lang_String_toLowerCase = new StringMethod(*Class_java_lang_String, "toLowerCase", "()");
|
||||
Method_java_lang_String_toUpperCase = new StringMethod(*Class_java_lang_String, "toUpperCase", "()");
|
||||
|
||||
Class_java_util_Collection = new JavaClass(env, "java/util/Collection");
|
||||
CHECK_NULL( MID_java_util_Collection_toArray = env->GetMethodID(Class_java_util_Collection->j(), "toArray", "()[Ljava/lang/Object;") );
|
||||
|
||||
Class_java_util_Locale = new JavaClass(env, "java/util/Locale");
|
||||
StaticMethod_java_util_Locale_getDefault = new StaticObjectMethod(*Class_java_util_Locale, "getDefault", *Class_java_util_Locale, "()");
|
||||
Method_java_util_Locale_getLanguage = new StringMethod(*Class_java_util_Locale, "getLanguage", "()");
|
||||
|
||||
Class_java_io_InputStream = new JavaClass(env, "java/io/InputStream");
|
||||
Method_java_io_InputStream_close = new VoidMethod(*Class_java_io_InputStream, "close", "()");
|
||||
Method_java_io_InputStream_read = new IntMethod(*Class_java_io_InputStream, "read", "([BII)");
|
||||
Method_java_io_InputStream_skip = new LongMethod(*Class_java_io_InputStream, "skip", "(J)");
|
||||
|
||||
Class_ZLibrary = new JavaClass(env, "org/geometerplus/zlibrary/core/library/ZLibrary");
|
||||
StaticMethod_ZLibrary_Instance = new StaticObjectMethod(*Class_ZLibrary, "Instance", *Class_ZLibrary, "()");
|
||||
Method_ZLibrary_getVersionName = new StringMethod(*Class_ZLibrary, "getVersionName", "()");
|
||||
|
||||
Class_NativeFormatPlugin = new JavaClass(env, "org/geometerplus/fbreader/formats/NativeFormatPlugin");
|
||||
Constructor_NativeFormatPlugin = new Constructor(*Class_NativeFormatPlugin, "(Ljava/lang/String;)V");
|
||||
Method_NativeFormatPlugin_supportedFileType = new StringMethod(*Class_NativeFormatPlugin, "supportedFileType", "()");
|
||||
|
||||
Class_PluginCollection = new JavaClass(env, "org/geometerplus/fbreader/formats/PluginCollection");
|
||||
StaticMethod_PluginCollection_Instance = new StaticObjectMethod(*Class_PluginCollection, "Instance", *Class_PluginCollection, "()");
|
||||
|
||||
Class_Encoding = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/Encoding");
|
||||
Method_Encoding_createConverter = new ObjectMethod(*Class_Encoding, "createConverter", "org/geometerplus/zlibrary/core/encodings/EncodingConverter", "()");
|
||||
|
||||
Class_EncodingConverter = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/EncodingConverter");
|
||||
Method_Encoding_createConverter = new ObjectMethod(*Class_Encoding, "createConverter", *Class_EncodingConverter, "()");
|
||||
Field_EncodingConverter_Name = new ObjectField(*Class_EncodingConverter, "Name", *Class_java_lang_String);
|
||||
Method_EncodingConverter_convert = new IntMethod(*Class_EncodingConverter, "convert", "([BII[BI)");
|
||||
Method_EncodingConverter_reset = new VoidMethod(*Class_EncodingConverter, "reset", "()");
|
||||
|
||||
Class_JavaEncodingCollection = new JavaClass(env, "org/geometerplus/zlibrary/core/encodings/JavaEncodingCollection");
|
||||
StaticMethod_JavaEncodingCollection_Instance = new StaticObjectMethod(*Class_JavaEncodingCollection, "Instance", *Class_JavaEncodingCollection, "()");
|
||||
Method_JavaEncodingCollection_getEncoding_String = new ObjectMethod(*Class_JavaEncodingCollection, "getEncoding", "org/geometerplus/zlibrary/core/encodings/Encoding", "(Ljava/lang/String;)");
|
||||
Method_JavaEncodingCollection_getEncoding_int = new ObjectMethod(*Class_JavaEncodingCollection, "getEncoding", "org/geometerplus/zlibrary/core/encodings/Encoding", "(I)");
|
||||
Method_JavaEncodingCollection_getEncoding_String = new ObjectMethod(*Class_JavaEncodingCollection, "getEncoding", *Class_Encoding, "(Ljava/lang/String;)");
|
||||
Method_JavaEncodingCollection_getEncoding_int = new ObjectMethod(*Class_JavaEncodingCollection, "getEncoding", *Class_Encoding, "(I)");
|
||||
Method_JavaEncodingCollection_providesConverterFor = new BooleanMethod(*Class_JavaEncodingCollection, "providesConverterFor", "(Ljava/lang/String;)");
|
||||
|
||||
Class_ZLFile = new JavaClass(env, "org/geometerplus/zlibrary/core/filesystem/ZLFile");
|
||||
StaticMethod_ZLFile_createFileByPath = new StaticObjectMethod(*Class_ZLFile, "createFileByPath", *Class_ZLFile, "(Ljava/lang/String;)");
|
||||
Method_ZLFile_children = new ObjectMethod(*Class_ZLFile, "children", "java/util/List", "()");
|
||||
Method_ZLFile_children = new ObjectMethod(*Class_ZLFile, "children", *Class_java_util_List, "()");
|
||||
Method_ZLFile_exists = new BooleanMethod(*Class_ZLFile, "exists", "()");
|
||||
Method_ZLFile_isDirectory = new BooleanMethod(*Class_ZLFile, "isDirectory", "()");
|
||||
Method_ZLFile_getInputStream = new ObjectMethod(*Class_ZLFile, "getInputStream", "java/io/InputStream", "()");
|
||||
Method_ZLFile_getInputStream = new ObjectMethod(*Class_ZLFile, "getInputStream", *Class_java_io_InputStream, "()");
|
||||
Method_ZLFile_getPath = new StringMethod(*Class_ZLFile, "getPath", "()");
|
||||
Method_ZLFile_size = new LongMethod(*Class_ZLFile, "size", "()");
|
||||
|
||||
Class_ZLFileImage = new JavaClass(env, "org/geometerplus/zlibrary/core/image/ZLFileImage");
|
||||
Constructor_ZLFileImage = new Constructor(*Class_ZLFileImage, "(Ljava/lang/String;Lorg/geometerplus/zlibrary/core/filesystem/ZLFile;Ljava/lang/String;II)V");
|
||||
|
||||
Class_Paths = new JavaClass(env, "org/geometerplus/fbreader/Paths");
|
||||
StaticMethod_Paths_cacheDirectory = new StaticObjectMethod(*Class_Paths, "cacheDirectory", *Class_java_lang_String, "()");
|
||||
|
||||
Class_Book = new JavaClass(env, "org/geometerplus/fbreader/library/Book");
|
||||
Field_Book_File = new ObjectField(*Class_Book, "File", *Class_ZLFile);
|
||||
Method_Book_getTitle = new StringMethod(*Class_Book, "getTitle", "()");
|
||||
Method_Book_getLanguage = new StringMethod(*Class_Book, "getLanguage", "()");
|
||||
|
@ -195,14 +203,12 @@ bool AndroidUtil::init(JavaVM* jvm) {
|
|||
Method_Book_addTag = new VoidMethod(*Class_Book, "addTag", "(Lorg/geometerplus/fbreader/library/Tag;)");
|
||||
Method_Book_save = new BooleanMethod(*Class_Book, "save", "()");
|
||||
|
||||
Class_Tag = new JavaClass(env, "org/geometerplus/fbreader/library/Tag");
|
||||
StaticMethod_Tag_getTag = new StaticObjectMethod(*Class_Tag, "getTag", *Class_Tag, "(Lorg/geometerplus/fbreader/library/Tag;Ljava/lang/String;)");
|
||||
|
||||
Class_NativeBookModel = new JavaClass(env, "org/geometerplus/fbreader/bookmodel/NativeBookModel");
|
||||
Field_NativeBookModel_Book = new ObjectField(*Class_NativeBookModel, "Book", *Class_Book);
|
||||
Method_NativeBookModel_initInternalHyperlinks = new VoidMethod(*Class_NativeBookModel, "initInternalHyperlinks", "(Ljava/lang/String;Ljava/lang/String;I)");
|
||||
Method_NativeBookModel_initTOC = new VoidMethod(*Class_NativeBookModel, "initTOC", "(Lorg/geometerplus/zlibrary/text/model/ZLTextModel;[I[I)");
|
||||
Method_NativeBookModel_createTextModel = new ObjectMethod(*Class_NativeBookModel, "createTextModel", "org/geometerplus/zlibrary/text/model/ZLTextModel", "(Ljava/lang/String;Ljava/lang/String;I[I[I[I[I[BLjava/lang/String;Ljava/lang/String;I)");
|
||||
Method_NativeBookModel_createTextModel = new ObjectMethod(*Class_NativeBookModel, "createTextModel", *Class_ZLTextModel, "(Ljava/lang/String;Ljava/lang/String;I[I[I[I[I[BLjava/lang/String;Ljava/lang/String;I)");
|
||||
Method_NativeBookModel_setBookTextModel = new VoidMethod(*Class_NativeBookModel, "setBookTextModel", "(Lorg/geometerplus/zlibrary/text/model/ZLTextModel;)");
|
||||
Method_NativeBookModel_setFootnoteModel = new VoidMethod(*Class_NativeBookModel, "setFootnoteModel", "(Lorg/geometerplus/zlibrary/text/model/ZLTextModel;)");
|
||||
Method_NativeBookModel_addImage = new VoidMethod(*Class_NativeBookModel, "addImage", "(Ljava/lang/String;Lorg/geometerplus/zlibrary/core/image/ZLImage;)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue