rhodes 2.3.2 → 2.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (623) hide show
  1. data/CHANGELOG +18 -0
  2. data/CREDITS +38 -0
  3. data/README.md +2 -2
  4. data/Rakefile +60 -2
  5. data/bin/set-rhodes-sdk.bat +1 -0
  6. data/doc/application.txt +11 -0
  7. data/doc/build.txt +156 -39
  8. data/doc/configuration.txt +1 -10
  9. data/doc/connect-to-web-services.txt +6 -6
  10. data/doc/device-caps.txt +48 -5
  11. data/doc/extensions.txt +8 -1
  12. data/doc/rhom.txt +16 -0
  13. data/doc/synchronization.txt +56 -14
  14. data/doc/ui.txt +23 -2
  15. data/installer/instant-rhodes.nsi +6 -6
  16. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +4 -2
  17. data/lib/extensions/barcode/ext/barcode/platform/wm/Rakefile +1 -1
  18. data/lib/extensions/digest-md5/ext/Rakefile +3 -3
  19. data/lib/extensions/digest-md5/ext/build +0 -1
  20. data/lib/extensions/digest-sha1/ext/Rakefile +1 -1
  21. data/lib/extensions/digest-sha1/ext/build +0 -1
  22. data/lib/extensions/digest/ext/Rakefile +3 -3
  23. data/lib/extensions/digest/ext/build +0 -1
  24. data/lib/extensions/fcntl/ext/Rakefile +1 -1
  25. data/lib/extensions/mspec/mspec/guards/guard.rb +4 -0
  26. data/lib/extensions/mspec/mspec/helpers/environment.rb +4 -0
  27. data/lib/extensions/nfc/ext.yml +2 -0
  28. data/lib/extensions/nfc/ext/build +12 -0
  29. data/lib/extensions/nfc/ext/build.bat +8 -0
  30. data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +25 -0
  31. data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +94 -0
  32. data/lib/extensions/nfc/ext/nfc/platform/android/ext_build.files +4 -0
  33. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +404 -0
  34. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/Nfc.java +138 -0
  35. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessage.java +34 -0
  36. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessagePack.java +33 -0
  37. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcRecord.java +149 -0
  38. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +22 -0
  39. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +2034 -0
  40. data/lib/extensions/nfc/nfc.rb +120 -0
  41. data/lib/extensions/rholang/{lang_ca.rb → rholang/lang_ca.rb} +0 -0
  42. data/lib/extensions/rholang/{lang_cf.rb → rholang/lang_cf.rb} +0 -0
  43. data/lib/extensions/rholang/{lang_chef.rb → rholang/lang_chef.rb} +0 -0
  44. data/lib/extensions/rholang/{lang_cs.rb → rholang/lang_cs.rb} +0 -0
  45. data/lib/extensions/rholang/{lang_da.rb → rholang/lang_da.rb} +0 -0
  46. data/lib/extensions/rholang/{lang_de.rb → rholang/lang_de.rb} +0 -0
  47. data/lib/extensions/rholang/{lang_es.rb → rholang/lang_es.rb} +0 -0
  48. data/lib/extensions/rholang/{lang_es_ar.rb → rholang/lang_es_ar.rb} +0 -0
  49. data/lib/extensions/rholang/{lang_fi.rb → rholang/lang_fi.rb} +0 -0
  50. data/lib/extensions/rholang/{lang_fr.rb → rholang/lang_fr.rb} +0 -0
  51. data/lib/extensions/rholang/{lang_it.rb → rholang/lang_it.rb} +0 -0
  52. data/lib/extensions/rholang/{lang_ko.rb → rholang/lang_ko.rb} +0 -0
  53. data/lib/extensions/rholang/{lang_nl.rb → rholang/lang_nl.rb} +0 -0
  54. data/lib/extensions/rholang/{lang_no.rb → rholang/lang_no.rb} +0 -0
  55. data/lib/extensions/rholang/{lang_pt.rb → rholang/lang_pt.rb} +0 -0
  56. data/lib/extensions/rholang/{lang_pt_br.rb → rholang/lang_pt_br.rb} +0 -0
  57. data/lib/extensions/rholang/{lang_ru.rb → rholang/lang_ru.rb} +0 -0
  58. data/lib/extensions/rholang/{lang_se.rb → rholang/lang_se.rb} +0 -0
  59. data/lib/extensions/rholang/{lang_sr.rb → rholang/lang_sr.rb} +0 -0
  60. data/lib/extensions/rholang/{rhoerror_ru.rb → rholang/rhoerror_ru.rb} +0 -0
  61. data/lib/extensions/rholang/{rhomsg_ru.rb → rholang/rhomsg_ru.rb} +0 -0
  62. data/lib/framework/date/format.rb +2 -0
  63. data/lib/framework/dateOrig.rb +17 -8
  64. data/lib/framework/rational18.rb +532 -0
  65. data/lib/framework/res/back_btn.wp7.png +0 -0
  66. data/lib/framework/res/blue_pushpin.wp7.png +0 -0
  67. data/lib/framework/res/blue_pushpin_small.wp7.png +0 -0
  68. data/lib/framework/res/callout.wp7.png +0 -0
  69. data/lib/framework/res/callout_link.wp7.png +0 -0
  70. data/lib/framework/res/esri.wp7.png +0 -0
  71. data/lib/framework/res/forward_btn.wp7.png +0 -0
  72. data/lib/framework/res/home_btn.wp7.png +0 -0
  73. data/lib/framework/res/options_btn.wp7.png +0 -0
  74. data/lib/framework/res/refresh_btn.wp7.png +0 -0
  75. data/lib/framework/rho/render.rb +8 -1
  76. data/lib/framework/rho/rho.rb +30 -7
  77. data/lib/framework/rho/rhoapplication.rb +9 -4
  78. data/lib/framework/rho/rhofsconnector.rb +5 -1
  79. data/lib/framework/rho/rhotabbar.rb +8 -0
  80. data/lib/framework/rho/rhotoolbar.rb +1 -1
  81. data/lib/framework/rho/rhoviewhelpers.rb +18 -1
  82. data/lib/framework/rhodes.rb +1 -1
  83. data/lib/framework/rhoframework.rb +46 -1
  84. data/lib/framework/rholang/localization_simplified.rb +17 -16
  85. data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
  86. data/lib/framework/rhom/rhom_object_factory.rb +115 -12
  87. data/lib/framework/rhosystem.rb +135 -0
  88. data/lib/framework/version.rb +1 -1
  89. data/lib/rhodes.rb +1 -1
  90. data/lib/test/apps/rhoconfig.txt +23 -23
  91. data/platform/android/Rhodes/AndroidManifest.full.xml +101 -0
  92. data/platform/android/Rhodes/AndroidManifest.xml +10 -15
  93. data/platform/android/Rhodes/default.properties +11 -0
  94. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +59 -53
  95. data/platform/android/Rhodes/jni/include/rhodes.h +1 -0
  96. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesApplication.h +21 -0
  97. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_alert_PopupActivity.h +21 -0
  98. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +10 -2
  99. data/platform/android/Rhodes/jni/src/alert.cpp +2 -1
  100. data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -0
  101. data/platform/android/Rhodes/jni/src/fileapi.cpp +671 -84
  102. data/platform/android/Rhodes/jni/src/nativebar.cpp +18 -0
  103. data/platform/android/Rhodes/jni/src/rhodes.cpp +92 -1
  104. data/platform/android/Rhodes/res/values/styles.xml +7 -0
  105. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +35 -2
  106. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -13
  107. data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +130 -0
  108. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +6 -0
  109. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +5 -1
  110. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +6 -2
  111. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +7 -36
  112. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +43 -20
  113. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +2 -0
  114. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +63 -28
  115. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +2 -2
  116. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +6 -2
  117. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +19 -282
  118. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +354 -0
  119. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +4 -0
  120. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -2
  121. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +71 -5
  122. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +107 -37
  123. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -7
  124. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +156 -56
  125. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +0 -1
  126. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +40 -32
  127. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +1 -0
  128. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/ExternalHttpHandler.java +14 -6
  129. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +46 -0
  130. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +4 -24
  131. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +3 -1
  132. data/platform/android/build/RhodesSRC_build.files +28 -25
  133. data/platform/android/build/android.rake +230 -54
  134. data/platform/android/build/androidcommon.rb +1 -1
  135. data/platform/android/build/librhocommon_build.files +1 -0
  136. data/platform/bb/Hsqldb/BlackBerry_App_Descriptor.xml +20 -0
  137. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +1 -5
  138. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
  139. data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBase.java +1 -1
  140. data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBinary.java +1 -1
  141. data/platform/bb/RubyVM/BlackBerry_App_Descriptor.xml +20 -0
  142. data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -0
  143. data/platform/bb/RubyVM/src/com/rho/RhoLogOutputSink.java +0 -1
  144. data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +12 -10
  145. data/platform/bb/RubyVM/src/com/rho/RhoThread.java +16 -0
  146. data/platform/bb/RubyVM/src/com/rho/RhoTimer.java +89 -0
  147. data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +20 -13
  148. data/platform/bb/RubyVM/src/com/rho/SplashScreen.java +1 -2
  149. data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +2 -2
  150. data/platform/bb/RubyVM/src/com/rho/TimeInterval.java +5 -0
  151. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +54 -48
  152. data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +0 -1
  153. data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -0
  154. data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +1 -1
  155. data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
  156. data/platform/bb/RubyVM/src/com/rho/sync/JSONStructIterator.java +1 -1
  157. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +16 -8
  158. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +2 -2
  159. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +52 -29
  160. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -3
  161. data/platform/bb/build/RubyVM_build.files +1 -0
  162. data/platform/bb/build/bb.rake +29 -9
  163. data/platform/bb/rhodes/BlackBerry_App_Descriptor.xml +23 -0
  164. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +1 -1
  165. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +0 -4
  166. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +13 -20
  167. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +183 -157
  168. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +22 -0
  169. data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +1 -1
  170. data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +0 -4
  171. data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +13 -20
  172. data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +183 -157
  173. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +46 -1
  174. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +8 -1
  175. data/platform/bb/rhodes/src/rhomobile/camera/CameraFilesListener.java +13 -3
  176. data/platform/iphone/Classes/AppManager/AppManager.h +5 -1
  177. data/platform/iphone/Classes/AppManager/AppManager.m +170 -7
  178. data/platform/iphone/Classes/DateTimePicker.m +14 -1
  179. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  180. data/platform/iphone/Classes/DateTimePickerDelegate.m +36 -2
  181. data/platform/iphone/Classes/NativeBar.h +1 -0
  182. data/platform/iphone/Classes/NativeBar.m +15 -3
  183. data/platform/iphone/Classes/Phonebook/phonebook.m +8 -9
  184. data/platform/iphone/Classes/Rhodes.m +50 -6
  185. data/platform/iphone/Classes/SimpleMainView.m +7 -6
  186. data/platform/iphone/Classes/SplitView/RightViewController.h +3 -1
  187. data/platform/iphone/Classes/SplitView/RightViewController.m +14 -1
  188. data/platform/iphone/Classes/TabbedMainView.h +4 -0
  189. data/platform/iphone/Classes/TabbedMainView.m +43 -26
  190. data/platform/iphone/Info.plist +1 -1
  191. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
  192. data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +3 -3
  193. data/platform/iphone/rbuild/iphone.rake +168 -119
  194. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -2
  195. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +3 -3
  196. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +2 -2
  197. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +3 -3
  198. data/platform/shared/SyncClient/SyncClient.cpp +20 -8
  199. data/platform/shared/SyncClient/SyncClient.h +2 -1
  200. data/platform/shared/common/RhoDefs.h +4 -0
  201. data/platform/shared/common/RhoPort.h +22 -0
  202. data/platform/shared/common/RhoStd.h +5 -0
  203. data/platform/shared/common/RhoTime.cpp +73 -0
  204. data/platform/shared/common/RhoTime.h +26 -53
  205. data/platform/shared/common/RhodesApp.cpp +29 -28
  206. data/platform/shared/common/RhodesApp.h +4 -1
  207. data/platform/shared/common/StringConverter.h +37 -10
  208. data/platform/shared/common/app_build_capabilities.h +2 -0
  209. data/platform/shared/common/rhoparams.cpp +25 -12
  210. data/platform/shared/common/rhoparams.h +10 -8
  211. data/platform/shared/db/DBAdapter.cpp +0 -22
  212. data/platform/shared/json/RJSONTokener.c +15 -23
  213. data/platform/shared/net/AsyncHttp.cpp +9 -8
  214. data/platform/shared/net/HttpServer.cpp +61 -19
  215. data/platform/shared/net/HttpServer.h +2 -0
  216. data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +3 -0
  217. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +151 -402
  218. data/platform/shared/ruby/ext/nativebar/nativebar.i +3 -0
  219. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +154 -403
  220. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  221. data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
  222. data/platform/shared/ruby/ext/system/system.i +8 -0
  223. data/platform/shared/ruby/ext/system/system_wrap.c +80 -5
  224. data/platform/shared/ruby/file.c +6 -4
  225. data/platform/shared/ruby/gc.c +1 -1
  226. data/platform/shared/ruby/linux/ruby/config.h +7 -2
  227. data/platform/shared/ruby/missing/acosh.c +3 -3
  228. data/platform/shared/ruby/wince/_time.h +1 -1
  229. data/platform/shared/ruby/wince/stdlib.c +1 -1
  230. data/platform/shared/ruby/wince/string_wce.c +2 -2
  231. data/platform/shared/ruby/wince/sys/timeb.c +1 -0
  232. data/platform/shared/ruby/wince/time_wce.c +8 -0
  233. data/platform/shared/ruby/wince/wince.c +7 -7
  234. data/platform/shared/ruby/wince/wince.h +22 -0
  235. data/platform/shared/rubyext/System.cpp +19 -1
  236. data/platform/shared/sqlite/sqlite3.c +18993 -8129
  237. data/platform/shared/sqlite/sqlite3.h +953 -358
  238. data/platform/shared/sqlite/sqlite3ext.h +42 -0
  239. data/platform/shared/sync/SyncEngine.cpp +10 -0
  240. data/platform/shared/sync/SyncSource.cpp +41 -19
  241. data/platform/shared/sync/SyncSource.h +1 -1
  242. data/platform/shared/tcmalloc/rhomem.h +7 -2
  243. data/platform/shared/tcmalloc/windows/port.h +2 -0
  244. data/platform/shared/unzip/unzip.cpp +1 -0
  245. data/platform/shared/xruby/src/com/xruby/compiler/parser/RubyParser.java +11 -1
  246. data/platform/wm/RhoLib/RhoLib.vcproj +182 -24
  247. data/platform/wm/build/wm.rake +16 -3
  248. data/platform/wm/rhodes.sln +106 -113
  249. data/platform/wm/rhodes/Alert.cpp +6 -7
  250. data/platform/wm/rhodes/AppManager.cpp +8 -17
  251. data/platform/wm/rhodes/DateTimePicker.cpp +3 -0
  252. data/platform/wm/rhodes/DateTimePicker.h +2 -0
  253. data/platform/wm/rhodes/MainWindow.cpp +36 -16
  254. data/platform/wm/rhodes/MainWindow.h +6 -3
  255. data/platform/wm/rhodes/OutlookApp.cpp +3 -3
  256. data/platform/wm/rhodes/Rhodes.cpp +46 -27
  257. data/platform/wm/rhodes/Rhodes.rc +16 -3
  258. data/platform/wm/rhodes/RingtoneManager.cpp +7 -7
  259. data/platform/wm/rhodes/RingtoneManager.h +1 -1
  260. data/platform/wm/rhodes/Utils.cpp +2 -1
  261. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +1 -13
  262. data/platform/wm/rhodes/bluetooth/Bluetooth.h +1 -2
  263. data/platform/wm/rhodes/camera/Camera.cpp +6 -12
  264. data/platform/wm/rhodes/phonebook/phonebook.cpp +11 -11
  265. data/platform/wm/rhodes/phonebook/phonebook.h +1 -1
  266. data/platform/wm/rhodes/resource.h +3 -1
  267. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +7 -5
  268. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +6 -6
  269. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
  270. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +6 -1
  271. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +84 -19
  272. data/platform/wm/rhodes/rho/rubyext/calendar.cpp +2 -2
  273. data/platform/wm/rhodes/rhodes.vcproj +316 -73
  274. data/platform/wm/rhodes/signature/Signature.cpp +336 -6
  275. data/platform/wm/rhodes/signature/Signature.h +55 -0
  276. data/platform/wm/rhodes/stdafx.h +7 -4
  277. data/platform/wm/rubylib/rubylib.vcproj +261 -91
  278. data/platform/wm/sqlite3/sqlite3.vcproj +223 -69
  279. data/platform/wm/syncengine/syncengine.vcproj +220 -66
  280. data/platform/wm/tcmalloc/tcmalloc.vcproj +197 -43
  281. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/ConsoleStream.cs +107 -0
  282. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/Loader.cs +1037 -0
  283. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +1476 -0
  284. data/platform/wp7/RhoAppRunner/Program.cs +55 -0
  285. data/platform/wp7/RhoAppRunner/Properties/AssemblyInfo.cs +36 -0
  286. data/platform/wp7/RhoAppRunner/RhoAppRunner.csproj +69 -0
  287. data/platform/wp7/RhoRubyExtGen/GenerateInitializers.cmd +7 -0
  288. data/platform/wp7/RhoRubyExtGen/Properties/AssemblyInfo.cs +36 -0
  289. data/platform/wp7/RhoRubyExtGen/RhoAsyncHttp.cs +38 -0
  290. data/platform/wp7/RhoRubyExtGen/RhoDatabase.cs +93 -0
  291. data/platform/wp7/RhoRubyExtGen/RhoJSON.cs +37 -0
  292. data/platform/wp7/RhoRubyExtGen/RhoNativeBar.cs +106 -0
  293. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +75 -0
  294. data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +123 -0
  295. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +42 -0
  296. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +309 -0
  297. data/platform/wp7/RhoRubyLib/Properties/AssemblyInfo.cs +36 -0
  298. data/platform/wp7/RhoRubyLib/RhoAppAdapter.cs +96 -0
  299. data/platform/wp7/RhoRubyLib/RhoRuby.cs +296 -0
  300. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +155 -0
  301. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +107 -0
  302. data/platform/wp7/RhoRubyLib/common/IInputStream.cs +21 -0
  303. data/platform/wp7/RhoRubyLib/common/Mutex.cs +30 -0
  304. data/platform/wp7/RhoRubyLib/common/RhoConf.cs +389 -0
  305. data/platform/wp7/RhoRubyLib/common/RhoEmptyProfiler.cs +27 -0
  306. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +332 -0
  307. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +89 -0
  308. data/platform/wp7/RhoRubyLib/common/RhoParamArray.cs +33 -0
  309. data/platform/wp7/RhoRubyLib/common/RhoParams.cs +66 -0
  310. data/platform/wp7/RhoRubyLib/common/RhoProfiler.cs +145 -0
  311. data/platform/wp7/RhoRubyLib/common/RhoResourceMap.cs +68 -0
  312. data/platform/wp7/RhoRubyLib/common/RhoStd.cs +205 -0
  313. data/platform/wp7/RhoRubyLib/common/RhoThread.cs +114 -0
  314. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +504 -0
  315. data/platform/wp7/RhoRubyLib/common/ThreadQueue.cs +199 -0
  316. data/platform/wp7/RhoRubyLib/common/TimeInterval.cs +56 -0
  317. data/platform/wp7/RhoRubyLib/common/Tokenizer.cs +52 -0
  318. data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +1129 -0
  319. data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +92 -0
  320. data/platform/wp7/RhoRubyLib/db/DBException.cs +35 -0
  321. data/platform/wp7/RhoRubyLib/db/IDBCallback.cs +10 -0
  322. data/platform/wp7/RhoRubyLib/db/IDBResult.cs +33 -0
  323. data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +32 -0
  324. data/platform/wp7/RhoRubyLib/db/SqliteCopyResult.cs +79 -0
  325. data/platform/wp7/RhoRubyLib/db/SqliteResult.cs +267 -0
  326. data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +319 -0
  327. data/platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs +63 -0
  328. data/platform/wp7/RhoRubyLib/json/JSONEntry.cs +96 -0
  329. data/platform/wp7/RhoRubyLib/json/JSONStructIterator.cs +77 -0
  330. data/platform/wp7/RhoRubyLib/json/JsonParser.cs +483 -0
  331. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +406 -0
  332. data/platform/wp7/RhoRubyLib/logging/IRhoLogSink.cs +12 -0
  333. data/platform/wp7/RhoRubyLib/logging/RhoLogConf.cs +161 -0
  334. data/platform/wp7/RhoRubyLib/logging/RhoLogFileSink.cs +174 -0
  335. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +320 -0
  336. data/platform/wp7/RhoRubyLib/net/AsyncHttp.cs +362 -0
  337. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +466 -0
  338. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +717 -0
  339. data/platform/wp7/RhoRubyLib/net/NetResponse.cs +64 -0
  340. data/platform/wp7/RhoRubyLib/net/URI.cs +187 -0
  341. data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +43 -0
  342. data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +177 -0
  343. data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +39 -0
  344. data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +19 -0
  345. data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +117 -0
  346. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +199 -0
  347. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +49 -0
  348. data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +142 -0
  349. data/platform/wp7/RhoRubyLib/sync/ISyncProtocol.cs +23 -0
  350. data/platform/wp7/RhoRubyLib/sync/ISyncStatusListener.cs +10 -0
  351. data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +1051 -0
  352. data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +651 -0
  353. data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +79 -0
  354. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +1105 -0
  355. data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +301 -0
  356. data/platform/wp7/WPApplication.sln +50 -0
  357. data/platform/wp7/WPApplication/App.xaml +19 -0
  358. data/platform/wp7/WPApplication/App.xaml.cs +211 -0
  359. data/platform/wp7/WPApplication/ApplicationIcon.png +0 -0
  360. data/platform/wp7/WPApplication/Background.png +0 -0
  361. data/platform/wp7/WPApplication/MainPage.xaml +44 -0
  362. data/platform/wp7/WPApplication/MainPage.xaml.cs +132 -0
  363. data/platform/wp7/WPApplication/Properties/AppManifest.xml +6 -0
  364. data/platform/wp7/WPApplication/Properties/AssemblyInfo.cs +35 -0
  365. data/platform/wp7/WPApplication/Properties/WMAppManifest.xml +32 -0
  366. data/platform/wp7/WPApplication/SplashScreenImage.jpg +0 -0
  367. data/platform/wp7/WPApplication/WPApplication.csproj +201 -0
  368. data/platform/wp7/WPApplication/WP_PlatformAdaptationLayer.cs +88 -0
  369. data/platform/wp7/WPApplication/app_manifest.txt +1 -0
  370. data/platform/wp7/WPApplication/readme.htm +40 -0
  371. data/platform/wp7/WPApplication/readme2.htm +37 -0
  372. data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.bb.erb +29 -0
  373. data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.erb +32 -0
  374. data/platform/wp7/WPApplication/rho/apps/app/Model1/index.bb.erb +21 -0
  375. data/platform/wp7/WPApplication/rho/apps/app/Model1/index.erb +26 -0
  376. data/platform/wp7/WPApplication/rho/apps/app/Model1/model1.rb +10 -0
  377. data/platform/wp7/WPApplication/rho/apps/app/Model1/model1_controller.rb +58 -0
  378. data/platform/wp7/WPApplication/rho/apps/app/Model1/new.bb.erb +29 -0
  379. data/platform/wp7/WPApplication/rho/apps/app/Model1/new.erb +31 -0
  380. data/platform/wp7/WPApplication/rho/apps/app/Model1/show.bb.erb +26 -0
  381. data/platform/wp7/WPApplication/rho/apps/app/Model1/show.erb +28 -0
  382. data/platform/wp7/WPApplication/rho/apps/app/Settings/controller.rb +75 -0
  383. data/platform/wp7/WPApplication/rho/apps/app/Settings/home.bb.erb +17 -0
  384. data/platform/wp7/WPApplication/rho/apps/app/Settings/home.erb +20 -0
  385. data/platform/wp7/WPApplication/rho/apps/app/Settings/index.bb.erb +32 -0
  386. data/platform/wp7/WPApplication/rho/apps/app/Settings/index.erb +30 -0
  387. data/platform/wp7/WPApplication/rho/apps/app/Settings/login.bb.erb +35 -0
  388. data/platform/wp7/WPApplication/rho/apps/app/Settings/login.erb +27 -0
  389. data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.bb.erb +15 -0
  390. data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.erb +17 -0
  391. data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.bb.erb +3 -0
  392. data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.erb +5 -0
  393. data/platform/wp7/WPApplication/rho/apps/app/application.rb +16 -0
  394. data/platform/wp7/WPApplication/rho/apps/app/helpers/application_helper.rb +126 -0
  395. data/platform/wp7/WPApplication/rho/apps/app/helpers/browser_helper.rb +18 -0
  396. data/platform/wp7/WPApplication/rho/apps/app/index.bb.erb +26 -0
  397. data/platform/wp7/WPApplication/rho/apps/app/index.erb +26 -0
  398. data/platform/wp7/WPApplication/rho/apps/app/layout.erb +45 -0
  399. data/platform/wp7/WPApplication/rho/apps/app/loading.html +11 -0
  400. data/platform/wp7/WPApplication/rho/apps/app_manifest.txt +1 -0
  401. data/platform/wp7/WPApplication/rho/apps/public/css/android.css +330 -0
  402. data/platform/wp7/WPApplication/rho/apps/public/css/blackberry.css +115 -0
  403. data/platform/wp7/WPApplication/rho/apps/public/css/iphone.css +410 -0
  404. data/platform/wp7/WPApplication/rho/apps/public/css/windows_mobile.css +222 -0
  405. data/platform/wp7/WPApplication/rho/apps/public/images/IUI_LICENSE.txt +21 -0
  406. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_off.png +0 -0
  407. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_on.png +0 -0
  408. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_off.png +0 -0
  409. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_on.png +0 -0
  410. data/platform/wp7/WPApplication/rho/apps/public/images/android/disclosure.png +0 -0
  411. data/platform/wp7/WPApplication/rho/apps/public/images/android/ic_menu_more.png +0 -0
  412. data/platform/wp7/WPApplication/rho/apps/public/images/backButton.png +0 -0
  413. data/platform/wp7/WPApplication/rho/apps/public/images/blueButton.png +0 -0
  414. data/platform/wp7/WPApplication/rho/apps/public/images/cancel.png +0 -0
  415. data/platform/wp7/WPApplication/rho/apps/public/images/grayButton.png +0 -0
  416. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure.png +0 -0
  417. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure_detail.png +0 -0
  418. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/backButton.png +0 -0
  419. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/blueButton.png +0 -0
  420. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/cancel.png +0 -0
  421. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/chevron.png +0 -0
  422. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/grayButton.png +0 -0
  423. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listArrowSel.png +0 -0
  424. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listGroup.png +0 -0
  425. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/loading.gif +0 -0
  426. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/on_off.png +0 -0
  427. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/pinstripes.png +0 -0
  428. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/selection.png +0 -0
  429. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/thumb.png +0 -0
  430. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggle.png +0 -0
  431. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggleOn.png +0 -0
  432. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolButton.png +0 -0
  433. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolbar.png +0 -0
  434. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/whiteButton.png +0 -0
  435. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/radiobutton.png +0 -0
  436. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/select.png +0 -0
  437. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/switch.png +0 -0
  438. data/platform/wp7/WPApplication/rho/apps/public/images/iui-logo-touch-icon.png +0 -0
  439. data/platform/wp7/WPApplication/rho/apps/public/images/listArrow.png +0 -0
  440. data/platform/wp7/WPApplication/rho/apps/public/images/listArrowDown.png +0 -0
  441. data/platform/wp7/WPApplication/rho/apps/public/images/listArrowSel.png +0 -0
  442. data/platform/wp7/WPApplication/rho/apps/public/images/listGroup.png +0 -0
  443. data/platform/wp7/WPApplication/rho/apps/public/images/loading.gif +0 -0
  444. data/platform/wp7/WPApplication/rho/apps/public/images/pinstripes.png +0 -0
  445. data/platform/wp7/WPApplication/rho/apps/public/images/right_button.png +0 -0
  446. data/platform/wp7/WPApplication/rho/apps/public/images/selection.png +0 -0
  447. data/platform/wp7/WPApplication/rho/apps/public/images/thumb.png +0 -0
  448. data/platform/wp7/WPApplication/rho/apps/public/images/toggle.png +0 -0
  449. data/platform/wp7/WPApplication/rho/apps/public/images/toggleOn.png +0 -0
  450. data/platform/wp7/WPApplication/rho/apps/public/images/toolButton.png +0 -0
  451. data/platform/wp7/WPApplication/rho/apps/public/images/toolButton_new.png +0 -0
  452. data/platform/wp7/WPApplication/rho/apps/public/images/toolbar.png +0 -0
  453. data/platform/wp7/WPApplication/rho/apps/public/images/whiteButton.png +0 -0
  454. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch-iphone.css +9 -0
  455. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.css +374 -0
  456. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.js +742 -0
  457. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.transitions.js +60 -0
  458. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jquery.1.3.2.min.js +19 -0
  459. data/platform/wp7/WPApplication/rho/apps/public/js/application.js +1 -0
  460. data/platform/wp7/WPApplication/rho/apps/public/js/rho.js +4 -0
  461. data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation-wm.js +59 -0
  462. data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation.js +11 -0
  463. data/platform/wp7/WPApplication/rho/apps/rhoconfig.txt +32 -0
  464. data/platform/wp7/WPApplication/rhoconfig.txt +32 -0
  465. data/platform/wp7/WPApplication/windows_mobile.css +222 -0
  466. data/platform/wp7/build/wp.rake +261 -0
  467. data/platform/wp7/rhodes.sln +79 -0
  468. data/platform/wp7/rhodes/App.xaml +19 -0
  469. data/platform/wp7/rhodes/App.xaml.cs +144 -0
  470. data/platform/wp7/rhodes/Background.png +0 -0
  471. data/platform/wp7/rhodes/MainPage.xaml +44 -0
  472. data/platform/wp7/rhodes/MainPage.xaml.cs +98 -0
  473. data/platform/wp7/rhodes/Properties/AppManifest.xml +6 -0
  474. data/platform/wp7/rhodes/Properties/AssemblyInfo.cs +35 -0
  475. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +31 -0
  476. data/platform/wp7/rhodes/Rhodes.csproj +127 -0
  477. data/platform/wp7/rhodes/SplashScreenImage.jpg +0 -0
  478. data/platform/wp7/rhodes/icon.png +0 -0
  479. data/platform/wp7/sqlite3/Properties/AssemblyInfo.cs +35 -0
  480. data/platform/wp7/sqlite3/SQLiteClient.cs +550 -0
  481. data/platform/wp7/sqlite3/SqliteWrapper/BtreeInt_h.cs +774 -0
  482. data/platform/wp7/sqlite3/SqliteWrapper/Btree_h.cs +280 -0
  483. data/platform/wp7/sqlite3/SqliteWrapper/ClassDiagram1.cd +1306 -0
  484. data/platform/wp7/sqlite3/SqliteWrapper/Delagates.cs +365 -0
  485. data/platform/wp7/sqlite3/SqliteWrapper/Hash_h.cs +133 -0
  486. data/platform/wp7/sqlite3/SqliteWrapper/VdbeInt_h.cs +620 -0
  487. data/platform/wp7/sqlite3/SqliteWrapper/Vdbe_h.cs +302 -0
  488. data/platform/wp7/sqlite3/SqliteWrapper/_Custom.cs +449 -0
  489. data/platform/wp7/sqlite3/SqliteWrapper/alter_c.cs +872 -0
  490. data/platform/wp7/sqlite3/SqliteWrapper/analyze_c.cs +757 -0
  491. data/platform/wp7/sqlite3/SqliteWrapper/attach_c.cs +628 -0
  492. data/platform/wp7/sqlite3/SqliteWrapper/auth_c.cs +268 -0
  493. data/platform/wp7/sqlite3/SqliteWrapper/backup_c.cs +737 -0
  494. data/platform/wp7/sqlite3/SqliteWrapper/bitvec_c.cs +509 -0
  495. data/platform/wp7/sqlite3/SqliteWrapper/btmutex_c.cs +379 -0
  496. data/platform/wp7/sqlite3/SqliteWrapper/btree_c.cs +9138 -0
  497. data/platform/wp7/sqlite3/SqliteWrapper/build_c.cs +4189 -0
  498. data/platform/wp7/sqlite3/SqliteWrapper/callback_c.cs +548 -0
  499. data/platform/wp7/sqlite3/SqliteWrapper/complete_c.cs +342 -0
  500. data/platform/wp7/sqlite3/SqliteWrapper/ctime_cs.cs +408 -0
  501. data/platform/wp7/sqlite3/SqliteWrapper/date_c.cs +1317 -0
  502. data/platform/wp7/sqlite3/SqliteWrapper/delete_c.cs +726 -0
  503. data/platform/wp7/sqlite3/SqliteWrapper/expr_c.cs +4406 -0
  504. data/platform/wp7/sqlite3/SqliteWrapper/fault_c.cs +115 -0
  505. data/platform/wp7/sqlite3/SqliteWrapper/fkey_c.cs +1330 -0
  506. data/platform/wp7/sqlite3/SqliteWrapper/func_c.cs +2025 -0
  507. data/platform/wp7/sqlite3/SqliteWrapper/global_c.cs +228 -0
  508. data/platform/wp7/sqlite3/SqliteWrapper/hash_c.cs +351 -0
  509. data/platform/wp7/sqlite3/SqliteWrapper/hwtime_c.cs +101 -0
  510. data/platform/wp7/sqlite3/SqliteWrapper/insert_c.cs +2122 -0
  511. data/platform/wp7/sqlite3/SqliteWrapper/journal_c.cs +247 -0
  512. data/platform/wp7/sqlite3/SqliteWrapper/keywordhash_h.cs +302 -0
  513. data/platform/wp7/sqlite3/SqliteWrapper/legacy_c.cs +223 -0
  514. data/platform/wp7/sqlite3/SqliteWrapper/loadext_c.cs +683 -0
  515. data/platform/wp7/sqlite3/SqliteWrapper/main_c.cs +2716 -0
  516. data/platform/wp7/sqlite3/SqliteWrapper/malloc_c.cs +977 -0
  517. data/platform/wp7/sqlite3/SqliteWrapper/mem_Pool.cs +394 -0
  518. data/platform/wp7/sqlite3/SqliteWrapper/memjournal_c.cs +315 -0
  519. data/platform/wp7/sqlite3/SqliteWrapper/mutex_c.cs +182 -0
  520. data/platform/wp7/sqlite3/SqliteWrapper/mutex_h.cs +91 -0
  521. data/platform/wp7/sqlite3/SqliteWrapper/mutex_noop_c.cs +202 -0
  522. data/platform/wp7/sqlite3/SqliteWrapper/mutex_w32.cs +344 -0
  523. data/platform/wp7/sqlite3/SqliteWrapper/notify_c.cs +347 -0
  524. data/platform/wp7/sqlite3/SqliteWrapper/opcodes_c.cs +171 -0
  525. data/platform/wp7/sqlite3/SqliteWrapper/opcodes_h.cs +346 -0
  526. data/platform/wp7/sqlite3/SqliteWrapper/os_c.cs +367 -0
  527. data/platform/wp7/sqlite3/SqliteWrapper/os_common_h.cs +174 -0
  528. data/platform/wp7/sqlite3/SqliteWrapper/os_h.cs +295 -0
  529. data/platform/wp7/sqlite3/SqliteWrapper/os_win_c.cs +1255 -0
  530. data/platform/wp7/sqlite3/SqliteWrapper/pager_c.cs +6078 -0
  531. data/platform/wp7/sqlite3/SqliteWrapper/pager_h.cs +188 -0
  532. data/platform/wp7/sqlite3/SqliteWrapper/parse_c.cs +4045 -0
  533. data/platform/wp7/sqlite3/SqliteWrapper/parse_h.cs +331 -0
  534. data/platform/wp7/sqlite3/SqliteWrapper/pcache1_c.cs +969 -0
  535. data/platform/wp7/sqlite3/SqliteWrapper/pcache_c.cs +712 -0
  536. data/platform/wp7/sqlite3/SqliteWrapper/pcache_h.cs +213 -0
  537. data/platform/wp7/sqlite3/SqliteWrapper/pragma_c.cs +1767 -0
  538. data/platform/wp7/sqlite3/SqliteWrapper/prepare_c.cs +1015 -0
  539. data/platform/wp7/sqlite3/SqliteWrapper/printf_c.cs +1300 -0
  540. data/platform/wp7/sqlite3/SqliteWrapper/random_c.cs +201 -0
  541. data/platform/wp7/sqlite3/SqliteWrapper/resolve_c.cs +1396 -0
  542. data/platform/wp7/sqlite3/SqliteWrapper/rowset_c.cs +519 -0
  543. data/platform/wp7/sqlite3/SqliteWrapper/select_c.cs +4878 -0
  544. data/platform/wp7/sqlite3/SqliteWrapper/sqlite3_h.cs +6253 -0
  545. data/platform/wp7/sqlite3/SqliteWrapper/sqlite3ext_h.cs +397 -0
  546. data/platform/wp7/sqlite3/SqliteWrapper/sqliteInt_h.cs +4075 -0
  547. data/platform/wp7/sqlite3/SqliteWrapper/sqliteLimit_h.cs +214 -0
  548. data/platform/wp7/sqlite3/SqliteWrapper/sqliteicu_h.cs +39 -0
  549. data/platform/wp7/sqlite3/SqliteWrapper/status_c.cs +155 -0
  550. data/platform/wp7/sqlite3/SqliteWrapper/table_c.cs +222 -0
  551. data/platform/wp7/sqlite3/SqliteWrapper/tokenize_c.cs +673 -0
  552. data/platform/wp7/sqlite3/SqliteWrapper/trigger_c.cs +1219 -0
  553. data/platform/wp7/sqlite3/SqliteWrapper/update_c.cs +766 -0
  554. data/platform/wp7/sqlite3/SqliteWrapper/utf_c.cs +612 -0
  555. data/platform/wp7/sqlite3/SqliteWrapper/util_c.cs +1476 -0
  556. data/platform/wp7/sqlite3/SqliteWrapper/vacuum_c.cs +382 -0
  557. data/platform/wp7/sqlite3/SqliteWrapper/vdbe_c.cs +6566 -0
  558. data/platform/wp7/sqlite3/SqliteWrapper/vdbeapi_c.cs +1557 -0
  559. data/platform/wp7/sqlite3/SqliteWrapper/vdbeaux_c.cs +4019 -0
  560. data/platform/wp7/sqlite3/SqliteWrapper/vdbeblob_c.cs +396 -0
  561. data/platform/wp7/sqlite3/SqliteWrapper/vdbemem_c.cs +1480 -0
  562. data/platform/wp7/sqlite3/SqliteWrapper/vdbetrace_c.cs +181 -0
  563. data/platform/wp7/sqlite3/SqliteWrapper/vtab_c.cs +957 -0
  564. data/platform/wp7/sqlite3/SqliteWrapper/walker_c.cs +174 -0
  565. data/platform/wp7/sqlite3/SqliteWrapper/where_c.cs +4651 -0
  566. data/platform/wp7/sqlite3/sqlite3.csproj +155 -0
  567. data/rakefile.rb +60 -2
  568. data/res/build-tools/7za.exe +0 -0
  569. data/res/build-tools/RhoAppRunner.exe +0 -0
  570. data/res/build-tools/xruby-0.3.3.jar +0 -0
  571. data/res/generators/rhogen.rb +9 -1
  572. data/res/generators/templates/application/app/Settings/reset.erb +1 -1
  573. data/res/generators/templates/application/app/layout.erb +17 -10
  574. data/res/generators/templates/application/build.yml +5 -3
  575. data/res/generators/templates/application/public/jqtouch/changes.txt +20 -0
  576. data/res/generators/templates/application/public/jqtouch/jqtouch.js +12 -4
  577. data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
  578. data/res/generators/templates/application/public/js/wp7.js +7 -0
  579. data/res/generators/templates/model/controller.rb +5 -6
  580. data/rhobuild.yml.example +1 -0
  581. data/rhodes.gemspec +2 -1
  582. data/spec/framework_spec/app/spec/core/dir/close_spec.rb +1 -1
  583. data/spec/framework_spec/app/spec/core/dir/shared/pwd.rb +13 -11
  584. data/spec/framework_spec/app/spec/core/env/shared/store.rb +12 -10
  585. data/spec/framework_spec/app/spec/core/env/update_spec.rb +1 -0
  586. data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +3 -2
  587. data/spec/framework_spec/app/spec/core/file/fixtures/file_types.rb +7 -1
  588. data/spec/framework_spec/app/spec/core/file/flock_spec.rb +8 -1
  589. data/spec/framework_spec/app/spec/core/file/ftype_spec.rb +5 -3
  590. data/spec/framework_spec/app/spec/core/file/lchmod_spec.rb +1 -1
  591. data/spec/framework_spec/app/spec/core/file/setgid_spec.rb +1 -1
  592. data/spec/framework_spec/app/spec/core/file/setuid_spec.rb +1 -1
  593. data/spec/framework_spec/app/spec/core/file/stat/ftype_spec.rb +6 -4
  594. data/spec/framework_spec/app/spec/core/file/truncate_spec.rb +5 -1
  595. data/spec/framework_spec/app/spec/core/float/to_s_spec.rb +1 -1
  596. data/spec/framework_spec/app/spec/core/process/gid_spec.rb +5 -3
  597. data/spec/framework_spec/app/spec/core/process/groups_spec.rb +11 -9
  598. data/spec/framework_spec/app/spec/core/process/uid_spec.rb +5 -3
  599. data/spec/framework_spec/app/spec/language/execution_spec.rb +10 -6
  600. data/spec/framework_spec/app/spec/shared/file/directory.rb +6 -1
  601. data/spec/framework_spec/app/spec/shared/file/executable.rb +7 -1
  602. data/spec/framework_spec/app/spec/shared/file/file.rb +6 -1
  603. data/spec/framework_spec/app/spec/shared/file/readable.rb +13 -4
  604. data/spec/framework_spec/app/spec/shared/file/writable.rb +6 -1
  605. data/spec/phone_spec/app/spec/rho_controller_spec.rb +11 -0
  606. data/spec/phone_spec/app/spec/rho_spec.rb +11 -0
  607. data/spec/phone_spec/app/spec/rhom_object_spec.rb +102 -6
  608. data/spec/phone_spec/app/spec/string/end_with_spec.rb +4 -1
  609. data/spec/phone_spec/app/spec/string/slice_spec.rb +5 -1
  610. data/spec/phone_spec/app/spec/string/start_with_spec.rb +4 -0
  611. data/spec/phone_spec/app/spec/syncengine_spec.rb +73 -6
  612. data/spec/phone_spec/app/spec_runner.rb +7 -3
  613. metadata +380 -41
  614. data/Manifest.txt +0 -5819
  615. data/platform/bb/Hsqldb/Hsqldb.cso +0 -5
  616. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -197
  617. data/platform/bb/RhoBundle/RhoBundle.cso +0 -5
  618. data/platform/bb/RhoBundle/RhoBundle.jdp +0 -42
  619. data/platform/bb/RubyVM/RubyVM.cso +0 -5
  620. data/platform/bb/RubyVM/RubyVM.jdp +0 -467
  621. data/platform/bb/rhodes/rhodes.csl +0 -3
  622. data/platform/bb/rhodes/rhodes.cso +0 -5
  623. data/platform/bb/rhodes/rhodes.jdp +0 -104
