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
@@ -3,20 +3,23 @@
3
3
  %{
4
4
  /* Put header files here or function declarations like below */
5
5
 
6
- #define latitude rho_geo_latitude
7
- extern double rho_geo_latitude();
6
+ #define latitude rho_geo_latitude
7
+ extern double rho_geo_latitude();
8
8
 
9
- #define longitude rho_geo_longitude
10
- extern double rho_geo_longitude();
9
+ #define longitude rho_geo_longitude
10
+ extern double rho_geo_longitude();
11
11
 
12
- #define known_position rho_geo_known_position
13
- extern int rho_geo_known_position();
12
+ #define known_position rho_geo_known_position
13
+ extern int rho_geo_known_position();
14
14
 
15
- #define set_view_notification rho_geo_set_view_notification
16
- extern void rho_geo_set_view_notification( const char *url, char* params, int timeout_sec);
15
+ #define set_view_notification rho_geo_set_view_notification
16
+ extern void rho_geo_set_view_notification( const char *url, char* params, int timeout_sec);
17
17
 
18
- #define set_notification rho_geo_set_notification
19
- extern void rho_geo_set_notification( const char *url, char* params, int timeout_sec);
18
+ #define set_notification rho_geo_set_notification
19
+ extern void rho_geo_set_notification( const char *url, char* params, int timeout_sec);
20
+
21
+ #define haversine_distance rho_geo_haversine_distance
22
+ extern double rho_geo_haversine_distance(double lat1, double lon1, double lat2, double lon2);
20
23
 
21
24
  %}
22
25
 
@@ -31,5 +34,6 @@
31
34
  extern double latitude();
32
35
  extern double longitude();
33
36
  extern int known_position();
34
- extern void set_view_notification( const char *url, char* params, int timeout_sec);
35
- extern void set_notification( const char *url, char* params, int timeout_sec);
37
+ extern void set_view_notification( const char *url, char* params, int timeout_sec);
38
+ extern void set_notification( const char *url, char* params, int timeout_sec);
39
+ extern double haversine_distance(double lat1, double lon1, double lat2, double lon2);
@@ -1,6 +1,6 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 1.3.31
3
+ * Version 1.3.40
4
4
  *
5
5
  * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -9,6 +9,7 @@
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
11
  #define SWIGRUBY
12
+
12
13
  /* -----------------------------------------------------------------------------
13
14
  * This section contains generic SWIG labels for method/variable
14
15
  * declarations/attributes, and other compiler dependent labels.
@@ -16,14 +17,14 @@
16
17
 
17
18
  /* template workaround for compilers that cannot correctly implement the C++ standard */
18
19
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
19
- # if defined(__SUNPRO_CC)
20
- # if (__SUNPRO_CC <= 0x560)
21
- # define SWIGTEMPLATEDISAMBIGUATOR template
22
- # else
23
- # define SWIGTEMPLATEDISAMBIGUATOR
24
- # endif
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # elif defined(__HP_aCC)
23
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25
+ # define SWIGTEMPLATEDISAMBIGUATOR template
25
26
  # else
26
- # define SWIGTEMPLATEDISAMBIGUATOR
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
27
28
  # endif
28
29
  #endif
29
30
 
@@ -51,6 +52,12 @@
51
52
  # endif
52
53
  #endif
53
54
 
55
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
56
+ # if defined(_MSC_VER)
57
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
+ # endif
59
+ #endif
60
+
54
61
  #ifndef SWIGUNUSEDPARM
55
62
  # ifdef __cplusplus
56
63
  # define SWIGUNUSEDPARM(p)
@@ -106,6 +113,12 @@
106
113
  # define _CRT_SECURE_NO_DEPRECATE
107
114
  #endif
108
115
 
116
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118
+ # define _SCL_SECURE_NO_DEPRECATE
119
+ #endif
120
+
121
+
109
122
  /* -----------------------------------------------------------------------------
110
123
  * This section contains generic SWIG labels for method/variable
111
124
  * declarations/attributes, and other compiler dependent labels.
@@ -113,14 +126,14 @@
113
126
 
114
127
  /* template workaround for compilers that cannot correctly implement the C++ standard */
115
128
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
116
- # if defined(__SUNPRO_CC)
117
- # if (__SUNPRO_CC <= 0x560)
118
- # define SWIGTEMPLATEDISAMBIGUATOR template
119
- # else
120
- # define SWIGTEMPLATEDISAMBIGUATOR
121
- # endif
129
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
130
+ # define SWIGTEMPLATEDISAMBIGUATOR template
131
+ # elif defined(__HP_aCC)
132
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
133
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
134
+ # define SWIGTEMPLATEDISAMBIGUATOR template
122
135
  # else
123
- # define SWIGTEMPLATEDISAMBIGUATOR
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
124
137
  # endif
125
138
  #endif
126
139
 
@@ -148,6 +161,12 @@
148
161
  # endif
149
162
  #endif
150
163
 
164
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
165
+ # if defined(_MSC_VER)
166
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
+ # endif
168
+ #endif
169
+
151
170
  #ifndef SWIGUNUSEDPARM
152
171
  # ifdef __cplusplus
153
172
  # define SWIGUNUSEDPARM(p)
