[sword-svn] r3625 - in trunk: bindings/Android/SWORD/app/src/main/cpp bindings/cordova/org.crosswire.sword.cordova.SWORD bindings/java-jni/jni bindings/java-jni/src/org/crosswire/android/sword include

scribe at crosswire.org scribe at crosswire.org
Sat May 18 19:49:20 MST 2019


Author: scribe
Date: 2019-05-18 19:49:20 -0700 (Sat, 18 May 2019)
New Revision: 3625

Added:
   trunk/bindings/Android/SWORD/app/src/main/cpp/CMakeLists.txt
   trunk/bindings/Android/SWORD/app/src/main/cpp/biblesync
Removed:
   trunk/include/swversion.h
Modified:
   trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/plugin.xml
   trunk/bindings/java-jni/jni/swordstub.cpp
   trunk/bindings/java-jni/src/org/crosswire/android/sword/SWMgr.java
Log:
added missing file to bindings/Android/SWORD project

Added: trunk/bindings/Android/SWORD/app/src/main/cpp/CMakeLists.txt
===================================================================
--- trunk/bindings/Android/SWORD/app/src/main/cpp/CMakeLists.txt	                        (rev 0)
+++ trunk/bindings/Android/SWORD/app/src/main/cpp/CMakeLists.txt	2019-05-19 02:49:20 UTC (rev 3625)
@@ -0,0 +1,232 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+
+SET(CMAKE_C_FLAGS "-DBIBLESYNC ${CMAKE_C_FLAGS}")
+
+#SET(NDK_DEBUG 0)
+SET(CMAKE_C_FLAGS "-D__unix__ ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-D_FTPLIB_NO_COMPAT ${CMAKE_C_FLAGS}")
+
+SET(CMAKE_C_FLAGS "-Wno-invalid-source-encoding ${CMAKE_C_FLAGS}")
+
+
+SET(CMAKE_C_FLAGS "-DOS_ANDROID ${CMAKE_C_FLAGS}")
+
+SET(CMAKE_C_FLAGS "-fvisibility=hidden ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-DSTDC_HEADERS ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-Dunix ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-DANDROID ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-DEXCLUDEBZIP2 ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-DEXCLUDEXZ ${CMAKE_C_FLAGS}")
+SET(CMAKE_C_FLAGS "-DEXCLUDEXZ ${CMAKE_C_FLAGS}")
+
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+
+add_library( # Sets the name of the library.
+        sword
+
+        # Sets the library as a shared library.
+        SHARED
+
+        # Provides a relative path to your source file(s).
+        jni/swordstub.cpp
+        utilfuns/swversion.cpp
+        modules/comments/zcom/zcom.cpp
+        modules/comments/zcom4/zcom4.cpp
+        modules/comments/rawfiles/rawfiles.cpp
+        modules/comments/rawcom4/rawcom4.cpp
+        modules/comments/rawcom/rawcom.cpp
+        modules/comments/swcom.cpp
+        modules/comments/hrefcom/hrefcom.cpp
+        modules/swmodule.cpp
+        modules/tests/echomod.cpp
+        modules/genbook/swgenbook.cpp
+        modules/genbook/rawgenbook/rawgenbook.cpp
+        modules/lexdict/swld.cpp
+        modules/lexdict/rawld4/rawld4.cpp
+        modules/lexdict/zld/zld.cpp
+        modules/lexdict/rawld/rawld.cpp
+        modules/texts/rawtext/rawtext.cpp
+        modules/texts/rawtext4/rawtext4.cpp
+        modules/texts/swtext.cpp
+        modules/texts/ztext/ztext.cpp
+        modules/texts/ztext4/ztext4.cpp
+        modules/common/rawstr4.cpp
+        modules/common/lzsscomprs.cpp
+        modules/common/zipcomprs.cpp
+        modules/common/rawverse4.cpp
+        modules/common/swcipher.cpp
+        modules/common/swcomprs.cpp
+        modules/common/rawverse.cpp
+        modules/common/sapphire.cpp
+        modules/common/zstr.cpp
+        modules/common/entriesblk.cpp
+        modules/common/zverse.cpp
+        modules/common/zverse4.cpp
+        modules/common/rawstr.cpp
+        modules/filters/gbfwordjs.cpp
+        modules/filters/utf8latin1.cpp
+        modules/filters/utf8greekaccents.cpp
+        modules/filters/utf16utf8.cpp
+        modules/filters/gbfwebif.cpp
+        modules/filters/utf8transliterator.cpp
+        modules/filters/gbfstrongs.cpp
+        modules/filters/thmlhtmlhref.cpp
+        modules/filters/thmlxhtml.cpp
+        modules/filters/thmlgbf.cpp
+        modules/filters/utf8utf16.cpp
+        modules/filters/utf8cantillation.cpp
+        modules/filters/utf8arshaping.cpp
+        modules/filters/cipherfil.cpp
+        modules/filters/thmlheadings.cpp
+        modules/filters/thmlscripref.cpp
+        modules/filters/latin1utf8.cpp
+        modules/filters/gbfhtml.cpp
+        modules/filters/thmlosis.cpp
+        modules/filters/utf8nfkd.cpp
+        modules/filters/thmlstrongs.cpp
+        modules/filters/osisenum.cpp
+        modules/filters/osisfootnotes.cpp
+        modules/filters/osisglosses.cpp
+        modules/filters/osisheadings.cpp
+        modules/filters/osishtmlhref.cpp
+        modules/filters/osislemma.cpp
+        modules/filters/osismorph.cpp
+        modules/filters/osismorphsegmentation.cpp
+        modules/filters/osisosis.cpp
+        modules/filters/osisplain.cpp
+        modules/filters/osisredletterwords.cpp
+        modules/filters/osisrtf.cpp
+        modules/filters/osisscripref.cpp
+        modules/filters/osisstrongs.cpp
+        modules/filters/osisvariants.cpp
+        modules/filters/osiswebif.cpp
+        modules/filters/osiswordjs.cpp
+        modules/filters/osisxhtml.cpp
+        modules/filters/osisxlit.cpp
+        modules/filters/osisreferencelinks.cpp
+        modules/filters/thmlmorph.cpp
+        modules/filters/gbfplain.cpp
+        modules/filters/gbfhtmlhref.cpp
+        modules/filters/gbfxhtml.cpp
+        modules/filters/utf8html.cpp
+        modules/filters/utf8nfc.cpp
+        modules/filters/rtfhtml.cpp
+        modules/filters/gbfredletterwords.cpp
+        modules/filters/latin1utf16.cpp
+        modules/filters/thmlhtml.cpp
+        modules/filters/gbfthml.cpp
+        modules/filters/teihtmlhref.cpp
+        modules/filters/teixhtml.cpp
+        modules/filters/gbfrtf.cpp
+        modules/filters/gbfosis.cpp
+        modules/filters/teirtf.cpp
+        modules/filters/thmlwordjs.cpp
+        modules/filters/papyriplain.cpp
+        modules/filters/utf8bidireorder.cpp
+        modules/filters/gbfheadings.cpp
+        modules/filters/thmlrtf.cpp
+        modules/filters/swoptfilter.cpp
+        modules/filters/utf8arabicpoints.cpp
+        modules/filters/unicodertf.cpp
+        modules/filters/gbffootnotes.cpp
+        modules/filters/greeklexattribs.cpp
+        modules/filters/thmlfootnotes.cpp
+        modules/filters/thmlplain.cpp
+        modules/filters/utf8hebrewpoints.cpp
+        modules/filters/thmlwebif.cpp
+        modules/filters/thmlvariants.cpp
+        modules/filters/thmllemma.cpp
+        modules/filters/gbfmorph.cpp
+        modules/filters/teiplain.cpp
+        modules/filters/swbasicfilter.cpp
+        modules/filters/scsuutf8.cpp
+        modules/filters/gbflatex.cpp
+        modules/filters/thmllatex.cpp
+        modules/filters/teilatex.cpp
+        modules/filters/osislatex.cpp
+        mgr/stringmgr.cpp
+        mgr/swmgr.cpp
+        mgr/swsearchable.cpp
+        mgr/localemgr.cpp
+        mgr/swconfig.cpp
+        mgr/markupfiltmgr.cpp
+        mgr/encfiltmgr.cpp
+        mgr/swfiltermgr.cpp
+        mgr/swcacher.cpp
+        mgr/installmgr.cpp
+        mgr/swlocale.cpp
+        mgr/filemgr.cpp
+        mgr/versificationmgr.cpp
+        mgr/remotetrans.cpp
+        mgr/ftplibftpt.cpp
+        utilfuns/swobject.cpp
+        utilfuns/roman.cpp
+        utilfuns/swbuf.cpp
+        utilfuns/utilstr.cpp
+        utilfuns/ftplib.c
+        utilfuns/ftpparse.c
+        utilfuns/url.cpp
+        utilfuns/utilxml.cpp
+        keys/swkey.cpp
+        keys/versetreekey.cpp
+        keys/treekeyidx.cpp
+        keys/versekey.cpp
+        keys/strkey.cpp
+        keys/treekey.cpp
+        keys/listkey.cpp
+        frontend/swdisp.cpp
+        frontend/swlog.cpp
+        utilfuns/zlib/untgz.c
+
+        biblesync/biblesync.cc
+        biblesync/Android/ifaddrs.c
+        biblesync/Android/uuid.c
+
+
+        )
+
+include_directories(
+        ../../../../../../../include
+
+        ../../../../../../../../biblesync/include
+        ../../../../../../../../biblesync/src/Android/
+
+)
+
+
+# Searches for a specified prebuilt library and stores the path as a
+# variable. Because CMake includes system libraries in the search path by
+# default, you only need to specify the name of the public NDK library
+# you want to add. CMake verifies that the library exists before
+# completing its build.
+
+find_library( # Sets the name of the path variable.
+        log-lib
+
+        # Specifies the name of the NDK library that
+        # you want CMake to locate.
+        log)
+
+# Specifies libraries CMake should link to your target library. You
+# can link multiple libraries, such as libraries you define in this
+# build script, prebuilt third-party libraries, or system libraries.
+
+target_link_libraries( # Specifies the target library.
+        sword
+
+        # Links the target library to the log library
+        # included in the NDK.
+        ${log-lib}
+        z
+        )
\ No newline at end of file

