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,331 @@
|
|
1
|
+
package com.rho;
|
2
|
+
|
3
|
+
import javax.microedition.io.HttpConnection;
|
4
|
+
|
5
|
+
import com.rho.net.URI;
|
6
|
+
|
7
|
+
import rhomobile.*;
|
8
|
+
import rhomobile.RhodesApplication.PrimaryResourceFetchThread;
|
9
|
+
|
10
|
+
import net.rim.device.api.browser.field.BrowserContent;
|
11
|
+
import net.rim.device.api.browser.field.Event;
|
12
|
+
import net.rim.device.api.browser.field.RedirectEvent;
|
13
|
+
import net.rim.device.api.browser.field.RenderingApplication;
|
14
|
+
import net.rim.device.api.browser.field.RenderingException;
|
15
|
+
import net.rim.device.api.browser.field.RenderingOptions;
|
16
|
+
import net.rim.device.api.browser.field.RenderingSession;
|
17
|
+
import net.rim.device.api.browser.field.RequestedResource;
|
18
|
+
import net.rim.device.api.browser.field.UrlRequestedEvent;
|
19
|
+
import net.rim.device.api.io.http.HttpHeaders;
|
20
|
+
import net.rim.device.api.system.Application;
|
21
|
+
import net.rim.device.api.system.Display;
|
22
|
+
import net.rim.device.api.ui.Field;
|
23
|
+
import net.rim.device.api.ui.component.Status;
|
24
|
+
|
25
|
+
public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
|
26
|
+
{
|
27
|
+
private static final RhoLogger LOG = RhoLogger.RHO_STRIP_LOG ? new RhoEmptyLogger() :
|
28
|
+
new RhoLogger("BrowserAdapter");
|
29
|
+
private RenderingSession _renderingSession;
|
30
|
+
private RhoMainScreen m_oMainScreen;
|
31
|
+
|
32
|
+
private RhodesApplication m_app;
|
33
|
+
private HttpConnection m_connResource = null;
|
34
|
+
private boolean m_bLoadImageAsync = false;
|
35
|
+
|
36
|
+
public BrowserAdapter(RhoMainScreen oMainScreen, RhodesApplication app, boolean bLoadImageAsync)
|
37
|
+
{
|
38
|
+
m_oMainScreen = oMainScreen;
|
39
|
+
m_app = app;
|
40
|
+
m_bLoadImageAsync = bLoadImageAsync;
|
41
|
+
|
42
|
+
_renderingSession = RenderingSession.getNewInstance();
|
43
|
+
|
44
|
+
// enable javascript
|
45
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);
|
46
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_LOCATION_ENABLED, true);
|
47
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_CSS, true);
|
48
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.DEFAULT_CHARSET_VALUE, "utf-8");
|
49
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.OVERWRITE_CHARSET_MODE, true);
|
50
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ALLOW_POPUPS, true);
|
51
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.USE_BACKGROUND_IMAGES, true);
|
52
|
+
|
53
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.VALUE_THRESHOLD, 100000);
|
54
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.USE_BACKGROUND_IMAGES, true);
|
55
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.SHOW_IMAGE_PLACEHOLDERS, false);
|
56
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_WML, false);
|
57
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT, false);
|
58
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_IMAGE_EDITING, false);
|
59
|
+
// _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.NO_SEARCH_MENU_MODE, true);
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
public void setFullBrowser()
|
64
|
+
{
|
65
|
+
//this is the undocumented option to tell the browser to use the 4.6 Rendering Engine
|
66
|
+
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, 17000, true);
|
67
|
+
}
|
68
|
+
|
69
|
+
public Object eventOccurred(Event event) {
|
70
|
+
|
71
|
+
int eventId = event.getUID();
|
72
|
+
|
73
|
+
switch (eventId) {
|
74
|
+
|
75
|
+
case Event.EVENT_URL_REQUESTED : {
|
76
|
+
|
77
|
+
UrlRequestedEvent urlRequestedEvent = (UrlRequestedEvent) event;
|
78
|
+
String absoluteUrl = urlRequestedEvent.getURL();
|
79
|
+
//if ( !absoluteUrl.startsWith(_httpRoot) )
|
80
|
+
// absoluteUrl = _httpRoot + absoluteUrl.substring(_httpRoot.length()-5);
|
81
|
+
|
82
|
+
if ( urlRequestedEvent.getPostData() == null ||
|
83
|
+
urlRequestedEvent.getPostData().length == 0 )
|
84
|
+
m_app.addToHistory(absoluteUrl, null );
|
85
|
+
|
86
|
+
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread(absoluteUrl,
|
87
|
+
urlRequestedEvent.getHeaders(),
|
88
|
+
urlRequestedEvent.getPostData(),
|
89
|
+
event);
|
90
|
+
thread.start();
|
91
|
+
|
92
|
+
break;
|
93
|
+
|
94
|
+
} case Event.EVENT_BROWSER_CONTENT_CHANGED: {
|
95
|
+
|
96
|
+
// browser field title might have changed update title
|
97
|
+
/*BrowserContentChangedEvent browserContentChangedEvent = (BrowserContentChangedEvent) event;
|
98
|
+
|
99
|
+
if (browserContentChangedEvent.getSource() instanceof BrowserContent) {
|
100
|
+
BrowserContent browserField = (BrowserContent) browserContentChangedEvent.getSource();
|
101
|
+
String newTitle = browserField.getTitle();
|
102
|
+
if (newTitle != null) {
|
103
|
+
synchronized (getAppEventLock())
|
104
|
+
//synchronized (Application.getEventLock())
|
105
|
+
{
|
106
|
+
_mainScreen.setTitle(newTitle);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}*/
|
110
|
+
|
111
|
+
break;
|
112
|
+
|
113
|
+
} case Event.EVENT_REDIRECT : {
|
114
|
+
|
115
|
+
RedirectEvent e = (RedirectEvent) event;
|
116
|
+
String referrer = e.getSourceURL();
|
117
|
+
String absoluteUrl = e.getLocation();
|
118
|
+
|
119
|
+
switch (e.getType()) {
|
120
|
+
|
121
|
+
case RedirectEvent.TYPE_SINGLE_FRAME_REDIRECT :
|
122
|
+
// show redirect message
|
123
|
+
Application.getApplication().invokeAndWait(new Runnable() {
|
124
|
+
public void run() {
|
125
|
+
Status.show("You are being redirected to a different page...");
|
126
|
+
}
|
127
|
+
});
|
128
|
+
|
129
|
+
break;
|
130
|
+
|
131
|
+
case RedirectEvent.TYPE_JAVASCRIPT :
|
132
|
+
break;
|
133
|
+
case RedirectEvent.TYPE_META :
|
134
|
+
// MSIE and Mozilla don't send a Referer for META Refresh.
|
135
|
+
referrer = null;
|
136
|
+
break;
|
137
|
+
case RedirectEvent.TYPE_300_REDIRECT :
|
138
|
+
// MSIE, Mozilla, and Opera all send the original
|
139
|
+
// request's Referer as the Referer for the new
|
140
|
+
// request.
|
141
|
+
//if ( !absoluteUrl.startsWith(_httpRoot) )
|
142
|
+
// absoluteUrl = _httpRoot + absoluteUrl.substring(_httpRoot.length()-5);
|
143
|
+
|
144
|
+
m_app.addToHistory(absoluteUrl,referrer);
|
145
|
+
Object eventSource = e.getSource();
|
146
|
+
if (eventSource instanceof HttpConnection) {
|
147
|
+
referrer = ((HttpConnection)eventSource).getRequestProperty("referer");
|
148
|
+
}
|
149
|
+
break;
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
HttpHeaders requestHeaders = new HttpHeaders();
|
154
|
+
requestHeaders.setProperty("referer", referrer);
|
155
|
+
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread(absoluteUrl, requestHeaders,null, event);
|
156
|
+
thread.start();
|
157
|
+
break;
|
158
|
+
|
159
|
+
} case Event.EVENT_CLOSE :
|
160
|
+
// TODO: close the application
|
161
|
+
break;
|
162
|
+
|
163
|
+
case Event.EVENT_SET_HEADER :
|
164
|
+
case Event.EVENT_SET_HTTP_COOKIE : {
|
165
|
+
/*String cookie = ((SetHttpCookieEvent)event).getCookie();
|
166
|
+
String response = processAjaxCall(cookie);
|
167
|
+
if (response != null)
|
168
|
+
synchronized (pendingResponses) {
|
169
|
+
pendingResponses.addElement(response);
|
170
|
+
}
|
171
|
+
response = null;
|
172
|
+
cookie = null;*/
|
173
|
+
break;
|
174
|
+
}
|
175
|
+
case Event.EVENT_HISTORY : // no history support
|
176
|
+
case Event.EVENT_EXECUTING_SCRIPT : // no progress bar is supported
|
177
|
+
case Event.EVENT_FULL_WINDOW : // no full window support
|
178
|
+
case Event.EVENT_STOP : // no stop loading support
|
179
|
+
default :
|
180
|
+
}
|
181
|
+
|
182
|
+
return null;
|
183
|
+
}
|
184
|
+
|
185
|
+
public void processConnection(HttpConnection connection, Object e)
|
186
|
+
{
|
187
|
+
BrowserContent browserContent = null;
|
188
|
+
|
189
|
+
try {
|
190
|
+
browserContent = _renderingSession.getBrowserContent(connection, this, (Event)e);
|
191
|
+
|
192
|
+
if (browserContent != null) {
|
193
|
+
browserContent.finishLoading();
|
194
|
+
|
195
|
+
Field field = browserContent.getDisplayableContent();
|
196
|
+
if (field != null) {
|
197
|
+
|
198
|
+
synchronized (Application.getEventLock())
|
199
|
+
{
|
200
|
+
Field old = m_oMainScreen.getField(0);
|
201
|
+
m_oMainScreen.add(field);
|
202
|
+
m_oMainScreen.delete(old);
|
203
|
+
/*
|
204
|
+
_mainScreen.doPaint();
|
205
|
+
if ( e == null )
|
206
|
+
{//This should awake screen in case of long network response
|
207
|
+
KeyCodeEvent inject1 = new KeyCodeEvent( KeyCodeEvent.KEY_DOWN, (char)Keypad.KEY_ESCAPE, 0);
|
208
|
+
KeyCodeEvent inject2 = new KeyCodeEvent( KeyCodeEvent.KEY_UP, (char)Keypad.KEY_ESCAPE, 0);
|
209
|
+
inject1.post();
|
210
|
+
inject2.post();
|
211
|
+
m_bSkipKeyPress = true;
|
212
|
+
}*/
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
}
|
217
|
+
} catch (RenderingException re) {
|
218
|
+
LOG.ERROR("RenderingException", re);
|
219
|
+
} finally {
|
220
|
+
SecondaryResourceFetchThread.doneAddingImages();
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
public int getAvailableHeight(BrowserContent browserContent) {
|
225
|
+
return Display.getHeight();
|
226
|
+
}
|
227
|
+
|
228
|
+
public int getAvailableWidth(BrowserContent browserContent) {
|
229
|
+
return Display.getWidth();
|
230
|
+
}
|
231
|
+
|
232
|
+
public String getHTTPCookie(String url) {
|
233
|
+
return null;
|
234
|
+
}
|
235
|
+
|
236
|
+
public int getHistoryPosition(BrowserContent browserContent) {
|
237
|
+
return 0;
|
238
|
+
}
|
239
|
+
|
240
|
+
public HttpConnection getResource( RequestedResource resource, BrowserContent referrer) {
|
241
|
+
|
242
|
+
if (resource == null)
|
243
|
+
return null;
|
244
|
+
|
245
|
+
String url = resource.getUrl();
|
246
|
+
if (url == null || url.endsWith("/favicon.ico"))
|
247
|
+
return null;
|
248
|
+
|
249
|
+
try
|
250
|
+
{
|
251
|
+
if (referrer == null || !m_bLoadImageAsync)
|
252
|
+
{
|
253
|
+
boolean bLocalHost = URI.isLocalHost(url);
|
254
|
+
if ( bLocalHost && m_connResource!= null)
|
255
|
+
{
|
256
|
+
com.rho.net.RhoConnection rhoConn = (com.rho.net.RhoConnection)((com.rho.net.bb.NativeBBHttpConnection)m_connResource).getNativeConnection();
|
257
|
+
rhoConn.resetUrl(url);
|
258
|
+
|
259
|
+
Utilities.makeConnection(url, resource.getRequestHeaders(), null, m_connResource);
|
260
|
+
return m_connResource;
|
261
|
+
}else
|
262
|
+
{
|
263
|
+
HttpConnection connection = Utilities.makeConnection(url, resource.getRequestHeaders(), null, null);
|
264
|
+
if (bLocalHost)
|
265
|
+
m_connResource = connection;
|
266
|
+
return connection;
|
267
|
+
}
|
268
|
+
}else
|
269
|
+
{
|
270
|
+
SecondaryResourceFetchThread.enqueue(resource, referrer);
|
271
|
+
}
|
272
|
+
}catch(Exception exc)
|
273
|
+
{
|
274
|
+
LOG.ERROR("getResource failed.", exc);
|
275
|
+
}
|
276
|
+
|
277
|
+
return null;
|
278
|
+
|
279
|
+
/*
|
280
|
+
// check if this is cache-only request
|
281
|
+
if (resource.isCacheOnly()) {
|
282
|
+
// no cache support
|
283
|
+
return null;
|
284
|
+
}
|
285
|
+
|
286
|
+
String url = resource.getUrl();
|
287
|
+
|
288
|
+
if (url == null) {
|
289
|
+
return null;
|
290
|
+
}
|
291
|
+
|
292
|
+
try{
|
293
|
+
// if referrer is null we must return the connection
|
294
|
+
if (referrer == null) {
|
295
|
+
HttpConnection connection = Utilities.makeConnection(url, resource.getRequestHeaders(), null);
|
296
|
+
return connection;
|
297
|
+
|
298
|
+
} else
|
299
|
+
{
|
300
|
+
if ( URI.isLocalHost(url) || URI.isLocalData(url))
|
301
|
+
{
|
302
|
+
HttpConnection connection = Utilities.makeConnection(url, resource.getRequestHeaders(), null);
|
303
|
+
return connection;
|
304
|
+
}else
|
305
|
+
{
|
306
|
+
// if referrer is provided we can set up the connection on a separate thread
|
307
|
+
SecondaryResourceFetchThread.enqueue(resource, referrer);
|
308
|
+
}
|
309
|
+
}
|
310
|
+
}catch(Exception exc)
|
311
|
+
{
|
312
|
+
LOG.ERROR("getResource failed.", exc);
|
313
|
+
}
|
314
|
+
|
315
|
+
return null;*/
|
316
|
+
}
|
317
|
+
|
318
|
+
public void invokeRunnable(Runnable runnable) {
|
319
|
+
(new Thread(runnable)).start();
|
320
|
+
}
|
321
|
+
|
322
|
+
public boolean navigationMovement(int dx, int dy, int status, int time)
|
323
|
+
{
|
324
|
+
return false;
|
325
|
+
}
|
326
|
+
|
327
|
+
public void executeJavascript(String strJavascript)
|
328
|
+
{
|
329
|
+
|
330
|
+
}
|
331
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
package com.rho;
|
2
|
+
|
3
|
+
import javax.microedition.io.HttpConnection;
|
4
|
+
import rhomobile.RhodesApplication;
|
5
|
+
|
6
|
+
public class BrowserAdapter5 implements IBrowserAdapter
|
7
|
+
{
|
8
|
+
public BrowserAdapter5(RhoMainScreen oMainScreen, RhodesApplication app)
|
9
|
+
{
|
10
|
+
}
|
11
|
+
|
12
|
+
public void setFullBrowser()
|
13
|
+
{
|
14
|
+
}
|
15
|
+
|
16
|
+
public void processConnection(HttpConnection connection, Object e)
|
17
|
+
{
|
18
|
+
}
|
19
|
+
|
20
|
+
public void executeJavascript(String strJavascript)
|
21
|
+
{
|
22
|
+
}
|
23
|
+
|
24
|
+
public boolean navigationMovement(int dx, int dy, int status, int time)
|
25
|
+
{
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
package com.rho;
|
2
|
+
|
3
|
+
import javax.microedition.io.HttpConnection;
|
4
|
+
|
5
|
+
public interface IBrowserAdapter {
|
6
|
+
public void processConnection(HttpConnection connection, Object e);
|
7
|
+
public boolean navigationMovement(int dx, int dy, int status, int time);
|
8
|
+
public void executeJavascript(String strJavascript);
|
9
|
+
public void setFullBrowser();
|
10
|
+
}
|
@@ -11,7 +11,7 @@ import rhomobile.NativeBar;
|
|
11
11
|
import rhomobile.RhoPhonebook;
|
12
12
|
import rhomobile.RhodesApplication;
|
13
13
|
import rhomobile.RingtoneManager;
|
14
|
-
import
|
14
|
+
import com.rho.rubyext.WebView;
|
15
15
|
import rhomobile.camera.Camera;
|
16
16
|
import rhomobile.datetime.DateTimePicker;
|
17
17
|
import rhomobile.mapview.MapView;
|
@@ -19,9 +19,7 @@ import com.rho.rubyext.GeoLocation;
|
|
19
19
|
|
20
20
|
import com.rho.db.HsqlDBStorage;
|
21
21
|
import com.rho.db.IDBStorage;
|
22
|
-
import com.rho.file
|
23
|
-
import com.rho.file.Jsr75RAFileImpl;
|
24
|
-
import com.rho.file.PersistRAFileImpl;
|
22
|
+
import com.rho.file.*;
|
25
23
|
import com.rho.net.SSLSocket;
|
26
24
|
import com.rho.net.TCPSocket;
|
27
25
|
import com.xruby.runtime.builtin.RubyArray;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package com.rho;
|
1
|
+
package com.rho.file;
|
2
2
|
|
3
3
|
import java.io.IOException;
|
4
4
|
import java.io.InputStream;
|
@@ -6,9 +6,10 @@ import java.io.OutputStream;
|
|
6
6
|
import java.util.Enumeration;
|
7
7
|
import javax.microedition.io.*;
|
8
8
|
import javax.microedition.io.file.*;
|
9
|
-
|
10
9
|
import java.util.Vector;
|
11
10
|
|
11
|
+
import com.rho.*;
|
12
|
+
|
12
13
|
public class Jsr75File implements SimpleFile
|
13
14
|
{
|
14
15
|
private FileConnection fconn;
|
@@ -30,7 +31,19 @@ public class Jsr75File implements SimpleFile
|
|
30
31
|
System.out.println("FileSystem: " + txt);
|
31
32
|
}
|
32
33
|
|
33
|
-
static void
|
34
|
+
static void recursiveCreateDir( String strPath )throws IOException
|
35
|
+
{
|
36
|
+
int nSlash = strPath.indexOf('/', getRhoPath().length() );
|
37
|
+
while (nSlash >=0 )
|
38
|
+
{
|
39
|
+
String strDir = strPath.substring(0, nSlash+1);
|
40
|
+
createDir(strDir);
|
41
|
+
nSlash = strPath.indexOf('/', nSlash+1 );
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
static void createDir( String strDir )throws IOException
|
46
|
+
{
|
34
47
|
log("Dir:"+strDir);
|
35
48
|
FileConnection fdir = null;
|
36
49
|
try{
|
@@ -132,6 +145,36 @@ public class Jsr75File implements SimpleFile
|
|
132
145
|
return m_strRhoPath;
|
133
146
|
}
|
134
147
|
|
148
|
+
public void copyJarFileToMemory(String strFileName, InputStream jarStream)throws IOException
|
149
|
+
{
|
150
|
+
//create target directories
|
151
|
+
String strTargetPath = FilePath.join(getRhoPath(), strFileName);
|
152
|
+
recursiveCreateDir(strTargetPath);
|
153
|
+
|
154
|
+
FileConnection fMem = null;
|
155
|
+
OutputStream out = null;
|
156
|
+
|
157
|
+
try{
|
158
|
+
fMem = (FileConnection)Connector.open(strTargetPath,Connector.READ_WRITE);
|
159
|
+
if ( !fMem.exists() )
|
160
|
+
fMem.create();
|
161
|
+
|
162
|
+
int nSize = jarStream.available();
|
163
|
+
if ( nSize > 0 )
|
164
|
+
{
|
165
|
+
out = fMem.openOutputStream();
|
166
|
+
byte[] buf = new byte[nSize];
|
167
|
+
jarStream.read(buf);
|
168
|
+
out.write(buf);
|
169
|
+
}
|
170
|
+
}finally{
|
171
|
+
if ( out != null )
|
172
|
+
out.close();
|
173
|
+
if ( fMem != null )
|
174
|
+
fMem.close();
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
135
178
|
public static void copyRhoFileFromDeviceMemory(String strFileName)
|
136
179
|
{
|
137
180
|
InputStream in = null;
|
@@ -345,14 +388,6 @@ public class Jsr75File implements SimpleFile
|
|
345
388
|
}
|
346
389
|
}
|
347
390
|
}
|
348
|
-
|
349
|
-
public OutputStream getOutStream(){ return out; }
|
350
|
-
public InputStream getInputStream()throws IOException{
|
351
|
-
if ( in == null )
|
352
|
-
in = fconn.openInputStream();
|
353
|
-
|
354
|
-
return in;
|
355
|
-
}
|
356
391
|
|
357
392
|
public boolean isOpened(){
|
358
393
|
return m_bOpened;
|
@@ -468,6 +503,37 @@ public class Jsr75File implements SimpleFile
|
|
468
503
|
}
|
469
504
|
}
|
470
505
|
|
506
|
+
public OutputStream getOutStream(){ return out; }
|
507
|
+
|
508
|
+
public OutputStream getOutStreamEx(long pos)throws IOException
|
509
|
+
{
|
510
|
+
if (outPos != pos) {
|
511
|
+
out.close();
|
512
|
+
out = fconn.openOutputStream(pos);
|
513
|
+
if (pos > fileSize) {
|
514
|
+
byte[] zeroBuf = new byte[ZERO_BUF_SIZE];
|
515
|
+
do {
|
516
|
+
int size = pos - fileSize > ZERO_BUF_SIZE ? ZERO_BUF_SIZE : (int)(pos - fileSize);
|
517
|
+
out.write(zeroBuf, 0, size);
|
518
|
+
fileSize += size;
|
519
|
+
|
520
|
+
//BB
|
521
|
+
//fconn.truncate(fileSize);
|
522
|
+
} while (pos != fileSize);
|
523
|
+
}
|
524
|
+
outPos = pos;
|
525
|
+
}
|
526
|
+
|
527
|
+
return out;
|
528
|
+
}
|
529
|
+
|
530
|
+
public InputStream getInputStream()throws IOException{
|
531
|
+
if ( in == null )
|
532
|
+
in = fconn.openInputStream();
|
533
|
+
|
534
|
+
return in;
|
535
|
+
}
|
536
|
+
|
471
537
|
public void write(long pos, byte[] b)throws IOException
|
472
538
|
{
|
473
539
|
int len = b.length;
|
@@ -475,24 +541,12 @@ public class Jsr75File implements SimpleFile
|
|
475
541
|
throw new IOException("Illegal mode");
|
476
542
|
}
|
477
543
|
int nTry = 0;
|
478
|
-
while (nTry <= 1)
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
byte[] zeroBuf = new byte[ZERO_BUF_SIZE];
|
485
|
-
do {
|
486
|
-
int size = pos - fileSize > ZERO_BUF_SIZE ? ZERO_BUF_SIZE : (int)(pos - fileSize);
|
487
|
-
out.write(zeroBuf, 0, size);
|
488
|
-
fileSize += size;
|
489
|
-
|
490
|
-
//BB
|
491
|
-
//fconn.truncate(fileSize);
|
492
|
-
} while (pos != fileSize);
|
493
|
-
}
|
494
|
-
outPos = pos;
|
495
|
-
}
|
544
|
+
while (nTry <= 1)
|
545
|
+
{
|
546
|
+
try
|
547
|
+
{
|
548
|
+
getOutStreamEx(pos);
|
549
|
+
|
496
550
|
out.write(b, 0, len);
|
497
551
|
outPos += len;
|
498
552
|
if (outPos > fileSize) {
|
@@ -511,13 +565,6 @@ public class Jsr75File implements SimpleFile
|
|
511
565
|
throw exc;
|
512
566
|
else{
|
513
567
|
outPos = -pos;
|
514
|
-
|
515
|
-
/* String name = fconn.getURL();
|
516
|
-
//boolean bRead = fconn.canRead();
|
517
|
-
boolean bWrite = fconn.canWrite();
|
518
|
-
|
519
|
-
close();
|
520
|
-
open(name, !bWrite, noFlush);*/
|
521
568
|
}
|
522
569
|
|
523
570
|
}
|