@@ -203,16 +222,22 @@
203
222
  # define _CRT_SECURE_NO_DEPRECATE
204
223
  #endif
205
224
 
225
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
226
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
227
+ # define _SCL_SECURE_NO_DEPRECATE
228
+ #endif
229
+
230
+
206
231
  /* -----------------------------------------------------------------------------
207
232
  * swigrun.swg
208
233
  *
209
- * This file contains generic CAPI SWIG runtime support for pointer
234
+ * This file contains generic C API SWIG runtime support for pointer
210
235
  * type checking.
211
236
  * ----------------------------------------------------------------------------- */
212
237
 
213
238
  /* This should only be incremented when either the layout of swig_type_info changes,
214
239
  or for whatever reason, the runtime changes incompatibly */
215
- #define SWIG_RUNTIME_VERSION "3"
240
+ #define SWIG_RUNTIME_VERSION "4"
216
241
 
217
242
  /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
218
243
  #ifdef SWIG_TYPE_TABLE
@@ -225,11 +250,11 @@
225
250
 
226
251
  /*
227
252
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
228
- creating a static or dynamic library from the swig runtime code.
229
- In 99.9% of the cases, swig just needs to declare them as 'static'.
253
+ creating a static or dynamic library from the SWIG runtime code.
254
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
230
255
 
231
- But only do this if is strictly necessary, ie, if you have problems
232
- with your compiler or so.
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
233
258
  */
234
259
 
235
260
  #ifndef SWIGRUNTIME
@@ -247,6 +272,7 @@
247
272
 
248
273
  /* Flags for pointer conversions */
249
274
  #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
250
276
 
251
277
  /* Flags for new pointer objects */
252
278
  #define SWIG_POINTER_OWN 0x1
@@ -255,14 +281,14 @@
255
281
  /*
256
282
  Flags/methods for returning states.
257
283
 
258
- The swig conversion methods, as ConvertPtr, return and integer
284
+ The SWIG conversion methods, as ConvertPtr, return and integer
259
285
  that tells if the conversion was successful or not. And if not,
260
286
  an error code can be returned (see swigerrors.swg for the codes).
261
287
 
262
288
  Use the following macros/flags to set or process the returning
263
289
  states.
264
290
 
265
- In old swig versions, you usually write code as:
291
+ In old versions of SWIG, code such as the following was usually written:
266
292
 
267
293
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
268
294
  // success code
@@ -270,7 +296,7 @@
270
296
  //fail code
271
297
  }
272
298
 
273
- Now you can be more explicit as:
299
+ Now you can be more explicit:
274
300
 
275
301
  int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
276
302
  if (SWIG_IsOK(res)) {
@@ -279,7 +305,7 @@
279
305
  // fail code
280
306
  }
281
307
 
282
- that seems to be the same, but now you can also do
308
+ which is the same really, but now you can also do
283
309
 
284
310
  Type *ptr;
285
311
  int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -297,7 +323,7 @@
297
323
 
298
324
  I.e., now SWIG_ConvertPtr can return new objects and you can
299
325
  identify the case and take care of the deallocation. Of course that
300
- requires also to SWIG_ConvertPtr to return new result values, as
326
+ also requires SWIG_ConvertPtr to return new result values, such as
301
327
 
302
328
  int SWIG_ConvertPtr(obj, ptr,...) {
303
329
  if (<obj is ok>) {
@@ -315,7 +341,7 @@
315
341
 
316
342
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
317
343
  more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
318
- swig errors code.
344
+ SWIG errors code.
319
345
 
320
346
  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
321
347
  allows to return the 'cast rank', for example, if you have this
@@ -329,9 +355,8 @@
329
355
  fooi(1) // cast rank '0'
330
356
 
331
357
  just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
332
359
 
333
-
334
- */
335
360
  #define SWIG_OK (0)
336
361
  #define SWIG_ERROR (-1)
337
362
  #define SWIG_IsOK(r) (r >= 0)
@@ -356,7 +381,6 @@
356
381
  #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
357
382
  #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
358
383
 
359
-
360
384
  /* Cast-Rank Mode */
361
385
  #if defined(SWIG_CASTRANK_MODE)
362
386
  # ifndef SWIG_TypeRank
@@ -379,18 +403,16 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
379
403
  #endif
380
404
 
381
405
 
382
-
383
-
384
406
  #include <string.h>
385
407
 
386
408
  #ifdef __cplusplus
387
409
  extern "C" {
388
410
  #endif
389
411
 
390
- typedef void *(*swig_converter_func)(void *);
412
+ typedef void *(*swig_converter_func)(void *, int *);
391
413
  typedef struct swig_type_info *(*swig_dycast_func)(void **);
392
414
 
393
- /* Structure to store inforomation on one type */
415
+ /* Structure to store information on one type */
394
416
  typedef struct swig_type_info {
395
417
  const char *name; /* mangled name of this type */
396
418
  const char *str; /* human readable name of this type */
@@ -435,7 +457,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
435
457
  while ((*f2 == ' ') && (f2 != l2)) ++f2;
436
458
  if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
437
459
  }
438
- return (l1 - f1) - (l2 - f2);
460
+ return (int)((l1 - f1) - (l2 - f2));
439
461
  }
