rhodes 2.2.6 → 2.3.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (486) hide show
  1. data/CHANGELOG +20 -0
  2. data/README.md +46 -0
  3. data/Rakefile +85 -80
  4. data/bin/rhodes +2 -2
  5. data/bin/rhogen +1 -1
  6. data/doc/application.txt +277 -0
  7. data/doc/bb-css.txt +209 -0
  8. data/doc/build.txt +785 -0
  9. data/doc/configuration.txt +236 -0
  10. data/doc/connect-to-web-services.txt +282 -0
  11. data/doc/contributing.txt +64 -0
  12. data/doc/css-framework.txt +144 -0
  13. data/doc/device-caps.txt +1152 -0
  14. data/doc/extensions.txt +528 -0
  15. data/doc/files.txt +4 -0
  16. data/doc/generator.txt +141 -0
  17. data/doc/install.txt +35 -0
  18. data/doc/introduction.txt +88 -0
  19. data/doc/rhom.txt +826 -0
  20. data/doc/standard-css.txt +392 -0
  21. data/doc/synchronization.txt +542 -0
  22. data/doc/test-log-debug.txt +148 -0
  23. data/doc/tutorial.txt +136 -0
  24. data/doc/ui.txt +766 -0
  25. data/installer/EnvVarUpdate.nsh +328 -0
  26. data/installer/README.html +81 -0
  27. data/installer/RHOSYNC-LICENSE.txt +675 -0
  28. data/installer/icon.ico +0 -0
  29. data/installer/instant-rhodes.nsi +427 -0
  30. data/lib/build/jake.rb +15 -1
  31. data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
  32. data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
  33. data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
  34. data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
  35. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
  36. data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
  37. data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
  38. data/lib/extensions/digest-sha1/ext/build.bat +1 -0
  39. data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
  40. data/lib/extensions/esri/ext/build +17 -0
  41. data/lib/extensions/esri/ext/build.bat +29 -0
  42. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
  43. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
  44. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
  45. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
  46. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
  47. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
  48. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
  49. data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
  50. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
  51. data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
  52. data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
  53. data/lib/extensions/esri/ext.yml +3 -0
  54. data/lib/extensions/net-http/monitor.rb +265 -0
  55. data/lib/extensions/net-http/net/ftp.rb +981 -0
  56. data/lib/extensions/net-http/thread.rb +367 -0
  57. data/lib/extensions/rhocgi/cgi.rb +16 -0
  58. data/lib/extensions/rhospec/rhospec.rb +118 -0
  59. data/lib/framework/base64.rb +91 -0
  60. data/lib/framework/builtinME.rb +13 -10
  61. data/lib/framework/ostruct.rb +145 -0
  62. data/lib/framework/res/back_btn.wm.png +0 -0
  63. data/lib/framework/res/blue_pushpin.wm.png +0 -0
  64. data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
  65. data/lib/framework/res/callout.wm.png +0 -0
  66. data/lib/framework/res/callout_link.wm.png +0 -0
  67. data/lib/framework/res/forward_btn.wm.png +0 -0
  68. data/lib/framework/res/home_btn.wm.png +0 -0
  69. data/lib/framework/res/options_btn.wm.png +0 -0
  70. data/lib/framework/res/refresh_btn.wm.png +0 -0
  71. data/lib/framework/rho/render.rb +5 -2
  72. data/lib/framework/rho/rho.rb +320 -50
  73. data/lib/framework/rho/rhoapplication.rb +48 -10
  74. data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
  75. data/lib/framework/rho/rhosupport.rb +15 -1
  76. data/lib/framework/rho/rhotabbar.rb +29 -0
  77. data/lib/framework/rho/rhotoolbar.rb +17 -0
  78. data/lib/framework/rho/rhoutils.rb +22 -6
  79. data/lib/framework/rhodes.rb +1 -1
  80. data/lib/framework/rholang/rhomsg_de.rb +4 -3
  81. data/lib/framework/rholang/rhomsg_en.rb +1 -0
  82. data/lib/framework/rholang/rhomsg_es.rb +1 -0
  83. data/lib/framework/rholang/rhomsg_it.rb +1 -0
  84. data/lib/framework/rhom/rhom.rb +31 -10
  85. data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
  86. data/lib/framework/rhom/rhom_object_factory.rb +465 -249
  87. data/lib/framework/rhom/rhom_source.rb +22 -7
  88. data/lib/framework/version.rb +1 -1
  89. data/lib/rhodes.rb +1 -1
  90. data/platform/android/Rhodes/AndroidManifest.xml +83 -20
  91. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
  92. data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
  93. data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
  94. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
  95. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
  96. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
  97. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
  98. data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
  99. data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
  100. data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
  101. data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
  102. data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
  103. data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
  104. data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
  105. data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
  106. data/platform/android/Rhodes/jni/src/event.cpp +9 -15
  107. data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
  108. data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
  109. data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
  110. data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
  111. data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
  112. data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
  113. data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
  114. data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
  115. data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
  116. data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
  117. data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
  118. data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
  119. data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
  120. data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
  121. data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
  122. data/platform/android/Rhodes/res/drawable/callout.png +0 -0
  123. data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
  124. data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
  125. data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
  126. data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
  127. data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
  128. data/platform/android/Rhodes/res/layout/signature.xml +24 -17
  129. data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
  130. data/platform/android/Rhodes/res/values/strings.xml +1 -1
  131. data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
  132. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
  134. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
  135. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
  136. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
  137. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
  138. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
  139. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
  140. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
  141. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
  142. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
  143. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
  144. data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
  145. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
  146. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
  147. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
  148. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
  149. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
  150. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
  151. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
  152. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
  153. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
  154. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
  155. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
  156. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
  157. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
  158. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
  159. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
  160. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
  161. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
  162. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
  163. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
  164. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
  165. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
  166. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
  167. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
  168. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
  169. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
  170. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
  171. data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
  172. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
  173. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
  174. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
  175. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
  176. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
  177. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
  178. data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
  179. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
  180. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
  181. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
  182. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
  183. data/platform/android/build/RhodesSRC_build.files +32 -23
  184. data/platform/android/build/android.rake +28 -11
  185. data/platform/android/build/androidcommon.rb +2 -0
  186. data/platform/android/build/librhocommon_build.files +9 -5
  187. data/platform/android/build/librhodes_build.files +1 -0
  188. data/platform/android/build/libruby_build.files +1 -0
  189. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
  190. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
  191. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
  192. data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
  193. data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
  194. data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
  195. data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
  196. data/platform/bb/RubyVM/RubyVM.jdp +3 -0
  197. data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
  198. data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
  199. data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
  200. data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
  201. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
  202. data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
  203. data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
  204. data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
  205. data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
  206. data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
  207. data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
  208. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
  209. data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
  210. data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
  211. data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
  212. data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
  213. data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
  214. data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
  215. data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
  216. data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
  217. data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
  218. data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
  219. data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
  220. data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
  221. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
  222. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
  223. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
  224. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
  225. data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
  226. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
  227. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
  228. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
  229. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
  230. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
  231. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
  232. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
  233. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
  234. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
  235. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
  236. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
  237. data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
  238. data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
  239. data/platform/bb/build/RubyVM_build.files +3 -0
  240. data/platform/bb/build/bb.rake +140 -62
  241. data/platform/bb/build/hsqldb_build.files +0 -2
  242. data/platform/bb/build/rhodes_build.files +5 -0
  243. data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
  244. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
  245. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
  246. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
  247. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
  248. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
  249. data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
  250. data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
  251. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
  252. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
  253. data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
  254. data/platform/bb/rhodes/resources/mappin.png +0 -0
  255. data/platform/bb/rhodes/rhodes.jdp +3 -0
  256. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
  257. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
  258. data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
  259. data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
  260. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
  261. data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
  262. data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
  263. data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
  264. data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
  265. data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
  266. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
  267. data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
  268. data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
  269. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
  270. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
  271. data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
  272. data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
  273. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
  274. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
  275. data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
  276. data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
  277. data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
  278. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
  279. data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
  280. data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
  281. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
  282. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
  283. data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
  284. data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
  285. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
  286. data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
  287. data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
  288. data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
  289. data/platform/iphone/Classes/DateTime.h +4 -0
  290. data/platform/iphone/Classes/DateTime.m +1 -1
  291. data/platform/iphone/Classes/DateTimePicker.m +8 -1
  292. data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
  293. data/platform/iphone/Classes/Event/Event.m +2 -2
  294. data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
  295. data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
  296. data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
  297. data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
  298. data/platform/iphone/Classes/NativeBar.h +34 -0
  299. data/platform/iphone/Classes/NativeBar.m +131 -26
  300. data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
  301. data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
  302. data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
  303. data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
  304. data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
  305. data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
  306. data/platform/iphone/Classes/RhoAlert.m +3 -3
  307. data/platform/iphone/Classes/RhoMainView.h +3 -0
  308. data/platform/iphone/Classes/Rhodes.h +6 -2
  309. data/platform/iphone/Classes/Rhodes.m +47 -79
  310. data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
  311. data/platform/iphone/Classes/SimpleMainView.h +18 -1
  312. data/platform/iphone/Classes/SimpleMainView.m +180 -35
  313. data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
  314. data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
  315. data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
  316. data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
  317. data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
  318. data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
  319. data/platform/iphone/Classes/TabbedMainView.h +25 -3
  320. data/platform/iphone/Classes/TabbedMainView.m +340 -14
  321. data/platform/iphone/ESRI/BluePushpin.png +0 -0
  322. data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
  323. data/platform/iphone/ESRI/esri.png +0 -0
  324. data/platform/iphone/ESRI/esri@2x.png +0 -0
  325. data/platform/iphone/Info.plist +1 -1
  326. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
  327. data/platform/iphone/rbuild/iphone.rake +100 -4
  328. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
  329. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
  330. data/platform/shared/SyncClient/SyncClient.cpp +29 -3
  331. data/platform/shared/SyncClient/SyncClient.h +2 -1
  332. data/platform/shared/common/IRhoClassFactory.h +3 -0
  333. data/platform/shared/common/IRhoCrypt.h +16 -0
  334. data/platform/shared/common/IRhoThreadImpl.h +1 -0
  335. data/platform/shared/common/RhoAppAdapter.h +2 -0
  336. data/platform/shared/common/RhoConf.cpp +97 -46
  337. data/platform/shared/common/RhoConf.h +14 -13
  338. data/platform/shared/common/RhoFile.cpp +10 -0
  339. data/platform/shared/common/RhoFile.h +1 -0
  340. data/platform/shared/common/RhoMath.cpp +43 -0
  341. data/platform/shared/common/RhoMath.h +27 -0
  342. data/platform/shared/common/RhoNativeViewManager.h +27 -1
  343. data/platform/shared/common/RhoPort.h +11 -0
  344. data/platform/shared/common/RhoStd.h +5 -0
  345. data/platform/shared/common/RhoThread.cpp +1 -1
  346. data/platform/shared/common/RhoThread.h +1 -1
  347. data/platform/shared/common/RhodesApp.cpp +381 -139
  348. data/platform/shared/common/RhodesApp.h +24 -10
  349. data/platform/shared/common/RhodesAppBase.cpp +72 -1
  350. data/platform/shared/common/RhodesAppBase.h +5 -1
  351. data/platform/shared/common/SplashScreen.h +4 -4
  352. data/platform/shared/common/ThreadQueue.cpp +44 -17
  353. data/platform/shared/common/ThreadQueue.h +4 -0
  354. data/platform/shared/common/app_build_configs.c +0 -1
  355. data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
  356. data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
  357. data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
  358. data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
  359. data/platform/shared/common/map/ESRIMapEngine.h +255 -0
  360. data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
  361. data/platform/shared/common/map/GoogleMapEngine.h +52 -0
  362. data/platform/shared/common/map/MapEngine.cpp +304 -0
  363. data/platform/shared/common/map/MapEngine.h +214 -0
  364. data/platform/shared/db/DBAdapter.cpp +147 -18
  365. data/platform/shared/db/DBAdapter.h +38 -12
  366. data/platform/shared/db/DBAttrManager.cpp +4 -3
  367. data/platform/shared/db/DBAttrManager.h +7 -7
  368. data/platform/shared/db/res/db/syncdb.triggers +0 -5
  369. data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
  370. data/platform/shared/json/JSONIterator.cpp +11 -1
  371. data/platform/shared/json/JSONIterator.h +1 -0
  372. data/platform/shared/logging/RhoLogConf.cpp +29 -12
  373. data/platform/shared/net/CURLNetRequest.cpp +80 -25
  374. data/platform/shared/net/CURLNetRequest.h +6 -2
  375. data/platform/shared/net/HttpServer.cpp +12 -6
  376. data/platform/shared/net/HttpServer.h +2 -1
  377. data/platform/shared/net/INetRequest.h +1 -0
  378. data/platform/shared/ruby/ext/alert/alert.i +5 -0
  379. data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
  380. data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
  381. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
  382. data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
  383. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
  384. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
  385. data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
  386. data/platform/shared/ruby/ext/rho/extensions.c +0 -1
  387. data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
  388. data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
  389. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
  390. data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
  391. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
  392. data/platform/shared/ruby/ext/system/system.i +4 -0
  393. data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
  394. data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
  395. data/platform/shared/rubyext/System.cpp +9 -0
  396. data/platform/shared/rubyext/WebView.h +1 -0
  397. data/platform/shared/sqlite/crypto.c +907 -0
  398. data/platform/shared/sqlite/sqlite3.c +6 -0
  399. data/platform/shared/sync/SyncEngine.cpp +49 -19
  400. data/platform/shared/sync/SyncEngine.h +0 -1
  401. data/platform/shared/sync/SyncNotify.cpp +14 -5
  402. data/platform/shared/sync/SyncNotify.h +2 -2
  403. data/platform/shared/sync/SyncSource.cpp +79 -33
  404. data/platform/shared/sync/SyncSource.h +1 -0
  405. data/platform/shared/sync/SyncThread.cpp +26 -11
  406. data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
  407. data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
  408. data/platform/wm/build/wm.rake +6 -0
  409. data/platform/wm/rhodes/Alert.cpp +4 -3
  410. data/platform/wm/rhodes/Alert.h +1 -1
  411. data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
  412. data/platform/wm/rhodes/DateTimePicker.h +9 -1
  413. data/platform/wm/rhodes/MainWindow.cpp +121 -61
  414. data/platform/wm/rhodes/MainWindow.h +29 -4
  415. data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
  416. data/platform/wm/rhodes/MapView/Graphics.h +136 -0
  417. data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
  418. data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
  419. data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
  420. data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
  421. data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
  422. data/platform/wm/rhodes/Rhodes.cpp +94 -102
  423. data/platform/wm/rhodes/Rhodes.rc +27 -0
  424. data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
  425. data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
  426. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
  427. data/platform/wm/rhodes/camera/Camera.cpp +36 -15
  428. data/platform/wm/rhodes/camera/Camera.h +0 -4
  429. data/platform/wm/rhodes/resource.h +10 -2
  430. data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
  431. data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
  432. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
  433. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
  434. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
  435. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
  436. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
  437. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
  438. data/platform/wm/rhodes/rhodes.vcproj +38 -2
  439. data/platform/wm/rhodes/stdafx.h +2 -1
  440. data/platform/wm/rubylib/rubylib.vcproj +12 -0
  441. data/rakefile.rb +85 -80
  442. data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
  443. data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
  444. data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
  445. data/res/build-tools/xruby-0.3.3.jar +0 -0
  446. data/res/generators/templates/application/app/application.rb +2 -2
  447. data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
  448. data/res/generators/templates/application/public/css/android.css +1 -0
  449. data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
  450. data/res/generators/templates/application/rhoconfig.txt +66 -14
  451. data/rhodes.gemspec +3 -3
  452. data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
  453. data/spec/framework_spec/build.yml +1 -1
  454. data/spec/phone_spec/Rakefile +1 -0
  455. data/spec/phone_spec/app/Account/account.rb +2 -0
  456. data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
  457. data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
  458. data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
  459. data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
  460. data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
  461. data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
  462. data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
  463. data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
  464. data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
  465. data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
  466. data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
  467. data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
  468. data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
  469. data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
  470. data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
  471. data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
  472. data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
  473. data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
  474. data/spec/phone_spec/app/spec_runner.rb +15 -7
  475. data/spec/phone_spec/build.yml +2 -2
  476. metadata +154 -25
  477. data/README.textile +0 -45
  478. data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
  479. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
  480. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
  481. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
  482. data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
  483. data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
  484. data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
  485. data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
  486. data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
