rhodes 3.2.3 → 3.3.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (368) hide show
  1. data/CHANGELOG +10 -0
  2. data/Rakefile +153 -46
  3. data/doc/build.txt +261 -102
  4. data/doc/configuration.txt +5 -2
  5. data/doc/device-caps.txt +134 -23
  6. data/doc/extensions.txt +922 -69
  7. data/doc/generator.txt +96 -39
  8. data/doc/install.txt +35 -19
  9. data/doc/jqt-jqm-transition.txt +17 -1
  10. data/doc/rhom.txt +23 -2
  11. data/doc/rhostudio-eclipse.txt +49 -0
  12. data/doc/rhostudio-test-plan.txt +440 -0
  13. data/doc/simulator.txt +1 -1
  14. data/doc/synchronization.txt +40 -1
  15. data/lib/build/jake.rb +108 -7
  16. data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +0 -35
  17. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +8 -2
  18. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +195 -195
  19. data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +6 -0
  20. data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +5 -0
  21. data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +64 -20
  22. data/lib/extensions/debugger/CHANGELOG +3 -0
  23. data/lib/extensions/debugger/debugger.rb +26 -21
  24. data/lib/extensions/digest-md5/ext/Rakefile +5 -5
  25. data/lib/extensions/digest-md5/ext/build +10 -1
  26. data/lib/extensions/digest-md5/ext/defs.h +19 -0
  27. data/lib/extensions/digest-md5/ext/digest-md5.vcproj +317 -9
  28. data/lib/extensions/digest-md5/ext/iphone/Dmd5.xcodeproj/project.pbxproj +290 -0
  29. data/lib/extensions/digest-md5/ext/iphone/Dmd5_Prefix.pch +7 -0
  30. data/lib/extensions/digest-md5/ext/iphone/Rakefile +79 -0
  31. data/lib/extensions/digest-sha1/ext/Rakefile +5 -5
  32. data/lib/extensions/digest-sha1/ext/build +10 -1
  33. data/lib/extensions/digest-sha1/ext/defs.h +19 -0
  34. data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +317 -9
  35. data/lib/extensions/digest-sha1/ext/iphone/Dsha1.xcodeproj/project.pbxproj +278 -0
  36. data/lib/extensions/digest-sha1/ext/iphone/Dsha1_Prefix.pch +7 -0
  37. data/lib/extensions/digest-sha1/ext/iphone/Rakefile +79 -0
  38. data/lib/extensions/digest/ext/Rakefile +5 -5
  39. data/lib/extensions/digest/ext/build +10 -1
  40. data/lib/extensions/digest/ext/digest.vcproj +317 -9
  41. data/lib/extensions/digest/ext/iphone/Digest.xcodeproj/project.pbxproj +270 -0
  42. data/lib/extensions/digest/ext/iphone/Digest_Prefix.pch +7 -0
  43. data/lib/extensions/digest/ext/iphone/Rakefile +79 -0
  44. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +10 -2
  45. data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +6 -0
  46. data/lib/extensions/fcntl/ext/Rakefile +5 -5
  47. data/lib/extensions/fcntl/ext/build +9 -1
  48. data/lib/extensions/fcntl/ext/iphone/Fcntl.xcodeproj/project.pbxproj +262 -0
  49. data/lib/extensions/fcntl/ext/iphone/Fcntl_Prefix.pch +7 -0
  50. data/lib/extensions/fcntl/ext/iphone/Rakefile +79 -0
  51. data/lib/extensions/net-http/net/http.rb +9 -7
  52. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +64 -20
  53. data/lib/extensions/rhoxml/rexml/document.rb +3 -2
  54. data/lib/extensions/rhoxml/rexml/instruction.rb +70 -0
  55. data/lib/framework/builtinME.rb +9 -0
  56. data/lib/framework/date/format.rb +1 -1
  57. data/lib/framework/dateME.rb +19 -2
  58. data/lib/framework/rho/rho.rb +15 -4
  59. data/lib/framework/rho/rhoapplication.rb +1 -0
  60. data/lib/framework/rho/rhocontact.rb +10 -27
  61. data/lib/framework/rho/rhoevent_c.rb +8 -2
  62. data/lib/framework/rho/rhosupport.rb +25 -0
  63. data/lib/framework/rhodes.rb +1 -1
  64. data/lib/framework/rhoframework.rb +15 -0
  65. data/lib/framework/rholang/localization_simplified.rb +8 -10
  66. data/lib/framework/rhom/rhom_object_factory.rb +8 -2
  67. data/lib/framework/version.rb +1 -1
  68. data/lib/rhodes.rb +1 -1
  69. data/platform/android/Rhodes/jni/Application.mk +2 -1
  70. data/platform/android/Rhodes/jni/include/rhodes.h +9 -0
  71. data/platform/android/Rhodes/jni/src/callbacks.cpp +31 -1
  72. data/platform/android/Rhodes/jni/src/event.cpp +75 -31
  73. data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
  74. data/platform/android/Rhodes/jni/src/phonebook.cpp +73 -9
  75. data/platform/android/Rhodes/jni/src/rhodes.cpp +21 -0
  76. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +16 -24
  77. data/platform/android/Rhodes/jni/src/signature.cpp +27 -1
  78. data/platform/android/Rhodes/{default.properties → project.properties} +2 -2
  79. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +14 -12
  80. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +14 -12
  81. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +38 -115
  82. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +69 -52
  83. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +9 -0
  84. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +21 -1
  85. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraOldService.java +1 -1
  86. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +1 -1
  87. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraService.java +1 -1
  88. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +38 -6
  89. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +212 -1
  90. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +82 -125
  91. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
  92. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +2 -1
  93. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +39 -19
  94. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +106 -136
  95. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +26 -25
  96. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +1 -1
  97. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +40 -0
  98. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +47 -0
  99. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java +33 -0
  100. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +33 -0
  101. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality04.java +34 -0
  102. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +75 -0
  103. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality06.java +34 -0
  104. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +34 -0
  105. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +44 -0
  106. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality09.java +34 -0
  107. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality10.java +34 -0
  108. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +73 -0
  109. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +57 -6
  110. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +2 -2
  111. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +322 -76
  112. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +11 -6
  113. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +5 -5
  114. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -1
  115. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +125 -0
  116. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +2 -3
  117. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebView.java +16 -0
  118. data/platform/android/build/RhodesSRC_build.files +14 -0
  119. data/platform/android/build/android.rake +149 -147
  120. data/platform/android/build/android_tools.rb +58 -0
  121. data/platform/android/build/librhocommon_build.files +1 -0
  122. data/platform/android/build/libruby_build.files +3 -0
  123. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +11 -1
  124. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +11 -5
  125. data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +3 -2
  126. data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +2 -0
  127. data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +20 -8
  128. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +9 -6
  129. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +45 -18
  130. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -2
  131. data/platform/bb/build/bb.rake +84 -70
  132. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +106 -14
  133. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -1
  134. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +108 -16
  135. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +10 -5
  136. data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +21 -4
  137. data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +17 -0
  138. data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +8 -5
  139. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +3 -1
  140. data/platform/iphone/Classes/AppManager/AppManager.m +15 -3
  141. data/platform/iphone/Classes/Event/Event.m +45 -2
  142. data/platform/iphone/Classes/MapView/MapViewController.m +8 -4
  143. data/platform/iphone/Classes/Phonebook/phonebook.m +30 -7
  144. data/platform/iphone/Classes/Rhodes.h +11 -1
  145. data/platform/iphone/Classes/Rhodes.m +141 -9
  146. data/platform/iphone/Classes/Signature/SignatureDelegate.m +27 -1
  147. data/platform/iphone/Classes/SimpleMainView.h +1 -0
  148. data/platform/iphone/Classes/SimpleMainView.m +4 -0
  149. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +31 -1
  150. data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +10 -0
  151. data/platform/iphone/rbuild/iphone.rake +33 -6
  152. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +10 -2
  153. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +22 -2
  154. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +14 -0
  155. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +10 -0
  156. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  157. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  158. data/platform/osx/build/osx.rake +58 -7
  159. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +427 -69
  160. data/platform/shared/RhoConnectClient/RhoConnectClient.h +21 -2
  161. data/platform/shared/common/Android.mk +2 -1
  162. data/platform/shared/common/AutoPointer.h +23 -0
  163. data/platform/shared/common/BundleManager.cpp +333 -0
  164. data/platform/shared/common/RhoFile.cpp +206 -23
  165. data/platform/shared/common/RhoFile.h +14 -4
  166. data/platform/shared/common/RhoFilePath.h +18 -0
  167. data/platform/shared/common/RhoStd.h +11 -1
  168. data/platform/shared/common/RhoThread.h +4 -1
  169. data/platform/shared/common/RhodesApp.cpp +31 -8
  170. data/platform/shared/common/RhodesApp.h +14 -0
  171. data/platform/shared/common/RhodesAppBase.cpp +6 -6
  172. data/platform/shared/common/RhodesAppBase.h +1 -1
  173. data/platform/shared/common/emml.h +34 -0
  174. data/platform/shared/common/iphone/RhoFileImpl.m +30 -2
  175. data/platform/shared/common/map/BaseMapEngine.cpp +3 -3
  176. data/platform/shared/common/map/GeocodingMapEngine.cpp +205 -14
  177. data/platform/shared/common/map/GeocodingMapEngine.h +25 -2
  178. data/platform/shared/common/map/MapEngine.cpp +24 -2
  179. data/platform/shared/common/map/MapEngine.h +23 -12
  180. data/platform/shared/common/phonebook/PhonebookParams.cpp +99 -0
  181. data/platform/shared/common/phonebook/PhonebookParams.h +52 -0
  182. data/platform/shared/common/rhoparams.cpp +14 -0
  183. data/platform/shared/common/rhoparams.h +1 -0
  184. data/platform/shared/db/DBAdapter.cpp +43 -24
  185. data/platform/shared/db/DBAdapter.h +6 -1
  186. data/platform/shared/db/DBAttrManager.cpp +50 -1
  187. data/platform/shared/logging/RhoLog.h +3 -0
  188. data/platform/shared/logging/RhoLogSink.cpp +5 -1
  189. data/platform/shared/net/CURLNetRequest.cpp +2 -0
  190. data/platform/shared/qt/rhodes/QtMainWindow.cpp +14 -1
  191. data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +2 -2
  192. data/platform/shared/qt/rhodes/impl/RhoFileImpl.cpp +1 -1
  193. data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +14 -2
  194. data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +16 -2
  195. data/platform/shared/qt/rhodes/main.cpp +28 -0
  196. data/platform/shared/qt/rhodes/rhodes.pro +3 -0
  197. data/platform/shared/qt/rholib/rholib.pro +2 -1
  198. data/platform/shared/qt/rubylib/rubylib.pro +2 -1
  199. data/platform/shared/ruby/Android.mk +3 -0
  200. data/platform/shared/ruby/class.c +7 -0
  201. data/platform/shared/ruby/compile.c +18 -10
  202. data/platform/shared/ruby/encdb.h +18 -8
  203. data/platform/shared/ruby/eval.c +108 -2
  204. data/platform/shared/ruby/ext/alert/alert_wrap.c +64 -20
  205. data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +64 -20
  206. data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +67 -23
  207. data/platform/shared/ruby/ext/calendar/calendar_wrap.c +64 -20
  208. data/platform/shared/ruby/ext/calendar/event_wrap.c +64 -20
  209. data/platform/shared/ruby/ext/camera/camera_wrap.c +64 -20
  210. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +64 -20
  211. data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -0
  212. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +127 -26
  213. data/platform/shared/ruby/ext/mapview/mapview_wrap.c +64 -20
  214. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +65 -21
  215. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +64 -20
  216. data/platform/shared/ruby/ext/navbar/navbar_wrap.c +64 -20
  217. data/platform/shared/ruby/ext/phonebook/phonebook.i +7 -7
  218. data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +95 -120
  219. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -4
  220. data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
  221. data/platform/shared/ruby/ext/rho/rhosupport.c +39 -6
  222. data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +65 -21
  223. data/platform/shared/ruby/ext/ringtones/ringtones_wrap.c +64 -20
  224. data/platform/shared/ruby/ext/signature/signature.i +37 -5
  225. data/platform/shared/ruby/ext/signature/signature_wrap.c +274 -45
  226. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +65 -21
  227. data/platform/shared/ruby/ext/system/system.i +14 -2
  228. data/platform/shared/ruby/ext/system/system_wrap.c +146 -25
  229. data/platform/shared/ruby/ext/webview/webview_wrap.c +65 -21
  230. data/platform/shared/ruby/include/ruby/ruby.h +15 -4
  231. data/platform/shared/ruby/inits.c +1 -0
  232. data/platform/shared/ruby/io.c +13 -3
  233. data/platform/shared/ruby/win32/win32.c +3 -3
  234. data/platform/shared/ruby/wince/io_wce.c +2 -2
  235. data/platform/shared/rubyext/System.cpp +9 -5
  236. data/platform/shared/sync/ClientRegister.cpp +18 -8
  237. data/platform/shared/sync/SyncEngine.cpp +25 -11
  238. data/platform/shared/sync/SyncEngine.h +2 -0
  239. data/platform/shared/sync/SyncSource.cpp +40 -15
  240. data/platform/shared/sync/SyncSource.h +3 -2
  241. data/platform/shared/sync/SyncThread.cpp +9 -4
  242. data/platform/shared/sync/SyncThread.h +3 -1
  243. data/platform/symbian/build/symbian.rake +14 -9
  244. data/platform/symbian/rhodes/rhodes.pro +11 -8
  245. data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +2 -2
  246. data/platform/symbian/rubylib/rubylib.pro +3 -0
  247. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  248. data/platform/wm/RhoLib/RhoLib.vcproj +315 -2
  249. data/platform/wm/build/build_inf.js +235 -187
  250. data/platform/wm/build/wm.rake +388 -233
  251. data/platform/wm/rhodes.sln +56 -0
  252. data/platform/wm/rhodes/MainWindow.cpp +139 -77
  253. data/platform/wm/rhodes/MainWindow.h +27 -22
  254. data/platform/wm/rhodes/MapView/{Graphics.cpp → Bitmap.cpp} +15 -253
  255. data/platform/wm/rhodes/MapView/Bitmap.h +86 -0
  256. data/platform/wm/rhodes/MapView/MapViewManager.cpp +7 -2
  257. data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
  258. data/platform/wm/rhodes/MapView/Win32Graphics.cpp +263 -0
  259. data/platform/wm/rhodes/MapView/Win32Graphics.h +133 -0
  260. data/platform/wm/rhodes/MapView/WmGraphics.cpp +291 -0
  261. data/platform/wm/rhodes/MapView/{Graphics.h → WmGraphics.h} +14 -56
  262. data/platform/wm/rhodes/Rhodes.cpp +128 -32
  263. data/platform/wm/rhodes/Rhodes.rc +6 -2
  264. data/platform/wm/rhodes/camera/Camera.cpp +1 -0
  265. data/platform/wm/rhodes/phonebook/phonebook.cpp +2 -2
  266. data/platform/wm/rhodes/phonebook/phonebook.h +2 -2
  267. data/platform/wm/rhodes/resource.h +3 -2
  268. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +6 -0
  269. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +4 -0
  270. data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +675 -0
  271. data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +123 -0
  272. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +12 -2
  273. data/platform/wm/rhodes/rhodes.vcproj +2732 -1113
  274. data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
  275. data/platform/wm/rhodes/stdafx.h +1 -0
  276. data/platform/wm/rhoelements.sln +118 -62
  277. data/platform/wm/rubylib/rubylib.vcproj +345 -16
  278. data/platform/wm/sqlite3/sqlite3.vcproj +305 -0
  279. data/platform/wm/syncengine/syncengine.vcproj +309 -0
  280. data/platform/wm/tools/detool/LogServer.cpp +19 -2
  281. data/platform/wm/tools/detool/detool.cpp +131 -6
  282. data/platform/wm/tools/detool/detool.vcproj +3 -1
  283. data/platform/wm/tools/detool/stdafx.h +1 -0
  284. data/platform/wp7/IronRuby/Languages/Ruby/Libraries/Builtins/RangeOps.cs +589 -0
  285. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/RubyEncoding.cs +678 -0
  286. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs +271 -0
  287. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +31 -1
  288. data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.Libraries.dll +0 -0
  289. data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.dll +0 -0
  290. data/platform/wp7/RhoRubyLib/common/RhoStd.cs +6 -0
  291. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +16 -2
  292. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +2 -0
  293. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +1 -2
  294. data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +13 -10
  295. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +30 -8
  296. data/platform/wp7/build/wp.rake +5 -0
  297. data/rakefile.rb +153 -46
  298. data/res/build-tools/detool.exe +0 -0
  299. data/res/build-tools/swig_patch/Lib/ruby/rubyerrors.swg +155 -0
  300. data/res/build-tools/swig_patch/Lib/ruby/rubyhead.swg +158 -0
  301. data/res/build-tools/swig_patch/Lib/ruby/rubyiterators.swg +932 -0
  302. data/res/build-tools/swig_patch/Lib/ruby/rubyrun.swg +448 -0
  303. data/res/build-tools/swig_patch/Lib/ruby/rubystdfunctors.swg +162 -0
  304. data/res/build-tools/swig_patch/Lib/ruby/rubytracking.swg +159 -0
  305. data/res/build-tools/swig_patch/Lib/ruby/std_basic_string.i +97 -0
  306. data/res/build-tools/swig_patch/Lib/ruby/std_map.i +418 -0
  307. data/res/build-tools/swig_patch/Lib/ruby/std_multimap.i +227 -0
  308. data/res/build-tools/swig_patch/Lib/swiginit.swg +269 -0
  309. data/res/build-tools/swig_patch/README +7 -0
  310. data/res/generators/templates/application/app/Settings/controller.rb +42 -1
  311. data/res/generators/templates/application/app/Settings/wait.erb +1 -1
  312. data/res/generators/templates/application/app/application.rb +1 -1
  313. data/res/generators/templates/application/app/layout.erb +8 -8
  314. data/res/generators/templates/application/build.yml +0 -1
  315. data/res/generators/templates/application/public/css/android.css +6 -0
  316. data/res/generators/templates/application/public/css/blackberry.css +6 -0
  317. data/res/generators/templates/application/public/css/iphone.css +6 -0
  318. data/res/generators/templates/application/public/css/jqmobile-patch.css +14 -0
  319. data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
  320. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  321. data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
  322. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  323. data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
  324. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.css → jquery.mobile-1.0.css} +452 -354
  325. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.js → jquery.mobile-1.0.js} +629 -442
  326. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +2 -0
  327. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +172 -0
  328. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.css +714 -0
  329. data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +2 -0
  330. data/res/generators/templates/application/public/js/jqmobile-patch.js +136 -7
  331. data/res/generators/templates/extension/app/MontanaTest/controller.rb +20 -20
  332. data/res/generators/templates/extension/app/MontanaTest/index.erb +17 -17
  333. data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Montana.xcodeproj/project.pbxproj +8 -2
  334. data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Rakefile +5 -0
  335. data/res/generators/templates/extension/extensions/montana/ext/montana/shared/ruby/montana_wrap.c +64 -20
  336. data/rhomobile-debug.gemspec +1 -1
  337. data/spec/framework_spec/app/layout.erb +1 -1
  338. data/spec/framework_spec/app/spec/core/rational/Rational_spec.rb +1 -1
  339. data/spec/framework_spec/app/spec/library/stringio/shared/each_char.rb +6 -2
  340. data/spec/framework_spec/app/spec/shared/rational/{Rational.rb → rational_main.rb} +0 -0
  341. data/spec/framework_spec/build.yml +0 -3
  342. data/spec/perfomance_spec/app/Benchmark/controller.rb +1 -1
  343. data/spec/perfomance_spec/app/layout.erb +1 -1
  344. data/spec/phone_spec/app/BlobTest_s/blob_test_s.rb +13 -0
  345. data/spec/phone_spec/app/BlobTest_s/test.png +0 -0
  346. data/spec/phone_spec/app/BlobTest_s/test2.png +0 -0
  347. data/spec/phone_spec/app/spec/blobsync_spec.rb +27 -15
  348. data/spec/phone_spec/app/spec/date_spec.rb +27 -1
  349. data/spec/phone_spec/app/spec/rho_spec.rb +6 -0
  350. data/spec/phone_spec/app/spec/rhom_object_spec.rb +64 -26
  351. data/spec/phone_spec/app/spec/syncengine_spec.rb +28 -7
  352. data/spec/phone_spec/app/spec/uri_spec.rb +4 -4
  353. data/spec/phone_spec/app/spec_runner.rb +4 -2
  354. data/spec/phone_spec/build.yml +7 -9
  355. data/spec/phone_spec/rhoconfig.txt +1 -0
  356. data/version +1 -1
  357. metadata +75 -22
  358. data/Manifest.txt +0 -7853
  359. data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.cpp +0 -384
  360. data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.h +0 -41
  361. data/platform/wm/rhodes/signature/Signature.cpp +0 -396
  362. data/platform/wm/rhodes/signature/Signature.h +0 -84
  363. data/platform/wm/rubylib/rubylib.vcproj.VLAD.Vladimir.user +0 -429
  364. data/platform/wm/sqlite3/sqlite3.vcproj.VLAD.Vladimir.user +0 -429
  365. data/platform/wm/syncengine/syncengine.vcproj.VLAD.Vladimir.user +0 -429
  366. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +0 -12
  367. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +0 -170
  368. data/rhomobile-debug-1.0.5.gem +0 -0
