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
@@ -11,7 +11,6 @@
|
|
11
11
|
#import <CoreLocation/CoreLocation.h>
|
12
12
|
#import "LocationController.h"
|
13
13
|
#import "logging/RhoLog.h"
|
14
|
-
#import "../Server/ServerHost.h"
|
15
14
|
#include "rubyext/GeoLocation.h"
|
16
15
|
|
17
16
|
#undef DEFAULT_LOGCATEGORY
|
@@ -201,8 +200,8 @@ _TimerCallBack(CFRunLoopTimerRef timer, void* context) {
|
|
201
200
|
}
|
202
201
|
|
203
202
|
void geo_update() {
|
204
|
-
|
205
|
-
|
203
|
+
LocationController *loc = [LocationController sharedInstance];
|
204
|
+
[loc performSelectorOnMainThread:[loc onUpdateLocation] withObject:nil waitUntilDone:NO];
|
206
205
|
}
|
207
206
|
|
208
207
|
double rho_geo_latitude() {
|
@@ -23,7 +23,7 @@
|
|
23
23
|
[super dealloc];
|
24
24
|
}
|
25
25
|
|
26
|
-
- (UIToolbar *)
|
26
|
+
- (UIToolbar *)newToolbar:(CGRect) frame
|
27
27
|
{
|
28
28
|
UIToolbar* toolbar = [UIToolbar new];
|
29
29
|
toolbar.barStyle = UIBarStyleBlackOpaque;
|
@@ -59,6 +59,7 @@
|
|
59
59
|
[toolbar setItems:items animated:NO];
|
60
60
|
[saveItem release];
|
61
61
|
[cancelItem release];
|
62
|
+
[flexItem release];
|
62
63
|
|
63
64
|
return toolbar;
|
64
65
|
}
|
@@ -136,7 +137,7 @@
|
|
136
137
|
[self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
|
137
138
|
CGRect mainViewBounds = self.view.bounds;
|
138
139
|
|
139
|
-
UIToolbar* toolbar = [self
|
140
|
+
UIToolbar* toolbar = [[self newToolbar:mainViewBounds] autorelease];
|
140
141
|
[self.view addSubview:toolbar];
|
141
142
|
|
142
143
|
// create and configure the table view
|
@@ -39,7 +39,7 @@ extern void rho_conf_send_log();
|
|
39
39
|
return textView;
|
40
40
|
}
|
41
41
|
|
42
|
-
- (UIToolbar *)
|
42
|
+
- (UIToolbar *)newToolbar:(CGRect) frame
|
43
43
|
{
|
44
44
|
UIToolbar* toolbar = [UIToolbar new];
|
45
45
|
toolbar.barStyle = UIBarStyleBlackOpaque;
|
@@ -86,6 +86,8 @@ extern void rho_conf_send_log();
|
|
86
86
|
[refreshItem release];
|
87
87
|
[settingsItem release];
|
88
88
|
[flexItem release];
|
89
|
+
[sendItem release];
|
90
|
+
[clearItem release];
|
89
91
|
|
90
92
|
return toolbar;
|
91
93
|
}
|
@@ -96,7 +98,7 @@ extern void rho_conf_send_log();
|
|
96
98
|
self.view = [[UIView alloc] initWithFrame:frame];
|
97
99
|
CGRect mainViewBounds = self.view.bounds;
|
98
100
|
|
99
|
-
UIToolbar* toolbar = [self
|
101
|
+
UIToolbar* toolbar = [[self newToolbar:mainViewBounds] autorelease];
|
100
102
|
[self.view addSubview:toolbar];
|
101
103
|
|
102
104
|
CGFloat toolbarHeight = [toolbar frame].size.height;
|
@@ -19,7 +19,7 @@
|
|
19
19
|
annotation = nil;
|
20
20
|
if ( (element.coordinate.latitude==10000) ||
|
21
21
|
(element.coordinate.longitude==10000) ) {
|
22
|
-
NSString* address = [element
|
22
|
+
NSString* address = [element address];
|
23
23
|
if ( ([address length] > 0) && [self geocode:element]) {
|
24
24
|
annotation = element;
|
25
25
|
}
|
@@ -53,7 +53,7 @@
|
|
53
53
|
BOOL retvar = TRUE;
|
54
54
|
currentAnnotation = annotation;
|
55
55
|
NSMutableString *url = [[NSMutableString alloc] initWithString:kGeoCodeURL];
|
56
|
-
[url appendString:[annotation
|
56
|
+
[url appendString:[annotation address]];
|
57
57
|
[url appendFormat:@"&output=xml"];
|
58
58
|
[url replaceOccurrencesOfString:@"ä" withString:@"ae" options:1 range:(NSRange){0,[url length]}];
|
59
59
|
[url replaceOccurrencesOfString:@"ö" withString:@"oe" options:1 range:(NSRange){0,[url length]}];
|
@@ -87,10 +87,10 @@
|
|
87
87
|
}
|
88
88
|
|
89
89
|
-(CLLocation *)stringCooridinatesToCLLocation{
|
90
|
-
NSArray *array = [[currentAnnotation
|
90
|
+
NSArray *array = [[currentAnnotation coordinateString] componentsSeparatedByString:@","];
|
91
91
|
double longitude = [[array objectAtIndex:0] doubleValue];
|
92
92
|
double lattitude = [[array objectAtIndex:1] doubleValue];
|
93
|
-
CLLocation *location = [[CLLocation alloc] initWithLatitude:lattitude longitude:longitude];
|
93
|
+
CLLocation *location = [[[CLLocation alloc] initWithLatitude:lattitude longitude:longitude] autorelease];
|
94
94
|
[currentAnnotation setCoordinate:location.coordinate];
|
95
95
|
return location;
|
96
96
|
}
|
@@ -106,24 +106,16 @@
|
|
106
106
|
}
|
107
107
|
|
108
108
|
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
|
109
|
+
string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
110
|
+
string = [string stringByReplacingOccurrencesOfString:@"\\n" withString:@""];
|
111
|
+
if ([string length] == 0)
|
112
|
+
return;
|
113
|
+
|
109
114
|
if([theElement isEqualToString:@"address"])
|
110
|
-
|
111
|
-
}
|
112
|
-
else if([string isEqualToString:@"\t"]){
|
113
|
-
}
|
114
|
-
else{
|
115
|
-
[currentAnnotation setResolvedAddress:string];
|
116
|
-
}
|
115
|
+
[currentAnnotation setResolvedAddress:string];
|
117
116
|
|
118
|
-
if([theElement isEqualToString:@"coordinates"])
|
119
|
-
|
120
|
-
}
|
121
|
-
else if([string isEqualToString:@"\t"]){
|
122
|
-
}
|
123
|
-
else{
|
124
|
-
[currentAnnotation setCoordinateString:string];
|
125
|
-
}
|
126
|
-
}
|
117
|
+
if([theElement isEqualToString:@"coordinates"])
|
118
|
+
[currentAnnotation setCoordinateString:string];
|
127
119
|
}
|
128
120
|
|
129
121
|
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
|
@@ -13,22 +13,18 @@
|
|
13
13
|
|
14
14
|
|
15
15
|
@interface MapAnnotation : NSObject<MKAnnotation> {
|
16
|
-
NSString *
|
17
|
-
|
16
|
+
NSString *title, *subtitle, *address, *url;
|
17
|
+
NSString *coordinateString,*resolvedAddress;
|
18
18
|
CLLocationCoordinate2D coordinate;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- (void)setResolvedAddress:(NSString*)resolved_address;
|
29
|
-
- (NSString*)resolved_address;
|
30
|
-
- (void)setUrl:(NSString*)url;
|
31
|
-
- (NSString*)url;
|
21
|
+
@property (nonatomic,copy) NSString *title;
|
22
|
+
@property (nonatomic,copy) NSString *subtitle;
|
23
|
+
@property (nonatomic,copy) NSString *address;
|
24
|
+
@property (nonatomic,copy) NSString *url;
|
25
|
+
@property (nonatomic,copy) NSString *coordinateString;
|
26
|
+
@property (nonatomic,copy) NSString *resolvedAddress;
|
27
|
+
@property (nonatomic,assign) CLLocationCoordinate2D coordinate;
|
32
28
|
|
33
29
|
@end
|
34
30
|
|
@@ -12,82 +12,34 @@
|
|
12
12
|
|
13
13
|
@implementation MapAnnotation
|
14
14
|
|
15
|
-
@synthesize coordinate;
|
15
|
+
@synthesize title, subtitle, address, url, coordinateString, resolvedAddress, coordinate;
|
16
16
|
|
17
17
|
-(id) init {
|
18
18
|
[super init];
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
title = [[NSString alloc] initWithFormat:@""];
|
20
|
+
subtitle = [[NSString alloc] initWithFormat:@""];
|
21
|
+
address = [[NSString alloc] initWithFormat:@""];
|
22
|
+
coordinateString = [[NSMutableString alloc] initWithFormat:@""];
|
23
|
+
resolvedAddress = [[NSMutableString alloc] initWithFormat:@""];
|
24
|
+
url = [[NSString alloc] initWithFormat:@""];
|
25
25
|
return self;
|
26
26
|
}
|
27
27
|
|
28
28
|
-(void) dealloc {
|
29
|
-
[
|
30
|
-
[
|
31
|
-
[
|
32
|
-
[
|
33
|
-
[
|
34
|
-
[
|
29
|
+
[title release];
|
30
|
+
[subtitle release];
|
31
|
+
[address release];
|
32
|
+
[coordinateString release];
|
33
|
+
[resolvedAddress release];
|
34
|
+
[url release];
|
35
35
|
[super dealloc];
|
36
36
|
}
|
37
37
|
|
38
|
-
- (void)
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
- (void)setTitle:(NSString*)title {
|
43
|
-
_title = [title copy];
|
44
|
-
}
|
45
|
-
|
46
|
-
- (NSString *)title {
|
47
|
-
return _title;
|
48
|
-
}
|
49
|
-
|
50
|
-
- (void)setSubtitle:(NSString*)subtitle {
|
51
|
-
_subtitle = [subtitle copy];
|
52
|
-
}
|
53
|
-
|
54
|
-
- (NSString *)subtitle {
|
55
|
-
return _subtitle;
|
56
|
-
}
|
57
|
-
|
58
|
-
- (void)setAddress:(NSString*)street_address {
|
59
|
-
_street_address = [street_address copy];
|
60
|
-
}
|
61
|
-
|
62
|
-
- (NSString*)street_address {
|
63
|
-
return _street_address;
|
64
|
-
}
|
65
|
-
|
66
|
-
- (void)setCoordinateString:(NSString*)coordinate_string {
|
67
|
-
[_coordinate_string appendString:coordinate_string];
|
68
|
-
}
|
69
|
-
|
70
|
-
- (NSString*)coordinate_string {
|
71
|
-
return _coordinate_string;
|
72
|
-
}
|
73
|
-
|
74
|
-
- (void)setResolvedAddress:(NSString*)resolved_address {
|
75
|
-
[_resolved_address appendString:resolved_address];
|
76
|
-
}
|
77
|
-
|
78
|
-
|
79
|
-
- (NSString*)resolved_address {
|
80
|
-
return _resolved_address;
|
81
|
-
}
|
82
|
-
|
83
|
-
- (void)setUrl:(NSString*)url {
|
84
|
-
const char *surl = [url UTF8String];
|
38
|
+
- (void)setUrl:(NSString*)u {
|
39
|
+
const char *surl = [u UTF8String];
|
85
40
|
const char *norm_url = rho_http_normalizeurl(surl);
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
- (NSString*)url {
|
90
|
-
return _url;
|
41
|
+
[url release];
|
42
|
+
url = [[NSString stringWithUTF8String:norm_url] copy];
|
91
43
|
}
|
92
44
|
|
93
45
|
@end
|
@@ -26,18 +26,12 @@
|
|
26
26
|
MKCoordinateRegion region;
|
27
27
|
NSString *gapikey;
|
28
28
|
//IBOutlet UISegmentedControl *mapType;
|
29
|
-
@public
|
30
|
-
id actionTarget;
|
31
|
-
SEL onNavigate;
|
32
|
-
|
33
29
|
}
|
34
30
|
|
35
31
|
//
|
36
|
-
@property (assign) id actionTarget;
|
37
|
-
@property (assign) SEL onNavigate;
|
38
32
|
@property (copy) NSString* gapikey;
|
39
33
|
|
40
|
-
|
34
|
+
+ (void)createMap:(rho_param*)params;
|
41
35
|
- (void)setParams:(rho_param*)params;
|
42
36
|
|
43
37
|
@end
|
@@ -8,15 +8,37 @@
|
|
8
8
|
|
9
9
|
#import "MapAnnotation.h"
|
10
10
|
#import "MapViewController.h"
|
11
|
-
#import "
|
11
|
+
#import "Rhodes.h"
|
12
|
+
|
13
|
+
#include "common/rhoparams.h"
|
14
|
+
#include "logging/RhoLog.h"
|
12
15
|
|
13
|
-
#import "logging/RhoLog.h"
|
14
16
|
#undef DEFAULT_LOGCATEGORY
|
15
17
|
#define DEFAULT_LOGCATEGORY "MapView"
|
16
18
|
|
19
|
+
@interface RhoCreateMapTask : NSObject {}
|
20
|
+
+ (void)run:(NSValue*)value;
|
21
|
+
@end
|
22
|
+
|
23
|
+
@implementation RhoCreateMapTask
|
24
|
+
+ (void)run:(NSValue*)value {
|
25
|
+
MapViewController* map = [[MapViewController alloc] init];
|
26
|
+
[map setParams:[value pointerValue]];
|
27
|
+
UIWindow *window = [[Rhodes sharedInstance] rootWindow];
|
28
|
+
[window addSubview:map.view];
|
29
|
+
//[map release];
|
30
|
+
}
|
31
|
+
@end
|
32
|
+
|
17
33
|
@implementation MapViewController
|
18
34
|
|
19
|
-
@synthesize
|
35
|
+
@synthesize gapikey;
|
36
|
+
|
37
|
+
+ (void)createMap:(rho_param *)params {
|
38
|
+
id runnable = [RhoCreateMapTask class];
|
39
|
+
id arg = [NSValue valueWithPointer:params];
|
40
|
+
[Rhodes performOnUiThread:runnable arg:arg wait:NO];
|
41
|
+
}
|
20
42
|
|
21
43
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
22
44
|
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
@@ -150,6 +172,7 @@
|
|
150
172
|
if (subtitle) [annObj setSubtitle:subtitle];
|
151
173
|
if (url) [annObj setUrl:url];
|
152
174
|
[annotations addObject:annObj];
|
175
|
+
[annObj release];
|
153
176
|
}
|
154
177
|
}
|
155
178
|
ggeoCoder = [[GoogleGeocoder alloc] initWithAnnotations:annotations apikey:gapikey];
|
@@ -190,6 +213,7 @@
|
|
190
213
|
target:self action:@selector(close_clicked:)];
|
191
214
|
[toolbar setItems:[NSArray arrayWithObjects:closeButton,nil]];
|
192
215
|
[self.view addSubview:toolbar];
|
216
|
+
[closeButton release];
|
193
217
|
|
194
218
|
CGRect rectMapArea = CGRectMake(0, 0, rootViewWidth, rootViewHeight - toolbarHeight);
|
195
219
|
mapView=[[MKMapView alloc] initWithFrame:rectMapArea];
|
@@ -221,17 +245,13 @@
|
|
221
245
|
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
|
222
246
|
calloutAccessoryControlTapped:(UIControl *)control
|
223
247
|
{
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
[actionTarget performSelector:onNavigate withObject:webViewUrl];
|
232
|
-
[self dismissModalViewControllerAnimated:YES];
|
233
|
-
self.view.hidden = YES;
|
234
|
-
}
|
248
|
+
MapAnnotation *ann = (MapAnnotation*)[view annotation];
|
249
|
+
NSString* url = [ann url];
|
250
|
+
NSLog(@"Callout tapped... Url = %@\n", url);
|
251
|
+
id<RhoMainView> mainView = [[Rhodes sharedInstance] mainView];
|
252
|
+
[mainView navigateRedirect:url tab:[mainView activeTab]];
|
253
|
+
[self dismissModalViewControllerAnimated:YES];
|
254
|
+
self.view.hidden = YES;
|
235
255
|
}
|
236
256
|
|
237
257
|
- (void) close_clicked:(id)sender {
|
@@ -269,24 +289,24 @@
|
|
269
289
|
}*/
|
270
290
|
|
271
291
|
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
|
272
|
-
|
273
|
-
|
292
|
+
NSLog(@"Reverse Geocoder Errored");
|
274
293
|
}
|
275
294
|
|
276
295
|
- (void)didFindAddress:(MapAnnotation*)annotation {
|
277
|
-
|
296
|
+
[mapView addAnnotation:annotation];
|
278
297
|
}
|
279
298
|
|
280
299
|
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
|
281
|
-
|
282
|
-
|
283
|
-
|
300
|
+
NSLog(@"Reverse Geocoder completed");
|
301
|
+
//mPlacemark=placemark;
|
302
|
+
//[mapView addAnnotation:placemark];
|
284
303
|
}
|
285
304
|
|
286
305
|
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
|
287
|
-
|
288
|
-
|
289
|
-
|
306
|
+
MKPinAnnotationView *annView = [[[MKPinAnnotationView alloc]
|
307
|
+
initWithAnnotation:annotation reuseIdentifier:@"currentloc"] autorelease];
|
308
|
+
annView.animatesDrop = TRUE;
|
309
|
+
annView.canShowCallout = YES;
|
290
310
|
if ([annotation isKindOfClass:[MapAnnotation class]]) {
|
291
311
|
MapAnnotation* ann = (MapAnnotation*)annotation;
|
292
312
|
NSString* url = [ann url];
|
@@ -294,9 +314,15 @@
|
|
294
314
|
[annView setRightCalloutAccessoryView:[UIButton buttonWithType:UIButtonTypeDetailDisclosure]];
|
295
315
|
}
|
296
316
|
}
|
297
|
-
|
317
|
+
return annView;
|
298
318
|
}
|
299
319
|
|
300
320
|
@end
|
301
321
|
|
302
|
-
#endif
|
322
|
+
#endif
|
323
|
+
|
324
|
+
void mapview_create(rho_param *p) {
|
325
|
+
#ifdef __IPHONE_3_0
|
326
|
+
[MapViewController createMap:rho_param_dup(p)];
|
327
|
+
#endif
|
328
|
+
}
|
@@ -12,15 +12,3 @@
|
|
12
12
|
#define TOOLBAR_TYPE 0
|
13
13
|
#define TABBAR_TYPE 1
|
14
14
|
#define NOBAR_TYPE 2
|
15
|
-
|
16
|
-
@interface NativeBar : NSObject
|
17
|
-
{
|
18
|
-
@private
|
19
|
-
int barType;
|
20
|
-
NSArray* barItemDataArray;
|
21
|
-
}
|
22
|
-
|
23
|
-
@property(assign) int barType;
|
24
|
-
@property(nonatomic, retain) NSArray* barItemDataArray;
|
25
|
-
|
26
|
-
@end
|
@@ -6,11 +6,130 @@
|
|
6
6
|
// Copyright 2009 Home. All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
+
#include "common/rhoparams.h"
|
9
10
|
#import "NativeBar.h"
|
11
|
+
#import "Rhodes.h"
|
12
|
+
#import "SimpleMainView.h"
|
13
|
+
#import "TabbedMainView.h"
|
10
14
|
|
15
|
+
#import "logging/RhoLog.h"
|
11
16
|
|
12
|
-
|
17
|
+
#undef DEFAULT_LOGCATEGORY
|
18
|
+
#define DEFAULT_LOGCATEGORY "NativeBar"
|
13
19
|
|
14
|
-
@
|
20
|
+
@interface RhoNativeBarCreateTask : NSObject {}
|
21
|
+
+ (void)run:(NSValue*)value :(NSArray*)items;
|
22
|
+
@end
|
23
|
+
|
24
|
+
@implementation RhoNativeBarCreateTask
|
25
|
+
+ (void)run:(NSValue*)value :(NSArray*)items {
|
26
|
+
int type;
|
27
|
+
[value getValue:&type];
|
28
|
+
|
29
|
+
id view = nil;
|
30
|
+
|
31
|
+
UIWindow *window = [[Rhodes sharedInstance] rootWindow];
|
32
|
+
CGRect frame = [Rhodes applicationFrame];
|
33
|
+
|
34
|
+
switch (type) {
|
35
|
+
case NOBAR_TYPE:
|
36
|
+
view = [[SimpleMainView alloc] initWithParentView:window frame:frame];
|
37
|
+
break;
|
38
|
+
case TOOLBAR_TYPE:
|
39
|
+
view = [[SimpleMainView alloc] initWithParentView:window frame:frame toolbar:items];
|
40
|
+
break;
|
41
|
+
case TABBAR_TYPE:
|
42
|
+
view = [[TabbedMainView alloc] initWithParentView:window frame:frame items:items];
|
43
|
+
break;
|
44
|
+
default:
|
45
|
+
RAWLOG_ERROR1("Unknown bar type passed: %d", type);
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
[Rhodes sharedInstance].mainView = view;
|
50
|
+
[view release];
|
51
|
+
}
|
52
|
+
@end
|
53
|
+
|
54
|
+
@interface RhoNativeBarSwitchTabTask : NSObject {}
|
55
|
+
+ (void)run:(NSValue*)value;
|
56
|
+
@end
|
15
57
|
|
58
|
+
@implementation RhoNativeBarSwitchTabTask
|
59
|
+
+ (void)run:(NSValue*)value {
|
60
|
+
int index;
|
61
|
+
[value getValue:&index];
|
62
|
+
[[[Rhodes sharedInstance] mainView] switchTab:index];
|
63
|
+
}
|
16
64
|
@end
|
65
|
+
|
66
|
+
void create_nativebar(int bar_type, rho_param *p)
|
67
|
+
{
|
68
|
+
if (p->type != RHO_PARAM_ARRAY) {
|
69
|
+
RAWLOG_ERROR("Unexpected parameter type for create_nativebar, should be Array");
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
|
73
|
+
int size = p->v.array->size;
|
74
|
+
NSMutableArray *items = [NSMutableArray arrayWithCapacity:size];
|
75
|
+
for (int i = 0; i < size; ++i) {
|
76
|
+
rho_param *hash = p->v.array->value[i];
|
77
|
+
if (hash->type != RHO_PARAM_HASH) {
|
78
|
+
RAWLOG_ERROR("Unexpected type of array item for create_nativebar, should be Hash");
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
|
82
|
+
const char *label = NULL;
|
83
|
+
const char *action = NULL;
|
84
|
+
const char *icon = NULL;
|
85
|
+
const char *reload = NULL;
|
86
|
+
|
87
|
+
for (int j = 0, lim = hash->v.hash->size; j < lim; ++j) {
|
88
|
+
const char *name = hash->v.hash->name[j];
|
89
|
+
rho_param *value = hash->v.hash->value[j];
|
90
|
+
if (value->type != RHO_PARAM_STRING) {
|
91
|
+
RAWLOG_ERROR1("Unexpected '%s' type, should be String", name);
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
|
95
|
+
if (strcasecmp(name, "label") == 0)
|
96
|
+
label = value->v.string;
|
97
|
+
else if (strcasecmp(name, "action") == 0)
|
98
|
+
action = value->v.string;
|
99
|
+
else if (strcasecmp(name, "icon") == 0)
|
100
|
+
icon = value->v.string;
|
101
|
+
else if (strcasecmp(name, "reload") == 0)
|
102
|
+
reload = value->v.string;
|
103
|
+
}
|
104
|
+
|
105
|
+
if (label == NULL && bar_type == TOOLBAR_TYPE)
|
106
|
+
label = "";
|
107
|
+
|
108
|
+
if (label == NULL || action == NULL) {
|
109
|
+
RAWLOG_ERROR("Illegal argument for create_nativebar");
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
|
113
|
+
[items addObject:[NSString stringWithUTF8String:label]];
|
114
|
+
[items addObject:[NSString stringWithUTF8String:action]];
|
115
|
+
[items addObject:[NSString stringWithUTF8String:(icon ? icon : "")]];
|
116
|
+
[items addObject:[NSString stringWithUTF8String:(reload ? reload : "false")]];
|
117
|
+
}
|
118
|
+
|
119
|
+
id runnable = [RhoNativeBarCreateTask class];
|
120
|
+
id arg1 = [NSValue valueWithBytes:&bar_type objCType:@encode(int)];
|
121
|
+
[Rhodes performOnUiThread:runnable arg:arg1 arg:items wait:YES];
|
122
|
+
}
|
123
|
+
|
124
|
+
void remove_nativebar() {
|
125
|
+
int bar_type = NOBAR_TYPE;
|
126
|
+
id runnable = [RhoNativeBarCreateTask class];
|
127
|
+
id arg1 = [NSValue valueWithBytes:&bar_type objCType:@encode(int)];
|
128
|
+
[Rhodes performOnUiThread:runnable arg:arg1 arg:nil wait:YES];
|
129
|
+
}
|
130
|
+
|
131
|
+
void nativebar_switch_tab(int index) {
|
132
|
+
id runnable = [RhoNativeBarSwitchTabTask class];
|
133
|
+
id arg = [NSValue valueWithBytes:&index objCType:@encode(int)];
|
134
|
+
[Rhodes performOnUiThread:runnable arg:arg wait:YES];
|
135
|
+
}
|