@@ -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 2.0.0
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,33 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
791
831
 
792
832
  #include <ruby.h>
793
833
 
834
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
835
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
836
+ * issue for now by disabling this.
837
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
838
+ */
839
+ #ifdef rb_intern
840
+ # undef rb_intern
841
+ #endif
842
+
843
+ /* Remove global macros defined in Ruby's win32.h */
844
+ #ifdef write
845
+ # undef write
846
+ #endif
847
+ #ifdef read
848
+ # undef read
849
+ #endif
850
+ #ifdef bind
851
+ # undef bind
852
+ #endif
853
+ #ifdef close
854
+ # undef close
855
+ #endif
856
+ #ifdef connect
857
+ # undef connect
858
+ #endif
859
+
860
+
794
861
  /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
795
862
  #ifndef NUM2LL
796
863
  #define NUM2LL(x) NUM2LONG((x))
@@ -819,12 +886,44 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
819
886
  #ifndef RSTRING_PTR
820
887
  # define RSTRING_PTR(x) RSTRING(x)->ptr
821
888
  #endif
889
+ #ifndef RSTRING_END
890
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
891
+ #endif
822
892
  #ifndef RARRAY_LEN
823
893
  # define RARRAY_LEN(x) RARRAY(x)->len
824
894
  #endif
