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.
Files changed (529) hide show
  1. data/CHANGELOG +5 -0
  2. data/Manifest.txt +214 -32
  3. data/Rakefile +33 -10
  4. data/bin/upgrade-rhodes-app +0 -1
  5. data/lib/build/compileERB/bb.rb +2 -2
  6. data/lib/build/compileERB/default.rb +7 -5
  7. data/lib/build/jake.rb +1 -1
  8. data/lib/extensions/digest-md5/ext.yml +1 -1
  9. data/lib/extensions/digest-md5/ext/Rakefile +35 -36
  10. data/lib/extensions/digest-md5/ext/build.bat +1 -0
  11. data/lib/extensions/digest-md5/ext/digest-md5.vcproj +203 -0
  12. data/lib/extensions/digest-sha1/ext.yml +1 -1
  13. data/lib/extensions/digest/ext.yml +1 -1
  14. data/lib/extensions/digest/ext/Rakefile +35 -39
  15. data/lib/extensions/digest/ext/build.bat +1 -2
  16. data/lib/extensions/digest/ext/digest.vcproj +203 -0
  17. data/lib/framework/rho/render.rb +79 -22
  18. data/lib/framework/rho/rho.rb +294 -56
  19. data/lib/framework/rho/rhoapplication.rb +10 -0
  20. data/lib/framework/rho/rhofsconnector.rb +2 -6
  21. data/lib/framework/rho/rhoutils.rb +56 -14
  22. data/lib/framework/rho/rhoviewhelpers.rb +2 -0
  23. data/lib/framework/rhodes.rb +2 -2
  24. data/lib/framework/rhom/rhom.rb +42 -15
  25. data/lib/framework/rhom/rhom_db_adapter.rb +165 -159
  26. data/lib/framework/rhom/rhom_object.rb +0 -1
  27. data/lib/framework/rhom/rhom_object_factory.rb +343 -166
  28. data/lib/framework/rhom/rhom_source.rb +28 -15
  29. data/lib/framework/version.rb +2 -2
  30. data/lib/rhodes.rb +2 -2
  31. data/platform/android/Rhodes/AndroidManifest.xml +2 -2
  32. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +39 -44
  33. data/platform/android/Rhodes/jni/include/JNIRhodes.h +1 -1
  34. data/platform/android/Rhodes/jni/include/details/rhojava.inc +23 -20
  35. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_RhoMenu.h +61 -0
  36. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_Rhodes.h +16 -0
  37. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_alert_Alert.h +21 -0
  38. data/platform/android/Rhodes/jni/include/sslimpl.h +1 -1
  39. data/platform/android/Rhodes/jni/src/alert.cpp +32 -5
  40. data/platform/android/Rhodes/jni/src/callbacks.cpp +51 -21
  41. data/platform/android/Rhodes/jni/src/mapview.cpp +3 -8
  42. data/platform/android/Rhodes/jni/src/menu.cpp +70 -0
  43. data/platform/android/Rhodes/jni/src/navbar.cpp +16 -0
  44. data/platform/android/Rhodes/jni/src/rhodes.cpp +37 -0
  45. data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
  46. data/platform/android/Rhodes/jni/src/webview.cpp +21 -7
  47. data/platform/android/Rhodes/res/drawable/alert_alert.png +0 -0
  48. data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
  49. data/platform/android/Rhodes/res/drawable/alert_question.png +0 -0
  50. data/platform/android/Rhodes/res/drawable/camera.png +0 -0
  51. data/platform/android/Rhodes/res/layout/camera.xml +18 -3
  52. data/platform/android/Rhodes/res/menu/options.xml +0 -10
  53. data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +5 -10
  54. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -0
  55. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +105 -0
  56. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +157 -122
  57. data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +7 -58
  58. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +16 -0
  59. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +220 -17
  60. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +22 -4
  61. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +44 -25
  62. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +10 -0
  63. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +3 -0
  64. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -21
  65. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -12
  66. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +44 -0
  67. data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +47 -3
  68. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +13 -6
  69. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +11 -5
  70. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +1 -4
  71. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +61 -0
  72. data/platform/android/build/RhodesSRC_build.files +3 -0
  73. data/platform/android/build/android.rake +173 -60
  74. data/platform/android/build/androidcommon.rb +1 -2
  75. data/platform/android/build/librhocommon_build.files +5 -0
  76. data/platform/android/build/librhodes_build.files +2 -0
  77. data/platform/android/build/libruby_build.files +2 -1
  78. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -3
  79. data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +1 -1
  80. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +16 -1
  81. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +5 -0
  82. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +25 -4
  83. data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +1 -1
  84. data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -1
  85. data/platform/bb/Hsqldb/src/j2me/math/Number.java +6 -3
  86. data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +2 -1
  87. data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -0
  88. data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +1 -0
  89. data/platform/bb/Hsqldb/src/org/hsqldb/Result.java +2 -0
  90. data/platform/bb/Hsqldb/src/org/hsqldb/Select.java +12 -6
  91. data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +19 -12
  92. data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +10 -4
  93. data/platform/bb/Hsqldb/src/org/hsqldb/Token.java +10 -2
  94. data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +3 -3
  95. data/platform/bb/Hsqldb/src/org/hsqldb/lib/java/JavaSystem.java +1 -1
  96. data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlProperties.java +2 -1
  97. data/platform/bb/Hsqldb/src/org/hsqldb/persist/ScaledRAFile.java +1 -1
  98. data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java +1 -1
  99. data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java +1 -1
  100. data/platform/bb/RubyVM/RubyVM.jdp +9 -10
  101. data/platform/bb/build/RubyVM_build.files +9 -7
  102. data/platform/bb/build/bb.rake +13 -3
  103. data/platform/bb/build/hsqldb_build.files +0 -2
  104. data/platform/bb/build/rhodes_build.files +5 -2
  105. data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +8 -0
  106. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +154 -0
  107. data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +8 -0
  108. data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +28 -0
  109. data/platform/bb/rhodes/rhodes.jdp +12 -7
  110. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +331 -0
  111. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +28 -0
  112. data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +10 -0
  113. data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +4 -0
  114. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +2 -4
  115. data/platform/bb/rhodes/src/com/rho/{Jsr75File.java → file/Jsr75File.java} +83 -36
  116. data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/Jsr75RAFileImpl.java +0 -1
  117. data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/PersistRAFileImpl.java +0 -2
  118. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +8 -10
  119. data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +1 -1
  120. data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +39 -0
  121. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +63 -2
  122. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +100 -0
  123. data/platform/bb/rhodes/src/rhomobile/LogScreen.java +1 -1
  124. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +13 -1
  125. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +138 -492
  126. data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +11 -2
  127. data/platform/bb/rhodes/src/rhomobile/Utilities.java +14 -10
  128. data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +5 -14
  129. data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +1 -1
  130. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +2 -2
  131. data/platform/iphone/Classes/AppManager/AppManager.m +37 -14
  132. data/platform/iphone/Classes/Camera/PickImageDelegate.h +15 -4
  133. data/platform/iphone/Classes/Camera/PickImageDelegate.m +53 -50
  134. data/platform/iphone/Classes/DateTimePicker.h +17 -0
  135. data/platform/iphone/Classes/DateTimePicker.m +35 -0
  136. data/platform/iphone/Classes/GeoLocation/LocationController.m +2 -3
  137. data/platform/iphone/Classes/LogOptionsController.m +3 -2
  138. data/platform/iphone/Classes/LogViewController.m +4 -2
  139. data/platform/iphone/Classes/MapView/GoogleGeocoder.m +12 -20
  140. data/platform/iphone/Classes/MapView/MapAnnotation.h +9 -13
  141. data/platform/iphone/Classes/MapView/MapAnnotation.m +17 -65
  142. data/platform/iphone/Classes/MapView/MapViewController.h +1 -7
  143. data/platform/iphone/Classes/MapView/MapViewController.m +51 -25
  144. data/platform/iphone/Classes/NativeBar.h +0 -12
  145. data/platform/iphone/Classes/NativeBar.m +121 -2
  146. data/platform/iphone/Classes/NavBar.h +16 -0
  147. data/platform/iphone/Classes/NavBar.m +115 -0
  148. data/platform/iphone/Classes/RhoAlert.h +19 -0
  149. data/platform/iphone/Classes/RhoAlert.m +258 -0
  150. data/platform/iphone/Classes/RhoDelegate.m +1 -0
  151. data/platform/iphone/Classes/RhoMainView.h +33 -0
  152. data/platform/iphone/Classes/Rhodes.h +56 -0
  153. data/platform/iphone/Classes/Rhodes.m +533 -0
  154. data/platform/iphone/Classes/RingtoneManager.h +17 -0
  155. data/platform/iphone/Classes/RingtoneManager.m +73 -0
  156. data/platform/iphone/Classes/SimpleMainView.h +30 -0
  157. data/platform/iphone/Classes/SimpleMainView.m +380 -0
  158. data/platform/iphone/Classes/TabbedMainView.h +24 -0
  159. data/platform/iphone/Classes/TabbedMainView.m +202 -0
  160. data/platform/iphone/Classes/WebView.m +123 -0
  161. data/platform/iphone/Classes/rho/net/NetRequestImpl.m +2 -2
  162. data/platform/iphone/Classes/rho/net/sslimpl.cpp +13 -1
  163. data/platform/iphone/Classes/rho/net/sslimpl.h +1 -1
  164. data/platform/iphone/Info.plist +1 -1
  165. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +44 -0
  166. data/platform/iphone/main.m +1 -2
  167. data/platform/iphone/rbuild/iphone.rake +8 -16
  168. data/platform/iphone/rhoextlib/dosyscall.c +1 -1
  169. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +6 -4
  170. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
  171. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +97 -62
  172. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +12 -0
  173. data/platform/osx/Rhodes Launcher/launch.rb +14 -21
  174. data/platform/shared/common/AppMenu.cpp +122 -0
  175. data/platform/shared/common/AppMenu.h +46 -0
  176. data/platform/shared/common/PosixThreadImpl.cpp +1 -1
  177. data/platform/shared/common/RhoConf.cpp +27 -2
  178. data/platform/shared/common/RhoConf.h +5 -0
  179. data/platform/shared/common/RhoFilePath.h +21 -0
  180. data/platform/shared/common/RhoStd.h +44 -5
  181. data/platform/shared/common/RhoTime.h +20 -7
  182. data/platform/shared/common/RhodesApp.cpp +236 -177
  183. data/platform/shared/common/RhodesApp.h +36 -13
  184. data/platform/shared/common/SplashScreen.cpp +2 -2
  185. data/platform/shared/common/StringConverter.h +10 -11
  186. data/platform/shared/common/rhoparams.c +0 -6
  187. data/platform/shared/curl/lib/rhossl.c +3 -2
  188. data/platform/shared/curl/lib/url.c +0 -5
  189. data/platform/shared/db/DBAdapter.cpp +304 -81
  190. data/platform/shared/db/DBAdapter.h +24 -7
  191. data/platform/shared/db/DBAttrManager.cpp +83 -30
  192. data/platform/shared/db/DBAttrManager.h +6 -0
  193. data/platform/shared/db/DBResult.h +15 -4
  194. data/platform/shared/json/JSONIterator.cpp +100 -3
  195. data/platform/shared/json/JSONIterator.h +28 -3
  196. data/platform/shared/net/AsyncHttp.cpp +25 -22
  197. data/platform/shared/net/AsyncHttp.h +10 -6
  198. data/platform/shared/net/CURLNetRequest.cpp +115 -36
  199. data/platform/shared/net/CURLNetRequest.h +6 -0
  200. data/platform/shared/net/HttpServer.cpp +6 -4
  201. data/platform/shared/net/HttpServer.h +0 -1
  202. data/platform/shared/net/INetRequest.h +19 -3
  203. data/platform/shared/net/URI.cpp +2 -2
  204. data/platform/shared/net/ssl.cpp +2 -2
  205. data/platform/shared/net/ssl.h +2 -2
  206. data/platform/shared/ruby/ext/alert/alert.i +14 -2
  207. data/platform/shared/ruby/ext/alert/alert_wrap.c +40 -20
  208. data/platform/shared/ruby/ext/asynchttp/asynchttp.i +8 -8
  209. data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +112 -16
  210. data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -12
  211. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +481 -125
  212. data/platform/shared/ruby/ext/navbar/navbar.i +20 -0
  213. data/platform/shared/ruby/ext/navbar/navbar_wrap.c +1859 -0
  214. data/platform/shared/ruby/ext/rho/extensions.c +1 -1
  215. data/platform/shared/ruby/ext/rho/rhoruby.c +32 -2
  216. data/platform/shared/ruby/ext/rho/rhoruby.h +7 -2
  217. data/platform/shared/ruby/ext/rhoconf/rhoconf.i +4 -0
  218. data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +31 -0
  219. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +188 -3226
  220. data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -25
  221. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +96 -104
  222. data/platform/shared/ruby/ext/system/system.i +12 -0
  223. data/platform/shared/ruby/ext/system/system_wrap.c +101 -7
  224. data/platform/shared/ruby/ext/webview/webview.i +20 -15
  225. data/platform/shared/ruby/ext/webview/webview_wrap.c +42 -16
  226. data/platform/shared/ruby/thread_pthread.c +4 -4
  227. data/platform/shared/ruby/thread_win32.c +4 -4
  228. data/platform/shared/ruby/wince/io_wce.c +0 -1
  229. data/platform/shared/rubyJVM/src/com/rho/FilePath.java +18 -2
  230. data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
  231. data/platform/shared/rubyJVM/src/com/rho/Properties.java +9 -0
  232. data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +2 -3
  233. data/platform/shared/rubyJVM/src/com/rho/RhoConf.java +47 -8
  234. data/platform/shared/rubyJVM/src/com/rho/RhoLogConf.java +1 -0
  235. data/platform/shared/rubyJVM/src/com/rho/RhoLogFileSink.java +1 -0
  236. data/platform/shared/rubyJVM/src/com/rho/RhoRuby.java +43 -5
  237. data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +98 -3
  238. data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +460 -175
  239. data/platform/shared/rubyJVM/src/com/rho/db/DBAttrManager.java +81 -33
  240. data/platform/shared/rubyJVM/src/com/rho/db/IDBCallback.java +3 -5
  241. data/platform/shared/rubyJVM/src/com/rho/db/IDBResult.java +2 -0
  242. data/platform/shared/rubyJVM/src/com/rho/db/IDBStorage.java +2 -0
  243. data/platform/shared/rubyJVM/src/com/rho/{IFile.java → file/IFile.java} +1 -1
  244. data/platform/shared/rubyJVM/src/com/rho/{IFileAccess.java → file/IFileAccess.java} +1 -1
  245. data/platform/shared/rubyJVM/src/com/rho/{IRAFile.java → file/IRAFile.java} +1 -1
  246. data/platform/{bb/Hsqldb/src/com/rho/db → shared/rubyJVM/src/com/rho/file}/RandomAccessFile.java +1 -2
  247. data/platform/shared/rubyJVM/src/com/rho/{SimpleFile.java → file/SimpleFile.java} +5 -1
  248. data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +23 -18
  249. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +167 -250
  250. data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +100 -30
  251. data/platform/shared/rubyJVM/src/com/rho/net/URI.java +0 -1
  252. data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +30 -33
  253. data/platform/shared/rubyJVM/src/com/rho/sync/ISyncProtocol.java +20 -0
  254. data/platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java +5 -0
  255. data/platform/shared/rubyJVM/src/com/rho/sync/JSONStructIterator.java +74 -0
  256. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +486 -257
  257. data/platform/shared/rubyJVM/src/com/rho/sync/SyncNotify.java +89 -58
  258. data/platform/shared/rubyJVM/src/com/rho/sync/SyncProtocol_3.java +79 -0
  259. data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +634 -495
  260. data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +74 -90
  261. data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +1 -0
  262. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyThread.java +6 -0
  263. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyRuntime.java +6 -2
  264. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +17 -1
  265. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyValue.java +1 -0
  266. data/platform/shared/rubyJVM/src/org/json/me/JSONObject.java +3 -0
  267. data/platform/shared/rubyext/GeoLocation.cpp +23 -0
  268. data/platform/shared/rubyext/GeoLocation.h +2 -0
  269. data/platform/shared/rubyext/RhoRuby.cpp +31 -0
  270. data/platform/shared/rubyext/RhoRuby.h +32 -0
  271. data/platform/shared/rubyext/System.cpp +14 -3
  272. data/platform/shared/rubyext/WebView.h +21 -0
  273. data/platform/shared/sync/ClientRegister.cpp +23 -28
  274. data/platform/shared/sync/ClientRegister.h +6 -2
  275. data/platform/shared/sync/ISyncProtocol.h +29 -0
  276. data/platform/shared/sync/SyncEngine.cpp +450 -190
  277. data/platform/shared/sync/SyncEngine.h +28 -38
  278. data/platform/shared/sync/SyncNotify.cpp +43 -41
  279. data/platform/shared/sync/SyncNotify.h +7 -7
  280. data/platform/shared/sync/SyncProtocol_3.h +86 -0
  281. data/platform/shared/sync/SyncSource.cpp +535 -371
  282. data/platform/shared/sync/SyncSource.h +48 -55
  283. data/platform/shared/sync/SyncThread.cpp +59 -103
  284. data/platform/shared/sync/SyncThread.h +10 -23
  285. data/platform/shared/unzip/unzip.cpp +3 -2
  286. data/platform/shared/unzip/unzip.h +5 -1
  287. data/platform/shared/wtl80/include/atlapp.h +10 -10
  288. data/platform/wm/RhoLib/RhoLib.vcproj +32 -0
  289. data/platform/wm/build/build_inf.js +40 -3
  290. data/platform/wm/build/wm.rake +95 -9
  291. data/platform/wm/rhodes/Alert.cpp +4 -0
  292. data/platform/wm/rhodes/DateTimePicker.cpp +183 -0
  293. data/platform/wm/rhodes/DateTimePicker.h +100 -0
  294. data/platform/wm/rhodes/MainWindow.cpp +222 -209
  295. data/platform/wm/rhodes/MainWindow.h +28 -35
  296. data/platform/wm/rhodes/Rhodes.cpp +20 -60
  297. data/platform/wm/rhodes/Rhodes.rc +41 -7
  298. data/platform/wm/rhodes/Utils.cpp +65 -0
  299. data/platform/wm/rhodes/Utils.h +9 -0
  300. data/platform/wm/rhodes/camera/Camera.cpp +2 -2
  301. data/platform/wm/rhodes/menubar.cpp +2 -33
  302. data/platform/wm/rhodes/menubar.h +0 -14
  303. data/platform/wm/rhodes/resource.h +13 -11
  304. data/platform/wm/rhodes/rho/net/NetRequest.cpp +16 -35
  305. data/platform/wm/rhodes/rho/net/NetRequest.h +8 -2
  306. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +264 -46
  307. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +14 -4
  308. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +1 -1
  309. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
  310. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +77 -4
  311. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +63 -0
  312. data/platform/wm/rhodes/rhodes.vcproj +20 -66
  313. data/platform/wm/rhodes/stdafx.h +22 -0
  314. data/platform/wm/rubylib/rubylib.vcproj +4 -0
  315. data/platform/wm/syncengine/syncengine.vcproj +8 -0
  316. data/platform/wm/tools/detool.sln +66 -0
  317. data/platform/wm/tools/detool/DEMComInterface.tlb +0 -0
  318. data/platform/wm/tools/detool/ReadMe.txt +33 -0
  319. data/platform/wm/tools/detool/detool.cpp +559 -0
  320. data/platform/wm/tools/detool/detool.h +5 -0
  321. data/platform/wm/tools/detool/detool.vcproj +233 -0
  322. data/platform/wm/tools/detool/stdafx.cpp +8 -0
  323. data/platform/wm/tools/detool/stdafx.h +15 -0
  324. data/platform/wm/tools/detool/targetver.h +24 -0
  325. data/platform/wm/tools/rhosetup/ReadMe.txt +41 -0
  326. data/platform/wm/tools/rhosetup/rhosetup.cpp +52 -0
  327. data/platform/wm/tools/rhosetup/rhosetup.vcproj +641 -0
  328. data/platform/wm/tools/rhosetup/stdafx.cpp +8 -0
  329. data/platform/wm/tools/rhosetup/stdafx.h +59 -0
  330. data/rakefile.rb +33 -10
  331. data/res/build-tools/db/syncdb.schema +25 -23
  332. data/res/build-tools/db/syncdb.triggers +1 -1
  333. data/res/build-tools/detool.exe +0 -0
  334. data/res/build-tools/rhosetup.dll +0 -0
  335. data/res/generators/rhogen.rb +27 -22
  336. data/res/generators/templates/application/app/Settings/controller.rb +3 -1
  337. data/res/generators/templates/application/app/Settings/home.bb.erb +17 -0
  338. data/res/generators/templates/application/app/Settings/home.erb +21 -12
  339. data/res/generators/templates/application/app/Settings/index.bb.erb +32 -0
  340. data/res/generators/templates/application/app/Settings/index.erb +44 -15
  341. data/res/generators/templates/application/app/Settings/login.bb.erb +35 -0
  342. data/res/generators/templates/application/app/Settings/login.erb +29 -30
  343. data/res/generators/templates/application/app/Settings/reset.bb.erb +15 -0
  344. data/res/generators/templates/application/app/Settings/reset.erb +16 -13
  345. data/res/generators/templates/application/app/Settings/wait.bb.erb +3 -0
  346. data/res/generators/templates/application/app/Settings/wait.erb +4 -4
  347. data/res/generators/templates/application/app/application.rb +8 -0
  348. data/res/generators/templates/application/app/helpers/browser_helper.rb +13 -0
  349. data/res/generators/templates/application/app/index.bb.erb +26 -0
  350. data/res/generators/templates/application/app/index.erb +21 -12
  351. data/res/generators/templates/application/app/layout.erb +9 -11
  352. data/res/generators/templates/application/public/css/android.css +285 -0
  353. data/res/generators/templates/application/public/css/blackberry.css +85 -78
  354. data/res/generators/templates/application/public/css/iphone.css +286 -296
  355. data/res/generators/templates/application/public/css/webkit.css +34 -0
  356. data/res/generators/templates/application/public/css/windows_mobile.css +208 -0
  357. data/res/generators/templates/application/public/icons/Read me first - license.txt +14 -0
  358. data/res/generators/templates/application/public/icons/about.png +0 -0
  359. data/res/generators/templates/application/public/icons/airplane.png +0 -0
  360. data/res/generators/templates/application/public/icons/baby.png +0 -0
  361. data/res/generators/templates/application/public/icons/badge.png +0 -0
  362. data/res/generators/templates/application/public/icons/bandaid.png +0 -0
  363. data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
  364. data/res/generators/templates/application/public/icons/battery.png +0 -0
  365. data/res/generators/templates/application/public/icons/beaker.png +0 -0
  366. data/res/generators/templates/application/public/icons/beaker2.png +0 -0
  367. data/res/generators/templates/application/public/icons/beermug.png +0 -0
  368. data/res/generators/templates/application/public/icons/bird.png +0 -0
  369. data/res/generators/templates/application/public/icons/book.png +0 -0
  370. data/res/generators/templates/application/public/icons/bookmark.png +0 -0
  371. data/res/generators/templates/application/public/icons/brightness.png +0 -0
  372. data/res/generators/templates/application/public/icons/bug.png +0 -0
  373. data/res/generators/templates/application/public/icons/cabinet.png +0 -0
  374. data/res/generators/templates/application/public/icons/calendar.png +0 -0
  375. data/res/generators/templates/application/public/icons/camera.png +0 -0
  376. data/res/generators/templates/application/public/icons/changeName.rb +22 -0
  377. data/res/generators/templates/application/public/icons/chat2.png +0 -0
  378. data/res/generators/templates/application/public/icons/chicken.png +0 -0
  379. data/res/generators/templates/application/public/icons/clock.png +0 -0
  380. data/res/generators/templates/application/public/icons/cloud.png +0 -0
  381. data/res/generators/templates/application/public/icons/coffee.png +0 -0
  382. data/res/generators/templates/application/public/icons/compass.png +0 -0
  383. data/res/generators/templates/application/public/icons/contrast.png +0 -0
  384. data/res/generators/templates/application/public/icons/dashboard.png +0 -0
  385. data/res/generators/templates/application/public/icons/display.png +0 -0
  386. data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
  387. data/res/generators/templates/application/public/icons/download.png +0 -0
  388. data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
  389. data/res/generators/templates/application/public/icons/ekg.png +0 -0
  390. data/res/generators/templates/application/public/icons/envelope.png +0 -0
  391. data/res/generators/templates/application/public/icons/equalizer.png +0 -0
  392. data/res/generators/templates/application/public/icons/eye.png +0 -0
  393. data/res/generators/templates/application/public/icons/film-roll.png +0 -0
  394. data/res/generators/templates/application/public/icons/flag.png +0 -0
  395. data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
  396. data/res/generators/templates/application/public/icons/fuel.png +0 -0
  397. data/res/generators/templates/application/public/icons/gameplan.png +0 -0
  398. data/res/generators/templates/application/public/icons/gear.png +0 -0
  399. data/res/generators/templates/application/public/icons/gear2.png +0 -0
  400. data/res/generators/templates/application/public/icons/gift.png +0 -0
  401. data/res/generators/templates/application/public/icons/heart.png +0 -0
  402. data/res/generators/templates/application/public/icons/house.png +0 -0
  403. data/res/generators/templates/application/public/icons/inbox.png +0 -0
  404. data/res/generators/templates/application/public/icons/index-cards.png +0 -0
  405. data/res/generators/templates/application/public/icons/iphone.png +0 -0
  406. data/res/generators/templates/application/public/icons/ipod.png +0 -0
  407. data/res/generators/templates/application/public/icons/key.png +0 -0
  408. data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
  409. data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
  410. data/res/generators/templates/application/public/icons/line-chart.png +0 -0
  411. data/res/generators/templates/application/public/icons/location.png +0 -0
  412. data/res/generators/templates/application/public/icons/lock.png +0 -0
  413. data/res/generators/templates/application/public/icons/loopback.png +0 -0
  414. data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
  415. data/res/generators/templates/application/public/icons/map-marker.png +0 -0
  416. data/res/generators/templates/application/public/icons/map.png +0 -0
  417. data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
  418. data/res/generators/templates/application/public/icons/medical.png +0 -0
  419. data/res/generators/templates/application/public/icons/microphone.png +0 -0
  420. data/res/generators/templates/application/public/icons/movie1.png +0 -0
  421. data/res/generators/templates/application/public/icons/movie2.png +0 -0
  422. data/res/generators/templates/application/public/icons/network.png +0 -0
  423. data/res/generators/templates/application/public/icons/note.png +0 -0
  424. data/res/generators/templates/application/public/icons/outlet.png +0 -0
  425. data/res/generators/templates/application/public/icons/palette.png +0 -0
  426. data/res/generators/templates/application/public/icons/paperclip.png +0 -0
  427. data/res/generators/templates/application/public/icons/phone.png +0 -0
  428. data/res/generators/templates/application/public/icons/photos.png +0 -0
  429. data/res/generators/templates/application/public/icons/piano.png +0 -0
  430. data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
  431. data/res/generators/templates/application/public/icons/pill.png +0 -0
  432. data/res/generators/templates/application/public/icons/pin.png +0 -0
  433. data/res/generators/templates/application/public/icons/pinetree.png +0 -0
  434. data/res/generators/templates/application/public/icons/planet.png +0 -0
  435. data/res/generators/templates/application/public/icons/puzzle.png +0 -0
  436. data/res/generators/templates/application/public/icons/radar.png +0 -0
  437. data/res/generators/templates/application/public/icons/redo.png +0 -0
  438. data/res/generators/templates/application/public/icons/refresh.png +0 -0
  439. data/res/generators/templates/application/public/icons/runner.png +0 -0
  440. data/res/generators/templates/application/public/icons/shoebox.png +0 -0
  441. data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
  442. data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
  443. data/res/generators/templates/application/public/icons/shuffle.png +0 -0
  444. data/res/generators/templates/application/public/icons/signpost.png +0 -0
  445. data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
  446. data/res/generators/templates/application/public/icons/skull.png +0 -0
  447. data/res/generators/templates/application/public/icons/sliders.png +0 -0
  448. data/res/generators/templates/application/public/icons/spraycan.png +0 -0
  449. data/res/generators/templates/application/public/icons/squiggle.png +0 -0
  450. data/res/generators/templates/application/public/icons/star.png +0 -0
  451. data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
  452. data/res/generators/templates/application/public/icons/suitcase.png +0 -0
  453. data/res/generators/templates/application/public/icons/tag.png +0 -0
  454. data/res/generators/templates/application/public/icons/tags.png +0 -0
  455. data/res/generators/templates/application/public/icons/target.png +0 -0
  456. data/res/generators/templates/application/public/icons/testtube.png +0 -0
  457. data/res/generators/templates/application/public/icons/thermometer.png +0 -0
  458. data/res/generators/templates/application/public/icons/toolbox.png +0 -0
  459. data/res/generators/templates/application/public/icons/trophy.png +0 -0
  460. data/res/generators/templates/application/public/icons/tshirt.png +0 -0
  461. data/res/generators/templates/application/public/icons/tv.png +0 -0
  462. data/res/generators/templates/application/public/icons/umbrella.png +0 -0
  463. data/res/generators/templates/application/public/icons/walk.png +0 -0
  464. data/res/generators/templates/application/public/icons/weather.png +0 -0
  465. data/res/generators/templates/application/public/icons/widescreen.png +0 -0
  466. data/res/generators/templates/application/public/icons/wineglass.png +0 -0
  467. data/res/generators/templates/application/public/icons/zap.png +0 -0
  468. data/res/generators/templates/application/public/images/android/btn_check_off.png +0 -0
  469. data/res/generators/templates/application/public/images/android/btn_check_on.png +0 -0
  470. data/res/generators/templates/application/public/images/android/btn_radio_off.png +0 -0
  471. data/res/generators/templates/application/public/images/android/btn_radio_on.png +0 -0
  472. data/res/generators/templates/application/public/images/android/ic_menu_more.png +0 -0
  473. data/res/generators/templates/application/public/images/iphone/disclosure.png +0 -0
  474. data/res/generators/templates/application/public/images/iphone/disclosure_detail.png +0 -0
  475. data/res/generators/templates/application/public/images/iphone/radiobutton.png +0 -0
  476. data/res/generators/templates/application/public/images/iphone/select.png +0 -0
  477. data/res/generators/templates/application/public/images/iphone/switch.png +0 -0
  478. data/res/generators/templates/application/public/images/listArrow.png +0 -0
  479. data/res/generators/templates/application/public/images/listArrowDown.png +0 -0
  480. data/res/generators/templates/model/controller.rb +2 -0
  481. data/res/generators/templates/model/edit.bb.erb +24 -0
  482. data/res/generators/templates/model/edit.erb +21 -25
  483. data/res/generators/templates/model/index.bb.erb +21 -0
  484. data/res/generators/templates/model/index.erb +28 -14
  485. data/res/generators/templates/model/new.bb.erb +24 -0
  486. data/res/generators/templates/model/new.erb +20 -20
  487. data/res/generators/templates/model/show.bb.erb +21 -0
  488. data/res/generators/templates/model/show.erb +15 -15
  489. data/rhobuild.yml +37 -0
  490. data/rhodes.gemspec +1 -1
  491. data/spec/framework_spec/app/Account/config.rb +57 -1
  492. data/spec/framework_spec/app/Case/config.rb +1 -1
  493. data/spec/framework_spec/app/Customer/config.rb +1 -1
  494. data/spec/framework_spec/app/Product/config.rb +15 -1
  495. data/spec/framework_spec/app/spec/fixtures/object_values.txt +90 -90
  496. data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +91 -91
  497. data/spec/framework_spec/app/spec/rho_spec.rb +1 -1
  498. data/spec/framework_spec/app/spec/rhom_object_spec.rb +47 -28
  499. data/spec/framework_spec/app/spec/rhom_spec.rb +8 -8
  500. data/spec/framework_spec/app/spec/spec_helper.rb +13 -5
  501. data/spec/framework_spec/app/spec_runner.rb +5 -4
  502. data/spec/framework_spec/public/css/base.css +0 -1
  503. data/spec/framework_spec/public/css/iphone.css +0 -1
  504. data/spec/framework_spec/rhoconfig.txt +3 -1
  505. metadata +220 -37
  506. data/platform/bb/rhodes/src/rhomobile/WebView.java +0 -90
  507. data/platform/iphone/Classes/BarItem.h +0 -27
  508. data/platform/iphone/Classes/BarItem.m +0 -32
  509. data/platform/iphone/Classes/JSString.h +0 -12
  510. data/platform/iphone/Classes/JSString.m +0 -7
  511. data/platform/iphone/Classes/RhoRunnerAppDelegate.h +0 -48
  512. data/platform/iphone/Classes/RhoRunnerAppDelegate.m +0 -617
  513. data/platform/iphone/Classes/Server/ServerHost.h +0 -81
  514. data/platform/iphone/Classes/Server/ServerHost.m +0 -597
  515. data/platform/iphone/Classes/Server/WebViewUrl.h +0 -13
  516. data/platform/iphone/Classes/Server/WebViewUrl.m +0 -8
  517. data/platform/iphone/Classes/TabBarDelegate.h +0 -39
  518. data/platform/iphone/Classes/TabBarDelegate.m +0 -151
  519. data/platform/iphone/Classes/Utils/unzip.cpp +0 -4328
  520. data/platform/iphone/Classes/Utils/unzip.h +0 -234
  521. data/platform/iphone/Classes/WebViewController.h +0 -59
  522. data/platform/iphone/Classes/WebViewController.m +0 -472
  523. data/platform/wm/rhodes/GetURLDialog.cpp +0 -64
  524. data/platform/wm/rhodes/GetURLDialog.h +0 -39
  525. data/res/generators/templates/application/public/css/base.css +0 -39
  526. data/res/generators/templates/application/public/css/rho.css +0 -3
  527. data/res/generators/templates/application/public/css/xhtml.css +0 -114
  528. data/spec/framework_spec/app/Question/config.rb +0 -3
  529. data/spec/generator_spec/source_generator_spec.rb +0 -27