440
462
 
441
463
  /*
@@ -477,48 +499,66 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
477
499
  }
478
500
 
479
501
 
480
- /* think of this as a c++ template<> or a scheme macro */
481
- #define SWIG_TypeCheck_Template(comparison, ty) \
482
- if (ty) { \
483
- swig_cast_info *iter = ty->cast; \
484
- while (iter) { \
485
- if (comparison) { \
486
- if (iter == ty->cast) return iter; \
487
- /* Move iter to the top of the linked list */ \
488
- iter->prev->next = iter->next; \
489
- if (iter->next) \
490
- iter->next->prev = iter->prev; \
491
- iter->next = ty->cast; \
492
- iter->prev = 0; \
493
- if (ty->cast) ty->cast->prev = iter; \
494
- ty->cast = iter; \
495
- return iter; \
496
- } \
497
- iter = iter->next; \
498
- } \
499
- } \
500
- return 0
501
-
502
502
  /*
503
503
  Check the typename
504
504
  */
505
505
  SWIGRUNTIME swig_cast_info *
506
506
  SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
- SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
507
+ if (ty) {
508
+ swig_cast_info *iter = ty->cast;
509
+ while (iter) {
510
+ if (strcmp(iter->type->name, c) == 0) {
511
+ if (iter == ty->cast)
512
+ return iter;
513
+ /* Move iter to the top of the linked list */
514
+ iter->prev->next = iter->next;
515
+ if (iter->next)
516
+ iter->next->prev = iter->prev;
517
+ iter->next = ty->cast;
518
+ iter->prev = 0;
519
+ if (ty->cast) ty->cast->prev = iter;
520
+ ty->cast = iter;
521
+ return iter;
522
+ }
523
+ iter = iter->next;
524
+ }
525
+ }
526
+ return 0;
508
527
  }
509
528
 
510
- /* Same as previous function, except strcmp is replaced with a pointer comparison */
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
511
532
  SWIGRUNTIME swig_cast_info *
512
- SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
513
- SWIG_TypeCheck_Template(iter->type == from, into);
533
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (iter->type == from) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
514
554
  }
515
555
 
516
556
  /*
517
557
  Cast a pointer up an inheritance hierarchy
518
558
  */
519
559
  SWIGRUNTIMEINLINE void *
520
- SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
521
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
522
562
  }
523
563
 
524
564
  /*
@@ -791,6 +831,24 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
791
831
 
792
832
  #include <ruby.h>
793
833
 
834
+ /* Remove global macros defined in Ruby's win32.h */
835
+ #ifdef write
836
+ # undef write
837
+ #endif
838
+ #ifdef read
839
+ # undef read
840
+ #endif
841
+ #ifdef bind
842
+ # undef bind
843
+ #endif
844
+ #ifdef close
845
+ # undef close
846
+ #endif
847
+ #ifdef connect
848
+ # undef connect
849
+ #endif
850
+
851
+
794
852
  /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
795
853
  #ifndef NUM2LL
796
854
  #define NUM2LL(x) NUM2LONG((x))
@@ -819,12 +877,44 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
819
877
  #ifndef RSTRING_PTR
820
878
  # define RSTRING_PTR(x) RSTRING(x)->ptr
821
879
  #endif
880
+ #ifndef RSTRING_END
881
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
882
+ #endif
822
883
  #ifndef RARRAY_LEN
823
884
  # define RARRAY_LEN(x) RARRAY(x)->len
824
885
  #endif
825
886
  #ifndef RARRAY_PTR
826
887
  # define RARRAY_PTR(x) RARRAY(x)->ptr
827
888
  #endif
889
+ #ifndef RFLOAT_VALUE
890
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
891
+ #endif
892
+ #ifndef DOUBLE2NUM
893
+ # define DOUBLE2NUM(x) rb_float_new(x)
894
+ #endif
895
+ #ifndef RHASH_TBL
896
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
897
+ #endif
898
+ #ifndef RHASH_ITER_LEV
899
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
900
+ #endif
901
+ #ifndef RHASH_IFNONE
902
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
903
+ #endif
904
+ #ifndef RHASH_SIZE
905
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
906
+ #endif
907
+ #ifndef RHASH_EMPTY_P
908
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
909
+ #endif
910
+ #ifndef RSTRUCT_LEN
911
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
912
+ #endif
913
+ #ifndef RSTRUCT_PTR
914
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
915
+ #endif
916
+
917
+
828
918
 
