├── 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 |
4 |
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 |
23 |
24 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKitTests/KirinKitTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.futureplatforms.kirin.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKitTests/DummyValueObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // DummyValueObject.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 "DummyResponseValueObject.h"
10 |
11 | @protocol DummyValueObject
12 |
13 | - (int) number;
14 |
15 | - (NSString*) string;
16 |
17 | - (NSDictionary*) dictionary;
18 |
19 | - (NSNumber*) numberObject;
20 |
21 | - (BOOL) boolean;
22 |
23 | - (int) intNotThere;
24 |
25 | - (NSString*) stringNotThere;
26 |
27 | - (float) aFloat;
28 |
29 | - (long) aLong;
30 |
31 | - (double) aDouble;
32 |
33 | - (short) aShort;
34 |
35 | - (void) callback;
36 |
37 | - (void) errback: (NSString*) err withStatus: (int) status;
38 |
39 | - (void) respond: (id) response;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKitTests/KirinTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // KirinTests.m
3 | // KirinTests
4 | //
5 | // Created by James Hugman on 21/12/2011.
6 | // Copyright 2011 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import "KirinTests.h"
10 | #import "Kirin.h"
11 |
12 | @implementation KirinTests
13 |
14 | - (void)setUp
15 | {
16 | [super setUp];
17 |
18 | // Set-up code here.
19 | }
20 |
21 | - (void)tearDown
22 | {
23 | // Tear-down code here.
24 |
25 | [super tearDown];
26 | }
27 |
28 | - (void)testSingleton {
29 | //Kirin* kirin = KIRIN;
30 |
31 | //STAssertNotNil(kirin, @"kirin is nil");
32 | //STAssertEqualObjects(KIRIN, kirin, @"Singleton objects aren't the same");
33 |
34 | }
35 |
36 | - (void) testBindSimple {
37 | //[KIRIN bindObject:self toModule:@"TestModule"];
38 |
39 | }
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/androidTest/java/com/futureplatforms/kirin/test/dummies/DummyJsContext.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.test.dummies;
2 |
3 | import java.util.ArrayList;
4 | import java.util.HashMap;
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 | import com.futureplatforms.kirin.internal.core.IJsContext;
9 |
10 | public class DummyJsContext implements IJsContext{
11 |
12 | public Map> mMethodNames = new HashMap>();
13 |
14 | public List mJsCalls = new ArrayList();
15 |
16 | public String mLastCall;
17 |
18 | @Override
19 | public void js(String string) {
20 | mLastCall = string;
21 | mJsCalls.add(string);
22 | }
23 |
24 | public void reset() {
25 | mLastCall = null;
26 | mJsCalls.clear();
27 | mMethodNames.clear();
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/helpers/KirinUiFragmentHelper.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.helpers;
2 |
3 | import com.futureplatforms.kirin.internal.core.IJsContext;
4 | import com.futureplatforms.kirin.internal.core.IKirinState;
5 | import com.futureplatforms.kirin.internal.core.INativeContext;
6 |
7 | public class KirinUiFragmentHelper extends KirinHelper {
8 |
9 | public KirinUiFragmentHelper(Object nativeObject, String moduleName,
10 | IJsContext jsContext, INativeContext nativeContext,
11 | IKirinState appState) {
12 | super(nativeObject, moduleName, jsContext, nativeContext, appState);
13 | }
14 |
15 | public void onPause() {
16 | super.jsMethod("onPause");
17 | }
18 |
19 | public void onResume(Object... args) {
20 | super.jsMethod("onResume", (Object[]) args);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/INativeContext.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.internal.core;
2 |
3 | import java.util.Collection;
4 |
5 | import com.futureplatforms.kirin.internal.attic.ProxyGenerator;
6 | import com.futureplatforms.kirin.internal.core.NativeContext.SettableFuture;
7 |
8 | public interface INativeContext {
9 | Collection getMethodNamesForObject(String objectName);
10 |
11 | void registerNativeObject(String moduleName, Object object, ProxyGenerator proxyGenerator);
12 |
13 | void unregisterNativeObject(String moduleName);
14 |
15 | void executeCommandFromModule(String moduleName, String methodName, Object... args);
16 |
17 | SettableFuture getFuture(Long id);
18 |
19 | void setReturnValue(Long id, T value);
20 |
21 | Long createNewId();
22 | }
23 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinScreenHelper.m:
--------------------------------------------------------------------------------
1 | //
2 | // KirinScreenHelper.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 "KirinScreenHelper.h"
10 | #import
11 |
12 | @implementation KirinScreenHelper
13 |
14 | - (void) onPause {
15 | if (self.state.currentScreen == self.nativeObject) {
16 | self.state.currentScreen = nil;
17 | }
18 | [super onPause];
19 | }
20 |
21 | - (void) onResume {
22 | self.state.currentScreen = (UIViewController*) self.nativeObject;
23 | [super onResume];
24 | }
25 |
26 | - (void) onResumeWithArgsList: (NSString*) argsList {
27 | self.state.currentScreen = (UIViewController*) self.nativeObject;
28 | [super onResumeWithArgsList:argsList];
29 | }
30 |
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/SettingsBackend.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import "Settings.h"
21 |
22 | @interface SettingsBackend : KirinExtensionStub {
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/templates/app/content/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 edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-20
15 | # for instances of the template, see project.properties.template
16 | # But this file works when developing the template itself.
17 | android.library.reference.1=../../../../../platforms/android/Kirin-Lib
18 |
--------------------------------------------------------------------------------
/templates/app/content/platforms/ios/__project_name__Tests/__project_name__Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | --companyIdentifier--.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/NetworkingBackend.h:
--------------------------------------------------------------------------------
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 | #import
18 | #import "Networking.h"
19 |
20 | @interface NetworkingBackend : KirinExtensionStub {
21 |
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKitTests/KirinArgsTest.m:
--------------------------------------------------------------------------------
1 | //
2 | // KirinArgsTest.m
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 "KirinArgsTest.h"
10 |
11 | #import
12 |
13 | @implementation KirinArgsTest
14 |
15 |
16 |
17 | - (void) testArgs {
18 | STAssertEqualObjects(@"", [KirinArgs args: nil], @"No args");
19 |
20 |
21 | NSString* args1 = [KirinArgs args: @"1", nil];
22 | STAssertEqualObjects(@"1", args1, @"One arg");
23 |
24 | NSString* args2 = [KirinArgs args: @"1", @"2", nil];
25 | STAssertEqualObjects(@"1, 2", args2, @"Two args");
26 |
27 |
28 | NSString* args3 = [KirinArgs args: @"1", @"2", @"3", nil];
29 | STAssertEqualObjects(@"1, 2, 3", args3, @"Three args");
30 |
31 | }
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/Settings.h:
--------------------------------------------------------------------------------
1 | //
2 | // Settings.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 Settings
13 |
14 | /*
15 | * Updates settings, by running a javascript method against
16 | * the settings (as a javascript object with properties keyed by setting name).
17 | */
18 | - (void) requestPopulateJSWithCallback:(NSString *)updateCallback;
19 |
20 | /*
21 | * Deletes settings, also removing those that are no longer needed.
22 | *
23 | * Arguments:
24 | * (NSDictionary *)keyValuePairs
25 | * (NSArray *)deletedKeys
26 | */
27 | - (void) updateContents:(NSDictionary *)adds withDeletes:(NSArray *)deletes;
28 | - (void) requestPopulateJSWithCallback:(NSString *)updateCallback;
29 | @end
30 |
--------------------------------------------------------------------------------
/platforms/android/Kirin-Lib-Test/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinExtensionStub.h:
--------------------------------------------------------------------------------
1 | //
2 | // KirinExtensionStub.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 |
13 | @interface KirinExtensionStub : NSObject {
14 |
15 | }
16 |
17 | @property(retain, nonatomic) NSString* moduleName;
18 | @property(retain, nonatomic) KirinExtensionHelper* kirinHelper;
19 |
20 |
21 | - (id) initWithModuleName: (NSString*) moduleName;
22 |
23 | - (void) bindExtension;
24 |
25 | - (id) bindExtensionWithProtocol: (Protocol*) protocol;
26 |
27 | - (id) bindRequestDictionary: (NSDictionary*) request withProtocol: (Protocol*) protocol;
28 |
29 | - (id) bindEmptyDictionaryWithProtocol: (Protocol*) protocol;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/DebugConsole.m:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import "DebugConsole.h"
20 |
21 | @implementation DebugConsole
22 |
23 |
24 |
25 | - (void)log:(id)message atLevel:(NSString*) log_level {
26 | NSLog(@"[%@] %@", log_level, message);
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/project.properties.template:
--------------------------------------------------------------------------------
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 edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-15
15 | # this works for instances of the template
16 | android.library.reference.1=../../xXKIRIN_HOME_RELATIVEXx/platforms/android/Kirin-Lib
17 | # this works when developing the template itself.
18 | #android.library.reference.1=../../../../../platforms/android/Kirin-Lib
19 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/DebugConsole.h:
--------------------------------------------------------------------------------
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 |
18 | #import
19 | #import "KirinExtensionOnMainThread.h"
20 |
21 | @interface DebugConsole : NSObject {
22 | }
23 | - (void)log:(id)message atLevel:(NSString*) log_level;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-for-android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/templates/app/content/shared/idl/__javascript_screen_module__.idl.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | namespace: "xXcontextPackageXx.xXshortNameXx",
3 | classes: {
4 | "__native_screen_module__": {
5 | namespace: ".shared",
6 | implementedBy: "javascript",
7 | methods: {
8 | addNewItem: [],
9 | itemSelected: [{index:"integer"}]
10 | }
11 | },
12 | "__native_screen__": {
13 | namespace: ".android",
14 | implementedBy: "native",
15 | methods: {
16 | setTableContents: [{rows:"array"}], // of strings
17 | "insertRow:WithContents:": [{index:"integer"}, {row:"string"}],
18 | "displayDetailScreenForRow:AndContents:": [{index:"integer"}, {contents:"string"}]
19 | }
20 | }
21 | }
22 | };
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinKit.h:
--------------------------------------------------------------------------------
1 | //
2 | // KirinKit.h
3 | // KirinKit
4 | //
5 | // Created by James Hugman on 03/01/2012.
6 | // Copyright 2012 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 |
16 | #import
17 |
18 | #import
19 | #import
20 | #import
21 | #import
22 | #import
23 |
24 | // TODO review if this is the best place to put this.
25 | // Better would be to go in KirinKitUI.h, but it's easier to remember here.
26 | #import
27 | #import
--------------------------------------------------------------------------------
/templates/screen-module/content/shared/idl/__module_name__.idl.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | namespace: "xXcontextPackageXx.xXshortNameXx",
3 | classes: {
4 | "__ModuleProtocol__": {
5 | implementedBy: "javascript",
6 | namespace: ".shared",
7 | methods: {
8 | "setItem:Name:": [{id:"integer"}, {name:"string"}],
9 | "onItemTapped:": [{id:"integer"}]
10 | }
11 | },
12 |
13 | "__ScreenProtocol__": {
14 | implementedBy: "native",
15 | namespace: ".android",
16 | methods: {
17 | "setDataForScreen": [{data:"__RequestProtocol__"}]
18 | }
19 | },
20 |
21 | "__RequestProtocol__": {
22 | namespace: ".shared.requests",
23 | role: "request",
24 | properties: {
25 | name: "string"
26 | }
27 | }
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/ios/HelloKirin-iOS/main.m:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 |
21 | int main(int argc, char *argv[])
22 | {
23 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
24 | int retVal = UIApplicationMain(argc, argv, nil, nil);
25 | [pool release];
26 | return retVal;
27 | }
28 |
--------------------------------------------------------------------------------
/platforms/android/attic-Kirin-Lib/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Kirin-Lib
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | HelloKirin-android
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/SQLiteDatabase.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import "Database.h"
21 |
22 | @interface SQLiteDatabase : NSObject {
23 |
24 | // Open database connections, indexed by database name.
25 | NSMutableDictionary *connectionsByName;
26 |
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | __project_name__
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/res/layout/dumb_list_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
16 |
17 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/ios/HelloKirin-iOS/DumbListViewController.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import
21 |
22 | #import "IDumbListScreen.h"
23 |
24 | @interface DumbListViewController : KirinUITableViewController {
25 |
26 | }
27 |
28 | - (void) populateList: (NSArray*) list;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/templates/app/content/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{project_name}}",
3 | "description": "{{project_description}}",
4 | "version": "0.0.1",
5 | "private": true,
6 | "kirin": {
7 | "shared": "shared/lib",
8 | "idl": "shared/idl",
9 | "platforms": {
10 | "ios": {
11 | "project": "platforms/ios/{{project_name}}.xcodeproj",
12 | "build": "xcodebuild clean build",
13 | "build.debug": "xcodebuild -configuration Debug clean build",
14 | "build.release": "xcodebuild -configuration Release clean build"
15 | },
16 | "android": {
17 | "project": "platforms/android",
18 | "build": "ant clean debug && ant clean release",
19 | "build.debug": "ant clean debug",
20 | "build.release": "ant clean release",
21 | "idlOutput": "src"
22 | }
23 | },
24 | "extensions": {
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/IProguardImmunity.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions;
19 |
20 | /**
21 | * Marker interface to help Proguard not munge our methods.
22 | * @author james
23 | * used to be called: IJs2Java
24 | */
25 | public interface IProguardImmunity {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/Networking.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 |
21 | @protocol Networking
22 |
23 | - (void) downloadJSON: (NSDictionary *) config;
24 | - (void) downloadJSONList: (NSDictionary *) config;
25 | - (void) downloadFile: (NSDictionary *) config;
26 | - (void) downloadString: (NSDictionary*) config;
27 |
28 | @end
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/KirinKit-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.futureplatforms.kirin.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | NSPrincipalClass
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/Build __project_name__ Javascript.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/state/IKirinDropbox.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.state;
19 |
20 | public interface IKirinDropbox {
21 | String put(String tokenPrefix, Object obj);
22 | Object get(String token);
23 | void remove(String token);
24 |
25 | Object consume(String token);
26 | }
27 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
13 |
17 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/ios/HelloKirin-iOS/HelloKirin_iOSAppDelegate.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 |
21 | @interface HelloKirin_iOSAppDelegate : NSObject {
22 |
23 | }
24 |
25 | @property (nonatomic, retain) IBOutlet UIWindow *window;
26 |
27 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/javascript/test/dummies/Networking-backend.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("Networking-backend", "Networking-backend-qt");
18 |
19 | var kirin = require("kirin"),
20 | backend = kirin.proxy("Networking-backend");
21 |
22 | backend.replaceableCreateXMLHttpRequest = function () {
23 | new require("XMLHttpRequest").XMLHttpRequest();
24 | }
25 |
26 | backend.replaceableSetTimeout = setTimeout;
27 |
--------------------------------------------------------------------------------
/platforms/android/Kirin-Lib-Test/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Kirin-Lib-Test
4 |
5 |
6 | JSCore-Android-Lib
7 |
8 |
9 |
10 | com.android.ide.eclipse.adt.ResourceManagerBuilder
11 |
12 |
13 |
14 |
15 | com.android.ide.eclipse.adt.PreCompilerBuilder
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javabuilder
21 |
22 |
23 |
24 |
25 | com.android.ide.eclipse.adt.ApkBuilder
26 |
27 |
28 |
29 |
30 |
31 | com.android.ide.eclipse.adt.AndroidNature
32 | org.eclipse.jdt.core.javanature
33 |
34 |
35 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/ui/KirinRowRenderer.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.ui;
19 |
20 | import android.view.View;
21 |
22 | public interface KirinRowRenderer {
23 | void configureView(View view);
24 |
25 | void renderItem(View view, T item);
26 |
27 | void onItemClicked(View view, int index, T item);
28 | }
29 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/Connection.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 |
21 | @protocol Connection
22 |
23 | - (NSNumber *)currentSchemaVersion;
24 | - (NSString *)name;
25 | - (NSString *)filename;
26 | - (void)close;
27 |
28 | - (NSArray*) execute:(NSString *)sql withParameters:(NSArray *)parameters;
29 | - (void) executeBlock:(NSString *)sql;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/javascript/test/test-environment/dates.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 | defineModule("dates", function (require, exports) {
18 | var currentTime = new Date(1299500023000) ; // Mon, 07 Mar 2011 12:13:43 GMT
19 |
20 | exports.setCurrentTime = function(timeInMillisSinceEpoch) {
21 | currentTime = new Date(timeInMillisSinceEpoch);
22 | }
23 |
24 | exports.getCurrentTime = function() {
25 | return currentTime;
26 | }
27 | });
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/Database.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import "Connection.h"
21 |
22 | @protocol Database
23 |
24 | /*
25 | * Creates a connection to a new database. If there is an open connection to this
26 | * database already, this raises an exception.
27 | */
28 | - (NSObject *)open:(NSString *)name backedByFile:(NSString *)filename;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/templates/screen-module/content/shared/lib/__module_name__.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This Javascript will be called by native.
3 | *
4 | * Kirin will load the module, and construct an instance and
5 | * pass an instance of __screen_interface__ in onLoad()
6 | */
7 |
8 |
9 | function __ModuleName__ () {
10 | this.screen = null;
11 | }
12 |
13 | __ModuleName__.prototype.onLoad = function (ui) {
14 | // ui is an instance of __screen_interface__.java,
15 | // or __ScreenProtocol__.h
16 | this.screen = ui;
17 | };
18 |
19 | __ModuleName__.prototype.onUnload = function () {
20 | this.screen = null;
21 | };
22 |
23 | __ModuleName__.prototype.onResume = function () {
24 | // the screen is about to appear.
25 | this.screen.setDataForScreen({name: "__ModuleName__"});
26 | };
27 |
28 | __ModuleName__.prototype.onPause = function () {
29 | // the screen is about to go away.
30 | };
31 |
32 | __ModuleName__.prototype.setItemName = function (id, name) {
33 |
34 | };
35 |
36 | __ModuleName__.prototype.onItemTapped = function (id) {
37 |
38 | };
39 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/fragmentation/CursorCoercer.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.internal.fragmentation;
19 |
20 | import org.json.JSONObject;
21 |
22 | import android.database.AbstractWindowedCursor;
23 |
24 | public interface CursorCoercer {
25 |
26 | public abstract JSONObject coerceToJSONObject(String[] cols, AbstractWindowedCursor c);
27 |
28 | }
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/KirinPaths.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.internal;
2 |
3 | import java.text.MessageFormat;
4 |
5 | import android.content.Context;
6 | import android.os.Environment;
7 |
8 | import com.futureplatforms.kirin.state.IKirinFileSystem;
9 |
10 | public class KirinPaths implements IKirinFileSystem {
11 |
12 | private final Context mContext;
13 |
14 | private final String mFileAreaPath;
15 |
16 | public KirinPaths(Context context) {
17 | mContext = context;
18 |
19 | String packageName = mContext.getPackageName();
20 | String sdCardPrefix = Environment.getExternalStorageDirectory().getPath();
21 | mFileAreaPath = MessageFormat.format("{0}/Android/data/{1}/files/", sdCardPrefix, packageName);
22 | }
23 |
24 | public String getExternalFilePath(String filename) {
25 | return mFileAreaPath + filename;
26 | }
27 |
28 | public String getExternalFileUrl(String filename) {
29 | return "file://" + mFileAreaPath + filename;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/location/KirinLocationListener.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.generated.location;
2 |
3 | import com.futureplatforms.kirin.generated.location.KirinLocationData;
4 | import com.futureplatforms.kirin.generated.location.KirinLocationPermissions;
5 |
6 | /**
7 | * This is originates in Javascript, but is passed to native. Calling methods from native will call the corresponding js method
8 | */
9 | public interface KirinLocationListener {
10 |
11 | float getMinimumDistanceDelta();
12 |
13 | float getMinimumTimeDelta();
14 |
15 | /**
16 | * @param location {@link KirinLocationData}
17 | */
18 | void locationUpdate(KirinLocationData location);
19 |
20 | /**
21 | * @param errorMessage {@link String}
22 | */
23 | void locationError(String errorMessage);
24 |
25 | void locationUpdateEnding();
26 |
27 | /**
28 | * @param permissions {@link KirinLocationPermissions}
29 | */
30 | void updatePermissions(KirinLocationPermissions permissions);
31 | }
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinFileSystem.h:
--------------------------------------------------------------------------------
1 | //
2 | // KirinFileSystem.h
3 | // KirinKit
4 | //
5 | // Created by James Hugman on 27/01/2012.
6 | // Copyright (c) 2012 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KirinFileSystem : NSObject
12 |
13 | + (KirinFileSystem*) fileSystem;
14 |
15 | - (NSString*) filePath: (NSString*) filePath inArea: (NSString*) fileArea;
16 |
17 | - (BOOL) writeData: (NSData*) data toFile: (NSString*) filePath;
18 |
19 | - (BOOL) mkdirForFile: (NSString*) filePath;
20 |
21 | - (BOOL) rmForce: (NSString*) fileOrDir;
22 |
23 | - (BOOL) mkdir: (NSString*) newDir;
24 |
25 | - (NSString*) readStringFromFilepath: (NSString*) filePath;
26 |
27 | - (BOOL) copyFrom: (NSString*) srcFilePath to:(NSString*) destFilePath;
28 |
29 | - (NSString*) filePathFromConfig: (NSDictionary*) config withPrefix:(NSString*) prefix;
30 |
31 | - (NSString*) filePathFromConfig: (NSDictionary*) config;
32 |
33 | - (NSArray*) list: (NSString*) filePath;
34 |
35 | - (BOOL) fileExists: (NSString*) filePath;
36 |
37 |
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/templates/app/content/shared/lib/xXjavascript_screen_moduleXx.js:
--------------------------------------------------------------------------------
1 |
2 | var sentence = "All work and no play makes __USER__ a dull boy",
3 | items = sentence.split(/\s+/);
4 |
5 |
6 | function MyModule () {
7 | this.screen = null;
8 | this.index = 0;
9 | }
10 |
11 | MyModule.prototype.onLoad = function (ui) {
12 | this.screen = ui;
13 | };
14 |
15 | MyModule.prototype.onUnload = function () {
16 | this.screen = null;
17 | };
18 |
19 | MyModule.prototype.onResume = function () {
20 | // the screen is about to appear.
21 | this.screen.setTableContents(["click on add"]);
22 | this.index = 0;
23 | };
24 |
25 | MyModule.prototype.onPause = function () {
26 | // the screen is about to go away.
27 | };
28 |
29 | MyModule.prototype.addNewItem = function () {
30 | this.screen.insertRowWithContents(this.index, items[this.index]);
31 | this.index = (this.index + 1) % items.length;
32 | };
33 |
34 | MyModule.prototype.itemSelected = function (row) {
35 | this.screen.displayDetailScreenForRowAndContents(row, items[row % items.length]);
36 | };
37 |
38 | module.exports = MyModule;
39 |
40 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/IKirinExtension.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions;
19 |
20 | import android.content.Intent;
21 |
22 | public interface IKirinExtension extends IProguardImmunity {
23 | void onLoad();
24 |
25 | void onStart();
26 |
27 | void onStop();
28 |
29 | void onUnload();
30 |
31 | void onActivityResult(int requestCode, int resultCode, Intent data);
32 | }
33 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/generated/preferences/KirinPreferencesBackend.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.generated.preferences;
2 |
3 | import org.json.JSONObject;
4 | import org.json.JSONArray;
5 | import com.futureplatforms.kirin.generated.preferences.KirinPreferenceListener;
6 |
7 | /**
8 | * Called in response to a settings.commit()
9 | */
10 | public interface KirinPreferencesBackend {
11 |
12 | /**
13 | * @param changes {@link JSONObject}
14 | * @param deletes {@link JSONArray}
15 | */
16 | void updateStoreWithChangesAndDeletes(JSONObject changes, JSONArray deletes);
17 |
18 | /**
19 | * @param listener {@link KirinPreferenceListener}
20 | */
21 | void addPreferenceListener(KirinPreferenceListener listener);
22 |
23 | void removePreferenceListener();
24 |
25 | /**
26 | * @param preferenceName {@link String}
27 | */
28 | void addInterestFor(String preferenceName);
29 |
30 | /**
31 | * @param preferenceName {@link String}
32 | */
33 | void removeInterestFor(String preferenceName);
34 | }
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/settings/ISettingsBackend.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions.settings;
19 |
20 | import org.json.JSONArray;
21 | import org.json.JSONObject;
22 |
23 | public interface ISettingsBackend {
24 |
25 | public abstract void updateContents_withDeletes_(JSONObject contents, JSONArray deletes);
26 |
27 | public abstract void requestPopulateJSWithCallback_(String callbackToken);
28 |
29 | }
--------------------------------------------------------------------------------
/examples/HelloKirin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hello-kirin",
3 | "description": "A demonstration of the kirin project",
4 | "version": "0.0.1",
5 | "private": true,
6 | "author": "@jhugman",
7 | "bugs": {
8 | "url": "https://github.com/kirinjs/kirin/issues"
9 | },
10 | "licenses": [
11 | {
12 | "type": "Apache",
13 | "url": "https://github.com/KirinJS/Kirin/blob/master/LICENSE"
14 | }
15 | ],
16 | "kirin": {
17 | "shared": "lib",
18 | "platforms": {
19 | "ios": {
20 | "project": "platforms/ios/HelloKirin-iOS.xcodeproj",
21 | "build": "xcodebuild clean build",
22 | "build.debug": "xcodebuild -configuration Debug clean build",
23 | "build.release": "xcodebuild -configuration Release clean build"
24 | },
25 | "android": {
26 | "project": "platforms/android",
27 | "build": "ant clean debug && ant clean release",
28 | "build.debug": "ant clean debug",
29 | "build.release": "ant clean release",
30 | "idlOutput": "src"
31 | }
32 | },
33 | "extensions": {
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/helpers/IKirinExtensionHelper.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.helpers;
2 |
3 | import android.app.Activity;
4 |
5 | public interface IKirinExtensionHelper extends IKirinHelper {
6 |
7 |
8 | /**
9 | * Lifecycle method. Should never be called by application code.
10 | *
11 | * This will be called after all extensions have had their onLoad methods called.
12 | */
13 | void onStart();
14 |
15 | /**
16 | * Lifecycle method. Should never be called by application code.
17 | *
18 | * This will be called on all extensions before any onLoad methods
19 | * are called.
20 | */
21 | void onStop();
22 |
23 | /**
24 | * The current screen activity, if any. This is useful to have if you
25 | * need to do anything like launch another activity.
26 | * @return
27 | */
28 | Activity getActivity();
29 |
30 | /**
31 | * Call this if you are about to launch an activity.
32 | *
33 | * It is not clear if you'll need your extension to implement
34 | * `IKirinExtensionOnUiThread`. It will be set inactive automatically.
35 | */
36 | void setActive();
37 |
38 | }
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/ios/HelloKirin-iOS/RootViewController.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import
21 |
22 | #import "IDumbButtonScreen.h"
23 |
24 | @interface RootViewController : KirinUIViewController {
25 |
26 | }
27 |
28 |
29 |
30 | @property(retain) IBOutlet UILabel* label;
31 | @property(retain) UIViewController* dumbListViewController;
32 |
33 |
34 | -(IBAction) buttonOnClick: (id)sender;
35 |
36 | -(IBAction) showListOnClick: (id)sender;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/localnotifications/ILocalNotificationsBackend.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions.localnotifications;
19 |
20 | import org.json.JSONArray;
21 |
22 | import com.futureplatforms.kirin.extensions.IKirinExtension;
23 |
24 | public interface ILocalNotificationsBackend extends IKirinExtension {
25 | void scheduleNotifications_(JSONArray notifications);
26 | void cancelNotifications_(JSONArray notificationIds);
27 | }
28 |
--------------------------------------------------------------------------------
/javascript/lib/extensions/location/DemoLocationListener.js:
--------------------------------------------------------------------------------
1 | var _ = require('underscore'),
2 | kirinBridge = require('kirin-bridge-utils');
3 |
4 | function DemoLocationListener (params) {
5 | if (typeof params === 'object') {
6 | _.extend(this, params);
7 | }
8 | }
9 |
10 | var instance = DemoLocationListener.prototype;
11 | module.exports = DemoLocationListener;
12 |
13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({
14 | "properties": {
15 | "minimumDistanceDelta": "float",
16 | "minimumTimeDelta": "float"
17 | },
18 | "methods": {
19 | "locationUpdate": [
20 | "location"
21 | ],
22 | "locationError": [
23 | "errorMessage"
24 | ],
25 | "locationUpdateEnding": [],
26 | "updatePermissions": [
27 | "permissions"
28 | ]
29 | },
30 | "mandatory": [
31 | "locationUpdate",
32 | "locationError",
33 | "locationUpdateEnding"
34 | ],
35 | "allowable": [
36 | [
37 | "minimumTimeDelta"
38 | ],
39 | [
40 | "minimumDistanceDelta"
41 | ]
42 | ]
43 | }, false);
--------------------------------------------------------------------------------
/javascript/lib/extensions/location/KirinLocationListener.js:
--------------------------------------------------------------------------------
1 | var _ = require('underscore'),
2 | kirinBridge = require('kirin-bridge-utils');
3 |
4 | function KirinLocationListener (params) {
5 | if (typeof params === 'object') {
6 | _.extend(this, params);
7 | }
8 | }
9 |
10 | var instance = KirinLocationListener.prototype;
11 | module.exports = KirinLocationListener;
12 |
13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({
14 | "properties": {
15 | "minimumDistanceDelta": "float",
16 | "minimumTimeDelta": "float"
17 | },
18 | "methods": {
19 | "locationUpdate": [
20 | "location"
21 | ],
22 | "locationError": [
23 | "errorMessage"
24 | ],
25 | "locationUpdateEnding": [],
26 | "updatePermissions": [
27 | "permissions"
28 | ]
29 | },
30 | "mandatory": [
31 | "locationUpdate",
32 | "locationError",
33 | "locationUpdateEnding"
34 | ],
35 | "allowable": [
36 | [
37 | "minimumTimeDelta"
38 | ],
39 | [
40 | "minimumDistanceDelta"
41 | ]
42 | ]
43 | }, false);
--------------------------------------------------------------------------------
/javascript/extensions.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | aliases: {
3 | 'kirin-bridge-utils': './lib/core/kirin-validation',
4 | 'app-analytics-beta': './lib/extensions/Analytics',
5 | 'app-databases-alpha': './lib/extensions/Databases',
6 | 'app-preferences': './lib/extensions/Settings',
7 | 'app-preferences-alpha': './lib/extensions/preferences/KirinPreferences',
8 | 'device-camera-alpha': './lib/extensions/Camera',
9 | 'device-location-alpha': './lib/extensions/location/KirinLocationModule',
10 | 'device-networking-alpha': './lib/extensions/Networking',
11 | 'device-filesystem-alpha': './lib/extensions/FileSystem',
12 | 'kirin-image-utils-alpha': './lib/extensions/ImageTransform',
13 | 'kirin-functional-utils-alpha': './lib/utils/FunctionalUtils',
14 | 'kirin-string-utils-alpha': './lib/utils/StringUtils',
15 | 'Filesystem': './lib/extensions/FileSystem',
16 | 'Databases': './lib/extensions/Databases',
17 | 'Networking': './lib/extensions/Networking',
18 | 'bridge-utils': './lib/utils/bridge-utils',
19 | //'simple-timers': './lib/extensions/Timers',
20 | 'kirin-json-utils': './lib/utils/JSONUtils'
21 | },
22 | verbose: false
23 |
24 | };
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/androidTest/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/templates/app/content/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "predef": [
3 | "console"
4 | ],
5 | "node": true,
6 | "bitwise": true,
7 | "curly": true,
8 | "eqeqeq": true,
9 | "forin": true,
10 | "immed": true,
11 | "latedef": true,
12 | "newcap": true,
13 | "noarg": true,
14 | "nonew": true,
15 | "plusplus": false,
16 | "regexp": true,
17 | "undef": true,
18 | "strict": false,
19 | "trailing": false,
20 | "asi": false,
21 | "boss": false,
22 | "debug": true,
23 | "eqnull": true,
24 | "es5": false,
25 | "esnext": false,
26 | "evil": false,
27 | "expr": false,
28 | "funcscope": false,
29 | "globalstrict": true,
30 | "iterator": false,
31 | "lastsemic": true,
32 | "laxbreak": false,
33 | "laxcomma": false,
34 | "loopfunc": false,
35 | "multistr": false,
36 | "onecase": true,
37 | "proto": false,
38 | "regexdash": false,
39 | "scripturl": false,
40 | "smarttabs": true,
41 | "shadow": false,
42 | "sub": false,
43 | "supernew": false,
44 | "validthis": false,
45 | "nomen": false,
46 | "onevar": false,
47 | "passfail": false,
48 | "white": false
49 | }
50 |
--------------------------------------------------------------------------------
/examples/HelloKirin/lib/list/stubs/IDumbListScreenModule.stub.js:
--------------------------------------------------------------------------------
1 | function IDumbListScreenModule () {
2 | // No properties declared
3 | }
4 | module.exports = IDumbListScreenModule;
5 | var instance = IDumbListScreenModule.prototype;
6 |
7 | /*
8 | * Lifecycle methods.
9 | * These should match corresponding native objects, via kirinHelpers
10 | */
11 | instance.onLoad = function (nativeObject) {
12 | // The native object can be called with this object
13 | this.nativeObject = nativeObject;
14 | };
15 |
16 | instance.onResume = function () {
17 | // A screen would get this viewWillAppear or onResume
18 | // TODO Implement onResume
19 | };
20 |
21 | instance.onPause = function () {
22 | // A screen would get this viewWillDisappear or onPause
23 | // TODO Implement onPause
24 | };
25 |
26 | instance.onUnload = function () {
27 | this.nativeObject = null;
28 | };
29 |
30 | /*
31 | * Method stubs
32 | */
33 |
34 | /**
35 | * @param index {@link an integer}
36 | * @param label {@link a string}
37 | */
38 | instance.onListItemClick = function (index, label) {
39 | // TODO Copy/paste this stub, and implement
40 | throw new Error("onListItemClick is unimplemented");
41 | };
42 |
--------------------------------------------------------------------------------
/javascript/lib/extensions/ImageTransform.js:
--------------------------------------------------------------------------------
1 |
2 | var backend;
3 | exports.onLoad = function (nativeObject) {
4 | backend = nativeObject;
5 | };
6 |
7 | exports.onUnload = function () {
8 | backend = null;
9 | };
10 |
11 | exports.transformSize = function (config) {
12 | var api = require("../utils/api-utils");
13 | api.normalizeAPI({
14 | "function": {
15 | mandatory: ['callback'],
16 | optional: ['errback']
17 | },
18 |
19 | 'string': {
20 | oneof: ['fromFileArea', 'fromFilename', 'fromFilepath',
21 | 'toFileArea', 'toFilename', 'toFilepath' ]
22 | },
23 |
24 | 'number': {
25 | mandatory: ['height', 'width']
26 | },
27 |
28 | 'boolean': {
29 | defaults: {
30 | overwrite: true
31 | }
32 | }
33 |
34 | }, config);
35 | config.fileType = require("../utils/ImageUtils").getFileTypeFromExtension(config.toFilePath || config.toFilename);
36 | require('kirin').wrapCallbacks(config, "Camera.transformSize");
37 |
38 | backend.transform_withConfig_("size", config);
39 | };
40 |
41 |
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Javascript
2 | generated-javascript/*
3 |
4 | # Objective-C
5 | build/*
6 | *.pbxuser
7 | !default.pbxuser
8 | *.mode1v3
9 | !default.mode1v3
10 | *.mode2v3
11 | !default.mode2v3
12 | *.perspectivev3
13 | !default.perspectivev3
14 | *.xcworkspace
15 | !default.xcworkspace
16 | xcuserdata
17 | profile
18 | *.moved-aside
19 |
20 | # Android
21 | *.apk
22 | *.ap_
23 |
24 | # files for the dex VM
25 | *.dex
26 |
27 | # Java class files
28 | *.class
29 |
30 | # generated files
31 | android/*/bin/
32 | android/bin/
33 | gen/
34 |
35 | # Local configuration file (sdk path, etc)
36 | local.properties
37 |
38 | # General
39 | .DS_Store
40 | *.swp
41 | examples/HelloKirin/platforms/android/bin
42 | generated-javascript
43 | npm-debug.log
44 | templates/app/content/platforms/android/bin
45 | idl-generated
46 | /.project
47 | *.stub.js
48 | */android/bin
49 | examples/HelloKirin/node_modules
50 | node_modules
51 | /build/
52 | build\/
53 | */android/bin
54 | examples/HelloKirin/build
55 | platforms/android/Kirin-Lib/src/com/futureplatforms/kirin/generated
56 | platforms/ios/KirinKit/build
57 | platforms/android/**/build
58 | platforms/android/kirin-for-android/.gradle
59 | platforms/android/kirin-for-android/gradle/.gradle
60 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/networking/INetworkingBackend.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions.networking;
19 |
20 | import org.json.JSONObject;
21 |
22 | import com.futureplatforms.kirin.extensions.IKirinExtension;
23 |
24 | public interface INetworkingBackend extends IKirinExtension {
25 | void downloadJSONList_(JSONObject config);
26 |
27 | void downloadJSON_(JSONObject config);
28 |
29 | void downloadFile_(JSONObject config);
30 |
31 | void deleteDownloadedFile_(JSONObject config);
32 | }
33 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "predef": [
3 | "console",
4 | "window",
5 | "document",
6 | "JavaProxyObject"
7 | ],
8 | "node": true,
9 | "bitwise": true,
10 | "curly": true,
11 | "eqeqeq": true,
12 | "forin": true,
13 | "immed": true,
14 | "latedef": true,
15 | "newcap": true,
16 | "noarg": true,
17 | "nonew": true,
18 | "plusplus": false,
19 | "regexp": false,
20 | "undef": true,
21 | "strict": false,
22 | "trailing": false,
23 | "asi": false,
24 | "boss": false,
25 | "debug": true,
26 | "eqnull": true,
27 | "es5": false,
28 | "esnext": false,
29 | "evil": false,
30 | "expr": false,
31 | "funcscope": false,
32 | "globalstrict": true,
33 | "iterator": false,
34 | "lastsemic": true,
35 | "laxbreak": false,
36 | "laxcomma": false,
37 | "loopfunc": false,
38 | "multistr": false,
39 | "onecase": true,
40 | "proto": false,
41 | "regexdash": false,
42 | "scripturl": false,
43 | "smarttabs": true,
44 | "shadow": false,
45 | "sub": false,
46 | "supernew": false,
47 | "validthis": false,
48 | "nomen": false,
49 | "onevar": false,
50 | "passfail": false,
51 | "white": false
52 | }
53 |
--------------------------------------------------------------------------------
/javascript/test/test-environment/Environment.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 | defineModule("Environment", function (require, exports) {
18 |
19 |
20 |
21 | var settings = require("app-preferences");
22 |
23 | settings.put("proxocube.prefix", "http://fp-proxocube-jh.appspot.com/proxo/test_glasto/");
24 |
25 | settings.put("lineups.minimum.sync.interval.in.seconds", 10 * 60);
26 | settings.put("news.minimum.sync.interval.in.seconds", 10 * 60);
27 |
28 | // let the data decide.
29 | //settings.put("client.detected.lineuptimes", true);
30 | //settings.put("client.detected.runorder", true);
31 |
32 | });
--------------------------------------------------------------------------------
/templates/app/content/platforms/android/Run __project_name__.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/JSONListDownloader.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 | #import "Networking.h"
21 |
22 | @interface JSONListDownloader : NSObject {
23 | NSURLConnection *theConnection;
24 | NSMutableData* data;
25 | NSDictionary* config;
26 | }
27 |
28 | + (JSONListDownloader*) downloaderWithHelper: (KirinHelper*) helper;
29 |
30 | -(void) downloadJSONList: (NSDictionary *) config;
31 |
32 | -(void) handleList: (NSData*) d withPath: (NSArray*) path;
33 |
34 | -(void) failWithError: (NSString*) error;
35 |
36 | @property (retain, nonatomic) KirinHelper* kirinHelper;
37 |
38 | @end
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinProxy.h:
--------------------------------------------------------------------------------
1 | //
2 | // KirinProxy.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 | #import
10 |
11 |
12 | #import "JSExecutor.h"
13 |
14 | @interface KirinProxy : NSObject
15 |
16 | @property(retain, nonatomic) Protocol* targetProtocol;
17 |
18 | // Modules objects
19 | + (id) proxyWithProtocol:(Protocol*) protocol andModuleName:(NSString*) moduleName andExecutor:(id) executor;
20 |
21 | // Requests from Javascript, with getters and callbacks
22 | + (id) proxyWithProtocol:(Protocol *)protocol andDictionary:(NSDictionary *)dictionary andExecutor: (id) executor;
23 |
24 | // Just setters, backed by a mutable dictionary;
25 | + (id) proxyWithProtocol:(Protocol *)protocol andMutableDictionary:(NSMutableDictionary *)dictionary;
26 |
27 |
28 | - (id) initWithProtocol: (Protocol*) protocol;
29 |
30 | - (NSArray*) getArgsFromSignature: (NSMethodSignature*) sig andInvocation: (NSInvocation*) invocation;
31 |
32 | - (NSString*) getMethodNameForSelector: (SEL) selector;
33 |
34 | - (void) handleGettingReturnType: (char) returnType withResult: (id) result andInvocation: (NSInvocation*) invocation;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/examples/HelloKirin/lib/button/stubs/IDumbButtonScreenModule.stub.js:
--------------------------------------------------------------------------------
1 | function IDumbButtonScreenModule () {
2 | // No properties declared
3 | }
4 | module.exports = IDumbButtonScreenModule;
5 | var instance = IDumbButtonScreenModule.prototype;
6 |
7 | /*
8 | * Lifecycle methods.
9 | * These should match corresponding native objects, via kirinHelpers
10 | */
11 | instance.onLoad = function (nativeObject) {
12 | // The native object can be called with this object
13 | this.nativeObject = nativeObject;
14 | };
15 |
16 | instance.onResume = function () {
17 | // A screen would get this viewWillAppear or onResume
18 | // TODO Implement onResume
19 | };
20 |
21 | instance.onPause = function () {
22 | // A screen would get this viewWillDisappear or onPause
23 | // TODO Implement onPause
24 | };
25 |
26 | instance.onUnload = function () {
27 | this.nativeObject = null;
28 | };
29 |
30 | /*
31 | * Method stubs
32 | */
33 |
34 | instance.onDumbButtonClick = function () {
35 | // TODO Copy/paste this stub, and implement
36 | throw new Error("onDumbButtonClick is unimplemented");
37 | };
38 |
39 | instance.onNextScreenButtonClick = function () {
40 | // TODO Copy/paste this stub, and implement
41 | throw new Error("onNextScreenButtonClick is unimplemented");
42 | };
43 |
--------------------------------------------------------------------------------
/javascript/lib/extensions/Camera.js:
--------------------------------------------------------------------------------
1 |
2 | var mNative, _;
3 |
4 | exports.onLoad = function (nativeObject) {
5 | mNative = nativeObject;
6 | _ = require("underscore");
7 | };
8 |
9 |
10 |
11 | function prepareConfig(config) {
12 | var api = require("../utils/api-utils");
13 | api.normalizeAPI({
14 | 'function': {
15 | mandatory: ['onSuccess'],
16 | optional: ['onError', 'onCancel']
17 | },
18 | 'number': {
19 | optional: ['targetWidth', 'targetHeight']
20 | },
21 | 'string': {
22 | // if no filename is specified then we should
23 | // hand back a dropbox key
24 | optional: ['filename']
25 | }
26 | }, config);
27 | config = _.clone(config);
28 |
29 | // TODO add mediaType
30 | var kirin = require('kirin');
31 | config = kirin.wrapCallbacks(config, "Camera");
32 |
33 | config.fileType = require("../utils/ImageUtils").getFileTypeFromExtension(config.filePath || config.filename);
34 |
35 | return config;
36 | }
37 |
38 | exports.takePicture = function (config) {
39 | mNative.cameraPicture_(prepareConfig(config));
40 | };
41 |
42 | exports.galleryPicture = function (config) {
43 | mNative.galleryPicture_(prepareConfig(config));
44 | };
45 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/JSContext.m:
--------------------------------------------------------------------------------
1 | //
2 | // JSContext.m
3 | // KirinKit
4 | //
5 | // Created by James Hugman on 21/12/2011.
6 | // Copyright 2011 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import "JSContext.h"
10 | #import "JSON.h"
11 |
12 |
13 | @interface JSContext (private)
14 |
15 |
16 | @end
17 |
18 | @implementation JSContext
19 |
20 | @synthesize jsExecutor;
21 |
22 | - (id) init {
23 | return [self initWithJSExecutor: nil];
24 | }
25 |
26 | - (id) initWithJSExecutor:(id) executor {
27 | self = [super init];
28 | if (self) {
29 | self.jsExecutor = executor;
30 | }
31 | return self;
32 | }
33 |
34 | - (void) dealloc {
35 | self.jsExecutor = nil;
36 | [super dealloc];
37 | }
38 |
39 | - (void) jsOnMainThread: (NSString*) js {
40 | if (jsExecutor) {
41 | [self.jsExecutor execJS:js];
42 | } else {
43 | NSLog(@"No JSExecutor! javascript: %@", js);
44 | }
45 | }
46 |
47 | - (void) execJS:(NSString *)js {
48 | [self js:js];
49 | }
50 |
51 | - (void) js: (NSString*) js {
52 | if ([NSThread isMainThread]) {
53 | [self jsOnMainThread:js];
54 | } else {
55 | [self performSelectorOnMainThread:@selector(jsOnMainThread:) withObject:js waitUntilDone:NO];
56 | }
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/javascript/test/test-environment/Settings-backend.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 | defineModule("Settings-backend", function (require, exports) {
18 | var kirin = require("kirin"),
19 | backend = {};
20 |
21 | var values = {};
22 |
23 | backend.requestPopulateJSWithCallback_ = function (updateJSCallback) {
24 | kirin.native2js.callCallback(updateJSCallback, values);
25 | kirin.native2js.deleteCallback(updateJSCallback);
26 | };
27 |
28 | backend.updateContents_withDeletes_ = function (keyValuePairs, deletedKeys) {
29 | values = keyValuePairs;
30 | };
31 |
32 |
33 | kirin.native2js.registerProxy("Settings-backend", backend);
34 | });
--------------------------------------------------------------------------------
/templates/screen-module/prompts.js:
--------------------------------------------------------------------------------
1 | /* Prompts cheatsheet
2 | * project_name: {
3 | * message: "the pretty name (instead of project_name)"
4 | * validator: /^[a-zA-Z\s\-]+$/,
5 | * warning: 'Name must be only letters, spaces, or dashes',
6 | * empty: false,
7 | * default: "my_awesome_project",
8 | * hidden: false
9 | * }
10 | */
11 | exports.overrides = {
12 | writeOptions: false
13 | };
14 | exports.prompts = {
15 | "screen_interface": "I__ModuleName__Screen",
16 | "module_activity": "__ModuleName__Activity",
17 | "module_interface": "I__ModuleName__Module",
18 | "screen_layout": "__module_name__",
19 |
20 | CompanyName: "MyCompanyName",
21 | ModuleViewController: "__class_prefix____ModuleName__ViewController",
22 | ModuleProtocol: "I__class_prefix____ModuleName__ScreenModule",
23 | ScreenProtocol: "I__class_prefix____ModuleName__Screen",
24 | RequestProtocol: "I__class_prefix____ModuleName__Request",
25 |
26 | module_name: {
27 | message: "the name of the Javascript module, without the .js extension",
28 | validator: /^[a-z][a-z0-9_\-]*$/,
29 | warning: "this should be lowercase, with underscores and dashes"
30 | },
31 | ModuleName: {
32 | message: "A version of the module name, in title case. This will be used in native code",
33 | validator: /^[A-Z]\w*$/
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKitTests/DummyJSContext.m:
--------------------------------------------------------------------------------
1 | //
2 | // DummyJSContext.m
3 | // KirinKit
4 | //
5 | // Created by James Hugman on 21/12/2011.
6 | // Copyright 2011 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import "DummyJSContext.h"
10 |
11 |
12 |
13 |
14 | @implementation DummyJSContext
15 | @synthesize jsCalls;
16 | @synthesize lastCall;
17 |
18 | - (id) init {
19 | self = [super init];
20 | if (self) {
21 | self.jsCalls = [[NSMutableArray alloc] init];
22 | }
23 | return self;
24 | }
25 |
26 | - (void) execJS:(NSString *)js {
27 | [self js:js];
28 | }
29 |
30 | - (void) js: (NSString*) js {
31 | NSLog(@"javascript: %@", js);
32 | self.lastCall = js;
33 | [jsCalls addObject:js];
34 | }
35 |
36 | - (void) registerObject: (NSObject*) obj asName: (NSString*) name {
37 | NSLog(@"Registering proxy for %@", name);
38 |
39 | [self js: [NSString stringWithFormat:@"kirin.loadProxyForModule('%@', %@)", name, @"[empty]"]];
40 | }
41 |
42 | - (void) unregisterObject: (NSString*) name {
43 | [self js: [NSString stringWithFormat:@"kirin.unloadProxyForModule('%@')", name]];
44 | }
45 |
46 | - (void) reset {
47 | self.lastCall = nil;
48 | [self.jsCalls removeAllObjects];
49 | }
50 |
51 | - (void) dealloc {
52 | self.jsCalls = nil;
53 | [super dealloc];
54 | }
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/ios/HelloKirin-iOS/HelloKirin-iOS-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIconFile
12 |
13 | CFBundleIdentifier
14 | com.futureplatforms.kirin.${PRODUCT_NAME:rfc1034identifier}
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | ${PRODUCT_NAME}
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 1.0
27 | LSRequiresIPhoneOS
28 |
29 | NSMainNibFile
30 | MainWindow
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationPortraitUpsideDown
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Extensions/FileDownloader.h:
--------------------------------------------------------------------------------
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 |
18 |
19 | #import
20 |
21 |
22 | @interface FileDownloader : NSObject {
23 | NSURLConnection *theConnection;
24 | NSMutableData* data;
25 | }
26 |
27 | @property (nonatomic, retain) KirinHelper* kirinHelper;
28 | @property (nonatomic, retain) NSDictionary* config;
29 |
30 | + (FileDownloader*) downloaderWithHelper: (KirinHelper*) helper;
31 |
32 | - (void) startDownloadWithConfig: (NSDictionary*) _config;
33 |
34 | - (void) deleteFileWithConfig: (NSDictionary*) _config;
35 |
36 | - (void) cleanupCallbacks;
37 |
38 | - (void) writeToFile: (NSData*) fileData;
39 |
40 | - (void) failWithError: (NSString*) error;
41 |
42 |
43 | @end
--------------------------------------------------------------------------------
/javascript/lib/extensions/network/KirinXHRequest.js:
--------------------------------------------------------------------------------
1 | var _ = require('underscore'),
2 | kirinBridge = require('kirin-bridge-utils');
3 |
4 | function KirinXHRequest (params) {
5 | if (typeof params === 'object') {
6 | _.extend(this, params);
7 | }
8 | }
9 |
10 | var instance = KirinXHRequest.prototype;
11 | module.exports = KirinXHRequest;
12 |
13 | instance.kirin_bridgeUtils = new kirinBridge.BridgeUtils({
14 | "properties": {
15 | "__id": "string",
16 | "url": "string",
17 | "method": "string",
18 | "timeout": "long",
19 | "responseType": "string",
20 | "requestHeaders": "object"
21 | },
22 | "methods": {
23 | "_doOnInitialisationError": [
24 | "errorMessage"
25 | ],
26 | "_doOnConnect": [
27 | "responseHeaders",
28 | "event"
29 | ],
30 | "_doOnAppendPayload": [
31 | "text",
32 | "event"
33 | ],
34 | "_doOnRequestComplete": [
35 | "statusCode",
36 | "response",
37 | "event"
38 | ],
39 | "_doOnInterrupt": [
40 | "errorMessage"
41 | ],
42 | "_doUploadProgress": [
43 | "eventType",
44 | "event"
45 | ]
46 | },
47 | "defaults": {
48 | "timeout": "0"
49 | }
50 | }, false);
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinDropbox.h:
--------------------------------------------------------------------------------
1 | //
2 | // KirinDropbox.h
3 | // KirinKit
4 | //
5 | // Created by James Hugman on 23/12/2011.
6 | // Copyright 2011 Future Platforms. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface KirinDropbox : NSObject {
13 |
14 |
15 |
16 | @private
17 | NSMutableDictionary* dropbox;
18 | int dropboxCounter;
19 | }
20 |
21 |
22 | /**
23 | * Stash an object in the drop box, returning a key - the token - which can be used to look up the object some place else.
24 | * The token is generated by appending the prefix to a generated suffix, guarunteeing a unique token for this object.
25 | * No effort is made de-duplicate the object - the token is unique per call.
26 | *
27 | */
28 | - (NSString*) putObject:(id) object withTokenPrefix:(NSString*) tokenPrefix;
29 |
30 | /**
31 | * Stash an object in the drop box using a well known token. The use of this is not encouraged, though is occassionally useful.
32 | * The returned string is the token passed in, to keep the method looking as much as possible like the tokenPrefix version of the call.
33 | */
34 | - (NSString*) putObject:(id) object withToken:(NSString*) token;
35 |
36 | - (NSObject*) consumeObjectWithToken:(NSString*) token;
37 |
38 | - (void) disposeObjectWithToken:(NSString*) token;
39 |
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/core/JsCommands.java:
--------------------------------------------------------------------------------
1 | package com.futureplatforms.kirin.internal.core;
2 |
3 | public final class JsCommands {
4 | public static final String EXECUTE_METHOD_JS = "EXPOSED_TO_NATIVE.native2js.execMethod(''{0}'', ''{1}'', null, {2})";
5 | public static final String EXECUTE_METHOD_JS_WITH_ARGS = "EXPOSED_TO_NATIVE.native2js.execMethod(''{0}'', ''{1}'', [{2}], {3})";
6 |
7 | public static final String REGISTER_MODULE_WITH_METHODS = "EXPOSED_TO_NATIVE.native2js.loadProxyForModule(''{0}'', [''{1}''])";
8 | public static final String UNREGISTER_MODULE = "EXPOSED_TO_NATIVE.native2js.unloadProxyForModule(''{0}'')";
9 |
10 | public static final String EXECUTE_CALLBACK_METHOD_JS = "EXPOSED_TO_NATIVE.native2js.execCallbackMethod(''{0}'', ''{1}'', null, {2})";
11 | public static final String EXECUTE_CALLBACK_METHOD_WITH_ARGS_JS = "EXPOSED_TO_NATIVE.native2js.execCallbackMethod(''{0}'', ''{1}'', [{2}], {3})";
12 |
13 | @Deprecated
14 | public static final String EXECUTE_CALLBACK_JS = "EXPOSED_TO_NATIVE.native2js.execCallback(''{0}'')";
15 | @Deprecated
16 | public static final String EXECUTE_CALLBACK_WITH_ARGS_JS = "EXPOSED_TO_NATIVE.native2js.execCallback(''{0}'', [{1}])";
17 | @Deprecated
18 | public static final String DELETE_CALLBACK_JS = "EXPOSED_TO_NATIVE.native2js.deleteCallback([''{0}''])";
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/examples/HelloKirin/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "predef": [
3 | "jasmine",
4 | "spyOn",
5 | "it",
6 | "console",
7 | "describe",
8 | "expect",
9 | "beforeEach",
10 | "waits",
11 | "waitsFor",
12 | "runs"
13 | ],
14 | "node": true,
15 | "bitwise": true,
16 | "curly": true,
17 | "eqeqeq": true,
18 | "forin": true,
19 | "immed": true,
20 | "latedef": true,
21 | "newcap": true,
22 | "noarg": true,
23 | "nonew": true,
24 | "plusplus": false,
25 | "regexp": true,
26 | "undef": true,
27 | "strict": false,
28 | "trailing": false,
29 | "asi": false,
30 | "boss": false,
31 | "debug": true,
32 | "eqnull": true,
33 | "es5": false,
34 | "esnext": false,
35 | "evil": false,
36 | "expr": false,
37 | "funcscope": false,
38 | "globalstrict": true,
39 | "iterator": false,
40 | "lastsemic": true,
41 | "laxbreak": false,
42 | "laxcomma": false,
43 | "loopfunc": false,
44 | "multistr": false,
45 | "onecase": true,
46 | "proto": false,
47 | "regexdash": false,
48 | "scripturl": false,
49 | "smarttabs": true,
50 | "shadow": false,
51 | "sub": false,
52 | "supernew": false,
53 | "validthis": false,
54 | "nomen": false,
55 | "onevar": false,
56 | "passfail": false,
57 | "white": false
58 | }
59 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/internal/fragmentation/WebChromeClient7.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.internal.fragmentation;
19 |
20 | import java.text.MessageFormat;
21 |
22 | import android.util.Log;
23 | import android.webkit.WebChromeClient;
24 |
25 | import com.futureplatforms.kirin.C;
26 |
27 | public class WebChromeClient7 extends WebChromeClient {
28 |
29 | @Override
30 | public void onConsoleMessage(String message, int lineNumber, String sourceID) {
31 | sourceID = sourceID.substring(sourceID.lastIndexOf('/') + 1);
32 | String msg = MessageFormat.format("{2} (line {1}): {0}", message, lineNumber, sourceID);
33 | Log.i(C.JS_TAG, msg);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/extensions/databases/IDatabasesBackend.java:
--------------------------------------------------------------------------------
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 |
18 | package com.futureplatforms.kirin.extensions.databases;
19 |
20 | import org.json.JSONArray;
21 | import org.json.JSONObject;
22 |
23 | import com.futureplatforms.kirin.extensions.IKirinExtension;
24 |
25 | public interface IDatabasesBackend extends IKirinExtension {
26 | void db_openOrCreate_(String dbName, JSONObject config);
27 |
28 | void beginTransaction_(JSONObject config);
29 |
30 | void tx_appendToTransactionScript_(String txId, JSONArray log);
31 |
32 | void tx_appendToOpenerScript_(String txId, JSONArray log);
33 |
34 | void endTransaction_(String txId);
35 |
36 | void diposeToken_(String token);
37 | }
38 |
--------------------------------------------------------------------------------
/examples/HelloKirin/idl/idl.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | namespace: "com.futureplatforms.kirin.generated.demo.hellokirin",
3 | classes: {
4 | "IDumbButtonScreen": {
5 | implementedBy: "native",
6 | methods: {
7 | // only methods allowed
8 | "updateLabelSize:andText:": [{ size : "integer" }, { text : "string" }],
9 | "changeScreen:": [{ finalLabel: "string" }]
10 | }
11 | },
12 | "IDumbButtonScreenModule": {
13 | implementedBy: "javascript", // || gwt
14 | location: "button",
15 | methods: {
16 | "onDumbButtonClick": [],
17 | "onNextScreenButtonClick": []
18 | }
19 | },
20 |
21 |
22 | "IDumbListScreen": {
23 | docs: "This screen looks after a list",
24 | implementedBy: "native",
25 | methods: {
26 | // only methods allowed
27 | "populateList": [{ list : "array" }],
28 | "showToast": [{ toast: "string" }]
29 | }
30 | },
31 | "IDumbListScreenModule": {
32 | implementedBy: "javascript", // || gwt
33 | location: "list",
34 | methods: {
35 | "onListItemClick": [{index: "int"}, {label: "string"}]
36 | }
37 | }
38 |
39 |
40 |
41 | }
42 | };
--------------------------------------------------------------------------------
/platforms/android/Kirin-Lib-Test/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class * extends android.app.backup.BackupAgentHelper
14 | -keep public class * extends android.preference.Preference
15 | -keep public class com.android.vending.licensing.ILicensingService
16 |
17 | -keepclasseswithmembernames class * {
18 | native ;
19 | }
20 |
21 | -keepclasseswithmembers class * {
22 | public (android.content.Context, android.util.AttributeSet);
23 | }
24 |
25 | -keepclasseswithmembers class * {
26 | public (android.content.Context, android.util.AttributeSet, int);
27 | }
28 |
29 | -keepclassmembers class * extends android.app.Activity {
30 | public void *(android.view.View);
31 | }
32 |
33 | -keepclassmembers enum * {
34 | public static **[] values();
35 | public static ** valueOf(java.lang.String);
36 | }
37 |
38 | -keep class * implements android.os.Parcelable {
39 | public static final android.os.Parcelable$Creator *;
40 | }
41 |
--------------------------------------------------------------------------------
/platforms/android/attic-Kirin-Lib/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class * extends android.app.backup.BackupAgentHelper
14 | -keep public class * extends android.preference.Preference
15 | -keep public class com.android.vending.licensing.ILicensingService
16 |
17 | -keepclasseswithmembernames class * {
18 | native ;
19 | }
20 |
21 | -keepclasseswithmembers class * {
22 | public (android.content.Context, android.util.AttributeSet);
23 | }
24 |
25 | -keepclasseswithmembers class * {
26 | public (android.content.Context, android.util.AttributeSet, int);
27 | }
28 |
29 | -keepclassmembers class * extends android.app.Activity {
30 | public void *(android.view.View);
31 | }
32 |
33 | -keepclassmembers enum * {
34 | public static **[] values();
35 | public static ** valueOf(java.lang.String);
36 | }
37 |
38 | -keep class * implements android.os.Parcelable {
39 | public static final android.os.Parcelable$Creator *;
40 | }
41 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class * extends android.app.backup.BackupAgentHelper
14 | -keep public class * extends android.preference.Preference
15 | -keep public class com.android.vending.licensing.ILicensingService
16 |
17 | -keepclasseswithmembernames class * {
18 | native ;
19 | }
20 |
21 | -keepclasseswithmembers class * {
22 | public (android.content.Context, android.util.AttributeSet);
23 | }
24 |
25 | -keepclasseswithmembers class * {
26 | public (android.content.Context, android.util.AttributeSet, int);
27 | }
28 |
29 | -keepclassmembers class * extends android.app.Activity {
30 | public void *(android.view.View);
31 | }
32 |
33 | -keepclassmembers enum * {
34 | public static **[] values();
35 | public static ** valueOf(java.lang.String);
36 | }
37 |
38 | -keep class * implements android.os.Parcelable {
39 | public static final android.os.Parcelable$Creator *;
40 | }
41 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/KirinUITableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // KirinUITableViewController.m
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 "KirinUITableViewController.h"
10 | #import
11 |
12 | @interface KirinUITableViewController ()
13 |
14 | @end
15 |
16 | @implementation KirinUITableViewController
17 |
18 | @synthesize kirinHelper = kirinHelper_;
19 |
20 | - (void) bindScreenWithoutLoading: (NSString*) moduleName {
21 | self.kirinHelper = [KIRIN bindScreen:self toModule:moduleName];
22 | }
23 |
24 | - (void) bindScreen:(NSString *)moduleName {
25 | [self bindScreenWithoutLoading:moduleName];
26 | [self.kirinHelper onLoad];
27 | }
28 |
29 | - (id) bindScreen:(NSString *)moduleName withProtocol: (Protocol*) protocol {
30 | [self bindScreen:moduleName];
31 | return [self.kirinHelper proxyForJavascriptModule:protocol];
32 | }
33 |
34 | - (void) viewWillAppear:(BOOL)animated {
35 | [super viewWillAppear:animated];
36 |
37 | [self.kirinHelper onResume];
38 | }
39 |
40 | - (void) viewWillDisappear:(BOOL)animated {
41 | [super viewWillDisappear:animated];
42 | [self.kirinHelper onPause];
43 |
44 | }
45 |
46 | - (void)viewDidUnload
47 | {
48 | [self.kirinHelper onUnload];
49 |
50 | [super viewDidUnload];
51 | self.kirinHelper = nil;
52 | }
53 |
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/javascript/test/dummies/DummyScreen.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 | defineModule("DummyScreen", function (require, exports) {
18 | var strings = ["smallest", "still small", "small", "medium", "big", "bigger", "huge", "giant", "quite big", "biggest"],
19 | counter = strings.length,
20 | kirin = require("kirin");
21 |
22 | exports.onDumbButtonClick = function () {
23 | if (counter >= (strings.length - 1)) {
24 | counter = 0;
25 | } else {
26 | counter ++;
27 | }
28 |
29 | kirin.js2nativeScreenProxy.updateLabelSize_andText_(counter * 5 + 10, strings[counter]);
30 |
31 | return true;
32 | };
33 |
34 | exports.onNextScreenButtonClick = function () {
35 | kirin.js2nativeScreenProxy.changeScreen_(strings[counter]);
36 |
37 | };
38 | });
39 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/res/layout-land/dumb_button_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
24 |
25 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/examples/HelloKirin/lib/button/DumbButtonScreenModule.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 | var strings = ["smallest", "still small", "small", "medium", "big", "bigger", "huge", "giant", "quite big", "biggest"],
18 | counter = strings.length - 1,
19 | theScreen;
20 |
21 |
22 | exports.onLoad = function (ui) {
23 | theScreen = ui;
24 | };
25 |
26 | exports.onUnload = function () {
27 | theScreen = null;
28 | };
29 |
30 | exports.onResume = function () {
31 | console.log("Resuming " + __filename);
32 | };
33 |
34 | exports.onPause = function () {
35 | // NOOP
36 | };
37 |
38 | exports.onDumbButtonClick = function () {
39 | if (counter >= (strings.length - 1)) {
40 | counter = 0;
41 | } else {
42 | counter ++;
43 | }
44 |
45 | theScreen.updateLabelSizeAndText(counter * 5 + 10, strings[counter]);
46 |
47 | return true;
48 | };
49 |
50 | exports.onNextScreenButtonClick = function () {
51 | theScreen.changeScreen(strings[counter]);
52 | };
53 |
--------------------------------------------------------------------------------
/RELEASE-NOTES:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | Kirin 0.6.0
19 | ===========
20 |
21 | Overview
22 | --------
23 | * Fragments. Cleaner way of associating native code with Javascript, principally useful for handling Android fragments.
24 | - this is currently iOS only, and even then this isn't complete yet.
25 | * Modularizing the build. This is to allow optional components; principally this is affects Javascript
26 | - build script no longer has a dependedency on Cygwin on Windows - it's all written in node.js Javascript.
27 | - the build script is much faster now.
28 |
29 | Kirin 0.5.0
30 | ===========
31 |
32 | Overview
33 | --------
34 | Initial Release
35 |
--------------------------------------------------------------------------------
/examples/HelloKirin/platforms/android/res/layout/dumb_button_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
19 |
20 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/platforms/ios/KirinKit/KirinKit/Core/JSExecutor.h:
--------------------------------------------------------------------------------
1 | //
2 | // JSExecutor.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 | #define DEBUG_JS NO
12 |
13 | #define EXECUTE_METHOD_JS @"EXPOSED_TO_NATIVE.native2js.execMethod('%@', '%@')"
14 | #define EXECUTE_METHOD_WITH_ARGS_JS @"EXPOSED_TO_NATIVE.native2js.execMethod('%@', '%@', %@)"
15 | #define DEPRECATED_EXECUTE_METHOD_WITH_ARGS_JS @"EXPOSED_TO_NATIVE.native2js.execMethod('%@', '%@', [%@])"
16 |
17 | // all of these callback_js methods are deprecated.
18 | #define EXECUTE_CALLBACK_JS @"EXPOSED_TO_NATIVE.native2js.execCallback('%@')"
19 | #define EXECUTE_CALLBACK_WITH_ARGS_JS @"EXPOSED_TO_NATIVE.native2js.execCallback('%@', %@)"
20 | #define DEPRECATED_EXECUTE_CALLBACK_WITH_ARGS_JS @"EXPOSED_TO_NATIVE.native2js.execCallback('%@', [%@])"
21 | #define DELETE_CALLBACK_JS @"EXPOSED_TO_NATIVE.native2js.deleteCallback(%@)"
22 |
23 | // these are the new thing. Cleanup of callbacks falls to the Javascript.
24 | #define EXECUTE_CALLBACK_METHOD_JS @"EXPOSED_TO_NATIVE.native2js.execCallbackMethod('%@', '%@')"
25 | #define EXECUTE_CALLBACK_METHOD_WITH_ARGS_JS @"EXPOSED_TO_NATIVE.native2js.execCallbackMethod('%@', '%@', %@)"
26 |
27 |
28 |
29 |
30 | #define REGISTER_MODULE_WITH_METHODS @"EXPOSED_TO_NATIVE.native2js.loadProxyForModule('%@', %@)"
31 |
32 | #define UNREGISTER_MODULE @"EXPOSED_TO_NATIVE.native2js.unloadProxyForModule('%@')"
33 |
34 | @protocol JSExecutor
35 | - (void) execJS: (NSString*) js;
36 | @end
37 |
--------------------------------------------------------------------------------
/javascript/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kirin",
3 | "description": "A toolkit to help building native crossplatform mobile apps by implementing the application logic in Javascript.",
4 | "version": "0.7.0",
5 | "homepage": "https://github.com/kirinjs/kirin",
6 | "author": [
7 | {
8 | "name": "jhugman",
9 | "email": "james@hugman.tv",
10 | "url": "https://hugman.posterous.com/tag/kirin"
11 | }
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "git://github.com/kirinjs/kirin.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/kirinjs/kirin/issues"
19 | },
20 | "licenses": [
21 | {
22 | "type": "Apache",
23 | "url": "https://github.com/KirinJS/Kirin/blob/master/LICENSE"
24 | }
25 | ],
26 | "engines": {
27 | "node": "*"
28 | },
29 | "main": "lib/entry.js",
30 | "kirin": {
31 | "idl": "lib/javascript/idl",
32 | "idlOutput": "src"
33 | },
34 | "browserify": {
35 | "transform": [
36 | "overidify"
37 | ]
38 | },
39 | "aliasify": "./extensions.js",
40 | "dependencies": {
41 | "underscore": ">= 1.3.1"
42 | },
43 | "optionalDependencies": {
44 | "progenitor": "git://github.com/KirinJS/progenitor.git",
45 | "kirin-build": "git://github.com/KirinJS/kirin-build.git",
46 | "findit": "~0.1.2",
47 | "harmonizr": "~0.2.0"
48 | },
49 | "keywords": [
50 | "mobile",
51 | "crossplatform",
52 | "native",
53 | "apps"
54 | ],
55 | "devDependencies": {
56 | "overidify": "jhugman/overidify",
57 | "tap": "~0.4.13",
58 | "aliasify": "~1.4.0"
59 | }
60 | }
61 |
--------------------------------------------------------------------------------