[sword-svn] r3716 - in trunk/bindings: cordova/cordova-plugin-crosswire-sword/src/ios objc objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad
scribe at crosswire.org
scribe at crosswire.org
Sat Apr 11 13:41:43 MST 2020
Author: scribe
Date: 2020-04-11 13:41:43 -0700 (Sat, 11 Apr 2020)
New Revision: 3716
Modified:
trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
trunk/bindings/objc/Makefile
trunk/bindings/objc/README
trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
Log:
Updated the SWIFT binding to be inline with the JNI bindings
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-04-11 14:22:35 UTC (rev 3715)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-04-11 20:41:43 UTC (rev 3716)
@@ -418,6 +418,18 @@
}
}
+ @objc(SWModule_parseKeyList:)
+ func SWModule_parseKeyList(command: CDVInvokedUrlCommand) {
+ initMgr()
+ let mod = getModule(command: command)
+ if (mod != 0) {
+ let retVal = getStringArray(buffer: org_crosswire_sword_SWModule_parseKeyList(mod, command.arguments[1] as? String ?? ""))
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: retVal), callbackId: command.callbackId)
+ }
+ else {
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_ERROR), callbackId: command.callbackId)
+ }
+ }
@objc(SWModule_getConfigEntry:)
func SWModule_getConfigEntry(command: CDVInvokedUrlCommand) {
@@ -500,6 +512,15 @@
}
}
+ @objc(SWModule_setGlobalOption:)
+ func SWModule_setGlobalOption(command: CDVInvokedUrlCommand) {
+ initMgr()
+ let option = command.arguments[0] as? String ?? ""
+ let value = command.arguments[1] as? String ?? ""
+ org_crosswire_sword_SWMgr_setGlobalOption(mgr, option, value)
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "SWModule_setGlobalOption"), callbackId: command.callbackId)
+ }
+
@objc(SWModule_getRenderText:)
func SWModule_getRenderText(command: CDVInvokedUrlCommand) {
initMgr()
@@ -513,7 +534,33 @@
}
}
+ @objc(SWModule_getStripText:)
+ func SWModule_getStripText(command: CDVInvokedUrlCommand) {
+ initMgr()
+ let mod = getModule(command: command)
+ if (mod != 0) {
+ let retVal = String(cString: org_crosswire_sword_SWModule_stripText(mod))
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: retVal), callbackId: command.callbackId)
+ }
+ else {
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_ERROR), callbackId: command.callbackId)
+ }
+ }
+ @objc(SWModule_getRawEntry:)
+ func SWModule_getRawEntry(command: CDVInvokedUrlCommand) {
+ initMgr()
+ let mod = getModule(command: command)
+ if (mod != 0) {
+ let retVal = String(cString: org_crosswire_sword_SWModule_getRawEntry(mod))
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: retVal), callbackId: command.callbackId)
+ }
+ else {
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_ERROR), callbackId: command.callbackId)
+ }
+ }
+
+
@objc(SWMgr_startBibleSync:)
func SWMgr_startBibleSync(command: CDVInvokedUrlCommand) {
initMgr()
@@ -613,12 +660,12 @@
var v = [String:Any]()
if (error == 0) {
v["verse"] = getVerseKey(keyChildren: getStringArray(buffer: org_crosswire_sword_SWModule_getKeyChildren(mod)))
+ v["text"] = String(cString: org_crosswire_sword_SWModule_renderText(mod))
var preVerse = ""
for i in getStringArray(buffer: org_crosswire_sword_SWModule_getEntryAttribute(mod, "Heading", "Preverse", "", 1)) {
preVerse += i
}
v["preVerse"] = preVerse
- v["text"] = String(cString: org_crosswire_sword_SWModule_renderText(mod))
}
else {
Modified: trunk/bindings/objc/Makefile
===================================================================
--- trunk/bindings/objc/Makefile 2020-04-11 14:22:35 UTC (rev 3715)
+++ trunk/bindings/objc/Makefile 2020-04-11 20:41:43 UTC (rev 3716)
@@ -1,10 +1,12 @@
#
# First enter dependencies/ and run make
#
-# Then open this project ObjCSword.xcodeproj with xcode, select Product|Scheme|SWORD (note all caps)
-# Build
+# For Universal libSWORD.a use XCode and compile SWORD/SWORD.xcodeproj
+# then if you'd like to add ios support to the ../cordova bindings,
+# this Makefile in here will copy the Universal lib and other deps
+# to the correct locations
#
-# Then come here and type make
+# just type: make
#
all: deploycordova
Modified: trunk/bindings/objc/README
===================================================================
--- trunk/bindings/objc/README 2020-04-11 14:22:35 UTC (rev 3715)
+++ trunk/bindings/objc/README 2020-04-11 20:41:43 UTC (rev 3716)
@@ -1,5 +1,5 @@
First you'll need to enter dependencies/ folder and type: make
-For Universal libsword.a use XCode and compile SWORD/SWORD.xcodeproj
+For Universal libSWORD.a use XCode and compile SWORD/SWORD.xcodeproj
then if you'd like to add ios support to the ../cordova bindings,
the Makefile in here will copy the Universal lib and other deps.
Modified: trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
===================================================================
(Binary files differ)
More information about the sword-cvs
mailing list