rhodes 1.5.5 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Manifest.txt +214 -32
- data/Rakefile +33 -10
- data/bin/upgrade-rhodes-app +0 -1
- data/lib/build/compileERB/bb.rb +2 -2
- data/lib/build/compileERB/default.rb +7 -5
- data/lib/build/jake.rb +1 -1
- data/lib/extensions/digest-md5/ext.yml +1 -1
- data/lib/extensions/digest-md5/ext/Rakefile +35 -36
- data/lib/extensions/digest-md5/ext/build.bat +1 -0
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +203 -0
- data/lib/extensions/digest-sha1/ext.yml +1 -1
- data/lib/extensions/digest/ext.yml +1 -1
- data/lib/extensions/digest/ext/Rakefile +35 -39
- data/lib/extensions/digest/ext/build.bat +1 -2
- data/lib/extensions/digest/ext/digest.vcproj +203 -0
- data/lib/framework/rho/render.rb +79 -22
- data/lib/framework/rho/rho.rb +294 -56
- data/lib/framework/rho/rhoapplication.rb +10 -0
- data/lib/framework/rho/rhofsconnector.rb +2 -6
- data/lib/framework/rho/rhoutils.rb +56 -14
- data/lib/framework/rho/rhoviewhelpers.rb +2 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/rhom/rhom.rb +42 -15
- data/lib/framework/rhom/rhom_db_adapter.rb +165 -159
- data/lib/framework/rhom/rhom_object.rb +0 -1
- data/lib/framework/rhom/rhom_object_factory.rb +343 -166
- data/lib/framework/rhom/rhom_source.rb +28 -15
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +39 -44
- data/platform/android/Rhodes/jni/include/JNIRhodes.h +1 -1
- data/platform/android/Rhodes/jni/include/details/rhojava.inc +23 -20
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_RhoMenu.h +61 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_Rhodes.h +16 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_alert_Alert.h +21 -0
- data/platform/android/Rhodes/jni/include/sslimpl.h +1 -1
- data/platform/android/Rhodes/jni/src/alert.cpp +32 -5
- data/platform/android/Rhodes/jni/src/callbacks.cpp +51 -21
- data/platform/android/Rhodes/jni/src/mapview.cpp +3 -8
- data/platform/android/Rhodes/jni/src/menu.cpp +70 -0
- data/platform/android/Rhodes/jni/src/navbar.cpp +16 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +37 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
- data/platform/android/Rhodes/jni/src/webview.cpp +21 -7
- data/platform/android/Rhodes/res/drawable/alert_alert.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_question.png +0 -0
- data/platform/android/Rhodes/res/drawable/camera.png +0 -0
- data/platform/android/Rhodes/res/layout/camera.xml +18 -3
- data/platform/android/Rhodes/res/menu/options.xml +0 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +5 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +105 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +157 -122
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +7 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +220 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +22 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +44 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +44 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +47 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +13 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +11 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +1 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +61 -0
- data/platform/android/build/RhodesSRC_build.files +3 -0
- data/platform/android/build/android.rake +173 -60
- data/platform/android/build/androidcommon.rb +1 -2
- data/platform/android/build/librhocommon_build.files +5 -0
- data/platform/android/build/librhodes_build.files +2 -0
- data/platform/android/build/libruby_build.files +2 -1
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -3
- data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +16 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +5 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +25 -4
- data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -1
- data/platform/bb/Hsqldb/src/j2me/math/Number.java +6 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Result.java +2 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Select.java +12 -6
- data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +19 -12
- data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +10 -4
- data/platform/bb/Hsqldb/src/org/hsqldb/Token.java +10 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +3 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/lib/java/JavaSystem.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlProperties.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/ScaledRAFile.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java +1 -1
- data/platform/bb/RubyVM/RubyVM.jdp +9 -10
- data/platform/bb/build/RubyVM_build.files +9 -7
- data/platform/bb/build/bb.rake +13 -3
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -2
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +154 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/rhodes.jdp +12 -7
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +331 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +10 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +4 -0
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +2 -4
- data/platform/bb/rhodes/src/com/rho/{Jsr75File.java → file/Jsr75File.java} +83 -36
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/Jsr75RAFileImpl.java +0 -1
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/PersistRAFileImpl.java +0 -2
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +8 -10
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +39 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +63 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +100 -0
- data/platform/bb/rhodes/src/rhomobile/LogScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +13 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +138 -492
- data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +11 -2
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +14 -10
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +5 -14
- data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +2 -2
- data/platform/iphone/Classes/AppManager/AppManager.m +37 -14
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +15 -4
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +53 -50
- data/platform/iphone/Classes/DateTimePicker.h +17 -0
- data/platform/iphone/Classes/DateTimePicker.m +35 -0
- data/platform/iphone/Classes/GeoLocation/LocationController.m +2 -3
- data/platform/iphone/Classes/LogOptionsController.m +3 -2
- data/platform/iphone/Classes/LogViewController.m +4 -2
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +12 -20
- data/platform/iphone/Classes/MapView/MapAnnotation.h +9 -13
- data/platform/iphone/Classes/MapView/MapAnnotation.m +17 -65
- data/platform/iphone/Classes/MapView/MapViewController.h +1 -7
- data/platform/iphone/Classes/MapView/MapViewController.m +51 -25
- data/platform/iphone/Classes/NativeBar.h +0 -12
- data/platform/iphone/Classes/NativeBar.m +121 -2
- data/platform/iphone/Classes/NavBar.h +16 -0
- data/platform/iphone/Classes/NavBar.m +115 -0
- data/platform/iphone/Classes/RhoAlert.h +19 -0
- data/platform/iphone/Classes/RhoAlert.m +258 -0
- data/platform/iphone/Classes/RhoDelegate.m +1 -0
- data/platform/iphone/Classes/RhoMainView.h +33 -0
- data/platform/iphone/Classes/Rhodes.h +56 -0
- data/platform/iphone/Classes/Rhodes.m +533 -0
- data/platform/iphone/Classes/RingtoneManager.h +17 -0
- data/platform/iphone/Classes/RingtoneManager.m +73 -0
- data/platform/iphone/Classes/SimpleMainView.h +30 -0
- data/platform/iphone/Classes/SimpleMainView.m +380 -0
- data/platform/iphone/Classes/TabbedMainView.h +24 -0
- data/platform/iphone/Classes/TabbedMainView.m +202 -0
- data/platform/iphone/Classes/WebView.m +123 -0
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +2 -2
- data/platform/iphone/Classes/rho/net/sslimpl.cpp +13 -1
- data/platform/iphone/Classes/rho/net/sslimpl.h +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +44 -0
- data/platform/iphone/main.m +1 -2
- data/platform/iphone/rbuild/iphone.rake +8 -16
- data/platform/iphone/rhoextlib/dosyscall.c +1 -1
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +6 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +97 -62
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +12 -0
- data/platform/osx/Rhodes Launcher/launch.rb +14 -21
- data/platform/shared/common/AppMenu.cpp +122 -0
- data/platform/shared/common/AppMenu.h +46 -0
- data/platform/shared/common/PosixThreadImpl.cpp +1 -1
- data/platform/shared/common/RhoConf.cpp +27 -2
- data/platform/shared/common/RhoConf.h +5 -0
- data/platform/shared/common/RhoFilePath.h +21 -0
- data/platform/shared/common/RhoStd.h +44 -5
- data/platform/shared/common/RhoTime.h +20 -7
- data/platform/shared/common/RhodesApp.cpp +236 -177
- data/platform/shared/common/RhodesApp.h +36 -13
- data/platform/shared/common/SplashScreen.cpp +2 -2
- data/platform/shared/common/StringConverter.h +10 -11
- data/platform/shared/common/rhoparams.c +0 -6
- data/platform/shared/curl/lib/rhossl.c +3 -2
- data/platform/shared/curl/lib/url.c +0 -5
- data/platform/shared/db/DBAdapter.cpp +304 -81
- data/platform/shared/db/DBAdapter.h +24 -7
- data/platform/shared/db/DBAttrManager.cpp +83 -30
- data/platform/shared/db/DBAttrManager.h +6 -0
- data/platform/shared/db/DBResult.h +15 -4
- data/platform/shared/json/JSONIterator.cpp +100 -3
- data/platform/shared/json/JSONIterator.h +28 -3
- data/platform/shared/net/AsyncHttp.cpp +25 -22
- data/platform/shared/net/AsyncHttp.h +10 -6
- data/platform/shared/net/CURLNetRequest.cpp +115 -36
- data/platform/shared/net/CURLNetRequest.h +6 -0
- data/platform/shared/net/HttpServer.cpp +6 -4
- data/platform/shared/net/HttpServer.h +0 -1
- data/platform/shared/net/INetRequest.h +19 -3
- data/platform/shared/net/URI.cpp +2 -2
- data/platform/shared/net/ssl.cpp +2 -2
- data/platform/shared/net/ssl.h +2 -2
- data/platform/shared/ruby/ext/alert/alert.i +14 -2
- data/platform/shared/ruby/ext/alert/alert_wrap.c +40 -20
- data/platform/shared/ruby/ext/asynchttp/asynchttp.i +8 -8
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +112 -16
- data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -12
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +481 -125
- data/platform/shared/ruby/ext/navbar/navbar.i +20 -0
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +1859 -0
- data/platform/shared/ruby/ext/rho/extensions.c +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +32 -2
- data/platform/shared/ruby/ext/rho/rhoruby.h +7 -2
- data/platform/shared/ruby/ext/rhoconf/rhoconf.i +4 -0
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +31 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +188 -3226
- data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -25
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +96 -104
- data/platform/shared/ruby/ext/system/system.i +12 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +101 -7
- data/platform/shared/ruby/ext/webview/webview.i +20 -15
- data/platform/shared/ruby/ext/webview/webview_wrap.c +42 -16
- data/platform/shared/ruby/thread_pthread.c +4 -4
- data/platform/shared/ruby/thread_win32.c +4 -4
- data/platform/shared/ruby/wince/io_wce.c +0 -1
- data/platform/shared/rubyJVM/src/com/rho/FilePath.java +18 -2
- data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/Properties.java +9 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +2 -3
- data/platform/shared/rubyJVM/src/com/rho/RhoConf.java +47 -8
- data/platform/shared/rubyJVM/src/com/rho/RhoLogConf.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoLogFileSink.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoRuby.java +43 -5
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +98 -3
- data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +460 -175
- data/platform/shared/rubyJVM/src/com/rho/db/DBAttrManager.java +81 -33
- data/platform/shared/rubyJVM/src/com/rho/db/IDBCallback.java +3 -5
- data/platform/shared/rubyJVM/src/com/rho/db/IDBResult.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/db/IDBStorage.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/{IFile.java → file/IFile.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IFileAccess.java → file/IFileAccess.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IRAFile.java → file/IRAFile.java} +1 -1
- data/platform/{bb/Hsqldb/src/com/rho/db → shared/rubyJVM/src/com/rho/file}/RandomAccessFile.java +1 -2
- data/platform/shared/rubyJVM/src/com/rho/{SimpleFile.java → file/SimpleFile.java} +5 -1
- data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +23 -18
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +167 -250
- data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +100 -30
- data/platform/shared/rubyJVM/src/com/rho/net/URI.java +0 -1
- data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +30 -33
- data/platform/shared/rubyJVM/src/com/rho/sync/ISyncProtocol.java +20 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java +5 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONStructIterator.java +74 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +486 -257
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncNotify.java +89 -58
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncProtocol_3.java +79 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +634 -495
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +74 -90
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +1 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyThread.java +6 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyRuntime.java +6 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +17 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyValue.java +1 -0
- data/platform/shared/rubyJVM/src/org/json/me/JSONObject.java +3 -0
- data/platform/shared/rubyext/GeoLocation.cpp +23 -0
- data/platform/shared/rubyext/GeoLocation.h +2 -0
- data/platform/shared/rubyext/RhoRuby.cpp +31 -0
- data/platform/shared/rubyext/RhoRuby.h +32 -0
- data/platform/shared/rubyext/System.cpp +14 -3
- data/platform/shared/rubyext/WebView.h +21 -0
- data/platform/shared/sync/ClientRegister.cpp +23 -28
- data/platform/shared/sync/ClientRegister.h +6 -2
- data/platform/shared/sync/ISyncProtocol.h +29 -0
- data/platform/shared/sync/SyncEngine.cpp +450 -190
- data/platform/shared/sync/SyncEngine.h +28 -38
- data/platform/shared/sync/SyncNotify.cpp +43 -41
- data/platform/shared/sync/SyncNotify.h +7 -7
- data/platform/shared/sync/SyncProtocol_3.h +86 -0
- data/platform/shared/sync/SyncSource.cpp +535 -371
- data/platform/shared/sync/SyncSource.h +48 -55
- data/platform/shared/sync/SyncThread.cpp +59 -103
- data/platform/shared/sync/SyncThread.h +10 -23
- data/platform/shared/unzip/unzip.cpp +3 -2
- data/platform/shared/unzip/unzip.h +5 -1
- data/platform/shared/wtl80/include/atlapp.h +10 -10
- data/platform/wm/RhoLib/RhoLib.vcproj +32 -0
- data/platform/wm/build/build_inf.js +40 -3
- data/platform/wm/build/wm.rake +95 -9
- data/platform/wm/rhodes/Alert.cpp +4 -0
- data/platform/wm/rhodes/DateTimePicker.cpp +183 -0
- data/platform/wm/rhodes/DateTimePicker.h +100 -0
- data/platform/wm/rhodes/MainWindow.cpp +222 -209
- data/platform/wm/rhodes/MainWindow.h +28 -35
- data/platform/wm/rhodes/Rhodes.cpp +20 -60
- data/platform/wm/rhodes/Rhodes.rc +41 -7
- data/platform/wm/rhodes/Utils.cpp +65 -0
- data/platform/wm/rhodes/Utils.h +9 -0
- data/platform/wm/rhodes/camera/Camera.cpp +2 -2
- data/platform/wm/rhodes/menubar.cpp +2 -33
- data/platform/wm/rhodes/menubar.h +0 -14
- data/platform/wm/rhodes/resource.h +13 -11
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +16 -35
- data/platform/wm/rhodes/rho/net/NetRequest.h +8 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +264 -46
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +14 -4
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +77 -4
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +63 -0
- data/platform/wm/rhodes/rhodes.vcproj +20 -66
- data/platform/wm/rhodes/stdafx.h +22 -0
- data/platform/wm/rubylib/rubylib.vcproj +4 -0
- data/platform/wm/syncengine/syncengine.vcproj +8 -0
- data/platform/wm/tools/detool.sln +66 -0
- data/platform/wm/tools/detool/DEMComInterface.tlb +0 -0
- data/platform/wm/tools/detool/ReadMe.txt +33 -0
- data/platform/wm/tools/detool/detool.cpp +559 -0
- data/platform/wm/tools/detool/detool.h +5 -0
- data/platform/wm/tools/detool/detool.vcproj +233 -0
- data/platform/wm/tools/detool/stdafx.cpp +8 -0
- data/platform/wm/tools/detool/stdafx.h +15 -0
- data/platform/wm/tools/detool/targetver.h +24 -0
- data/platform/wm/tools/rhosetup/ReadMe.txt +41 -0
- data/platform/wm/tools/rhosetup/rhosetup.cpp +52 -0
- data/platform/wm/tools/rhosetup/rhosetup.vcproj +641 -0
- data/platform/wm/tools/rhosetup/stdafx.cpp +8 -0
- data/platform/wm/tools/rhosetup/stdafx.h +59 -0
- data/rakefile.rb +33 -10
- data/res/build-tools/db/syncdb.schema +25 -23
- data/res/build-tools/db/syncdb.triggers +1 -1
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/rhosetup.dll +0 -0
- data/res/generators/rhogen.rb +27 -22
- data/res/generators/templates/application/app/Settings/controller.rb +3 -1
- data/res/generators/templates/application/app/Settings/home.bb.erb +17 -0
- data/res/generators/templates/application/app/Settings/home.erb +21 -12
- data/res/generators/templates/application/app/Settings/index.bb.erb +32 -0
- data/res/generators/templates/application/app/Settings/index.erb +44 -15
- data/res/generators/templates/application/app/Settings/login.bb.erb +35 -0
- data/res/generators/templates/application/app/Settings/login.erb +29 -30
- data/res/generators/templates/application/app/Settings/reset.bb.erb +15 -0
- data/res/generators/templates/application/app/Settings/reset.erb +16 -13
- data/res/generators/templates/application/app/Settings/wait.bb.erb +3 -0
- data/res/generators/templates/application/app/Settings/wait.erb +4 -4
- data/res/generators/templates/application/app/application.rb +8 -0
- data/res/generators/templates/application/app/helpers/browser_helper.rb +13 -0
- data/res/generators/templates/application/app/index.bb.erb +26 -0
- data/res/generators/templates/application/app/index.erb +21 -12
- data/res/generators/templates/application/app/layout.erb +9 -11
- data/res/generators/templates/application/public/css/android.css +285 -0
- data/res/generators/templates/application/public/css/blackberry.css +85 -78
- data/res/generators/templates/application/public/css/iphone.css +286 -296
- data/res/generators/templates/application/public/css/webkit.css +34 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +208 -0
- data/res/generators/templates/application/public/icons/Read me first - license.txt +14 -0
- data/res/generators/templates/application/public/icons/about.png +0 -0
- data/res/generators/templates/application/public/icons/airplane.png +0 -0
- data/res/generators/templates/application/public/icons/baby.png +0 -0
- data/res/generators/templates/application/public/icons/badge.png +0 -0
- data/res/generators/templates/application/public/icons/bandaid.png +0 -0
- data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
- data/res/generators/templates/application/public/icons/battery.png +0 -0
- data/res/generators/templates/application/public/icons/beaker.png +0 -0
- data/res/generators/templates/application/public/icons/beaker2.png +0 -0
- data/res/generators/templates/application/public/icons/beermug.png +0 -0
- data/res/generators/templates/application/public/icons/bird.png +0 -0
- data/res/generators/templates/application/public/icons/book.png +0 -0
- data/res/generators/templates/application/public/icons/bookmark.png +0 -0
- data/res/generators/templates/application/public/icons/brightness.png +0 -0
- data/res/generators/templates/application/public/icons/bug.png +0 -0
- data/res/generators/templates/application/public/icons/cabinet.png +0 -0
- data/res/generators/templates/application/public/icons/calendar.png +0 -0
- data/res/generators/templates/application/public/icons/camera.png +0 -0
- data/res/generators/templates/application/public/icons/changeName.rb +22 -0
- data/res/generators/templates/application/public/icons/chat2.png +0 -0
- data/res/generators/templates/application/public/icons/chicken.png +0 -0
- data/res/generators/templates/application/public/icons/clock.png +0 -0
- data/res/generators/templates/application/public/icons/cloud.png +0 -0
- data/res/generators/templates/application/public/icons/coffee.png +0 -0
- data/res/generators/templates/application/public/icons/compass.png +0 -0
- data/res/generators/templates/application/public/icons/contrast.png +0 -0
- data/res/generators/templates/application/public/icons/dashboard.png +0 -0
- data/res/generators/templates/application/public/icons/display.png +0 -0
- data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
- data/res/generators/templates/application/public/icons/download.png +0 -0
- data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
- data/res/generators/templates/application/public/icons/ekg.png +0 -0
- data/res/generators/templates/application/public/icons/envelope.png +0 -0
- data/res/generators/templates/application/public/icons/equalizer.png +0 -0
- data/res/generators/templates/application/public/icons/eye.png +0 -0
- data/res/generators/templates/application/public/icons/film-roll.png +0 -0
- data/res/generators/templates/application/public/icons/flag.png +0 -0
- data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
- data/res/generators/templates/application/public/icons/fuel.png +0 -0
- data/res/generators/templates/application/public/icons/gameplan.png +0 -0
- data/res/generators/templates/application/public/icons/gear.png +0 -0
- data/res/generators/templates/application/public/icons/gear2.png +0 -0
- data/res/generators/templates/application/public/icons/gift.png +0 -0
- data/res/generators/templates/application/public/icons/heart.png +0 -0
- data/res/generators/templates/application/public/icons/house.png +0 -0
- data/res/generators/templates/application/public/icons/inbox.png +0 -0
- data/res/generators/templates/application/public/icons/index-cards.png +0 -0
- data/res/generators/templates/application/public/icons/iphone.png +0 -0
- data/res/generators/templates/application/public/icons/ipod.png +0 -0
- data/res/generators/templates/application/public/icons/key.png +0 -0
- data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
- data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
- data/res/generators/templates/application/public/icons/line-chart.png +0 -0
- data/res/generators/templates/application/public/icons/location.png +0 -0
- data/res/generators/templates/application/public/icons/lock.png +0 -0
- data/res/generators/templates/application/public/icons/loopback.png +0 -0
- data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
- data/res/generators/templates/application/public/icons/map-marker.png +0 -0
- data/res/generators/templates/application/public/icons/map.png +0 -0
- data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
- data/res/generators/templates/application/public/icons/medical.png +0 -0
- data/res/generators/templates/application/public/icons/microphone.png +0 -0
- data/res/generators/templates/application/public/icons/movie1.png +0 -0
- data/res/generators/templates/application/public/icons/movie2.png +0 -0
- data/res/generators/templates/application/public/icons/network.png +0 -0
- data/res/generators/templates/application/public/icons/note.png +0 -0
- data/res/generators/templates/application/public/icons/outlet.png +0 -0
- data/res/generators/templates/application/public/icons/palette.png +0 -0
- data/res/generators/templates/application/public/icons/paperclip.png +0 -0
- data/res/generators/templates/application/public/icons/phone.png +0 -0
- data/res/generators/templates/application/public/icons/photos.png +0 -0
- data/res/generators/templates/application/public/icons/piano.png +0 -0
- data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
- data/res/generators/templates/application/public/icons/pill.png +0 -0
- data/res/generators/templates/application/public/icons/pin.png +0 -0
- data/res/generators/templates/application/public/icons/pinetree.png +0 -0
- data/res/generators/templates/application/public/icons/planet.png +0 -0
- data/res/generators/templates/application/public/icons/puzzle.png +0 -0
- data/res/generators/templates/application/public/icons/radar.png +0 -0
- data/res/generators/templates/application/public/icons/redo.png +0 -0
- data/res/generators/templates/application/public/icons/refresh.png +0 -0
- data/res/generators/templates/application/public/icons/runner.png +0 -0
- data/res/generators/templates/application/public/icons/shoebox.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
- data/res/generators/templates/application/public/icons/shuffle.png +0 -0
- data/res/generators/templates/application/public/icons/signpost.png +0 -0
- data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
- data/res/generators/templates/application/public/icons/skull.png +0 -0
- data/res/generators/templates/application/public/icons/sliders.png +0 -0
- data/res/generators/templates/application/public/icons/spraycan.png +0 -0
- data/res/generators/templates/application/public/icons/squiggle.png +0 -0
- data/res/generators/templates/application/public/icons/star.png +0 -0
- data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
- data/res/generators/templates/application/public/icons/suitcase.png +0 -0
- data/res/generators/templates/application/public/icons/tag.png +0 -0
- data/res/generators/templates/application/public/icons/tags.png +0 -0
- data/res/generators/templates/application/public/icons/target.png +0 -0
- data/res/generators/templates/application/public/icons/testtube.png +0 -0
- data/res/generators/templates/application/public/icons/thermometer.png +0 -0
- data/res/generators/templates/application/public/icons/toolbox.png +0 -0
- data/res/generators/templates/application/public/icons/trophy.png +0 -0
- data/res/generators/templates/application/public/icons/tshirt.png +0 -0
- data/res/generators/templates/application/public/icons/tv.png +0 -0
- data/res/generators/templates/application/public/icons/umbrella.png +0 -0
- data/res/generators/templates/application/public/icons/walk.png +0 -0
- data/res/generators/templates/application/public/icons/weather.png +0 -0
- data/res/generators/templates/application/public/icons/widescreen.png +0 -0
- data/res/generators/templates/application/public/icons/wineglass.png +0 -0
- data/res/generators/templates/application/public/icons/zap.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_check_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_check_on.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_on.png +0 -0
- data/res/generators/templates/application/public/images/android/ic_menu_more.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure_detail.png +0 -0
- data/res/generators/templates/application/public/images/iphone/radiobutton.png +0 -0
- data/res/generators/templates/application/public/images/iphone/select.png +0 -0
- data/res/generators/templates/application/public/images/iphone/switch.png +0 -0
- data/res/generators/templates/application/public/images/listArrow.png +0 -0
- data/res/generators/templates/application/public/images/listArrowDown.png +0 -0
- data/res/generators/templates/model/controller.rb +2 -0
- data/res/generators/templates/model/edit.bb.erb +24 -0
- data/res/generators/templates/model/edit.erb +21 -25
- data/res/generators/templates/model/index.bb.erb +21 -0
- data/res/generators/templates/model/index.erb +28 -14
- data/res/generators/templates/model/new.bb.erb +24 -0
- data/res/generators/templates/model/new.erb +20 -20
- data/res/generators/templates/model/show.bb.erb +21 -0
- data/res/generators/templates/model/show.erb +15 -15
- data/rhobuild.yml +37 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/Account/config.rb +57 -1
- data/spec/framework_spec/app/Case/config.rb +1 -1
- data/spec/framework_spec/app/Customer/config.rb +1 -1
- data/spec/framework_spec/app/Product/config.rb +15 -1
- data/spec/framework_spec/app/spec/fixtures/object_values.txt +90 -90
- data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +91 -91
- data/spec/framework_spec/app/spec/rho_spec.rb +1 -1
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +47 -28
- data/spec/framework_spec/app/spec/rhom_spec.rb +8 -8
- data/spec/framework_spec/app/spec/spec_helper.rb +13 -5
- data/spec/framework_spec/app/spec_runner.rb +5 -4
- data/spec/framework_spec/public/css/base.css +0 -1
- data/spec/framework_spec/public/css/iphone.css +0 -1
- data/spec/framework_spec/rhoconfig.txt +3 -1
- metadata +220 -37
- data/platform/bb/rhodes/src/rhomobile/WebView.java +0 -90
- data/platform/iphone/Classes/BarItem.h +0 -27
- data/platform/iphone/Classes/BarItem.m +0 -32
- data/platform/iphone/Classes/JSString.h +0 -12
- data/platform/iphone/Classes/JSString.m +0 -7
- data/platform/iphone/Classes/RhoRunnerAppDelegate.h +0 -48
- data/platform/iphone/Classes/RhoRunnerAppDelegate.m +0 -617
- data/platform/iphone/Classes/Server/ServerHost.h +0 -81
- data/platform/iphone/Classes/Server/ServerHost.m +0 -597
- data/platform/iphone/Classes/Server/WebViewUrl.h +0 -13
- data/platform/iphone/Classes/Server/WebViewUrl.m +0 -8
- data/platform/iphone/Classes/TabBarDelegate.h +0 -39
- data/platform/iphone/Classes/TabBarDelegate.m +0 -151
- data/platform/iphone/Classes/Utils/unzip.cpp +0 -4328
- data/platform/iphone/Classes/Utils/unzip.h +0 -234
- data/platform/iphone/Classes/WebViewController.h +0 -59
- data/platform/iphone/Classes/WebViewController.m +0 -472
- data/platform/wm/rhodes/GetURLDialog.cpp +0 -64
- data/platform/wm/rhodes/GetURLDialog.h +0 -39
- data/res/generators/templates/application/public/css/base.css +0 -39
- data/res/generators/templates/application/public/css/rho.css +0 -3
- data/res/generators/templates/application/public/css/xhtml.css +0 -114
- data/spec/framework_spec/app/Question/config.rb +0 -3
- data/spec/generator_spec/source_generator_spec.rb +0 -27
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
============================================================================
|
3
|
+
Author : Dmitry Moskalchuk
|
4
|
+
Version : 2.0
|
5
|
+
Copyright : Copyright (C) 2008 Rhomobile. All rights reserved.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
============================================================================
|
20
|
+
*/
|
21
|
+
package com.rhomobile.rhodes.uri;
|
22
|
+
|
23
|
+
import com.rhomobile.rhodes.Logger;
|
24
|
+
|
25
|
+
import android.content.Context;
|
26
|
+
import android.content.Intent;
|
27
|
+
import android.net.Uri;
|
28
|
+
import android.webkit.MimeTypeMap;
|
29
|
+
|
30
|
+
public class VideoUriHandler implements UriHandler {
|
31
|
+
|
32
|
+
private static final String TAG = "VideoUriHandler";
|
33
|
+
|
34
|
+
private Context ctx;
|
35
|
+
|
36
|
+
public VideoUriHandler(Context c) {
|
37
|
+
ctx = c;
|
38
|
+
}
|
39
|
+
|
40
|
+
public boolean handle(String url) {
|
41
|
+
String ext = MimeTypeMap.getFileExtensionFromUrl(url);
|
42
|
+
if (ext == null || ext.length() == 0)
|
43
|
+
return false;
|
44
|
+
|
45
|
+
MimeTypeMap mt = MimeTypeMap.getSingleton();
|
46
|
+
String mimeType = mt.getMimeTypeFromExtension(ext);
|
47
|
+
if (mimeType == null)
|
48
|
+
return false;
|
49
|
+
|
50
|
+
if (!mimeType.startsWith("video/"))
|
51
|
+
return false;
|
52
|
+
|
53
|
+
Logger.D(TAG, "This is video url, handle it");
|
54
|
+
|
55
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
56
|
+
intent.setDataAndType(Uri.parse(url), mimeType);
|
57
|
+
ctx.startActivity(Intent.createChooser(intent, "Choose video player"));
|
58
|
+
return true;
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java
|
2
|
+
platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java
|
2
3
|
platform/android/Rhodes/src/com/rhomobile/rhodes/HttpLog.java
|
3
4
|
platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java
|
4
5
|
platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java
|
@@ -6,6 +7,7 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkConnectivityListener.jav
|
|
6
7
|
platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkStateTracker.java
|
7
8
|
platform/android/Rhodes/src/com/rhomobile/rhodes/RhoConf.java
|
8
9
|
platform/android/Rhodes/src/com/rhomobile/rhodes/RhoLogConf.java
|
10
|
+
platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java
|
9
11
|
platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java
|
10
12
|
platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesInstance.java
|
11
13
|
platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java
|
@@ -40,3 +42,4 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java
|
|
40
42
|
platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java
|
41
43
|
platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java
|
42
44
|
platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java
|
45
|
+
platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java
|
@@ -25,6 +25,15 @@ end
|
|
25
25
|
# command "android list targets"
|
26
26
|
ANDROID_API_LEVEL = 3
|
27
27
|
|
28
|
+
ANDROID_PERMISSIONS = {
|
29
|
+
'camera' => 'CAMERA',
|
30
|
+
'gps' => 'ACCESS_FINE_LOCATION',
|
31
|
+
'network_state' => 'ACCESS_NETWORK_STATE',
|
32
|
+
'phone' => ['CALL_PHONE', 'READ_PHONE_STATE'],
|
33
|
+
'pim' => ['READ_CONTACTS', 'WRITE_CONTACTS'],
|
34
|
+
'vibrate' => 'VIBRATE'
|
35
|
+
}
|
36
|
+
|
28
37
|
def get_sources(name)
|
29
38
|
File.read(File.join($builddir, name + '_build.files')).split("\n")
|
30
39
|
end
|
@@ -47,10 +56,49 @@ def set_app_name_android(newname)
|
|
47
56
|
doc.elements["resources/string[@name='app_name']"].text = newname
|
48
57
|
File.open(appstrings, "w") { |f| doc.write f }
|
49
58
|
|
59
|
+
version = {'major' => 0, 'minor' => 0, 'patch' => 0}
|
60
|
+
if $app_config["version"]
|
61
|
+
if $app_config["version"] =~ /^(\d+)$/
|
62
|
+
version["major"] = $1.to_i
|
63
|
+
elsif $app_config["version"] =~ /^(\d+)\.(\d+)$/
|
64
|
+
version["major"] = $1.to_i
|
65
|
+
version["minor"] = $2.to_i
|
66
|
+
elsif $app_config["version"] =~ /^(\d+)\.(\d+)\.(\d+)$/
|
67
|
+
version["major"] = $1.to_i
|
68
|
+
version["minor"] = $2.to_i
|
69
|
+
version["patch"] = $3.to_i
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
version = version["major"]*10000 + version["minor"]*100 + version["patch"]
|
74
|
+
|
50
75
|
doc = REXML::Document.new(File.new($rhomanifest))
|
51
76
|
doc.root.attributes['package'] = $app_package_name
|
77
|
+
if version > 0
|
78
|
+
doc.root.attributes['android:versionCode'] = version.to_s
|
79
|
+
doc.root.attributes['android:versionName'] = $app_config["version"]
|
80
|
+
end
|
52
81
|
doc.elements.delete "manifest/application/uses-library[@android:name='com.google.android.maps']" unless $use_geomapping
|
53
|
-
|
82
|
+
|
83
|
+
caps = ['INTERNET']
|
84
|
+
$app_config["capabilities"].each do |cap|
|
85
|
+
cap = ANDROID_PERMISSIONS[cap]
|
86
|
+
next if cap.nil?
|
87
|
+
cap = [cap] if cap.is_a? String
|
88
|
+
cap = [] unless cap.is_a? Array
|
89
|
+
caps += cap
|
90
|
+
end
|
91
|
+
caps.uniq!
|
92
|
+
|
93
|
+
manifest = doc.elements["manifest"]
|
94
|
+
manifest.elements.each('uses-permission') { |e| manifest.delete e }
|
95
|
+
caps.each do |cap|
|
96
|
+
element = REXML::Element.new('uses-permission')
|
97
|
+
element.add_attribute('android:name', "android.permission.#{cap}")
|
98
|
+
manifest.add element
|
99
|
+
end
|
100
|
+
|
101
|
+
File.open($appmanifest, "w") { |f| doc.write f, 2 }
|
54
102
|
|
55
103
|
buf = File.new($rho_android_r,"r").read.gsub(/^\s*import com\.rhomobile\..*\.R;\s*$/,"\nimport #{$app_package_name}.R;\n")
|
56
104
|
File.open($app_android_r,"w") { |f| f.write(buf) }
|
@@ -125,6 +173,8 @@ namespace "config" do
|
|
125
173
|
$rhores = File.join $androidpath, "Rhodes", "res"
|
126
174
|
$appres = File.join $tmpdir, "res"
|
127
175
|
|
176
|
+
$appincdir = File.join $tmpdir, "include"
|
177
|
+
|
128
178
|
$rho_android_r = File.join $androidpath, "Rhodes", "src", "com", "rhomobile", "rhodes", "AndroidR.java"
|
129
179
|
$app_android_r = File.join $tmpdir, "AndroidR.java"
|
130
180
|
$app_rjava_dir = File.join $tmpdir
|
@@ -291,11 +341,21 @@ namespace "config" do
|
|
291
341
|
|
292
342
|
$extensionsdir = $bindir + "/libs/" + $confdir + "/extensions"
|
293
343
|
|
344
|
+
$app_config["extensions"] = [] if $app_config["extensions"].nil?
|
345
|
+
$app_config["extensions"] = [] unless $app_config["extensions"].is_a? Array
|
294
346
|
if $app_config["android"] and $app_config["android"]["extensions"]
|
295
|
-
$app_config["extensions"] += $app_config["android"]["extensions"]
|
347
|
+
$app_config["extensions"] += $app_config["android"]["extensions"]
|
296
348
|
$app_config["android"]["extensions"] = nil
|
297
349
|
end
|
298
350
|
|
351
|
+
$app_config["capabilities"] = [] if $app_config["capabilities"].nil?
|
352
|
+
$app_config["capabilities"] = [] unless $app_config["capabilities"].is_a? Array
|
353
|
+
if $app_config["android"] and $app_config["android"]["capabilities"]
|
354
|
+
$app_config["capabilities"] += $app_config["android"]["capabilities"]
|
355
|
+
$app_config["android"]["capabilities"] = nil
|
356
|
+
end
|
357
|
+
$app_config["capabilities"].map! { |cap| cap.is_a?(String) ? cap : nil }.delete_if { |cap| cap.nil? }
|
358
|
+
|
299
359
|
mkdir_p $bindir if not File.exists? $bindir
|
300
360
|
mkdir_p $rhobindir if not File.exists? $rhobindir
|
301
361
|
mkdir_p $targetdir if not File.exists? $targetdir
|
@@ -328,7 +388,7 @@ namespace "build" do
|
|
328
388
|
|
329
389
|
end
|
330
390
|
# desc "Build RhoBundle for android"
|
331
|
-
task :rhobundle => ["config:android","build:bundle:noxruby",:
|
391
|
+
task :rhobundle => ["config:android","build:bundle:noxruby",:extensions,:librhodes] do
|
332
392
|
# Rake::Task["build:bundle:noxruby"].execute
|
333
393
|
|
334
394
|
assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
|
@@ -345,62 +405,35 @@ namespace "build" do
|
|
345
405
|
File.open(File.join(assets, "name"), "w") { |f| f.write($appname) }
|
346
406
|
end
|
347
407
|
|
348
|
-
task :generate_sources => "config:android" do
|
349
|
-
# Generate gapikey.h
|
350
|
-
gapikey_h = File.join($androidpath, "Rhodes", "jni", "include", "gapikey.h")
|
351
|
-
gapi_defined = false
|
352
|
-
if File.file? gapikey_h
|
353
|
-
File.open(gapikey_h, 'r') do |f|
|
354
|
-
while line = f.gets
|
355
|
-
gapi_defined = true if line =~ /GOOGLE_API_KEY/
|
356
|
-
break if gapi_defined
|
357
|
-
end
|
358
|
-
end
|
359
|
-
end
|
360
|
-
|
361
|
-
if $use_geomapping != gapi_defined or not File.file? gapikey_h
|
362
|
-
File.open(gapikey_h, 'w') do |f|
|
363
|
-
f.puts "#ifndef RHO_GAPIKEY_H_411BFA4742CF4F2AAA3F6B411ED7514F"
|
364
|
-
f.puts "#define RHO_GAPIKEY_H_411BFA4742CF4F2AAA3F6B411ED7514F"
|
365
|
-
f.puts "#define GOOGLE_API_KEY \"#{$gapikey}\"" if $use_geomapping and !$gapikey.nil?
|
366
|
-
f.puts "#endif /* RHO_GAPIKEY_H_411BFA4742CF4F2AAA3F6B411ED7514F */"
|
367
|
-
end
|
368
|
-
end
|
369
|
-
end
|
370
|
-
|
371
408
|
task :extensions => "config:android" do
|
372
409
|
|
410
|
+
ENV['RHO_PLATFORM'] = 'android'
|
373
411
|
ENV["ANDROID_NDK"] = $androidndkpath
|
374
412
|
ENV["ANDROID_API_LEVEL"] = ANDROID_API_LEVEL.to_s
|
375
413
|
ENV["TARGET_TEMP_DIR"] = $extensionsdir
|
376
|
-
ENV["
|
414
|
+
ENV["RHODES_ROOT_DIR"] = $startdir
|
377
415
|
ENV["BUILD_DIR"] ||= $startdir + "/platform/android/build"
|
378
416
|
|
379
417
|
mkdir_p $bindir + "/libs/" + $confdir + "/extensions" unless File.exist? $bindir + "/libs/" + $confdir + "/extensions"
|
380
418
|
|
381
419
|
$app_config["extensions"].each do |ext|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
420
|
+
$app_config["extpaths"].each do |p|
|
421
|
+
extpath = File.join(p, ext, 'ext')
|
422
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
423
|
+
next unless File.exists? File.join(extpath, 'build.bat')
|
424
|
+
else
|
425
|
+
next unless File.executable? File.join(extpath, 'build')
|
426
|
+
end
|
387
427
|
|
388
|
-
|
389
|
-
puts rhoextpath
|
428
|
+
ENV['TEMP_FILES_DIR'] = File.join(ENV["TARGET_TEMP_DIR"], ext)
|
390
429
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
if RUBY_PLATFORM =~ /(win|w)32$/
|
398
|
-
puts Jake.run('build.bat', [], extpath) if File.exists? File.join(extpath, 'build.bat')
|
399
|
-
else
|
400
|
-
puts Jake.run('./build', [], extpath) if File.executable? File.join(extpath, 'build')
|
430
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
431
|
+
puts Jake.run('build.bat', [], extpath)
|
432
|
+
else
|
433
|
+
puts Jake.run('./build', [], extpath)
|
434
|
+
end
|
435
|
+
exit 1 unless $? == 0
|
401
436
|
end
|
402
|
-
exit 1 unless $? == 0
|
403
|
-
|
404
437
|
end
|
405
438
|
|
406
439
|
end
|
@@ -586,13 +619,94 @@ namespace "build" do
|
|
586
619
|
|
587
620
|
task :libs => [:libsqlite, :libcurl, :libruby, :libjson, :libstlport, :librhodb, :librhocommon, :librhomain, :librhosync, :librholog]
|
588
621
|
|
589
|
-
task :
|
622
|
+
task :genconfig => "config:android" do
|
623
|
+
mkdir_p $appincdir unless File.directory? $appincdir
|
624
|
+
|
625
|
+
# Generate genconfig.h
|
626
|
+
genconfig_h = File.join($appincdir, 'genconfig.h')
|
627
|
+
|
628
|
+
gapi_already_enabled = false
|
629
|
+
caps_already_enabled = {}
|
630
|
+
ANDROID_PERMISSIONS.keys.each do |k|
|
631
|
+
caps_already_enabled[k] = false
|
632
|
+
end
|
633
|
+
if File.file? genconfig_h
|
634
|
+
File.open(genconfig_h, 'r') do |f|
|
635
|
+
while line = f.gets
|
636
|
+
if line =~ /^\s*#\s*define\s+RHO_GOOGLE_API_KEY\s+"[^"]*"\s*$/
|
637
|
+
gapi_already_enabled = true
|
638
|
+
else
|
639
|
+
ANDROID_PERMISSIONS.keys.each do |k|
|
640
|
+
re = /^\s*#\s*define\s+RHO_CAP_#{k.upcase}_ENABLED\s+true\s*$/
|
641
|
+
caps_already_enabled[k] = true if line =~ re
|
642
|
+
end
|
643
|
+
end
|
644
|
+
end
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
regenerate = false
|
649
|
+
regenerate = true unless File.file? genconfig_h
|
650
|
+
regenerate = $use_geomapping != gapi_already_enabled unless regenerate
|
651
|
+
|
652
|
+
caps_enabled = {}
|
653
|
+
ANDROID_PERMISSIONS.keys.each do |k|
|
654
|
+
caps_enabled[k] = $app_config["capabilities"].index(k) != nil
|
655
|
+
regenerate = true if caps_enabled[k] != caps_already_enabled[k]
|
656
|
+
end
|
657
|
+
|
658
|
+
if regenerate
|
659
|
+
puts "Need to regenerate genconfig.h"
|
660
|
+
$stdout.flush
|
661
|
+
File.open(genconfig_h, 'w') do |f|
|
662
|
+
f.puts "#ifndef RHO_GENCONFIG_H_411BFA4742CF4F2AAA3F6B411ED7514F"
|
663
|
+
f.puts "#define RHO_GENCONFIG_H_411BFA4742CF4F2AAA3F6B411ED7514F"
|
664
|
+
f.puts ""
|
665
|
+
f.puts "#define RHO_GOOGLE_API_KEY \"#{$gapikey}\"" if $use_geomapping and !$gapikey.nil?
|
666
|
+
caps_enabled.each do |k,v|
|
667
|
+
f.puts "#define RHO_CAP_#{k.upcase}_ENABLED #{v ? "true" : "false"}"
|
668
|
+
end
|
669
|
+
f.puts ""
|
670
|
+
f.puts "#endif /* RHO_GENCONFIG_H_411BFA4742CF4F2AAA3F6B411ED7514F */"
|
671
|
+
end
|
672
|
+
else
|
673
|
+
puts "No need to regenerate genconfig.h"
|
674
|
+
$stdout.flush
|
675
|
+
end
|
676
|
+
|
677
|
+
# Generate rhocaps.inc
|
678
|
+
rhocaps_inc = File.join($appincdir, 'rhocaps.inc')
|
679
|
+
caps_already_defined = []
|
680
|
+
if File.exists? rhocaps_inc
|
681
|
+
File.open(rhocaps_inc, 'r') do |f|
|
682
|
+
while line = f.gets
|
683
|
+
next unless line =~ /^\s*RHO_DEFINE_CAP\s*\(\s*([A-Z_]*)\s*\)\s*\s*$/
|
684
|
+
caps_already_defined << $1.downcase
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
|
689
|
+
if caps_already_defined.sort.uniq != ANDROID_PERMISSIONS.keys.sort.uniq
|
690
|
+
puts "Need to regenerate rhocaps.inc"
|
691
|
+
$stdout.flush
|
692
|
+
File.open(rhocaps_inc, 'w') do |f|
|
693
|
+
ANDROID_PERMISSIONS.keys.each do |k|
|
694
|
+
f.puts "RHO_DEFINE_CAP(#{k.upcase})"
|
695
|
+
end
|
696
|
+
end
|
697
|
+
else
|
698
|
+
puts "No need to regenerate rhocaps.inc"
|
699
|
+
$stdout.flush
|
700
|
+
end
|
701
|
+
end
|
702
|
+
|
703
|
+
task :librhodes => [:libs, :genconfig] do
|
590
704
|
srcdir = File.join $androidpath, "Rhodes", "jni", "src"
|
591
|
-
|
592
|
-
objdir = File.join $rhobindir, $confdir, "librhodes"
|
705
|
+
objdir = File.join $bindir, "libs", $confdir, "librhodes"
|
593
706
|
libname = File.join $bindir, "libs", $confdir, "librhodes.so"
|
594
707
|
|
595
708
|
args = []
|
709
|
+
args << "-I#{$appincdir}"
|
596
710
|
args << "-I#{srcdir}/../include"
|
597
711
|
args << "-I#{$shareddir}"
|
598
712
|
args << "-I#{$shareddir}/sqlite"
|
@@ -936,27 +1050,26 @@ namespace "run" do
|
|
936
1050
|
puts `"#{$adb}" -e wait-for-device`
|
937
1051
|
|
938
1052
|
puts "Loading package into emulator"
|
939
|
-
theoutput = `"#{$adb}" -e install -r "#{apkfile}"`
|
940
1053
|
count = 0
|
941
1054
|
done = false
|
942
|
-
while count <
|
943
|
-
|
944
|
-
|
945
|
-
|
1055
|
+
while count < 20
|
1056
|
+
f = Jake.run2($adb, ["-e", "install", "-r", apkfile], {:nowait => true})
|
1057
|
+
theoutput = ""
|
1058
|
+
while c = f.getc
|
1059
|
+
$stdout.putc c
|
1060
|
+
$stdout.flush
|
1061
|
+
theoutput << c
|
1062
|
+
end
|
1063
|
+
f.close
|
946
1064
|
|
947
1065
|
if theoutput.to_s.match(/Success/)
|
948
1066
|
done = true
|
949
1067
|
break
|
950
1068
|
end
|
951
1069
|
|
952
|
-
if theoutput.to_s.match(/Failure/)
|
953
|
-
done = false
|
954
|
-
break
|
955
|
-
end
|
956
|
-
|
957
1070
|
puts "Failed to load (possibly because emulator not done launching)- retrying"
|
958
1071
|
$stdout.flush
|
959
|
-
sleep
|
1072
|
+
sleep 1
|
960
1073
|
count += 1
|
961
1074
|
end
|
962
1075
|
puts "Loading complete, you may now run the application" if done
|
@@ -117,8 +117,7 @@ def cc_run(command, args, chdir = nil)
|
|
117
117
|
end
|
118
118
|
ret = $?
|
119
119
|
FileUtils.cd save_cwd
|
120
|
-
|
121
|
-
ret.success?
|
120
|
+
ret == 0
|
122
121
|
end
|
123
122
|
|
124
123
|
def cc_compile(filename, objdir, additional = nil)
|
@@ -1,9 +1,11 @@
|
|
1
|
+
platform/shared/common/AppMenu.cpp
|
1
2
|
platform/shared/common/PosixThreadImpl.cpp
|
2
3
|
platform/shared/common/RhoConf.cpp
|
3
4
|
platform/shared/common/RhoFile.cpp
|
4
5
|
platform/shared/common/RhoThread.cpp
|
5
6
|
platform/shared/common/SplashScreen.cpp
|
6
7
|
platform/shared/common/Tokenizer.cpp
|
8
|
+
platform/shared/common/AppMenu.cpp
|
7
9
|
platform/shared/common/rhoparams.c
|
8
10
|
platform/shared/net/AsyncHttp.cpp
|
9
11
|
platform/shared/net/CURLNetRequest.cpp
|
@@ -11,5 +13,8 @@ platform/shared/net/HttpServer.cpp
|
|
11
13
|
platform/shared/net/URI.cpp
|
12
14
|
platform/shared/net/ssl.cpp
|
13
15
|
platform/shared/rubyext/GeoLocation.cpp
|
16
|
+
platform/shared/rubyext/RhoRuby.cpp
|
14
17
|
platform/shared/rubyext/System.cpp
|
18
|
+
platform/shared/rubyext/RhoRuby.cpp
|
15
19
|
platform/shared/statistic/RhoProfiler.cpp
|
20
|
+
platform/shared/unzip/unzip.cpp
|
@@ -7,7 +7,9 @@ platform/android/Rhodes/jni/src/geolocation.cpp
|
|
7
7
|
platform/android/Rhodes/jni/src/logconf.cpp
|
8
8
|
platform/android/Rhodes/jni/src/logger.cpp
|
9
9
|
platform/android/Rhodes/jni/src/mapview.cpp
|
10
|
+
platform/android/Rhodes/jni/src/menu.cpp
|
10
11
|
platform/android/Rhodes/jni/src/nativebar.cpp
|
12
|
+
platform/android/Rhodes/jni/src/navbar.cpp
|
11
13
|
platform/android/Rhodes/jni/src/phonebook.cpp
|
12
14
|
platform/android/Rhodes/jni/src/rhoconf.cpp
|
13
15
|
platform/android/Rhodes/jni/src/rhodes.cpp
|