@@ -168,9 +168,11 @@ public class CameraScreen extends MainScreen {
168
168
  SimpleFile file = null;
169
169
  FileConnection fconnsrc = null;
170
170
  FileConnection fconndst = null;
171
+ InputStream src = null;
172
+ OutputStream dst = null;
171
173
  try
172
174
  {
173
- file = RhoClassFactory.createFile();
175
+ file = RhoClassFactory.createFile();
174
176
 
175
177
  if (fileName != null) {
176
178
  String ext = fileName.substring(fileName.lastIndexOf('.'));
@@ -183,8 +185,8 @@ public class CameraScreen extends MainScreen {
183
185
 
184
186
  LOG.TRACE("should be readed " + fconnsrc.fileSize() + " bytes");
185
187
 
186
- InputStream src = fconnsrc.openInputStream();
187
- OutputStream dst = fconndst.openOutputStream();
188
+ src = fconnsrc.openInputStream();
189
+ dst = fconndst.openOutputStream();
188
190
 
189
191
  long fullLength = 0;
190
192
 
@@ -197,6 +199,17 @@ public class CameraScreen extends MainScreen {
197
199
  dst.flush();
198
200
 
199
201
  LOG.TRACE("readed: " + fullLength + " bytes");
202
+
203
+ try{
204
+ if ( src != null )
205
+ src.close();
206
+ src = null;
207
+
208
+ fconnsrc.delete();
209
+ }catch (Exception exc)
210
+ {
211
+ LOG.ERROR("Cannot delete file: " + fileName, exc);
212
+ }
200
213
  }
201
214
  else {
202
215
  //A null encoding indicates that the camera should
@@ -212,7 +225,6 @@ public class CameraScreen extends MainScreen {
212
225
  }
213
226
 
214
227
  fname = makeFileName(ext);
215
-
216
228
  file.open(fname, false, false);
217
229
 
218
230
  //Retrieve the raw image from the VideoControl
@@ -234,6 +246,11 @@ public class CameraScreen extends MainScreen {
234
246
  if ( file != null )
235
247
  file.close();
236
248
 
249
+ if ( dst != null )
250
+ dst.close();
251
+ if ( src != null )
252
+ src.close();
253
+
237
254
  if (fconnsrc != null)
238
255
  fconnsrc.close();
239
256
  if (fconndst != null)
@@ -26,6 +26,10 @@
26
26
 
27
27
  package rhomobile.mapview;
28
28
 
29
+ import com.rho.Sprintf;
30
+ import com.xruby.runtime.builtin.ObjectFactory;
31
+ import com.xruby.runtime.builtin.RubyArray;
32
+
29
33
  public class Annotation {
30
34
 
31
35
  public static class Coordinates {
@@ -44,5 +48,18 @@ public class Annotation {
44
48
  public String resolved_address = null;
45
49
  public String url = null;
46
50
  public Coordinates coordinates = null;
51
+ public boolean pass_location = false;
52
+
47
53
 
54
+ public String make_url()
55
+ {
56
+ if (!pass_location)
57
+ return url;
58
+
59
+ RubyArray args = new RubyArray();
60
+ args.add(ObjectFactory.createFloat(coordinates.latitude));
61
+ args.add(ObjectFactory.createFloat(coordinates.longitude));
62
+
63
+ return url + ( url.indexOf('?') >= 0 ? "&" : "?" ) + Sprintf.sprintf("latitude=%.5f&longitude=%.5f", args);
64
+ }
48
65
  }
@@ -181,11 +181,11 @@ public class MapView extends RubyBasic {
181
181
  settings.put(strKey, strValue);
182
182
  }
183
183
  else if (strKey.equals("zoom_enabled"))
184
- settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
184
+ settings.put(strKey, new Boolean(value.inspect().equalsIgnoreCase("true")));
185
185
  else if (strKey.equals("scroll_enabled"))
186
- settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
186
+ settings.put(strKey, new Boolean(value.inspect().equalsIgnoreCase("true")));
187
187
  else if (strKey.equals("shows_user_location"))
188
- settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
188
+ settings.put(strKey, new Boolean(value.inspect().equalsIgnoreCase("true")));
189
189
  else if (strKey.equals("region")) {
190
190
  if (value instanceof RubyArray) {
191
191
  RubyArray arr = (RubyArray)value;
@@ -257,8 +257,8 @@ public class MapView extends RubyBasic {
257
257
  key.equals(RubyConstant.QNIL) ||
258
258
  value.equals(RubyConstant.QNIL))
259
259
  continue;
260
- String strKey = key.toString();
261
- String strValue = value.toString();
260
+ String strKey = key.toStr();
261
+ String strValue = value.inspect();
262
262
  if (strKey.equals("latitude")) {
263
263
  double v;
264
264
  try {
@@ -297,6 +297,9 @@ public class MapView extends RubyBasic {
297
297
  annotation.resolved_address = strValue;
298
298
  else if (strKey.equals("url"))
299
299
  annotation.url = strValue;
300
+ else if (strKey.equals("pass_location"))
301
+ annotation.pass_location = strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("1");
302
+
300
303
  }
301
304
  annotations.addElement(annotation);
302
305
  }
@@ -467,6 +467,7 @@ public class MapViewScreen extends RhoMainScreen {
467
467
  }
468
468
  }
469
469
 
470
+
470
471
  private void handleClick(int x, int y)
471
472
  {
472
473
  Annotation old_selectedAnnotation = mSelectedAnnotation;
@@ -479,7 +480,8 @@ public class MapViewScreen extends RhoMainScreen {
479
480
  if (mSelectedAnnotation != null && old_selectedAnnotation != null && mSelectedAnnotation.equals(old_selectedAnnotation))
480
481
  {
481
482
  // We have clicked already selected annotation
482
- WebView.navigate(mSelectedAnnotation.url);
483
+
484
+ WebView.navigate(mSelectedAnnotation.make_url());
483
485
  mapParent.close();
484
486
  mSelectedAnnotation = null;
485
487
  }
@@ -442,7 +442,9 @@ int rho_sys_set_sleeping(int sleeping)
442
442
  }
443
443
 
444
444
  void rho_sys_app_exit() {
445
- exit(EXIT_SUCCESS);
445
+ if (([Rhodes sharedInstance] != nil) && (![Rhodes sharedInstance].mBlockExit)) {
446
+ exit(EXIT_SUCCESS);
447
+ }
446
448
  }
447
449
 
448
450
  int rho_sys_is_app_installed(const char *appname) {
@@ -625,7 +627,15 @@ int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
625
627
  NSString *version = [[UIDevice currentDevice] systemVersion];
626
628
  *resValue = rho_ruby_create_string([version UTF8String]);
627
629
  return 1;
628
- }else if (strcasecmp("is_emulator", szPropName) == 0) {
630
+ }
631
+ else if (strcasecmp("webview_framework", szPropName) == 0) {
632
+ NSString *version = [[UIDevice currentDevice] systemVersion];
633
+ NSString *wvf = @"WEBKIT/";
634
+ wvf = [wvf stringByAppendingString:version];
635
+ *resValue = rho_ruby_create_string([wvf UTF8String]);
636
+ return 1;
637
+ }
638
+ else if (strcasecmp("is_emulator", szPropName) == 0) {
629
639
  int bSim = 0;
630
640
  #if TARGET_IPHONE_SIMULATOR
631
641
  bSim = 1;
@@ -756,7 +766,9 @@ void rho_sys_set_application_icon_badge(int badge_number) {
756
766
  [[UIApplication sharedApplication] setApplicationIconBadgeNumber:badge_number];
757
767
  }
758
768
 
759
-
769
+ void rho_platform_restart_application() {
770
+ // [Rhodes restart_app];
771
+ }
760
772
 
761
773
  /*
762
774
  #define MAX_ACTIONS 4
@@ -64,7 +64,12 @@ static VALUE dateToRuby(NSDate *date)
64
64
 
65
65
  static NSDate *dateFromRuby(VALUE rDate)
66
66
  {
67
+ if (NIL_P(rDate))
68
+ return nil;
69
+
67
70
  if (TYPE(rDate) == T_STRING) {
71
+ if (RSTRING_LEN(rDate) == 0)
72
+ return nil;
68
73
  // Convert to time
69
74
  ID id_parse = rb_intern("parse");
70
75
  rDate = rb_funcall(rb_cTime, id_parse, 1, rDate);
@@ -155,6 +160,16 @@ static VALUE eventToRuby(EKEvent *event)
155
160
  int interval = event.recurrenceRule.interval;
156
161
  rb_hash_aset(rRecurrence, rb_str_new2(RUBY_EV_RECURRENCE_INTERVAL), INT2FIX(interval));
157
162
 
163
+ if (event.recurrenceRule.recurrenceEnd != nil) {
164
+ NSDate* endDate = event.recurrenceRule.recurrenceEnd.endDate;
165
+ if (endDate != nil) {
166
+ rb_hash_aset(rRecurrence, rb_str_new2(RUBY_EV_RECURRENCE_END), dateToRuby(endDate));
167
+ [endDate release];
168
+ } else {
169
+ int count = event.recurrenceRule.recurrenceEnd.occurrenceCount;
170
+ rb_hash_aset(rRecurrence, rb_str_new2(RUBY_EV_RECURRENCE_COUNT), INT2FIX(count));
171
+ }
172
+ }
158
173
  rb_hash_aset(rEvent, rb_str_new2(RUBY_EV_RECURRENCE), rRecurrence);
159
174
  }
160
175
 
@@ -163,6 +178,7 @@ static VALUE eventToRuby(EKEvent *event)
163
178
 
164
179
  static EKEvent *eventFromRuby(EKEventStore *eventStore, VALUE rEvent)
165
180
  {
181
+
166
182
  VALUE rId = rb_hash_aref(rEvent, rb_str_new2(RUBY_EV_ID));
167
183
  if (!NIL_P(rId))
168
184
  Check_Type(rId, T_STRING);
@@ -227,8 +243,35 @@ static EKEvent *eventFromRuby(EKEventStore *eventStore, VALUE rEvent)
227
243
  rInterval = rb_funcall(rInterval, rb_intern("to_i"), 0);
228
244
  int interval = NUM2INT(rInterval);
229
245
 
230
- EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] initRecurrenceWithFrequency:freq interval:interval end:nil];
231
- event.recurrenceRule = rule;
246
+ if (interval <= 0) {
247
+ interval = 1;
248
+ }
249
+
250
+ EKRecurrenceEnd *recurrenceEnd = nil;
251
+ VALUE rUntilDate = rb_hash_aref(rRecurrence, rb_str_new2(RUBY_EV_RECURRENCE_END));
252
+ NSDate *until = dateFromRuby(rUntilDate);
253
+ if (until != nil) {
254
+ recurrenceEnd = [EKRecurrenceEnd recurrenceEndWithEndDate: until];
255
+ RAWTRACE("eventFromRuby recurrenceEndWithEndDate");
256
+ }
257
+ if (recurrenceEnd == nil)
258
+ {
259
+ VALUE rTimes = rb_funcall(rb_hash_aref(rRecurrence, rb_str_new2(RUBY_EV_RECURRENCE_COUNT)), rb_intern("to_i"), 0);;
260
+ int times = NUM2INT(rTimes);
261
+ if (times > 0) {
262
+ recurrenceEnd = [EKRecurrenceEnd recurrenceEndWithOccurrenceCount:times];
263
+ RAWTRACE1("eventFromRuby recurrenceEndWithOccurrenceCount: %d", [recurrenceEnd occurrenceCount]);
264
+ }
265
+ }
266
+
267
+ EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] initRecurrenceWithFrequency:freq interval:interval end:recurrenceEnd];
268
+
269
+
270
+ [event setRecurrenceRule:rule];
271
+
272
+
273
+ if (recurrenceEnd != nil)
274
+ [recurrenceEnd release];
232
275
  [rule release];
233
276
  }
234
277
 
@@ -379,6 +379,9 @@ static MapViewController *mc = nil;
379
379
  mapView.delegate=self;
380
380
 
381
381
  mapView.showsUserLocation=showsUserLocation;
382
+
383
+ //[mapView setUserTrackingMode:MKUserTrackingModeNone animated:NO];
384
+
382
385
  mapView.scrollEnabled=scrollEnabled;
383
386
  mapView.zoomEnabled=zoomEnabled;
384
387
  mapView.mapType=mapType;
@@ -511,15 +514,16 @@ static MapViewController *mc = nil;
511
514
  if ([url length] > 0) {
512
515
  [annView setRightCalloutAccessoryView:[UIButton buttonWithType:UIButtonTypeDetailDisclosure]];
513
516
  }
517
+
518
+ if ([annView isKindOfClass:[MKPinAnnotationView class]]) {
519
+ MKPinAnnotationView* annPinView = (MKPinAnnotationView*)annView;
520
+ annPinView.animatesDrop = TRUE;
521
+ }
514
522
  }
515
523
  else {
516
524
  annView = [[[MKPinAnnotationView alloc]
517
525
  initWithAnnotation:annotation reuseIdentifier:@"currentloc"] autorelease];
518
526
  }
519
- if ([annView isKindOfClass:[MKPinAnnotationView class]]) {
520
- MKPinAnnotationView* annPinView = (MKPinAnnotationView*)annView;
521
- annPinView.animatesDrop = TRUE;
522
- }
523
527
  annView.canShowCallout = YES;
524
528
  return annView;
525
529
  }
@@ -27,6 +27,7 @@
27
27
  #include "ruby/ext/rho/rhoruby.h"
28
28
  #include "ruby/ext/phonebook/phonebook.h"
29
29
  #include "phonebook.h"
30
+ #include "common/phonebook/PhonebookParams.h"
30
31
 
31
32
  #include "logging/RhoLog.h"
32
33
 
@@ -374,24 +375,35 @@ VALUE getallPhonebookRecords(void* pb) {
374
375
  return rho_ruby_get_NIL();
375
376
  }
376
377
 
377
- int getPhonebookRecordCount(void* pb) {
378
+ int getPhonebookRecordCount(void* pb, rho_param* param) {
378
379
  if (pb) {
379
380
  if (logging_enable) RAWLOG_INFO("phonebook :: getPhonebookRecordCount START");
380
381
  LocalPhonebook* phonebook = pb;
382
+ int count = 0;
381
383
 
382
384
  VALUE valGc = rho_ruby_disable_gc();
383
385
  _getAllPeople(phonebook);
384
386
  rho_ruby_enable_gc(valGc);
387
+ count = phonebook->_len;
388
+
389
+ PbPageParam pageParam;
390
+ if(rho_phonebook_getpageparams(param, &pageParam) != 0)
391
+ {
392
+ count -= pageParam.offset;
393
+ if(pageParam.per_page != -1 && count > pageParam.per_page)
394
+ count = pageParam.per_page;
395
+ }
385
396
 
386
397
  if (logging_enable) RAWLOG_INFO("phonebook :: getallPhonebookRecords FINISH");
387
- return phonebook->_len;
398
+
399
+ return count;
388
400
  }
389
401
  return 0;
390
402
  }
391
403
 
392
- VALUE getPhonebookRecords(void* pb, int offset, int max_results, rho_param* select_param) {
404
+ VALUE getPhonebookRecords(void* pb, rho_param* param) {
393
405
  if (pb) {
394
- if (logging_enable) RAWLOG_INFO("phonebook :: getallPhonebookRecords START");
406
+ if (logging_enable) RAWLOG_INFO("phonebook :: getPhonebookRecords START");
395
407
  LocalPhonebook* phonebook = pb;
396
408
 
397
409
  VALUE hash = rho_ruby_createHash();
@@ -402,8 +414,19 @@ VALUE getPhonebookRecords(void* pb, int offset, int max_results, rho_param* sele
402
414
  VALUE record; char buf[128];
403
415
 
404
416
  _getAllPeople(phonebook);
405
- int top_index = (offset + max_results) > phonebook->_len ? phonebook->_len : offset + max_results;
406
- for (int index = offset; index < top_index ; index++) {
417
+
418
+ int offset = 0;
419
+ int top_index = phonebook->_len;
420
+ PbPageParam pageParam;
421
+ if(rho_phonebook_getpageparams(param, &pageParam) != 0)
422
+ {
423
+ RAWTRACE2("Page params: offset: %d, per_page: %d", pageParam.offset, pageParam.per_page);
424
+ offset = pageParam.offset;
425
+ if(pageParam.per_page != -1 && (offset + pageParam.per_page) < top_index)
426
+ top_index = offset + pageParam.per_page;
427
+ }
428
+
429
+ for (int index = offset; index < top_index ; index++) {
407
430
  record = _getRecordByIndex(phonebook->_people, index, &recordId);
408
431
  snprintf(buf, sizeof(buf), "{%d}", recordId);
409
432
  addHashToHash(hash, buf, record);
@@ -412,7 +435,7 @@ VALUE getPhonebookRecords(void* pb, int offset, int max_results, rho_param* sele
412
435
  rho_ruby_releaseValue(hash);
413
436
 
414
437
  rho_ruby_enable_gc(valGc);
415
- if (logging_enable) RAWLOG_INFO("phonebook :: getallPhonebookRecords FINISH");
438
+ if (logging_enable) RAWLOG_INFO("phonebook :: getPhonebookRecords FINISH");
416
439
  return hash;
417
440
  }
418
441
  return rho_ruby_get_NIL();
@@ -41,7 +41,7 @@
41
41
  #import "NVDelegate.h"
42
42
 
43
43
  @interface Rhodes : NSObject <UIApplicationDelegate,
44
- UITabBarControllerDelegate, AVAudioPlayerDelegate>
44
+ UITabBarControllerDelegate, AVAudioPlayerDelegate, UIAlertViewDelegate>
45
45
  {
46
46
  AppManager *appManager;
47
47
  UIApplication *application;
@@ -62,6 +62,7 @@
62
62
 
63
63
  id<RhoMainView,NSObject> mainView;
64
64
  BOOL rotationLocked;
65
+ BOOL mBlockExit;
65
66
  }
66
67
 
67
68
  @property (nonatomic, retain) UIWindow *window;
@@ -69,6 +70,8 @@
69
70
  @property (nonatomic, retain) NSMutableDictionary *cookies;
70
71
  @property (nonatomic, copy) SignatureDelegate* signatureDelegate;
71
72
  @property (nonatomic, copy) NVDelegate* nvDelegate;
73
+ @property (nonatomic, assign) BOOL mBlockExit;
74
+
72
75
  #ifdef __IPHONE_4_0
73
76
  @property (nonatomic, readonly) EKEventStore *eventStore;
74
77
  #endif
@@ -88,6 +91,8 @@
88
91
  + (void)performOnUiThread:(id)runnable arg:(id)arg wait:(BOOL)wait;
89
92
  + (void)performOnUiThread:(id)runnable arg:(id)arg1 arg:(id)arg2 wait:(BOOL)wait;
90
93
 
94
+ +(void)restart_app;
95
+
91
96
  - (UIWindow*)rootWindow;
92
97
 
93
98
  - (void)playStart:(NSString*)fileName mediaType:(NSString*)type;
@@ -104,4 +109,9 @@
104
109
  - (void)openFullScreenNativeView:(UIView*)view;
105
110
  - (void)closeFullScreenNativeView;
106
111
 
112
+ // UIAlertViewDelegate
113
+ - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
114
+
115
+ - (void) exit_with_errormessage:(NSString*)title message:(NSString*)message;
116
+
107
117
  @end
@@ -41,6 +41,13 @@
41
41
  #include "common/app_build_capabilities.h"
42
42
 
43
43
 
44
+
45
+ extern int rho_sys_check_rollback_bundle(const char* szRhoPath);
46
+ void rho_sys_impl_exit_with_errormessage(const char* szTitle, const char* szMsg);
47
+
48
+
49
+
50
+
44
51
  #undef DEFAULT_LOGCATEGORY
45
52
  #define DEFAULT_LOGCATEGORY "Rhodes"
46
53
 
@@ -96,7 +103,7 @@ static BOOL app_created = NO;
96
103
 
97
104
  @implementation Rhodes
98
105
 
99
- @synthesize window, player, cookies, signatureDelegate, nvDelegate;
106
+ @synthesize window, player, cookies, signatureDelegate, nvDelegate, mBlockExit;
100
107
  #ifdef __IPHONE_4_0
101
108
  @synthesize eventStore;
102
109
  #endif
@@ -305,7 +312,7 @@ static Rhodes *instance = NULL;
305
312
  #endif
306
313
  // Show picker
307
314
  #ifdef __IPHONE_3_2
308
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
315
+ if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) && (type != UIImagePickerControllerSourceTypeCamera)) {
309
316
  // WARNING!!! DO NOT USE UIPopoverController DIRECTLY HERE!!!
310
317
  // It will cause problem of starting application on iPhone OS < 3.2
311
318
  // All such stuff should be loaded in runtime using NSClassFromString
@@ -570,9 +577,7 @@ static Rhodes *instance = NULL;
570
577
 
571
578
  - (void)doStartUp {
572
579
  NSLog(@"Rhodes starting application...");
573
- instance = self;
574
- application = [UIApplication sharedApplication];
575
- rotationLocked = NO;
580
+
576
581
 
577
582
  [NSThread setThreadPriority:1.0];
578
583
 
@@ -781,14 +786,89 @@ static Rhodes *instance = NULL;
781
786
  NSLog(@"Audio player decoding error %@", error);
782
787
  }
783
788
 
789
+
790
+
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+ - (void)doStartUpRe:(NSObject*)arg {
799
+ NSLog(@"Rhodes starting application...");
800
+ rotationLocked = NO;
801
+
802
+ NSLog(@"Create new detached thread for initialization stuff");
803
+ [NSThread detachNewThreadSelector:@selector(doRhoInit) toTarget:self withObject:nil];
804
+
805
+ if (mainView != nil) {
806
+ [mainView.view removeFromSuperview];
807
+ [mainView release];
808
+ }
809
+
810
+ mainView = nil;
811
+ [SimpleMainView enableHiddenOnStart];
812
+ mainView = [[SimpleMainView alloc] initWithParentView:window frame:[Rhodes applicationFrame]];
813
+ mainView.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
814
+ mainView.view.autoresizesSubviews = YES;
815
+
816
+ BOOL is_splash_screen_maked = [self showLoadingPagePre];
817
+
818
+ if (!is_splash_screen_maked) {
819
+ [window addSubview:mainView.view];
820
+ }
821
+
822
+ NSLog(@"Init cookies");
823
+ cookies = [[NSMutableDictionary alloc] initWithCapacity:0];
824
+
825
+ rho_rhodesapp_canstartapp("", ", ");
826
+
827
+ NSLog(@"Initialization finished");
828
+ }
829
+
830
+
831
+
832
+
833
+
834
+ -(void)restart_app_func
835
+ {
836
+ [self performSelectorOnMainThread:@selector(doStartUpRe:) withObject:nil waitUntilDone:NO];
837
+ }
838
+
839
+ +(void)restart_app
840
+ {
841
+ [[Rhodes sharedInstance] restart_app_func];
842
+
843
+ }
844
+
845
+
784
846
  // UIApplicationDelegate implementation
785
847
 
786
848
  #ifdef __IPHONE_3_0
787
849
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
850
+
851
+
852
+ self.mBlockExit = NO;
853
+
854
+
855
+ instance = self;
856
+ self->application = [UIApplication sharedApplication];
857
+ rotationLocked = NO;
858
+
859
+ if ( !rho_sys_check_rollback_bundle(rho_native_rhopath()) )
860
+ {
861
+
862
+ rho_sys_impl_exit_with_errormessage( "Bundle update.", "Application is currupted. Reinstall it , please.");
863
+ return NO;
864
+ }
865
+
866
+
788
867
 
789
868
  NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
790
869
  NSLog(@"didFinishLaunchingWithOptions: %@", url);
791
870
 
871
+
792
872
  // store start parameter
793
873
  NSString* start_parameter = [NSString stringWithUTF8String:""];
794
874
  if (url != nil) {
@@ -800,18 +880,63 @@ static Rhodes *instance = NULL;
800
880
  }
801
881
  }
802
882
  }
803
-
804
- [self doStartUp];
805
- [self processDoSync:launchOptions];
883
+
884
+ [self doStartUp];
885
+ [self processDoSync:launchOptions];
806
886
 
807
887
  if ( !rho_rhodesapp_canstartapp([start_parameter UTF8String], ", ") )
808
888
  {
889
+ //const char* szAppSecToken = get_app_build_config_item("security_token");
809
890
  NSLog(@"This is hidden app and can be started only with security key.");
810
- //exit(EXIT_SUCCESS);
891
+ /*
892
+ {
893
+
894
+ NSString* message = @"Invalid security token !";
895
+
896
+ rho_conf_Init(rho_native_rhopath());
897
+
898
+ if (rho_conf_is_property_exists("invalid_security_token_message")) {
899
+ const char* conf_message = rho_conf_getString("invalid_security_token_message");
900
+ message = [NSString stringWithUTF8String:conf_message];
901
+ }
902
+
903
+
904
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
905
+ message:message
906
+ delegate:self
907
+ cancelButtonTitle:@"OK"
908
+ otherButtonTitles: nil];
909
+ [alert show];
910
+ [alert release];
911
+ }
912
+ */
913
+ //exit(EXIT_SUCCESS);
811
914
  }
812
915
 
813
916
  return NO;
814
917
  }
918
+
919
+ - (void) exit_with_errormessage:(NSString*)title message:(NSString*)message
920
+ {
921
+ [Rhodes sharedInstance].mBlockExit = YES;
922
+
923
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
924
+ message:message
925
+ delegate:self
926
+ cancelButtonTitle:@"OK"
927
+ otherButtonTitles: nil];
928
+ [alert show];
929
+ [alert release];
930
+
931
+ }
932
+
933
+
934
+ - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
935
+ exit(EXIT_SUCCESS);
936
+ }
937
+
938
+
939
+
815
940
  #endif
816
941
  /*
817
942
  - (void)applicationDidFinishLaunching:(UIApplication *)application
@@ -950,6 +1075,13 @@ static Rhodes *instance = NULL;
950
1075
 
951
1076
  // Native functions
952
1077
 
1078
+
1079
+ void rho_sys_impl_exit_with_errormessage(const char* szTitle, const char* szMsg) {
1080
+
1081
+ [[Rhodes sharedInstance] exit_with_errormessage:[NSString stringWithUTF8String:szTitle] message:[NSString stringWithUTF8String:szMsg]];
1082
+ }
1083
+
1084
+
953
1085
  void rho_map_location(char* query) {
954
1086
  [[Rhodes sharedInstance] mapLocation:[NSString stringWithUTF8String:query]];
955
1087
  }