825
895
  #ifndef RARRAY_PTR
826
896
  # define RARRAY_PTR(x) RARRAY(x)->ptr
827
897
  #endif
898
+ #ifndef RFLOAT_VALUE
899
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
900
+ #endif
901
+ #ifndef DOUBLE2NUM
902
+ # define DOUBLE2NUM(x) rb_float_new(x)
903
+ #endif
904
+ #ifndef RHASH_TBL
905
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
906
+ #endif
907
+ #ifndef RHASH_ITER_LEV
908
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
909
+ #endif
910
+ #ifndef RHASH_IFNONE
911
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
912
+ #endif
913
+ #ifndef RHASH_SIZE
914
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
915
+ #endif
916
+ #ifndef RHASH_EMPTY_P
917
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
918
+ #endif
919
+ #ifndef RSTRUCT_LEN
920
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
921
+ #endif
922
+ #ifndef RSTRUCT_PTR
923
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
924
+ #endif
925
+
926
+
828
927
 
829
928
  /*
830
929
  * Need to be very careful about how these macros are defined, especially
@@ -886,6 +985,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
886
985
  #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
887
986
  #endif
888
987
 
988
+ static VALUE _mSWIG = Qnil;
889
989
 
890
990
  /* -----------------------------------------------------------------------------
891
991
  * error manipulation
@@ -976,12 +1076,73 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
976
1076
  }
977
1077
 
978
1078
 
1079
+ /* This function is called when a user inputs a wrong argument to
1080
+ a method.
1081
+ */
1082
+ SWIGINTERN
1083
+ const char* Ruby_Format_TypeError( const char* msg,
1084
+ const char* type,
1085
+ const char* name,
1086
+ const int argn,
1087
+ VALUE input )
1088
+ {
1089
+ char buf[128];
1090
+ VALUE str;
1091
+ VALUE asStr;
1092
+ if ( msg && *msg )
1093
+ {
1094
+ str = rb_str_new2(msg);
1095
+ }
1096
+ else
1097
+ {
1098
+ str = rb_str_new(NULL, 0);
1099
+ }
1100
+
1101
+ str = rb_str_cat2( str, "Expected argument " );
1102
+ sprintf( buf, "%d of type ", argn-1 );
1103
+ str = rb_str_cat2( str, buf );
1104
+ str = rb_str_cat2( str, type );
1105
+ str = rb_str_cat2( str, ", but got " );
1106
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1107
+ str = rb_str_cat2( str, " " );
1108
+ asStr = rb_inspect(input);
1109
+ if ( RSTRING_LEN(asStr) > 30 )
1110
+ {
1111
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1112
+ str = rb_str_cat2( str, "..." );
1113
+ }
1114
+ else
1115
+ {
1116
+ str = rb_str_append( str, asStr );
1117
+ }
1118
+
1119
+ if ( name )
1120
+ {
1121
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1122
+ str = rb_str_cat2( str, name );
1123
+ str = rb_str_cat2( str, "'" );
1124
+ }
1125
+
1126
+ return StringValuePtr( str );
1127
+ }
979
1128
 