829
919
  /*
830
920
  * Need to be very careful about how these macros are defined, especially
@@ -886,6 +976,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
886
976
  #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
887
977
  #endif
888
978
 
979
+ static VALUE _mSWIG = Qnil;
889
980
 
890
981
  /* -----------------------------------------------------------------------------
891
982
  * error manipulation
@@ -976,7 +1067,71 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
976
1067
  }
977
1068
 
978
1069
 
1070
+ /* This function is called when a user inputs a wrong argument to
1071
+ a method.
1072
+ */
1073
+ SWIGINTERN
1074
+ const char* Ruby_Format_TypeError( const char* msg,
1075
+ const char* type,
1076
+ const char* name,
1077
+ const int argn,
1078
+ VALUE input )
1079
+ {
1080
+ char buf[128];
1081
+ VALUE str;
1082
+ VALUE asStr;
1083
+ if ( msg && *msg )
1084
+ {
1085
+ str = rb_str_new2(msg);
1086
+ }
1087
+ else
1088
+ {
1089
+ str = rb_str_new(NULL, 0);
1090
+ }
1091
+
1092
+ str = rb_str_cat2( str, "Expected argument " );
1093
+ sprintf( buf, "%d of type ", argn-1 );
1094
+ str = rb_str_cat2( str, buf );
1095
+ str = rb_str_cat2( str, type );
1096
+ str = rb_str_cat2( str, ", but got " );
1097
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1098
+ str = rb_str_cat2( str, " " );
1099
+ asStr = rb_inspect(input);
1100
+ if ( RSTRING_LEN(asStr) > 30 )
1101
+ {
1102
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1103
+ str = rb_str_cat2( str, "..." );
1104
+ }
1105
+ else
1106
+ {
1107
+ str = rb_str_append( str, asStr );
1108
+ }
1109
+
1110
+ if ( name )
1111
+ {
1112
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1113
+ str = rb_str_cat2( str, name );
1114
+ str = rb_str_cat2( str, "'" );
1115
+ }
979
1116
 
1117
+ return StringValuePtr( str );
1118
+ }
1119
+
1120
+ /* This function is called when an overloaded method fails */
1121
+ SWIGINTERN
1122
+ void Ruby_Format_OverloadedError(
1123
+ const int argc,
1124
+ const int maxargs,
1125
+ const char* method,
1126
+ const char* prototypes
1127
+ )
1128
+ {
1129
+ const char* msg = "Wrong # of arguments";
1130
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1131
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1132
+ "Possible C/C++ prototypes are:\n%s",
1133
+ msg, method, prototypes);
1134
+ }
980
1135
 
981
1136
  /* -----------------------------------------------------------------------------
982
1137
  * See the LICENSE file for information on copyright, usage and redistribution
@@ -994,23 +1149,51 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
994
1149
  extern "C" {
995
1150
  #endif
996
1151
 
1152
+ /* Ruby 1.8 actually assumes the first case. */
1153
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1154
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1155
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1156
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1157
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1158
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1159
+ #else
1160
+ # error sizeof(void*) is not the same as long or long long
1161
+ #endif
1162
+
997
1163
 
998
1164
  /* Global Ruby hash table to store Trackings from C/C++
999
- structs to Ruby Objects. */
1000
- static VALUE swig_ruby_trackings;
1165
+ structs to Ruby Objects.
1166
+ */
1167
+ static VALUE swig_ruby_trackings = Qnil;
1001
1168
 
1002
1169
  /* Global variable that stores a reference to the ruby
1003
1170
  hash table delete function. */
1004
- static ID swig_ruby_hash_delete = 0;
1171
+ static ID swig_ruby_hash_delete;
1005
1172
 
1006
1173
  /* Setup a Ruby hash table to store Trackings */
1007
1174
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1008
1175
  /* Create a ruby hash table to store Trackings from C++
1009
- objects to Ruby objects. Also make sure to tell
1010
- the garabage collector about the hash table. */
1011
- swig_ruby_trackings = rb_hash_new();
1012
- rb_gc_register_address(&swig_ruby_trackings);
1013
-
1176
+ objects to Ruby objects. */
1177
+
1178
+ /* Try to see if some other .so has already created a
1179
+ tracking hash table, which we keep hidden in an instance var
1180
+ in the SWIG module.
1181
+ This is done to allow multiple DSOs to share the same
1182
+ tracking table.
1183
+ */
1184
+ ID trackings_id = rb_intern( "@__trackings__" );
1185
+ VALUE verbose = rb_gv_get("VERBOSE");
1186
+ rb_gv_set("VERBOSE", Qfalse);
1187
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1188
+ rb_gv_set("VERBOSE", verbose);
1189
+
1190
+ /* No, it hasn't. Create one ourselves */
1191
+ if ( swig_ruby_trackings == Qnil )
1192
+ {
1193
+ swig_ruby_trackings = rb_hash_new();
1194
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1195
+ }
1196
+
1014
1197
  /* Now store a reference to the hash table delete function
1015
1198
  so that we only have to look it up once.*/
1016
1199
  swig_ruby_hash_delete = rb_intern("delete");
@@ -1023,8 +1206,7 @@ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1023
1206
  a Ruby number object. */
1024
1207
 
1025
1208
  /* Convert the pointer to a Ruby number */
1026
- unsigned long value = (unsigned long) ptr;
1027
- return LONG2NUM(value);
1209
+ return SWIG2NUM(ptr);
1028
1210
  }
1029
1211
 
1030
1212
  /* Get a Ruby number to reference an object */
@@ -1034,8 +1216,7 @@ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1034
1216
  a Ruby number object. */
1035
1217
 
1036
1218
  /* Convert the Object to a Ruby number */
1037
- unsigned long value = (unsigned long) object;
1038
- return LONG2NUM(value);
1219
+ return SWIG2NUM(object);
1039
1220
  }
1040
1221
 
