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
@@ -26,7 +26,11 @@ public final class AndroidR {
|
|
26
26
|
public static final class attr {
|
27
27
|
}
|
28
28
|
public static final class drawable {
|
29
|
+
public static final int alert_alert=R.drawable.alert_alert;
|
30
|
+
public static final int alert_info=R.drawable.alert_info;
|
31
|
+
public static final int alert_question=R.drawable.alert_question;
|
29
32
|
public static final int back=R.drawable.back;
|
33
|
+
public static final int camera=R.drawable.camera;
|
30
34
|
public static final int exit=R.drawable.exit;
|
31
35
|
public static final int home=R.drawable.home;
|
32
36
|
public static final int icon=R.drawable.icon;
|
@@ -38,34 +42,25 @@ public final class AndroidR {
|
|
38
42
|
public static final int sync=R.drawable.sync;
|
39
43
|
}
|
40
44
|
public static final class id {
|
41
|
-
public static final int about=R.id.about;
|
42
45
|
public static final int buttonLayout=R.id.buttonLayout;
|
46
|
+
public static final int cameraButton=R.id.cameraButton;
|
43
47
|
public static final int cancelButton=R.id.cancelButton;
|
44
48
|
public static final int excludeClasses=R.id.excludeClasses;
|
45
|
-
public static final int exit=R.id.exit;
|
46
49
|
public static final int filesList=R.id.filesList;
|
47
50
|
public static final int includeClasses=R.id.includeClasses;
|
48
51
|
public static final int logcontent=R.id.logcontent;
|
49
52
|
public static final int loglevel=R.id.loglevel;
|
50
|
-
public static final int logoptions=R.id.logoptions;
|
51
53
|
public static final int logoptsCloseButton=R.id.logoptsCloseButton;
|
52
54
|
public static final int logoptsSaveButton=R.id.logoptsSaveButton;
|
53
|
-
public static final int logview=R.id.logview;
|
54
55
|
public static final int logviewClearButton=R.id.logviewClearButton;
|
55
56
|
public static final int logviewSendButton=R.id.logviewSendButton;
|
56
57
|
public static final int logviewCloseButton=R.id.logviewCloseButton;
|
57
58
|
public static final int logviewRefreshButton=R.id.logviewRefreshButton;
|
58
59
|
public static final int lookIn=R.id.lookIn;
|
59
|
-
public static final int navigation_back=R.id.navigation_back;
|
60
|
-
public static final int navigation_forward=R.id.navigation_forward;
|
61
|
-
public static final int navigation_home=R.id.navigation_home;
|
62
60
|
public static final int okButton=R.id.okButton;
|
63
|
-
public static final int options=R.id.options;
|
64
61
|
public static final int preview=R.id.preview;
|
65
|
-
public static final int refresh=R.id.refresh;
|
66
62
|
public static final int scrollview=R.id.scrollview;
|
67
63
|
public static final int surface=R.id.surface;
|
68
|
-
public static final int sync=R.id.sync;
|
69
64
|
public static final int text=R.id.text;
|
70
65
|
public static final int text1=R.id.text1;
|
71
66
|
public static final int widget28=R.id.widget28;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
package com.rhomobile.rhodes;
|
2
|
+
|
3
|
+
public class Capabilities {
|
4
|
+
|
5
|
+
public static boolean CAMERA_ENABLED = true;
|
6
|
+
public static boolean GPS_ENABLED = true;
|
7
|
+
public static boolean NETWORK_STATE_ENABLED = true;
|
8
|
+
public static boolean PHONE_ENABLED = true;
|
9
|
+
public static boolean PIM_ENABLED = true;
|
10
|
+
public static boolean VIBRATE_ENABLED = true;
|
11
|
+
|
12
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
package com.rhomobile.rhodes;
|
2
|
+
|
3
|
+
import java.util.HashMap;
|
4
|
+
import java.util.Map;
|
5
|
+
|
6
|
+
import com.rhomobile.rhodes.mainview.MainView;
|
7
|
+
|
8
|
+
import android.view.Menu;
|
9
|
+
import android.view.MenuItem;
|
10
|
+
|
11
|
+
public class RhoMenu {
|
12
|
+
|
13
|
+
private static final String TAG = "Menu";
|
14
|
+
|
15
|
+
private static class Item
|
16
|
+
{
|
17
|
+
public String type;
|
18
|
+
public String url;
|
19
|
+
|
20
|
+
public Item(String t, String u) {
|
21
|
+
type = t;
|
22
|
+
url = u;
|
23
|
+
}
|
24
|
+
};
|
25
|
+
|
26
|
+
private Map<MenuItem, Item> items;
|
27
|
+
|
28
|
+
private native long allocMenu();
|
29
|
+
private native void deallocMenu(long menu);
|
30
|
+
|
31
|
+
private native int getMenuSize(long menu);
|
32
|
+
private native String getMenuItemLabel(long menu, int index);
|
33
|
+
private native String getMenuItemType(long menu, int index);
|
34
|
+
private native String getMenuItemUrl(long menu, int index);
|
35
|
+
|
36
|
+
public RhoMenu(Menu menu) {
|
37
|
+
menu.clear();
|
38
|
+
items = new HashMap<MenuItem, Item>();
|
39
|
+
|
40
|
+
long m = allocMenu();
|
41
|
+
for (int i = 0, lim = getMenuSize(m); i < lim; ++i) {
|
42
|
+
String type = getMenuItemType(m, i);
|
43
|
+
String url = getMenuItemUrl(m, i);
|
44
|
+
String label = getMenuItemLabel(m, i);
|
45
|
+
if (type.equalsIgnoreCase("unknown"))
|
46
|
+
continue;
|
47
|
+
|
48
|
+
MenuItem item = menu.add(label);
|
49
|
+
items.put(item, new Item(type, url));
|
50
|
+
}
|
51
|
+
deallocMenu(m);
|
52
|
+
}
|
53
|
+
|
54
|
+
public boolean onMenuItemSelected(MenuItem item) {
|
55
|
+
Object obj = items.get(item);
|
56
|
+
if (obj == null || !(obj instanceof Item)) {
|
57
|
+
Logger.E(TAG, "Unknown MenuItem");
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
|
61
|
+
Item ri = (Item)obj;
|
62
|
+
|
63
|
+
Rhodes r = RhodesInstance.getInstance();
|
64
|
+
MainView mainView = r.getMainView();
|
65
|
+
|
66
|
+
String type = ri.type;
|
67
|
+
if (type.equalsIgnoreCase("refresh")) {
|
68
|
+
mainView.reload(mainView.activeTab());
|
69
|
+
}
|
70
|
+
else if (type.equalsIgnoreCase("home")) {
|
71
|
+
mainView.navigate(r.getStartUrl(), mainView.activeTab());
|
72
|
+
}
|
73
|
+
else if (type.equalsIgnoreCase("back")) {
|
74
|
+
mainView.back(mainView.activeTab());
|
75
|
+
}
|
76
|
+
else if (type.equalsIgnoreCase("forward")) {
|
77
|
+
mainView.forward(mainView.activeTab());
|
78
|
+
}
|
79
|
+
else if (type.equalsIgnoreCase("options")) {
|
80
|
+
mainView.navigate(r.getOptionsUrl(), mainView.activeTab());
|
81
|
+
}
|
82
|
+
else if (type.equalsIgnoreCase("sync")) {
|
83
|
+
r.doSyncAllSources(true);
|
84
|
+
}
|
85
|
+
else if (type.equalsIgnoreCase("log")) {
|
86
|
+
Rhodes.showLogView();
|
87
|
+
}
|
88
|
+
else if (type.equalsIgnoreCase("logOptions")) {
|
89
|
+
Rhodes.showLogOptions();
|
90
|
+
}
|
91
|
+
else if (type.equalsIgnoreCase("close") || type.equalsIgnoreCase("exit")) {
|
92
|
+
Rhodes.exit();
|
93
|
+
}
|
94
|
+
else if (type.equalsIgnoreCase("url")) {
|
95
|
+
String url = ri.url;
|
96
|
+
mainView.navigate(r.normalizeUrl(url), mainView.activeTab());
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
Logger.E(TAG, "Unknown type of menu item: \"" + type + "\"");
|
100
|
+
return false;
|
101
|
+
}
|
102
|
+
return true;
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
@@ -22,8 +22,9 @@ package com.rhomobile.rhodes;
|
|
22
22
|
|
23
23
|
import java.io.File;
|
24
24
|
import java.io.IOException;
|
25
|
-
import java.util.
|
25
|
+
import java.util.Enumeration;
|
26
26
|
import java.util.Locale;
|
27
|
+
import java.util.Vector;
|
27
28
|
|
28
29
|
import com.rhomobile.rhodes.Utils.AssetsSource;
|
29
30
|
import com.rhomobile.rhodes.Utils.FileSource;
|
@@ -35,26 +36,25 @@ import com.rhomobile.rhodes.ui.LogViewDialog;
|
|
35
36
|
import com.rhomobile.rhodes.uri.MailUriHandler;
|
36
37
|
import com.rhomobile.rhodes.uri.TelUriHandler;
|
37
38
|
import com.rhomobile.rhodes.uri.UriHandler;
|
39
|
+
import com.rhomobile.rhodes.uri.VideoUriHandler;
|
38
40
|
|
39
41
|
import android.app.Activity;
|
40
|
-
import android.app.AlertDialog;
|
41
42
|
import android.content.Context;
|
42
|
-
import android.content.DialogInterface;
|
43
43
|
import android.content.pm.ActivityInfo;
|
44
44
|
import android.content.res.Configuration;
|
45
45
|
import android.graphics.Bitmap;
|
46
46
|
import android.net.ConnectivityManager;
|
47
47
|
import android.net.NetworkInfo;
|
48
|
-
import android.
|
48
|
+
import android.os.Build;
|
49
49
|
import android.os.Bundle;
|
50
50
|
import android.os.Environment;
|
51
51
|
import android.os.Handler;
|
52
52
|
import android.telephony.TelephonyManager;
|
53
|
+
import android.util.DisplayMetrics;
|
53
54
|
import android.util.Log;
|
54
55
|
import android.view.Display;
|
55
56
|
import android.view.KeyEvent;
|
56
57
|
import android.view.Menu;
|
57
|
-
import android.view.MenuInflater;
|
58
58
|
import android.view.MenuItem;
|
59
59
|
import android.view.View;
|
60
60
|
import android.view.Window;
|
@@ -82,6 +82,9 @@ public class Rhodes extends Activity {
|
|
82
82
|
|
83
83
|
private static int MAX_PROGRESS = 10000;
|
84
84
|
|
85
|
+
private static final String INSTALLING_PAGE = "apps/app/installing.html";
|
86
|
+
private static final String LOADING_PAGE = "apps/app/loading.html";
|
87
|
+
|
85
88
|
private long uiThreadId;
|
86
89
|
public long getUiThreadId() {
|
87
90
|
return uiThreadId;
|
@@ -92,6 +95,9 @@ public class Rhodes extends Activity {
|
|
92
95
|
private static int screenWidth;
|
93
96
|
private static int screenHeight;
|
94
97
|
|
98
|
+
private static float screenPpiX;
|
99
|
+
private static float screenPpiY;
|
100
|
+
|
95
101
|
private static boolean isCameraAvailable;
|
96
102
|
|
97
103
|
private FrameLayout outerFrame;
|
@@ -99,10 +105,13 @@ public class Rhodes extends Activity {
|
|
99
105
|
|
100
106
|
private SplashScreen splashScreen = null;
|
101
107
|
|
102
|
-
private Hashtable<String, UriHandler> uriHandlers = new Hashtable<String, UriHandler>();
|
103
108
|
private Boolean contentChanged = null;
|
104
109
|
|
105
|
-
private
|
110
|
+
private Vector<UriHandler> uriHandlers = new Vector<UriHandler>();
|
111
|
+
|
112
|
+
//private String sdCardError = "Application can not access the SD card while it's mounted. Please unmount the device and stop the adb server before launching the app.";
|
113
|
+
|
114
|
+
private RhoMenu appMenu = null;
|
106
115
|
|
107
116
|
private String rootPath = null;
|
108
117
|
|
@@ -110,7 +119,7 @@ public class Rhodes extends Activity {
|
|
110
119
|
public native void startRhodesApp();
|
111
120
|
public native void stopRhodesApp();
|
112
121
|
|
113
|
-
|
122
|
+
public native void doSyncAllSources(boolean v);
|
114
123
|
|
115
124
|
public native String getOptionsUrl();
|
116
125
|
public native String getStartUrl();
|
@@ -119,24 +128,29 @@ public class Rhodes extends Activity {
|
|
119
128
|
|
120
129
|
public native String normalizeUrl(String url);
|
121
130
|
|
131
|
+
public static native void loadUrl(String url);
|
132
|
+
|
133
|
+
public static native void navigateBack();
|
134
|
+
|
122
135
|
public native void doRequest(String url);
|
123
136
|
|
124
137
|
public native static void makeLink(String src, String dst);
|
125
138
|
|
126
139
|
private void initRootPath() {
|
127
|
-
|
128
|
-
|
140
|
+
Log.d(TAG, "Check if the SD card is mounted...");
|
141
|
+
String state = Environment.getExternalStorageState();
|
142
|
+
Log.d(TAG, "Storage state: " + state);
|
143
|
+
boolean hasSDCard = Environment.MEDIA_MOUNTED.equals(state);
|
144
|
+
rootPath = hasSDCard ? sdcardRootPath() : phoneMemoryRootPath();
|
129
145
|
}
|
130
146
|
|
131
147
|
public String getRootPath() {
|
132
148
|
return rootPath;
|
133
149
|
}
|
134
150
|
|
135
|
-
/*
|
136
151
|
private String phoneMemoryRootPath() {
|
137
152
|
return "/data/data/" + getPackageName() + "/data/";
|
138
153
|
}
|
139
|
-
*/
|
140
154
|
|
141
155
|
private String sdcardRootPath() {
|
142
156
|
return Environment.getExternalStorageDirectory() + "/rhomobile/" + getPackageName() + "/";
|
@@ -146,7 +160,8 @@ public class Rhodes extends Activity {
|
|
146
160
|
public RhoLogConf getLogConf() {
|
147
161
|
return m_rhoLogConf;
|
148
162
|
}
|
149
|
-
|
163
|
+
|
164
|
+
/*
|
150
165
|
private boolean checkSDCard() {
|
151
166
|
Log.d(TAG, "Check if the SD card is mounted...");
|
152
167
|
String state = Environment.getExternalStorageState();
|
@@ -169,6 +184,7 @@ public class Rhodes extends Activity {
|
|
169
184
|
Log.d(TAG, "SD card check passed, going on");
|
170
185
|
return true;
|
171
186
|
}
|
187
|
+
*/
|
172
188
|
|
173
189
|
private void copyFromBundle(String file) throws IOException {
|
174
190
|
File target = new File(sdcardRootPath(), file);
|
@@ -188,7 +204,7 @@ public class Rhodes extends Activity {
|
|
188
204
|
*/
|
189
205
|
}
|
190
206
|
|
191
|
-
|
207
|
+
private boolean isNameChanged() {
|
192
208
|
try {
|
193
209
|
FileSource as = new AssetsSource(getResources().getAssets());
|
194
210
|
FileSource fs = new FileSource();
|
@@ -199,7 +215,7 @@ public class Rhodes extends Activity {
|
|
199
215
|
}
|
200
216
|
}
|
201
217
|
|
202
|
-
|
218
|
+
private boolean isBundleChanged() {
|
203
219
|
if (contentChanged == null) {
|
204
220
|
try {
|
205
221
|
String rp = getRootPath();
|
@@ -233,10 +249,9 @@ public class Rhodes extends Activity {
|
|
233
249
|
String items[] = {"apps", "lib", "db", "hash", "name"};
|
234
250
|
for (int i = 0; i != items.length; ++i) {
|
235
251
|
String item = items[i];
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
Utils.copyRecursively(as, item, sdf, nameChanged);
|
252
|
+
File f = new File(rp, item);
|
253
|
+
Logger.D(TAG, "Copy '" + item + "' to '" + f.getAbsolutePath() + "'");
|
254
|
+
Utils.copyRecursively(as, item, f, nameChanged);
|
240
255
|
/*
|
241
256
|
String src = sdf.getAbsolutePath();
|
242
257
|
String dst = phf.getAbsolutePath();
|
@@ -245,11 +260,6 @@ public class Rhodes extends Activity {
|
|
245
260
|
*/
|
246
261
|
}
|
247
262
|
|
248
|
-
File dbfiles = new File(rootPath + "apps/public/db-files");
|
249
|
-
if (!dbfiles.exists())
|
250
|
-
dbfiles.mkdirs();
|
251
|
-
dbfiles = null;
|
252
|
-
|
253
263
|
contentChanged = new Boolean(true);
|
254
264
|
Logger.D(TAG, "All files copied");
|
255
265
|
}
|
@@ -262,13 +272,19 @@ public class Rhodes extends Activity {
|
|
262
272
|
}
|
263
273
|
|
264
274
|
private boolean handleUrlLoading(String url) {
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
275
|
+
Enumeration<UriHandler> e = uriHandlers.elements();
|
276
|
+
while (e.hasMoreElements()) {
|
277
|
+
UriHandler handler = e.nextElement();
|
278
|
+
try {
|
279
|
+
if (handler.handle(url))
|
280
|
+
return true;
|
281
|
+
}
|
282
|
+
catch (Exception ex) {
|
283
|
+
continue;
|
284
|
+
}
|
285
|
+
}
|
269
286
|
|
270
|
-
|
271
|
-
return true;
|
287
|
+
return false;
|
272
288
|
}
|
273
289
|
|
274
290
|
public WebView createWebView() {
|
@@ -286,11 +302,13 @@ public class Rhodes extends Activity {
|
|
286
302
|
|
287
303
|
w.setVerticalScrollBarEnabled(true);
|
288
304
|
w.setHorizontalScrollBarEnabled(true);
|
305
|
+
w.setVerticalScrollbarOverlay(true);
|
306
|
+
w.setHorizontalScrollbarOverlay(true);
|
289
307
|
|
290
308
|
w.setWebViewClient(new WebViewClient() {
|
291
|
-
|
292
|
-
private boolean splashHidden = false;
|
293
309
|
|
310
|
+
private boolean realPageLoaded = false;
|
311
|
+
|
294
312
|
@Override
|
295
313
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
296
314
|
return handleUrlLoading(url);
|
@@ -304,10 +322,18 @@ public class Rhodes extends Activity {
|
|
304
322
|
|
305
323
|
@Override
|
306
324
|
public void onPageFinished(WebView view, String url) {
|
307
|
-
|
325
|
+
// Clear page until we get real page loaded
|
326
|
+
if (!(realPageLoaded || url.equals(LOADING_PAGE)))
|
327
|
+
realPageLoaded = true;
|
328
|
+
if (!realPageLoaded)
|
329
|
+
view.clearHistory();
|
330
|
+
// Set title
|
331
|
+
Rhodes r = RhodesInstance.getInstance();
|
332
|
+
String title = view.getTitle();
|
333
|
+
r.setTitle(title);
|
334
|
+
// Hide splash screen
|
335
|
+
if (url.startsWith("http://"))
|
308
336
|
hideSplashScreen();
|
309
|
-
splashHidden = true;
|
310
|
-
}
|
311
337
|
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, MAX_PROGRESS);
|
312
338
|
super.onPageFinished(view, url);
|
313
339
|
}
|
@@ -394,8 +420,8 @@ public class Rhodes extends Activity {
|
|
394
420
|
}
|
395
421
|
}
|
396
422
|
|
397
|
-
private void showSplashScreen() {
|
398
|
-
splashScreen = new SplashScreen(this,
|
423
|
+
private void showSplashScreen(String file) throws IOException {
|
424
|
+
splashScreen = new SplashScreen(this, file);
|
399
425
|
splashScreen.start(outerFrame);
|
400
426
|
}
|
401
427
|
|
@@ -409,19 +435,57 @@ public class Rhodes extends Activity {
|
|
409
435
|
view.requestFocus();
|
410
436
|
}
|
411
437
|
|
438
|
+
private void showLoadingPage() {
|
439
|
+
try {
|
440
|
+
boolean hasInstalling = false;
|
441
|
+
try {
|
442
|
+
getResources().getAssets().open("apps/app/installing.png").close();
|
443
|
+
hasInstalling = true;
|
444
|
+
}
|
445
|
+
catch (IOException e) {}
|
446
|
+
showSplashScreen("apps/app/" + (hasInstalling && isBundleChanged() ? "installing.png" : "loading.png"));
|
447
|
+
}
|
448
|
+
catch (Exception e) {
|
449
|
+
MainView v = new SimpleMainView();
|
450
|
+
|
451
|
+
boolean bc = isBundleChanged();
|
452
|
+
String page = bc ? INSTALLING_PAGE : LOADING_PAGE;
|
453
|
+
|
454
|
+
boolean hasNeededPage;
|
455
|
+
try {
|
456
|
+
getResources().getAssets().open(page).close();
|
457
|
+
hasNeededPage = true;
|
458
|
+
}
|
459
|
+
catch (IOException e1) {
|
460
|
+
hasNeededPage = false;
|
461
|
+
}
|
462
|
+
|
463
|
+
if (hasNeededPage) {
|
464
|
+
v.navigate("file:///android_asset/" + page, 0);
|
465
|
+
}
|
466
|
+
else {
|
467
|
+
StringBuffer p = new StringBuffer();
|
468
|
+
p.append("<html><title>");
|
469
|
+
p.append(bc ? "Installing" : "Loading");
|
470
|
+
p.append("</title><body>");
|
471
|
+
p.append(bc ? "Installing" : "Loading");
|
472
|
+
p.append("...</body></html>");
|
473
|
+
v.loadData(p.toString(), 0);
|
474
|
+
}
|
475
|
+
|
476
|
+
setMainView(v);
|
477
|
+
}
|
478
|
+
}
|
479
|
+
|
412
480
|
/** Called when the activity is first created. */
|
413
481
|
@Override
|
414
482
|
public void onCreate(Bundle savedInstanceState) {
|
415
483
|
super.onCreate(savedInstanceState);
|
416
484
|
|
417
|
-
if (!checkSDCard()) {
|
418
|
-
finish();
|
419
|
-
return;
|
420
|
-
}
|
421
|
-
|
422
485
|
Thread ct = Thread.currentThread();
|
423
486
|
ct.setPriority(Thread.MAX_PRIORITY);
|
424
487
|
uiThreadId = ct.getId();
|
488
|
+
|
425
489
|
RhodesInstance.setInstance(this);
|
426
490
|
|
427
491
|
initRootPath();
|
@@ -432,7 +496,7 @@ public class Rhodes extends Activity {
|
|
432
496
|
finish();
|
433
497
|
return;
|
434
498
|
}
|
435
|
-
createRhodesApp(
|
499
|
+
createRhodesApp(getRootPath());
|
436
500
|
|
437
501
|
boolean fullScreen = true;
|
438
502
|
if (RhoConf.isExist("full_screen"))
|
@@ -453,7 +517,7 @@ public class Rhodes extends Activity {
|
|
453
517
|
this.setContentView(outerFrame, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
454
518
|
|
455
519
|
Logger.I("Rhodes", "Loading...");
|
456
|
-
|
520
|
+
showLoadingPage();
|
457
521
|
|
458
522
|
// Increase WebView rendering priority
|
459
523
|
WebView w = new WebView(this);
|
@@ -466,16 +530,18 @@ public class Rhodes extends Activity {
|
|
466
530
|
screenHeight = d.getHeight();
|
467
531
|
screenWidth = d.getWidth();
|
468
532
|
|
533
|
+
DisplayMetrics metrics = new DisplayMetrics();
|
534
|
+
d.getMetrics(metrics);
|
535
|
+
screenPpiX = metrics.xdpi;
|
536
|
+
screenPpiY = metrics.ydpi;
|
537
|
+
|
469
538
|
// TODO: detect camera availability
|
470
539
|
isCameraAvailable = true;
|
471
540
|
|
472
541
|
// Register custom uri handlers here
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
};
|
477
|
-
for (int i = 0; i < handlers.length; ++i)
|
478
|
-
uriHandlers.put(handlers[i].scheme(), handlers[i]);
|
542
|
+
uriHandlers.addElement(new MailUriHandler(this));
|
543
|
+
uriHandlers.addElement(new TelUriHandler(this));
|
544
|
+
uriHandlers.addElement(new VideoUriHandler(this));
|
479
545
|
|
480
546
|
Thread init = new Thread(new Runnable() {
|
481
547
|
|
@@ -510,19 +576,11 @@ public class Rhodes extends Activity {
|
|
510
576
|
super.onDestroy();
|
511
577
|
}
|
512
578
|
|
513
|
-
@Override
|
514
|
-
public boolean onCreateOptionsMenu(Menu menu) {
|
515
|
-
super.onCreateOptionsMenu(menu);
|
516
|
-
MenuInflater mi = new MenuInflater(getApplication());
|
517
|
-
mi.inflate(AndroidR.menu.options, menu);
|
518
|
-
return true;
|
519
|
-
}
|
520
|
-
|
521
579
|
@Override
|
522
580
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
523
581
|
switch (keyCode) {
|
524
582
|
case KeyEvent.KEYCODE_BACK:
|
525
|
-
|
583
|
+
mainView.back(mainView.activeTab());
|
526
584
|
return true;
|
527
585
|
case KeyEvent.KEYCODE_HOME:
|
528
586
|
stopSelf();
|
@@ -531,65 +589,31 @@ public class Rhodes extends Activity {
|
|
531
589
|
|
532
590
|
return super.onKeyDown(keyCode, event);
|
533
591
|
}
|
592
|
+
|
593
|
+
@Override
|
594
|
+
public boolean onPrepareOptionsMenu(Menu menu) {
|
595
|
+
super.onPrepareOptionsMenu(menu);
|
596
|
+
appMenu = new RhoMenu(menu);
|
597
|
+
return true;
|
598
|
+
}
|
534
599
|
|
535
600
|
@Override
|
536
601
|
public boolean onOptionsItemSelected(MenuItem item) {
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
aboutDialog.setTitle("About");
|
541
|
-
aboutDialog.setCanceledOnTouchOutside(true);
|
542
|
-
aboutDialog.setCancelable(true);
|
543
|
-
aboutDialog.show();
|
544
|
-
return true;
|
545
|
-
|
546
|
-
case AndroidR.id.navigation_back:
|
547
|
-
goBack();
|
548
|
-
return true;
|
549
|
-
|
550
|
-
case AndroidR.id.navigation_forward:
|
551
|
-
goForward();
|
552
|
-
return true;
|
553
|
-
|
554
|
-
case AndroidR.id.navigation_home:
|
555
|
-
mainView.navigate(getStartUrl(), mainView.activeTab());
|
556
|
-
return true;
|
557
|
-
|
558
|
-
case AndroidR.id.options:
|
559
|
-
String curUrl = getOptionsUrl();
|
560
|
-
mainView.navigate(curUrl, mainView.activeTab());
|
561
|
-
return true;
|
562
|
-
|
563
|
-
case AndroidR.id.refresh:
|
564
|
-
mainView.reload(mainView.activeTab());
|
565
|
-
return true;
|
566
|
-
|
567
|
-
case AndroidR.id.sync:
|
568
|
-
doSyncAllSources(true);
|
569
|
-
return true;
|
570
|
-
|
571
|
-
case AndroidR.id.logview:
|
572
|
-
showLogView();
|
573
|
-
return true;
|
574
|
-
|
575
|
-
case AndroidR.id.logoptions:
|
576
|
-
showLogOptions();
|
577
|
-
return true;
|
578
|
-
|
579
|
-
case AndroidR.id.exit:
|
580
|
-
stopSelf();
|
581
|
-
return true;
|
582
|
-
}
|
583
|
-
|
584
|
-
return false;
|
585
|
-
}
|
586
|
-
|
587
|
-
private void goBack() {
|
588
|
-
mainView.back(mainView.activeTab());
|
602
|
+
if (appMenu == null)
|
603
|
+
return false;
|
604
|
+
return appMenu.onMenuItemSelected(item);
|
589
605
|
}
|
590
606
|
|
591
|
-
|
592
|
-
|
607
|
+
public static void showAboutDialog() {
|
608
|
+
performOnUiThread(new Runnable() {
|
609
|
+
public void run() {
|
610
|
+
final AboutDialog aboutDialog = new AboutDialog(RhodesInstance.getInstance());
|
611
|
+
aboutDialog.setTitle("About");
|
612
|
+
aboutDialog.setCanceledOnTouchOutside(true);
|
613
|
+
aboutDialog.setCancelable(true);
|
614
|
+
aboutDialog.show();
|
615
|
+
}
|
616
|
+
}, false);
|
593
617
|
}
|
594
618
|
|
595
619
|
public static void showLogView() {
|
@@ -621,11 +645,12 @@ public class Rhodes extends Activity {
|
|
621
645
|
Utils.deleteRecursively(new File(folder, children[i]));
|
622
646
|
}
|
623
647
|
|
624
|
-
public static void showNetworkIndicator(boolean v) {
|
625
|
-
// No GUI indicator
|
626
|
-
}
|
627
|
-
|
628
648
|
private static boolean hasNetwork() {
|
649
|
+
if (!Capabilities.NETWORK_STATE_ENABLED) {
|
650
|
+
Logger.E(TAG, "Capability NETWORK_STATE disabled");
|
651
|
+
return false;
|
652
|
+
}
|
653
|
+
|
629
654
|
Context ctx = RhodesInstance.getInstance();
|
630
655
|
ConnectivityManager conn = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
|
631
656
|
if (conn == null)
|
@@ -671,25 +696,35 @@ public class Rhodes extends Activity {
|
|
671
696
|
return new Boolean(isCameraAvailable);
|
672
697
|
else if (name.equalsIgnoreCase("has_network"))
|
673
698
|
return hasNetwork();
|
699
|
+
else if (name.equalsIgnoreCase("ppi_x"))
|
700
|
+
return new Float(screenPpiX);
|
701
|
+
else if (name.equalsIgnoreCase("ppi_y"))
|
702
|
+
return new Float(screenPpiY);
|
674
703
|
else if (name.equalsIgnoreCase("phone_number")) {
|
675
704
|
TelephonyManager manager = (TelephonyManager)RhodesInstance.getInstance().
|
676
705
|
getSystemService(Context.TELEPHONY_SERVICE);
|
677
706
|
String number = manager.getLine1Number();
|
678
707
|
return number;
|
679
708
|
}
|
709
|
+
else if (name.equalsIgnoreCase("device_name")) {
|
710
|
+
return Build.DEVICE;
|
711
|
+
}
|
712
|
+
else if (name.equalsIgnoreCase("os_version")) {
|
713
|
+
return Build.VERSION.RELEASE;
|
714
|
+
}
|
680
715
|
|
681
716
|
return null;
|
682
717
|
}
|
683
718
|
|
684
|
-
public void stopSelf() {
|
685
|
-
stopRhodesApp();
|
686
|
-
Process.killProcess(Process.myPid());
|
687
|
-
}
|
688
|
-
|
689
719
|
public static void exit() {
|
690
720
|
RhodesInstance.getInstance().stopSelf();
|
691
721
|
}
|
692
722
|
|
723
|
+
private void stopSelf() {
|
724
|
+
//stopRhodesApp();
|
725
|
+
Process.killProcess(Process.myPid());
|
726
|
+
}
|
727
|
+
|
693
728
|
static {
|
694
729
|
// Load native implementation of rhodes
|
695
730
|
System.loadLibrary("rhodes");
|