1129
+ /* This function is called when an overloaded method fails */
1130
+ SWIGINTERN
1131
+ void Ruby_Format_OverloadedError(
1132
+ const int argc,
1133
+ const int maxargs,
1134
+ const char* method,
1135
+ const char* prototypes
1136
+ )
1137
+ {
1138
+ const char* msg = "Wrong # of arguments";
1139
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1140
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1141
+ "Possible C/C++ prototypes are:\n%s",
1142
+ msg, method, prototypes);
1143
+ }
980
1144
 
981
1145
  /* -----------------------------------------------------------------------------
982
- * See the LICENSE file for information on copyright, usage and redistribution
983
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
984
- *
985
1146
  * rubytracking.swg
986
1147
  *
987
1148
  * This file contains support for tracking mappings from
@@ -994,23 +1155,51 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
994
1155
  extern "C" {
995
1156
  #endif
996
1157
 
1158
+ /* Ruby 1.8 actually assumes the first case. */
1159
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1160
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1161
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1162
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1163
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1164
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1165
+ #else
1166
+ # error sizeof(void*) is not the same as long or long long
1167
+ #endif
1168
+
997
1169
 
998
1170
  /* Global Ruby hash table to store Trackings from C/C++
999
- structs to Ruby Objects. */
1000
- static VALUE swig_ruby_trackings;
1171
+ structs to Ruby Objects.
1172
+ */
1173
+ static VALUE swig_ruby_trackings = Qnil;
1001
1174
 