1041
1222
  /* Get a Ruby object from a previously stored reference */
@@ -1043,9 +1224,8 @@ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1043
1224
  /* The provided Ruby number object is a reference
1044
1225
  to the Ruby object we want.*/
1045
1226
 
1046
- /* First convert the Ruby number to a C number */
1047
- unsigned long value = NUM2LONG(reference);
1048
- return (VALUE) value;
1227
+ /* Convert the Ruby number to a Ruby object */
1228
+ return NUM2SWIG(reference);
1049
1229
  }
1050
1230
 
1051
1231
  /* Add a Tracking from a C/C++ struct to a Ruby object */
@@ -1137,6 +1317,15 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1137
1317
  return target;
1138
1318
  }
1139
1319
 
1320
+ /* For ruby1.8.4 and earlier. */
1321
+ #ifndef RUBY_INIT_STACK
1322
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1323
+ # define RUBY_INIT_STACK \
1324
+ VALUE variable_in_this_stack_frame; \
1325
+ Init_stack(&variable_in_this_stack_frame);
1326
+ #endif
1327
+
1328
+
1140
1329
  #ifdef __cplusplus
1141
1330
  }
1142
1331
  #endif
@@ -1201,6 +1390,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1201
1390
  #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1202
1391
  #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1203
1392
 
1393
+ #include "assert.h"
1204
1394
 
1205
1395
  /* -----------------------------------------------------------------------------
1206
1396
  * pointers/data manipulation
@@ -1208,9 +1398,6 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1208
1398
 
1209
1399
  #ifdef __cplusplus
1210
1400
  extern "C" {
1211
- #if 0
1212
- } /* cc-mode */
1213
- #endif
1214
1401
  #endif
1215
1402
 