Added: trunk/bindings/Android/SWORD/app/src/main/cpp/biblesync
===================================================================
--- trunk/bindings/Android/SWORD/app/src/main/cpp/biblesync	                        (rev 0)
+++ trunk/bindings/Android/SWORD/app/src/main/cpp/biblesync	2019-05-19 02:49:20 UTC (rev 3625)
@@ -0,0 +1 @@
+link ../../../../../../../../biblesync/src/
\ No newline at end of file


Property changes on: trunk/bindings/Android/SWORD/app/src/main/cpp/biblesync
___________________________________________________________________
Added: svn:special
   + *

Modified: trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/plugin.xml
===================================================================
--- trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/plugin.xml	2019-05-19 02:49:01 UTC (rev 3624)
+++ trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/plugin.xml	2019-05-19 02:49:20 UTC (rev 3625)
@@ -57,10 +57,12 @@
         <source-file src="libs/android/x86/libsword.so" target-dir="libs/x86" />
         <source-file src="libs/android/x86_64/libsword.so" target-dir="libs/x86_64" />
 
+<!-- no longer needed with latest ndk
         <source-file src="libs/android/arm64-v8a/libc++_shared.so" target-dir="libs/arm64-v8a" />
         <source-file src="libs/android/armeabi-v7a/libc++_shared.so" target-dir="libs/armeabi-v7a" />
         <source-file src="libs/android/x86/libc++_shared.so" target-dir="libs/x86" />
         <source-file src="libs/android/x86_64/libc++_shared.so" target-dir="libs/x86_64" />
