├── BUILDING ├── platforms ├── android │ ├── kirin-for-android │ │ ├── .exists │ │ ├── .idea │ │ │ ├── .name │ │ │ ├── copyright │ │ │ │ └── profiles_settings.xml │ │ │ ├── scopes │ │ │ │ └── scope_settings.xml │ │ │ ├── encodings.xml │ │ │ ├── vcs.xml │ │ │ ├── modules.xml │ │ │ ├── gradle.xml │ │ │ └── compiler.xml │ │ ├── settings.gradle │ │ ├── kirin-lib │ │ │ ├── src │ │ │ │ ├── androidTest │ │ │ │ │ ├── assets │ │ │ │ │ │ └── generated-javascript │ │ │ │ │ │ │ └── databases │ │ │ │ │ │ │ └── dummyFile.sql │ │ │ │ │ ├── res │ │ │ │ │ │ ├── drawable-hdpi │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── drawable-ldpi │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── drawable-mdpi │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ └── strings.xml │ │ │ │ │ │ └── layout │ │ │ │ │ │ │ └── main.xml │ │ │ │ │ ├── java │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── futureplatforms │ │ │ │ │ │ │ └── kirin │ │ │ │ │ │ │ ├── TestingApplication.java │ │ │ │ │ │ │ └── test │ │ │ │ │ │ │ ├── testable │ │ │ │ │ │ │ └── TestableObjectHolder.java │ │ │ │ │ │ │ └── dummies │ │ │ │ │ │ │ └── DummyJsContext.java │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── futureplatforms │ │ │ │ │ │ └── kirin │ │ │ │ │ │ ├── state │ │ │ │ │ │ ├── IKirinFileSystem.java │ │ │ │ │ │ └── IKirinDropbox.java │ │ │ │ │ │ ├── internal │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ ├── IJsContext.java │ │ │ │ │ │ │ ├── IObjectHolder.java │ │ │ │ │ │ │ ├── IKirinState.java │ │ │ │ │ │ │ ├── UiObjectHolder.java │ │ │ │ │ │ │ ├── DefaultObjectHandler.java │ │ │ │ │ │ │ ├── INativeContext.java │ │ │ │ │ │ │ └── JsCommands.java │ │ │ │ │ │ ├── fragmentation │ │ │ │ │ │ │ ├── CursorCoercer.java │ │ │ │ │ │ │ └── WebChromeClient7.java │ │ │ │ │ │ └── KirinPaths.java │ │ │ │ │ │ ├── application │ │ │ │ │ │ ├── IKirinApplication.java │ │ │ │ │ │ └── KirinApplication.java │ │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── IKirinExtensionOnNonDefaultThread.java │ │ │ │ │ │ ├── IKirinExtensionOnUiThread.java │ │ │ │ │ │ ├── IProguardImmunity.java │ │ │ │ │ │ ├── IKirinExtension.java │ │ │ │ │ │ ├── settings │ │ │ │ │ │ │ └── ISettingsBackend.java │ │ │ │ │ │ ├── localnotifications │ │ │ │ │ │ │ └── ILocalNotificationsBackend.java │ │ │ │ │ │ ├── networking │ │ │ │ │ │ │ └── INetworkingBackend.java │ │ │ │ │ │ └── databases │ │ │ │ │ │ │ └── IDatabasesBackend.java │ │ │ │ │ │ ├── generated │ │ │ │ │ │ ├── location │ │ │ │ │ │ │ ├── KirinLocationPermissions.java │ │ │ │ │ │ │ ├── KirinLocation.java │ │ │ │ │ │ │ ├── KirinLocationBackend.java │ │ │ │ │ │ │ ├── KirinLocationData.java │ │ │ │ │ │ │ └── KirinLocationListener.java │ │ │ │ │ │ ├── fs │ │ │ │ │ │ │ ├── KirinFilesystem.java │ │ │ │ │ │ │ ├── KirinFile.java │ │ │ │ │ │ │ ├── KirinFoundFile.java │ │ │ │ │ │ │ ├── KirinCallback.java │ │ │ │ │ │ │ └── KirinOptionalCallback.java │ │ │ │ │ │ ├── xhr │ │ │ │ │ │ │ ├── KirinXHRProgressEvent.java │ │ │ │ │ │ │ ├── KirinXHRResponse.java │ │ │ │ │ │ │ ├── KirinXMLHTTPRequest.java │ │ │ │ │ │ │ └── KirinXHRExtension.java │ │ │ │ │ │ └── preferences │ │ │ │ │ │ │ ├── KirinPreferences.java │ │ │ │ │ │ │ ├── KirinPreferenceListener.java │ │ │ │ │ │ │ └── KirinPreferencesBackend.java │ │ │ │ │ │ ├── helpers │ │ │ │ │ │ ├── KirinApplicationHelper.java │ │ │ │ │ │ ├── KirinUiFragmentHelper.java │ │ │ │ │ │ └── IKirinExtensionHelper.java │ │ │ │ │ │ └── ui │ │ │ │ │ │ └── KirinRowRenderer.java │ │ │ │ │ ├── res │ │ │ │ │ └── values │ │ │ │ │ │ └── strings.xml │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── build.gradle │ │ ├── gradle │ │ │ ├── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ └── gradle.iml │ │ ├── build.gradle │ │ └── kirin-for-android.iml │ ├── Kirin-Lib-Test │ │ ├── .gitignore │ │ ├── default.properties │ │ ├── project.properties │ │ ├── .classpath │ │ ├── proguard-project.txt │ │ ├── .project │ │ └── proguard.cfg │ └── attic-Kirin-Lib │ │ ├── .gitignore │ │ ├── .classpath │ │ ├── project.properties │ │ ├── .project │ │ └── proguard.cfg └── ios │ └── KirinKit │ ├── KirinKit │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── KirinKit-Prefix.pch │ ├── Core │ │ ├── KirinScreenHelper.h │ │ ├── KirinAppDelegateHelper.h │ │ ├── NativeExecutor.h │ │ ├── KirinExtensionOnMainThread.h │ │ ├── KirinAppDelegateHelper.m │ │ ├── KirinExtensionHelper.h │ │ ├── KirinProxyWithModule.h │ │ ├── KirinUiFragmentHelper.h │ │ ├── KirinExtensionProtocol.h │ │ ├── KirinState.m │ │ ├── JSContext.h │ │ ├── KirinKitUI.h │ │ ├── KirinProxyWithDictionary.h │ │ ├── KirinProxyWithEmptyDictionary.h │ │ ├── KirinState.h │ │ ├── KirinExtensionHelper.m │ │ ├── NativeObjectHolder.h │ │ ├── KirinUiFragmentHelper.m │ │ ├── NativeContext.h │ │ ├── KirinExtensions.h │ │ ├── KirinUITableViewController.h │ │ ├── KirinWebViewHolder.h │ │ ├── KirinUIViewController.h │ │ ├── KirinArgs.h │ │ ├── KirinPaths.h │ │ ├── KirinScreenHelper.m │ │ ├── KirinExtensionStub.h │ │ ├── DebugConsole.m │ │ ├── DebugConsole.h │ │ ├── KirinKit.h │ │ ├── KirinFileSystem.h │ │ ├── KirinProxy.h │ │ ├── JSContext.m │ │ ├── KirinDropbox.h │ │ ├── KirinUITableViewController.m │ │ └── JSExecutor.h │ ├── Extensions │ │ ├── FileSystemBackend.h │ │ ├── ImageTransformProtocol.h │ │ ├── CameraProtocol.h │ │ ├── PreferencesBackendImpl.h │ │ ├── KirinImageTransformer.h │ │ ├── KirinLocationBackendImpl.h │ │ ├── KirinLocationLegacy.h │ │ ├── KirinLocationLegacyBackend.h │ │ ├── StringDownloader.h │ │ ├── FileSystem.h │ │ ├── KirinImagePicker.h │ │ ├── SettingsBackend.h │ │ ├── NetworkingBackend.h │ │ ├── Settings.h │ │ ├── SQLiteDatabase.h │ │ ├── Networking.h │ │ ├── Connection.h │ │ ├── Database.h │ │ ├── JSONListDownloader.h │ │ └── FileDownloader.h │ └── KirinKit-Info.plist │ └── KirinKitTests │ ├── en.lproj │ └── InfoPlist.strings │ ├── KirinKitTests-Prefix.pch │ ├── NetworkingTest.m │ ├── KirinArgsTest.h │ ├── KirinProxyTest.h │ ├── NetworkingTest.h │ ├── KirinTests.h │ ├── DummyNativeContext.h │ ├── KirinHelperTest.h │ ├── DummyResponseValueObject.h │ ├── DummyNativeContext.m │ ├── NativeContextTest.h │ ├── DummyJSContext.h │ ├── DummyProtocol.h │ ├── DummyNativeObject.h │ ├── KirinKitTests-Info.plist │ ├── DummyValueObject.h │ ├── KirinTests.m │ ├── KirinArgsTest.m │ └── DummyJSContext.m ├── examples └── HelloKirin │ ├── lib │ ├── Environment.js │ ├── list │ │ └── stubs │ │ │ └── IDumbListScreenModule.stub.js │ └── button │ │ ├── stubs │ │ └── IDumbButtonScreenModule.stub.js │ │ └── DumbButtonScreenModule.js │ ├── build.sh │ ├── platforms │ ├── ios │ │ └── HelloKirin-iOS │ │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ │ ├── HelloKirin-iOS-Prefix.pch │ │ │ ├── main.m │ │ │ ├── DumbListViewController.h │ │ │ ├── HelloKirin_iOSAppDelegate.h │ │ │ ├── RootViewController.h │ │ │ └── HelloKirin-iOS-Info.plist │ └── android │ │ ├── res │ │ ├── values │ │ │ ├── integer.xml │ │ │ ├── themes.xml │ │ │ ├── strings.xml │ │ │ ├── dimens.xml │ │ │ ├── color.xml │ │ │ └── styles.xml │ │ ├── drawable-hdpi │ │ │ ├── icon.png │ │ │ └── fp_logo.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ ├── btn_bg.xml │ │ │ └── bg_gradient.xml │ │ ├── layout │ │ │ ├── dumb_row.xml │ │ │ ├── dumb_list_activity.xml │ │ │ └── dumb_button_activity.xml │ │ └── layout-land │ │ │ └── dumb_button_activity.xml │ │ ├── src │ │ └── com │ │ │ └── futureplatforms │ │ │ └── kirin │ │ │ └── generated │ │ │ └── demo │ │ │ └── hellokirin │ │ │ ├── IDumbButtonScreenModule.java │ │ │ ├── IDumbListScreenModule.java │ │ │ ├── IDumbButtonScreen.java │ │ │ └── IDumbListScreen.java │ │ ├── .classpath │ │ ├── project.properties │ │ ├── HelloKirin-build javascript.launch │ │ ├── proguard-project.txt │ │ ├── .project │ │ ├── AndroidManifest.xml │ │ └── proguard.cfg │ ├── .project │ ├── package.json │ ├── .jshintrc │ └── idl │ └── idl.js ├── templates ├── app │ └── content │ │ ├── build.sh │ │ ├── platforms │ │ ├── ios │ │ │ ├── __project_name__Tests │ │ │ │ ├── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── __project_name__Tests.h │ │ │ │ ├── __project_name__Tests.m │ │ │ │ └── __project_name__Tests-Info.plist │ │ │ └── __project_name__ │ │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── __project_name__-Prefix.pch │ │ │ │ ├── main.m │ │ │ │ ├── __class_prefix__DetailViewController.h │ │ │ │ ├── __class_prefix__AppDelegate.h │ │ │ │ └── __class_prefix__MasterViewController.h │ │ └── android │ │ │ ├── bin │ │ │ └── jarlist.cache │ │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── item_master_list.xml │ │ │ │ └── activity_master_list.xml │ │ │ ├── src │ │ │ └── xXcontextPackageXx │ │ │ │ └── xXshortNameXx │ │ │ │ └── C.java │ │ │ ├── .classpath │ │ │ ├── project.properties │ │ │ ├── proguard-project.txt │ │ │ ├── project.properties.template │ │ │ ├── AndroidManifest.xml │ │ │ ├── .project │ │ │ ├── Build __project_name__ Javascript.launch │ │ │ └── Run __project_name__.launch │ │ ├── shared │ │ ├── .project │ │ ├── idl │ │ │ └── __javascript_screen_module__.idl.js │ │ └── lib │ │ │ └── xXjavascript_screen_moduleXx.js │ │ ├── package.json │ │ └── .jshintrc └── screen-module │ ├── content │ ├── platforms │ │ ├── ios │ │ │ └── __project_name__ │ │ │ │ └── __ModuleViewController__.h │ │ └── android │ │ │ └── res │ │ │ └── layout │ │ │ └── activity___screen_layout__.xml │ └── shared │ │ ├── idl │ │ └── __module_name__.idl.js │ │ └── lib │ │ └── __module_name__.js │ └── prompts.js ├── javascript ├── lib │ ├── entry.js │ ├── utils │ │ ├── ImageUtils.js │ │ └── bridge-utils.js │ └── extensions │ │ ├── resources │ │ └── create_db_services-qt.sql │ │ ├── filesystem │ │ ├── KirinOptionalCallback.js │ │ ├── KirinCallback.js │ │ └── KirinFile.js │ │ ├── Timers-webview.js │ │ ├── window-webview.js │ │ ├── preferences │ │ └── KirinPreferenceListener.js │ │ ├── location │ │ ├── DemoLocationListener.js │ │ └── KirinLocationListener.js │ │ ├── ImageTransform.js │ │ ├── Camera.js │ │ └── network │ │ └── KirinXHRequest.js ├── build-config-local.js ├── build-config-local.template.js ├── views │ └── index.html ├── build-config.js ├── test │ ├── test-environment │ │ ├── kirin.js │ │ ├── dates.js │ │ ├── Environment.js │ │ └── Settings-backend.js │ └── dummies │ │ ├── Networking-backend.js │ │ └── DummyScreen.js ├── extensions.js └── package.json ├── README.md ├── bin └── rebuild_kirinkit.sh ├── .gitignore ├── .jshintrc └── RELEASE-NOTES /BUILDING: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.exists: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/HelloKirin/lib/Environment.js: -------------------------------------------------------------------------------- 1 | // placeholder. -------------------------------------------------------------------------------- /platforms/android/Kirin-Lib-Test/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/.name: -------------------------------------------------------------------------------- 1 | kirin-for-android -------------------------------------------------------------------------------- /examples/HelloKirin/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $HOME/bin/kirin-build $@ 3 | -------------------------------------------------------------------------------- /templates/app/content/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $HOME/bin/kirin-build $@ 3 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':kirin-lib' 2 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/ios/HelloKirin-iOS/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/values/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /platforms/android/Kirin-Lib-Test/default.properties: -------------------------------------------------------------------------------- 1 | android.library.reference.1=../JSCore-Android-Lib 2 | # Project target. 3 | target=android-10 4 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/assets/generated-javascript/databases/dummyFile.sql: -------------------------------------------------------------------------------- 1 | ASSETS SQL 0; 2 | ASSETS SQL 1; 3 | ASSETS SQL 2; 4 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/examples/HelloKirin/platforms/android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/examples/HelloKirin/platforms/android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/examples/HelloKirin/platforms/android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable-hdpi/fp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/examples/HelloKirin/platforms/android/res/drawable-hdpi/fp_logo.png -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/platforms/android/kirin-for-android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /templates/app/content/platforms/android/bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependecy. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/KirinKit-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'KirinKit' target in the 'KirinKit' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #endif 7 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/templates/app/content/platforms/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/templates/app/content/platforms/android/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/templates/app/content/platforms/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/templates/app/content/platforms/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/gradle/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/platforms/android/kirin-for-android/gradle/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /javascript/lib/entry.js: -------------------------------------------------------------------------------- 1 | // This file is here so client modules can require kirin, 2 | // but still let overidify select the right implementation for 3 | // us to use. 4 | 5 | module.exports = require('./core/kirin'); -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/state/IKirinFileSystem.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.state; 2 | 3 | 4 | public interface IKirinFileSystem { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /javascript/build-config-local.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "ios": { 3 | "project-dir": "platforms/ios/KirinKit/KirinKit.xcodeproj" 4 | }, 5 | "android": { 6 | "project-dir": "platforms/android/Kirin-Lib" 7 | } 8 | }; -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KirinJS/Kirin/HEAD/platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /javascript/build-config-local.template.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "ios": { 3 | "project-dir": "platforms/ios/KirinKit/KirinKit.xcodeproj" 4 | }, 5 | "android": { 6 | "project-dir": "platforms/android/Kirin-Lib" 7 | } 8 | }; -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | "Oh noes. I'm on a train." 4 | 5 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/IJsContext.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.internal.core; 2 | 3 | 4 | public interface IJsContext { 5 | void js(String pattern); 6 | } 7 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/KirinKitTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'KirinKitTests' target in the 'KirinKitTests' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, DumbButtonActivity! 4 | Application 5 | 6 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World! 4 | JSCore-Android-LibTest 5 | 6 | -------------------------------------------------------------------------------- /examples/HelloKirin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | HelloKirin-js 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/application/IKirinApplication.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.application; 2 | 3 | import com.futureplatforms.kirin.Kirin; 4 | 5 | public interface IKirinApplication { 6 | Kirin getKirin(); 7 | } 8 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/src/xXcontextPackageXx/xXshortNameXx/C.java: -------------------------------------------------------------------------------- 1 | package xXcontextPackageXx.xXshortNameXx; 2 | 3 | public final class C { 4 | private C() { 5 | // no instantiation. 6 | } 7 | 8 | public static final String TAG = "__project_name__"; 9 | } 10 | -------------------------------------------------------------------------------- /templates/app/content/shared/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | __project_name__ Javascript 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/src/com/futureplatforms/kirin/generated/demo/hellokirin/IDumbButtonScreenModule.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.demo.hellokirin; 2 | 3 | 4 | public interface IDumbButtonScreenModule { 5 | 6 | void onDumbButtonClick(); 7 | 8 | void onNextScreenButtonClick(); 9 | } -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip 7 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/IKirinExtensionOnNonDefaultThread.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.extensions; 2 | 3 | import java.util.concurrent.Executor; 4 | 5 | public interface IKirinExtensionOnNonDefaultThread { 6 | Executor getExecutor(); 7 | } 8 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/NetworkingTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkingTest.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 20/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "NetworkingTest.h" 10 | 11 | @implementation NetworkingTest 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/gradle/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Oct 09 00:59:30 BST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip 7 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World, __project_name__Activity! 5 | __project_name__ 6 | Add rows 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kirin 2 | ===== 3 | Kirin has moved to [https://github.com/futureplatforms/Kirin](https://github.com/futureplatforms/Kirin), where cross-platform development is supported in Java. 4 | 5 | Kirin in JavaScript is still being championed by [James Hugman](https://twitter.com/jhugman), please follow him on Twitter for more information. -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/location/KirinLocationPermissions.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.location; 2 | 3 | 4 | public interface KirinLocationPermissions { 5 | 6 | void setAuthorized(boolean authorized); 7 | 8 | boolean getAuthorized(); 9 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/KirinArgsTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinArgsTest.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 03/05/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KirinArgsTest : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/KirinProxyTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinProxyTest.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 31/03/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | 13 | @interface KirinProxyTest : SenTestCase 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/NetworkingTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkingTest.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 20/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NetworkingTest : SenTestCase { 12 | 13 | } 14 | @end 15 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/IObjectHolder.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.internal.core; 2 | 3 | import java.util.Collection; 4 | 5 | public interface IObjectHolder { 6 | 7 | public void invoke(String methodName, Object... args); 8 | 9 | Collection getMethodNames(); 10 | } 11 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/KirinTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinTests.h 3 | // KirinTests 4 | // 5 | // Created by James Hugman on 21/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface KirinTests : SenTestCase { 13 | @private 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/fs/KirinFilesystem.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.fs; 2 | 3 | 4 | /** 5 | * This module is actually replaces the window.XHR with one connected to native. The native implementation should provide resiliance to interrupts. 6 | */ 7 | public interface KirinFilesystem { 8 | } -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/xhr/KirinXHRProgressEvent.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.xhr; 2 | 3 | 4 | public interface KirinXHRProgressEvent { 5 | 6 | void setLoaded(int loaded); 7 | 8 | int getLoaded(); 9 | 10 | void setTotal(int total); 11 | 12 | int getTotal(); 13 | } -------------------------------------------------------------------------------- /platforms/android/attic-Kirin-Lib/.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | proguard-project.txt 18 | 19 | # Eclipse project files 20 | .classpath 21 | .project -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/xhr/KirinXHRResponse.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.xhr; 2 | 3 | 4 | public interface KirinXHRResponse { 5 | 6 | void setStatus(int status); 7 | 8 | int getStatus(); 9 | 10 | void setStatusText(String statusText); 11 | 12 | String getStatusText(); 13 | } -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__Tests/__project_name__Tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // __project_name__Tests.h 3 | // __project_name__Tests 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface __project_name__Tests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/src/com/futureplatforms/kirin/generated/demo/hellokirin/IDumbListScreenModule.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.demo.hellokirin; 2 | 3 | 4 | public interface IDumbListScreenModule { 5 | 6 | /** 7 | * @param index {@link int} 8 | * @param label {@link String} 9 | */ 10 | void onListItemClick(int index, String label); 11 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyNativeContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyNativeContext.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface DummyNativeContext : NativeContext { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:0.12.2' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | jcenter() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10px 4 | 20dp 5 | 20dp 6 | 50dp 7 | 10dp 8 | 20dp 9 | -------------------------------------------------------------------------------- /platforms/android/attic-Kirin-Lib/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinScreenHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinScreenHelper.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 10/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface KirinScreenHelper : KirinUiFragmentHelper { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /bin/rebuild_kirinkit.sh: -------------------------------------------------------------------------------- 1 | if [[ "$KIRIN_HOME" = "" ]] ; then 2 | export KIRIN_HOME=`dirname $0`/.. 3 | fi 4 | configuration=$1 5 | if [[ "$configuration" = "" ]] ; then 6 | configuration="debug release" 7 | fi 8 | rm -Rf $KIRIN_HOME/platforms/ios/KirinKit/build 2>/dev/null 9 | for conf in $configuration ; do 10 | $HOME/bin/kirin-build --src $KIRIN_HOME --platform ios --native --target $conf --noJavascript 11 | done 12 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinAppDelegateHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinAppDelegateHelper.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 09/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KirinAppDelegateHelper : KirinUiFragmentHelper 12 | 13 | - (UIViewController*) viewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/NativeExecutor.h: -------------------------------------------------------------------------------- 1 | // 2 | // NativeExecutor.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @protocol NativeExecutor 13 | - (void) executeCommandFromModule: (NSString*) host andMethod: (NSString*) file andArgsList: (NSString*) query; 14 | @end 15 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/FileSystemBackend.h: -------------------------------------------------------------------------------- 1 | // 2 | // FileSystemBackend.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 08/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "FileSystem.h" 12 | 13 | @interface FileSystemBackend : KirinExtensionStub 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinExtensionOnMainThread.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinExtensionWithUI.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 29/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | /* 10 | * Marker protocol. This ensure it runs on the main thread. 11 | */ 12 | #import 13 | 14 | @protocol KirinExtensionOnMainThread 15 | 16 | @end -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/ImageTransformProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageTransformProtocol.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 08/03/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ImageTransformProtocol 12 | - (void) transform: (NSString*) transformType withConfig: (NSDictionary*) config; 13 | @end 14 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/fs/KirinFile.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.fs; 2 | 3 | 4 | public interface KirinFile { 5 | 6 | String getName(); 7 | 8 | String getType(); 9 | 10 | long getSize(); 11 | 12 | String getFileArea(); 13 | 14 | /** 15 | * @param text {@link String} 16 | */ 17 | void _append(String text); 18 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinAppDelegateHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // KirinAppDelegateHelper.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 09/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinAppDelegateHelper.h" 10 | 11 | @implementation KirinAppDelegateHelper 12 | 13 | - (UIViewController*) viewController { 14 | return self.state.currentScreen; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/CameraProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // CameraProtocol.h 3 | // Moo 4 | // 5 | // Created by James Hugman on 24/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol CameraProtocol 12 | 13 | - (void) galleryPicture: (NSDictionary*) config; 14 | 15 | - (void) cameraPicture: (NSDictionary*) config; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/ios/HelloKirin-iOS/HelloKirin-iOS-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'HelloKirin-iOS' target in the 'HelloKirin-iOS' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/PreferencesBackendImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // PreferencesBackend.h 3 | // KirinKit 4 | // 5 | // Created by James on 06/10/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KirinPreferencesBackend.h" 11 | 12 | @interface PreferencesBackendImpl : KirinExtensionStub 13 | 14 | + (PreferencesBackendImpl*) instance; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/__project_name__-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the '__project_name__' target in the '__project_name__' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinExtensionHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinExtensionHelper.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 10/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface KirinExtensionHelper : KirinHelper { 13 | 14 | } 15 | 16 | - (void) onStart; 17 | 18 | - (void) onStop; 19 | 20 | - (UIViewController*) viewController; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinProxyWithModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinProxyWithModule.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 26/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinProxy.h" 10 | 11 | @interface KirinProxyWithModule : KirinProxy 12 | 13 | - (id) initWithProtocol: (Protocol*) protocol andModuleName: (NSString*) moduleName andExecutor: (id) executor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/KirinImageTransformer.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinImageTransformer.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 08/03/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinExtensionStub.h" 10 | #import "ImageTransformProtocol.h" 11 | 12 | @interface KirinImageTransformer : KirinExtensionStub 13 | 14 | + (KirinImageTransformer*) instance; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/KirinHelperTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinHelperTest.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 21/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "DummyJSContext.h" 12 | 13 | @interface KirinHelperTest : SenTestCase { 14 | DummyJSContext* ctx; 15 | KirinHelper* helper; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /platforms/android/attic-Kirin-Lib/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | android.library=true 11 | # Project target. 12 | target=android-20 13 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #020D35 4 | #003276 5 | 6 | #DDDDDD 7 | #FFFFFF 8 | 9 | #FFFFFF 10 | #000000 11 | 12 | -------------------------------------------------------------------------------- /javascript/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/IKirinExtensionOnUiThread.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.extensions; 2 | 3 | /** 4 | * Marker interface for methods to be run on the main thread. 5 | * 6 | * It is unnecessary for the most user interface object to implement this. Fragments will need to implement this. 7 | * 8 | * @author james 9 | * 10 | */ 11 | public interface IKirinExtensionOnUiThread { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable/btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 12 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/fs/KirinFoundFile.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.fs; 2 | 3 | 4 | /** 5 | * Used by the list() method 6 | */ 7 | public interface KirinFoundFile { 8 | 9 | void setName(String name); 10 | 11 | String getName(); 12 | 13 | void setType(String type); 14 | 15 | String getType(); 16 | 17 | void setSize(long size); 18 | 19 | long getSize(); 20 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinUiFragmentHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinUiFragmentHelper.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 10/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KirinUiFragmentHelper : KirinHelper { 12 | 13 | } 14 | 15 | - (void) onResume; 16 | 17 | - (void) onResumeWithArgsList: (NSString*) argsList; 18 | 19 | - (void) onPause; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/drawable/bg_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 12 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /templates/screen-module/content/platforms/ios/__project_name__/__ModuleViewController__.h: -------------------------------------------------------------------------------- 1 | // 2 | // __ModuleViewController__.h 3 | // __project_name__ 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "__ScreenProtocol__.h" 13 | 14 | @interface __ModuleViewController__ : KirinUIViewController <__ScreenProtocol__> 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /platforms/android/Kirin-Lib-Test/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | android.library.reference.1=../Kirin-Lib 11 | # Project target. 12 | target=android-20 13 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/fs/KirinCallback.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.fs; 2 | 3 | 4 | public interface KirinCallback { 5 | 6 | /** 7 | * @param payload {@link Object} 8 | */ 9 | void callback(Object payload); 10 | 11 | /** 12 | * @param errorCode {@link int} 13 | * @param errorMessage {@link String} 14 | */ 15 | void errback(int errorCode, String errorMessage); 16 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinExtensionProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinExtensionProtocol.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 11/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @protocol KirinExtensionProtocol 13 | 14 | - (void) onLoad; 15 | 16 | - (void) onStart; 17 | 18 | - (void) onStop; 19 | 20 | - (void) onUnload; 21 | 22 | - (NSString*) moduleName; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinState.m: -------------------------------------------------------------------------------- 1 | // 2 | // KirinState.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 20/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinState.h" 10 | 11 | @implementation KirinState 12 | 13 | @synthesize currentScreen = currentScreen_; 14 | @synthesize dropbox = dropbox_; 15 | 16 | + (KirinState*) initialState { 17 | return [[[KirinState alloc] init] autorelease]; 18 | 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/src/com/futureplatforms/kirin/generated/demo/hellokirin/IDumbButtonScreen.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.demo.hellokirin; 2 | 3 | 4 | public interface IDumbButtonScreen { 5 | 6 | /** 7 | * @param size {@link int} 8 | * @param text {@link String} 9 | */ 10 | void updateLabelSizeAndText(int size, String text); 11 | 12 | /** 13 | * @param finalLabel {@link String} 14 | */ 15 | void changeScreen(String finalLabel); 16 | } -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/fs/KirinOptionalCallback.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.fs; 2 | 3 | 4 | public interface KirinOptionalCallback { 5 | 6 | /** 7 | * @param payload {@link Object} 8 | */ 9 | void callback(Object payload); 10 | 11 | /** 12 | * @param errorCode {@link int} 13 | * @param errorMessage {@link String} 14 | */ 15 | void errback(int errorCode, String errorMessage); 16 | } -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // __project_name__ 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "__class_prefix__AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([__class_prefix__AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/xhr/KirinXMLHTTPRequest.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.xhr; 2 | 3 | 4 | /** 5 | * This module is actually replaces the window.XHR with one connected to native. The native implementation should provide resiliance to interrupts. 6 | */ 7 | public interface KirinXMLHTTPRequest { 8 | 9 | /** 10 | * @param newState {@link String} 11 | */ 12 | void onConnectivityStateChange(String newState); 13 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyResponseValueObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyResponseValueObject.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 21/05/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol DummyResponseValueObject 12 | 13 | @property(retain) NSString* string; 14 | 15 | - (BOOL) boolean; 16 | - (void) setBoolean: (BOOL) value; 17 | 18 | 19 | @property int integer; 20 | 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-16 12 | android.library.reference.1=../../../../platforms/android/Kirin-Lib 13 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/JSContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSContext.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 21/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JSExecutor.h" 11 | 12 | 13 | 14 | @interface JSContext : NSObject { 15 | } 16 | 17 | @property(retain) id jsExecutor; 18 | 19 | - (id) initWithJSExecutor:(id) executor; 20 | 21 | - (void) js: (NSString*) js; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /templates/screen-module/content/platforms/android/res/layout/activity___screen_layout__.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/src/com/futureplatforms/kirin/generated/demo/hellokirin/IDumbListScreen.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.demo.hellokirin; 2 | 3 | import org.json.JSONArray; 4 | 5 | /** 6 | * This screen looks after a list 7 | */ 8 | public interface IDumbListScreen { 9 | 10 | /** 11 | * @param list {@link JSONArray} 12 | */ 13 | void populateList(JSONArray list); 14 | 15 | /** 16 | * @param toast {@link String} 17 | */ 18 | void showToast(String toast); 19 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinKitUI.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinKitUI.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 26/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #import 15 | #import 16 | 17 | #import 18 | #import 19 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/location/KirinLocation.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.location; 2 | 3 | import com.futureplatforms.kirin.generated.location.KirinLocationData; 4 | 5 | /** 6 | * This is or represents the Javascript module that will communicate with native 7 | */ 8 | public interface KirinLocation { 9 | 10 | /** 11 | * @param location {@link KirinLocationData} 12 | */ 13 | void setLastLocation(KirinLocationData location); 14 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/KirinLocationBackendImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinLocationBackendImpl.h 3 | // KirinKit 4 | // 5 | // Created by James on 07/11/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "KirinLocationBackend.h" 12 | 13 | @interface KirinLocationBackendImpl : KirinExtensionStub 14 | 15 | + (KirinLocationBackendImpl*) instance; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /javascript/lib/utils/ImageUtils.js: -------------------------------------------------------------------------------- 1 | exports.getFileTypeFromExtension = function (name) { 2 | var re = /\.(png|jpg|jpeg)$/; 3 | var match = re.test(name); 4 | 5 | var type = "png"; 6 | 7 | if (match) { 8 | 9 | switch (match[1]) { 10 | 11 | case "png": 12 | type = "png"; 13 | break; 14 | case "jpeg": 15 | case "jpg": 16 | type = "jpeg"; 17 | break; 18 | } 19 | } 20 | return type; 21 | }; 22 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/KirinLocationLegacy.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinLocation.h 3 | // Moo 4 | // 5 | // Created by James Hugman on 27/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol KirinLocationLegacy 12 | 13 | - (void) startWithCallback: (NSString*) callback andErrback: (NSString*) errback; 14 | 15 | - (void) stop; 16 | 17 | - (void) forceRefresh; 18 | 19 | - (void) updatePermissions: (NSDictionary*) config; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/preferences/KirinPreferences.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.preferences; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * mergeOrOverwrite and resetEnviroment is called at onLoad() time 7 | */ 8 | public interface KirinPreferences { 9 | 10 | /** 11 | * @param latestNativePreferences {@link JSONObject} 12 | */ 13 | void mergeOrOverwrite(JSONObject latestNativePreferences); 14 | 15 | void resetEnvironment(); 16 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinProxyWithDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinProxyWithDictionary.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 26/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinProxy.h" 10 | 11 | #import "JSExecutor.h" 12 | 13 | @interface KirinProxyWithDictionary : KirinProxy 14 | 15 | - (id) initWithProtocol: (Protocol*) protocol andDictionary: (NSDictionary*) dictionary andExecutor: (id) executor; 16 | 17 | - (void) cleanupCallbacks; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinProxyWithEmptyDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinProxyWithEmptyDictionary.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 18/05/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinProxy.h" 10 | 11 | @interface KirinProxyWithEmptyDictionary : KirinProxy 12 | 13 | - (id) initWithProtocol:(Protocol *)protocol; 14 | 15 | - (id) initWithProtocol:(Protocol *)protocol andDictionary: (NSDictionary*) dictionary; 16 | 17 | - (NSString*) JSONValue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinState.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinState.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 20/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "KirinDropbox.h" 12 | 13 | @interface KirinState : NSObject 14 | 15 | + (KirinState*) initialState; 16 | 17 | @property(retain, nonatomic) UIViewController* currentScreen; 18 | @property(retain, nonatomic) KirinDropbox* dropbox; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyNativeContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // DummyNativeContext.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "DummyNativeContext.h" 10 | 11 | 12 | @implementation DummyNativeContext 13 | 14 | - (NSArray*) methodNamesFor: (id) obj { 15 | NSMutableArray* methods = [[NSMutableArray alloc] initWithCapacity:1]; 16 | [methods addObject:@"dummyMethodWithArgs"]; 17 | return methods; 18 | 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /javascript/lib/extensions/resources/create_db_services-qt.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS localNotifications; 2 | 3 | CREATE TABLE localNotifications ( 4 | id INTEGER 5 | PRIMARY KEY AUTOINCREMENT, 6 | 7 | title TEXT DEFAULT "Alert", 8 | body TEXT NOT NULL, 9 | 10 | time INTEGER NOT NULL, 11 | -- the time interval when after which the notification will not be fired. 12 | epsilon INTEGER DEFAULT (1000 * 60 * 24 * 365), 13 | 14 | vibrate INTEGER DEFAULT 0, 15 | sound INTEGER DEFAULT 0 16 | ); -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/KirinLocationLegacyBackend.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinLocationBackend.h 3 | // Moo 4 | // 5 | // Created by James Hugman on 27/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "KirinLocationLegacy.h" 13 | 14 | @interface KirinLocationLegacyBackend : KirinExtensionStub 15 | 16 | + (KirinLocationLegacyBackend*) instance; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinExtensionHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // KirinExtensionHelper.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 10/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinExtensionHelper.h" 10 | 11 | 12 | @implementation KirinExtensionHelper 13 | 14 | - (void) onStart { 15 | [self jsMethod:@"onStart"]; 16 | } 17 | 18 | - (void) onStop { 19 | [self jsMethod:@"onStop"]; 20 | } 21 | 22 | - (UIViewController*) viewController { 23 | return self.state.currentScreen; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/NativeContextTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // NativeContextTest.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import 13 | #import "DummyJSContext.h" 14 | 15 | @interface NativeContextTest : SenTestCase { 16 | NSMutableDictionary* nativeObjects; 17 | NativeContext* nativeCtx; 18 | 19 | DummyJSContext* jsCtx; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/__class_prefix__DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // __class_prefix__DetailViewController.h 3 | // __project_name__ 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface __class_prefix__DetailViewController : UIViewController 12 | 13 | @property (strong, nonatomic) id detailItem; 14 | 15 | @property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/layout/item_master_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/NativeObjectHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // NativeObjectHolder.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 29/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NativeObjectHolder : NSObject 12 | 13 | + (NativeObjectHolder*) holderForObject: (NSObject*) object; 14 | 15 | @property(retain, nonatomic) NSObject* nativeObject; 16 | @property(nonatomic) dispatch_queue_t dispatchQueue; 17 | 18 | - (SEL) findSelectorFromString: methodName; 19 | - (NSArray*) methodNames; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/java/com/futureplatforms/kirin/TestingApplication.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin; 2 | 3 | import android.app.Application; 4 | 5 | import com.futureplatforms.kirin.application.IKirinApplication; 6 | 7 | public class TestingApplication extends Application implements IKirinApplication { 8 | 9 | private Kirin mKirin; 10 | 11 | @Override 12 | public void onCreate() { 13 | mKirin = Kirin.create(this.getApplicationContext()); 14 | super.onCreate(); 15 | } 16 | 17 | @Override 18 | public Kirin getKirin() { 19 | return mKirin; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/preferences/KirinPreferenceListener.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.preferences; 2 | 3 | 4 | /** 5 | * This is originates in Javascript, but is passed to native. Calling methods from native will call the corresponding js method 6 | */ 7 | public interface KirinPreferenceListener { 8 | 9 | /** 10 | * @param preferenceKey {@link String} 11 | * @param newValue {@link Object} 12 | */ 13 | void onPreferenceChange(String preferenceKey, Object newValue); 14 | 15 | void onListeningEnding(); 16 | } -------------------------------------------------------------------------------- /javascript/build-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'dist-relative': { 3 | 'android': './app/src/main/assets/generated-javascript' 4 | }, 5 | 6 | 'idl-dist': { 7 | 'android': './app/src/main/java', 8 | }, 9 | "ios": { 10 | "build": "xcodebuild -target KirinKit", 11 | "build.debug": "xcodebuild -sdk iphoneos -configuration Debug clean build", 12 | "build.release": "xcodebuild -sdk iphoneos -configuration Release clean build" 13 | }, 14 | "android": { 15 | "build": "ant clean debug && ant clean release", 16 | "build.debug": "ant clean debug", 17 | "build.release": "ant clean release" 18 | } 19 | }; -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyJSContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyJSContext.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 21/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | 14 | @interface DummyJSContext : JSContext { 15 | } 16 | 17 | @property(retain) NSString* lastCall; 18 | 19 | @property(retain) NSMutableArray* jsCalls; 20 | 21 | - (void) reset; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/__class_prefix__AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // __class_prefix__AppDelegate.h 3 | // __project_name__ 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface __class_prefix__AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @property (strong, nonatomic) UINavigationController *navigationController; 16 | 17 | @property (strong, nonatomic) UISplitViewController *splitViewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinUiFragmentHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // KirinUiFragmentHelper.m 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 10/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinUiFragmentHelper.h" 10 | #import 11 | 12 | @implementation KirinUiFragmentHelper 13 | 14 | - (void) onPause { 15 | [self jsMethod:@"onPause"]; 16 | } 17 | 18 | - (void) onResume { 19 | [self jsMethod:@"onResume"]; 20 | } 21 | 22 | - (void) onResumeWithArgsList: (NSString*) argsList { 23 | [self jsMethod: @"onResume" withArgsList: argsList]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/NativeContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // NativeContext.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface NativeContext : NSObject { 13 | } 14 | 15 | - (id) init; 16 | 17 | - (id) initWithDictionary: (NSMutableDictionary*) nativeObjs; 18 | 19 | - (NSArray*) methodNamesFor: (NSString*) moduleName; 20 | 21 | - (void) registerNativeObject: (id) object asName: (NSString*) name; 22 | 23 | - (void) unregisterNativeObject: (NSString*) name; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /javascript/lib/extensions/filesystem/KirinOptionalCallback.js: -------------------------------------------------------------------------------- 1 | var _ = require('underscore'), 2 | kirinBridge = require('kirin-bridge-utils'); 3 | 4 | function KirinOptionalCallback (params) { 5 | if (typeof params === 'object') { 6 | _.extend(this, params); 7 | } 8 | } 9 | 10 | var instance = KirinOptionalCallback.prototype; 11 | module.exports = KirinOptionalCallback; 12 | 13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({ 14 | "methods": { 15 | "callback": [ 16 | "payload" 17 | ], 18 | "errback": [ 19 | "errorCode", 20 | "errorMessage" 21 | ] 22 | } 23 | }, false); -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/androidTest/java/com/futureplatforms/kirin/test/testable/TestableObjectHolder.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.test.testable; 2 | 3 | import com.futureplatforms.kirin.internal.attic.ProxyGenerator; 4 | import com.futureplatforms.kirin.internal.core.AbstractObjectHolder; 5 | 6 | public class TestableObjectHolder extends AbstractObjectHolder { 7 | 8 | public TestableObjectHolder(Object nativeObject) { 9 | super(nativeObject, new ProxyGenerator(null)); 10 | } 11 | 12 | @Override 13 | protected void enqueue(Runnable methodCall) { 14 | // no queuing, just run inline. 15 | methodCall.run(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinExtensions.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 11/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface KirinExtensions : NSObject { 13 | 14 | } 15 | 16 | + (KirinExtensions*) coreExtensions; 17 | 18 | + (KirinExtensions*) empty; 19 | 20 | @property BOOL isStarted; 21 | 22 | 23 | 24 | - (void) registerExtension: (id) service; 25 | 26 | - (void) ensureStarted; 27 | 28 | - (void) unloadServices; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__/__class_prefix__MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // __class_prefix__MasterViewController.h 3 | // __project_name__ 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "__native_screen__.h" 13 | 14 | @class __class_prefix__DetailViewController; 15 | 16 | @interface __class_prefix__MasterViewController : KirinUITableViewController <__native_screen__> 17 | 18 | @property (strong, nonatomic) __class_prefix__DetailViewController *detailViewController; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/res/layout/dumb_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /javascript/lib/extensions/Timers-webview.js: -------------------------------------------------------------------------------- 1 | var _ = require("underscore"); 2 | if (_.isUndefined(window)) { 3 | throw new Error("Timer: Cannot find any window object."); 4 | } 5 | 6 | function bind (methodName) { 7 | exports[methodName] = function (arg1, arg2) { 8 | var fn = typeof arg1 === 'function' ? function () { 9 | try { 10 | arg1(); 11 | } catch (e) { 12 | console.error(e); 13 | } 14 | } : arg1; 15 | return window[methodName](fn, arg2); 16 | }; 17 | } 18 | 19 | bind("setInterval"); 20 | bind("clearInterval"); 21 | bind("setTimeout"); 22 | bind("clearTimeout"); 23 | 24 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinUITableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinUITableViewController.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface KirinUITableViewController : UITableViewController 13 | @property(retain, nonatomic) KirinScreenHelper* kirinHelper; 14 | 15 | - (void) bindScreenWithoutLoading: (NSString*) moduleName; 16 | 17 | - (void) bindScreen: (NSString*) moduleName; 18 | 19 | - (id) bindScreen:(NSString *)moduleName withProtocol: (Protocol*) protocol; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /javascript/lib/utils/bridge-utils.js: -------------------------------------------------------------------------------- 1 | var kirin = require("kirin"), 2 | _ = require("underscore"); 3 | 4 | var wrapCallbacks = kirin.wrapCallbacks; 5 | 6 | exports.makeTransportable = function (object, validator) { 7 | if (validator && _.isFunction(validator)) { 8 | validator(object); 9 | } 10 | 11 | return wrapCallbacks(object); 12 | }; 13 | 14 | exports.registerWithNative = function (object) { 15 | 16 | }; 17 | 18 | exports.checkConsistency = function (obj, validMembership, dependencies) { 19 | _.each(validMembership, function (configuration) { 20 | _.each(configuration, function (member) { 21 | 22 | }); 23 | }); 24 | }; 25 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 20 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.futureplatforms.kirin" 9 | minSdkVersion 5 10 | targetSdkVersion 5 11 | 12 | testApplicationId "com.futureplatforms.kirin.test" 13 | testInstrumentationRunner "android.test.InstrumentationTestRunner" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | runProguard false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/IKirinState.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.internal.core; 2 | 3 | import android.app.Activity; 4 | 5 | import com.futureplatforms.kirin.extensions.IKirinExtension; 6 | import com.futureplatforms.kirin.state.IKirinDropbox; 7 | import com.futureplatforms.kirin.state.IKirinFileSystem; 8 | 9 | public interface IKirinState { 10 | void setActivity(Activity activity); 11 | Activity getActivity(); 12 | 13 | IKirinDropbox getDropbox(); 14 | 15 | void setActiveExtension(IKirinExtension extension); 16 | IKirinExtension getActiveExtension(); 17 | IKirinFileSystem getPaths(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinWebViewHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinWebViewHolder.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 22/12/2011. 6 | // Copyright 2011 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | 14 | @interface KirinWebViewHolder : NSObject { 15 | 16 | @private 17 | NSMutableArray* jsQueue; 18 | 19 | BOOL webViewIsReady; 20 | } 21 | 22 | 23 | 24 | - (id) initWithWebView: (UIWebView*) aWebView andNativeContext: (id) nativeExec; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /javascript/lib/extensions/filesystem/KirinCallback.js: -------------------------------------------------------------------------------- 1 | var _ = require('underscore'), 2 | kirinBridge = require('kirin-bridge-utils'); 3 | 4 | function KirinCallback (params) { 5 | if (typeof params === 'object') { 6 | _.extend(this, params); 7 | } 8 | } 9 | 10 | var instance = KirinCallback.prototype; 11 | module.exports = KirinCallback; 12 | 13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({ 14 | "methods": { 15 | "callback": [ 16 | "payload" 17 | ], 18 | "errback": [ 19 | "errorCode", 20 | "errorMessage" 21 | ] 22 | }, 23 | "mandatory": [ 24 | "callback" 25 | ] 26 | }, false); -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/application/KirinApplication.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.application; 2 | 3 | import android.app.Application; 4 | 5 | import com.futureplatforms.kirin.Kirin; 6 | 7 | public class KirinApplication extends Application implements IKirinApplication { 8 | 9 | protected Kirin mKirin; 10 | 11 | @Override 12 | public void onCreate() { 13 | super.onCreate(); 14 | mKirin = createKirin(); 15 | } 16 | 17 | @Override 18 | public Kirin getKirin() { 19 | return mKirin; 20 | } 21 | 22 | protected Kirin createKirin() { 23 | return Kirin.create(this.getApplicationContext()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/UiObjectHolder.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.internal.core; 2 | 3 | 4 | import com.futureplatforms.kirin.internal.attic.ProxyGenerator; 5 | 6 | import android.os.Handler; 7 | 8 | public class UiObjectHolder extends AbstractObjectHolder { 9 | 10 | private final Handler mHandler; 11 | 12 | public UiObjectHolder(Handler handler, Object nativeObject, ProxyGenerator proxyGenerator) { 13 | super(nativeObject, proxyGenerator); 14 | mHandler = handler; 15 | } 16 | 17 | @Override 18 | protected void enqueue(Runnable methodCall) { 19 | mHandler.post(methodCall); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/StringDownloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // StringDownloader.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 19/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef void (^SuccessBlock)(NSData* data); 13 | typedef void (^ErrorBlock)(NSString* data); 14 | 15 | @interface StringDownloader : NSObject 16 | 17 | - (void) startDownloadWithConfig: (NSDictionary*) config; 18 | 19 | @property(readwrite, copy, nonatomic) SuccessBlock successBlock; 20 | @property(readwrite, copy, nonatomic) ErrorBlock errorBlock; 21 | 22 | @property(nonatomic) int statusCode; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /platforms/android/Kirin-Lib-Test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/FileSystem.h: -------------------------------------------------------------------------------- 1 | // 2 | // FileSystem.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 08/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol FileSystem 12 | 13 | - (void) readStringWithConfig: (NSDictionary*) config; 14 | 15 | - (void) readJsonWithConfig: (NSDictionary*) config; 16 | 17 | - (void) copyItemWithConfig: (NSDictionary*) config; 18 | 19 | - (void) deleteItemWithConfig: (NSDictionary*) config; 20 | 21 | - (void) writeStringWithConfig: (NSDictionary*) config; 22 | 23 | - (void) fileListFromConfig: (NSDictionary*) config; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyProtocol.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 31/03/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | 10 | @protocol DummyProtocol 11 | 12 | - (void) method0; 13 | 14 | - (void) methodWithInt: (int) integer; 15 | 16 | - (void) methodWithArray: (NSArray*) array; 17 | 18 | - (void) methodWithDictionary: (NSDictionary*) dict; 19 | 20 | - (void) methodWithBool: (BOOL) boolean; 21 | 22 | - (void) methodWithArgs: (int) arg0 : (BOOL) arg1; 23 | 24 | - (void) methodWithString: (NSString*) string; 25 | 26 | - (void) methodWithNumber: (NSNumber*) number; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /templates/app/content/platforms/ios/__project_name__Tests/__project_name__Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // __project_name__Tests.m 3 | // __project_name__Tests 4 | // 5 | // Created by James Hugman on 30/04/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "__project_name__Tests.h" 10 | 11 | @implementation __project_name__Tests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in __project_name__Tests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/DefaultObjectHandler.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.internal.core; 2 | 3 | import java.util.concurrent.Executor; 4 | 5 | import com.futureplatforms.kirin.internal.attic.ProxyGenerator; 6 | 7 | public class DefaultObjectHandler extends AbstractObjectHolder { 8 | 9 | private final Executor mExecutor; 10 | 11 | public DefaultObjectHandler(Executor executor, Object object, ProxyGenerator proxyGenerator) { 12 | super(object, proxyGenerator); 13 | mExecutor = executor; 14 | } 15 | 16 | @Override 17 | protected void enqueue(Runnable methodCall) { 18 | mExecutor.execute(methodCall); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /javascript/lib/extensions/window-webview.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Future Platforms 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | module.exports = window; 18 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinUIViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinUIViewControllerViewController.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 26/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | @interface KirinUIViewController : UIViewController 15 | 16 | @property(retain, nonatomic) KirinScreenHelper* kirinHelper; 17 | 18 | - (void) bindScreenWithoutLoading: (NSString*) moduleName; 19 | 20 | - (void) bindScreen: (NSString*) moduleName; 21 | 22 | - (id) bindScreen:(NSString *)moduleName withProtocol: (Protocol*) protocol; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /javascript/test/test-environment/kirin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Future Platforms 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | defineModuleAlias("kirin", "kirin-webview"); -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/location/KirinLocationBackend.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.location; 2 | 3 | import com.futureplatforms.kirin.generated.location.KirinLocationListener; 4 | 5 | /** 6 | * This is the backend of the location extension. This is implemented in native code, and talks to the js and the device. 7 | */ 8 | public interface KirinLocationBackend { 9 | 10 | /** 11 | * @param listener {@link KirinLocationListener} 12 | */ 13 | void startWithLocationListener(KirinLocationListener listener); 14 | 15 | void stopLocationListener(); 16 | 17 | void forceRefresh(); 18 | 19 | void getPermissions(); 20 | } -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/location/KirinLocationData.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.location; 2 | 3 | 4 | /** 5 | * This is a Location data object. It is produced by the device, and then passed into the Javascript. 6 | */ 7 | public interface KirinLocationData { 8 | 9 | void setLatitude(double latitude); 10 | 11 | double getLatitude(); 12 | 13 | void setLongitude(double longitude); 14 | 15 | double getLongitude(); 16 | 17 | void setTimestamp(double timestamp); 18 | 19 | double getTimestamp(); 20 | 21 | void setHorizontalAccuracy(double horizontalAccuracy); 22 | 23 | double getHorizontalAccuracy(); 24 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Extensions/KirinImagePicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinImagePicker.h 3 | // Moo 4 | // 5 | // Created by James Hugman on 24/01/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | 13 | #import "CameraProtocol.h" 14 | 15 | 16 | @interface KirinImagePicker : KirinExtensionStub 17 | 18 | - (NSString*) saveImage: (UIImage*) image toFilename: (NSString*) filename andFileType: (NSString*) fileType; 19 | - (UIImage*)imageByScalingAndCroppingForSize:(UIImage*)anImage toSize:(CGSize)targetSize; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/gradle/gradle.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /javascript/lib/extensions/filesystem/KirinFile.js: -------------------------------------------------------------------------------- 1 | var _ = require('underscore'), 2 | kirinBridge = require('kirin-bridge-utils'); 3 | 4 | function KirinFile (params) { 5 | if (typeof params === 'object') { 6 | _.extend(this, params); 7 | } 8 | } 9 | 10 | var instance = KirinFile.prototype; 11 | module.exports = KirinFile; 12 | 13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({ 14 | "properties": { 15 | "name": "string", 16 | "type": "string", 17 | "size": "long", 18 | "fileArea": "string" 19 | }, 20 | "methods": { 21 | "_append": [ 22 | "text" 23 | ] 24 | }, 25 | "mandatory": [ 26 | "name", 27 | "type", 28 | "size" 29 | ] 30 | }, false); -------------------------------------------------------------------------------- /javascript/lib/extensions/preferences/KirinPreferenceListener.js: -------------------------------------------------------------------------------- 1 | var _ = require('underscore'), 2 | kirinBridge = require('kirin/lib/core/kirin-validation'); 3 | 4 | function KirinPreferenceListener (params) { 5 | if (typeof params === 'object') { 6 | _.extend(this, params); 7 | } 8 | } 9 | 10 | var instance = KirinPreferenceListener.prototype; 11 | module.exports = KirinPreferenceListener; 12 | 13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({ 14 | "methods": { 15 | "onPreferenceChange": [ 16 | "preferenceKey", 17 | "newValue" 18 | ], 19 | "onListeningEnding": [] 20 | }, 21 | "mandatory": [ 22 | "onPreferenceChange", 23 | "onListeningEnding" 24 | ] 25 | }, false); -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKitTests/DummyNativeObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyNativeObject.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 24/04/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DummyNativeObject : NSObject 12 | 13 | @property(nonatomic) SEL lastMethod; 14 | 15 | @property(retain, nonatomic) NSString* lastArg; 16 | 17 | - (void) methodWithNoArgs; 18 | 19 | - (void) methodWithArg: (NSString*) string0; 20 | 21 | - (void) methodWithArg: (NSString*) string0 andArg: (NSString*) string1; 22 | 23 | - (void) methodWithArg: (NSString*) string0 andArg: (NSString*) string1 andArg: (NSString*) string3; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /examples/HelloKirin/platforms/android/HelloKirin-build javascript.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinArgs.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinArgs.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 11/02/2012. 6 | // Copyright (c) 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import "KirinHelper.h" 10 | 11 | @interface KirinArgs : KirinHelper 12 | 13 | 14 | + (NSString*) string: (NSString*) string; 15 | 16 | + (NSString*) untaintedForDisplay: (NSString*) string; 17 | 18 | + (NSString*) taintedForJs: (NSString*) string; 19 | 20 | + (NSString*) object: (NSDictionary*) object; 21 | 22 | + (NSString*) array: (NSArray*) array; 23 | 24 | + (NSString*) integer: (int) number; 25 | 26 | + (NSString*) boolean: (BOOL) boolean; 27 | 28 | + (NSString*) args: (NSString*) arg, ... 29 | NS_REQUIRES_NIL_TERMINATION; 30 | 31 | + (BOOL) isNull: (id) arg; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/xhr/KirinXHRExtension.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.generated.xhr; 2 | 3 | import com.futureplatforms.kirin.generated.xhr.KirinXHRequest; 4 | 5 | /** 6 | * This module reimplements the bare minimum that native needs to drive an implementation of XMLHTTPRequests, adding resiliance to interrupt events such as loss of network connectivity, application backgrounding and perhaps even reboot. 7 | */ 8 | public interface KirinXHRExtension { 9 | 10 | /** 11 | * @param xhrObject {@link KirinXHRequest} 12 | * @param data {@link Object} 13 | */ 14 | void open(KirinXHRequest xhrObject, Object data); 15 | 16 | /** 17 | * @param xhrId {@link String} 18 | */ 19 | void abort(String xhrId); 20 | } -------------------------------------------------------------------------------- /platforms/ios/KirinKit/KirinKit/Core/KirinPaths.h: -------------------------------------------------------------------------------- 1 | // 2 | // KirinPaths.h 3 | // KirinKit 4 | // 5 | // Created by James Hugman on 11/01/2012. 6 | // Copyright 2012 Future Platforms. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface KirinPaths : NSObject { 13 | 14 | } 15 | 16 | 17 | + (NSString*) indexFilename; 18 | 19 | + (NSString*) javascriptDirectory; 20 | 21 | + (NSString*) pathForResource:(NSString*)resourcepath; 22 | 23 | + (NSString*) filePathInDocuments: (NSString*) path; 24 | 25 | + (NSString*) filePathInTempDir: (NSString*) path; 26 | 27 | + (NSString*) filePathInAppAssets: (NSString*) path; 28 | 29 | + (NSString*) fileInJavascriptDir: (NSString*) path; 30 | 31 | + (NSString*) join: (NSString*) prefix andFilePath: (NSString*) suffix; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/helpers/KirinApplicationHelper.java: -------------------------------------------------------------------------------- 1 | package com.futureplatforms.kirin.helpers; 2 | 3 | import android.app.Activity; 4 | 5 | import com.futureplatforms.kirin.internal.core.IJsContext; 6 | import com.futureplatforms.kirin.internal.core.IKirinState; 7 | import com.futureplatforms.kirin.internal.core.INativeContext; 8 | 9 | public class KirinApplicationHelper extends KirinUiFragmentHelper { 10 | 11 | public KirinApplicationHelper(Object nativeObject, String moduleName, 12 | IJsContext jsContext, INativeContext nativeContext, 13 | IKirinState appState) { 14 | super(nativeObject, moduleName, jsContext, nativeContext, appState); 15 | } 16 | 17 | public Activity getActivity() { 18 | return getAppState().getActivity(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /templates/app/content/platforms/android/res/layout/activity_master_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 |