1216
1403
  typedef struct {
@@ -1222,10 +1409,44 @@ typedef struct {
1222
1409
  } swig_class;
1223
1410
 
1224
1411
 
1225
- static VALUE _mSWIG = Qnil;
1412
+ /* Global pointer used to keep some internal SWIG stuff */
1226
1413
  static VALUE _cSWIG_Pointer = Qnil;
1227
1414
  static VALUE swig_runtime_data_type_pointer = Qnil;
1228
1415
 
1416
+ /* Global IDs used to keep some internal SWIG stuff */
1417
+ static ID swig_arity_id = 0;
1418
+ static ID swig_call_id = 0;
1419
+
1420
+ /*
1421
+ If your swig extension is to be run within an embedded ruby and has
1422
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1423
+ This will reset ruby's stack frame on each entry point from the main
1424
+ program the first time a virtual director function is invoked (in a
1425
+ non-recursive way).
1426
+ If this is not done, you run the risk of Ruby trashing the stack.
1427
+ */
1428
+
1429
+ #ifdef RUBY_EMBEDDED
1430
+
1431
+ # define SWIG_INIT_STACK \
1432
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1433
+ ++swig_virtual_calls;
1434
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1435
+ # define Ruby_DirectorTypeMismatchException(x) \
1436
+ rb_raise( rb_eTypeError, x ); return c_result;
1437
+
1438
+ static unsigned int swig_virtual_calls = 0;
1439
+
1440
+ #else /* normal non-embedded extension */
1441
+
1442
+ # define SWIG_INIT_STACK
1443
+ # define SWIG_RELEASE_STACK
1444
+ # define Ruby_DirectorTypeMismatchException(x) \
1445
+ throw Swig::DirectorTypeMismatchException( x );
1446
+
1447
+ #endif /* RUBY_EMBEDDED */
1448
+
1449
+
1229
1450
  SWIGRUNTIME VALUE
1230
1451
  getExceptionClass(void) {
1231
1452
  static int init = 0;
@@ -1257,6 +1478,8 @@ SWIG_Ruby_InitRuntime(void)
1257
1478
  {
1258
1479
  if (_mSWIG == Qnil) {
1259
1480
  _mSWIG = rb_define_module("SWIG");
1481
+ swig_call_id = rb_intern("call");
1482
+ swig_arity_id = rb_intern("arity");
1260
1483
  }
1261
1484
  }
1262
1485
 
@@ -1280,7 +1503,7 @@ SWIGRUNTIME VALUE
1280
1503
  SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1281
1504
  {
1282
1505
  int own = flags & SWIG_POINTER_OWN;
1283
-
1506
+ int track;
1284
1507
  char *klass_name;
1285
1508
  swig_class *sklass;
1286
1509
  VALUE klass;
@@ -1293,14 +1516,15 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1293
1516
  sklass = (swig_class *) type->clientdata;
1294
1517
 
1295
1518
  /* Are we tracking this class and have we already returned this Ruby object? */
1296
- if (sklass->trackObjects) {
1519
+ track = sklass->trackObjects;
1520
+ if (track) {
1297
1521
  obj = SWIG_RubyInstanceFor(ptr);
1298
1522
 
1299
1523
  /* Check the object's type and make sure it has the correct type.
1300
1524
  It might not in cases where methods do things like
1301
1525
  downcast methods. */
1302
1526
  if (obj != Qnil) {
1303
- VALUE value = rb_iv_get(obj, "__swigtype__");
1527
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1304
1528
  char* type_name = RSTRING_PTR(value);
1305
1529
 
1306
1530
  if (strcmp(type->name, type_name) == 0) {
@@ -1310,10 +1534,13 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1310
1534
  }
1311
1535
 
1312
1536
  /* Create a new Ruby object */
1313
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1537
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1538
+ ( own ? VOIDFUNC(sklass->destroy) :
1539
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1540
+ ), ptr);
1314
1541
 
1315
1542
  /* If tracking is on for this class then track this object. */
1316
- if (sklass->trackObjects) {
1543
+ if (track) {
1317
1544
  SWIG_RubyAddTracking(ptr, obj);
1318
1545
  }
1319
1546
  } else {
@@ -1323,7 +1550,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1323
1550
  free((void *) klass_name);
1324
1551
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1325
1552
  }
1326
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1553
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1327
1554
 
1328
1555
  return obj;
1329
1556
  }
@@ -1335,7 +1562,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1335
1562
  VALUE obj;
1336
1563
  swig_class *sklass = (swig_class *) type->clientdata;
1337
1564
  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1338
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1565
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1339
1566
  return obj;
1340
1567
  }
1341
1568
 
@@ -1343,7 +1570,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1343
1570
  SWIGRUNTIMEINLINE char *
1344
1571
  SWIG_Ruby_MangleStr(VALUE obj)
1345
1572
  {
1346
- VALUE stype = rb_iv_get(obj, "__swigtype__");
1573
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1347
1574
  return StringValuePtr(stype);
1348
1575
  }
1349
1576
 
@@ -1425,8 +1652,11 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1425
1652
  tc = SWIG_TypeCheck(c, ty);
1426
1653
  if (!tc) {
1427
1654
  return SWIG_ERROR;
1655
+ } else {
1656
+ int newmemory = 0;
1657
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1658
+ assert(!newmemory); /* newmemory handling not yet implemented */
1428
1659
  }
1429
- *ptr = SWIG_TypeCast(tc, vptr);
1430
1660
  } else {
1431
1661
  *ptr = vptr;
1432
1662
  }
@@ -1507,10 +1737,42 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1507
1737
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1508
1738
  }
1509
1739
 
1740
+ /* This function can be used to check whether a proc or method or similarly
1741
+ callable function has been passed. Usually used in a %typecheck, like:
1742
+
1743
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1744
+ $result = SWIG_Ruby_isCallable( $input );
1745
+ }
1746
+ */
1747
+ SWIGINTERN
1748
+ int SWIG_Ruby_isCallable( VALUE proc )
1749
+ {
1750
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1751
+ return 1;
1752
+ return 0;
1753
+ }
1754
+
1755
+ /* This function can be used to check the arity (number of arguments)
1756
+ a proc or method can take. Usually used in a %typecheck.
1757
+ Valid arities will be that equal to minimal or those < 0
1758
+ which indicate a variable number of parameters at the end.
1759
+ */
1760
+ SWIGINTERN
1761
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1762
+ {
1763
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1764
+ {
1765
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1766
+ int arity = NUM2INT(num);
1767
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1768
+ if ( arity == minimal ) return 1;
1769
+ return 1;
1770
+ }
1771
+ return 0;
1772
+ }
1773
+
1774
+
1510
1775
  #ifdef __cplusplus
1511
- #if 0
1512
- { /* cc-mode */
1513
- #endif
1514
1776
  }
1515
1777
  #endif
1516
1778
 
@@ -1537,7 +1799,11 @@ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1537
1799
 
1538
1800
  static VALUE mGeoLocation;
1539
1801
 
1540
- #define SWIGVERSION 0x010331
1802
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1803
+ #define SWIG_RUBY_THREAD_END_BLOCK
1804
+
1805
+
1806
+ #define SWIGVERSION 0x010340
1541
1807
  #define SWIG_VERSION SWIGVERSION
1542
1808
 
1543
1809
 
@@ -1547,20 +1813,23 @@ static VALUE mGeoLocation;
1547
1813
 
1548
1814
  /* Put header files here or function declarations like below */
1549
1815
 
1550
- #define latitude rho_geo_latitude
1551
- extern double rho_geo_latitude();
1816
+ #define latitude rho_geo_latitude
1817
+ extern double rho_geo_latitude();
1552
1818
 
1553
- #define longitude rho_geo_longitude
1554
- extern double rho_geo_longitude();
1819
+ #define longitude rho_geo_longitude
1820
+ extern double rho_geo_longitude();
1555
1821
 
1556
- #define known_position rho_geo_known_position
1557
- extern int rho_geo_known_position();
1822
+ #define known_position rho_geo_known_position
1823
+ extern int rho_geo_known_position();
1558
1824
 
1559
- #define set_view_notification rho_geo_set_view_notification
1560
- extern void rho_geo_set_view_notification( const char *url, char* params, int timeout_sec);
1825
+ #define set_view_notification rho_geo_set_view_notification
1826
+ extern void rho_geo_set_view_notification( const char *url, char* params, int timeout_sec);
1561
1827
 
1562
- #define set_notification rho_geo_set_notification
1563
- extern void rho_geo_set_notification( const char *url, char* params, int timeout_sec);
1828
+ #define set_notification rho_geo_set_notification
1829
+ extern void rho_geo_set_notification( const char *url, char* params, int timeout_sec);
1830
+
1831
+ #define haversine_distance rho_geo_haversine_distance
1832
+ extern double rho_geo_haversine_distance(double lat1, double lon1, double lat2, double lon2);
1564
1833
 
1565
1834
 
1566
1835
 
@@ -1584,11 +1853,11 @@ SWIGINTERN int
1584
1853
  SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1585
1854
  {
1586
1855
  if (TYPE(obj) == T_STRING) {
1587
-
1588
-
1589
-
1856
+ #if defined(StringValuePtr)
1857
+ char *cstr = StringValuePtr(obj);
1858
+ #else
1590
1859
  char *cstr = STR2CSTR(obj);
1591
-
1860
+ #endif
1592
1861
  size_t size = RSTRING_LEN(obj) + 1;
1593
1862
  if (cptr) {
1594
1863
  if (alloc) {
@@ -1622,14 +1891,12 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1622
1891
 
1623
1892
 
1624
1893
  #include <limits.h>
1625
- #ifndef LLONG_MIN
1626
- # define LLONG_MIN LONG_LONG_MIN
1627
- #endif
1628
- #ifndef LLONG_MAX
1629
- # define LLONG_MAX LONG_LONG_MAX
1630
- #endif
1631
- #ifndef ULLONG_MAX
1632
- # define ULLONG_MAX ULONG_LONG_MAX
1894
+ #if !defined(SWIG_NO_LLONG_MAX)
1895
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1896
+ # define LLONG_MAX __LONG_LONG_MAX__
1897
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1898
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1899
+ # endif
1633
1900
  #endif
1634
1901
 
1635
1902
 
@@ -1640,7 +1907,7 @@ SWIG_ruby_failed(void)
1640
1907
  }
1641
1908
 
1642
1909
 
1643
- /*@SWIG:%ruby_aux_method@*/
1910
+ /*@SWIG:C:\\work\\swig\\Lib\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
1644
1911
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1645
1912
  {
1646
1913
  VALUE obj = args[0];
@@ -1684,6 +1951,35 @@ SWIG_AsVal_int (VALUE obj, int *val)
1684
1951
  return res;
1685
1952
  }
1686
1953
 
1954
+
1955
+ /*@SWIG:C:\\work\\swig\\Lib\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
1956
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
1957
+ {
1958
+ VALUE obj = args[0];
1959
+ VALUE type = TYPE(obj);
1960
+ double *res = (double *)(args[1]);
1961
+ *res = NUM2DBL(obj);
1962
+ return obj;
1963
+ }
1964
+ /*@SWIG@*/
1965
+
1966
+ SWIGINTERN int
1967
+ SWIG_AsVal_double (VALUE obj, double *val)
1968
+ {
1969
+ VALUE type = TYPE(obj);
1970
+ if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
1971
+ double v;
1972
+ VALUE a[2];
1973
+ a[0] = obj;
1974
+ a[1] = (VALUE)(&v);
1975
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1976
+ if (val) *val = v;
1977
+ return SWIG_OK;
1978
+ }
1979
+ }
1980
+ return SWIG_TypeError;
1981
+ }
1982
+
1687
1983
  SWIGINTERN VALUE
1688
1984
  _wrap_latitude(int argc, VALUE *argv, VALUE self) {
1689
1985
  double result;
@@ -1757,20 +2053,20 @@ _wrap_set_view_notification(int argc, VALUE *argv, VALUE self) {
1757
2053
  }
1758
2054
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1759
2055
  if (!SWIG_IsOK(res1)) {
1760
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_view_notification" "', argument " "1"" of type '" "char const *""'");
2056
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","set_view_notification", 1, argv[0] ));
1761
2057
  }
1762
2058
  arg1 = (char *)(buf1);
1763
2059
  if (argc > 1) {
1764
2060
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1765
2061
  if (!SWIG_IsOK(res2)) {
1766
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "set_view_notification" "', argument " "2"" of type '" "char *""'");
2062
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","set_view_notification", 2, argv[1] ));
1767
2063
  }
1768
2064
  arg2 = (char *)(buf2);
1769
2065
  }
1770
2066
  if (argc > 2) {
1771
2067
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
1772
2068
  if (!SWIG_IsOK(ecode3)) {
1773
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "set_view_notification" "', argument " "3"" of type '" "int""'");
2069
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_view_notification", 3, argv[2] ));
1774
2070
  }
1775
2071
  arg3 = (int)(val3);
1776
2072
  }
@@ -1810,20 +2106,20 @@ _wrap_set_notification(int argc, VALUE *argv, VALUE self) {
1810
2106
  }
1811
2107
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1812
2108
  if (!SWIG_IsOK(res1)) {
1813
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_notification" "', argument " "1"" of type '" "char const *""'");
2109
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","set_notification", 1, argv[0] ));
1814
2110
  }
1815
2111
  arg1 = (char *)(buf1);
1816
2112
  if (argc > 1) {
1817
2113
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1818
2114
  if (!SWIG_IsOK(res2)) {
1819
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "set_notification" "', argument " "2"" of type '" "char *""'");
2115
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","set_notification", 2, argv[1] ));
1820
2116
  }
1821
2117
  arg2 = (char *)(buf2);
1822
2118
  }