@@ -0,0 +1,138 @@
1
+ package com.nfc;
2
+
3
+ import android.app.Activity;
4
+ import android.content.BroadcastReceiver;
5
+ import android.content.Context;
6
+ import android.content.Intent;
7
+ import android.nfc.NdefMessage;
8
+ import android.nfc.NdefRecord;
9
+ import android.nfc.NfcAdapter;
10
+ import android.os.Bundle;
11
+ import android.os.Parcelable;
12
+ import android.util.Log;
13
+
14
+ import com.rhomobile.rhodes.PushService;
15
+ import com.rhomobile.rhodes.RhodesActivity;
16
+ import com.rhomobile.rhodes.RhodesService;
17
+ import com.rhomobile.rhodes.Utils;
18
+
19
+ public class Nfc extends BroadcastReceiver {
20
+
21
+
22
+ private static final String TAG = Nfc.class.getSimpleName();
23
+
24
+ private static boolean ourIsEnable = false;
25
+ private static String ourCallback = null;
26
+
27
+ private static Nfc ourInstance = null;
28
+
29
+ private static native void callCallback(String callback_url, NfcMessagePack msgpack);
30
+
31
+
32
+ public static Nfc getInstance() {
33
+ if (ourInstance == null) {
34
+ ourInstance = new Nfc();
35
+ }
36
+ return ourInstance;
37
+ }
38
+
39
+
40
+ public static int isSupported() {
41
+ //NfcAdapter da = NfcAdapter.getDefaultAdapter(RhodesService.getContext());
42
+ NfcAdapter da = NfcAdapter.getDefaultAdapter();
43
+ if (da == null) {
44
+ return 0;
45
+ }
46
+ int res = 0;
47
+ if (da.isEnabled()) {
48
+ res = 1;
49
+ }
50
+ return res;
51
+ }
52
+
53
+ public static int isEnabled() {
54
+ int res = 0;
55
+ if (ourIsEnable) {
56
+ res = 1;
57
+ }
58
+ return res;
59
+ }
60
+
61
+ public static void setEnable(int enable) {
62
+ ourIsEnable = (enable != 0);
63
+ }
64
+
65
+ public static void setCallback(String callback) {
66
+ ourCallback = callback;
67
+ }
68
+
69
+ @Override
70
+ public void onReceive(Context context, Intent intent) {
71
+ String action = intent.getAction();
72
+
73
+ if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
74
+ Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
75
+ NdefMessage[] msgs;
76
+ if (rawMsgs != null) {
77
+ msgs = new NdefMessage[rawMsgs.length];
78
+ for (int i = 0; i < rawMsgs.length; i++) {
79
+ msgs[i] = (NdefMessage) rawMsgs[i];
80
+ }
81
+ } else {
82
+ // Unknown tag type
83
+ byte[] empty = new byte[] {};
84
+ NdefRecord record = new NdefRecord(NdefRecord.TNF_UNKNOWN, empty, empty, empty);
85
+ NdefMessage msg = new NdefMessage(new NdefRecord[] {record});
86
+ msgs = new NdefMessage[] {msg};
87
+ }
88
+ onReceiveMessages(msgs);
89
+ }
90
+ }
91
+
92
+ private static boolean isRhodesApplicationRun() {
93
+ return RhodesService.getInstance()!=null;
94
+ }
95
+
96
+ void onReceiveMessages(NdefMessage[] msgs) {
97
+ if (msgs == null || msgs.length == 0) {
98
+ return;
99
+ }
100
+
101
+ Utils.platformLog(TAG, "NFC TAG Received ! Service started = "+String.valueOf(isRhodesApplicationRun()));
102
+
103
+ NfcMessagePack pack = new NfcMessagePack(msgs);
104
+
105
+ if (isRhodesApplicationRun()) {
106
+ if (ourIsEnable) {
107
+ if (ourCallback != null) {
108
+ if (ourCallback.length() > 0) {
109
+ callCallback(ourCallback, pack);
110
+ }
111
+ }
112
+ }
113
+ }
114
+
115
+
116
+ }
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ }
@@ -0,0 +1,34 @@
1
+ package com.nfc;
2
+
3
+ import android.nfc.NdefMessage;
4
+ import android.nfc.NdefRecord;
5
+ import com.rhomobile.rhodes.Utils;
6
+
7
+ public class NfcMessage {
8
+
9
+ private NfcRecord[] mRecords = null;
10
+ private byte[] mByteArray = null;
11
+
12
+ public NfcMessage(NdefMessage msg) {
13
+ mByteArray = msg.toByteArray();
14
+ NdefRecord[] records = msg.getRecords();
15
+ mRecords = new NfcRecord[records.length];
16
+ int i;
17
+ for (i = 0; i < records.length; i++) {
18
+ mRecords[i] = new NfcRecord(records[i]);
19
+ }
20
+ }
21
+
22
+ public int getItemCount() {
23
+ return mRecords.length;
24
+ }
25
+
26
+ public NfcRecord getItem(int index) {
27
+ return mRecords[index];
28
+ }
29
+
30
+ public byte[] getByteArray() {
31
+ return mByteArray;
32
+ }
33
+
34
+ }
@@ -0,0 +1,33 @@
1
+ package com.nfc;
2
+
3
+ import android.nfc.NdefMessage;
4
+ import com.rhomobile.rhodes.Utils;
5
+
6
+ public class NfcMessagePack {
7
+
8
+
9
+ private NfcMessage[] mMessages = null;
10
+
11
+ public NfcMessagePack(NdefMessage[] msgs) {
12
+ mMessages = new NfcMessage[msgs.length];
13
+ int i;
14
+ for (i = 0; i < msgs.length; i++) {
15
+ mMessages[i] = new NfcMessage(msgs[i]);
16
+ }
17
+ }
18
+
19
+ public int getItemCount() {
20
+ if (mMessages == null) {
21
+ return 0;
22
+ }
23
+ return mMessages.length;
24
+ }
25
+
26
+ public NfcMessage getItem(int index) {
27
+ if (mMessages == null) {
28
+ return null;
29
+ }
30
+ return mMessages[index];
31
+ }
32
+
33
+ }
@@ -0,0 +1,149 @@
1
+ package com.nfc;
2
+
3
+ import java.io.UnsupportedEncodingException;
4
+ import java.nio.charset.Charset;
5
+ import java.util.Arrays;
6
+
7
+ import android.nfc.FormatException;
8
+ import android.nfc.NdefMessage;
9
+ import android.nfc.NdefRecord;
10
+
11
+ import com.rhomobile.rhodes.Utils;
12
+
13
+ public class NfcRecord {
14
+
15
+ private byte[] mId = null;
16
+ private byte[] mPayload = null;
17
+ private String mPayloadString = null;
18
+ private int mTnf = 0;
19
+ private byte[] mType = null;
20
+ private byte[] mByteArray = null;
21
+
22
+ private NfcMessage mSubrecords = null;
23
+
24
+
25
+
26
+ public NfcRecord(NdefRecord rec) {
27
+
28
+ mId = rec.getId();
29
+ mPayload = rec.getPayload();
30
+ mTnf = rec.getTnf();
31
+ mType = rec.getType();
32
+ mByteArray = rec.toByteArray();
33
+ mPayloadString = "";
34
+
35
+ try {
36
+
37
+ // detect type for prepare string from payload
38
+ if (mTnf == NdefRecord.TNF_ABSOLUTE_URI) {
39
+ mPayloadString = new String(mPayload, Charset.forName("UTF-8"));
40
+ }
41
+ else if (mTnf == NdefRecord.TNF_WELL_KNOWN) {
42
+ if (Arrays.equals(mType, NdefRecord.RTD_URI)) {
43
+ String prefix = getUriPrefixByNfcCode(mPayload[0]);
44
+ String uri = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length), Charset.forName("UTF-8"));
45
+ mPayloadString = prefix + uri;
46
+ }
47
+ else if (Arrays.equals(mType, NdefRecord.RTD_TEXT)) {
48
+ String textEncoding = ((mPayload[0] & 0200) == 0) ? "UTF-8" : "UTF-16";
49
+ int languageCodeLength = mPayload[0] & 0077;
50
+ String languageCode = new String(mPayload, 1, languageCodeLength, "US-ASCII");
51
+ String text = new String(mPayload, languageCodeLength + 1, mPayload.length - languageCodeLength - 1, textEncoding);
52
+ mPayloadString = text;
53
+ }
54
+ else if (Arrays.equals(mType, NdefRecord.RTD_SMART_POSTER)) {
55
+ try {
56
+ NdefMessage subRecords = new NdefMessage(mPayload);
57
+ mSubrecords = new NfcMessage(subRecords);
58
+ } catch (FormatException e) {
59
+ //throw new IllegalArgumentException(e);
60
+ Utils.platformLog("NFC support native extension", "Invalid record with RTD_SMART_POSTER type !");
61
+ }
62
+ }
63
+ else {
64
+ mPayloadString = new String(mPayload, Charset.forName("UTF-8"));
65
+ }
66
+ }
67
+ else {
68
+ mPayloadString = new String(mPayload, Charset.forName("UTF-8"));
69
+ }
70
+ } catch (UnsupportedEncodingException e) {
71
+ // should never happen unless we get a malformed tag.
72
+ //throw new IllegalArgumentException(e);
73
+ Utils.platformLog("NFC support native extension", "catch UnsupportedEncodingException - tag maybe broken !");
74
+ }
75
+ }
76
+
77
+ public byte[] getId() {
78
+ return mId;
79
+ }
80
+
81
+ public byte[] getPayload() {
82
+ return mPayload;
83
+ }
84
+
85
+ public String getPayloadString() {
86
+ return mPayloadString;
87
+ }
88
+
89
+ public int getTnf() {
90
+ return mTnf;
91
+ }
92
+
93
+ public byte[] getType() {
94
+ return mType;
95
+ }
96
+
97
+ public byte[] getByteArray() {
98
+ return mByteArray;
99
+ }
100
+
101
+ public NfcMessage getSubrecords() {
102
+ return mSubrecords;
103
+ }
104
+
105
+
106
+ private String getUriPrefixByNfcCode(byte code) {
107
+ switch(code) {
108
+ case 0x00: return "";
109
+ case 0x01: return "http://www.";
110
+ case 0x02: return "https://www.";
111
+ case 0x03: return "http://";
112
+ case 0x04: return "https://";
113
+ case 0x05: return "tel:";
114
+ case 0x06: return "mailto:";
115
+ case 0x07: return "ftp://anonymous:anonymous@";
116
+ case 0x08: return "ftp://ftp.";
117
+ case 0x09: return "ftps://";
118
+ case 0x0A: return "sftp://";
119
+ case 0x0B: return "smb://";
120
+ case 0x0C: return "nfs://";
121
+ case 0x0D: return "ftp://";
122
+ case 0x0E: return "dav://";
123
+ case 0x0F: return "news:";
124
+ case 0x10: return "telnet://";
125
+ case 0x11: return "imap:";
126
+ case 0x12: return "rtsp://";
127
+ case 0x13: return "urn:";
128
+ case 0x14: return "pop:";
129
+ case 0x15: return "sip:";
130
+ case 0x16: return "sips:";
131
+ case 0x17: return "tftp:";
132
+ case 0x18: return "btspp://";
133
+ case 0x19: return "btl2cap://";
134
+ case 0x1A: return "btgoep://";
135
+ case 0x1B: return "tcpobex://";
136
+ case 0x1C: return "irdaobex://";
137
+ case 0x1D: return "file://";
138
+ case 0x1E: return "urn:epc:id:";
139
+ case 0x1F: return "urn:epc:tag:";
140
+ case 0x20: return "urn:epc:pat:";
141
+ case 0x21: return "urn:epc:raw:";
142
+ case 0x22: return "urn:epc:";
143
+ case 0x23: return "urn:nfc:";
144
+ }
145
+ return "";
146
+ }
147
+
148
+
149
+ }
@@ -0,0 +1,22 @@
1
+ /* nfc.i */
2
+ %module Nfc
3
+ %{
4
+
5
+ extern void rho_nfc_set_callback(const char* callback_url);
6
+ #define set_callback rho_nfc_set_callback
7
+
8
+ extern void rho_nfc_enable(int enable);
9
+ #define enable rho_nfc_enable
10
+
11
+ extern int rho_nfc_is_enabled(void);
12
+ #define is_enabled rho_nfc_is_enabled
13
+
14
+ extern int rho_nfc_is_supported(void);
15
+ #define is_supported rho_nfc_is_supported
16
+
17
+ %}
18
+
19
+ extern void set_callback(const char* callback_url);
20
+ extern void enable(int enable);
21
+ extern int is_enabled(void);
22
+ extern int is_supported(void);
@@ -0,0 +1,2034 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.31
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
+ * This section contains generic SWIG labels for method/variable
14
+ * declarations/attributes, and other compiler dependent labels.
15
+ * ----------------------------------------------------------------------------- */
16
+
17
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
18
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
19
+ # if defined(__SUNPRO_CC)
20
+ # if (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # else
23
+ # define SWIGTEMPLATEDISAMBIGUATOR
24
+ # endif
25
+ # else
26
+ # define SWIGTEMPLATEDISAMBIGUATOR
27
+ # endif
28
+ #endif
29
+
30
+ /* inline attribute */
31
+ #ifndef SWIGINLINE
32
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
33
+ # define SWIGINLINE inline
34
+ # else
35
+ # define SWIGINLINE
36
+ # endif
37
+ #endif
38
+
39
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
40
+ #ifndef SWIGUNUSED
41
+ # if defined(__GNUC__)
42
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
43
+ # define SWIGUNUSED __attribute__ ((__unused__))
44
+ # else
45
+ # define SWIGUNUSED
46
+ # endif
47
+ # elif defined(__ICC)
48
+ # define SWIGUNUSED __attribute__ ((__unused__))
49
+ # else
50
+ # define SWIGUNUSED
51
+ # endif
52
+ #endif
53
+
54
+ #ifndef SWIGUNUSEDPARM
55
+ # ifdef __cplusplus
56
+ # define SWIGUNUSEDPARM(p)
57
+ # else
58
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
59
+ # endif
60
+ #endif
61
+
62
+ /* internal SWIG method */
63
+ #ifndef SWIGINTERN
64
+ # define SWIGINTERN static SWIGUNUSED
65
+ #endif
66
+
67
+ /* internal inline SWIG method */
68
+ #ifndef SWIGINTERNINLINE
69
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
70
+ #endif
71
+
72
+ /* exporting methods */
73
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
74
+ # ifndef GCC_HASCLASSVISIBILITY
75
+ # define GCC_HASCLASSVISIBILITY
76
+ # endif
77
+ #endif
78
+
79
+ #ifndef SWIGEXPORT
80
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
81
+ # if defined(STATIC_LINKED)
82
+ # define SWIGEXPORT
83
+ # else
84
+ # define SWIGEXPORT __declspec(dllexport)
85
+ # endif
86
+ # else
87
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
88
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
89
+ # else
90
+ # define SWIGEXPORT
91
+ # endif
92
+ # endif
93
+ #endif
94
+
95
+ /* calling conventions for Windows */
96
+ #ifndef SWIGSTDCALL
97
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
98
+ # define SWIGSTDCALL __stdcall
99
+ # else
100
+ # define SWIGSTDCALL
101
+ # endif
102
+ #endif
103
+
104
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
105
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
106
+ # define _CRT_SECURE_NO_DEPRECATE
107
+ #endif
108
+
109
+ /* -----------------------------------------------------------------------------
110
+ * This section contains generic SWIG labels for method/variable
111
+ * declarations/attributes, and other compiler dependent labels.
112
+ * ----------------------------------------------------------------------------- */
113
+
114
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
115
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
116
+ # if defined(__SUNPRO_CC)
117
+ # if (__SUNPRO_CC <= 0x560)
118
+ # define SWIGTEMPLATEDISAMBIGUATOR template
119
+ # else
120
+ # define SWIGTEMPLATEDISAMBIGUATOR
121
+ # endif
122
+ # else
123
+ # define SWIGTEMPLATEDISAMBIGUATOR
124
+ # endif
125
+ #endif
126
+
127
+ /* inline attribute */
128
+ #ifndef SWIGINLINE
129
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
130
+ # define SWIGINLINE inline
131
+ # else
132
+ # define SWIGINLINE
133
+ # endif
134
+ #endif
135
+
136
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
137
+ #ifndef SWIGUNUSED
138
+ # if defined(__GNUC__)
139
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
140
+ # define SWIGUNUSED __attribute__ ((__unused__))
141
+ # else
142
+ # define SWIGUNUSED
143
+ # endif
144
+ # elif defined(__ICC)
145
+ # define SWIGUNUSED __attribute__ ((__unused__))
146
+ # else
147
+ # define SWIGUNUSED
148
+ # endif
149
+ #endif
150
+
151
+ #ifndef SWIGUNUSEDPARM
152
+ # ifdef __cplusplus
153
+ # define SWIGUNUSEDPARM(p)
154
+ # else
155
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
156
+ # endif
157
+ #endif
158
+
159
+ /* internal SWIG method */
160
+ #ifndef SWIGINTERN
161
+ # define SWIGINTERN static SWIGUNUSED
162
+ #endif
163
+
164
+ /* internal inline SWIG method */
165
+ #ifndef SWIGINTERNINLINE
166
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
167
+ #endif
168
+
169
+ /* exporting methods */
170
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
171
+ # ifndef GCC_HASCLASSVISIBILITY
172
+ # define GCC_HASCLASSVISIBILITY
173
+ # endif
174
+ #endif
175
+
176
+ #ifndef SWIGEXPORT
177
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
178
+ # if defined(STATIC_LINKED)
179
+ # define SWIGEXPORT
180
+ # else
181
+ # define SWIGEXPORT __declspec(dllexport)
182
+ # endif
183
+ # else
184
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
185
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
186
+ # else
187
+ # define SWIGEXPORT
188
+ # endif
189
+ # endif
190
+ #endif
191
+
192
+ /* calling conventions for Windows */
193
+ #ifndef SWIGSTDCALL
194
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
195
+ # define SWIGSTDCALL __stdcall
196
+ # else
197
+ # define SWIGSTDCALL
198
+ # endif
199
+ #endif
200
+
201
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
202
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
203
+ # define _CRT_SECURE_NO_DEPRECATE
204
+ #endif
205
+
206
+ /* -----------------------------------------------------------------------------
207
+ * swigrun.swg
208
+ *
209
+ * This file contains generic CAPI SWIG runtime support for pointer
210
+ * type checking.
211
+ * ----------------------------------------------------------------------------- */
212
+
213
+ /* This should only be incremented when either the layout of swig_type_info changes,
214
+ or for whatever reason, the runtime changes incompatibly */
215
+ #define SWIG_RUNTIME_VERSION "3"
216
+
217
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
218
+ #ifdef SWIG_TYPE_TABLE
219
+ # define SWIG_QUOTE_STRING(x) #x
220
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
221
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
222
+ #else
223
+ # define SWIG_TYPE_TABLE_NAME
224
+ #endif
225
+
226
+ /*
227
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
228
+ creating a static or dynamic library from the swig runtime code.
229
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
230
+
231
+ But only do this if is strictly necessary, ie, if you have problems
232
+ with your compiler or so.
233
+ */
234
+
235
+ #ifndef SWIGRUNTIME
236
+ # define SWIGRUNTIME SWIGINTERN
237
+ #endif
238
+
239
+ #ifndef SWIGRUNTIMEINLINE
240
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
241
+ #endif
242
+
243
+ /* Generic buffer size */
244
+ #ifndef SWIG_BUFFER_SIZE
245
+ # define SWIG_BUFFER_SIZE 1024
246
+ #endif
247
+
248
+ /* Flags for pointer conversions */
249
+ #define SWIG_POINTER_DISOWN 0x1
250
+
251
+ /* Flags for new pointer objects */
252
+ #define SWIG_POINTER_OWN 0x1
253
+
254
+
255
+ /*
256
+ Flags/methods for returning states.
257
+
258
+ The swig conversion methods, as ConvertPtr, return and integer
259
+ that tells if the conversion was successful or not. And if not,
260
+ an error code can be returned (see swigerrors.swg for the codes).
261
+
262
+ Use the following macros/flags to set or process the returning
263
+ states.
264
+
265
+ In old swig versions, you usually write code as:
266
+
267
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
268
+ // success code
269
+ } else {
270
+ //fail code
271
+ }
272
+
273
+ Now you can be more explicit as:
274
+
275
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
276
+ if (SWIG_IsOK(res)) {
277
+ // success code
278
+ } else {
279
+ // fail code
280
+ }
281
+
282
+ that seems to be the same, but now you can also do
283
+
284
+ Type *ptr;
285
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
286
+ if (SWIG_IsOK(res)) {
287
+ // success code
288
+ if (SWIG_IsNewObj(res) {
289
+ ...
290
+ delete *ptr;
291
+ } else {
292
+ ...
293
+ }
294
+ } else {
295
+ // fail code
296
+ }
297
+
298
+ I.e., now SWIG_ConvertPtr can return new objects and you can
299
+ identify the case and take care of the deallocation. Of course that
300
+ requires also to SWIG_ConvertPtr to return new result values, as
301
+
302
+ int SWIG_ConvertPtr(obj, ptr,...) {
303
+ if (<obj is ok>) {
304
+ if (<need new object>) {
305
+ *ptr = <ptr to new allocated object>;
306
+ return SWIG_NEWOBJ;
307
+ } else {
308
+ *ptr = <ptr to old object>;
309
+ return SWIG_OLDOBJ;
310
+ }
311
+ } else {
312
+ return SWIG_BADOBJ;
313
+ }
314
+ }
315
+
316
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
317
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
318
+ swig errors code.
319
+
320
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
321
+ allows to return the 'cast rank', for example, if you have this
322
+
323
+ int food(double)
324
+ int fooi(int);
325
+
326
+ and you call
327
+
328
+ food(1) // cast rank '1' (1 -> 1.0)
329
+ fooi(1) // cast rank '0'
330
+
331
+ just use the SWIG_AddCast()/SWIG_CheckState()
332
+
333
+
334
+ */
335
+ #define SWIG_OK (0)
336
+ #define SWIG_ERROR (-1)
337
+ #define SWIG_IsOK(r) (r >= 0)
338
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
339
+
340
+ /* The CastRankLimit says how many bits are used for the cast rank */
341
+ #define SWIG_CASTRANKLIMIT (1 << 8)
342
+ /* The NewMask denotes the object was created (using new/malloc) */
343
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
344
+ /* The TmpMask is for in/out typemaps that use temporal objects */
345
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
346
+ /* Simple returning values */
347
+ #define SWIG_BADOBJ (SWIG_ERROR)
348
+ #define SWIG_OLDOBJ (SWIG_OK)
349
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
350
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
351
+ /* Check, add and del mask methods */
352
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
353
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
354
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
355
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
356
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
357
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
358
+
359
+
360
+ /* Cast-Rank Mode */
361
+ #if defined(SWIG_CASTRANK_MODE)
362
+ # ifndef SWIG_TypeRank
363
+ # define SWIG_TypeRank unsigned long
364
+ # endif
365
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
366
+ # define SWIG_MAXCASTRANK (2)
367
+ # endif
368
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
369
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
370
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
371
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
372
+ }
373
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
374
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
375
+ }
376
+ #else /* no cast-rank mode */
377
+ # define SWIG_AddCast
378
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
379
+ #endif
380
+
381
+
382
+
383
+
384
+ #include <string.h>
385
+
386
+ #ifdef __cplusplus
387
+ extern "C" {
388
+ #endif
389
+
390
+ typedef void *(*swig_converter_func)(void *);
391
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
392
+
393
+ /* Structure to store inforomation on one type */
394
+ typedef struct swig_type_info {
395
+ const char *name; /* mangled name of this type */
396
+ const char *str; /* human readable name of this type */
397
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
398
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
399
+ void *clientdata; /* language specific type data */
400
+ int owndata; /* flag if the structure owns the clientdata */
401
+ } swig_type_info;
402
+
403
+ /* Structure to store a type and conversion function used for casting */
404
+ typedef struct swig_cast_info {
405
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
406
+ swig_converter_func converter; /* function to cast the void pointers */
407
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
408
+ struct swig_cast_info *prev; /* pointer to the previous cast */
409
+ } swig_cast_info;
410
+
411
+ /* Structure used to store module information
412
+ * Each module generates one structure like this, and the runtime collects
413
+ * all of these structures and stores them in a circularly linked list.*/
414
+ typedef struct swig_module_info {
415
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
416
+ size_t size; /* Number of types in this module */
417
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
418
+ swig_type_info **type_initial; /* Array of initially generated type structures */
419
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
420
+ void *clientdata; /* Language specific module data */
421
+ } swig_module_info;
422
+
423
+ /*
424
+ Compare two type names skipping the space characters, therefore
425
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
426
+
427
+ Return 0 when the two name types are equivalent, as in
428
+ strncmp, but skipping ' '.
429
+ */
430
+ SWIGRUNTIME int
431
+ SWIG_TypeNameComp(const char *f1, const char *l1,
432
+ const char *f2, const char *l2) {
433
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
434
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
435
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
436
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
437
+ }
438
+ return (l1 - f1) - (l2 - f2);
439
+ }
440
+
441
+ /*
442
+ Check type equivalence in a name list like <name1>|<name2>|...
443
+ Return 0 if not equal, 1 if equal
444
+ */
445
+ SWIGRUNTIME int
446
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
447
+ int equiv = 0;
448
+ const char* te = tb + strlen(tb);
449
+ const char* ne = nb;
450
+ while (!equiv && *ne) {
451
+ for (nb = ne; *ne; ++ne) {
452
+ if (*ne == '|') break;
453
+ }
454
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
455
+ if (*ne) ++ne;
456
+ }
457
+ return equiv;
458
+ }
459
+
460
+ /*
461
+ Check type equivalence in a name list like <name1>|<name2>|...
462
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
463
+ */
464
+ SWIGRUNTIME int
465
+ SWIG_TypeCompare(const char *nb, const char *tb) {
466
+ int equiv = 0;
467
+ const char* te = tb + strlen(tb);
468
+ const char* ne = nb;
469
+ while (!equiv && *ne) {
470
+ for (nb = ne; *ne; ++ne) {
471
+ if (*ne == '|') break;
472
+ }
473
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
474
+ if (*ne) ++ne;
475
+ }
476
+ return equiv;
477
+ }
478
+
479
+
480
+ /* think of this as a c++ template<> or a scheme macro */
481
+ #define SWIG_TypeCheck_Template(comparison, ty) \
482
+ if (ty) { \
483
+ swig_cast_info *iter = ty->cast; \
484
+ while (iter) { \
485
+ if (comparison) { \
486
+ if (iter == ty->cast) return iter; \
487
+ /* Move iter to the top of the linked list */ \
488
+ iter->prev->next = iter->next; \
489
+ if (iter->next) \
490
+ iter->next->prev = iter->prev; \
491
+ iter->next = ty->cast; \
492
+ iter->prev = 0; \
493
+ if (ty->cast) ty->cast->prev = iter; \
494
+ ty->cast = iter; \
495
+ return iter; \
496
+ } \
497
+ iter = iter->next; \
498
+ } \
499
+ } \
500
+ return 0
501
+
502
+ /*
503
+ Check the typename
504
+ */
505
+ SWIGRUNTIME swig_cast_info *
506
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
508
+ }
509
+
510
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
511
+ SWIGRUNTIME swig_cast_info *
512
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
513
+ SWIG_TypeCheck_Template(iter->type == from, into);
514
+ }
515
+
516
+ /*
517
+ Cast a pointer up an inheritance hierarchy
518
+ */
519
+ SWIGRUNTIMEINLINE void *
520
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
521
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
522
+ }
523
+
524
+ /*
525
+ Dynamic pointer casting. Down an inheritance hierarchy
526
+ */
527
+ SWIGRUNTIME swig_type_info *
528
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
529
+ swig_type_info *lastty = ty;
530
+ if (!ty || !ty->dcast) return ty;
531
+ while (ty && (ty->dcast)) {
532
+ ty = (*ty->dcast)(ptr);
533
+ if (ty) lastty = ty;
534
+ }
535
+ return lastty;
536
+ }
537
+
538
+ /*
539
+ Return the name associated with this type
540
+ */
541
+ SWIGRUNTIMEINLINE const char *
542
+ SWIG_TypeName(const swig_type_info *ty) {
543
+ return ty->name;
544
+ }
545
+
546
+ /*
547
+ Return the pretty name associated with this type,
548
+ that is an unmangled type name in a form presentable to the user.
549
+ */
550
+ SWIGRUNTIME const char *
551
+ SWIG_TypePrettyName(const swig_type_info *type) {
552
+ /* The "str" field contains the equivalent pretty names of the
553
+ type, separated by vertical-bar characters. We choose
554
+ to print the last name, as it is often (?) the most
555
+ specific. */
556
+ if (!type) return NULL;
557
+ if (type->str != NULL) {
558
+ const char *last_name = type->str;
559
+ const char *s;
560
+ for (s = type->str; *s; s++)
561
+ if (*s == '|') last_name = s+1;
562
+ return last_name;
563
+ }
564
+ else
565
+ return type->name;
566
+ }
567
+
568
+ /*
569
+ Set the clientdata field for a type
570
+ */
571
+ SWIGRUNTIME void
572
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
573
+ swig_cast_info *cast = ti->cast;
574
+ /* if (ti->clientdata == clientdata) return; */
575
+ ti->clientdata = clientdata;
576
+
577
+ while (cast) {
578
+ if (!cast->converter) {
579
+ swig_type_info *tc = cast->type;
580
+ if (!tc->clientdata) {
581
+ SWIG_TypeClientData(tc, clientdata);
582
+ }
583
+ }
584
+ cast = cast->next;
585
+ }
586
+ }
587
+ SWIGRUNTIME void
588
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
589
+ SWIG_TypeClientData(ti, clientdata);
590
+ ti->owndata = 1;
591
+ }
592
+
593
+ /*
594
+ Search for a swig_type_info structure only by mangled name
595
+ Search is a O(log #types)
596
+
597
+ We start searching at module start, and finish searching when start == end.
598
+ Note: if start == end at the beginning of the function, we go all the way around
599
+ the circular list.
600
+ */
601
+ SWIGRUNTIME swig_type_info *
602
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
603
+ swig_module_info *end,
604
+ const char *name) {
605
+ swig_module_info *iter = start;
606
+ do {
607
+ if (iter->size) {
608
+ register size_t l = 0;
609
+ register size_t r = iter->size - 1;
610
+ do {
611
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
612
+ register size_t i = (l + r) >> 1;
613
+ const char *iname = iter->types[i]->name;
614
+ if (iname) {
615
+ register int compare = strcmp(name, iname);
616
+ if (compare == 0) {
617
+ return iter->types[i];
618
+ } else if (compare < 0) {
619
+ if (i) {
620
+ r = i - 1;
621
+ } else {
622
+ break;
623
+ }
624
+ } else if (compare > 0) {
625
+ l = i + 1;
626
+ }
627
+ } else {
628
+ break; /* should never happen */
629
+ }
630
+ } while (l <= r);
631
+ }
632
+ iter = iter->next;
633
+ } while (iter != end);
634
+ return 0;
635
+ }
636
+
637
+ /*
638
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
639
+ It first searches the mangled names of the types, which is a O(log #types)
640
+ If a type is not found it then searches the human readable names, which is O(#types).
641
+
642
+ We start searching at module start, and finish searching when start == end.
643
+ Note: if start == end at the beginning of the function, we go all the way around
644
+ the circular list.
645
+ */
646
+ SWIGRUNTIME swig_type_info *
647
+ SWIG_TypeQueryModule(swig_module_info *start,
648
+ swig_module_info *end,
649
+ const char *name) {
650
+ /* STEP 1: Search the name field using binary search */
651
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
652
+ if (ret) {
653
+ return ret;
654
+ } else {
655
+ /* STEP 2: If the type hasn't been found, do a complete search
656
+ of the str field (the human readable name) */
657
+ swig_module_info *iter = start;
658
+ do {
659
+ register size_t i = 0;
660
+ for (; i < iter->size; ++i) {
661
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
662
+ return iter->types[i];
663
+ }
664
+ iter = iter->next;
665
+ } while (iter != end);
666
+ }
667
+
668
+ /* neither found a match */
669
+ return 0;
670
+ }
671
+
672
+ /*
673
+ Pack binary data into a string
674
+ */
675
+ SWIGRUNTIME char *
676
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
677
+ static const char hex[17] = "0123456789abcdef";
678
+ register const unsigned char *u = (unsigned char *) ptr;
679
+ register const unsigned char *eu = u + sz;
680
+ for (; u != eu; ++u) {
681
+ register unsigned char uu = *u;
682
+ *(c++) = hex[(uu & 0xf0) >> 4];
683
+ *(c++) = hex[uu & 0xf];
684
+ }
685
+ return c;
686
+ }
687
+
688
+ /*
689
+ Unpack binary data from a string
690
+ */
691
+ SWIGRUNTIME const char *
692
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
693
+ register unsigned char *u = (unsigned char *) ptr;
694
+ register const unsigned char *eu = u + sz;
695
+ for (; u != eu; ++u) {
696
+ register char d = *(c++);
697
+ register unsigned char uu;
698
+ if ((d >= '0') && (d <= '9'))
699
+ uu = ((d - '0') << 4);
700
+ else if ((d >= 'a') && (d <= 'f'))
701
+ uu = ((d - ('a'-10)) << 4);
702
+ else
703
+ return (char *) 0;
704
+ d = *(c++);
705
+ if ((d >= '0') && (d <= '9'))
706
+ uu |= (d - '0');
707
+ else if ((d >= 'a') && (d <= 'f'))
708
+ uu |= (d - ('a'-10));
709
+ else
710
+ return (char *) 0;
711
+ *u = uu;
712
+ }
713
+ return c;
714
+ }
715
+
716
+ /*
717
+ Pack 'void *' into a string buffer.
718
+ */
719
+ SWIGRUNTIME char *
720
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
721
+ char *r = buff;
722
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
723
+ *(r++) = '_';
724
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
725
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
726
+ strcpy(r,name);
727
+ return buff;
728
+ }
729
+
730
+ SWIGRUNTIME const char *
731
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
732
+ if (*c != '_') {
733
+ if (strcmp(c,"NULL") == 0) {
734
+ *ptr = (void *) 0;
735
+ return name;
736
+ } else {
737
+ return 0;
738
+ }
739
+ }
740
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
741
+ }
742
+
743
+ SWIGRUNTIME char *
744
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
745
+ char *r = buff;
746
+ size_t lname = (name ? strlen(name) : 0);
747
+ if ((2*sz + 2 + lname) > bsz) return 0;
748
+ *(r++) = '_';
749
+ r = SWIG_PackData(r,ptr,sz);
750
+ if (lname) {
751
+ strncpy(r,name,lname+1);
752
+ } else {
753
+ *r = 0;
754
+ }
755
+ return buff;
756
+ }
757
+
758
+ SWIGRUNTIME const char *
759
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
760
+ if (*c != '_') {
761
+ if (strcmp(c,"NULL") == 0) {
762
+ memset(ptr,0,sz);
763
+ return name;
764
+ } else {
765
+ return 0;
766
+ }
767
+ }
768
+ return SWIG_UnpackData(++c,ptr,sz);
769
+ }
770
+
771
+ #ifdef __cplusplus
772
+ }
773
+ #endif
774
+
775
+ /* Errors in SWIG */
776
+ #define SWIG_UnknownError -1
777
+ #define SWIG_IOError -2
778
+ #define SWIG_RuntimeError -3
779
+ #define SWIG_IndexError -4
780
+ #define SWIG_TypeError -5
781
+ #define SWIG_DivisionByZero -6
782
+ #define SWIG_OverflowError -7
783
+ #define SWIG_SyntaxError -8
784
+ #define SWIG_ValueError -9
785
+ #define SWIG_SystemError -10
786
+ #define SWIG_AttributeError -11
787
+ #define SWIG_MemoryError -12
788
+ #define SWIG_NullReferenceError -13
789
+
790
+
791
+
792
+ #include <ruby.h>
793
+
794
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
795
+ #ifndef NUM2LL
796
+ #define NUM2LL(x) NUM2LONG((x))
797
+ #endif
798
+ #ifndef LL2NUM
799
+ #define LL2NUM(x) INT2NUM((long) (x))
800
+ #endif
801
+ #ifndef ULL2NUM
802
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
803
+ #endif
804
+
805
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
806
+ #ifndef NUM2ULL
807
+ #ifdef HAVE_LONG_LONG
808
+ #define NUM2ULL(x) rb_num2ull((x))
809
+ #else
810
+ #define NUM2ULL(x) NUM2ULONG(x)
811
+ #endif
812
+ #endif
813
+
814
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
815
+ /* Define these for older versions so we can just write code the new way */
816
+ #ifndef RSTRING_LEN
817
+ # define RSTRING_LEN(x) RSTRING(x)->len
818
+ #endif
819
+ #ifndef RSTRING_PTR
820
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
821
+ #endif
822
+ #ifndef RARRAY_LEN
823
+ # define RARRAY_LEN(x) RARRAY(x)->len
824
+ #endif
825
+ #ifndef RARRAY_PTR
826
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
827
+ #endif
828
+
829
+ /*
830
+ * Need to be very careful about how these macros are defined, especially
831
+ * when compiling C++ code or C code with an ANSI C compiler.
832
+ *
833
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
834
+ * a Ruby method so that it can be passed as an argument to API functions
835
+ * like rb_define_method() and rb_define_singleton_method().
836
+ *
837
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
838
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
839
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
840
+ * and Data_Make_Struct().
841
+ */
842
+
843
+ #ifdef __cplusplus
844
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
845
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
846
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
847
+ # define VOIDFUNC(f) ((void (*)()) f)
848
+ # else
849
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
850
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
851
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
852
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
853
+ # else /* These definitions should work for Ruby 1.7+ */
854
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
855
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
856
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
857
+ # endif
858
+ # endif
859
+ #else
860
+ # define VALUEFUNC(f) (f)
861
+ # define VOIDFUNC(f) (f)
862
+ #endif
863
+
864
+ /* Don't use for expressions have side effect */
865
+ #ifndef RB_STRING_VALUE
866
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
867
+ #endif
868
+ #ifndef StringValue
869
+ #define StringValue(s) RB_STRING_VALUE(s)
870
+ #endif
871
+ #ifndef StringValuePtr
872
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
873
+ #endif
874
+ #ifndef StringValueLen
875
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
876
+ #endif
877
+ #ifndef SafeStringValue
878
+ #define SafeStringValue(v) do {\
879
+ StringValue(v);\
880
+ rb_check_safe_str(v);\
881
+ } while (0)
882
+ #endif
883
+
884
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
885
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
886
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
887
+ #endif
888
+
889
+
890
+ /* -----------------------------------------------------------------------------
891
+ * error manipulation
892
+ * ----------------------------------------------------------------------------- */
893
+
894
+
895
+ /* Define some additional error types */
896
+ #define SWIG_ObjectPreviouslyDeletedError -100
897
+
898
+
899
+ /* Define custom exceptions for errors that do not map to existing Ruby
900
+ exceptions. Note this only works for C++ since a global cannot be
901
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
902
+
903
+ SWIGINTERN VALUE
904
+ getNullReferenceError(void) {
905
+ static int init = 0;
906
+ static VALUE rb_eNullReferenceError ;
907
+ if (!init) {
908
+ init = 1;
909
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
910
+ }
911
+ return rb_eNullReferenceError;
912
+ }
913
+
914
+ SWIGINTERN VALUE
915
+ getObjectPreviouslyDeletedError(void) {
916
+ static int init = 0;
917
+ static VALUE rb_eObjectPreviouslyDeleted ;
918
+ if (!init) {
919
+ init = 1;
920
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
921
+ }
922
+ return rb_eObjectPreviouslyDeleted;
923
+ }
924
+
925
+
926
+ SWIGINTERN VALUE
927
+ SWIG_Ruby_ErrorType(int SWIG_code) {
928
+ VALUE type;
929
+ switch (SWIG_code) {
930
+ case SWIG_MemoryError:
931
+ type = rb_eNoMemError;
932
+ break;
933
+ case SWIG_IOError:
934
+ type = rb_eIOError;
935
+ break;
936
+ case SWIG_RuntimeError:
937
+ type = rb_eRuntimeError;
938
+ break;
939
+ case SWIG_IndexError:
940
+ type = rb_eIndexError;
941
+ break;
942
+ case SWIG_TypeError:
943
+ type = rb_eTypeError;
944
+ break;
945
+ case SWIG_DivisionByZero:
946
+ type = rb_eZeroDivError;
947
+ break;
948
+ case SWIG_OverflowError:
949
+ type = rb_eRangeError;
950
+ break;
951
+ case SWIG_SyntaxError:
952
+ type = rb_eSyntaxError;
953
+ break;
954
+ case SWIG_ValueError:
955
+ type = rb_eArgError;
956
+ break;
957
+ case SWIG_SystemError:
958
+ type = rb_eFatal;
959
+ break;
960
+ case SWIG_AttributeError:
961
+ type = rb_eRuntimeError;
962
+ break;
963
+ case SWIG_NullReferenceError:
964
+ type = getNullReferenceError();
965
+ break;
966
+ case SWIG_ObjectPreviouslyDeletedError:
967
+ type = getObjectPreviouslyDeletedError();
968
+ break;
969
+ case SWIG_UnknownError:
970
+ type = rb_eRuntimeError;
971
+ break;
972
+ default:
973
+ type = rb_eRuntimeError;
974
+ }
975
+ return type;
976
+ }
977
+
978
+
979
+
980
+
981
+ /* -----------------------------------------------------------------------------
982
+ * See the LICENSE file for information on copyright, usage and redistribution
983
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
984
+ *
985
+ * rubytracking.swg
986
+ *
987
+ * This file contains support for tracking mappings from
988
+ * Ruby objects to C++ objects. This functionality is needed
989
+ * to implement mark functions for Ruby's mark and sweep
990
+ * garbage collector.
991
+ * ----------------------------------------------------------------------------- */
992
+
993
+ #ifdef __cplusplus
994
+ extern "C" {
995
+ #endif
996
+
997
+
998
+ /* Global Ruby hash table to store Trackings from C/C++
999
+ structs to Ruby Objects. */
1000
+ static VALUE swig_ruby_trackings;
1001
+
1002
+ /* Global variable that stores a reference to the ruby
1003
+ hash table delete function. */
1004
+ static ID swig_ruby_hash_delete = 0;
1005
+
1006
+ /* Setup a Ruby hash table to store Trackings */
1007
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1008
+ /* Create a ruby hash table to store Trackings from C++
1009
+ objects to Ruby objects. Also make sure to tell
1010
+ the garabage collector about the hash table. */
1011
+ swig_ruby_trackings = rb_hash_new();
1012
+ rb_gc_register_address(&swig_ruby_trackings);
1013
+
1014
+ /* Now store a reference to the hash table delete function
1015
+ so that we only have to look it up once.*/
1016
+ swig_ruby_hash_delete = rb_intern("delete");
1017
+ }
1018
+
1019
+ /* Get a Ruby number to reference a pointer */
1020
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1021
+ /* We cast the pointer to an unsigned long
1022
+ and then store a reference to it using
1023
+ a Ruby number object. */
1024
+
1025
+ /* Convert the pointer to a Ruby number */
1026
+ unsigned long value = (unsigned long) ptr;
1027
+ return LONG2NUM(value);
1028
+ }
1029
+
1030
+ /* Get a Ruby number to reference an object */
1031
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1032
+ /* We cast the object to an unsigned long
1033
+ and then store a reference to it using
1034
+ a Ruby number object. */
1035
+
1036
+ /* Convert the Object to a Ruby number */
1037
+ unsigned long value = (unsigned long) object;
1038
+ return LONG2NUM(value);
1039
+ }
1040
+
1041
+ /* Get a Ruby object from a previously stored reference */
1042
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1043
+ /* The provided Ruby number object is a reference
1044
+ to the Ruby object we want.*/
1045
+
1046
+ /* First convert the Ruby number to a C number */
1047
+ unsigned long value = NUM2LONG(reference);
1048
+ return (VALUE) value;
1049
+ }
1050
+
1051
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1052
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1053
+ /* In a Ruby hash table we store the pointer and
1054
+ the associated Ruby object. The trick here is
1055
+ that we cannot store the Ruby object directly - if
1056
+ we do then it cannot be garbage collected. So
1057
+ instead we typecast it as a unsigned long and
1058
+ convert it to a Ruby number object.*/
1059
+
1060
+ /* Get a reference to the pointer as a Ruby number */
1061
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1062
+
1063
+ /* Get a reference to the Ruby object as a Ruby number */
1064
+ VALUE value = SWIG_RubyObjectToReference(object);
1065
+
1066
+ /* Store the mapping to the global hash table. */
1067
+ rb_hash_aset(swig_ruby_trackings, key, value);
1068
+ }
1069
+
1070
+ /* Get the Ruby object that owns the specified C/C++ struct */
1071
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1072
+ /* Get a reference to the pointer as a Ruby number */
1073
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1074
+
1075
+ /* Now lookup the value stored in the global hash table */
1076
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1077
+
1078
+ if (value == Qnil) {
1079
+ /* No object exists - return nil. */
1080
+ return Qnil;
1081
+ }
1082
+ else {
1083
+ /* Convert this value to Ruby object */
1084
+ return SWIG_RubyReferenceToObject(value);
1085
+ }
1086
+ }
1087
+
1088
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1089
+ is very important to remove objects once they are destroyed
1090
+ since the same memory address may be reused later to create
1091
+ a new object. */
1092
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1093
+ /* Get a reference to the pointer as a Ruby number */
1094
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1095
+
1096
+ /* Delete the object from the hash table by calling Ruby's
1097
+ do this we need to call the Hash.delete method.*/
1098
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1099
+ }
1100
+
1101
+ /* This is a helper method that unlinks a Ruby object from its
1102
+ underlying C++ object. This is needed if the lifetime of the
1103
+ Ruby object is longer than the C++ object */
1104
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1105
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1106
+
1107
+ if (object != Qnil) {
1108
+ DATA_PTR(object) = 0;
1109
+ }
1110
+ }
1111
+
1112
+
1113
+ #ifdef __cplusplus
1114
+ }
1115
+ #endif
1116
+
1117
+ /* -----------------------------------------------------------------------------
1118
+ * Ruby API portion that goes into the runtime
1119
+ * ----------------------------------------------------------------------------- */
1120
+
1121
+ #ifdef __cplusplus
1122
+ extern "C" {
1123
+ #endif
1124
+
1125
+ SWIGINTERN VALUE
1126
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1127
+ if (NIL_P(target)) {
1128
+ target = o;
1129
+ } else {
1130
+ if (TYPE(target) != T_ARRAY) {
1131
+ VALUE o2 = target;
1132
+ target = rb_ary_new();
1133
+ rb_ary_push(target, o2);
1134
+ }
1135
+ rb_ary_push(target, o);
1136
+ }
1137
+ return target;
1138
+ }
1139
+
1140
+ #ifdef __cplusplus
1141
+ }
1142
+ #endif
1143
+
1144
+
1145
+ /* -----------------------------------------------------------------------------
1146
+ * See the LICENSE file for information on copyright, usage and redistribution
1147
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1148
+ *
1149
+ * rubyrun.swg
1150
+ *
1151
+ * This file contains the runtime support for Ruby modules
1152
+ * and includes code for managing global variables and pointer
1153
+ * type checking.
1154
+ * ----------------------------------------------------------------------------- */
1155
+
1156
+ /* For backward compatibility only */
1157
+ #define SWIG_POINTER_EXCEPTION 0
1158
+
1159
+ /* for raw pointers */
1160
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1161
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1162
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1163
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1164
+ #define swig_owntype ruby_owntype
1165
+
1166
+ /* for raw packed data */
1167
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1168
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1169
+
1170
+ /* for class or struct pointers */
1171
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1172
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1173
+
1174
+ /* for C or C++ function pointers */
1175
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1176
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1177
+
1178
+ /* for C++ member pointers, ie, member methods */
1179
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1180
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1181
+
1182
+
1183
+ /* Runtime API */
1184
+
1185
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1186
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1187
+
1188
+
1189
+ /* Error manipulation */
1190
+
1191
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1192
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1193
+ #define SWIG_fail goto fail
1194
+
1195
+
1196
+ /* Ruby-specific SWIG API */
1197
+
1198
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1199
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1200
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1201
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1202
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1203
+
1204
+
1205
+ /* -----------------------------------------------------------------------------
1206
+ * pointers/data manipulation
1207
+ * ----------------------------------------------------------------------------- */
1208
+
1209
+ #ifdef __cplusplus
1210
+ extern "C" {
1211
+ #if 0
1212
+ } /* cc-mode */
1213
+ #endif
1214
+ #endif
1215
+
1216
+ typedef struct {
1217
+ VALUE klass;
1218
+ VALUE mImpl;
1219
+ void (*mark)(void *);
1220
+ void (*destroy)(void *);
1221
+ int trackObjects;
1222
+ } swig_class;
1223
+
1224
+
1225
+ static VALUE _mSWIG = Qnil;
1226
+ static VALUE _cSWIG_Pointer = Qnil;
1227
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1228
+
1229
+ SWIGRUNTIME VALUE
1230
+ getExceptionClass(void) {
1231
+ static int init = 0;
1232
+ static VALUE rubyExceptionClass ;
1233
+ if (!init) {
1234
+ init = 1;
1235
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1236
+ }
1237
+ return rubyExceptionClass;
1238
+ }
1239
+
1240
+ /* This code checks to see if the Ruby object being raised as part
1241
+ of an exception inherits from the Ruby class Exception. If so,
1242
+ the object is simply returned. If not, then a new Ruby exception
1243
+ object is created and that will be returned to Ruby.*/
1244
+ SWIGRUNTIME VALUE
1245
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1246
+ VALUE exceptionClass = getExceptionClass();
1247
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1248
+ return obj;
1249
+ } else {
1250
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1251
+ }
1252
+ }
1253
+
1254
+ /* Initialize Ruby runtime support */
1255
+ SWIGRUNTIME void
1256
+ SWIG_Ruby_InitRuntime(void)
1257
+ {
1258
+ if (_mSWIG == Qnil) {
1259
+ _mSWIG = rb_define_module("SWIG");
1260
+ }
1261
+ }
1262
+
1263
+ /* Define Ruby class for C type */
1264
+ SWIGRUNTIME void
1265
+ SWIG_Ruby_define_class(swig_type_info *type)
1266
+ {
1267
+ VALUE klass;
1268
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1269
+ sprintf(klass_name, "TYPE%s", type->name);
1270
+ if (NIL_P(_cSWIG_Pointer)) {
1271
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1272
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1273
+ }
1274
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1275
+ free((void *) klass_name);
1276
+ }
1277
+
1278
+ /* Create a new pointer object */
1279
+ SWIGRUNTIME VALUE
1280
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1281
+ {
1282
+ int own = flags & SWIG_POINTER_OWN;
1283
+
1284
+ char *klass_name;
1285
+ swig_class *sklass;
1286
+ VALUE klass;
1287
+ VALUE obj;
1288
+
1289
+ if (!ptr)
1290
+ return Qnil;
1291
+
1292
+ if (type->clientdata) {
1293
+ sklass = (swig_class *) type->clientdata;
1294
+
1295
+ /* Are we tracking this class and have we already returned this Ruby object? */
1296
+ if (sklass->trackObjects) {
1297
+ obj = SWIG_RubyInstanceFor(ptr);
1298
+
1299
+ /* Check the object's type and make sure it has the correct type.
1300
+ It might not in cases where methods do things like
1301
+ downcast methods. */
1302
+ if (obj != Qnil) {
1303
+ VALUE value = rb_iv_get(obj, "__swigtype__");
1304
+ char* type_name = RSTRING_PTR(value);
1305
+
1306
+ if (strcmp(type->name, type_name) == 0) {
1307
+ return obj;
1308
+ }
1309
+ }
1310
+ }
1311
+
1312
+ /* Create a new Ruby object */
1313
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1314
+
1315
+ /* If tracking is on for this class then track this object. */
1316
+ if (sklass->trackObjects) {
1317
+ SWIG_RubyAddTracking(ptr, obj);
1318
+ }
1319
+ } else {
1320
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1321
+ sprintf(klass_name, "TYPE%s", type->name);
1322
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1323
+ free((void *) klass_name);
1324
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1325
+ }
1326
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1327
+
1328
+ return obj;
1329
+ }
1330
+
1331
+ /* Create a new class instance (always owned) */
1332
+ SWIGRUNTIME VALUE
1333
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1334
+ {
1335
+ VALUE obj;
1336
+ swig_class *sklass = (swig_class *) type->clientdata;
1337
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1338
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1339
+ return obj;
1340
+ }
1341
+
1342
+ /* Get type mangle from class name */
1343
+ SWIGRUNTIMEINLINE char *
1344
+ SWIG_Ruby_MangleStr(VALUE obj)
1345
+ {
1346
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
1347
+ return StringValuePtr(stype);
1348
+ }
1349
+
1350
+ /* Acquire a pointer value */
1351
+ typedef void (*ruby_owntype)(void*);
1352
+
1353
+ SWIGRUNTIME ruby_owntype
1354
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1355
+ if (obj) {
1356
+ ruby_owntype oldown = RDATA(obj)->dfree;
1357
+ RDATA(obj)->dfree = own;
1358
+ return oldown;
1359
+ } else {
1360
+ return 0;
1361
+ }
1362
+ }
1363
+
1364
+ /* Convert a pointer value */
1365
+ SWIGRUNTIME int
1366
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1367
+ {
1368
+ char *c;
1369
+ swig_cast_info *tc;
1370
+ void *vptr = 0;
1371
+
1372
+ /* Grab the pointer */
1373
+ if (NIL_P(obj)) {
1374
+ *ptr = 0;
1375
+ return SWIG_OK;
1376
+ } else {
1377
+ if (TYPE(obj) != T_DATA) {
1378
+ return SWIG_ERROR;
1379
+ }
1380
+ Data_Get_Struct(obj, void, vptr);
1381
+ }
1382
+
1383
+ if (own) *own = RDATA(obj)->dfree;
1384
+
1385
+ /* Check to see if the input object is giving up ownership
1386
+ of the underlying C struct or C++ object. If so then we
1387
+ need to reset the destructor since the Ruby object no
1388
+ longer owns the underlying C++ object.*/
1389
+ if (flags & SWIG_POINTER_DISOWN) {
1390
+ /* Is tracking on for this class? */
1391
+ int track = 0;
1392
+ if (ty && ty->clientdata) {
1393
+ swig_class *sklass = (swig_class *) ty->clientdata;
1394
+ track = sklass->trackObjects;
1395
+ }
1396
+
1397
+ if (track) {
1398
+ /* We are tracking objects for this class. Thus we change the destructor
1399
+ * to SWIG_RubyRemoveTracking. This allows us to
1400
+ * remove the mapping from the C++ to Ruby object
1401
+ * when the Ruby object is garbage collected. If we don't
1402
+ * do this, then it is possible we will return a reference
1403
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1404
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1405
+ } else {
1406
+ RDATA(obj)->dfree = 0;
1407
+ }
1408
+ }
1409
+
1410
+ /* Do type-checking if type info was provided */
1411
+ if (ty) {
1412
+ if (ty->clientdata) {
1413
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1414
+ if (vptr == 0) {
1415
+ /* The object has already been deleted */
1416
+ return SWIG_ObjectPreviouslyDeletedError;
1417
+ }
1418
+ *ptr = vptr;
1419
+ return SWIG_OK;
1420
+ }
1421
+ }
1422
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1423
+ return SWIG_ERROR;
1424
+ }
1425
+ tc = SWIG_TypeCheck(c, ty);
1426
+ if (!tc) {
1427
+ return SWIG_ERROR;
1428
+ }
1429
+ *ptr = SWIG_TypeCast(tc, vptr);
1430
+ } else {
1431
+ *ptr = vptr;
1432
+ }
1433
+
1434
+ return SWIG_OK;
1435
+ }
1436
+
1437
+ /* Check convert */
1438
+ SWIGRUNTIMEINLINE int
1439
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1440
+ {
1441
+ char *c = SWIG_MangleStr(obj);
1442
+ if (!c) return 0;
1443
+ return SWIG_TypeCheck(c,ty) != 0;
1444
+ }
1445
+
1446
+ SWIGRUNTIME VALUE
1447
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1448
+ char result[1024];
1449
+ char *r = result;
1450
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1451
+ *(r++) = '_';
1452
+ r = SWIG_PackData(r, ptr, sz);
1453
+ strcpy(r, type->name);
1454
+ return rb_str_new2(result);
1455
+ }
1456
+
1457
+ /* Convert a packed value value */
1458
+ SWIGRUNTIME int
1459
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1460
+ swig_cast_info *tc;
1461
+ const char *c;
1462
+
1463
+ if (TYPE(obj) != T_STRING) goto type_error;
1464
+ c = StringValuePtr(obj);
1465
+ /* Pointer values must start with leading underscore */
1466
+ if (*c != '_') goto type_error;
1467
+ c++;
1468
+ c = SWIG_UnpackData(c, ptr, sz);
1469
+ if (ty) {
1470
+ tc = SWIG_TypeCheck(c, ty);
1471
+ if (!tc) goto type_error;
1472
+ }
1473
+ return SWIG_OK;
1474
+
1475
+ type_error:
1476
+ return SWIG_ERROR;
1477
+ }
1478
+
1479
+ SWIGRUNTIME swig_module_info *
1480
+ SWIG_Ruby_GetModule(void)
1481
+ {
1482
+ VALUE pointer;
1483
+ swig_module_info *ret = 0;
1484
+ VALUE verbose = rb_gv_get("VERBOSE");
1485
+
1486
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1487
+ rb_gv_set("VERBOSE", Qfalse);
1488
+
1489
+ /* first check if pointer already created */
1490
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1491
+ if (pointer != Qnil) {
1492
+ Data_Get_Struct(pointer, swig_module_info, ret);
1493
+ }
1494
+
1495
+ /* reinstate warnings */
1496
+ rb_gv_set("VERBOSE", verbose);
1497
+ return ret;
1498
+ }
1499
+
1500
+ SWIGRUNTIME void
1501
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1502
+ {
1503
+ /* register a new class */
1504
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1505
+ /* create and store the structure pointer to a global variable */
1506
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1507
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1508
+ }
1509
+
1510
+ #ifdef __cplusplus
1511
+ #if 0
1512
+ { /* cc-mode */
1513
+ #endif
1514
+ }
1515
+ #endif
1516
+
1517
+
1518
+
1519
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1520
+
1521
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1522
+
1523
+
1524
+
1525
+ /* -------- TYPES TABLE (BEGIN) -------- */
1526
+
1527
+ #define SWIGTYPE_p_char swig_types[0]
1528
+ static swig_type_info *swig_types[2];
1529
+ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1530
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1531
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1532
+
1533
+ /* -------- TYPES TABLE (END) -------- */
1534
+
1535
+ #define SWIG_init Init_Nfc
1536
+ #define SWIG_name "Nfc"
1537
+
1538
+ static VALUE mNfc;
1539
+
1540
+ #define SWIGVERSION 0x010331
1541
+ #define SWIG_VERSION SWIGVERSION
1542
+
1543
+
1544
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1545
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1546
+
1547
+
1548
+
1549
+ extern void rho_nfc_set_callback(const char* callback_url);
1550
+ #define set_callback rho_nfc_set_callback
1551
+
1552
+ extern void rho_nfc_enable(int enable);
1553
+ #define enable rho_nfc_enable
1554
+
1555
+ extern int rho_nfc_is_enabled(void);
1556
+ #define is_enabled rho_nfc_is_enabled
1557
+
1558
+ extern int rho_nfc_is_supported(void);
1559
+ #define is_supported rho_nfc_is_supported
1560
+
1561
+
1562
+
1563
+ SWIGINTERN swig_type_info*
1564
+ SWIG_pchar_descriptor(void)
1565
+ {
1566
+ static int init = 0;
1567
+ static swig_type_info* info = 0;
1568
+ if (!init) {
1569
+ info = SWIG_TypeQuery("_p_char");
1570
+ init = 1;
1571
+ }
1572
+ return info;
1573
+ }
1574
+
1575
+
1576
+ SWIGINTERN int
1577
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1578
+ {
1579
+ if (TYPE(obj) == T_STRING) {
1580
+
1581
+
1582
+
1583
+ char *cstr = STR2CSTR(obj);
1584
+
1585
+ size_t size = RSTRING_LEN(obj) + 1;
1586
+ if (cptr) {
1587
+ if (alloc) {
1588
+ if (*alloc == SWIG_NEWOBJ) {
1589
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1590
+ } else {
1591
+ *cptr = cstr;
1592
+ *alloc = SWIG_OLDOBJ;
1593
+ }
1594
+ }
1595
+ }
1596
+ if (psize) *psize = size;
1597
+ return SWIG_OK;
1598
+ } else {
1599
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1600
+ if (pchar_descriptor) {
1601
+ void* vptr = 0;
1602
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1603
+ if (cptr) *cptr = (char *)vptr;
1604
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1605
+ if (alloc) *alloc = SWIG_OLDOBJ;
1606
+ return SWIG_OK;
1607
+ }
1608
+ }
1609
+ }
1610
+ return SWIG_TypeError;
1611
+ }
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+ #include <limits.h>
1618
+ #ifndef LLONG_MIN
1619
+ # define LLONG_MIN LONG_LONG_MIN
1620
+ #endif
1621
+ #ifndef LLONG_MAX
1622
+ # define LLONG_MAX LONG_LONG_MAX
1623
+ #endif
1624
+ #ifndef ULLONG_MAX
1625
+ # define ULLONG_MAX ULONG_LONG_MAX
1626
+ #endif
1627
+
1628
+
1629
+ SWIGINTERN VALUE
1630
+ SWIG_ruby_failed(void)
1631
+ {
1632
+ return Qnil;
1633
+ }
1634
+
1635
+
1636
+ /*@SWIG:%ruby_aux_method@*/
1637
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1638
+ {
1639
+ VALUE obj = args[0];
1640
+ VALUE type = TYPE(obj);
1641
+ long *res = (long *)(args[1]);
1642
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1643
+ return obj;
1644
+ }
1645
+ /*@SWIG@*/
1646
+
1647
+ SWIGINTERN int
1648
+ SWIG_AsVal_long (VALUE obj, long* val)
1649
+ {
1650
+ VALUE type = TYPE(obj);
1651
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1652
+ long v;
1653
+ VALUE a[2];
1654
+ a[0] = obj;
1655
+ a[1] = (VALUE)(&v);
1656
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1657
+ if (val) *val = v;
1658
+ return SWIG_OK;
1659
+ }
1660
+ }
1661
+ return SWIG_TypeError;
1662
+ }
1663
+
1664
+
1665
+ SWIGINTERN int
1666
+ SWIG_AsVal_int (VALUE obj, int *val)
1667
+ {
1668
+ long v;
1669
+ int res = SWIG_AsVal_long (obj, &v);
1670
+ if (SWIG_IsOK(res)) {
1671
+ if ((v < INT_MIN || v > INT_MAX)) {
1672
+ return SWIG_OverflowError;
1673
+ } else {
1674
+ if (val) *val = (int)(v);
1675
+ }
1676
+ }
1677
+ return res;
1678
+ }
1679
+
1680
+
1681
+ #define SWIG_From_long LONG2NUM
1682
+
1683
+
1684
+ SWIGINTERNINLINE VALUE
1685
+ SWIG_From_int (int value)
1686
+ {
1687
+ return SWIG_From_long (value);
1688
+ }
1689
+
1690
+ SWIGINTERN VALUE
1691
+ _wrap_set_callback(int argc, VALUE *argv, VALUE self) {
1692
+ char *arg1 = (char *) 0 ;
1693
+ int res1 ;
1694
+ char *buf1 = 0 ;
1695
+ int alloc1 = 0 ;
1696
+
1697
+ if ((argc < 1) || (argc > 1)) {
1698
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1699
+ }
1700
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1701
+ if (!SWIG_IsOK(res1)) {
1702
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_callback" "', argument " "1"" of type '" "char const *""'");
1703
+ }
1704
+ arg1 = (char *)(buf1);
1705
+ set_callback((char const *)arg1);
1706
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1707
+ return Qnil;
1708
+ fail:
1709
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1710
+ return Qnil;
1711
+ }
1712
+
1713
+
1714
+ SWIGINTERN VALUE
1715
+ _wrap_enable(int argc, VALUE *argv, VALUE self) {
1716
+ int arg1 ;
1717
+ int val1 ;
1718
+ int ecode1 = 0 ;
1719
+
1720
+ if ((argc < 1) || (argc > 1)) {
1721
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1722
+ }
1723
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
1724
+ if (!SWIG_IsOK(ecode1)) {
1725
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "enable" "', argument " "1"" of type '" "int""'");
1726
+ }
1727
+ arg1 = (int)(val1);
1728
+ enable(arg1);
1729
+ return Qnil;
1730
+ fail:
1731
+ return Qnil;
1732
+ }
1733
+
1734
+
1735
+ SWIGINTERN VALUE
1736
+ _wrap_is_enabled(int argc, VALUE *argv, VALUE self) {
1737
+ int result;
1738
+ VALUE vresult = Qnil;
1739
+
1740
+ if ((argc < 0) || (argc > 0)) {
1741
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1742
+ }
1743
+ result = (int)is_enabled();
1744
+ vresult = SWIG_From_int((int)(result));
1745
+ return vresult;
1746
+ fail:
1747
+ return Qnil;
1748
+ }
1749
+
1750
+
1751
+ SWIGINTERN VALUE
1752
+ _wrap_is_supported(int argc, VALUE *argv, VALUE self) {
1753
+ int result;
1754
+ VALUE vresult = Qnil;
1755
+
1756
+ if ((argc < 0) || (argc > 0)) {
1757
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1758
+ }
1759
+ result = (int)is_supported();
1760
+ vresult = SWIG_From_int((int)(result));
1761
+ return vresult;
1762
+ fail:
1763
+ return Qnil;
1764
+ }
1765
+
1766
+
1767
+
1768
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1769
+
1770
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
1771
+
1772
+ static swig_type_info *swig_type_initial[] = {
1773
+ &_swigt__p_char,
1774
+ };
1775
+
1776
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
1777
+
1778
+ static swig_cast_info *swig_cast_initial[] = {
1779
+ _swigc__p_char,
1780
+ };
1781
+
1782
+
1783
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
1784
+
1785
+ /* -----------------------------------------------------------------------------
1786
+ * Type initialization:
1787
+ * This problem is tough by the requirement that no dynamic
1788
+ * memory is used. Also, since swig_type_info structures store pointers to
1789
+ * swig_cast_info structures and swig_cast_info structures store pointers back
1790
+ * to swig_type_info structures, we need some lookup code at initialization.
1791
+ * The idea is that swig generates all the structures that are needed.
1792
+ * The runtime then collects these partially filled structures.
1793
+ * The SWIG_InitializeModule function takes these initial arrays out of
1794
+ * swig_module, and does all the lookup, filling in the swig_module.types
1795
+ * array with the correct data and linking the correct swig_cast_info
1796
+ * structures together.
1797
+ *
1798
+ * The generated swig_type_info structures are assigned staticly to an initial
1799
+ * array. We just loop through that array, and handle each type individually.
1800
+ * First we lookup if this type has been already loaded, and if so, use the
1801
+ * loaded structure instead of the generated one. Then we have to fill in the
1802
+ * cast linked list. The cast data is initially stored in something like a
1803
+ * two-dimensional array. Each row corresponds to a type (there are the same
1804
+ * number of rows as there are in the swig_type_initial array). Each entry in
1805
+ * a column is one of the swig_cast_info structures for that type.
1806
+ * The cast_initial array is actually an array of arrays, because each row has
1807
+ * a variable number of columns. So to actually build the cast linked list,
1808
+ * we find the array of casts associated with the type, and loop through it
1809
+ * adding the casts to the list. The one last trick we need to do is making
1810
+ * sure the type pointer in the swig_cast_info struct is correct.
1811
+ *
1812
+ * First off, we lookup the cast->type name to see if it is already loaded.
1813
+ * There are three cases to handle:
1814
+ * 1) If the cast->type has already been loaded AND the type we are adding
1815
+ * casting info to has not been loaded (it is in this module), THEN we
1816
+ * replace the cast->type pointer with the type pointer that has already
1817
+ * been loaded.
1818
+ * 2) If BOTH types (the one we are adding casting info to, and the
1819
+ * cast->type) are loaded, THEN the cast info has already been loaded by
1820
+ * the previous module so we just ignore it.
1821
+ * 3) Finally, if cast->type has not already been loaded, then we add that
1822
+ * swig_cast_info to the linked list (because the cast->type) pointer will
1823
+ * be correct.
1824
+ * ----------------------------------------------------------------------------- */
1825
+
1826
+ #ifdef __cplusplus
1827
+ extern "C" {
1828
+ #if 0
1829
+ } /* c-mode */
1830
+ #endif
1831
+ #endif
1832
+
1833
+ #if 0
1834
+ #define SWIGRUNTIME_DEBUG
1835
+ #endif
1836
+
1837
+
1838
+ SWIGRUNTIME void
1839
+ SWIG_InitializeModule(void *clientdata) {
1840
+ size_t i;
1841
+ swig_module_info *module_head, *iter;
1842
+ int found;
1843
+
1844
+ clientdata = clientdata;
1845
+
1846
+ /* check to see if the circular list has been setup, if not, set it up */
1847
+ if (swig_module.next==0) {
1848
+ /* Initialize the swig_module */
1849
+ swig_module.type_initial = swig_type_initial;
1850
+ swig_module.cast_initial = swig_cast_initial;
1851
+ swig_module.next = &swig_module;
1852
+ }
1853
+
1854
+ /* Try and load any already created modules */
1855
+ module_head = SWIG_GetModule(clientdata);
1856
+ if (!module_head) {
1857
+ /* This is the first module loaded for this interpreter */
1858
+ /* so set the swig module into the interpreter */
1859
+ SWIG_SetModule(clientdata, &swig_module);
1860
+ module_head = &swig_module;
1861
+ } else {
1862
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
1863
+ found=0;
1864
+ iter=module_head;
1865
+ do {
1866
+ if (iter==&swig_module) {
1867
+ found=1;
1868
+ break;
1869
+ }
1870
+ iter=iter->next;
1871
+ } while (iter!= module_head);
1872
+
1873
+ /* if the is found in the list, then all is done and we may leave */
1874
+ if (found) return;
1875
+ /* otherwise we must add out module into the list */
1876
+ swig_module.next = module_head->next;
1877
+ module_head->next = &swig_module;
1878
+ }
1879
+
1880
+ /* Now work on filling in swig_module.types */
1881
+ #ifdef SWIGRUNTIME_DEBUG
1882
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
1883
+ #endif
1884
+ for (i = 0; i < swig_module.size; ++i) {
1885
+ swig_type_info *type = 0;
1886
+ swig_type_info *ret;
1887
+ swig_cast_info *cast;
1888
+
1889
+ #ifdef SWIGRUNTIME_DEBUG
1890
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
1891
+ #endif
1892
+
1893
+ /* if there is another module already loaded */
1894
+ if (swig_module.next != &swig_module) {
1895
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
1896
+ }
1897
+ if (type) {
1898
+ /* Overwrite clientdata field */
1899
+ #ifdef SWIGRUNTIME_DEBUG
1900
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
1901
+ #endif
1902
+ if (swig_module.type_initial[i]->clientdata) {
1903
+ type->clientdata = swig_module.type_initial[i]->clientdata;
1904
+ #ifdef SWIGRUNTIME_DEBUG
1905
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
1906
+ #endif
1907
+ }
1908
+ } else {
1909
+ type = swig_module.type_initial[i];
1910
+ }
1911
+
1912
+ /* Insert casting types */
1913
+ cast = swig_module.cast_initial[i];
1914
+ while (cast->type) {
1915
+
1916
+ /* Don't need to add information already in the list */
1917
+ ret = 0;
1918
+ #ifdef SWIGRUNTIME_DEBUG
1919
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
1920
+ #endif
1921
+ if (swig_module.next != &swig_module) {
1922
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
1923
+ #ifdef SWIGRUNTIME_DEBUG
1924
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
1925
+ #endif
1926
+ }
1927
+ if (ret) {
1928
+ if (type == swig_module.type_initial[i]) {
1929
+ #ifdef SWIGRUNTIME_DEBUG
1930
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
1931
+ #endif
1932
+ cast->type = ret;
1933
+ ret = 0;
1934
+ } else {
1935
+ /* Check for casting already in the list */
1936
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
1937
+ #ifdef SWIGRUNTIME_DEBUG
1938
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
1939
+ #endif
1940
+ if (!ocast) ret = 0;
1941
+ }
1942
+ }
1943
+
1944
+ if (!ret) {
1945
+ #ifdef SWIGRUNTIME_DEBUG
1946
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
1947
+ #endif
1948
+ if (type->cast) {
1949
+ type->cast->prev = cast;
1950
+ cast->next = type->cast;
1951
+ }
1952
+ type->cast = cast;
1953
+ }
1954
+ cast++;
1955
+ }
1956
+ /* Set entry in modules->types array equal to the type */
1957
+ swig_module.types[i] = type;
1958
+ }
1959
+ swig_module.types[i] = 0;
1960
+
1961
+ #ifdef SWIGRUNTIME_DEBUG
1962
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
1963
+ for (i = 0; i < swig_module.size; ++i) {
1964
+ int j = 0;
1965
+ swig_cast_info *cast = swig_module.cast_initial[i];
1966
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
1967
+ while (cast->type) {
1968
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
1969
+ cast++;
1970
+ ++j;
1971
+ }
1972
+ printf("---- Total casts: %d\n",j);
1973
+ }
1974
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
1975
+ #endif
1976
+ }
1977
+
1978
+ /* This function will propagate the clientdata field of type to
1979
+ * any new swig_type_info structures that have been added into the list
1980
+ * of equivalent types. It is like calling
1981
+ * SWIG_TypeClientData(type, clientdata) a second time.
1982
+ */
1983
+ SWIGRUNTIME void
1984
+ SWIG_PropagateClientData(void) {
1985
+ size_t i;
1986
+ swig_cast_info *equiv;
1987
+ static int init_run = 0;
1988
+
1989
+ if (init_run) return;
1990
+ init_run = 1;
1991
+
1992
+ for (i = 0; i < swig_module.size; i++) {
1993
+ if (swig_module.types[i]->clientdata) {
1994
+ equiv = swig_module.types[i]->cast;
1995
+ while (equiv) {
1996
+ if (!equiv->converter) {
1997
+ if (equiv->type && !equiv->type->clientdata)
1998
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
1999
+ }
2000
+ equiv = equiv->next;
2001
+ }
2002
+ }
2003
+ }
2004
+ }
2005
+
2006
+ #ifdef __cplusplus
2007
+ #if 0
2008
+ { /* c-mode */
2009
+ #endif
2010
+ }
2011
+ #endif
2012
+
2013
+
2014
+ #ifdef __cplusplus
2015
+ extern "C"
2016
+ #endif
2017
+ SWIGEXPORT void Init_Nfc(void) {
2018
+ size_t i;
2019
+
2020
+ SWIG_InitRuntime();
2021
+ mNfc = rb_define_module("Nfc");
2022
+
2023
+ SWIG_InitializeModule(0);
2024
+ for (i = 0; i < swig_module.size; i++) {
2025
+ SWIG_define_class(swig_module.types[i]);
2026
+ }
2027
+
2028
+ SWIG_RubyInitializeTrackings();
2029
+ rb_define_module_function(mNfc, "set_callback", _wrap_set_callback, -1);
2030
+ rb_define_module_function(mNfc, "enable", _wrap_enable, -1);
2031
+ rb_define_module_function(mNfc, "is_enabled", _wrap_is_enabled, -1);
2032
+ rb_define_module_function(mNfc, "is_supported", _wrap_is_supported, -1);
2033
+ }
2034
+