1002
1175
  /* Global variable that stores a reference to the ruby
1003
1176
  hash table delete function. */
1004
- static ID swig_ruby_hash_delete = 0;
1177
+ static ID swig_ruby_hash_delete;
1005
1178
 
1006
1179
  /* Setup a Ruby hash table to store Trackings */
1007
1180
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1008
1181
  /* 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
-
1182
+ objects to Ruby objects. */
1183
+
1184
+ /* Try to see if some other .so has already created a
1185
+ tracking hash table, which we keep hidden in an instance var
1186
+ in the SWIG module.
1187
+ This is done to allow multiple DSOs to share the same
1188
+ tracking table.
1189
+ */
1190
+ ID trackings_id = rb_intern( "@__trackings__" );
1191
+ VALUE verbose = rb_gv_get("VERBOSE");
1192
+ rb_gv_set("VERBOSE", Qfalse);
1193
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1194
+ rb_gv_set("VERBOSE", verbose);
1195
+
1196
+ /* No, it hasn't. Create one ourselves */
1197
+ if ( swig_ruby_trackings == Qnil )
1198
+ {
1199
+ swig_ruby_trackings = rb_hash_new();
1200
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1201
+ }
1202
+
1014
1203
  /* Now store a reference to the hash table delete function
1015
1204
  so that we only have to look it up once.*/
1016
1205
  swig_ruby_hash_delete = rb_intern("delete");
@@ -1023,8 +1212,7 @@ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1023
1212
  a Ruby number object. */
1024
1213
 
1025
1214
  /* Convert the pointer to a Ruby number */
1026
- unsigned long value = (unsigned long) ptr;
1027
- return LONG2NUM(value);
1215
+ return SWIG2NUM(ptr);
1028
1216
  }
1029
1217
 
1030
1218
  /* Get a Ruby number to reference an object */
@@ -1034,8 +1222,7 @@ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1034
1222
  a Ruby number object. */
1035
1223
 
1036
1224
  /* Convert the Object to a Ruby number */
1037
- unsigned long value = (unsigned long) object;
1038
- return LONG2NUM(value);
1225
+ return SWIG2NUM(object);
1039
1226
  }
1040
1227
 
1041
1228
  /* Get a Ruby object from a previously stored reference */
@@ -1043,9 +1230,8 @@ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1043
1230
  /* The provided Ruby number object is a reference
1044
1231
  to the Ruby object we want.*/
1045
1232
 
1046
- /* First convert the Ruby number to a C number */
1047
- unsigned long value = NUM2LONG(reference);
1048
- return (VALUE) value;
1233
+ /* Convert the Ruby number to a Ruby object */
1234
+ return NUM2SWIG(reference);
1049
1235
  }
1050
1236
 
1051
1237
  /* Add a Tracking from a C/C++ struct to a Ruby object */
@@ -1137,15 +1323,21 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1137
1323
  return target;
1138
1324
  }
1139
1325
 
1326
+ /* For ruby1.8.4 and earlier. */
1327
+ #ifndef RUBY_INIT_STACK
1328
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1329
+ # define RUBY_INIT_STACK \
1330
+ VALUE variable_in_this_stack_frame; \
1331
+ Init_stack(&variable_in_this_stack_frame);
1332
+ #endif
1333
+
1334
+
1140
1335
  #ifdef __cplusplus
1141
1336
  }
1142
1337
  #endif
1143
1338
 
1144
1339
 
1145
1340
  /* -----------------------------------------------------------------------------
1146
- * See the LICENSE file for information on copyright, usage and redistribution
1147
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1148
- *
1149
1341
  * rubyrun.swg
1150
1342
  *
1151
1343
  * This file contains the runtime support for Ruby modules
@@ -1189,7 +1381,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1189
1381
  /* Error manipulation */
1190
1382
 
1191
1383
  #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1192
- #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1384
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1193
1385
  #define SWIG_fail goto fail
1194
1386
 
1195
1387
 
@@ -1201,6 +1393,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1201
1393
  #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1202
1394
  #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1203
1395
 
1396
+ #include "assert.h"
1204
1397
 
1205
1398
  /* -----------------------------------------------------------------------------
1206
1399
  * pointers/data manipulation
@@ -1208,9 +1401,6 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1208
1401
 
1209
1402
  #ifdef __cplusplus
1210
1403
  extern "C" {
1211
- #if 0
1212
- } /* cc-mode */
1213
- #endif
1214
1404
  #endif
1215
1405
 