@@ -1,234 +0,0 @@
1
- #ifndef _unzip_H
2
- #define _unzip_H
3
-
4
- #if defined(__cplusplus)
5
- extern "C" {
6
- #endif
7
-
8
- //
9
- #ifdef ZIP_STD
10
- #include <time.h>
11
- #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
12
- #ifndef MAX_PATH
13
- #define MAX_PATH 1024
14
- #endif
15
- typedef unsigned long DWORD;
16
- typedef char TCHAR;
17
- typedef FILE* HANDLE;
18
- typedef time_t FILETIME;
19
- #endif
20
-
21
- // UNZIPPING functions -- for unzipping.
22
- // This file is a repackaged form of extracts from the zlib code available
23
- // at www.gzip.org/zlib, by Jean-Loup Gailly and Mark Adler. The original
24
- // copyright notice may be found in unzip.cpp. The repackaging was done
25
- // by Lucian Wischik to simplify and extend its use in Windows/C++. Also
26
- // encryption and unicode filenames have been added.
27
-
28
-
29
- #ifndef _zip_H
30
- DECLARE_HANDLE(HZIP);
31
- #endif
32
- // An HZIP identifies a zip file that has been opened
33
-
34
- typedef DWORD ZRESULT;
35
- // return codes from any of the zip functions. Listed later.
36
-
37
- typedef struct
38
- { int index; // index of this file within the zip
39
- TCHAR name[MAX_PATH]; // filename within the zip
40
- DWORD attr; // attributes, as in GetFileAttributes.
41
- FILETIME atime,ctime,mtime;// access, create, modify filetimes
42
- long comp_size; // sizes of item, compressed and uncompressed. These
43
- long unc_size; // may be -1 if not yet known (e.g. being streamed in)
44
- } ZIPENTRY;
45
-
46
-
47
- //HZIP OpenZip(const TCHAR *fn, const char *password);
48
- HZIP OpenZip(void *z,unsigned int len, const char *password);
49
- HZIP OpenZipHandle(HANDLE h, const char *password);
50
- // OpenZip - opens a zip file and returns a handle with which you can
51
- // subsequently examine its contents. You can open a zip file from:
52
- // from a pipe: OpenZipHandle(hpipe_read,0);
53
- // from a file (by handle): OpenZipHandle(hfile,0);
54
- // from a file (by name): OpenZip("c:\\test.zip","password");
55
- // from a memory block: OpenZip(bufstart, buflen,0);
56
- // If the file is opened through a pipe, then items may only be
57
- // accessed in increasing order, and an item may only be unzipped once,
58
- // although GetZipItem can be called immediately before and after unzipping
59
- // it. If it's opened in any other way, then full random access is possible.
60
- // Note: pipe input is not yet implemented.
61
- // Note: zip passwords are ascii, not unicode.
62
- // Note: for windows-ce, you cannot close the handle until after CloseZip.
63
- // but for real windows, the zip makes its own copy of your handle, so you
64
- // can close yours anytime.
65
-
66
- ZRESULT GetZipItem(HZIP hz, int index, ZIPENTRY *ze);
67
- // GetZipItem - call this to get information about an item in the zip.
68
- // If index is -1 and the file wasn't opened through a pipe,
69
- // then it returns information about the whole zipfile
70
- // (and in particular ze.index returns the number of index items).
71
- // Note: the item might be a directory (ze.attr & FILE_ATTRIBUTE_DIRECTORY)
72
- // See below for notes on what happens when you unzip such an item.
73
- // Note: if you are opening the zip through a pipe, then random access
74
- // is not possible and GetZipItem(-1) fails and you can't discover the number
75
- // of items except by calling GetZipItem on each one of them in turn,
76
- // starting at 0, until eventually the call fails. Also, in the event that
77
- // you are opening through a pipe and the zip was itself created into a pipe,
78
- // then then comp_size and sometimes unc_size as well may not be known until
79
- // after the item has been unzipped.
80
-
81
- ZRESULT FindZipItem(HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRY *ze);
82
- // FindZipItem - finds an item by name. ic means 'insensitive to case'.
83
- // It returns the index of the item, and returns information about it.
84
- // If nothing was found, then index is set to -1 and the function returns
85
- // an error code.
86
-
87
- ZRESULT UnzipItem(HZIP hz, int index, const TCHAR *fn);
88
- //ZRESULT UnzipItem(HZIP hz, int index, void *z,unsigned int len);
89
- ZRESULT UnzipItemHandle(HZIP hz, int index, HANDLE h);
90
- // UnzipItem - given an index to an item, unzips it. You can unzip to:
91
- // to a pipe: UnzipItemHandle(hz,i, hpipe_write);
92
- // to a file (by handle): UnzipItemHandle(hz,i, hfile);
93
- // to a file (by name): UnzipItem(hz,i, ze.name);
94
- // to a memory block: UnzipItem(hz,i, buf,buflen);
95
- // In the final case, if the buffer isn't large enough to hold it all,
96
- // then the return code indicates that more is yet to come. If it was
97
- // large enough, and you want to know precisely how big, GetZipItem.
98
- // Note: zip files are normally stored with relative pathnames. If you
99
- // unzip with ZIP_FILENAME a relative pathname then the item gets created
100
- // relative to the current directory - it first ensures that all necessary
101
- // subdirectories have been created. Also, the item may itself be a directory.
102
- // If you unzip a directory with ZIP_FILENAME, then the directory gets created.
103
- // If you unzip it to a handle or a memory block, then nothing gets created
104
- // and it emits 0 bytes.
105
- ZRESULT SetUnzipBaseDir(HZIP hz, const TCHAR *dir);
106
- // if unzipping to a filename, and it's a relative filename, then it will be relative to here.
107
- // (defaults to current-directory).
108
-
109
-
110
- ZRESULT CloseZip(HZIP hz);
111
- // CloseZip - the zip handle must be closed with this function.
112
-
113
- unsigned int FormatZipMessage(ZRESULT code, TCHAR *buf,unsigned int len);
114
- // FormatZipMessage - given an error code, formats it as a string.
115
- // It returns the length of the error message. If buf/len points
116
- // to a real buffer, then it also writes as much as possible into there.
117
-
118
-
119
- // These are the result codes:
120
- #define ZR_OK 0x00000000 // nb. the pseudo-code zr-recent is never returned,
121
- #define ZR_RECENT 0x00000001 // but can be passed to FormatZipMessage.
122
- // The following come from general system stuff (e.g. files not openable)
123
- #define ZR_GENMASK 0x0000FF00
124
- #define ZR_NODUPH 0x00000100 // couldn't duplicate the handle
125
- #define ZR_NOFILE 0x00000200 // couldn't create/open the file
126
- #define ZR_NOALLOC 0x00000300 // failed to allocate some resource
127
- #define ZR_WRITE 0x00000400 // a general error writing to the file
128
- #define ZR_NOTFOUND 0x00000500 // couldn't find that file in the zip
129
- #define ZR_MORE 0x00000600 // there's still more data to be unzipped
130
- #define ZR_CORRUPT 0x00000700 // the zipfile is corrupt or not a zipfile
131
- #define ZR_READ 0x00000800 // a general error reading the file
132
- #define ZR_PASSWORD 0x00001000 // we didn't get the right password to unzip the file
133
- // The following come from mistakes on the part of the caller
134
- #define ZR_CALLERMASK 0x00FF0000
135
- #define ZR_ARGS 0x00010000 // general mistake with the arguments
136
- #define ZR_NOTMMAP 0x00020000 // tried to ZipGetMemory, but that only works on mmap zipfiles, which yours wasn't
137
- #define ZR_MEMSIZE 0x00030000 // the memory size is too small
138
- #define ZR_FAILED 0x00040000 // the thing was already failed when you called this function
139
- #define ZR_ENDED 0x00050000 // the zip creation has already been closed
140
- #define ZR_MISSIZE 0x00060000 // the indicated input file size turned out mistaken
141
- #define ZR_PARTIALUNZ 0x00070000 // the file had already been partially unzipped
142
- #define ZR_ZMODE 0x00080000 // tried to mix creating/opening a zip
143
- // The following come from bugs within the zip library itself
144
- #define ZR_BUGMASK 0xFF000000
145
- #define ZR_NOTINITED 0x01000000 // initialisation didn't work
146
- #define ZR_SEEK 0x02000000 // trying to seek in an unseekable file
147
- #define ZR_NOCHANGE 0x04000000 // changed its mind on storage, but not allowed
148
- #define ZR_FLATE 0x05000000 // an internal error in the de/inflation code
149
-
150
-
151
-
152
-
153
-
154
- // e.g.
155
- //
156
- // SetCurrentDirectory("c:\\docs\\stuff");
157
- // HZIP hz = OpenZip("c:\\stuff.zip",0);
158
- // ZIPENTRY ze; GetZipItem(hz,-1,&ze); int numitems=ze.index;
159
- // for (int i=0; i<numitems; i++)
160
- // { GetZipItem(hz,i,&ze);
161
- // UnzipItem(hz,i,ze.name);
162
- // }
163
- // CloseZip(hz);
164
- //
165
- //
166
- // HRSRC hrsrc = FindResource(hInstance,MAKEINTRESOURCE(1),RT_RCDATA);
167
- // HANDLE hglob = LoadResource(hInstance,hrsrc);
168
- // void *zipbuf=LockResource(hglob);
169
- // unsigned int ziplen=SizeofResource(hInstance,hrsrc);
170
- // HZIP hz = OpenZip(zipbuf, ziplen, 0);
171
- // - unzip to a membuffer -
172
- // ZIPENTRY ze; int i; FindZipItem(hz,"file.dat",true,&i,&ze);
173
- // char *ibuf = new char[ze.unc_size];
174
- // UnzipItem(hz,i, ibuf, ze.unc_size);
175
- // delete[] ibuf;
176
- // - unzip to a fixed membuff -
177
- // ZIPENTRY ze; int i; FindZipItem(hz,"file.dat",true,&i,&ze);
178
- // char ibuf[1024]; ZRESULT zr=ZR_MORE; unsigned long totsize=0;
179
- // while (zr==ZR_MORE)
180
- // { zr = UnzipItem(hz,i, ibuf,1024);
181
- // unsigned long bufsize=1024; if (zr==ZR_OK) bufsize=ze.unc_size-totsize;
182
- // totsize+=bufsize;
183
- // }
184
- // - unzip to a pipe -
185
- // HANDLE hwrite; HANDLE hthread=CreateWavReaderThread(&hwrite);
186
- // int i; ZIPENTRY ze; FindZipItem(hz,"sound.wav",true,&i,&ze);
187
- // UnzipItemHandle(hz,i, hwrite);
188
- // CloseHandle(hwrite);
189
- // WaitForSingleObject(hthread,INFINITE);
190
- // CloseHandle(hwrite); CloseHandle(hthread);
191
- // - finished -
192
- // CloseZip(hz);
193
- // // note: no need to free resources obtained through Find/Load/LockResource
194
- //
195
- //
196
- // SetCurrentDirectory("c:\\docs\\pipedzipstuff");
197
- // HANDLE hread,hwrite; CreatePipe(&hread,&hwrite,0,0);
198
- // CreateZipWriterThread(hwrite);
199
- // HZIP hz = OpenZipHandle(hread,0);
200
- // for (int i=0; ; i++)
201
- // { ZIPENTRY ze;
202
- // ZRESULT zr=GetZipItem(hz,i,&ze); if (zr!=ZR_OK) break; // no more
203
- // UnzipItem(hz,i, ze.name);
204
- // }
205
- // CloseZip(hz);
206
- //
207
- //
208
-
209
-
210
-
211
-
212
- // Now we indulge in a little skullduggery so that the code works whether
213
- // the user has included just zip or both zip and unzip.
214
- // Idea: if header files for both zip and unzip are present, then presumably
215
- // the cpp files for zip and unzip are both present, so we will call
216
- // one or the other of them based on a dynamic choice. If the header file
217
- // for only one is present, then we will bind to that particular one.
218
- ZRESULT CloseZipU(HZIP hz);
219
- unsigned int FormatZipMessageU(ZRESULT code, TCHAR *buf,unsigned int len);
220
- bool IsZipHandleU(HZIP hz);
221
- #ifdef _zip_H
222
- #undef CloseZip
223
- #define CloseZip(hz) (IsZipHandleU(hz)?CloseZipU(hz):CloseZipZ(hz))
224
- #else
225
- #define CloseZip CloseZipU
226
- #define FormatZipMessage FormatZipMessageU
227
- #endif
228
-
229
-
230
- #if defined(__cplusplus)
231
- }
232
- #endif
233
-
234
- #endif // _unzip_H
@@ -1,59 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
- #import <Foundation/Foundation.h>
3
- #import "JSString.h"
4
- //#include "SyncEngine.h"
5
-
6
- @interface WebViewController : UIViewController <UIActionSheetDelegate, UIWebViewDelegate> {
7
- UINavigationBar* navBar;
8
- UIToolbar* toolbar;
9
- UIBarButtonItem* backBtn;
10
- UIBarButtonItem* forwardBtn;
11
- UIBarButtonItem* homeBtn;
12
- UIBarButtonItem* refreshBtn;
13
- UIBarButtonItem* optionsBtn;
14
- UILabel* activityInfo;
15
- UIWebView *webView;
16
- UIActivityIndicatorView *activity;
17
- //NSString *viewHomeUrl,*viewOptionsUrl;
18
-
19
- @public
20
- id actionTarget;
21
- SEL onShowLog;
22
- UIWindow *window;
23
- }
24
-
25
- //@property (assign) NSString *viewHomeUrl;
26
- //@property (assign) NSString *viewOptionsUrl;
27
-
28
- @property (assign) id actionTarget;
29
- @property (assign) UIToolbar* toolbar;
30
- @property (assign) UIWebView* webView;
31
- @property (assign) SEL onShowLog;
32
-
33
- -(id)initWithParentWindow:(UIWindow*)w;
34
-
35
- -(void)loadData:(NSData*)data mimeType:(NSString*)type;
36
-
37
- -(void)showToolbar:(BOOL)show;
38
- -(void)createNewToolbar:(NSArray*)items;
39
-
40
- -(void)navigate:(NSString*)url;
41
- -(void)navigateRedirect:(NSString*)url;
42
-
43
- -(void)setActivityInfo:(NSString *)labelText;
44
-
45
- -(void)goBack:(id)sender;
46
- -(void)goForward:(id)sender;
47
- -(void)goHome:(id)sender;
48
- -(void)goOptions:(id)sender;
49
- -(void)refresh;
50
-
51
- -(void)executeJs:(JSString *)js;
52
-
53
- -(void)active;
54
-
55
- -(void)inactive;
56
-
57
- //-(void)runSync;
58
-
59
- @end
@@ -1,472 +0,0 @@
1
- #import "WebViewController.h"
2
- #import "AppManager.h"
3
- //#import "ruby/ext/rho/rhoruby.h"
4
- //#import "UniversalLock.h"
5
- #import "common/RhoConf.h"
6
- //#import "sync/syncthread.h"
7
- #import "common/RhodesApp.h"
8
- #import "logging/RhoLog.h"
9
- #undef DEFAULT_LOGCATEGORY
10
- #define DEFAULT_LOGCATEGORY "WebViewCtrl"
11
- /*
12
- static char currentLocation[4096] = "";
13
-
14
- //INIT_LOCK(current_location); // racing condition on thid lock, need to fix it somehow
15
-
16
- void set_current_location(CFStringRef location) {
17
- //LOCK(current_location);
18
- CFStringGetCString((CFStringRef)location, currentLocation, sizeof(currentLocation), CFStringGetSystemEncoding());
19
-
20
- char* fragment = strstr(currentLocation,"#");
21
- if (fragment) *fragment = 0; //cut out fragment
22
- RAWLOG_INFO1("Current location: %s",currentLocation);
23
- //UNLOCK(current_location);
24
-
25
- if (rho_conf_getBool("KeepTrackOfLastVisitedPage")) {
26
- rho_conf_setString("LastVisitedPage",currentLocation);
27
- rho_conf_save();
28
- }
29
-
30
- }
31
-
32
- char* get_current_location() {
33
- //LOCK(current_location);
34
- return currentLocation;
35
- //UNLOCK(current_location);
36
- }*/
37
-
38
- extern int webview_active_tab();
39
-
40
- @interface UIBarButtonItemAction : NSObject
41
- {
42
- WebViewController *wc;
43
- NSString *url;
44
- bool callback;
45
- }
46
-
47
- @property (nonatomic,copy) NSString *url;
48
-
49
- - (id)init:(WebViewController*)w url:(NSString*)u callback:(bool)c;
50
- - (void)onAction:(id)sender;
51
-
52
- @end
53
-
54
- @implementation UIBarButtonItemAction
55
-
56
- @synthesize url;
57
-
58
- - (id)init:(WebViewController *)w url:(NSString*)u callback:(bool)c {
59
- wc = w;
60
- self.url = u;
61
- callback = c;
62
- return self;
63
- }
64
-
65
- - (void)doAction {
66
- if (callback)
67
- rho_net_request([url UTF8String]);
68
- else
69
- [wc navigate:url];
70
- }
71
-
72
- - (void)onAction:(id)sender {
73
- [self performSelectorOnMainThread:@selector(doAction) withObject:nil waitUntilDone:NO];
74
- }
75
-
76
- @end
77
-
78
-
79
- @implementation WebViewController
80
-
81
- //@synthesize viewHomeUrl, viewOptionsUrl;
82
- @synthesize actionTarget, onShowLog, toolbar, webView;
83
-
84
- - (void)dealloc {
85
- [backBtn release];
86
- [forwardBtn release];
87
- [homeBtn release];
88
- [refreshBtn release];
89
- [optionsBtn release];
90
- [activity release];
91
- [toolbar release];
92
- [super dealloc];
93
- }
94
-
95
- - (void)createNewToolbar:(NSArray*)items {
96
- if ([items count] % 4 != 0) {
97
- RAWLOG_ERROR("Illegal arguments for createNewToolbar");
98
- return;
99
- }
100
-
101
- UIToolbar *tb = [UIToolbar new];
102
- tb.barStyle = UIBarStyleBlackOpaque;
103
-
104
- [tb sizeToFit];
105
-
106
- CGRect mainFrame = window.frame;
107
-
108
- CGFloat tbHeight = [tb frame].size.height;
109
- CGRect tbFrame = CGRectMake(CGRectGetMinX(mainFrame),
110
- CGRectGetHeight(mainFrame) - tbHeight,
111
- CGRectGetWidth(mainFrame),
112
- tbHeight);
113
- [tb setFrame:tbFrame];
114
-
115
- UIBarButtonItem *fixed = [[UIBarButtonItem alloc]
116
- initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
117
- target:nil action:nil];
118
-
119
- NSMutableArray *btns = [NSMutableArray arrayWithCapacity:[items count]/4];
120
- for(int i = 0, lim = [items count]/4; i < lim; i++) {
121
- int index = i*4;
122
- NSString *label = (NSString*)[items objectAtIndex:index++];
123
- NSString *url = (NSString*)[items objectAtIndex:index++];
124
- NSString *icon = (NSString*)[items objectAtIndex:index++];
125
- //NSString *reload = (NSString*)[items objectAtIndex:index++];
126
-
127
- if ([url length] == 0) {
128
- RAWLOG_ERROR("Illegal arguments for createNewToolbar");
129
- return;
130
- }
131
-
132
- UIImage *img = nil;
133
- if ([icon length] > 0) {
134
- NSString *imagePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:icon];
135
- img = [UIImage imageWithContentsOfFile:imagePath];
136
- }
137
-
138
- UIBarButtonItem *btn = nil;
139
- if ([url compare:@"back"] == NSOrderedSame) {
140
- btn = [[UIBarButtonItem alloc]
141
- initWithImage:(img ? img : [UIImage imageNamed:@"back_btn.png"])
142
- style:UIBarButtonItemStylePlain target:self
143
- action:@selector(goBack:)];
144
- }
145
- else if ([url compare:@"forward"] == NSOrderedSame) {
146
- btn = [[UIBarButtonItem alloc]
147
- initWithImage:(img ? img : [UIImage imageNamed:@"forward_btn.png"])
148
- style:UIBarButtonItemStylePlain target:self
149
- action:@selector(goForward:)];
150
- }
151
- else if ([url compare:@"home"] == NSOrderedSame) {
152
- btn = [[UIBarButtonItem alloc]
153
- initWithImage:(img ? img : [UIImage imageNamed:@"home_btn.png"])
154
- style:UIBarButtonItemStylePlain target:self
155
- action:@selector(goHome:)];
156
- }
157
- else if ([url compare:@"options"] == NSOrderedSame) {
158
- btn = [[UIBarButtonItem alloc]
159
- initWithImage:(img ? img : [UIImage imageNamed:@"gears.png"])
160
- style:UIBarButtonItemStylePlain target:self
161
- action:@selector(goOptions:)];
162
- }
163
- else if ([url compare:@"refresh"] == NSOrderedSame) {
164
- if (img)
165
- btn = [[UIBarButtonItem alloc]
166
- initWithImage:img
167
- style:UIBarButtonItemStylePlain target:self
168
- action:@selector(onRefresh:)];
169
- else
170
- btn = [[UIBarButtonItem alloc]
171
- initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
172
- target:self action:@selector(onRefresh:)];
173
- }
174
- else if ([url compare:@"separator"] == NSOrderedSame) {
175
- btn = [[UIBarButtonItem alloc]
176
- initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
177
- target:nil action:nil];
178
- }
179
- else {
180
- bool callback = false;
181
- if ([url length] > 9 && [[url substringToIndex:9] isEqual:@"callback:"]) {
182
- callback = true;
183
- url = [url substringFromIndex:9];
184
- }
185
- NSString *u = [NSString stringWithUTF8String:rho_http_normalizeurl([url UTF8String])];
186
- UIBarButtonItemAction *action = [[UIBarButtonItemAction alloc] init:self url:u callback:callback];
187
- if (img) {
188
- btn = [[UIBarButtonItem alloc]
189
- initWithImage:img style:UIBarButtonItemStylePlain
190
- target:action action:@selector(onAction:)];
191
- }
192
- else if ([label length] > 0) {
193
- btn = [[UIBarButtonItem alloc]
194
- initWithTitle:label style:UIBarButtonItemStylePlain
195
- target:action action:@selector(onAction:)];
196
- }
197
- }
198
-
199
- if (btn) {
200
- [btns addObject:fixed];
201
- [btns addObject:btn];
202
- }
203
- }
204
-
205
- [tb setItems:btns];
206
-
207
- [fixed release];
208
-
209
- [toolbar removeFromSuperview];
210
- toolbar = tb;
211
- toolbar.hidden = YES;
212
- [window addSubview:toolbar];
213
- }
214
-
215
- - (UIToolbar*)newToolbar:(CGRect)mainFrame {
216
- UIToolbar *tb = [UIToolbar new];
217
- tb.barStyle = UIBarStyleBlackOpaque;
218
-
219
- [tb sizeToFit];
220
-
221
- CGFloat tbHeight = [tb frame].size.height;
222
- CGRect tbFrame = CGRectMake(CGRectGetMinX(mainFrame),
223
- CGRectGetHeight(mainFrame) - tbHeight,
224
- CGRectGetWidth(mainFrame),
225
- tbHeight);
226
- [tb setFrame:tbFrame];
227
-
228
- backBtn = [[UIBarButtonItem alloc]
229
- initWithImage:[UIImage imageNamed:@"back_btn.png"]
230
- style:UIBarButtonItemStylePlain target:self
231
- action:@selector(goBack:)];
232
-
233
- forwardBtn = [[UIBarButtonItem alloc]
234
- initWithImage:[UIImage imageNamed:@"forward_btn.png"]
235
- style:UIBarButtonItemStylePlain target:self
236
- action:@selector(goForward:)];
237
-
238
- homeBtn = [[UIBarButtonItem alloc]
239
- initWithImage:[UIImage imageNamed:@"home_btn.png"]
240
- style:UIBarButtonItemStylePlain target:self
241
- action:@selector(goHome:)];
242
-
243
- refreshBtn = [[UIBarButtonItem alloc]
244
- initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
245
- target:self action:@selector(onRefresh:)];
246
-
247
- optionsBtn = [[UIBarButtonItem alloc]
248
- initWithImage:[UIImage imageNamed:@"gears.png"]
249
- style:UIBarButtonItemStylePlain target:self
250
- action:@selector(goOptions:)];
251
-
252
- activity = [[UIActivityIndicatorView alloc]
253
- initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
254
- activity.hidesWhenStopped = YES;
255
-
256
- UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc]
257
- initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
258
- target:nil action:nil];
259
-
260
- UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc]
261
- initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
262
- target:nil action:nil];
263
-
264
- NSArray *items = [NSArray arrayWithObjects:backBtn, fixedSpace, forwardBtn, flexSpace,
265
- homeBtn, fixedSpace, refreshBtn, fixedSpace, optionsBtn, nil];
266
- [tb setItems:items];
267
-
268
- [fixedSpace release];
269
- [flexSpace release];
270
-
271
- return tb;
272
- }
273
-
274
- - (id)initWithParentWindow:(UIWindow*)w {
275
- window = w;
276
-
277
- CGRect mainFrame = window.frame;
278
-
279
- toolbar = [self newToolbar:window.frame];
280
- toolbar.hidden = YES;
281
- [window addSubview:toolbar];
282
-
283
- CGRect tbFrame = toolbar.frame;
284
-
285
- CGRect wvFrame = CGRectMake(CGRectGetMinX(mainFrame), CGRectGetMinY(mainFrame),
286
- CGRectGetWidth(mainFrame),
287
- CGRectGetHeight(mainFrame) - CGRectGetHeight(tbFrame));
288
- webView = [[UIWebView alloc] initWithFrame:wvFrame];
289
- webView.scalesPageToFit = YES;
290
- webView.userInteractionEnabled = YES;
291
- //webView.detectsPhoneNumbers = YES;
292
- webView.multipleTouchEnabled = YES;
293
- webView.autoresizesSubviews = YES;
294
- webView.delegate = self;
295
- [window addSubview:webView];
296
-
297
- return self;
298
- }
299
-
300
- - (void)viewDidAppear:(BOOL)animated
301
- {
302
- [super viewDidAppear:animated];
303
- }
304
-
305
- -(void)viewDidLoad {
306
- [super viewDidLoad];
307
-
308
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
309
- bool logEnabled = [defaults boolForKey:@"log_enabled_preference"];
310
-
311
- if (logEnabled && toolbar) {
312
- NSArray *items = toolbar.items;
313
-
314
- // create a bordered style button with custom title
315
- UIBarButtonItem *item = [[UIBarButtonItem alloc]
316
- initWithTitle:@"Log"
317
- style:UIBarButtonItemStyleBordered
318
- target:self
319
- action:@selector(actionShowLog:)];
320
- items = [items arrayByAddingObject:item];
321
-
322
- [toolbar setItems:items animated: YES];
323
- [item release];
324
- }
325
- }
326
-
327
- -(void)loadData:(NSData*)data mimeType:(NSString*)type {
328
- [webView loadData:data MIMEType:type textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:@""]];
329
- }
330
-
331
- -(void)showToolbar:(BOOL)show {
332
- toolbar.hidden = !show;
333
- CGRect frame = window.frame;
334
- if (show) {
335
- [window sendSubviewToBack:webView];
336
- [window bringSubviewToFront:toolbar];
337
- CGRect tbFrame = toolbar.frame;
338
- frame.size.height -= tbFrame.size.height;
339
- }
340
- else {
341
- [window sendSubviewToBack:toolbar];
342
- [window bringSubviewToFront:webView];
343
- }
344
- [webView sizeToFit];
345
- [webView setFrame:frame];
346
- }
347
-
348
- -(void)navigate:(NSString*)url {
349
- //RAWLOG_INFO1("Navigating to the specifyed URL: %s", [url cStringUsingEncoding:[NSString defaultCStringEncoding]]);
350
- NSString *escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
351
- [webView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:escapedUrl]]];
352
- }
353
-
354
- -(void)executeJs:(JSString*)js {
355
- RAWLOG_INFO1("Executing JS: %s", [js.inputJs UTF8String] );
356
- js.outputJs = [webView stringByEvaluatingJavaScriptFromString:js.inputJs];
357
- }
358
-
359
- -(void)navigateRedirect:(NSString*)url {
360
- //RAWLOG_INFO1("Navigate (redirect) to: %s", [url cStringUsingEncoding:[NSString defaultCStringEncoding]]);
361
- NSString* escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
362
- NSString* homeurl = [NSString stringWithCString:rho_rhodesapp_gethomeurl() encoding:[NSString defaultCStringEncoding]];
363
- NSString* redirector1 = [@"/system/redirect_to?url=" stringByAppendingString:escapedUrl];
364
- NSString* redirector = [homeurl stringByAppendingString:redirector1];
365
- [webView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:redirector]]];
366
- }
367
-
368
- -(void)goBack:(id)sender {
369
- const char* szBackUrl = rho_rhodesapp_getappbackurl();
370
- if ( szBackUrl && *szBackUrl )
371
- [self navigateRedirect:[NSString stringWithCString:szBackUrl encoding:[NSString defaultCStringEncoding]]];
372
- else
373
- [webView goBack];
374
- }
375
-
376
- -(void)goForward:(id)sender {
377
- [webView goForward];
378
- }
379
-
380
- -(void)goHome:(id)sender {
381
- const char* url = rho_rhodesapp_getstarturl();
382
- [self navigateRedirect:[NSString stringWithCString:url encoding:[NSString defaultCStringEncoding]]];
383
- //if (viewHomeUrl != NULL) {
384
- // [self navigateRedirect:viewHomeUrl];
385
- //}
386
- }
387
-
388
- -(void)goOptions:(id)sender {
389
- const char* url = rho_rhodesapp_getoptionsurl();
390
- [self navigateRedirect:[NSString stringWithCString:url encoding:[NSString defaultCStringEncoding]]];
391
-
392
- //if (viewOptionsUrl != NULL) {
393
- // [self navigateRedirect:viewOptionsUrl];
394
- //}
395
- }
396
-
397
- -(void)refresh {
398
- //[webView reload];
399
- const char *appUrl = rho_rhodesapp_getcurrenturl(webview_active_tab());
400
- [self navigate:[NSString stringWithUTF8String:appUrl]];
401
- }
402
-
403
- -(void)onRefresh:(id)sender {
404
- [self refresh];
405
- }
406
-
407
- -(void)setActivityInfo:(NSString *)labelText {
408
- if (!labelText) {
409
- activityInfo.hidden = YES;
410
- } else {
411
- activityInfo.hidden = NO;
412
- [activityInfo setText:labelText];
413
- }
414
- }
415
-
416
- -(void)active {
417
- [activity startAnimating];
418
- activity.hidden = NO;
419
- }
420
-
421
- -(void)inactive {
422
- [activity stopAnimating];
423
- activity.hidden = YES;
424
- }
425
-
426
- - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
427
- navigationType:(UIWebViewNavigationType)navigationType {
428
- return YES;
429
- }
430
-
431
- - (void)webViewDidStartLoad:(UIWebView *)webview
432
- {
433
- [self active];
434
- }
435
-
436
- - (void)webViewDidFinishLoad:(UIWebView *)webview
437
- {
438
- [self inactive];
439
-
440
- if ([webView canGoBack]) {
441
- backBtn.enabled = YES;
442
- } else {
443
- backBtn.enabled = NO;
444
- }
445
- if ([webView canGoForward]) {
446
- forwardBtn.enabled = YES;
447
- } else {
448
- forwardBtn.enabled = NO;
449
- }
450
-
451
- //NSString* location = [webview stringByEvaluatingJavaScriptFromString:@"location.href"];
452
- //rho_rhodesapp_keeplastvisitedurl( [location cStringUsingEncoding:[NSString defaultCStringEncoding]] );
453
-
454
- if ([actionTarget respondsToSelector:@selector(hideSplash)])
455
- [actionTarget performSelectorOnMainThread:@selector(hideSplash) withObject:nil waitUntilDone:NO];
456
- }
457
- /*
458
- - (void)runSync
459
- {
460
- rho_sync_doSyncAllSources(TRUE);
461
- }*/
462
-
463
- - (void)actionShowLog:(id)sender
464
- {
465
- if(actionTarget && [actionTarget respondsToSelector:onShowLog]) {
466
- [actionTarget performSelector:onShowLog];
467
- }
468
- }
469
-
470
- @end
471
-
472
-