+-->
 <!--
         <source-file src="libs/android/arm64-v8a/libstlport_shared.so" target-dir="libs/arm64-v8a" />
         <source-file src="libs/android/armeabi-v7a/libstlport_shared.so" target-dir="libs/armeabi-v7a" />

Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp	2019-05-19 02:49:01 UTC (rev 3624)
+++ trunk/bindings/java-jni/jni/swordstub.cpp	2019-05-19 02:49:20 UTC (rev 3625)
@@ -910,7 +910,25 @@
 }
 
 
+/*
+ * Class:     org_crosswire_android_sword_SWMgr
+ * Method:    translate
+ * Signature: (Ljava/lang/String;Ljava/lang/String)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_crosswire_android_sword_SWMgr_translate
+		(JNIEnv *env, jobject me, jstring textJS, jstring localeNameJS) {
+	const char *text = env->GetStringUTFChars(textJS, NULL);
+	const char *localeName = env->GetStringUTFChars(localeNameJS, NULL);
 
+	SWBuf translation = assureValidUTF8(LocaleMgr::getSystemLocaleMgr()->translate(text, localeName));
+
+	env->ReleaseStringUTFChars(localeNameJS, localeName);
+	env->ReleaseStringUTFChars(textJS, text);
+
+	return strToUTF8Java(env, translation);
+}
+
+
 // SWModule methods ----------------------------------------------------------------------------------
 
 

Modified: trunk/bindings/java-jni/src/org/crosswire/android/sword/SWMgr.java
===================================================================
--- trunk/bindings/java-jni/src/org/crosswire/android/sword/SWMgr.java	2019-05-19 02:49:01 UTC (rev 3624)
+++ trunk/bindings/java-jni/src/org/crosswire/android/sword/SWMgr.java	2019-05-19 02:49:20 UTC (rev 3625)
@@ -63,6 +63,7 @@
 	public native void        setJavascript(boolean val);
 	public native String[]    getAvailableLocales();
 	public native void        setDefaultLocale(String name);
+	public native String      translate(String text, String localeName);
 
 	/**
 	 * add a conf snippet to extraConfig.  This is useful for adding a config section

Deleted: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2019-05-19 02:49:01 UTC (rev 3624)
+++ trunk/include/swversion.h	2019-05-19 02:49:20 UTC (rev 3625)
@@ -1,74 +0,0 @@
-/******************************************************************************
- *
- *  swversion.h -	definition of class SWVersion used to compare version
- *			info
- *
- * $Id$
- *
- * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
- *	CrossWire Bible Society
- *	P. O. Box 2528
- *	Tempe, AZ  85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- */
-
-#ifndef SWVERSION_H
-#define SWVERSION_H
-
-#define SWORD_VERSION_NUM 108900000
-#define SWORD_VERSION_STR "1.8.900"
-#define SWORD_VERSION_MAJOR 1
-#define SWORD_VERSION_MINOR 8
-#define SWORD_VERSION_MICRO 900
-#define SWORD_VERSION_NANO 0
-
-#include <defs.h>
-SWORD_NAMESPACE_START
-
-/** A basic tool class to handle program version numbers.
-*/
-class SWDLLEXPORT SWVersion {
-	public:
-	/** The different version subnumbers.
-	*/
-	int major, minor, minor2, minor3;
-	/**The constructor.
-	* @param version Version string to be parsed.
-	*/
-	SWVersion(const char *version = "0.0");
-	/** Compare 2 Versions with each other.
-	* @param vi Version number to compare with.
-	* @return >0:this>vi; 0:this==vi; <0:this<vi
-	*/
-	int compare(const SWVersion &vi) const;
-	/** @return The parsed version number text.
-	*/
-	const char *getText() const;
-	/** @return The parsed version number text.
-	*/
-	operator const char *() const { return getText(); }
-	bool operator>(const SWVersion &vi) const {return (compare(vi) > 0);}
-	bool operator<(const SWVersion &vi) const {return (compare(vi) < 0);}
-	bool operator>=(const SWVersion &vi) const {return (compare(vi) >= 0);}
-	bool operator<=(const SWVersion &vi) const {return (compare(vi) <= 0);}
-	bool operator==(const SWVersion &vi) const {return (compare(vi) == 0);}
-
-	/** Current sword library version.
-	* Use this to check (e.g. at compile time) if the
-	* version of the sword lib is recent enough for your program.
-	*/
-	static SWVersion currentVersion;
-};
-
-SWORD_NAMESPACE_END
-#endif
-




More information about the sword-cvs mailing list