1216
1406
  typedef struct {
@@ -1222,10 +1412,44 @@ typedef struct {
1222
1412
  } swig_class;
1223
1413
 
1224
1414
 
1225
- static VALUE _mSWIG = Qnil;
1415
+ /* Global pointer used to keep some internal SWIG stuff */
1226
1416
  static VALUE _cSWIG_Pointer = Qnil;
1227
1417
  static VALUE swig_runtime_data_type_pointer = Qnil;
1228
1418
 
1419
+ /* Global IDs used to keep some internal SWIG stuff */
1420
+ static ID swig_arity_id = 0;
1421
+ static ID swig_call_id = 0;
1422
+
1423
+ /*
1424
+ If your swig extension is to be run within an embedded ruby and has
1425
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1426
+ This will reset ruby's stack frame on each entry point from the main
1427
+ program the first time a virtual director function is invoked (in a
1428
+ non-recursive way).
1429
+ If this is not done, you run the risk of Ruby trashing the stack.
1430
+ */
1431
+
1432
+ #ifdef RUBY_EMBEDDED
1433
+
1434
+ # define SWIG_INIT_STACK \
1435
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1436
+ ++swig_virtual_calls;
1437
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1438
+ # define Ruby_DirectorTypeMismatchException(x) \
1439
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1440
+
1441
+ static unsigned int swig_virtual_calls = 0;
1442
+
1443
+ #else /* normal non-embedded extension */
1444
+
1445
+ # define SWIG_INIT_STACK
1446
+ # define SWIG_RELEASE_STACK
1447
+ # define Ruby_DirectorTypeMismatchException(x) \
1448
+ throw Swig::DirectorTypeMismatchException( x );
1449
+
1450
+ #endif /* RUBY_EMBEDDED */
1451
+
1452
+
1229
1453
  SWIGRUNTIME VALUE
1230
1454
  getExceptionClass(void) {
1231
1455
  static int init = 0;
@@ -1257,6 +1481,8 @@ SWIG_Ruby_InitRuntime(void)
1257
1481
  {
1258
1482
  if (_mSWIG == Qnil) {
1259
1483
  _mSWIG = rb_define_module("SWIG");
1484
+ swig_call_id = rb_intern("call");
1485
+ swig_arity_id = rb_intern("arity");
1260
1486
  }
1261
1487
  }
1262
1488
 
@@ -1280,7 +1506,7 @@ SWIGRUNTIME VALUE
1280
1506
  SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1281
1507
  {
1282
1508
  int own = flags & SWIG_POINTER_OWN;
1283
-
1509
+ int track;
1284
1510
  char *klass_name;
1285
1511
  swig_class *sklass;
1286
1512
  VALUE klass;
@@ -1293,14 +1519,15 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1293
1519
  sklass = (swig_class *) type->clientdata;
1294
1520
 
1295
1521
  /* Are we tracking this class and have we already returned this Ruby object? */
1296
- if (sklass->trackObjects) {
1522
+ track = sklass->trackObjects;
1523
+ if (track) {
1297
1524
  obj = SWIG_RubyInstanceFor(ptr);
1298
1525
 
1299
1526
  /* Check the object's type and make sure it has the correct type.
1300
1527
  It might not in cases where methods do things like
1301
1528
  downcast methods. */
1302
1529
  if (obj != Qnil) {
1303
- VALUE value = rb_iv_get(obj, "__swigtype__");
1530
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1304
1531
  char* type_name = RSTRING_PTR(value);
1305
1532
 
1306
1533
  if (strcmp(type->name, type_name) == 0) {
@@ -1310,10 +1537,13 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1310
1537
  }
1311
1538
 
1312
1539
  /* Create a new Ruby object */
1313
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1540
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1541
+ ( own ? VOIDFUNC(sklass->destroy) :
1542
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1543
+ ), ptr);
1314
1544
 
1315
1545
  /* If tracking is on for this class then track this object. */
1316
- if (sklass->trackObjects) {
1546
+ if (track) {
1317
1547
  SWIG_RubyAddTracking(ptr, obj);
1318
1548
  }
1319
1549
  } else {
@@ -1323,7 +1553,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1323
1553
  free((void *) klass_name);
1324
1554
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1325
1555
  }
1326
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1556
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1327
1557
 
1328
1558
  return obj;
1329
1559
  }
@@ -1335,7 +1565,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1335
1565
  VALUE obj;
1336
1566
  swig_class *sklass = (swig_class *) type->clientdata;
1337
1567
  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1338
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1568
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1339
1569
  return obj;
1340
1570
  }
1341
1571
 
@@ -1343,7 +1573,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1343
1573
  SWIGRUNTIMEINLINE char *
1344
1574
  SWIG_Ruby_MangleStr(VALUE obj)
1345
1575
  {
1346
- VALUE stype = rb_iv_get(obj, "__swigtype__");
1576
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1347
1577
  return StringValuePtr(stype);
1348
1578
  }
1349
1579
 
@@ -1425,8 +1655,11 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1425
1655
  tc = SWIG_TypeCheck(c, ty);
1426
1656
  if (!tc) {
1427
1657
  return SWIG_ERROR;
1658
+ } else {
1659
+ int newmemory = 0;
1660
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1661
+ assert(!newmemory); /* newmemory handling not yet implemented */
1428
1662
  }
1429
- *ptr = SWIG_TypeCast(tc, vptr);
1430
1663
  } else {
1431
1664
  *ptr = vptr;
1432
1665
  }
@@ -1507,10 +1740,42 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1507
1740
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1508
1741
  }
1509
1742
 
1743
+ /* This function can be used to check whether a proc or method or similarly
1744
+ callable function has been passed. Usually used in a %typecheck, like:
1745
+
1746
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1747
+ $result = SWIG_Ruby_isCallable( $input );
1748
+ }
1749
+ */
1750
+ SWIGINTERN
1751
+ int SWIG_Ruby_isCallable( VALUE proc )
1752
+ {
1753
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1754
+ return 1;
1755
+ return 0;
1756
+ }
1757
+
1758
+ /* This function can be used to check the arity (number of arguments)
1759
+ a proc or method can take. Usually used in a %typecheck.
1760
+ Valid arities will be that equal to minimal or those < 0
1761
+ which indicate a variable number of parameters at the end.
1762
+ */
1763
+ SWIGINTERN
1764
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
+ {
1766
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1767
+ {
1768
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
+ int arity = NUM2INT(num);
1770
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1771
+ if ( arity == minimal ) return 1;
1772
+ return 1;
1773
+ }
1774
+ return 0;
1775
+ }
1776
+
1777
+
1510
1778
  #ifdef __cplusplus
1511
- #if 0
1512
- { /* cc-mode */
1513
- #endif
1514
1779
  }
1515
1780
  #endif
1516
1781
 
@@ -1537,7 +1802,11 @@ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1537
1802
 
1538
1803
  static VALUE mDateTimePicker;
1539
1804
 
1540
- #define SWIGVERSION 0x010331
1805
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1806
+ #define SWIG_RUBY_THREAD_END_BLOCK
1807
+
1808
+
1809
+ #define SWIGVERSION 0x020000
1541
1810
  #define SWIG_VERSION SWIGVERSION
1542
1811
 
1543
1812
 
@@ -1547,6 +1816,8 @@ static VALUE mDateTimePicker;
1547
1816
 
1548
1817
  extern void choose_datetime(char* callback, char* title, long initial_time, int format, char* data);
1549
1818
  #define choose choose_datetime
1819
+ extern void choose_datetime_with_range(char* callback, char* title, long initial_time, int format, char* data, long min_time, long max_time);
1820
+ #define choose_with_range choose_datetime_with_range
1550
1821
 
1551
1822
 
1552
1823
  SWIGINTERN swig_type_info*
@@ -1566,11 +1837,11 @@ SWIGINTERN int
1566
1837
  SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1567
1838
  {
1568
1839
  if (TYPE(obj) == T_STRING) {
1569
-
1570
-
1571
-
1840
+ #if defined(StringValuePtr)
1841
+ char *cstr = StringValuePtr(obj);
1842
+ #else
1572
1843
  char *cstr = STR2CSTR(obj);
1573
-
1844
+ #endif
1574
1845
  size_t size = RSTRING_LEN(obj) + 1;
1575
1846
  if (cptr) {
1576
1847
  if (alloc) {
@@ -1604,14 +1875,12 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1604
1875
 
1605
1876
 
1606
1877
  #include <limits.h>
1607
- #ifndef LLONG_MIN
1608
- # define LLONG_MIN LONG_LONG_MIN
1609
- #endif
1610
- #ifndef LLONG_MAX
1611
- # define LLONG_MAX LONG_LONG_MAX
1612
- #endif
1613
- #ifndef ULLONG_MAX
1614
- # define ULLONG_MAX ULONG_LONG_MAX
1878
+ #if !defined(SWIG_NO_LLONG_MAX)
1879
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1880
+ # define LLONG_MAX __LONG_LONG_MAX__
1881
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1882
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1883
+ # endif
1615
1884
  #endif
1616
1885
 
1617
1886
 
@@ -1622,7 +1891,7 @@ SWIG_ruby_failed(void)
1622
1891
  }
1623
1892
 
1624
1893
 
1625
- /*@SWIG:%ruby_aux_method@*/
1894
+ /*@SWIG:C:\Rhode\swigwin-2.0.0\Lib\ruby\rubyprimtypes.swg,19,%ruby_aux_method@*/
1626
1895
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1627
1896
  {
1628
1897
  VALUE obj = args[0];
@@ -1693,12 +1962,12 @@ _wrap_choose(int argc, VALUE *argv, VALUE self) {
1693
1962
  }
1694
1963
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1695
1964
  if (!SWIG_IsOK(res1)) {
1696
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "choose" "', argument " "1"" of type '" "char *""'");
1965
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","choose", 1, argv[0] ));
1697
1966
  }
1698
1967
  arg1 = (char *)(buf1);
1699
1968
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1700
1969
  if (!SWIG_IsOK(res2)) {
1701
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "choose" "', argument " "2"" of type '" "char *""'");
1970
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","choose", 2, argv[1] ));
1702
1971
  }
1703
1972
  arg2 = (char *)(buf2);
1704
1973
  {
@@ -1721,13 +1990,13 @@ _wrap_choose(int argc, VALUE *argv, VALUE self) {
1721
1990
  }
1722
1991
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
1723
1992
  if (!SWIG_IsOK(ecode4)) {
1724
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "choose" "', argument " "4"" of type '" "int""'");
1993
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","choose", 4, argv[3] ));
1725
1994
  }
1726
1995
  arg4 = (int)(val4);
1727
1996
  if (argc > 4) {
1728
1997
  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
1729
1998
  if (!SWIG_IsOK(res5)) {
1730
- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "choose" "', argument " "5"" of type '" "char *""'");
1999
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","choose", 5, argv[4] ));
1731
2000
  }
1732
2001
  arg5 = (char *)(buf5);
1733
2002
  }
@@ -1744,6 +2013,126 @@ fail:
1744
2013
  }
1745
2014
 
1746
2015
 
2016
+ SWIGINTERN VALUE
2017
+ _wrap_choose_with_range(int argc, VALUE *argv, VALUE self) {
2018
+ char *arg1 = (char *) 0 ;
2019
+ char *arg2 = (char *) 0 ;
2020
+ long arg3 ;
2021
+ int arg4 ;
2022
+ char *arg5 = (char *) 0 ;
2023
+ long arg6 ;
2024
+ long arg7 ;
2025
+ int res1 ;
2026
+ char *buf1 = 0 ;
2027
+ int alloc1 = 0 ;
2028
+ int res2 ;
2029
+ char *buf2 = 0 ;
2030
+ int alloc2 = 0 ;
2031
+ int val4 ;
2032
+ int ecode4 = 0 ;
2033
+ int res5 ;
2034
+ char *buf5 = 0 ;
2035
+ int alloc5 = 0 ;
2036
+
2037
+ {
2038
+ arg5 = NULL;
2039
+ }
2040
+ if ((argc < 4) || (argc > 7)) {
2041
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
2042
+ }
2043
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2044
+ if (!SWIG_IsOK(res1)) {
2045
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","choose_with_range", 1, argv[0] ));
2046
+ }
2047
+ arg1 = (char *)(buf1);
2048
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2049
+ if (!SWIG_IsOK(res2)) {
2050
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","choose_with_range", 2, argv[1] ));
2051
+ }
2052
+ arg2 = (char *)(buf2);
2053
+ {
2054
+ VALUE t;
2055
+ long val;
2056
+ VALUE class;
2057
+ VALUE class_str;
2058
+ char *class_val;
2059
+
2060
+ class = rb_funcall(argv[2], rb_intern("class"), 0);
2061
+ class_str = rb_funcall(class, rb_intern("to_s"), 0);
2062
+ class_val = StringValuePtr(class_str);
2063
+
2064
+ if (!strcmp(class_val, "Time") == 0) {
2065
+ rb_raise(SWIG_Ruby_ErrorType(SWIG_AttributeError), " of type '" "Time""'");
2066
+ }
2067
+ t = rb_funcall(argv[2], rb_intern("to_i"), 0);
2068
+ val = NUM2INT(t);
2069
+ arg3 = (long)val;
2070
+ }
2071
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
2072
+ if (!SWIG_IsOK(ecode4)) {
2073
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","choose_with_range", 4, argv[3] ));
2074
+ }
2075
+ arg4 = (int)(val4);
2076
+ if (argc > 4) {
2077
+ res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
2078
+ if (!SWIG_IsOK(res5)) {
2079
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","choose_with_range", 5, argv[4] ));
2080
+ }
2081
+ arg5 = (char *)(buf5);
2082
+ }
2083
+ if (argc > 5) {
2084
+ {
2085
+ VALUE t;
2086
+ long val;
2087
+ VALUE class;
2088
+ VALUE class_str;
2089
+ char *class_val;
2090
+
2091
+ class = rb_funcall(argv[5], rb_intern("class"), 0);
2092
+ class_str = rb_funcall(class, rb_intern("to_s"), 0);
2093
+ class_val = StringValuePtr(class_str);
2094
+
2095
+ if (!strcmp(class_val, "Time") == 0) {
2096
+ rb_raise(SWIG_Ruby_ErrorType(SWIG_AttributeError), " of type '" "Time""'");
2097
+ }
2098
+ t = rb_funcall(argv[5], rb_intern("to_i"), 0);
2099
+ val = NUM2INT(t);
2100
+ arg6 = (long)val;
2101
+ }
2102
+ }
2103
+ if (argc > 6) {
2104
+ {
2105
+ VALUE t;
2106
+ long val;
2107
+ VALUE class;
2108
+ VALUE class_str;
2109
+ char *class_val;
2110
+
2111
+ class = rb_funcall(argv[6], rb_intern("class"), 0);
2112
+ class_str = rb_funcall(class, rb_intern("to_s"), 0);
2113
+ class_val = StringValuePtr(class_str);
2114
+
2115
+ if (!strcmp(class_val, "Time") == 0) {
2116
+ rb_raise(SWIG_Ruby_ErrorType(SWIG_AttributeError), " of type '" "Time""'");
2117
+ }
2118
+ t = rb_funcall(argv[6], rb_intern("to_i"), 0);
2119
+ val = NUM2INT(t);
2120
+ arg7 = (long)val;
2121
+ }
2122
+ }
2123
+ choose_with_range(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
2124
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2125
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2126
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2127
+ return Qnil;
2128
+ fail:
2129
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2130
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2131
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2132
+ return Qnil;
2133
+ }
2134
+
2135
+
1747
2136
 
1748
2137
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1749
2138
 
@@ -1819,7 +2208,7 @@ SWIGRUNTIME void
1819
2208
  SWIG_InitializeModule(void *clientdata) {
1820
2209
  size_t i;
1821
2210
  swig_module_info *module_head, *iter;
1822
- int found;
2211
+ int found, init;
1823
2212
 
1824
2213
  clientdata = clientdata;
1825
2214
 
@@ -1829,6 +2218,9 @@ SWIG_InitializeModule(void *clientdata) {
1829
2218
  swig_module.type_initial = swig_type_initial;
1830
2219
  swig_module.cast_initial = swig_cast_initial;
1831
2220
  swig_module.next = &swig_module;
2221
+ init = 1;
2222
+ } else {
2223
+ init = 0;
1832
2224
  }
1833
2225
 
1834
2226
  /* Try and load any already created modules */
@@ -1857,6 +2249,12 @@ SWIG_InitializeModule(void *clientdata) {
1857
2249
  module_head->next = &swig_module;
1858
2250
  }
1859
2251
 
2252
+ /* When multiple interpeters are used, a module could have already been initialized in
2253
+ a different interpreter, but not yet have a pointer in this interpreter.
2254
+ In this case, we do not want to continue adding types... everything should be
2255
+ set up already */
2256
+ if (init == 0) return;
2257
+
1860
2258
  /* Now work on filling in swig_module.types */
1861
2259
  #ifdef SWIGRUNTIME_DEBUG
1862
2260
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
@@ -1990,7 +2388,9 @@ SWIG_PropagateClientData(void) {
1990
2388
  }
1991
2389
  #endif
1992
2390
 
2391
+ /*
1993
2392
 
2393
+ */
1994
2394
  #ifdef __cplusplus
1995
2395
  extern "C"
1996
2396
  #endif
@@ -2007,5 +2407,6 @@ SWIGEXPORT void Init_DateTimePicker(void) {
2007
2407
 
2008
2408
  SWIG_RubyInitializeTrackings();
2009
2409
  rb_define_module_function(mDateTimePicker, "choose", _wrap_choose, -1);
2410
+ rb_define_module_function(mDateTimePicker, "choose_with_range", _wrap_choose_with_range, -1);
2010
2411
  }
2011
2412