rhodes 3.4.2 → 3.5.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (705) hide show
  1. data/CHANGELOG +9 -0
  2. data/Rakefile +61 -9
  3. data/doc/build.txt +147 -38
  4. data/doc/configuration.txt +49 -33
  5. data/doc/connect-to-web-services.txt +32 -32
  6. data/doc/contributing.txt +1 -1
  7. data/doc/device-caps.txt +62 -311
  8. data/doc/extensions.txt +104 -5
  9. data/doc/install.txt +17 -61
  10. data/doc/linea.txt +11 -11
  11. data/doc/nfc.txt +3 -3
  12. data/doc/release.txt +4 -4
  13. data/doc/rhom.txt +7 -7
  14. data/doc/rhostudio-test-plan.txt +12 -12
  15. data/doc/simulator.txt +32 -19
  16. data/doc/syncengine-ajax-api.txt +1 -1
  17. data/doc/synchronization.txt +8 -2
  18. data/doc/test-log-debug.txt +34 -3
  19. data/doc/ui.txt +8 -3
  20. data/installer/icon.ico +0 -0
  21. data/lib/build/jake.rb +27 -6
  22. data/lib/extensions/audiocapture/audiocapture.rb +43 -0
  23. data/lib/extensions/audiocapture/ext.yml +5 -0
  24. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/AndroidManifest.xml +10 -0
  25. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/Rakefile +77 -0
  26. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/ext_build.files +2 -0
  27. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/jni/src/audiocapture.cpp +189 -0
  28. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/src/com/audiocapture/Audiocapture.java +236 -0
  29. data/lib/extensions/audiocapture/ext/audiocapture/platform/android/src/com/audiocapture/ExtAudioRecorder.java +573 -0
  30. data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/Audiocapture.files +1 -0
  31. data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/Rakefile +97 -0
  32. data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/audiocapture.jdp +48 -0
  33. data/lib/extensions/audiocapture/ext/audiocapture/platform/bb/src/com/audiocapture/Audiocapture.java +118 -0
  34. data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Audiocapture.xcodeproj/project.pbxproj +314 -0
  35. data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Audiocapture_Prefix.pch +7 -0
  36. data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Classes/audioCapture.h +51 -0
  37. data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Classes/audioCapture.m +418 -0
  38. data/lib/extensions/audiocapture/ext/audiocapture/platform/iphone/Rakefile +79 -0
  39. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.sln +44 -0
  40. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.vcproj +647 -0
  41. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Audiocapture.vsprops +15 -0
  42. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/Rakefile +62 -0
  43. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/src/audiocapture_wm.cpp +40 -0
  44. data/lib/extensions/audiocapture/ext/audiocapture/platform/wm/src/audiocapture_wm.h +2 -0
  45. data/lib/extensions/audiocapture/ext/audiocapture/shared/ruby/audiocapture.i +29 -0
  46. data/lib/extensions/audiocapture/ext/audiocapture/shared/ruby/audiocapture_wrap.c +2310 -0
  47. data/lib/extensions/audiocapture/ext/audiocapture/shared/src/audiocapture.c +26 -0
  48. data/lib/extensions/audiocapture/ext/build +17 -0
  49. data/lib/extensions/audiocapture/ext/build.bat +36 -0
  50. data/lib/extensions/barcode/ext.yml +5 -3
  51. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +87 -87
  52. data/lib/extensions/digest-md5/ext/build +1 -1
  53. data/lib/extensions/digest-sha1/ext/build +1 -1
  54. data/lib/extensions/digest-sha2/ext/build +1 -1
  55. data/lib/extensions/digest/ext/build +1 -1
  56. data/lib/extensions/fcntl/ext/fcntl.c +5 -5
  57. data/lib/extensions/gcm-push/ext.yml +8 -0
  58. data/lib/extensions/gcm-push/ext/android/AndroidManifest.rb +5 -0
  59. data/lib/extensions/gcm-push/ext/android/ApplicationManifestAdds.erb +8 -0
  60. data/lib/extensions/gcm-push/ext/android/Rakefile +66 -0
  61. data/lib/extensions/gcm-push/ext/android/ext_build.files +3 -0
  62. data/lib/extensions/gcm-push/ext/android/jni/src/com_rhomobile_rhodes_gcm_GCMRhoListener.h +21 -0
  63. data/lib/extensions/gcm-push/ext/android/jni/src/gcmpushclient.cpp +173 -0
  64. data/lib/extensions/gcm-push/ext/android/jni/src/gcmpushclient.h +62 -0
  65. data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMBroadcastReceiver.java +40 -0
  66. data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMFacade.java +55 -0
  67. data/lib/extensions/gcm-push/ext/android/src/com/rhomobile/rhodes/gcm/GCMIntentService.java +60 -0
  68. data/lib/extensions/gcm-push/ext/build +12 -0
  69. data/lib/extensions/gcm-push/ext/build.bat +8 -0
  70. data/lib/extensions/net-http/net/http.rb +153 -119
  71. data/lib/extensions/net-http/net/https.rb +4 -38
  72. data/lib/extensions/nfc/ext.yml +6 -4
  73. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +2 -2
  74. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +0 -1
  75. data/lib/extensions/openssl/openssl/ssl-internal.rb +3 -1
  76. data/lib/extensions/rawsensors/ext.yml +4 -0
  77. data/lib/extensions/rawsensors/ext/build +17 -0
  78. data/lib/extensions/rawsensors/ext/build.bat +36 -0
  79. data/lib/extensions/rawsensors/ext/rawsensors/platform/android/Rakefile +77 -0
  80. data/lib/extensions/rawsensors/ext/rawsensors/platform/android/ext_build.files +1 -0
  81. data/lib/extensions/rawsensors/ext/rawsensors/platform/android/jni/src/rawsensors.cpp +180 -0
  82. data/lib/extensions/rawsensors/ext/rawsensors/platform/android/src/com/rawsensors/Rawsensors.java +355 -0
  83. data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/Rakefile +97 -0
  84. data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/Rawsensors.files +1 -0
  85. data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/rawsensors.jdp +48 -0
  86. data/lib/extensions/rawsensors/ext/rawsensors/platform/bb/src/com/rawsensors/Rawsensors.java +118 -0
  87. data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.h +66 -0
  88. data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Classes/RawSensors.m +351 -0
  89. data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rakefile +79 -0
  90. data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rawsensors.xcodeproj/project.pbxproj +316 -0
  91. data/lib/extensions/rawsensors/ext/rawsensors/platform/iphone/Rawsensors_Prefix.pch +7 -0
  92. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rakefile +62 -0
  93. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.sln +44 -0
  94. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.vcproj +647 -0
  95. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/Rawsensors.vsprops +15 -0
  96. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/src/rawsensors_wm.cpp +40 -0
  97. data/lib/extensions/rawsensors/ext/rawsensors/platform/wm/src/rawsensors_wm.h +2 -0
  98. data/lib/extensions/rawsensors/ext/rawsensors/shared/ruby/rawsensors.i +22 -0
  99. data/lib/extensions/rawsensors/ext/rawsensors/shared/ruby/rawsensors_wrap.c +2308 -0
  100. data/lib/extensions/rawsensors/ext/rawsensors/shared/src/rawsensors.c +25 -0
  101. data/lib/extensions/rawsensors/rawsensors.rb +36 -0
  102. data/lib/framework/autocomplete/AddressBar.rb +19 -0
  103. data/lib/framework/autocomplete/Alarm.rb +23 -0
  104. data/lib/framework/autocomplete/Alert.rb +19 -0
  105. data/lib/framework/autocomplete/AppApplication.rb +17 -0
  106. data/lib/framework/autocomplete/AppSwitcher.rb +13 -0
  107. data/lib/framework/autocomplete/Application.rb +23 -0
  108. data/lib/framework/autocomplete/AudioCapture.rb +31 -0
  109. data/lib/framework/autocomplete/BackButton.rb +25 -0
  110. data/lib/framework/autocomplete/Backlight.rb +21 -0
  111. data/lib/framework/autocomplete/Barcode.rb +29 -0
  112. data/lib/framework/autocomplete/BasicSocket.rb +87 -0
  113. data/lib/framework/autocomplete/Battery.rb +33 -0
  114. data/lib/framework/autocomplete/BottomCommandArea.rb +19 -0
  115. data/lib/framework/autocomplete/BrowserHelper.rb +19 -0
  116. data/lib/framework/autocomplete/Bsearch.rb +11 -0
  117. data/lib/framework/autocomplete/Camera.rb +17 -0
  118. data/lib/framework/autocomplete/CardReader.rb +29 -0
  119. data/lib/framework/autocomplete/Comm.rb +45 -0
  120. data/lib/framework/autocomplete/Cradle.rb +15 -0
  121. data/lib/framework/autocomplete/Date.rb +50 -0
  122. data/lib/framework/autocomplete/DateTime.rb +24 -0
  123. data/lib/framework/autocomplete/DateTimePicker.rb +15 -0
  124. data/lib/framework/autocomplete/Device.rb +19 -0
  125. data/lib/framework/autocomplete/Digest.rb +28 -0
  126. data/lib/framework/autocomplete/Dir.rb +63 -0
  127. data/lib/framework/autocomplete/Eink.rb +19 -0
  128. data/lib/framework/autocomplete/EmmlProfile.rb +19 -0
  129. data/lib/framework/autocomplete/File.rb +301 -0
  130. data/lib/framework/autocomplete/FileTransfer.rb +27 -0
  131. data/lib/framework/autocomplete/ForwardButton.rb +25 -0
  132. data/lib/framework/autocomplete/GeneratorController.rb +15 -0
  133. data/lib/framework/autocomplete/GeoLocation.rb +27 -0
  134. data/lib/framework/autocomplete/Gesture.rb +71 -0
  135. data/lib/framework/autocomplete/GoButton.rb +25 -0
  136. data/lib/framework/autocomplete/HashWithIndifferentAccess.rb +51 -0
  137. data/lib/framework/autocomplete/History.rb +11 -0
  138. data/lib/framework/autocomplete/HomeButton.rb +25 -0
  139. data/lib/framework/autocomplete/Hourglass.rb +17 -0
  140. data/lib/framework/autocomplete/IPSocket.rb +65 -0
  141. data/lib/framework/autocomplete/Imager.rb +53 -0
  142. data/lib/framework/autocomplete/IoAnalog.rb +73 -0
  143. data/lib/framework/autocomplete/IoDigital.rb +93 -0
  144. data/lib/framework/autocomplete/IoSystem.rb +21 -0
  145. data/lib/framework/autocomplete/JSON.rb +142 -0
  146. data/lib/framework/autocomplete/KeyCapture.rb +25 -0
  147. data/lib/framework/autocomplete/KeyState.rb +23 -0
  148. data/lib/framework/autocomplete/Keylight.rb +17 -0
  149. data/lib/framework/autocomplete/Lightsensor.rb +19 -0
  150. data/lib/framework/autocomplete/LocalizationSimplified.rb +33 -0
  151. data/lib/framework/autocomplete/MapView.rb +23 -0
  152. data/lib/framework/autocomplete/MediaPlayer.rb +19 -0
  153. data/lib/framework/autocomplete/Memory.rb +17 -0
  154. data/lib/framework/autocomplete/MinimizeButton.rb +25 -0
  155. data/lib/framework/autocomplete/NativeBar.rb +31 -0
  156. data/lib/framework/autocomplete/NavBar.rb +15 -0
  157. data/lib/framework/autocomplete/Network.rb +31 -0
  158. data/lib/framework/autocomplete/Notification.rb +35 -0
  159. data/lib/framework/autocomplete/OpenSSL.rb +440 -0
  160. data/lib/framework/autocomplete/Phonebook.rb +39 -0
  161. data/lib/framework/autocomplete/PowerOn.rb +13 -0
  162. data/lib/framework/autocomplete/Push.rb +27 -0
  163. data/lib/framework/autocomplete/QuitButton.rb +25 -0
  164. data/lib/framework/autocomplete/RHO_APPS_DIR.rb +8 -0
  165. data/lib/framework/autocomplete/RHO_ERB_EXT.rb +8 -0
  166. data/lib/framework/autocomplete/RHO_FRAMEWORK.rb +0 -0
  167. data/lib/framework/autocomplete/RHO_RB_EXT.rb +8 -0
  168. data/lib/framework/autocomplete/RawSensors.rb +53 -0
  169. data/lib/framework/autocomplete/Reboot.rb +13 -0
  170. data/lib/framework/autocomplete/Registry.rb +25 -0
  171. data/lib/framework/autocomplete/ReloadButton.rb +25 -0
  172. data/lib/framework/autocomplete/Rfid.rb +173 -0
  173. data/lib/framework/autocomplete/Rho.rb +496 -0
  174. data/lib/framework/autocomplete/RhoBluetooth.rb +41 -0
  175. data/lib/framework/autocomplete/RhoConf.rb +23 -0
  176. data/lib/framework/autocomplete/RhoElementsExt.rb +11 -0
  177. data/lib/framework/autocomplete/RhoLog.rb +13 -0
  178. data/lib/framework/autocomplete/RhoProfiler.rb +21 -0
  179. data/lib/framework/autocomplete/RhoStdout.rb +19 -0
  180. data/lib/framework/autocomplete/Rhodes.rb +13 -0
  181. data/lib/framework/autocomplete/RhodesNativeViewManager.rb +15 -0
  182. data/lib/framework/autocomplete/Rhom.rb +198 -0
  183. data/lib/framework/autocomplete/Rsm.rb +135 -0
  184. data/lib/framework/autocomplete/SQLite3.rb +36 -0
  185. data/lib/framework/autocomplete/SWIG.rb +24 -0
  186. data/lib/framework/autocomplete/ScanError.rb +9 -0
  187. data/lib/framework/autocomplete/Scanner.rb +379 -0
  188. data/lib/framework/autocomplete/ScreenOrientation.rb +23 -0
  189. data/lib/framework/autocomplete/SignatureCapture.rb +47 -0
  190. data/lib/framework/autocomplete/SignatureTool.rb +11 -0
  191. data/lib/framework/autocomplete/Sip.rb +19 -0
  192. data/lib/framework/autocomplete/SipButton.rb +25 -0
  193. data/lib/framework/autocomplete/Sntp.rb +13 -0
  194. data/lib/framework/autocomplete/Socket.rb +356 -0
  195. data/lib/framework/autocomplete/SocketError.rb +9 -0
  196. data/lib/framework/autocomplete/StopButton.rb +25 -0
  197. data/lib/framework/autocomplete/StringIO.rb +139 -0
  198. data/lib/framework/autocomplete/StringScanner.rb +102 -0
  199. data/lib/framework/autocomplete/Stylus.rb +15 -0
  200. data/lib/framework/autocomplete/SyncEngine.rb +77 -0
  201. data/lib/framework/autocomplete/System.rb +79 -0
  202. data/lib/framework/autocomplete/SystemTime.rb +17 -0
  203. data/lib/framework/autocomplete/TCPServer.rb +65 -0
  204. data/lib/framework/autocomplete/TCPSocket.rb +59 -0
  205. data/lib/framework/autocomplete/Telemetry.rb +23 -0
  206. data/lib/framework/autocomplete/Thread.rb +85 -0
  207. data/lib/framework/autocomplete/Time.rb +167 -0
  208. data/lib/framework/autocomplete/Timer.rb +19 -0
  209. data/lib/framework/autocomplete/TopCommandArea.rb +19 -0
  210. data/lib/framework/autocomplete/UDPSocket.rb +65 -0
  211. data/lib/framework/autocomplete/VideoCapture.rb +29 -0
  212. data/lib/framework/autocomplete/Volume.rb +13 -0
  213. data/lib/framework/autocomplete/Wake.rb +15 -0
  214. data/lib/framework/autocomplete/WebView.rb +31 -0
  215. data/lib/framework/autocomplete/Wlan.rb +87 -0
  216. data/lib/framework/autocomplete/Zoom.rb +15 -0
  217. data/lib/framework/autocomplete/ZoomInPageButton.rb +25 -0
  218. data/lib/framework/autocomplete/ZoomOutPageButton.rb +25 -0
  219. data/lib/framework/autocomplete/ZoomTextButton.rb +25 -0
  220. data/lib/framework/rho/render.rb +15 -4
  221. data/lib/framework/rho/rho.rb +17 -8
  222. data/lib/framework/rho/rhoapplication.rb +25 -3
  223. data/lib/framework/rho/rhocontact.rb +13 -0
  224. data/lib/framework/rho/rhoevent.rb +15 -0
  225. data/lib/framework/rho/rhonativeviewmanager.rb +3 -3
  226. data/lib/framework/rhodes.rb +1 -1
  227. data/lib/framework/rhom/rhom.rb +5 -0
  228. data/lib/framework/rhomotoapi.rb +2 -1
  229. data/lib/framework/version.rb +1 -1
  230. data/lib/rhodes.rb +1 -1
  231. data/platform/android/Rhodes/AndroidManifest.xml +4 -3
  232. data/platform/android/Rhodes/AndroidManifest.xml.erb +7 -7
  233. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +22 -0
  234. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +1 -9
  235. data/platform/android/Rhodes/jni/src/callbacks.cpp +2 -0
  236. data/platform/android/Rhodes/jni/src/camera.cpp +5 -0
  237. data/platform/android/Rhodes/jni/src/event.cpp +10 -0
  238. data/platform/android/Rhodes/jni/src/geolocation.cpp +10 -0
  239. data/platform/android/Rhodes/jni/src/logger.cpp +3 -1
  240. data/platform/android/Rhodes/jni/src/phonebook.cpp +11 -0
  241. data/platform/android/Rhodes/jni/src/rhodes.cpp +1 -1
  242. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +41 -25
  243. data/platform/android/Rhodes/jni/src/signature.cpp +7 -6
  244. data/platform/android/Rhodes/jni/src/webview.cpp +29 -0
  245. data/platform/android/Rhodes/project.properties +1 -1
  246. data/platform/android/Rhodes/res/drawable/icon.png +0 -0
  247. data/platform/android/Rhodes/src/com/rhomobile/rhodes/ConnectionChangeReceiver.java +28 -0
  248. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +1 -1
  249. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushContract.java +102 -0
  250. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +20 -56
  251. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +9 -124
  252. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +114 -126
  253. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +26 -0
  254. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +3 -5
  255. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +31 -13
  256. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +2 -0
  257. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +3 -7
  258. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProvider.java +19 -0
  259. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProviderFroyo.java +5 -0
  260. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/CalendarIDsProviderICS.java +22 -0
  261. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +32 -22
  262. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +5 -0
  263. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoListener.java +34 -0
  264. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +11 -2
  265. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +1 -0
  266. data/platform/android/Rhodes/src/com/rhomobile/rhodes/{webview → extmanager}/IRhoWebView.java +5 -1
  267. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +605 -492
  268. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +16 -0
  269. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +9 -2
  270. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +43 -14
  271. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +82 -64
  272. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +28 -13
  273. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +4 -4
  274. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +0 -1
  275. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +4 -0
  276. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +6 -0
  277. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +7 -0
  278. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality12.java +6 -0
  279. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality13.java +6 -0
  280. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality14.java +12 -0
  281. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +10 -1
  282. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +3 -6
  283. data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/RhoSocketImpl.java +1 -1
  284. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +1 -1
  285. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +43 -0
  286. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebChromeClient.java +5 -0
  287. data/platform/android/build/RhodesSRC_build.files +10 -4
  288. data/platform/android/build/android.rake +46 -193
  289. data/platform/android/build/android_tools.rb +181 -13
  290. data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +3 -3
  291. data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +4 -2
  292. data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -0
  293. data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +6 -0
  294. data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +13 -8
  295. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +103 -1
  296. data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +18 -0
  297. data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +9 -2
  298. data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +16 -11
  299. data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +25 -3
  300. data/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java +1 -1
  301. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +122 -32
  302. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +44 -14
  303. data/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java +3 -2
  304. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +340 -88
  305. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +62 -15
  306. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/AttrReader.java +1 -1
  307. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyFixnum.java +3 -1
  308. data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyHash.java +1 -1
  309. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +19 -1
  310. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyBasic.java +9 -0
  311. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyBinding.java +4 -4
  312. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyModule.java +13 -1
  313. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyObject.java +16 -1
  314. data/platform/bb/build/bb.rake +3 -1
  315. data/platform/bb/build/rhodes_build.files +0 -1
  316. data/platform/bb/rhodes/platform/4.7/com/rho/rubyext/SignatureCapture.java +13 -18
  317. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +13 -3
  318. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +1 -1
  319. data/platform/bb/rhodes/platform/common/com/rho/rubyext/SignatureCapture.java +13 -18
  320. data/platform/bb/rhodes/resources/icon.png +0 -0
  321. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +10 -0
  322. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +13 -3
  323. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +5 -0
  324. data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +1 -1
  325. data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +6 -1
  326. data/platform/bb/rhodes/src/com/rho/file/Jsr75RAFileImpl.java +6 -1
  327. data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +38 -9
  328. data/platform/bb/rhodes/src/com/rho/rubyext/SignatureCapture.java +13 -18
  329. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +16 -1
  330. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +0 -20
  331. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +1 -10
  332. data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +40 -35
  333. data/platform/iphone/Classes/AppManager/AppManager.h +1 -1
  334. data/platform/iphone/Classes/AppManager/AppManager.m +46 -29
  335. data/platform/iphone/Classes/Camera/PickImageDelegate.m +9 -0
  336. data/platform/iphone/Classes/Event/Event.h +6 -1
  337. data/platform/iphone/Classes/Event/Event.m +67 -1
  338. data/platform/iphone/Classes/GeoLocation/LocationController.h +2 -1
  339. data/platform/iphone/Classes/GeoLocation/LocationController.m +17 -1
  340. data/platform/iphone/Classes/NetworkStatusMonitor.h +17 -0
  341. data/platform/iphone/Classes/NetworkStatusMonitor.mm +58 -0
  342. data/platform/iphone/Classes/Phonebook/phonebook.h +6 -0
  343. data/platform/iphone/Classes/Phonebook/phonebook.m +62 -6
  344. data/platform/iphone/Classes/Reachability.h +31 -0
  345. data/platform/iphone/Classes/Reachability.m +223 -0
  346. data/platform/iphone/Classes/RhoMainView.h +1 -0
  347. data/platform/iphone/Classes/RhoViewController.m +16 -0
  348. data/platform/iphone/Classes/Rhodes.h +2 -0
  349. data/platform/iphone/Classes/Rhodes.m +89 -10
  350. data/platform/iphone/Classes/Signature/SignatureDelegate.m +4 -7
  351. data/platform/iphone/Classes/SimpleMainView.m +16 -0
  352. data/platform/iphone/Classes/SplashViewController.m +11 -1
  353. data/platform/iphone/Classes/SplitView/RightViewController.m +6 -0
  354. data/platform/iphone/Classes/SplitView/SplittedMainView.m +5 -0
  355. data/platform/iphone/Classes/TabbedMainView.m +4 -0
  356. data/platform/iphone/Classes/WebView.m +14 -0
  357. data/platform/iphone/Info.plist +1 -6
  358. data/platform/iphone/iTunesArtwork.jpg +0 -0
  359. data/platform/iphone/icon.png +0 -0
  360. data/platform/iphone/icon114.png +0 -0
  361. data/platform/iphone/icon57.png +0 -0
  362. data/platform/iphone/icon72.png +0 -0
  363. data/platform/iphone/rbuild/iphone.rake +8 -11
  364. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +20 -4
  365. data/platform/osx/Rhodes Launcher/rhorunner.app/icon.png +0 -0
  366. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
  367. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
  368. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
  369. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
  370. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
  371. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  372. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
  373. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
  374. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
  375. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
  376. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
  377. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
  378. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
  379. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
  380. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
  381. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
  382. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
  383. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
  384. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtga.dylib +0 -0
  385. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
  386. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_inspector.dylib +0 -0
  387. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
  388. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/rho.icns +0 -0
  389. data/platform/shared/common/ExtManager.h +8 -0
  390. data/platform/shared/common/RhoDefs.h +3 -2
  391. data/platform/shared/common/RhoFile.cpp +14 -1
  392. data/platform/shared/common/RhoMutexLock.h +4 -0
  393. data/platform/shared/common/RhoPort.h +5 -1
  394. data/platform/shared/common/RhoStd.h +12 -0
  395. data/platform/shared/common/RhoThread.cpp +1 -2
  396. data/platform/shared/common/RhoTime.h +4 -0
  397. data/platform/shared/common/RhodesApp.cpp +189 -65
  398. data/platform/shared/common/RhodesApp.h +60 -7
  399. data/platform/shared/common/RhodesAppBase.cpp +2 -8
  400. data/platform/shared/common/RhodesAppBase.h +1 -0
  401. data/platform/shared/common/ThreadQueue.cpp +2 -2
  402. data/platform/shared/common/app_build_configs.c +3 -1
  403. data/platform/shared/common/map/MapEngine.cpp +39 -3
  404. data/platform/shared/common/push/IRhoPushClient.h +3 -3
  405. data/platform/shared/common/push/RhoPushManager.cpp +31 -53
  406. data/platform/shared/common/push/RhoPushManager.h +12 -26
  407. data/platform/shared/curl/lib/curl_config.h +1 -1
  408. data/platform/shared/json/RJSONTokener.c +3 -1
  409. data/platform/shared/json/config.h +4 -4
  410. data/platform/shared/json/json_tokener.c +1 -1
  411. data/platform/shared/logging/RhoLog.cpp +5 -5
  412. data/platform/shared/logging/RhoLogConf.cpp +4 -6
  413. data/platform/shared/logging/RhoLogConf.h +2 -2
  414. data/platform/shared/logging/RhoLogSink.cpp +2 -0
  415. data/platform/shared/net/HttpServer.cpp +54 -7
  416. data/platform/shared/net/HttpServer.h +2 -0
  417. data/platform/shared/qt/rhodes/QtMainWindow.cpp +22 -0
  418. data/platform/shared/qt/rhodes/QtMainWindow.h +1 -0
  419. data/platform/shared/qt/rhodes/impl/CalendarImpl.cpp +4 -0
  420. data/platform/shared/qt/rhodes/impl/CameraImpl.cpp +4 -0
  421. data/platform/shared/qt/rhodes/impl/GeoLocationImpl.cpp +6 -0
  422. data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +7 -0
  423. data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +2 -0
  424. data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +4 -0
  425. data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +5 -0
  426. data/platform/shared/qt/rhodes/impl/WebViewImpl.cpp +12 -0
  427. data/platform/shared/qt/rhodes/main.cpp +0 -7
  428. data/platform/shared/qt/rhodes/resources/rho.icns +0 -0
  429. data/platform/shared/qt/rhodes/resources/rho.ico +0 -0
  430. data/platform/shared/qt/rhodes/resources/rho.png +0 -0
  431. data/platform/shared/ruby/encoding.c +4 -0
  432. data/platform/shared/ruby/ext/calendar/calendar.i +3 -0
  433. data/platform/shared/ruby/ext/calendar/calendar_wrap.c +19 -0
  434. data/platform/shared/ruby/ext/camera/camera.i +2 -0
  435. data/platform/shared/ruby/ext/camera/camera_wrap.c +43 -2
  436. data/platform/shared/ruby/ext/geolocation/geolocation.i +4 -0
  437. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +24 -4
  438. data/platform/shared/ruby/ext/phonebook/phonebook.i +4 -0
  439. data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +44 -0
  440. data/platform/shared/ruby/ext/rho/extensions.c +0 -2
  441. data/platform/shared/ruby/ext/rho/rhoruby.c +2 -0
  442. data/platform/shared/ruby/ext/rho/rhosupport.c +8 -0
  443. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +1 -1
  444. data/platform/shared/ruby/ext/syncengine/syncengine.i +6 -2
  445. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +19 -6
  446. data/platform/shared/ruby/ext/system/system.i +22 -0
  447. data/platform/shared/ruby/ext/system/system_wrap.c +158 -86
  448. data/platform/shared/ruby/ext/webview/webview.i +13 -8
  449. data/platform/shared/ruby/ext/webview/webview_wrap.c +88 -2
  450. data/platform/shared/ruby/include/ruby/win32.h +3 -1
  451. data/platform/shared/ruby/iphone/ruby/config.h +3 -3
  452. data/platform/shared/ruby/missing/hypot.c +4 -0
  453. data/platform/shared/ruby/random.c +6 -2
  454. data/platform/shared/ruby/thread_win32.c +8 -3
  455. data/platform/shared/ruby/win32/ruby/config.h +0 -3
  456. data/platform/shared/ruby/win32/win32.c +4 -0
  457. data/platform/shared/ruby/wp8/assert.c +12 -0
  458. data/platform/shared/ruby/wp8/assert.h +18 -0
  459. data/platform/shared/ruby/wp8/errno.c +11 -0
  460. data/platform/shared/ruby/wp8/errno.h +59 -0
  461. data/platform/shared/ruby/wp8/missing_wp8.h +74 -0
  462. data/platform/shared/ruby/wp8/signal.h +71 -0
  463. data/platform/shared/ruby/wp8/signal_wp8.c +26 -0
  464. data/platform/shared/ruby/wp8/stdio.c +36 -0
  465. data/platform/shared/ruby/wp8/stdlib.c +61 -0
  466. data/platform/shared/ruby/wp8/string_wp8.c +89 -0
  467. data/platform/shared/ruby/wp8/sys/stat.c +183 -0
  468. data/platform/shared/ruby/wp8/sys/stat.h +70 -0
  469. data/platform/shared/ruby/wp8/sys/timeb.c +31 -0
  470. data/platform/shared/ruby/wp8/sys/timeb.h +27 -0
  471. data/platform/shared/ruby/wp8/sys/types.h +62 -0
  472. data/platform/shared/ruby/wp8/sys/utime.c +44 -0
  473. data/platform/shared/ruby/wp8/sys/utime.h +27 -0
  474. data/platform/shared/ruby/wp8/time_wp8.c +256 -0
  475. data/platform/shared/ruby/wp8/varargs.h +34 -0
  476. data/platform/shared/ruby/wp8/win32/win32.c +5783 -0
  477. data/platform/shared/ruby/wp8/winsock_wp8.c +26 -0
  478. data/platform/shared/ruby/wp8/winsock_wp8.h +23 -0
  479. data/platform/shared/ruby/wp8/wp8.c +516 -0
  480. data/platform/shared/ruby/wp8/wp8.h +274 -0
  481. data/platform/shared/ruby/wp8/wp8main.c +18 -0
  482. data/platform/shared/rubyext/GeoLocation.cpp +1 -1
  483. data/platform/shared/rubyext/System.cpp +18 -4
  484. data/platform/shared/rubyext/ZipFiles.cpp +1 -1
  485. data/platform/shared/sync/ClientRegister.cpp +113 -23
  486. data/platform/shared/sync/ClientRegister.h +27 -16
  487. data/platform/shared/sync/ILoginListener.h +44 -0
  488. data/platform/shared/sync/SyncEngine.cpp +50 -24
  489. data/platform/shared/sync/SyncEngine.h +11 -5
  490. data/platform/shared/sync/SyncSource.cpp +87 -61
  491. data/platform/shared/sync/SyncSource.h +6 -3
  492. data/platform/shared/sync/SyncThread.cpp +8 -15
  493. data/platform/shared/sync/SyncThread.h +13 -7
  494. data/platform/shared/unzip/unzip.cpp +1 -1
  495. data/platform/shared/unzip/zip.h +8 -1
  496. data/platform/shared/xruby/src/com/xruby/runtime/builtin/AttrReader.java +13 -0
  497. data/platform/shared/xruby/src/com/xruby/runtime/builtin/RubyFixnum.java +3 -1
  498. data/platform/shared/xruby/src/com/xruby/runtime/lang/MethodBlockBase.java +9 -0
  499. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyBasic.java +9 -0
  500. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyBinding.java +17 -0
  501. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyMethod.java +22 -2
  502. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyModule.java +25 -0
  503. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyObject.java +21 -0
  504. data/platform/shared/xruby/src/com/xruby/runtime/lang/RubyValue.java +8 -0
  505. data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +6 -0
  506. data/platform/win32/RhoSimulator/Microsoft.VC90.CRT.manifest +12 -5
  507. data/platform/win32/RhoSimulator/Microsoft.VC90.OpenMP.manifest +12 -5
  508. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  509. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  510. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  511. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  512. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  513. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  514. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  515. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  516. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  517. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  518. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  519. data/platform/win32/RhoSimulator/msvcm90.dll +0 -0
  520. data/platform/win32/RhoSimulator/msvcp90.dll +0 -0
  521. data/platform/win32/RhoSimulator/msvcr90.dll +0 -0
  522. data/platform/win32/RhoSimulator/phonon4.dll +0 -0
  523. data/platform/win32/RhoSimulator/vcomp90.dll +0 -0
  524. data/platform/wm/build/wm.rake +67 -22
  525. data/platform/wm/rhodes.sln +485 -493
  526. data/platform/wm/rhodes/IEBrowserEngine.cpp +2 -6
  527. data/platform/wm/rhodes/MainWindow.cpp +86 -35
  528. data/platform/wm/rhodes/MainWindow.h +33 -0
  529. data/platform/wm/rhodes/Rhodes.cpp +288 -215
  530. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +22 -17
  531. data/platform/wm/rhodes/bluetooth/Bluetooth.h +3 -3
  532. data/platform/wm/rhodes/camera/Camera.cpp +4 -0
  533. data/platform/wm/rhodes/camera/Camera.h +1 -0
  534. data/platform/wm/rhodes/phonebook/phonebook.cpp +9 -0
  535. data/platform/wm/rhodes/phonebook/phonebook.h +2 -0
  536. data/platform/wm/rhodes/resources/icon.ico +0 -0
  537. data/platform/wm/rhodes/rho/common/ExtManager.cpp +5 -1
  538. data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +1 -11
  539. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +5 -0
  540. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +21 -2
  541. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +12 -0
  542. data/platform/wm/rhodes/rho/rubyext/calendar.cpp +9 -0
  543. data/platform/wm/rhodes/rhodes.vcproj +60 -60
  544. data/platform/wm/rhodes/simulator/MainWindowQt.cpp +91 -6
  545. data/platform/wm/rhodes/simulator/MainWindowQt.h +6 -0
  546. data/platform/wm/rhoelements.sln +624 -623
  547. data/platform/wm/tcmalloc/tcmalloc.vcproj +1230 -1070
  548. data/platform/wp7/RhoRubyLib/rubyext/RhoCamera.cs +6 -3
  549. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +5 -0
  550. data/platform/wp7/rhodes/icon.png +0 -0
  551. data/platform/wp8/RhoAppRunner/Program.cs +99 -0
  552. data/platform/wp8/RhoAppRunner/Properties/AssemblyInfo.cs +36 -0
  553. data/platform/wp8/RhoAppRunner/RhoAppRunner.csproj +69 -0
  554. data/platform/wp8/build/wp.rake +486 -0
  555. data/platform/wp8/rhodes.sln +154 -0
  556. data/platform/wp8/rhodes/App.xaml +20 -0
  557. data/platform/wp8/rhodes/App.xaml.cs +189 -0
  558. data/platform/wp8/rhodes/Assets/ApplicationIcon.png +0 -0
  559. data/platform/wp8/rhodes/Assets/Tiles/FlipCycleTileMedium.png +0 -0
  560. data/platform/wp8/rhodes/Assets/Tiles/FlipCycleTileSmall.png +0 -0
  561. data/platform/wp8/rhodes/LocalizedStrings.cs +37 -0
  562. data/platform/wp8/rhodes/MainPage.xaml +21 -0
  563. data/platform/wp8/rhodes/MainPage.xaml.cs +339 -0
  564. data/platform/wp8/rhodes/Properties/AppManifest.xml +6 -0
  565. data/platform/wp8/rhodes/Properties/AssemblyInfo.cs +37 -0
  566. data/platform/wp8/rhodes/Properties/WMAppManifest.xml +47 -0
  567. data/platform/wp8/rhodes/Resources/AppResources.Designer.cs +127 -0
  568. data/platform/wp8/rhodes/Resources/AppResources.resx +135 -0
  569. data/platform/wp8/rhodes/common/IInputStream.cs +47 -0
  570. data/platform/wp8/rhodes/common/RhoFile.cs +374 -0
  571. data/platform/wp8/rhodes/common/RhoFilePath.cs +115 -0
  572. data/platform/wp8/rhodes/common/RhoResourceMap.cs +92 -0
  573. data/platform/wp8/rhodes/common/RhoStd.cs +237 -0
  574. data/platform/wp8/rhodes/icon.png +0 -0
  575. data/platform/wp8/rhodes/rhodes.csproj +198 -0
  576. data/platform/wp8/rholib/rholib.vcxproj +240 -0
  577. data/platform/wp8/rholib/rholib.vcxproj.filters +289 -0
  578. data/platform/wp8/rhoruntime/FakeDefs.cpp +134 -0
  579. data/platform/wp8/rhoruntime/common/ExtManager.cpp +449 -0
  580. data/platform/wp8/rhoruntime/common/RhoClassFactory.cpp +58 -0
  581. data/platform/wp8/rhoruntime/common/RhoClassFactory.h +60 -0
  582. data/platform/wp8/rhoruntime/common/RhoCryptImpl.cpp +274 -0
  583. data/platform/wp8/rhoruntime/common/RhoCryptImpl.h +78 -0
  584. data/platform/wp8/rhoruntime/common/RhoThreadImpl.cpp +109 -0
  585. data/platform/wp8/rhoruntime/common/RhoThreadImpl.h +56 -0
  586. data/platform/wp8/rhoruntime/pch_rhoruntime.cpp +27 -0
  587. data/platform/wp8/rhoruntime/pch_rhoruntime.h +30 -0
  588. data/platform/wp8/rhoruntime/rhoruntime.cpp +93 -0
  589. data/platform/wp8/rhoruntime/rhoruntime.h +114 -0
  590. data/platform/wp8/rhoruntime/rhoruntime.vcxproj +175 -0
  591. data/platform/wp8/rhoruntime/rhoruntime.vcxproj.filters +44 -0
  592. data/platform/wp8/rubylib/file.c +5459 -0
  593. data/platform/wp8/rubylib/rubylib.vcxproj +286 -0
  594. data/platform/wp8/rubylib/rubylib.vcxproj.filters +307 -0
  595. data/platform/wp8/sqlite3/crypto.c +933 -0
  596. data/platform/wp8/sqlite3/sqlite3.c +136332 -0
  597. data/platform/wp8/sqlite3/sqlite3.vcxproj +149 -0
  598. data/platform/wp8/sqlite3/sqlite3.vcxproj.filters +16 -0
  599. data/platform/wp8/syncengine/syncengine.vcxproj +199 -0
  600. data/platform/wp8/syncengine/syncengine.vcxproj.filters +155 -0
  601. data/rakefile.rb +61 -9
  602. data/res/build-tools/RhoAppRunnerWP8.exe +0 -0
  603. data/res/build-tools/license_rc.dll +0 -0
  604. data/res/build-tools/win32/license_rc.dll +0 -0
  605. data/res/build-tools/xruby-0.3.3.jar +0 -0
  606. data/res/generators/rhogen.rb +36 -0
  607. data/res/generators/templates/application/app/loading-568h@2x.png +0 -0
  608. data/res/generators/templates/application/app/loading-Landscape.png +0 -0
  609. data/res/generators/templates/application/app/loading-LandscapeLeft.png +0 -0
  610. data/res/generators/templates/application/app/loading-LandscapeRight.png +0 -0
  611. data/res/generators/templates/application/app/loading-Portrait.png +0 -0
  612. data/res/generators/templates/application/app/loading-PortraitUpsideDown.png +0 -0
  613. data/res/generators/templates/application/app/loading.png +0 -0
  614. data/res/generators/templates/application/app/loading@2x.png +0 -0
  615. data/res/generators/templates/application/icon/icon.ico +0 -0
  616. data/res/generators/templates/application/icon/icon.png +0 -0
  617. data/res/generators/templates/application/icon/icon114.png +0 -0
  618. data/res/generators/templates/application/icon/icon57.png +0 -0
  619. data/res/generators/templates/application/icon/icon72.png +0 -0
  620. data/res/generators/templates/application/public/css/android.css +1 -1
  621. data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
  622. data/res/generators/templates/application/rhoconfig.txt +3 -1
  623. data/res/generators/templates/model/model.rb +1 -1
  624. data/res/icons/rho.icns +0 -0
  625. data/res/icons/rho.ico +0 -0
  626. data/res/icons/rho.png +0 -0
  627. data/res/icons/rhodes.icns +0 -0
  628. data/res/icons/rhodes.ico +0 -0
  629. data/res/icons/rhodes.png +0 -0
  630. data/res/icons/rhosim.icns +0 -0
  631. data/res/icons/rhosim.ico +0 -0
  632. data/res/icons/rhosim.png +0 -0
  633. data/res/libs/motorolalicence/android/MotorolaLicence.h +2 -1
  634. data/res/libs/motorolalicence/android/libMotorolaLicence.a +0 -0
  635. data/res/libs/motorolalicence/iphone/MotorolaLicence.h +2 -1
  636. data/res/libs/motorolalicence/iphone/libMotorolaLicence.a +0 -0
  637. data/spec/autocomplete_generator/Rakefile +37 -0
  638. data/spec/autocomplete_generator/app/Generator/controller.rb +40 -0
  639. data/spec/autocomplete_generator/app/Generator/generator.rb +236 -0
  640. data/spec/autocomplete_generator/app/Generator/index.erb +21 -0
  641. data/spec/autocomplete_generator/app/Settings/controller.rb +117 -0
  642. data/spec/autocomplete_generator/app/Settings/err_sync.erb +11 -0
  643. data/spec/autocomplete_generator/app/Settings/home.bb.erb +18 -0
  644. data/spec/autocomplete_generator/app/Settings/home.erb +19 -0
  645. data/spec/autocomplete_generator/app/Settings/index.bb.erb +31 -0
  646. data/spec/autocomplete_generator/app/Settings/index.erb +31 -0
  647. data/spec/autocomplete_generator/app/Settings/login.bb.erb +29 -0
  648. data/spec/autocomplete_generator/app/Settings/login.erb +25 -0
  649. data/spec/autocomplete_generator/app/Settings/reset.bb.erb +16 -0
  650. data/spec/autocomplete_generator/app/Settings/reset.erb +14 -0
  651. data/spec/autocomplete_generator/app/Settings/wait.bb.erb +10 -0
  652. data/spec/autocomplete_generator/app/Settings/wait.erb +10 -0
  653. data/spec/autocomplete_generator/app/application.rb +16 -0
  654. data/spec/autocomplete_generator/app/helpers/application_helper.rb +129 -0
  655. data/spec/autocomplete_generator/app/helpers/browser_helper.rb +22 -0
  656. data/spec/autocomplete_generator/app/index.bb.erb +21 -0
  657. data/spec/autocomplete_generator/app/index.erb +24 -0
  658. data/spec/autocomplete_generator/app/layout.erb +94 -0
  659. data/spec/autocomplete_generator/app/loading.html +11 -0
  660. data/spec/autocomplete_generator/build.yml +41 -0
  661. data/spec/autocomplete_generator/icon/icon.ico +0 -0
  662. data/spec/autocomplete_generator/icon/icon.png +0 -0
  663. data/spec/autocomplete_generator/icon/icon.svg +5334 -0
  664. data/spec/autocomplete_generator/icon/icon114.png +0 -0
  665. data/spec/autocomplete_generator/icon/icon57.png +0 -0
  666. data/spec/autocomplete_generator/icon/icon72.png +0 -0
  667. data/spec/autocomplete_generator/readme.txt +1 -0
  668. data/spec/autocomplete_generator/rhoconfig.txt +88 -0
  669. data/spec/autocomplete_generator/rhosimulator/Databases/Databases.db +0 -0
  670. data/spec/autocomplete_generator/rhosimulator/WebpageIcons.db +0 -0
  671. data/spec/autocomplete_generator/rhosimulator/db/syncdbuser.sqlite +0 -0
  672. data/spec/autocomplete_generator/rhosimulator/db/syncdbuser.sqlite.version +1 -0
  673. data/spec/autocomplete_generator/rhosimulator/rholog.txt_pos +1 -0
  674. data/spec/autocomplete_generator/rhosimulator/rhosimconfig.txt +8 -0
  675. data/spec/framework_spec/app/spec/rhomobile/NetHttp_spec.rb +22 -0
  676. data/spec/framework_spec/app/spec_runner.rb +12 -0
  677. data/spec/framework_spec/icon/icon.ico +0 -0
  678. data/spec/framework_spec/icon/icon.png +0 -0
  679. data/spec/perfomance_spec/icon/icon.ico +0 -0
  680. data/spec/perfomance_spec/icon/icon.png +0 -0
  681. data/spec/phone_spec/app/BlobBulkTest/blob_bulk_test.png +0 -0
  682. data/spec/phone_spec/app/BlobBulkTest_s/blob_bulk_test_s.png +0 -0
  683. data/spec/phone_spec/app/PartialTest/_index_partial.erb +5 -0
  684. data/spec/phone_spec/app/PartialTest/_index_partial_nested.erb +2 -0
  685. data/spec/phone_spec/app/PartialTest/index.erb +6 -0
  686. data/spec/phone_spec/app/spec/blob_bulksync_spec.rb +5 -3
  687. data/spec/phone_spec/app/spec/bulksync_spec.rb +33 -41
  688. data/spec/phone_spec/app/spec/database_spec.rb +5 -0
  689. data/spec/phone_spec/app/spec/json_spec.rb +50 -50
  690. data/spec/phone_spec/app/spec/rho_controller_spec.rb +29 -0
  691. data/spec/phone_spec/app/spec/syncengine_spec.rb +184 -47
  692. data/spec/phone_spec/app/spec_runner.rb +3 -2
  693. data/spec/phone_spec/icon/icon.ico +0 -0
  694. data/spec/phone_spec/icon/icon.png +0 -0
  695. data/spec/phone_spec/rhoconfig.txt +2 -0
  696. data/version +1 -1
  697. metadata +339 -47
  698. data/platform/android/Rhodes/PushReceiver.erb +0 -14
  699. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +0 -126
  700. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +0 -83
  701. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/Config.java +0 -246
  702. data/platform/bb/rhodes/src/com/rho/rubyext/PNGEncoder.java +0 -613
  703. data/res/icons/rho.psd +0 -0
  704. data/res/icons/rhodes.psd +0 -0
  705. data/res/icons/rhosim.psd +0 -0
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="windows-1251"?>
2
+ <VisualStudioPropertySheet
3
+ ProjectType="Visual C++"
4
+ Version="8.00"
5
+ Name="emmlapi"
6
+ >
7
+ <UserMacro
8
+ Name="RHO_ROOT_DEMO"
9
+ Value="c:\projects\rhodes"
10
+ />
11
+ <UserMacro
12
+ Name="TEMP_FILES_DIR_DEMO"
13
+ Value="$(RHO_ROOT)\platform\wm\bin\$(PlatformName)\rhodes"
14
+ />
15
+ </VisualStudioPropertySheet>
@@ -0,0 +1,40 @@
1
+ #include <common/RhodesApp.h>
2
+ #include <logging/RhoLogConf.h>
3
+
4
+ #include <stdlib.h>
5
+ #include <windows.h>
6
+ #include <commctrl.h>
7
+
8
+ #include <RhoNativeViewManager.h>
9
+ #include "rubyext/WebView.h"
10
+
11
+ #include "ruby/ext/rho/rhoruby.h"
12
+
13
+ #include "rawsensors_wm.h"
14
+
15
+
16
+ extern "C" VALUE rawsensors_native_process_string(const char* str) {
17
+
18
+ const char block[] = "<WM>";
19
+ char* buf = NULL;
20
+ buf = (char*)malloc(strlen(str) + strlen(block)*2 + 1);
21
+
22
+ strcpy(buf, block);
23
+ strcat(buf, str);
24
+ strcat(buf, block);
25
+
26
+ VALUE result = rho_ruby_create_string(buf);
27
+
28
+ free(buf);
29
+
30
+ return result;
31
+ }
32
+
33
+
34
+ extern "C" int rawsensors_calc_summ(int x, int y) {
35
+ return (x+y);
36
+ }
37
+
38
+
39
+
40
+
@@ -0,0 +1,22 @@
1
+ /* rawsensors.i */
2
+ %module RawSensorsNative
3
+ %{
4
+ #include "ruby/ext/rho/rhoruby.h"
5
+
6
+ extern VALUE rawsensors_get_property(const char* property_name);
7
+ extern void rawsensors_set_property(const char* property_name, const char* value);
8
+ extern VALUE rawsensors_is_available(const char* sensor_name);
9
+ extern void rawsensors_getSensorData();
10
+
11
+ #define get_property rawsensors_get_property
12
+ #define set_property rawsensors_set_property
13
+ #define is_available rawsensors_is_available
14
+ #define getSensorData rawsensors_getSensorData
15
+
16
+
17
+ %}
18
+
19
+ extern VALUE get_property(const char* property_name);
20
+ extern void set_property(const char* property_name, const char* value);
21
+ extern VALUE is_available(const char* sensor_name);
22
+ extern void getSensorData();
@@ -0,0 +1,2308 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.4
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+ /* -----------------------------------------------------------------------------
14
+ * This section contains generic SWIG labels for method/variable
15
+ * declarations/attributes, and other compiler dependent labels.
16
+ * ----------------------------------------------------------------------------- */
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
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
26
+ # else
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
28
+ # endif
29
+ #endif
30
+
31
+ /* inline attribute */
32
+ #ifndef SWIGINLINE
33
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34
+ # define SWIGINLINE inline
35
+ # else
36
+ # define SWIGINLINE
37
+ # endif
38
+ #endif
39
+
40
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
41
+ #ifndef SWIGUNUSED
42
+ # if defined(__GNUC__)
43
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
+ # else
46
+ # define SWIGUNUSED
47
+ # endif
48
+ # elif defined(__ICC)
49
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
+ # else
51
+ # define SWIGUNUSED
52
+ # endif
53
+ #endif
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
+
61
+ #ifndef SWIGUNUSEDPARM
62
+ # ifdef __cplusplus
63
+ # define SWIGUNUSEDPARM(p)
64
+ # else
65
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
+ # endif
67
+ #endif
68
+
69
+ /* internal SWIG method */
70
+ #ifndef SWIGINTERN
71
+ # define SWIGINTERN static SWIGUNUSED
72
+ #endif
73
+
74
+ /* internal inline SWIG method */
75
+ #ifndef SWIGINTERNINLINE
76
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77
+ #endif
78
+
79
+ /* exporting methods */
80
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81
+ # ifndef GCC_HASCLASSVISIBILITY
82
+ # define GCC_HASCLASSVISIBILITY
83
+ # endif
84
+ #endif
85
+
86
+ #ifndef SWIGEXPORT
87
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88
+ # if defined(STATIC_LINKED)
89
+ # define SWIGEXPORT
90
+ # else
91
+ # define SWIGEXPORT __declspec(dllexport)
92
+ # endif
93
+ # else
94
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
96
+ # else
97
+ # define SWIGEXPORT
98
+ # endif
99
+ # endif
100
+ #endif
101
+
102
+ /* calling conventions for Windows */
103
+ #ifndef SWIGSTDCALL
104
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105
+ # define SWIGSTDCALL __stdcall
106
+ # else
107
+ # define SWIGSTDCALL
108
+ # endif
109
+ #endif
110
+
111
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113
+ # define _CRT_SECURE_NO_DEPRECATE
114
+ #endif
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
+
122
+ /* -----------------------------------------------------------------------------
123
+ * This section contains generic SWIG labels for method/variable
124
+ * declarations/attributes, and other compiler dependent labels.
125
+ * ----------------------------------------------------------------------------- */
126
+
127
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
128
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
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
135
+ # else
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
137
+ # endif
138
+ #endif
139
+
140
+ /* inline attribute */
141
+ #ifndef SWIGINLINE
142
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
143
+ # define SWIGINLINE inline
144
+ # else
145
+ # define SWIGINLINE
146
+ # endif
147
+ #endif
148
+
149
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
150
+ #ifndef SWIGUNUSED
151
+ # if defined(__GNUC__)
152
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
+ # else
155
+ # define SWIGUNUSED
156
+ # endif
157
+ # elif defined(__ICC)
158
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
+ # else
160
+ # define SWIGUNUSED
161
+ # endif
162
+ #endif
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
+
170
+ #ifndef SWIGUNUSEDPARM
171
+ # ifdef __cplusplus
172
+ # define SWIGUNUSEDPARM(p)
173
+ # else
174
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
+ # endif
176
+ #endif
177
+
178
+ /* internal SWIG method */
179
+ #ifndef SWIGINTERN
180
+ # define SWIGINTERN static SWIGUNUSED
181
+ #endif
182
+
183
+ /* internal inline SWIG method */
184
+ #ifndef SWIGINTERNINLINE
185
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
186
+ #endif
187
+
188
+ /* exporting methods */
189
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
190
+ # ifndef GCC_HASCLASSVISIBILITY
191
+ # define GCC_HASCLASSVISIBILITY
192
+ # endif
193
+ #endif
194
+
195
+ #ifndef SWIGEXPORT
196
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
197
+ # if defined(STATIC_LINKED)
198
+ # define SWIGEXPORT
199
+ # else
200
+ # define SWIGEXPORT __declspec(dllexport)
201
+ # endif
202
+ # else
203
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
204
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
205
+ # else
206
+ # define SWIGEXPORT
207
+ # endif
208
+ # endif
209
+ #endif
210
+
211
+ /* calling conventions for Windows */
212
+ #ifndef SWIGSTDCALL
213
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
214
+ # define SWIGSTDCALL __stdcall
215
+ # else
216
+ # define SWIGSTDCALL
217
+ # endif
218
+ #endif
219
+
220
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
221
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
222
+ # define _CRT_SECURE_NO_DEPRECATE
223
+ #endif
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
+
231
+ /* -----------------------------------------------------------------------------
232
+ * swigrun.swg
233
+ *
234
+ * This file contains generic C API SWIG runtime support for pointer
235
+ * type checking.
236
+ * ----------------------------------------------------------------------------- */
237
+
238
+ /* This should only be incremented when either the layout of swig_type_info changes,
239
+ or for whatever reason, the runtime changes incompatibly */
240
+ #define SWIG_RUNTIME_VERSION "4"
241
+
242
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
243
+ #ifdef SWIG_TYPE_TABLE
244
+ # define SWIG_QUOTE_STRING(x) #x
245
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
246
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
247
+ #else
248
+ # define SWIG_TYPE_TABLE_NAME
249
+ #endif
250
+
251
+ /*
252
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
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'.
255
+
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
258
+ */
259
+
260
+ #ifndef SWIGRUNTIME
261
+ # define SWIGRUNTIME SWIGINTERN
262
+ #endif
263
+
264
+ #ifndef SWIGRUNTIMEINLINE
265
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
266
+ #endif
267
+
268
+ /* Generic buffer size */
269
+ #ifndef SWIG_BUFFER_SIZE
270
+ # define SWIG_BUFFER_SIZE 1024
271
+ #endif
272
+
273
+ /* Flags for pointer conversions */
274
+ #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
276
+
277
+ /* Flags for new pointer objects */
278
+ #define SWIG_POINTER_OWN 0x1
279
+
280
+
281
+ /*
282
+ Flags/methods for returning states.
283
+
284
+ The SWIG conversion methods, as ConvertPtr, return an integer
285
+ that tells if the conversion was successful or not. And if not,
286
+ an error code can be returned (see swigerrors.swg for the codes).
287
+
288
+ Use the following macros/flags to set or process the returning
289
+ states.
290
+
291
+ In old versions of SWIG, code such as the following was usually written:
292
+
293
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
294
+ // success code
295
+ } else {
296
+ //fail code
297
+ }
298
+
299
+ Now you can be more explicit:
300
+
301
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
302
+ if (SWIG_IsOK(res)) {
303
+ // success code
304
+ } else {
305
+ // fail code
306
+ }
307
+
308
+ which is the same really, but now you can also do
309
+
310
+ Type *ptr;
311
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
312
+ if (SWIG_IsOK(res)) {
313
+ // success code
314
+ if (SWIG_IsNewObj(res) {
315
+ ...
316
+ delete *ptr;
317
+ } else {
318
+ ...
319
+ }
320
+ } else {
321
+ // fail code
322
+ }
323
+
324
+ I.e., now SWIG_ConvertPtr can return new objects and you can
325
+ identify the case and take care of the deallocation. Of course that
326
+ also requires SWIG_ConvertPtr to return new result values, such as
327
+
328
+ int SWIG_ConvertPtr(obj, ptr,...) {
329
+ if (<obj is ok>) {
330
+ if (<need new object>) {
331
+ *ptr = <ptr to new allocated object>;
332
+ return SWIG_NEWOBJ;
333
+ } else {
334
+ *ptr = <ptr to old object>;
335
+ return SWIG_OLDOBJ;
336
+ }
337
+ } else {
338
+ return SWIG_BADOBJ;
339
+ }
340
+ }
341
+
342
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
343
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
344
+ SWIG errors code.
345
+
346
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
347
+ allows to return the 'cast rank', for example, if you have this
348
+
349
+ int food(double)
350
+ int fooi(int);
351
+
352
+ and you call
353
+
354
+ food(1) // cast rank '1' (1 -> 1.0)
355
+ fooi(1) // cast rank '0'
356
+
357
+ just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
359
+
360
+ #define SWIG_OK (0)
361
+ #define SWIG_ERROR (-1)
362
+ #define SWIG_IsOK(r) (r >= 0)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
+
365
+ /* The CastRankLimit says how many bits are used for the cast rank */
366
+ #define SWIG_CASTRANKLIMIT (1 << 8)
367
+ /* The NewMask denotes the object was created (using new/malloc) */
368
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
369
+ /* The TmpMask is for in/out typemaps that use temporal objects */
370
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
371
+ /* Simple returning values */
372
+ #define SWIG_BADOBJ (SWIG_ERROR)
373
+ #define SWIG_OLDOBJ (SWIG_OK)
374
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
375
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
376
+ /* Check, add and del mask methods */
377
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
378
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
379
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
380
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
381
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
382
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
383
+
384
+ /* Cast-Rank Mode */
385
+ #if defined(SWIG_CASTRANK_MODE)
386
+ # ifndef SWIG_TypeRank
387
+ # define SWIG_TypeRank unsigned long
388
+ # endif
389
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
390
+ # define SWIG_MAXCASTRANK (2)
391
+ # endif
392
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
+ }
397
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
+ }
400
+ #else /* no cast-rank mode */
401
+ # define SWIG_AddCast
402
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
+ #endif
404
+
405
+
406
+ #include <string.h>
407
+
408
+ #ifdef __cplusplus
409
+ extern "C" {
410
+ #endif
411
+
412
+ typedef void *(*swig_converter_func)(void *, int *);
413
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
414
+
415
+ /* Structure to store information on one type */
416
+ typedef struct swig_type_info {
417
+ const char *name; /* mangled name of this type */
418
+ const char *str; /* human readable name of this type */
419
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
420
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
421
+ void *clientdata; /* language specific type data */
422
+ int owndata; /* flag if the structure owns the clientdata */
423
+ } swig_type_info;
424
+
425
+ /* Structure to store a type and conversion function used for casting */
426
+ typedef struct swig_cast_info {
427
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
428
+ swig_converter_func converter; /* function to cast the void pointers */
429
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
430
+ struct swig_cast_info *prev; /* pointer to the previous cast */
431
+ } swig_cast_info;
432
+
433
+ /* Structure used to store module information
434
+ * Each module generates one structure like this, and the runtime collects
435
+ * all of these structures and stores them in a circularly linked list.*/
436
+ typedef struct swig_module_info {
437
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
438
+ size_t size; /* Number of types in this module */
439
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
440
+ swig_type_info **type_initial; /* Array of initially generated type structures */
441
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
442
+ void *clientdata; /* Language specific module data */
443
+ } swig_module_info;
444
+
445
+ /*
446
+ Compare two type names skipping the space characters, therefore
447
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
+
449
+ Return 0 when the two name types are equivalent, as in
450
+ strncmp, but skipping ' '.
451
+ */
452
+ SWIGRUNTIME int
453
+ SWIG_TypeNameComp(const char *f1, const char *l1,
454
+ const char *f2, const char *l2) {
455
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
456
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
457
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
458
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
459
+ }
460
+ return (int)((l1 - f1) - (l2 - f2));
461
+ }
462
+
463
+ /*
464
+ Check type equivalence in a name list like <name1>|<name2>|...
465
+ Return 0 if not equal, 1 if equal
466
+ */
467
+ SWIGRUNTIME int
468
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
469
+ int equiv = 0;
470
+ const char* te = tb + strlen(tb);
471
+ const char* ne = nb;
472
+ while (!equiv && *ne) {
473
+ for (nb = ne; *ne; ++ne) {
474
+ if (*ne == '|') break;
475
+ }
476
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
477
+ if (*ne) ++ne;
478
+ }
479
+ return equiv;
480
+ }
481
+
482
+ /*
483
+ Check type equivalence in a name list like <name1>|<name2>|...
484
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
485
+ */
486
+ SWIGRUNTIME int
487
+ SWIG_TypeCompare(const char *nb, const char *tb) {
488
+ int equiv = 0;
489
+ const char* te = tb + strlen(tb);
490
+ const char* ne = nb;
491
+ while (!equiv && *ne) {
492
+ for (nb = ne; *ne; ++ne) {
493
+ if (*ne == '|') break;
494
+ }
495
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
496
+ if (*ne) ++ne;
497
+ }
498
+ return equiv;
499
+ }
500
+
501
+
502
+ /*
503
+ Check the typename
504
+ */
505
+ SWIGRUNTIME swig_cast_info *
506
+ SWIG_TypeCheck(const char *c, swig_type_info *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;
527
+ }
528
+
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
532
+ SWIGRUNTIME swig_cast_info *
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;
554
+ }
555
+
556
+ /*
557
+ Cast a pointer up an inheritance hierarchy
558
+ */
559
+ SWIGRUNTIMEINLINE void *
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
+ }
563
+
564
+ /*
565
+ Dynamic pointer casting. Down an inheritance hierarchy
566
+ */
567
+ SWIGRUNTIME swig_type_info *
568
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
569
+ swig_type_info *lastty = ty;
570
+ if (!ty || !ty->dcast) return ty;
571
+ while (ty && (ty->dcast)) {
572
+ ty = (*ty->dcast)(ptr);
573
+ if (ty) lastty = ty;
574
+ }
575
+ return lastty;
576
+ }
577
+
578
+ /*
579
+ Return the name associated with this type
580
+ */
581
+ SWIGRUNTIMEINLINE const char *
582
+ SWIG_TypeName(const swig_type_info *ty) {
583
+ return ty->name;
584
+ }
585
+
586
+ /*
587
+ Return the pretty name associated with this type,
588
+ that is an unmangled type name in a form presentable to the user.
589
+ */
590
+ SWIGRUNTIME const char *
591
+ SWIG_TypePrettyName(const swig_type_info *type) {
592
+ /* The "str" field contains the equivalent pretty names of the
593
+ type, separated by vertical-bar characters. We choose
594
+ to print the last name, as it is often (?) the most
595
+ specific. */
596
+ if (!type) return NULL;
597
+ if (type->str != NULL) {
598
+ const char *last_name = type->str;
599
+ const char *s;
600
+ for (s = type->str; *s; s++)
601
+ if (*s == '|') last_name = s+1;
602
+ return last_name;
603
+ }
604
+ else
605
+ return type->name;
606
+ }
607
+
608
+ /*
609
+ Set the clientdata field for a type
610
+ */
611
+ SWIGRUNTIME void
612
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
+ swig_cast_info *cast = ti->cast;
614
+ /* if (ti->clientdata == clientdata) return; */
615
+ ti->clientdata = clientdata;
616
+
617
+ while (cast) {
618
+ if (!cast->converter) {
619
+ swig_type_info *tc = cast->type;
620
+ if (!tc->clientdata) {
621
+ SWIG_TypeClientData(tc, clientdata);
622
+ }
623
+ }
624
+ cast = cast->next;
625
+ }
626
+ }
627
+ SWIGRUNTIME void
628
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
+ SWIG_TypeClientData(ti, clientdata);
630
+ ti->owndata = 1;
631
+ }
632
+
633
+ /*
634
+ Search for a swig_type_info structure only by mangled name
635
+ Search is a O(log #types)
636
+
637
+ We start searching at module start, and finish searching when start == end.
638
+ Note: if start == end at the beginning of the function, we go all the way around
639
+ the circular list.
640
+ */
641
+ SWIGRUNTIME swig_type_info *
642
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
643
+ swig_module_info *end,
644
+ const char *name) {
645
+ swig_module_info *iter = start;
646
+ do {
647
+ if (iter->size) {
648
+ register size_t l = 0;
649
+ register size_t r = iter->size - 1;
650
+ do {
651
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
+ register size_t i = (l + r) >> 1;
653
+ const char *iname = iter->types[i]->name;
654
+ if (iname) {
655
+ register int compare = strcmp(name, iname);
656
+ if (compare == 0) {
657
+ return iter->types[i];
658
+ } else if (compare < 0) {
659
+ if (i) {
660
+ r = i - 1;
661
+ } else {
662
+ break;
663
+ }
664
+ } else if (compare > 0) {
665
+ l = i + 1;
666
+ }
667
+ } else {
668
+ break; /* should never happen */
669
+ }
670
+ } while (l <= r);
671
+ }
672
+ iter = iter->next;
673
+ } while (iter != end);
674
+ return 0;
675
+ }
676
+
677
+ /*
678
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
679
+ It first searches the mangled names of the types, which is a O(log #types)
680
+ If a type is not found it then searches the human readable names, which is O(#types).
681
+
682
+ We start searching at module start, and finish searching when start == end.
683
+ Note: if start == end at the beginning of the function, we go all the way around
684
+ the circular list.
685
+ */
686
+ SWIGRUNTIME swig_type_info *
687
+ SWIG_TypeQueryModule(swig_module_info *start,
688
+ swig_module_info *end,
689
+ const char *name) {
690
+ /* STEP 1: Search the name field using binary search */
691
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
692
+ if (ret) {
693
+ return ret;
694
+ } else {
695
+ /* STEP 2: If the type hasn't been found, do a complete search
696
+ of the str field (the human readable name) */
697
+ swig_module_info *iter = start;
698
+ do {
699
+ register size_t i = 0;
700
+ for (; i < iter->size; ++i) {
701
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
702
+ return iter->types[i];
703
+ }
704
+ iter = iter->next;
705
+ } while (iter != end);
706
+ }
707
+
708
+ /* neither found a match */
709
+ return 0;
710
+ }
711
+
712
+ /*
713
+ Pack binary data into a string
714
+ */
715
+ SWIGRUNTIME char *
716
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
717
+ static const char hex[17] = "0123456789abcdef";
718
+ register const unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register unsigned char uu = *u;
722
+ *(c++) = hex[(uu & 0xf0) >> 4];
723
+ *(c++) = hex[uu & 0xf];
724
+ }
725
+ return c;
726
+ }
727
+
728
+ /*
729
+ Unpack binary data from a string
730
+ */
731
+ SWIGRUNTIME const char *
732
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
733
+ register unsigned char *u = (unsigned char *) ptr;
734
+ register const unsigned char *eu = u + sz;
735
+ for (; u != eu; ++u) {
736
+ register char d = *(c++);
737
+ register unsigned char uu;
738
+ if ((d >= '0') && (d <= '9'))
739
+ uu = ((d - '0') << 4);
740
+ else if ((d >= 'a') && (d <= 'f'))
741
+ uu = ((d - ('a'-10)) << 4);
742
+ else
743
+ return (char *) 0;
744
+ d = *(c++);
745
+ if ((d >= '0') && (d <= '9'))
746
+ uu |= (d - '0');
747
+ else if ((d >= 'a') && (d <= 'f'))
748
+ uu |= (d - ('a'-10));
749
+ else
750
+ return (char *) 0;
751
+ *u = uu;
752
+ }
753
+ return c;
754
+ }
755
+
756
+ /*
757
+ Pack 'void *' into a string buffer.
758
+ */
759
+ SWIGRUNTIME char *
760
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
761
+ char *r = buff;
762
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
763
+ *(r++) = '_';
764
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
765
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
766
+ strcpy(r,name);
767
+ return buff;
768
+ }
769
+
770
+ SWIGRUNTIME const char *
771
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
772
+ if (*c != '_') {
773
+ if (strcmp(c,"NULL") == 0) {
774
+ *ptr = (void *) 0;
775
+ return name;
776
+ } else {
777
+ return 0;
778
+ }
779
+ }
780
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
781
+ }
782
+
783
+ SWIGRUNTIME char *
784
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ size_t lname = (name ? strlen(name) : 0);
787
+ if ((2*sz + 2 + lname) > bsz) return 0;
788
+ *(r++) = '_';
789
+ r = SWIG_PackData(r,ptr,sz);
790
+ if (lname) {
791
+ strncpy(r,name,lname+1);
792
+ } else {
793
+ *r = 0;
794
+ }
795
+ return buff;
796
+ }
797
+
798
+ SWIGRUNTIME const char *
799
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
800
+ if (*c != '_') {
801
+ if (strcmp(c,"NULL") == 0) {
802
+ memset(ptr,0,sz);
803
+ return name;
804
+ } else {
805
+ return 0;
806
+ }
807
+ }
808
+ return SWIG_UnpackData(++c,ptr,sz);
809
+ }
810
+
811
+ #ifdef __cplusplus
812
+ }
813
+ #endif
814
+
815
+ /* Errors in SWIG */
816
+ #define SWIG_UnknownError -1
817
+ #define SWIG_IOError -2
818
+ #define SWIG_RuntimeError -3
819
+ #define SWIG_IndexError -4
820
+ #define SWIG_TypeError -5
821
+ #define SWIG_DivisionByZero -6
822
+ #define SWIG_OverflowError -7
823
+ #define SWIG_SyntaxError -8
824
+ #define SWIG_ValueError -9
825
+ #define SWIG_SystemError -10
826
+ #define SWIG_AttributeError -11
827
+ #define SWIG_MemoryError -12
828
+ #define SWIG_NullReferenceError -13
829
+
830
+
831
+
832
+ #include <ruby.h>
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
+
861
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
862
+ #ifndef NUM2LL
863
+ #define NUM2LL(x) NUM2LONG((x))
864
+ #endif
865
+ #ifndef LL2NUM
866
+ #define LL2NUM(x) INT2NUM((long) (x))
867
+ #endif
868
+ #ifndef ULL2NUM
869
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
870
+ #endif
871
+
872
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
873
+ #ifndef NUM2ULL
874
+ #ifdef HAVE_LONG_LONG
875
+ #define NUM2ULL(x) rb_num2ull((x))
876
+ #else
877
+ #define NUM2ULL(x) NUM2ULONG(x)
878
+ #endif
879
+ #endif
880
+
881
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
882
+ /* Define these for older versions so we can just write code the new way */
883
+ #ifndef RSTRING_LEN
884
+ # define RSTRING_LEN(x) RSTRING(x)->len
885
+ #endif
886
+ #ifndef RSTRING_PTR
887
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
888
+ #endif
889
+ #ifndef RSTRING_END
890
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
891
+ #endif
892
+ #ifndef RARRAY_LEN
893
+ # define RARRAY_LEN(x) RARRAY(x)->len
894
+ #endif
895
+ #ifndef RARRAY_PTR
896
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
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
+
927
+
928
+ /*
929
+ * Need to be very careful about how these macros are defined, especially
930
+ * when compiling C++ code or C code with an ANSI C compiler.
931
+ *
932
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
933
+ * a Ruby method so that it can be passed as an argument to API functions
934
+ * like rb_define_method() and rb_define_singleton_method().
935
+ *
936
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
937
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
938
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
939
+ * and Data_Make_Struct().
940
+ */
941
+
942
+ #ifdef __cplusplus
943
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
944
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
945
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
946
+ # define VOIDFUNC(f) ((void (*)()) f)
947
+ # else
948
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
949
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
950
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
951
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
952
+ # else /* These definitions should work for Ruby 1.7+ */
953
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
954
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
955
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
956
+ # endif
957
+ # endif
958
+ #else
959
+ # define VALUEFUNC(f) (f)
960
+ # define VOIDFUNC(f) (f)
961
+ #endif
962
+
963
+ /* Don't use for expressions have side effect */
964
+ #ifndef RB_STRING_VALUE
965
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
966
+ #endif
967
+ #ifndef StringValue
968
+ #define StringValue(s) RB_STRING_VALUE(s)
969
+ #endif
970
+ #ifndef StringValuePtr
971
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
972
+ #endif
973
+ #ifndef StringValueLen
974
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
975
+ #endif
976
+ #ifndef SafeStringValue
977
+ #define SafeStringValue(v) do {\
978
+ StringValue(v);\
979
+ rb_check_safe_str(v);\
980
+ } while (0)
981
+ #endif
982
+
983
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
984
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
985
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
986
+ #endif
987
+
988
+ #define _mSWIG_defined
989
+ static VALUE _mSWIG = Qnil;
990
+
991
+ /* -----------------------------------------------------------------------------
992
+ * error manipulation
993
+ * ----------------------------------------------------------------------------- */
994
+
995
+
996
+ /* Define some additional error types */
997
+ #define SWIG_ObjectPreviouslyDeletedError -100
998
+
999
+
1000
+ /* Define custom exceptions for errors that do not map to existing Ruby
1001
+ exceptions. Note this only works for C++ since a global cannot be
1002
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1003
+
1004
+ #define SWIG_rb_eNullReferenceError_defined
1005
+ static VALUE SWIG_rb_eNullReferenceError = Qnil;
1006
+
1007
+
1008
+ SWIGINTERN VALUE
1009
+ getNullReferenceError(void) {
1010
+ if (SWIG_rb_eNullReferenceError == Qnil) {
1011
+ SWIG_rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1012
+ }
1013
+ return SWIG_rb_eNullReferenceError;
1014
+ }
1015
+
1016
+ #define SWIG_rb_eObjectPreviouslyDeleted_defined
1017
+ static VALUE SWIG_rb_eObjectPreviouslyDeleted = Qnil;
1018
+
1019
+ SWIGINTERN VALUE
1020
+ getObjectPreviouslyDeletedError(void) {
1021
+ if (SWIG_rb_eObjectPreviouslyDeleted == Qnil) {
1022
+ SWIG_rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1023
+ }
1024
+ return SWIG_rb_eObjectPreviouslyDeleted;
1025
+ }
1026
+
1027
+
1028
+ SWIGINTERN VALUE
1029
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1030
+ VALUE type;
1031
+ switch (SWIG_code) {
1032
+ case SWIG_MemoryError:
1033
+ type = rb_eNoMemError;
1034
+ break;
1035
+ case SWIG_IOError:
1036
+ type = rb_eIOError;
1037
+ break;
1038
+ case SWIG_RuntimeError:
1039
+ type = rb_eRuntimeError;
1040
+ break;
1041
+ case SWIG_IndexError:
1042
+ type = rb_eIndexError;
1043
+ break;
1044
+ case SWIG_TypeError:
1045
+ type = rb_eTypeError;
1046
+ break;
1047
+ case SWIG_DivisionByZero:
1048
+ type = rb_eZeroDivError;
1049
+ break;
1050
+ case SWIG_OverflowError:
1051
+ type = rb_eRangeError;
1052
+ break;
1053
+ case SWIG_SyntaxError:
1054
+ type = rb_eSyntaxError;
1055
+ break;
1056
+ case SWIG_ValueError:
1057
+ type = rb_eArgError;
1058
+ break;
1059
+ case SWIG_SystemError:
1060
+ type = rb_eFatal;
1061
+ break;
1062
+ case SWIG_AttributeError:
1063
+ type = rb_eRuntimeError;
1064
+ break;
1065
+ case SWIG_NullReferenceError:
1066
+ type = getNullReferenceError();
1067
+ break;
1068
+ case SWIG_ObjectPreviouslyDeletedError:
1069
+ type = getObjectPreviouslyDeletedError();
1070
+ break;
1071
+ case SWIG_UnknownError:
1072
+ type = rb_eRuntimeError;
1073
+ break;
1074
+ default:
1075
+ type = rb_eRuntimeError;
1076
+ }
1077
+ return type;
1078
+ }
1079
+
1080
+
1081
+ /* This function is called when a user inputs a wrong argument to
1082
+ a method.
1083
+ */
1084
+ SWIGINTERN
1085
+ const char* Ruby_Format_TypeError( const char* msg,
1086
+ const char* type,
1087
+ const char* name,
1088
+ const int argn,
1089
+ VALUE input )
1090
+ {
1091
+ char buf[128];
1092
+ VALUE str;
1093
+ VALUE asStr;
1094
+ if ( msg && *msg )
1095
+ {
1096
+ str = rb_str_new2(msg);
1097
+ }
1098
+ else
1099
+ {
1100
+ str = rb_str_new(NULL, 0);
1101
+ }
1102
+
1103
+ str = rb_str_cat2( str, "Expected argument " );
1104
+ sprintf( buf, "%d of type ", argn-1 );
1105
+ str = rb_str_cat2( str, buf );
1106
+ str = rb_str_cat2( str, type );
1107
+ str = rb_str_cat2( str, ", but got " );
1108
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1109
+ str = rb_str_cat2( str, " " );
1110
+ asStr = rb_inspect(input);
1111
+ if ( RSTRING_LEN(asStr) > 30 )
1112
+ {
1113
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1114
+ str = rb_str_cat2( str, "..." );
1115
+ }
1116
+ else
1117
+ {
1118
+ str = rb_str_append( str, asStr );
1119
+ }
1120
+
1121
+ if ( name )
1122
+ {
1123
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1124
+ str = rb_str_cat2( str, name );
1125
+ str = rb_str_cat2( str, "'" );
1126
+ }
1127
+
1128
+ return StringValuePtr( str );
1129
+ }
1130
+
1131
+ /* This function is called when an overloaded method fails */
1132
+ SWIGINTERN
1133
+ void Ruby_Format_OverloadedError(
1134
+ const int argc,
1135
+ const int maxargs,
1136
+ const char* method,
1137
+ const char* prototypes
1138
+ )
1139
+ {
1140
+ const char* msg = "Wrong # of arguments";
1141
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1142
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1143
+ "Possible C/C++ prototypes are:\n%s",
1144
+ msg, method, prototypes);
1145
+ }
1146
+
1147
+ /* -----------------------------------------------------------------------------
1148
+ * rubytracking.swg
1149
+ *
1150
+ * This file contains support for tracking mappings from
1151
+ * Ruby objects to C++ objects. This functionality is needed
1152
+ * to implement mark functions for Ruby's mark and sweep
1153
+ * garbage collector.
1154
+ * ----------------------------------------------------------------------------- */
1155
+
1156
+ #ifdef __cplusplus
1157
+ extern "C" {
1158
+ #endif
1159
+
1160
+ /* Ruby 1.8 actually assumes the first case. */
1161
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1162
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1163
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1164
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1165
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1166
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1167
+ #else
1168
+ # error sizeof(void*) is not the same as long or long long
1169
+ #endif
1170
+
1171
+
1172
+ /* Global Ruby hash table to store Trackings from C/C++
1173
+ structs to Ruby Objects.
1174
+ */
1175
+ #define swig_ruby_trackings_defined
1176
+ static VALUE swig_ruby_trackings = Qnil;
1177
+
1178
+ /* Global variable that stores a reference to the ruby
1179
+ hash table delete function. */
1180
+ #define swig_ruby_hash_delete_defined
1181
+ static ID swig_ruby_hash_delete = 0;
1182
+
1183
+ /* Setup a Ruby hash table to store Trackings */
1184
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1185
+ /* Create a ruby hash table to store Trackings from C++
1186
+ objects to Ruby objects. */
1187
+
1188
+ /* Try to see if some other .so has already created a
1189
+ tracking hash table, which we keep hidden in an instance var
1190
+ in the SWIG module.
1191
+ This is done to allow multiple DSOs to share the same
1192
+ tracking table.
1193
+ */
1194
+ ID trackings_id = rb_intern( "@__trackings__" );
1195
+ VALUE verbose = rb_gv_get("VERBOSE");
1196
+ rb_gv_set("VERBOSE", Qfalse);
1197
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1198
+ rb_gv_set("VERBOSE", verbose);
1199
+
1200
+ /* No, it hasn't. Create one ourselves */
1201
+ if ( swig_ruby_trackings == Qnil )
1202
+ {
1203
+ swig_ruby_trackings = rb_hash_new();
1204
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1205
+ }
1206
+
1207
+ /* Now store a reference to the hash table delete function
1208
+ so that we only have to look it up once.*/
1209
+ swig_ruby_hash_delete = rb_intern("delete");
1210
+ }
1211
+
1212
+ /* Get a Ruby number to reference a pointer */
1213
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1214
+ /* We cast the pointer to an unsigned long
1215
+ and then store a reference to it using
1216
+ a Ruby number object. */
1217
+
1218
+ /* Convert the pointer to a Ruby number */
1219
+ return SWIG2NUM(ptr);
1220
+ }
1221
+
1222
+ /* Get a Ruby number to reference an object */
1223
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1224
+ /* We cast the object to an unsigned long
1225
+ and then store a reference to it using
1226
+ a Ruby number object. */
1227
+
1228
+ /* Convert the Object to a Ruby number */
1229
+ return SWIG2NUM(object);
1230
+ }
1231
+
1232
+ /* Get a Ruby object from a previously stored reference */
1233
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1234
+ /* The provided Ruby number object is a reference
1235
+ to the Ruby object we want.*/
1236
+
1237
+ /* Convert the Ruby number to a Ruby object */
1238
+ return NUM2SWIG(reference);
1239
+ }
1240
+
1241
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1242
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1243
+ /* In a Ruby hash table we store the pointer and
1244
+ the associated Ruby object. The trick here is
1245
+ that we cannot store the Ruby object directly - if
1246
+ we do then it cannot be garbage collected. So
1247
+ instead we typecast it as a unsigned long and
1248
+ convert it to a Ruby number object.*/
1249
+
1250
+ /* Get a reference to the pointer as a Ruby number */
1251
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1252
+
1253
+ /* Get a reference to the Ruby object as a Ruby number */
1254
+ VALUE value = SWIG_RubyObjectToReference(object);
1255
+
1256
+ /* Store the mapping to the global hash table. */
1257
+ rb_hash_aset(swig_ruby_trackings, key, value);
1258
+ }
1259
+
1260
+ /* Get the Ruby object that owns the specified C/C++ struct */
1261
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1262
+ /* Get a reference to the pointer as a Ruby number */
1263
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1264
+
1265
+ /* Now lookup the value stored in the global hash table */
1266
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1267
+
1268
+ if (value == Qnil) {
1269
+ /* No object exists - return nil. */
1270
+ return Qnil;
1271
+ }
1272
+ else {
1273
+ /* Convert this value to Ruby object */
1274
+ return SWIG_RubyReferenceToObject(value);
1275
+ }
1276
+ }
1277
+
1278
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1279
+ is very important to remove objects once they are destroyed
1280
+ since the same memory address may be reused later to create
1281
+ a new object. */
1282
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1283
+ /* Get a reference to the pointer as a Ruby number */
1284
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1285
+
1286
+ /* Delete the object from the hash table by calling Ruby's
1287
+ do this we need to call the Hash.delete method.*/
1288
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1289
+ }
1290
+
1291
+ /* This is a helper method that unlinks a Ruby object from its
1292
+ underlying C++ object. This is needed if the lifetime of the
1293
+ Ruby object is longer than the C++ object */
1294
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1295
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1296
+
1297
+ if (object != Qnil) {
1298
+ DATA_PTR(object) = 0;
1299
+ }
1300
+ }
1301
+
1302
+
1303
+ #ifdef __cplusplus
1304
+ }
1305
+ #endif
1306
+
1307
+ /* -----------------------------------------------------------------------------
1308
+ * Ruby API portion that goes into the runtime
1309
+ * ----------------------------------------------------------------------------- */
1310
+
1311
+ #ifdef __cplusplus
1312
+ extern "C" {
1313
+ #endif
1314
+
1315
+ SWIGINTERN VALUE
1316
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1317
+ if (NIL_P(target)) {
1318
+ target = o;
1319
+ } else {
1320
+ if (TYPE(target) != T_ARRAY) {
1321
+ VALUE o2 = target;
1322
+ target = rb_ary_new();
1323
+ rb_ary_push(target, o2);
1324
+ }
1325
+ rb_ary_push(target, o);
1326
+ }
1327
+ return target;
1328
+ }
1329
+
1330
+ /* For ruby1.8.4 and earlier. */
1331
+ #ifndef RUBY_INIT_STACK
1332
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1333
+ # define RUBY_INIT_STACK \
1334
+ VALUE variable_in_this_stack_frame; \
1335
+ Init_stack(&variable_in_this_stack_frame);
1336
+ #endif
1337
+
1338
+
1339
+ #ifdef __cplusplus
1340
+ }
1341
+ #endif
1342
+
1343
+
1344
+ /* -----------------------------------------------------------------------------
1345
+ * rubyrun.swg
1346
+ *
1347
+ * This file contains the runtime support for Ruby modules
1348
+ * and includes code for managing global variables and pointer
1349
+ * type checking.
1350
+ * ----------------------------------------------------------------------------- */
1351
+
1352
+ /* For backward compatibility only */
1353
+ #define SWIG_POINTER_EXCEPTION 0
1354
+
1355
+ /* for raw pointers */
1356
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1357
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1358
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1359
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1360
+ #define swig_owntype ruby_owntype
1361
+
1362
+ /* for raw packed data */
1363
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1364
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1365
+
1366
+ /* for class or struct pointers */
1367
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1368
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1369
+
1370
+ /* for C or C++ function pointers */
1371
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1372
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1373
+
1374
+ /* for C++ member pointers, ie, member methods */
1375
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1376
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1377
+
1378
+
1379
+ /* Runtime API */
1380
+
1381
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1382
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1383
+
1384
+
1385
+ /* Error manipulation */
1386
+
1387
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1388
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1389
+ #define SWIG_fail goto fail
1390
+
1391
+
1392
+ /* Ruby-specific SWIG API */
1393
+
1394
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1395
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1396
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1397
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1398
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1399
+
1400
+ #include "assert.h"
1401
+
1402
+ /* -----------------------------------------------------------------------------
1403
+ * pointers/data manipulation
1404
+ * ----------------------------------------------------------------------------- */
1405
+
1406
+ #ifdef __cplusplus
1407
+ extern "C" {
1408
+ #endif
1409
+
1410
+ typedef struct {
1411
+ VALUE klass;
1412
+ VALUE mImpl;
1413
+ void (*mark)(void *);
1414
+ void (*destroy)(void *);
1415
+ int trackObjects;
1416
+ } swig_class;
1417
+
1418
+
1419
+ /* Global pointer used to keep some internal SWIG stuff */
1420
+ #define _cSWIG_Pointer_defined
1421
+ static VALUE _cSWIG_Pointer = Qnil;
1422
+
1423
+ #define swig_runtime_data_type_pointer_defined
1424
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1425
+
1426
+ /* Global IDs used to keep some internal SWIG stuff */
1427
+ #define swig_arity_id_defined
1428
+ static ID swig_arity_id = 0;
1429
+
1430
+ #define swig_call_id_defined
1431
+ static ID swig_call_id = 0;
1432
+
1433
+ /*
1434
+ If your swig extension is to be run within an embedded ruby and has
1435
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1436
+ This will reset ruby's stack frame on each entry point from the main
1437
+ program the first time a virtual director function is invoked (in a
1438
+ non-recursive way).
1439
+ If this is not done, you run the risk of Ruby trashing the stack.
1440
+ */
1441
+
1442
+ #ifdef RUBY_EMBEDDED
1443
+
1444
+ # define SWIG_INIT_STACK \
1445
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1446
+ ++swig_virtual_calls;
1447
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1448
+ # define Ruby_DirectorTypeMismatchException(x) \
1449
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1450
+
1451
+ #define swig_virtual_calls_defined
1452
+ static unsigned int swig_virtual_calls = 0;
1453
+
1454
+ #else /* normal non-embedded extension */
1455
+
1456
+ # define SWIG_INIT_STACK
1457
+ # define SWIG_RELEASE_STACK
1458
+ # define Ruby_DirectorTypeMismatchException(x) \
1459
+ throw Swig::DirectorTypeMismatchException( x );
1460
+
1461
+ #endif /* RUBY_EMBEDDED */
1462
+
1463
+
1464
+ SWIGRUNTIME VALUE
1465
+ getExceptionClass(void) {
1466
+ //static int init = 0;
1467
+ static VALUE rubyExceptionClass ;
1468
+ //if (!init) {
1469
+ //init = 1;
1470
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1471
+ //}
1472
+ return rubyExceptionClass;
1473
+ }
1474
+
1475
+ /* This code checks to see if the Ruby object being raised as part
1476
+ of an exception inherits from the Ruby class Exception. If so,
1477
+ the object is simply returned. If not, then a new Ruby exception
1478
+ object is created and that will be returned to Ruby.*/
1479
+ SWIGRUNTIME VALUE
1480
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1481
+ VALUE exceptionClass = getExceptionClass();
1482
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1483
+ return obj;
1484
+ } else {
1485
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1486
+ }
1487
+ }
1488
+
1489
+ /* Initialize Ruby runtime support */
1490
+ SWIGRUNTIME void
1491
+ SWIG_Ruby_InitRuntime(void)
1492
+ {
1493
+ //if (_mSWIG == Qnil) {
1494
+ _mSWIG = rb_define_module("SWIG");
1495
+ swig_call_id = rb_intern("call");
1496
+ swig_arity_id = rb_intern("arity");
1497
+ //}
1498
+ }
1499
+
1500
+ /* Define Ruby class for C type */
1501
+ SWIGRUNTIME void
1502
+ SWIG_Ruby_define_class(swig_type_info *type)
1503
+ {
1504
+ VALUE klass;
1505
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1506
+ sprintf(klass_name, "TYPE%s", type->name);
1507
+ if (NIL_P(_cSWIG_Pointer)) {
1508
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1509
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1510
+ }
1511
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1512
+ free((void *) klass_name);
1513
+ }
1514
+
1515
+ /* Create a new pointer object */
1516
+ SWIGRUNTIME VALUE
1517
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1518
+ {
1519
+ int own = flags & SWIG_POINTER_OWN;
1520
+ int track;
1521
+ char *klass_name;
1522
+ swig_class *sklass;
1523
+ VALUE klass;
1524
+ VALUE obj;
1525
+
1526
+ if (!ptr)
1527
+ return Qnil;
1528
+
1529
+ if (type->clientdata) {
1530
+ sklass = (swig_class *) type->clientdata;
1531
+
1532
+ /* Are we tracking this class and have we already returned this Ruby object? */
1533
+ track = sklass->trackObjects;
1534
+ if (track) {
1535
+ obj = SWIG_RubyInstanceFor(ptr);
1536
+
1537
+ /* Check the object's type and make sure it has the correct type.
1538
+ It might not in cases where methods do things like
1539
+ downcast methods. */
1540
+ if (obj != Qnil) {
1541
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1542
+ char* type_name = RSTRING_PTR(value);
1543
+
1544
+ if (strcmp(type->name, type_name) == 0) {
1545
+ return obj;
1546
+ }
1547
+ }
1548
+ }
1549
+
1550
+ /* Create a new Ruby object */
1551
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1552
+ ( own ? VOIDFUNC(sklass->destroy) :
1553
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1554
+ ), ptr);
1555
+
1556
+ /* If tracking is on for this class then track this object. */
1557
+ if (track) {
1558
+ SWIG_RubyAddTracking(ptr, obj);
1559
+ }
1560
+ } else {
1561
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1562
+ sprintf(klass_name, "TYPE%s", type->name);
1563
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1564
+ free((void *) klass_name);
1565
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1566
+ }
1567
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1568
+
1569
+ return obj;
1570
+ }
1571
+
1572
+ /* Create a new class instance (always owned) */
1573
+ SWIGRUNTIME VALUE
1574
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1575
+ {
1576
+ VALUE obj;
1577
+ swig_class *sklass = (swig_class *) type->clientdata;
1578
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1579
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1580
+ return obj;
1581
+ }
1582
+
1583
+ /* Get type mangle from class name */
1584
+ SWIGRUNTIMEINLINE char *
1585
+ SWIG_Ruby_MangleStr(VALUE obj)
1586
+ {
1587
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1588
+ return StringValuePtr(stype);
1589
+ }
1590
+
1591
+ /* Acquire a pointer value */
1592
+ typedef void (*ruby_owntype)(void*);
1593
+
1594
+ SWIGRUNTIME ruby_owntype
1595
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1596
+ if (obj) {
1597
+ ruby_owntype oldown = RDATA(obj)->dfree;
1598
+ RDATA(obj)->dfree = own;
1599
+ return oldown;
1600
+ } else {
1601
+ return 0;
1602
+ }
1603
+ }
1604
+
1605
+ /* Convert a pointer value */
1606
+ SWIGRUNTIME int
1607
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1608
+ {
1609
+ char *c;
1610
+ swig_cast_info *tc;
1611
+ void *vptr = 0;
1612
+
1613
+ /* Grab the pointer */
1614
+ if (NIL_P(obj)) {
1615
+ *ptr = 0;
1616
+ return SWIG_OK;
1617
+ } else {
1618
+ if (TYPE(obj) != T_DATA) {
1619
+ return SWIG_ERROR;
1620
+ }
1621
+ Data_Get_Struct(obj, void, vptr);
1622
+ }
1623
+
1624
+ if (own) *own = RDATA(obj)->dfree;
1625
+
1626
+ /* Check to see if the input object is giving up ownership
1627
+ of the underlying C struct or C++ object. If so then we
1628
+ need to reset the destructor since the Ruby object no
1629
+ longer owns the underlying C++ object.*/
1630
+ if (flags & SWIG_POINTER_DISOWN) {
1631
+ /* Is tracking on for this class? */
1632
+ int track = 0;
1633
+ if (ty && ty->clientdata) {
1634
+ swig_class *sklass = (swig_class *) ty->clientdata;
1635
+ track = sklass->trackObjects;
1636
+ }
1637
+
1638
+ if (track) {
1639
+ /* We are tracking objects for this class. Thus we change the destructor
1640
+ * to SWIG_RubyRemoveTracking. This allows us to
1641
+ * remove the mapping from the C++ to Ruby object
1642
+ * when the Ruby object is garbage collected. If we don't
1643
+ * do this, then it is possible we will return a reference
1644
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1645
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1646
+ } else {
1647
+ RDATA(obj)->dfree = 0;
1648
+ }
1649
+ }
1650
+
1651
+ /* Do type-checking if type info was provided */
1652
+ if (ty) {
1653
+ if (ty->clientdata) {
1654
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1655
+ if (vptr == 0) {
1656
+ /* The object has already been deleted */
1657
+ return SWIG_ObjectPreviouslyDeletedError;
1658
+ }
1659
+ *ptr = vptr;
1660
+ return SWIG_OK;
1661
+ }
1662
+ }
1663
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1664
+ return SWIG_ERROR;
1665
+ }
1666
+ tc = SWIG_TypeCheck(c, ty);
1667
+ if (!tc) {
1668
+ return SWIG_ERROR;
1669
+ } else {
1670
+ int newmemory = 0;
1671
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1672
+ assert(!newmemory); /* newmemory handling not yet implemented */
1673
+ }
1674
+ } else {
1675
+ *ptr = vptr;
1676
+ }
1677
+
1678
+ return SWIG_OK;
1679
+ }
1680
+
1681
+ /* Check convert */
1682
+ SWIGRUNTIMEINLINE int
1683
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1684
+ {
1685
+ char *c = SWIG_MangleStr(obj);
1686
+ if (!c) return 0;
1687
+ return SWIG_TypeCheck(c,ty) != 0;
1688
+ }
1689
+
1690
+ SWIGRUNTIME VALUE
1691
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1692
+ char result[1024];
1693
+ char *r = result;
1694
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1695
+ *(r++) = '_';
1696
+ r = SWIG_PackData(r, ptr, sz);
1697
+ strcpy(r, type->name);
1698
+ return rb_str_new2(result);
1699
+ }
1700
+
1701
+ /* Convert a packed value value */
1702
+ SWIGRUNTIME int
1703
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1704
+ swig_cast_info *tc;
1705
+ const char *c;
1706
+
1707
+ if (TYPE(obj) != T_STRING) goto type_error;
1708
+ c = StringValuePtr(obj);
1709
+ /* Pointer values must start with leading underscore */
1710
+ if (*c != '_') goto type_error;
1711
+ c++;
1712
+ c = SWIG_UnpackData(c, ptr, sz);
1713
+ if (ty) {
1714
+ tc = SWIG_TypeCheck(c, ty);
1715
+ if (!tc) goto type_error;
1716
+ }
1717
+ return SWIG_OK;
1718
+
1719
+ type_error:
1720
+ return SWIG_ERROR;
1721
+ }
1722
+
1723
+ SWIGRUNTIME swig_module_info *
1724
+ SWIG_Ruby_GetModule(void)
1725
+ {
1726
+ VALUE pointer;
1727
+ swig_module_info *ret = 0;
1728
+ VALUE verbose = rb_gv_get("VERBOSE");
1729
+
1730
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1731
+ rb_gv_set("VERBOSE", Qfalse);
1732
+
1733
+ /* first check if pointer already created */
1734
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1735
+ if (pointer != Qnil) {
1736
+ Data_Get_Struct(pointer, swig_module_info, ret);
1737
+ }
1738
+
1739
+ /* reinstate warnings */
1740
+ rb_gv_set("VERBOSE", verbose);
1741
+ return ret;
1742
+ }
1743
+
1744
+ SWIGRUNTIME void
1745
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1746
+ {
1747
+ /* register a new class */
1748
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1749
+ /* create and store the structure pointer to a global variable */
1750
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1751
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1752
+ }
1753
+
1754
+ /* This function can be used to check whether a proc or method or similarly
1755
+ callable function has been passed. Usually used in a %typecheck, like:
1756
+
1757
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1758
+ $result = SWIG_Ruby_isCallable( $input );
1759
+ }
1760
+ */
1761
+ SWIGINTERN
1762
+ int SWIG_Ruby_isCallable( VALUE proc )
1763
+ {
1764
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1765
+ return 1;
1766
+ return 0;
1767
+ }
1768
+
1769
+ /* This function can be used to check the arity (number of arguments)
1770
+ a proc or method can take. Usually used in a %typecheck.
1771
+ Valid arities will be that equal to minimal or those < 0
1772
+ which indicate a variable number of parameters at the end.
1773
+ */
1774
+ SWIGINTERN
1775
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1776
+ {
1777
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1778
+ {
1779
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1780
+ int arity = NUM2INT(num);
1781
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1782
+ if ( arity == minimal ) return 1;
1783
+ return 1;
1784
+ }
1785
+ return 0;
1786
+ }
1787
+
1788
+
1789
+ #ifdef __cplusplus
1790
+ }
1791
+ #endif
1792
+
1793
+
1794
+
1795
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1796
+
1797
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1798
+
1799
+
1800
+
1801
+ /* -------- TYPES TABLE (BEGIN) -------- */
1802
+
1803
+ #define SWIGTYPE_p_char swig_types[0]
1804
+ static swig_type_info *swig_types[2];
1805
+ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1806
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1807
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1808
+
1809
+ /* -------- TYPES TABLE (END) -------- */
1810
+
1811
+ #define SWIG_init Init_RawSensorsNative
1812
+ #define SWIG_name "RawSensorsNative"
1813
+
1814
+ static VALUE mRawSensorsNative;
1815
+
1816
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1817
+ #define SWIG_RUBY_THREAD_END_BLOCK
1818
+
1819
+
1820
+ #define SWIGVERSION 0x020004
1821
+ #define SWIG_VERSION SWIGVERSION
1822
+
1823
+
1824
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1825
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1826
+
1827
+
1828
+ #include "ruby/ext/rho/rhoruby.h"
1829
+
1830
+ extern VALUE rawsensors_get_property(const char* property_name);
1831
+ extern void rawsensors_set_property(const char* property_name, const char* value);
1832
+ extern VALUE rawsensors_is_available(const char* sensor_name);
1833
+ extern void rawsensors_getSensorData();
1834
+
1835
+ #define get_property rawsensors_get_property
1836
+ #define set_property rawsensors_set_property
1837
+ #define is_available rawsensors_is_available
1838
+ #define getSensorData rawsensors_getSensorData
1839
+
1840
+
1841
+
1842
+
1843
+ SWIGINTERN swig_type_info*
1844
+ SWIG_pchar_descriptor(void)
1845
+ {
1846
+ static int init = 0;
1847
+ static swig_type_info* info = 0;
1848
+ if (!init) {
1849
+ info = SWIG_TypeQuery("_p_char");
1850
+ init = 1;
1851
+ }
1852
+ return info;
1853
+ }
1854
+
1855
+
1856
+ SWIGINTERN int
1857
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1858
+ {
1859
+ if (TYPE(obj) == T_STRING) {
1860
+ #if defined(StringValuePtr)
1861
+ char *cstr = StringValuePtr(obj);
1862
+ #else
1863
+ char *cstr = STR2CSTR(obj);
1864
+ #endif
1865
+ size_t size = RSTRING_LEN(obj) + 1;
1866
+ if (cptr) {
1867
+ if (alloc) {
1868
+ if (*alloc == SWIG_NEWOBJ) {
1869
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1870
+ } else {
1871
+ *cptr = cstr;
1872
+ *alloc = SWIG_OLDOBJ;
1873
+ }
1874
+ }
1875
+ }
1876
+ if (psize) *psize = size;
1877
+ return SWIG_OK;
1878
+ } else {
1879
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1880
+ if (pchar_descriptor) {
1881
+ void* vptr = 0;
1882
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1883
+ if (cptr) *cptr = (char *)vptr;
1884
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1885
+ if (alloc) *alloc = SWIG_OLDOBJ;
1886
+ return SWIG_OK;
1887
+ }
1888
+ }
1889
+ }
1890
+ return SWIG_TypeError;
1891
+ }
1892
+
1893
+
1894
+
1895
+
1896
+ SWIGINTERN VALUE
1897
+ _wrap_get_property(int argc, VALUE *argv, VALUE self) {
1898
+ char *arg1 = (char *) 0 ;
1899
+ int res1 ;
1900
+ char *buf1 = 0 ;
1901
+ int alloc1 = 0 ;
1902
+ VALUE result;
1903
+ VALUE vresult = Qnil;
1904
+
1905
+ if ((argc < 1) || (argc > 1)) {
1906
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1907
+ }
1908
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1909
+ if (!SWIG_IsOK(res1)) {
1910
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","get_property", 1, argv[0] ));
1911
+ }
1912
+ arg1 = (char *)(buf1);
1913
+ result = (VALUE)get_property((char const *)arg1);
1914
+ vresult = result;
1915
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1916
+ return vresult;
1917
+ fail:
1918
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1919
+ return Qnil;
1920
+ }
1921
+
1922
+
1923
+ SWIGINTERN VALUE
1924
+ _wrap_set_property(int argc, VALUE *argv, VALUE self) {
1925
+ char *arg1 = (char *) 0 ;
1926
+ char *arg2 = (char *) 0 ;
1927
+ int res1 ;
1928
+ char *buf1 = 0 ;
1929
+ int alloc1 = 0 ;
1930
+ int res2 ;
1931
+ char *buf2 = 0 ;
1932
+ int alloc2 = 0 ;
1933
+
1934
+ if ((argc < 2) || (argc > 2)) {
1935
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
1936
+ }
1937
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1938
+ if (!SWIG_IsOK(res1)) {
1939
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","set_property", 1, argv[0] ));
1940
+ }
1941
+ arg1 = (char *)(buf1);
1942
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1943
+ if (!SWIG_IsOK(res2)) {
1944
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","set_property", 2, argv[1] ));
1945
+ }
1946
+ arg2 = (char *)(buf2);
1947
+ set_property((char const *)arg1,(char const *)arg2);
1948
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1949
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
1950
+ return Qnil;
1951
+ fail:
1952
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1953
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
1954
+ return Qnil;
1955
+ }
1956
+
1957
+
1958
+ SWIGINTERN VALUE
1959
+ _wrap_is_available(int argc, VALUE *argv, VALUE self) {
1960
+ char *arg1 = (char *) 0 ;
1961
+ int res1 ;
1962
+ char *buf1 = 0 ;
1963
+ int alloc1 = 0 ;
1964
+ VALUE result;
1965
+ VALUE vresult = Qnil;
1966
+
1967
+ if ((argc < 1) || (argc > 1)) {
1968
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1969
+ }
1970
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1971
+ if (!SWIG_IsOK(res1)) {
1972
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","is_available", 1, argv[0] ));
1973
+ }
1974
+ arg1 = (char *)(buf1);
1975
+ result = (VALUE)is_available((char const *)arg1);
1976
+ vresult = result;
1977
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1978
+ return vresult;
1979
+ fail:
1980
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1981
+ return Qnil;
1982
+ }
1983
+
1984
+
1985
+ SWIGINTERN VALUE
1986
+ _wrap_getSensorData(int argc, VALUE *argv, VALUE self) {
1987
+ if ((argc < 0) || (argc > 0)) {
1988
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1989
+ }
1990
+ getSensorData();
1991
+ return Qnil;
1992
+ fail:
1993
+ return Qnil;
1994
+ }
1995
+
1996
+
1997
+
1998
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1999
+
2000
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
2001
+
2002
+ static swig_type_info *swig_type_initial[] = {
2003
+ &_swigt__p_char,
2004
+ };
2005
+
2006
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2007
+
2008
+ static swig_cast_info *swig_cast_initial[] = {
2009
+ _swigc__p_char,
2010
+ };
2011
+
2012
+
2013
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2014
+
2015
+ /* -----------------------------------------------------------------------------
2016
+ * Type initialization:
2017
+ * This problem is tough by the requirement that no dynamic
2018
+ * memory is used. Also, since swig_type_info structures store pointers to
2019
+ * swig_cast_info structures and swig_cast_info structures store pointers back
2020
+ * to swig_type_info structures, we need some lookup code at initialization.
2021
+ * The idea is that swig generates all the structures that are needed.
2022
+ * The runtime then collects these partially filled structures.
2023
+ * The SWIG_InitializeModule function takes these initial arrays out of
2024
+ * swig_module, and does all the lookup, filling in the swig_module.types
2025
+ * array with the correct data and linking the correct swig_cast_info
2026
+ * structures together.
2027
+ *
2028
+ * The generated swig_type_info structures are assigned staticly to an initial
2029
+ * array. We just loop through that array, and handle each type individually.
2030
+ * First we lookup if this type has been already loaded, and if so, use the
2031
+ * loaded structure instead of the generated one. Then we have to fill in the
2032
+ * cast linked list. The cast data is initially stored in something like a
2033
+ * two-dimensional array. Each row corresponds to a type (there are the same
2034
+ * number of rows as there are in the swig_type_initial array). Each entry in
2035
+ * a column is one of the swig_cast_info structures for that type.
2036
+ * The cast_initial array is actually an array of arrays, because each row has
2037
+ * a variable number of columns. So to actually build the cast linked list,
2038
+ * we find the array of casts associated with the type, and loop through it
2039
+ * adding the casts to the list. The one last trick we need to do is making
2040
+ * sure the type pointer in the swig_cast_info struct is correct.
2041
+ *
2042
+ * First off, we lookup the cast->type name to see if it is already loaded.
2043
+ * There are three cases to handle:
2044
+ * 1) If the cast->type has already been loaded AND the type we are adding
2045
+ * casting info to has not been loaded (it is in this module), THEN we
2046
+ * replace the cast->type pointer with the type pointer that has already
2047
+ * been loaded.
2048
+ * 2) If BOTH types (the one we are adding casting info to, and the
2049
+ * cast->type) are loaded, THEN the cast info has already been loaded by
2050
+ * the previous module so we just ignore it.
2051
+ * 3) Finally, if cast->type has not already been loaded, then we add that
2052
+ * swig_cast_info to the linked list (because the cast->type) pointer will
2053
+ * be correct.
2054
+ * ----------------------------------------------------------------------------- */
2055
+
2056
+ #ifdef __cplusplus
2057
+ extern "C" {
2058
+ #if 0
2059
+ } /* c-mode */
2060
+ #endif
2061
+ #endif
2062
+
2063
+ #if 0
2064
+ #define SWIGRUNTIME_DEBUG
2065
+ #endif
2066
+
2067
+
2068
+ SWIGRUNTIME void
2069
+ SWIG_InitializeModule(void *clientdata) {
2070
+ size_t i;
2071
+ swig_module_info *module_head, *iter;
2072
+ int found, init;
2073
+
2074
+ clientdata = clientdata;
2075
+
2076
+ // clear static variables for support reinitialization
2077
+ #ifdef SWIG_rb_eNullReferenceError_defined
2078
+ SWIG_rb_eNullReferenceError = Qnil;
2079
+ #endif
2080
+ #ifdef SWIG_rb_eObjectPreviouslyDeleted_defined
2081
+ SWIG_rb_eObjectPreviouslyDeleted = Qnil;
2082
+ #endif
2083
+ //#ifdef _mSWIG_defined
2084
+ // _mSWIG = Qnil;
2085
+ //#endif
2086
+ #ifdef _cSWIG_Pointer_defined
2087
+ _cSWIG_Pointer = Qnil;
2088
+ #endif
2089
+ #ifdef swig_runtime_data_type_pointer_defined
2090
+ swig_runtime_data_type_pointer = Qnil;
2091
+ #endif
2092
+ #ifdef swig_arity_id_defined
2093
+ swig_arity_id = 0;
2094
+ #endif
2095
+ #ifdef swig_call_id_defined
2096
+ swig_call_id = 0;
2097
+ #endif
2098
+ #ifdef swig_virtual_calls_defined
2099
+ swig_virtual_calls = 0;
2100
+ #endif
2101
+ #ifdef swig_ruby_trackings_defined
2102
+ swig_ruby_trackings = Qnil;
2103
+ #endif
2104
+ #ifdef swig_ruby_hash_delete_defined
2105
+ swig_ruby_hash_delete = 0;
2106
+ #endif
2107
+
2108
+
2109
+ /* check to see if the circular list has been setup, if not, set it up */
2110
+ if (swig_module.next==0) {
2111
+ /* Initialize the swig_module */
2112
+ swig_module.type_initial = swig_type_initial;
2113
+ swig_module.cast_initial = swig_cast_initial;
2114
+ swig_module.next = &swig_module;
2115
+ init = 1;
2116
+ } else {
2117
+ init = 0;
2118
+ }
2119
+
2120
+ /* Try and load any already created modules */
2121
+ module_head = SWIG_GetModule(clientdata);
2122
+ if (!module_head) {
2123
+ /* This is the first module loaded for this interpreter */
2124
+ /* so set the swig module into the interpreter */
2125
+ SWIG_SetModule(clientdata, &swig_module);
2126
+ module_head = &swig_module;
2127
+ } else {
2128
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
2129
+ found=0;
2130
+ iter=module_head;
2131
+ do {
2132
+ if (iter==&swig_module) {
2133
+ found=1;
2134
+ break;
2135
+ }
2136
+ iter=iter->next;
2137
+ } while (iter!= module_head);
2138
+
2139
+ /* if the is found in the list, then all is done and we may leave */
2140
+ if (found) return;
2141
+ /* otherwise we must add out module into the list */
2142
+ swig_module.next = module_head->next;
2143
+ module_head->next = &swig_module;
2144
+ }
2145
+
2146
+ /* When multiple interpeters are used, a module could have already been initialized in
2147
+ a different interpreter, but not yet have a pointer in this interpreter.
2148
+ In this case, we do not want to continue adding types... everything should be
2149
+ set up already */
2150
+ if (init == 0) return;
2151
+
2152
+ /* Now work on filling in swig_module.types */
2153
+ #ifdef SWIGRUNTIME_DEBUG
2154
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2155
+ #endif
2156
+ for (i = 0; i < swig_module.size; ++i) {
2157
+ swig_type_info *type = 0;
2158
+ swig_type_info *ret;
2159
+ swig_cast_info *cast;
2160
+
2161
+ #ifdef SWIGRUNTIME_DEBUG
2162
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2163
+ #endif
2164
+
2165
+ /* if there is another module already loaded */
2166
+ if (swig_module.next != &swig_module) {
2167
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2168
+ }
2169
+ if (type) {
2170
+ /* Overwrite clientdata field */
2171
+ #ifdef SWIGRUNTIME_DEBUG
2172
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
2173
+ #endif
2174
+ if (swig_module.type_initial[i]->clientdata) {
2175
+ type->clientdata = swig_module.type_initial[i]->clientdata;
2176
+ #ifdef SWIGRUNTIME_DEBUG
2177
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2178
+ #endif
2179
+ }
2180
+ } else {
2181
+ type = swig_module.type_initial[i];
2182
+ }
2183
+
2184
+ /* Insert casting types */
2185
+ cast = swig_module.cast_initial[i];
2186
+ while (cast->type) {
2187
+
2188
+ /* Don't need to add information already in the list */
2189
+ ret = 0;
2190
+ #ifdef SWIGRUNTIME_DEBUG
2191
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2192
+ #endif
2193
+ if (swig_module.next != &swig_module) {
2194
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2195
+ #ifdef SWIGRUNTIME_DEBUG
2196
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2197
+ #endif
2198
+ }
2199
+ if (ret) {
2200
+ if (type == swig_module.type_initial[i]) {
2201
+ #ifdef SWIGRUNTIME_DEBUG
2202
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2203
+ #endif
2204
+ cast->type = ret;
2205
+ ret = 0;
2206
+ } else {
2207
+ /* Check for casting already in the list */
2208
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2209
+ #ifdef SWIGRUNTIME_DEBUG
2210
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2211
+ #endif
2212
+ if (!ocast) ret = 0;
2213
+ }
2214
+ }
2215
+
2216
+ if (!ret) {
2217
+ #ifdef SWIGRUNTIME_DEBUG
2218
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2219
+ #endif
2220
+ if (type->cast) {
2221
+ type->cast->prev = cast;
2222
+ cast->next = type->cast;
2223
+ }
2224
+ type->cast = cast;
2225
+ }
2226
+ cast++;
2227
+ }
2228
+ /* Set entry in modules->types array equal to the type */
2229
+ swig_module.types[i] = type;
2230
+ }
2231
+ swig_module.types[i] = 0;
2232
+
2233
+ #ifdef SWIGRUNTIME_DEBUG
2234
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
2235
+ for (i = 0; i < swig_module.size; ++i) {
2236
+ int j = 0;
2237
+ swig_cast_info *cast = swig_module.cast_initial[i];
2238
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2239
+ while (cast->type) {
2240
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2241
+ cast++;
2242
+ ++j;
2243
+ }
2244
+ printf("---- Total casts: %d\n",j);
2245
+ }
2246
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
2247
+ #endif
2248
+ }
2249
+
2250
+ /* This function will propagate the clientdata field of type to
2251
+ * any new swig_type_info structures that have been added into the list
2252
+ * of equivalent types. It is like calling
2253
+ * SWIG_TypeClientData(type, clientdata) a second time.
2254
+ */
2255
+ SWIGRUNTIME void
2256
+ SWIG_PropagateClientData(void) {
2257
+ size_t i;
2258
+ swig_cast_info *equiv;
2259
+ static int init_run = 0;
2260
+
2261
+ if (init_run) return;
2262
+ init_run = 1;
2263
+
2264
+ for (i = 0; i < swig_module.size; i++) {
2265
+ if (swig_module.types[i]->clientdata) {
2266
+ equiv = swig_module.types[i]->cast;
2267
+ while (equiv) {
2268
+ if (!equiv->converter) {
2269
+ if (equiv->type && !equiv->type->clientdata)
2270
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2271
+ }
2272
+ equiv = equiv->next;
2273
+ }
2274
+ }
2275
+ }
2276
+ }
2277
+
2278
+ #ifdef __cplusplus
2279
+ #if 0
2280
+ { /* c-mode */
2281
+ #endif
2282
+ }
2283
+ #endif
2284
+
2285
+ /*
2286
+
2287
+ */
2288
+ #ifdef __cplusplus
2289
+ extern "C"
2290
+ #endif
2291
+ SWIGEXPORT void Init_RawSensorsNative(void) {
2292
+ size_t i;
2293
+
2294
+ SWIG_InitRuntime();
2295
+ mRawSensorsNative = rb_define_module("RawSensorsNative");
2296
+
2297
+ SWIG_InitializeModule(0);
2298
+ for (i = 0; i < swig_module.size; i++) {
2299
+ SWIG_define_class(swig_module.types[i]);
2300
+ }
2301
+
2302
+ SWIG_RubyInitializeTrackings();
2303
+ rb_define_module_function(mRawSensorsNative, "get_property", _wrap_get_property, -1);
2304
+ rb_define_module_function(mRawSensorsNative, "set_property", _wrap_set_property, -1);
2305
+ rb_define_module_function(mRawSensorsNative, "is_available", _wrap_is_available, -1);
2306
+ rb_define_module_function(mRawSensorsNative, "getSensorData", _wrap_getSensorData, -1);
2307
+ }
2308
+