1823
2119
  if (argc > 2) {
1824
2120
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
1825
2121
  if (!SWIG_IsOK(ecode3)) {
1826
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "set_notification" "', argument " "3"" of type '" "int""'");
2122
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_notification", 3, argv[2] ));
1827
2123
  }
1828
2124
  arg3 = (int)(val3);
1829
2125
  }
@@ -1838,6 +2134,54 @@ fail:
1838
2134
  }
1839
2135
 
1840
2136
 
2137
+ SWIGINTERN VALUE
2138
+ _wrap_haversine_distance(int argc, VALUE *argv, VALUE self) {
2139
+ double arg1 ;
2140
+ double arg2 ;
2141
+ double arg3 ;
2142
+ double arg4 ;
2143
+ double val1 ;
2144
+ int ecode1 = 0 ;
2145
+ double val2 ;
2146
+ int ecode2 = 0 ;
2147
+ double val3 ;
2148
+ int ecode3 = 0 ;
2149
+ double val4 ;
2150
+ int ecode4 = 0 ;
2151
+ double result;
2152
+ VALUE vresult = Qnil;
2153
+
2154
+ if ((argc < 4) || (argc > 4)) {
2155
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
2156
+ }
2157
+ ecode1 = SWIG_AsVal_double(argv[0], &val1);
2158
+ if (!SWIG_IsOK(ecode1)) {
2159
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","haversine_distance", 1, argv[0] ));
2160
+ }
2161
+ arg1 = (double)(val1);
2162
+ ecode2 = SWIG_AsVal_double(argv[1], &val2);
2163
+ if (!SWIG_IsOK(ecode2)) {
2164
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","haversine_distance", 2, argv[1] ));
2165
+ }
2166
+ arg2 = (double)(val2);
2167
+ ecode3 = SWIG_AsVal_double(argv[2], &val3);
2168
+ if (!SWIG_IsOK(ecode3)) {
2169
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","haversine_distance", 3, argv[2] ));
2170
+ }
2171
+ arg3 = (double)(val3);
2172
+ ecode4 = SWIG_AsVal_double(argv[3], &val4);
2173
+ if (!SWIG_IsOK(ecode4)) {
2174
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","haversine_distance", 4, argv[3] ));
2175
+ }
2176
+ arg4 = (double)(val4);
2177
+ result = (double)haversine_distance(arg1,arg2,arg3,arg4);
2178
+ vresult = SWIG_From_double((double)(result));
2179
+ return vresult;
2180
+ fail:
2181
+ return Qnil;
2182
+ }
2183
+
2184
+
1841
2185
 
