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,56 @@
|
|
1
|
+
/*
|
2
|
+
* Rhodes.h
|
3
|
+
* rhorunner
|
4
|
+
*
|
5
|
+
* Created by Dmitry Moskalchuk on 07.03.10.
|
6
|
+
* Copyright 2010 Rhomobile Inc. All rights reserved.
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
#import <UIKit/UIKit.h>
|
11
|
+
#import <AVFoundation/AVFoundation.h>
|
12
|
+
#import "AppManager.h"
|
13
|
+
#import "RhoMainView.h"
|
14
|
+
|
15
|
+
#import "LogOptionsController.h"
|
16
|
+
#import "LogViewController.h"
|
17
|
+
#import "DateTimePickerDelegate.h"
|
18
|
+
#import "PickImageDelegate.h"
|
19
|
+
|
20
|
+
@interface Rhodes : NSObject <UIApplicationDelegate, UIWebViewDelegate,
|
21
|
+
UITabBarControllerDelegate, AVAudioPlayerDelegate>
|
22
|
+
{
|
23
|
+
AppManager *appManager;
|
24
|
+
UIApplication *application;
|
25
|
+
UIWindow *window;
|
26
|
+
AVAudioPlayer *player;
|
27
|
+
// Controllers
|
28
|
+
LogOptionsController* logOptionsController;
|
29
|
+
LogViewController* logViewController;
|
30
|
+
DateTimePickerDelegate* dateTimePickerDelegate;
|
31
|
+
PickImageDelegate* pickImageDelegate;
|
32
|
+
@public
|
33
|
+
id<RhoMainView,NSObject> mainView;
|
34
|
+
}
|
35
|
+
|
36
|
+
@property (nonatomic, retain) UIWindow *window;
|
37
|
+
@property (nonatomic, retain) AVAudioPlayer *player;
|
38
|
+
@property (nonatomic, retain) id<RhoMainView,NSObject> mainView;
|
39
|
+
|
40
|
+
+ (Rhodes*)sharedInstance;
|
41
|
+
|
42
|
+
+ (UIApplication*)application;
|
43
|
+
|
44
|
+
+ (CGRect)applicationFrame;
|
45
|
+
+ (void)setStatusBarHidden:(BOOL)v;
|
46
|
+
|
47
|
+
+ (void)performOnUiThread:(id)runnable wait:(BOOL)wait;
|
48
|
+
+ (void)performOnUiThread:(id)runnable arg:(id)arg wait:(BOOL)wait;
|
49
|
+
+ (void)performOnUiThread:(id)runnable arg:(id)arg1 arg:(id)arg2 wait:(BOOL)wait;
|
50
|
+
|
51
|
+
- (UIWindow*)rootWindow;
|
52
|
+
|
53
|
+
- (void)playStart:(NSString*)fileName mediaType:(NSString*)type;
|
54
|
+
- (void)playStop;
|
55
|
+
|
56
|
+
@end
|
@@ -0,0 +1,533 @@
|
|
1
|
+
#import "Rhodes.h"
|
2
|
+
#import "SimpleMainView.h"
|
3
|
+
#import "RhoAlert.h"
|
4
|
+
#import "ParamsWrapper.h"
|
5
|
+
|
6
|
+
#include "sync/ClientRegister.h"
|
7
|
+
#include "sync/syncthread.h"
|
8
|
+
#include "logging/RhoLogConf.h"
|
9
|
+
#include "logging/RhoLog.h"
|
10
|
+
#include "common/RhoConf.h"
|
11
|
+
#include "common/RhodesApp.h"
|
12
|
+
|
13
|
+
#undef DEFAULT_LOGCATEGORY
|
14
|
+
#define DEFAULT_LOGCATEGORY "Rhodes"
|
15
|
+
|
16
|
+
void rho_geoimpl_init();
|
17
|
+
|
18
|
+
@implementation Rhodes
|
19
|
+
|
20
|
+
@synthesize window, player, mainView;
|
21
|
+
|
22
|
+
static Rhodes *instance = NULL;
|
23
|
+
|
24
|
+
+ (Rhodes*)sharedInstance {
|
25
|
+
return instance;
|
26
|
+
}
|
27
|
+
|
28
|
+
+ (UIApplication*)application {
|
29
|
+
return [Rhodes sharedInstance]->application;
|
30
|
+
}
|
31
|
+
|
32
|
+
+ (CGRect)applicationFrame {
|
33
|
+
CGRect frame = [[UIScreen mainScreen] bounds];
|
34
|
+
CGRect sbFrame = [[UIApplication sharedApplication] statusBarFrame];
|
35
|
+
frame.origin.y += sbFrame.size.height;
|
36
|
+
frame.size.height -= sbFrame.size.height;
|
37
|
+
return frame;
|
38
|
+
}
|
39
|
+
|
40
|
+
+ (void)setStatusBarHidden:(BOOL)v {
|
41
|
+
[[Rhodes application] setStatusBarHidden:v animated:YES];
|
42
|
+
[[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
|
43
|
+
}
|
44
|
+
|
45
|
+
- (void)runRunnable:(NSArray*)args {
|
46
|
+
id runnable = [args objectAtIndex:0];
|
47
|
+
if ([runnable respondsToSelector:@selector(run)])
|
48
|
+
[runnable performSelector:@selector(run)];
|
49
|
+
else if ([runnable respondsToSelector:@selector(run:)]) {
|
50
|
+
id arg = nil;
|
51
|
+
if ([args count] == 2)
|
52
|
+
arg = [args objectAtIndex:1];
|
53
|
+
[runnable performSelector:@selector(run:) withObject:arg];
|
54
|
+
}
|
55
|
+
else if ([runnable respondsToSelector:@selector(run::)]) {
|
56
|
+
id arg1 = nil;
|
57
|
+
if ([args count] > 1)
|
58
|
+
arg1 = [args objectAtIndex:1];
|
59
|
+
id arg2 = nil;
|
60
|
+
if ([args count] > 2)
|
61
|
+
arg2 = [args objectAtIndex:2];
|
62
|
+
[runnable performSelector:@selector(run::) withObject:arg1 withObject:arg2];
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
RAWLOG_ERROR("runRunnable: unrecognized parameters");
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
+ (void)performOnUiThread:(id)runnable wait:(BOOL)wait {
|
70
|
+
NSMutableArray *args = [NSMutableArray arrayWithCapacity:1];
|
71
|
+
[args addObject:runnable];
|
72
|
+
[[Rhodes sharedInstance] performSelectorOnMainThread:@selector(runRunnable:) withObject:args waitUntilDone:wait];
|
73
|
+
}
|
74
|
+
|
75
|
+
+ (void)performOnUiThread:(id)runnable arg:(id)arg wait:(BOOL)wait {
|
76
|
+
NSMutableArray *args = [NSMutableArray arrayWithCapacity:2];
|
77
|
+
[args addObject:runnable];
|
78
|
+
if (arg)
|
79
|
+
[args addObject:arg];
|
80
|
+
[[Rhodes sharedInstance] performSelectorOnMainThread:@selector(runRunnable:) withObject:args waitUntilDone:wait];
|
81
|
+
}
|
82
|
+
|
83
|
+
+ (void)performOnUiThread:(id)runnable arg:(id)arg1 arg:(id)arg2 wait:(BOOL)wait {
|
84
|
+
NSMutableArray *args = [NSMutableArray arrayWithCapacity:3];
|
85
|
+
[args addObject:runnable];
|
86
|
+
if (arg1)
|
87
|
+
[args addObject:arg1];
|
88
|
+
if (arg2)
|
89
|
+
[args addObject:arg2];
|
90
|
+
[[Rhodes sharedInstance] performSelectorOnMainThread:@selector(runRunnable:) withObject:args waitUntilDone:wait];
|
91
|
+
}
|
92
|
+
|
93
|
+
- (void)openMapLocation:(NSString*)query {
|
94
|
+
NSURL* url = [NSURL URLWithString:[@"http://maps.google.com/?" stringByAppendingString:query]];
|
95
|
+
[[UIApplication sharedApplication] openURL:url];
|
96
|
+
}
|
97
|
+
|
98
|
+
- (void)mapLocation:(NSString *)query {
|
99
|
+
[self performSelectorOnMainThread:@selector(openMapLocation:) withObject:query waitUntilDone:NO];
|
100
|
+
}
|
101
|
+
|
102
|
+
- (void)doSysCall:(ParamsWrapper*)params {
|
103
|
+
PARAMS_WRAPPER pw;
|
104
|
+
do_syscall([params unwrap:&pw]);
|
105
|
+
[params release];
|
106
|
+
}
|
107
|
+
|
108
|
+
- (void)sysCall:(PARAMS_WRAPPER*)params {
|
109
|
+
ParamsWrapper* pw = [ParamsWrapper wrap:params];
|
110
|
+
[self performSelectorOnMainThread:@selector(doSysCall:) withObject:pw waitUntilDone:NO];
|
111
|
+
}
|
112
|
+
|
113
|
+
- (void)doShowLogOptions {
|
114
|
+
if (logOptionsController!=NULL) {
|
115
|
+
[window addSubview:logOptionsController.view];
|
116
|
+
logOptionsController.view.hidden = NO;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
- (void)showLogOptions {
|
121
|
+
[self performSelectorOnMainThread:@selector(doShowLogOptions) withObject:nil waitUntilDone:NO];
|
122
|
+
}
|
123
|
+
|
124
|
+
- (void)doShowLog {
|
125
|
+
if (logViewController!=NULL) {
|
126
|
+
[window addSubview:logViewController.view];
|
127
|
+
logViewController.view.hidden = NO;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
- (void)showLog {
|
132
|
+
[self performSelectorOnMainThread:@selector(doShowLog) withObject:nil waitUntilDone:NO];
|
133
|
+
}
|
134
|
+
|
135
|
+
- (void)chooseDateTime:(DateTime*)dateTime {
|
136
|
+
dateTimePickerDelegate.dateTime = dateTime;
|
137
|
+
[dateTimePickerDelegate setPostUrl:dateTime.url];
|
138
|
+
//[self normalizeUrl:dateTime.url]];
|
139
|
+
@try {
|
140
|
+
[dateTimePickerDelegate createPicker:window];
|
141
|
+
} @catch (NSException* theException) {
|
142
|
+
RAWLOG_ERROR2("startDateTimePickerFromViewController failed(%s): %s", [[theException name] UTF8String], [[theException reason] UTF8String] );
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
-(BOOL)startCameraPicker:(PickImageDelegate*)delegateObject
|
147
|
+
sourceType:(UIImagePickerControllerSourceType)type
|
148
|
+
{
|
149
|
+
#ifndef __IPHONE_3_0
|
150
|
+
if ( (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) ||
|
151
|
+
(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) ||
|
152
|
+
(delegateObject == nil)) {
|
153
|
+
return NO;
|
154
|
+
}
|
155
|
+
#endif
|
156
|
+
|
157
|
+
@try {
|
158
|
+
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
|
159
|
+
picker.sourceType = type;
|
160
|
+
picker.delegate = delegateObject;
|
161
|
+
#ifndef __IPHONE_3_1
|
162
|
+
picker.allowsImageEditing = YES;
|
163
|
+
#else
|
164
|
+
picker.allowsEditing = YES;
|
165
|
+
#endif
|
166
|
+
// Show picker
|
167
|
+
#ifdef __IPHONE_3_2
|
168
|
+
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
169
|
+
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker];
|
170
|
+
popover.delegate = delegateObject;
|
171
|
+
delegateObject->popover = popover;
|
172
|
+
CGRect rect = [[[self mainView] view] frame];
|
173
|
+
rect.origin.x += rect.size.width/4;
|
174
|
+
rect.origin.y += rect.size.height/4;
|
175
|
+
rect.size.width /= 2;
|
176
|
+
rect.size.height /= 2;
|
177
|
+
popover.popoverContentSize = CGSizeMake(CGRectGetWidth(rect), CGRectGetHeight(rect));
|
178
|
+
[popover presentPopoverFromRect:rect inView:[[self mainView] view] permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
179
|
+
}
|
180
|
+
else
|
181
|
+
#endif
|
182
|
+
[window addSubview:picker.view];
|
183
|
+
} @catch(NSException* theException) {
|
184
|
+
RAWLOG_ERROR2("startCameraPickerFromViewController failed(%s): %s", [[theException name] UTF8String], [[theException reason] UTF8String] );
|
185
|
+
return NO;
|
186
|
+
}
|
187
|
+
|
188
|
+
return YES;
|
189
|
+
}
|
190
|
+
|
191
|
+
- (void)takePicture:(NSString*) url {
|
192
|
+
[pickImageDelegate setPostUrl:url];
|
193
|
+
[self startCameraPicker:pickImageDelegate
|
194
|
+
sourceType:UIImagePickerControllerSourceTypeCamera];
|
195
|
+
}
|
196
|
+
|
197
|
+
- (void)choosePicture:(NSString*) url {
|
198
|
+
[pickImageDelegate setPostUrl:url];
|
199
|
+
[self startCameraPicker:pickImageDelegate
|
200
|
+
sourceType:UIImagePickerControllerSourceTypePhotoLibrary];
|
201
|
+
}
|
202
|
+
|
203
|
+
- (UIWindow*)rootWindow {
|
204
|
+
return window;
|
205
|
+
}
|
206
|
+
|
207
|
+
- (void)setMainView:(id<RhoMainView,NSObject>)view {
|
208
|
+
if (mainView == view)
|
209
|
+
return;
|
210
|
+
[mainView.view removeFromSuperview];
|
211
|
+
[mainView release];
|
212
|
+
mainView = [view retain];
|
213
|
+
[window addSubview:mainView.view];
|
214
|
+
}
|
215
|
+
|
216
|
+
- (void) showLoadingPage
|
217
|
+
{
|
218
|
+
NSFileManager *fileManager = [NSFileManager defaultManager];
|
219
|
+
|
220
|
+
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
|
221
|
+
NSString *htmPath = [NSString stringWithFormat:@"%@/apps/app/loading.html", resourcePath];
|
222
|
+
|
223
|
+
if ([fileManager fileExistsAtPath:htmPath]) {
|
224
|
+
NSError *err;
|
225
|
+
NSString *data = [NSString stringWithContentsOfFile:htmPath encoding:NSUTF8StringEncoding error:&err];
|
226
|
+
[mainView loadHTMLString:data];
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
- (void)doStartUp {
|
231
|
+
instance = self;
|
232
|
+
application = [UIApplication sharedApplication];
|
233
|
+
|
234
|
+
[NSThread setThreadPriority:1.0];
|
235
|
+
|
236
|
+
appManager = [AppManager instance];
|
237
|
+
//Configure AppManager
|
238
|
+
[appManager configure];
|
239
|
+
|
240
|
+
const char *szRootPath = rho_native_rhopath();
|
241
|
+
rho_logconf_Init(szRootPath);
|
242
|
+
rho_rhodesapp_create(szRootPath);
|
243
|
+
|
244
|
+
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:NO];
|
245
|
+
|
246
|
+
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
247
|
+
[window makeKeyAndVisible];
|
248
|
+
|
249
|
+
mainView = nil;
|
250
|
+
self.mainView = [[SimpleMainView alloc] initWithParentView:window frame:[Rhodes applicationFrame]];
|
251
|
+
[self showLoadingPage];
|
252
|
+
|
253
|
+
// Init controllers
|
254
|
+
logOptionsController = [[LogOptionsController alloc] init];
|
255
|
+
logViewController = [[LogViewController alloc] init];
|
256
|
+
|
257
|
+
dateTimePickerDelegate = [[DateTimePickerDelegate alloc] init];
|
258
|
+
pickImageDelegate = [[PickImageDelegate alloc] init];
|
259
|
+
|
260
|
+
rho_geoimpl_init();
|
261
|
+
rho_rhodesapp_start();
|
262
|
+
|
263
|
+
#ifdef __IPHONE_3_0
|
264
|
+
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
|
265
|
+
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
|
266
|
+
#endif
|
267
|
+
}
|
268
|
+
|
269
|
+
#ifdef __IPHONE_3_0
|
270
|
+
- (void)processDoSync:(NSDictionary *)userInfo
|
271
|
+
{
|
272
|
+
NSArray *do_sync = [userInfo objectForKey:@"do_sync"];
|
273
|
+
if (do_sync) {
|
274
|
+
NSEnumerator *enumerator = [do_sync objectEnumerator];
|
275
|
+
id url;
|
276
|
+
|
277
|
+
NSLog(@"do_sync array: ");
|
278
|
+
bool sync_all = false;
|
279
|
+
while ( url = [enumerator nextObject] ) {
|
280
|
+
NSLog( @"url = %@", url );
|
281
|
+
if ([@"all" caseInsensitiveCompare:url] == NSOrderedSame) {
|
282
|
+
sync_all = true;
|
283
|
+
} else {
|
284
|
+
//do sync of individual source
|
285
|
+
NSString* srcUrl = [url stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@" \t\r\n"]];
|
286
|
+
rho_sync_doSyncSourceByUrl([srcUrl cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
if (sync_all) {
|
291
|
+
rho_sync_doSyncAllSources(TRUE);
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}
|
295
|
+
- (void)processPushMessage:(NSDictionary *)userInfo
|
296
|
+
{
|
297
|
+
RAWLOG_INFO("Processing PUSH message...");
|
298
|
+
|
299
|
+
{
|
300
|
+
NSString* strData = [userInfo description];
|
301
|
+
const char* szData = [strData cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
302
|
+
if ( rho_rhodesapp_callPushCallback(szData) )
|
303
|
+
return;
|
304
|
+
}
|
305
|
+
|
306
|
+
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
307
|
+
if (aps) {
|
308
|
+
NSString *alert = [aps objectForKey:@"alert"];
|
309
|
+
if (alert && [alert length] > 0) {
|
310
|
+
NSLog(@"Push Alert: %@", alert);
|
311
|
+
rho_param *p = rho_param_str((char*)[alert UTF8String]);
|
312
|
+
[RhoAlert showPopup:p];
|
313
|
+
rho_param_free(p);
|
314
|
+
}
|
315
|
+
NSString *sound = [aps objectForKey:@"sound"];
|
316
|
+
if (sound && [sound length] > 0) {
|
317
|
+
NSLog(@"Sound file name: %@", sound);
|
318
|
+
[RhoAlert playFile:[@"/public/alerts/" stringByAppendingPathComponent:sound] mediaType:NULL];
|
319
|
+
}
|
320
|
+
NSString *vibrate = [aps objectForKey:@"vibrate"];
|
321
|
+
if (vibrate && [vibrate length] > 0) {
|
322
|
+
NSLog(@"Do vibrate...");
|
323
|
+
[RhoAlert vibrate:1];
|
324
|
+
}
|
325
|
+
}
|
326
|
+
[self processDoSync:userInfo];
|
327
|
+
}
|
328
|
+
#endif
|
329
|
+
|
330
|
+
- (void) saveLastUsedTime {
|
331
|
+
/*
|
332
|
+
int now = [[NSDate date] timeIntervalSince1970];
|
333
|
+
rho_conf_setInt("last_time_used",now);
|
334
|
+
rho_conf_save();
|
335
|
+
*/
|
336
|
+
}
|
337
|
+
|
338
|
+
- (void)playStart:(NSString *)fileName mediaType:(NSString *)type {
|
339
|
+
NSString *soundFilePath;
|
340
|
+
//hack to work around iphone limitation when it will play push alerts only from the main bundle root
|
341
|
+
if ([fileName hasPrefix:@"/public/alerts/"] || [fileName hasPrefix:@"/apps/public/alerts/"]) {
|
342
|
+
NSString *file = [fileName lastPathComponent];
|
343
|
+
soundFilePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:file];
|
344
|
+
} else {
|
345
|
+
soundFilePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:fileName];
|
346
|
+
}
|
347
|
+
NSLog(@"Playing %@: ", soundFilePath);
|
348
|
+
|
349
|
+
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
|
350
|
+
NSError* err = nil;
|
351
|
+
AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&err];
|
352
|
+
NSLog(@"Init media player returns: %@", err);
|
353
|
+
|
354
|
+
[fileURL release];
|
355
|
+
self.player = newPlayer;
|
356
|
+
[newPlayer release];
|
357
|
+
|
358
|
+
[player prepareToPlay];
|
359
|
+
[player setDelegate: self];
|
360
|
+
[self.player play];
|
361
|
+
}
|
362
|
+
|
363
|
+
- (void)playStop {
|
364
|
+
if (!self.player)
|
365
|
+
return;
|
366
|
+
|
367
|
+
[self.player stop];
|
368
|
+
self.player = nil;
|
369
|
+
}
|
370
|
+
|
371
|
+
// AVAudioPlayerDelegate implementation
|
372
|
+
|
373
|
+
- (void) audioPlayerDidFinishPlaying: (AVAudioPlayer *) player successfully: (BOOL) flag {
|
374
|
+
if (flag == YES) {
|
375
|
+
NSLog(@"Audio player finished playing...");
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error {
|
380
|
+
NSLog(@"Audio player decoding error %@", error);
|
381
|
+
}
|
382
|
+
|
383
|
+
// UIApplicationDelegate implementation
|
384
|
+
|
385
|
+
#ifdef __IPHONE_3_0
|
386
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
387
|
+
[self doStartUp];
|
388
|
+
[self processDoSync:launchOptions];
|
389
|
+
return NO;
|
390
|
+
}
|
391
|
+
#endif
|
392
|
+
|
393
|
+
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
394
|
+
[self doStartUp];
|
395
|
+
}
|
396
|
+
|
397
|
+
#ifdef __IPHONE_3_0
|
398
|
+
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
|
399
|
+
{
|
400
|
+
NSLog(@"Device token is %@", deviceToken);
|
401
|
+
|
402
|
+
NSMutableString *stringBuffer = [NSMutableString stringWithCapacity:([deviceToken length] * 2)];
|
403
|
+
const unsigned char *dataBuffer = [deviceToken bytes];
|
404
|
+
for (int i = 0; i < [deviceToken length]; ++i)
|
405
|
+
[stringBuffer appendFormat:@"%02x", (unsigned long)dataBuffer[ i ]];
|
406
|
+
|
407
|
+
char* szpin = strdup([stringBuffer cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
408
|
+
RAWLOG_INFO1("device pin: %s\n", szpin);
|
409
|
+
|
410
|
+
rho_clientregister_create(szpin);
|
411
|
+
free(szpin);
|
412
|
+
}
|
413
|
+
|
414
|
+
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
|
415
|
+
{
|
416
|
+
NSLog(@"Push Notification Error: %@", [error localizedDescription]);
|
417
|
+
}
|
418
|
+
|
419
|
+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
|
420
|
+
{
|
421
|
+
[self processPushMessage:userInfo];
|
422
|
+
}
|
423
|
+
#endif
|
424
|
+
|
425
|
+
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
426
|
+
#if 0
|
427
|
+
if (appStarted) {
|
428
|
+
//rho_rhodesapp_callAppActiveCallback();
|
429
|
+
/*
|
430
|
+
RhoDelegate* callback = [[RhoDelegate alloc] init];
|
431
|
+
char* callbackUrl = rho_conf_getString("app_did_become_active_callback");
|
432
|
+
if (callbackUrl && strlen(callbackUrl) > 0) {
|
433
|
+
callback.postUrl = [self normalizeUrl:[NSString stringWithCString:callbackUrl
|
434
|
+
encoding:[NSString defaultCStringEncoding]]];
|
435
|
+
[callback doCallback:@""];
|
436
|
+
}
|
437
|
+
[callback release];
|
438
|
+
*/
|
439
|
+
}
|
440
|
+
#endif // #if 0
|
441
|
+
}
|
442
|
+
|
443
|
+
- (void)applicationWillResignActive:(UIApplication *)application {
|
444
|
+
RAWLOG_INFO("Runner will resign active");
|
445
|
+
[self saveLastUsedTime];
|
446
|
+
}
|
447
|
+
|
448
|
+
- (void)applicationWillTerminate:(UIApplication *)application {
|
449
|
+
RAWLOG_INFO("Runner will terminate");
|
450
|
+
[self saveLastUsedTime];
|
451
|
+
rho_rhodesapp_destroy();
|
452
|
+
}
|
453
|
+
|
454
|
+
// UIWebViewDelegate imlementation
|
455
|
+
|
456
|
+
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
|
457
|
+
navigationType:(UIWebViewNavigationType)navigationType {
|
458
|
+
return YES;
|
459
|
+
}
|
460
|
+
|
461
|
+
- (void)webViewDidStartLoad:(UIWebView *)webview {
|
462
|
+
// TODO
|
463
|
+
//[self active];
|
464
|
+
}
|
465
|
+
|
466
|
+
- (void)webViewDidFinishLoad:(UIWebView *)webview {
|
467
|
+
[webview stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";"];
|
468
|
+
// TODO
|
469
|
+
/*
|
470
|
+
[self inactive];
|
471
|
+
|
472
|
+
if ([webView canGoBack]) {
|
473
|
+
backBtn.enabled = YES;
|
474
|
+
} else {
|
475
|
+
backBtn.enabled = NO;
|
476
|
+
}
|
477
|
+
if ([webView canGoForward]) {
|
478
|
+
forwardBtn.enabled = YES;
|
479
|
+
} else {
|
480
|
+
forwardBtn.enabled = NO;
|
481
|
+
}
|
482
|
+
|
483
|
+
//NSString* location = [webview stringByEvaluatingJavaScriptFromString:@"location.href"];
|
484
|
+
//rho_rhodesapp_keeplastvisitedurl( [location cStringUsingEncoding:[NSString defaultCStringEncoding]] );
|
485
|
+
|
486
|
+
if ([actionTarget respondsToSelector:@selector(hideSplash)])
|
487
|
+
[actionTarget performSelectorOnMainThread:@selector(hideSplash) withObject:nil waitUntilDone:NO];
|
488
|
+
*/
|
489
|
+
}
|
490
|
+
|
491
|
+
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
|
492
|
+
// TODO
|
493
|
+
}
|
494
|
+
|
495
|
+
// UITabBarControllerDelegate implementation
|
496
|
+
|
497
|
+
- (void)tabBarController:(UITabBarController *)tabBarController
|
498
|
+
didSelectViewController:(UIViewController *)viewController {
|
499
|
+
SEL sel = @selector(onSwitchTab);
|
500
|
+
if ([mainView respondsToSelector:sel])
|
501
|
+
[mainView performSelector:sel];
|
502
|
+
}
|
503
|
+
|
504
|
+
@end
|
505
|
+
|
506
|
+
// Native functions
|
507
|
+
|
508
|
+
void* rho_nativethread_start()
|
509
|
+
{
|
510
|
+
return [[NSAutoreleasePool alloc] init];
|
511
|
+
}
|
512
|
+
|
513
|
+
void rho_nativethread_end(void* pData)
|
514
|
+
{
|
515
|
+
NSAutoreleasePool *pool = (NSAutoreleasePool *)pData;
|
516
|
+
[pool release];
|
517
|
+
}
|
518
|
+
|
519
|
+
void rho_map_location(char* query) {
|
520
|
+
[[Rhodes sharedInstance] mapLocation:[NSString stringWithUTF8String:query]];
|
521
|
+
}
|
522
|
+
|
523
|
+
void _rho_ext_syscall(PARAMS_WRAPPER* params) {
|
524
|
+
[[Rhodes sharedInstance] sysCall:params];
|
525
|
+
}
|
526
|
+
|
527
|
+
void rho_conf_show_log() {
|
528
|
+
[[Rhodes sharedInstance] showLog];
|
529
|
+
}
|
530
|
+
|
531
|
+
void rho_sys_app_exit() {
|
532
|
+
exit(EXIT_SUCCESS);
|
533
|
+
}
|