1842
2186
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1843
2187
 
@@ -1913,7 +2257,7 @@ SWIGRUNTIME void
1913
2257
  SWIG_InitializeModule(void *clientdata) {
1914
2258
  size_t i;
1915
2259
  swig_module_info *module_head, *iter;
1916
- int found;
2260
+ int found, init;
1917
2261
 
1918
2262
  clientdata = clientdata;
1919
2263
 
@@ -1923,6 +2267,9 @@ SWIG_InitializeModule(void *clientdata) {
1923
2267
  swig_module.type_initial = swig_type_initial;
1924
2268
  swig_module.cast_initial = swig_cast_initial;
1925
2269
  swig_module.next = &swig_module;
2270
+ init = 1;
2271
+ } else {
2272
+ init = 0;
1926
2273
  }
1927
2274
 
1928
2275
  /* Try and load any already created modules */
@@ -1951,6 +2298,12 @@ SWIG_InitializeModule(void *clientdata) {
1951
2298
  module_head->next = &swig_module;
1952
2299
  }
1953
2300
 
2301
+ /* When multiple interpeters are used, a module could have already been initialized in
2302
+ a different interpreter, but not yet have a pointer in this interpreter.
2303
+ In this case, we do not want to continue adding types... everything should be
2304
+ set up already */
2305
+ if (init == 0) return;
2306
+
1954
2307
  /* Now work on filling in swig_module.types */
1955
2308
  #ifdef SWIGRUNTIME_DEBUG
1956
2309
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
@@ -2084,7 +2437,9 @@ SWIG_PropagateClientData(void) {
2084
2437
  }
2085
2438
  #endif
2086
2439
 
2440
+ /*
2087
2441
 
2442
+ */
2088
2443
  #ifdef __cplusplus
2089
2444
  extern "C"
2090
2445
  #endif
@@ -2105,5 +2460,6 @@ SWIGEXPORT void Init_GeoLocation(void) {
2105
2460
  rb_define_module_function(mGeoLocation, "known_position?", _wrap_known_positionq___, -1);
2106
2461
  rb_define_module_function(mGeoLocation, "set_view_notification", _wrap_set_view_notification, -1);
2107
2462
  rb_define_module_function(mGeoLocation, "set_notification", _wrap_set_notification, -1);
2463
+ rb_define_module_function(mGeoLocation, "haversine_distance", _wrap_haversine_distance, -1);
2108
2464
  }
2109
2465