fxruby 1.6.19-x86-mingw32 → 1.6.20-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (973) hide show
  1. data/History.txt +10 -0
  2. data/Manifest.txt +922 -0
  3. data/README +0 -0
  4. data/{LICENSE → README.txt} +27 -1
  5. data/Rakefile +191 -0
  6. data/TODO +47 -0
  7. data/doap.rdf +87 -0
  8. data/examples/RAA.rb +0 -0
  9. data/examples/README +0 -0
  10. data/examples/babelfish.rb +0 -0
  11. data/examples/bounce.rb +0 -0
  12. data/examples/browser.rb +0 -0
  13. data/examples/button.rb +0 -0
  14. data/examples/datatarget.rb +0 -0
  15. data/examples/dctest.rb +0 -0
  16. data/examples/dialog.rb +0 -0
  17. data/examples/dilbert.rb +0 -0
  18. data/examples/dirlist.rb +0 -0
  19. data/examples/dragdrop.rb +0 -0
  20. data/examples/dragsource.rb +0 -0
  21. data/examples/dropsite.rb +0 -0
  22. data/examples/foursplit.rb +0 -0
  23. data/examples/gltest.rb +0 -0
  24. data/examples/glviewer.rb +0 -0
  25. data/examples/groupbox.rb +0 -0
  26. data/examples/header.rb +0 -0
  27. data/examples/hello.rb +0 -0
  28. data/examples/hello2.rb +0 -0
  29. data/examples/iRAA.rb +0 -0
  30. data/examples/iconlist.rb +0 -0
  31. data/examples/icons/AngryGuyInBunnySuit.ico +0 -0
  32. data/examples/icons/FatBot.ico +0 -0
  33. data/examples/icons/FlippedySwitch.ico +0 -0
  34. data/examples/icons/LeGoon.ico +0 -0
  35. data/examples/icons/Net.ico +0 -0
  36. data/examples/icons/RedMacOS.ico +0 -0
  37. data/examples/icons/SawBlade.ico +0 -0
  38. data/examples/icons/backview.png +0 -0
  39. data/examples/icons/big.png +0 -0
  40. data/examples/icons/bigfolder.png +0 -0
  41. data/examples/icons/bigpenguin.png +0 -0
  42. data/examples/icons/bluebullet14x14.gif +0 -0
  43. data/examples/icons/bottomview.png +0 -0
  44. data/examples/icons/camera.png +0 -0
  45. data/examples/icons/capbutt.png +0 -0
  46. data/examples/icons/capnotlast.png +0 -0
  47. data/examples/icons/capproj.png +0 -0
  48. data/examples/icons/capround.png +0 -0
  49. data/examples/icons/colorpal.png +0 -0
  50. data/examples/icons/copy.png +0 -0
  51. data/examples/icons/cut.png +0 -0
  52. data/examples/icons/delimit.png +0 -0
  53. data/examples/icons/dippy.png +0 -0
  54. data/examples/icons/double_dash.png +0 -0
  55. data/examples/icons/filenew.png +0 -0
  56. data/examples/icons/fileopen.png +0 -0
  57. data/examples/icons/filesave.png +0 -0
  58. data/examples/icons/filesaveas.png +0 -0
  59. data/examples/icons/fonts.png +0 -0
  60. data/examples/icons/fox.png +0 -0
  61. data/examples/icons/foxicon.png +0 -0
  62. data/examples/icons/frontview.png +0 -0
  63. data/examples/icons/gem_big.png +0 -0
  64. data/examples/icons/gem_small.png +0 -0
  65. data/examples/icons/hello2.png +0 -0
  66. data/examples/icons/help.png +0 -0
  67. data/examples/icons/indent.png +0 -0
  68. data/examples/icons/jbevel.png +0 -0
  69. data/examples/icons/jmiter.png +0 -0
  70. data/examples/icons/jround.png +0 -0
  71. data/examples/icons/kill.png +0 -0
  72. data/examples/icons/leftview.png +0 -0
  73. data/examples/icons/light.png +0 -0
  74. data/examples/icons/minidoc.png +0 -0
  75. data/examples/icons/minifolder.png +0 -0
  76. data/examples/icons/minifolderopen.png +0 -0
  77. data/examples/icons/newfolder.png +0 -0
  78. data/examples/icons/nolight.png +0 -0
  79. data/examples/icons/onoff_dash.png +0 -0
  80. data/examples/icons/palette.png +0 -0
  81. data/examples/icons/parallel.png +0 -0
  82. data/examples/icons/paste.png +0 -0
  83. data/examples/icons/pattern.png +0 -0
  84. data/examples/icons/penguin.png +0 -0
  85. data/examples/icons/perspective.png +0 -0
  86. data/examples/icons/printicon.png +0 -0
  87. data/examples/icons/prop.png +0 -0
  88. data/examples/icons/redo.png +0 -0
  89. data/examples/icons/rightview.png +0 -0
  90. data/examples/icons/saveas.png +0 -0
  91. data/examples/icons/shutter1.png +0 -0
  92. data/examples/icons/shutter2.png +0 -0
  93. data/examples/icons/small.png +0 -0
  94. data/examples/icons/smoothlight.png +0 -0
  95. data/examples/icons/solid_line.png +0 -0
  96. data/examples/icons/tbuplevel.png +0 -0
  97. data/examples/icons/topview.png +0 -0
  98. data/examples/icons/transpbullet14x14.gif +0 -0
  99. data/examples/icons/undo.png +0 -0
  100. data/examples/icons/winapp.png +0 -0
  101. data/examples/icons/zoom.png +0 -0
  102. data/examples/image.rb +0 -0
  103. data/examples/imageviewer.rb +0 -0
  104. data/examples/inputs.rb +0 -0
  105. data/examples/mditest.rb +0 -0
  106. data/examples/pig.rb +0 -0
  107. data/examples/raabrowser.rb +0 -0
  108. data/examples/scintilla-test.rb +0 -0
  109. data/examples/scribble-orig.rb +0 -0
  110. data/examples/scribble.rb +0 -0
  111. data/examples/shutter.rb +0 -0
  112. data/examples/splitter.rb +0 -0
  113. data/examples/styledtext.rb +0 -0
  114. data/examples/tabbook.rb +0 -0
  115. data/examples/table.rb +0 -0
  116. data/examples/textedit/commands.rb +0 -0
  117. data/examples/textedit/helpwindow.rb +0 -0
  118. data/examples/textedit/prefdialog.rb +0 -0
  119. data/examples/textedit/textedit.rb +0 -0
  120. data/examples/unicode.rb +0 -0
  121. data/ext/fox16/FXRbApp.cpp +128 -0
  122. data/ext/fox16/FXRbDataTarget.cpp +110 -0
  123. data/ext/fox16/FXRbGLViewer.cpp +89 -0
  124. data/ext/fox16/FXRuby.cpp +2067 -0
  125. data/ext/fox16/MANIFEST +189 -0
  126. data/ext/fox16/core_wrap.cpp +11541 -0
  127. data/ext/fox16/dc_wrap.cpp +2874 -0
  128. data/ext/fox16/dialogs_wrap.cpp +7963 -0
  129. data/ext/fox16/extconf.rb +143 -0
  130. data/ext/fox16/frames_wrap.cpp +11380 -0
  131. data/ext/fox16/fx3d_wrap.cpp +10651 -0
  132. data/ext/fox16/iconlist_wrap.cpp +4074 -0
  133. data/ext/fox16/icons_wrap.cpp +4745 -0
  134. data/ext/fox16/image_wrap.cpp +4388 -0
  135. data/ext/fox16/impl.cpp +1156 -0
  136. data/ext/fox16/include/FXMemoryBuffer.h +52 -0
  137. data/ext/fox16/include/FXRb4Splitter.h +54 -0
  138. data/ext/fox16/include/FXRb7Segment.h +51 -0
  139. data/ext/fox16/include/FXRbAccelTable.h +46 -0
  140. data/ext/fox16/include/FXRbApp.h +155 -0
  141. data/ext/fox16/include/FXRbAppVirtuals.h +15 -0
  142. data/ext/fox16/include/FXRbArrowButton.h +51 -0
  143. data/ext/fox16/include/FXRbBMPIcon.h +54 -0
  144. data/ext/fox16/include/FXRbBMPImage.h +54 -0
  145. data/ext/fox16/include/FXRbBitmap.h +133 -0
  146. data/ext/fox16/include/FXRbBitmapFrame.h +56 -0
  147. data/ext/fox16/include/FXRbBitmapView.h +56 -0
  148. data/ext/fox16/include/FXRbBitmapVirtuals.h +37 -0
  149. data/ext/fox16/include/FXRbButton.h +51 -0
  150. data/ext/fox16/include/FXRbCURCursor.h +60 -0
  151. data/ext/fox16/include/FXRbCanvas.h +51 -0
  152. data/ext/fox16/include/FXRbCheckButton.h +51 -0
  153. data/ext/fox16/include/FXRbChoiceBox.h +56 -0
  154. data/ext/fox16/include/FXRbColorBar.h +51 -0
  155. data/ext/fox16/include/FXRbColorDialog.h +53 -0
  156. data/ext/fox16/include/FXRbColorList.h +84 -0
  157. data/ext/fox16/include/FXRbColorRing.h +51 -0
  158. data/ext/fox16/include/FXRbColorSelector.h +51 -0
  159. data/ext/fox16/include/FXRbColorWell.h +51 -0
  160. data/ext/fox16/include/FXRbColorWheel.h +51 -0
  161. data/ext/fox16/include/FXRbComboBox.h +56 -0
  162. data/ext/fox16/include/FXRbCommon.h +93 -0
  163. data/ext/fox16/include/FXRbComposite.h +51 -0
  164. data/ext/fox16/include/FXRbCursor.h +87 -0
  165. data/ext/fox16/include/FXRbCursorVirtuals.h +6 -0
  166. data/ext/fox16/include/FXRbDC.h +427 -0
  167. data/ext/fox16/include/FXRbDCPrint.h +49 -0
  168. data/ext/fox16/include/FXRbDCVirtuals.h +187 -0
  169. data/ext/fox16/include/FXRbDCWindow.h +64 -0
  170. data/ext/fox16/include/FXRbDataTarget.h +65 -0
  171. data/ext/fox16/include/FXRbDebugTarget.h +46 -0
  172. data/ext/fox16/include/FXRbDelegator.h +46 -0
  173. data/ext/fox16/include/FXRbDial.h +51 -0
  174. data/ext/fox16/include/FXRbDialogBox.h +68 -0
  175. data/ext/fox16/include/FXRbDialogBoxVirtuals.h +3 -0
  176. data/ext/fox16/include/FXRbDict.h +46 -0
  177. data/ext/fox16/include/FXRbDirBox.h +52 -0
  178. data/ext/fox16/include/FXRbDirDialog.h +56 -0
  179. data/ext/fox16/include/FXRbDirList.h +79 -0
  180. data/ext/fox16/include/FXRbDirSelector.h +51 -0
  181. data/ext/fox16/include/FXRbDockBar.h +86 -0
  182. data/ext/fox16/include/FXRbDockBarVirtuals.h +10 -0
  183. data/ext/fox16/include/FXRbDockHandler.h +51 -0
  184. data/ext/fox16/include/FXRbDockSite.h +85 -0
  185. data/ext/fox16/include/FXRbDockSiteVirtuals.h +13 -0
  186. data/ext/fox16/include/FXRbDockTitle.h +51 -0
  187. data/ext/fox16/include/FXRbDocument.h +46 -0
  188. data/ext/fox16/include/FXRbDragCorner.h +51 -0
  189. data/ext/fox16/include/FXRbDrawable.h +64 -0
  190. data/ext/fox16/include/FXRbDrawableVirtuals.h +3 -0
  191. data/ext/fox16/include/FXRbDriveBox.h +52 -0
  192. data/ext/fox16/include/FXRbFileDialog.h +56 -0
  193. data/ext/fox16/include/FXRbFileDict.h +104 -0
  194. data/ext/fox16/include/FXRbFileDictVirtuals.h +9 -0
  195. data/ext/fox16/include/FXRbFileList.h +81 -0
  196. data/ext/fox16/include/FXRbFileSelector.h +51 -0
  197. data/ext/fox16/include/FXRbFoldingItemVirtuals.h +42 -0
  198. data/ext/fox16/include/FXRbFoldingList.h +270 -0
  199. data/ext/fox16/include/FXRbFoldingListVirtuals.h +43 -0
  200. data/ext/fox16/include/FXRbFont.h +183 -0
  201. data/ext/fox16/include/FXRbFontDialog.h +53 -0
  202. data/ext/fox16/include/FXRbFontSelector.h +51 -0
  203. data/ext/fox16/include/FXRbFontVirtuals.h +55 -0
  204. data/ext/fox16/include/FXRbFrame.h +51 -0
  205. data/ext/fox16/include/FXRbGIFCursor.h +60 -0
  206. data/ext/fox16/include/FXRbGIFIcon.h +54 -0
  207. data/ext/fox16/include/FXRbGIFImage.h +54 -0
  208. data/ext/fox16/include/FXRbGLCanvas.h +92 -0
  209. data/ext/fox16/include/FXRbGLCanvasVirtuals.h +13 -0
  210. data/ext/fox16/include/FXRbGLContext.h +58 -0
  211. data/ext/fox16/include/FXRbGLObject.h +103 -0
  212. data/ext/fox16/include/FXRbGLObjectVirtuals.h +22 -0
  213. data/ext/fox16/include/FXRbGLShape.h +81 -0
  214. data/ext/fox16/include/FXRbGLShapeVirtuals.h +8 -0
  215. data/ext/fox16/include/FXRbGLViewer.h +89 -0
  216. data/ext/fox16/include/FXRbGLViewerVirtuals.h +10 -0
  217. data/ext/fox16/include/FXRbGLVisual.h +56 -0
  218. data/ext/fox16/include/FXRbGradientBar.h +55 -0
  219. data/ext/fox16/include/FXRbGroupBox.h +51 -0
  220. data/ext/fox16/include/FXRbHeader.h +129 -0
  221. data/ext/fox16/include/FXRbHeaderItemVirtuals.h +22 -0
  222. data/ext/fox16/include/FXRbHorizontalFrame.h +51 -0
  223. data/ext/fox16/include/FXRbICOIcon.h +54 -0
  224. data/ext/fox16/include/FXRbICOImage.h +54 -0
  225. data/ext/fox16/include/FXRbIcon.h +57 -0
  226. data/ext/fox16/include/FXRbIconItemVirtuals.h +68 -0
  227. data/ext/fox16/include/FXRbIconList.h +288 -0
  228. data/ext/fox16/include/FXRbIconListVirtuals.h +35 -0
  229. data/ext/fox16/include/FXRbIconSource.h +127 -0
  230. data/ext/fox16/include/FXRbIconSourceVirtuals.h +37 -0
  231. data/ext/fox16/include/FXRbId.h +74 -0
  232. data/ext/fox16/include/FXRbIdVirtuals.h +9 -0
  233. data/ext/fox16/include/FXRbImage.h +162 -0
  234. data/ext/fox16/include/FXRbImageFrame.h +56 -0
  235. data/ext/fox16/include/FXRbImageView.h +55 -0
  236. data/ext/fox16/include/FXRbImageVirtuals.h +51 -0
  237. data/ext/fox16/include/FXRbInputDialog.h +56 -0
  238. data/ext/fox16/include/FXRbJPGIcon.h +54 -0
  239. data/ext/fox16/include/FXRbJPGImage.h +54 -0
  240. data/ext/fox16/include/FXRbKnob.h +51 -0
  241. data/ext/fox16/include/FXRbLabel.h +51 -0
  242. data/ext/fox16/include/FXRbList.h +226 -0
  243. data/ext/fox16/include/FXRbListBox.h +67 -0
  244. data/ext/fox16/include/FXRbListBoxVirtuals.h +4 -0
  245. data/ext/fox16/include/FXRbListItemVirtuals.h +33 -0
  246. data/ext/fox16/include/FXRbListVirtuals.h +30 -0
  247. data/ext/fox16/include/FXRbMDIButton.h +162 -0
  248. data/ext/fox16/include/FXRbMDIChild.h +82 -0
  249. data/ext/fox16/include/FXRbMDIChildVirtuals.h +12 -0
  250. data/ext/fox16/include/FXRbMDIClient.h +80 -0
  251. data/ext/fox16/include/FXRbMDIClientVirtuals.h +12 -0
  252. data/ext/fox16/include/FXRbMainWindow.h +54 -0
  253. data/ext/fox16/include/FXRbMatrix.h +51 -0
  254. data/ext/fox16/include/FXRbMenuBar.h +63 -0
  255. data/ext/fox16/include/FXRbMenuButton.h +51 -0
  256. data/ext/fox16/include/FXRbMenuCaption.h +51 -0
  257. data/ext/fox16/include/FXRbMenuCascade.h +51 -0
  258. data/ext/fox16/include/FXRbMenuCheck.h +49 -0
  259. data/ext/fox16/include/FXRbMenuCommand.h +49 -0
  260. data/ext/fox16/include/FXRbMenuPane.h +52 -0
  261. data/ext/fox16/include/FXRbMenuRadio.h +49 -0
  262. data/ext/fox16/include/FXRbMenuSeparator.h +51 -0
  263. data/ext/fox16/include/FXRbMenuTitle.h +51 -0
  264. data/ext/fox16/include/FXRbMessageBox.h +56 -0
  265. data/ext/fox16/include/FXRbObject.h +67 -0
  266. data/ext/fox16/include/FXRbObjectVirtuals.h +9 -0
  267. data/ext/fox16/include/FXRbOptionMenu.h +73 -0
  268. data/ext/fox16/include/FXRbPCXIcon.h +54 -0
  269. data/ext/fox16/include/FXRbPCXImage.h +54 -0
  270. data/ext/fox16/include/FXRbPNGIcon.h +54 -0
  271. data/ext/fox16/include/FXRbPNGImage.h +54 -0
  272. data/ext/fox16/include/FXRbPPMIcon.h +54 -0
  273. data/ext/fox16/include/FXRbPPMImage.h +54 -0
  274. data/ext/fox16/include/FXRbPacker.h +51 -0
  275. data/ext/fox16/include/FXRbPicker.h +51 -0
  276. data/ext/fox16/include/FXRbPopup.h +70 -0
  277. data/ext/fox16/include/FXRbPopupVirtuals.h +6 -0
  278. data/ext/fox16/include/FXRbPrintDialog.h +53 -0
  279. data/ext/fox16/include/FXRbProgressBar.h +51 -0
  280. data/ext/fox16/include/FXRbProgressDialog.h +53 -0
  281. data/ext/fox16/include/FXRbRGBIcon.h +54 -0
  282. data/ext/fox16/include/FXRbRGBImage.h +54 -0
  283. data/ext/fox16/include/FXRbRadioButton.h +51 -0
  284. data/ext/fox16/include/FXRbRealSlider.h +51 -0
  285. data/ext/fox16/include/FXRbRealSpinner.h +64 -0
  286. data/ext/fox16/include/FXRbRealSpinnerVirtuals.h +3 -0
  287. data/ext/fox16/include/FXRbRecentFiles.h +52 -0
  288. data/ext/fox16/include/FXRbRegistry.h +46 -0
  289. data/ext/fox16/include/FXRbReplaceDialog.h +53 -0
  290. data/ext/fox16/include/FXRbRootWindow.h +51 -0
  291. data/ext/fox16/include/FXRbRuler.h +56 -0
  292. data/ext/fox16/include/FXRbRulerView.h +54 -0
  293. data/ext/fox16/include/FXRbScintilla.h +52 -0
  294. data/ext/fox16/include/FXRbScrollArea.h +87 -0
  295. data/ext/fox16/include/FXRbScrollAreaVirtuals.h +13 -0
  296. data/ext/fox16/include/FXRbScrollBar.h +73 -0
  297. data/ext/fox16/include/FXRbScrollPane.h +52 -0
  298. data/ext/fox16/include/FXRbScrollWindow.h +57 -0
  299. data/ext/fox16/include/FXRbSearchDialog.h +53 -0
  300. data/ext/fox16/include/FXRbSeparator.h +95 -0
  301. data/ext/fox16/include/FXRbSettings.h +46 -0
  302. data/ext/fox16/include/FXRbShell.h +56 -0
  303. data/ext/fox16/include/FXRbShutter.h +86 -0
  304. data/ext/fox16/include/FXRbShutterVirtuals.h +3 -0
  305. data/ext/fox16/include/FXRbSlider.h +51 -0
  306. data/ext/fox16/include/FXRbSpinner.h +64 -0
  307. data/ext/fox16/include/FXRbSpinnerVirtuals.h +3 -0
  308. data/ext/fox16/include/FXRbSplashWindow.h +57 -0
  309. data/ext/fox16/include/FXRbSplitter.h +54 -0
  310. data/ext/fox16/include/FXRbSpring.h +51 -0
  311. data/ext/fox16/include/FXRbStatusBar.h +51 -0
  312. data/ext/fox16/include/FXRbStatusLine.h +51 -0
  313. data/ext/fox16/include/FXRbStream.h +101 -0
  314. data/ext/fox16/include/FXRbStreamVirtuals.h +9 -0
  315. data/ext/fox16/include/FXRbStringDict.h +46 -0
  316. data/ext/fox16/include/FXRbSwitcher.h +51 -0
  317. data/ext/fox16/include/FXRbTGAIcon.h +54 -0
  318. data/ext/fox16/include/FXRbTGAImage.h +54 -0
  319. data/ext/fox16/include/FXRbTIFIcon.h +54 -0
  320. data/ext/fox16/include/FXRbTIFImage.h +54 -0
  321. data/ext/fox16/include/FXRbTabBar.h +64 -0
  322. data/ext/fox16/include/FXRbTabBarVirtuals.h +3 -0
  323. data/ext/fox16/include/FXRbTabBook.h +52 -0
  324. data/ext/fox16/include/FXRbTabItem.h +51 -0
  325. data/ext/fox16/include/FXRbTable.h +509 -0
  326. data/ext/fox16/include/FXRbTableItemVirtuals.h +89 -0
  327. data/ext/fox16/include/FXRbTableVirtuals.h +89 -0
  328. data/ext/fox16/include/FXRbText.h +187 -0
  329. data/ext/fox16/include/FXRbTextField.h +51 -0
  330. data/ext/fox16/include/FXRbTextVirtuals.h +52 -0
  331. data/ext/fox16/include/FXRbToggleButton.h +51 -0
  332. data/ext/fox16/include/FXRbToolBar.h +63 -0
  333. data/ext/fox16/include/FXRbToolBarGrip.h +51 -0
  334. data/ext/fox16/include/FXRbToolBarShell.h +52 -0
  335. data/ext/fox16/include/FXRbToolBarTab.h +51 -0
  336. data/ext/fox16/include/FXRbToolTip.h +51 -0
  337. data/ext/fox16/include/FXRbTopWindow.h +91 -0
  338. data/ext/fox16/include/FXRbTopWindowVirtuals.h +15 -0
  339. data/ext/fox16/include/FXRbTranslator.h +61 -0
  340. data/ext/fox16/include/FXRbTranslatorVirtuals.h +4 -0
  341. data/ext/fox16/include/FXRbTreeItemVirtuals.h +42 -0
  342. data/ext/fox16/include/FXRbTreeList.h +277 -0
  343. data/ext/fox16/include/FXRbTreeListBox.h +64 -0
  344. data/ext/fox16/include/FXRbTreeListBoxVirtuals.h +4 -0
  345. data/ext/fox16/include/FXRbTreeListVirtuals.h +42 -0
  346. data/ext/fox16/include/FXRbTriStateButton.h +51 -0
  347. data/ext/fox16/include/FXRbVerticalFrame.h +51 -0
  348. data/ext/fox16/include/FXRbVisual.h +56 -0
  349. data/ext/fox16/include/FXRbWindow.h +248 -0
  350. data/ext/fox16/include/FXRbWindowVirtuals.h +94 -0
  351. data/ext/fox16/include/FXRbWizard.h +60 -0
  352. data/ext/fox16/include/FXRbXBMIcon.h +54 -0
  353. data/ext/fox16/include/FXRbXBMImage.h +54 -0
  354. data/ext/fox16/include/FXRbXPMIcon.h +54 -0
  355. data/ext/fox16/include/FXRbXPMImage.h +54 -0
  356. data/ext/fox16/include/FXRuby.h +842 -0
  357. data/ext/fox16/include/impl.h +214 -0
  358. data/ext/fox16/include/inlinestubs.h +1155 -0
  359. data/ext/fox16/label_wrap.cpp +5700 -0
  360. data/ext/fox16/layout_wrap.cpp +6358 -0
  361. data/ext/fox16/librb.c +647 -0
  362. data/ext/fox16/list_wrap.cpp +2981 -0
  363. data/ext/fox16/make_impl.rb +121 -0
  364. data/ext/fox16/markfuncs.cpp +1650 -0
  365. data/ext/fox16/mdi_wrap.cpp +5266 -0
  366. data/ext/fox16/menu_wrap.cpp +5589 -0
  367. data/ext/fox16/scintilla_wrap.cpp +2518 -0
  368. data/ext/fox16/table_wrap.cpp +4173 -0
  369. data/ext/fox16/text_wrap.cpp +3832 -0
  370. data/ext/fox16/treelist_wrap.cpp +6004 -0
  371. data/ext/fox16/ui_wrap.cpp +14230 -0
  372. data/ext/fox16/unregisterOwnedObjects.cpp +120 -0
  373. data/index.html +0 -0
  374. data/lib/1.8/fox16.so +0 -0
  375. data/{ext/fox16 → lib/1.9}/fox16.so +0 -0
  376. data/lib/fox16.rb +8 -0
  377. data/lib/fox16/aliases.rb +0 -0
  378. data/lib/fox16/bitmapview.rb +223 -0
  379. data/lib/fox16/calendar.rb +0 -0
  380. data/lib/fox16/chore.rb +0 -0
  381. data/lib/fox16/colors.rb +0 -0
  382. data/lib/fox16/core.rb +0 -0
  383. data/lib/fox16/dict.rb +0 -0
  384. data/lib/fox16/glgroup.rb +0 -0
  385. data/lib/fox16/glshapes.rb +0 -0
  386. data/lib/fox16/input.rb +0 -0
  387. data/lib/fox16/irb.rb +0 -0
  388. data/lib/fox16/iterators.rb +0 -0
  389. data/lib/fox16/keys.rb +0 -0
  390. data/lib/fox16/kwargs.rb +893 -893
  391. data/lib/fox16/missingdep.rb +0 -0
  392. data/lib/fox16/pseudokeyboard.rb +0 -0
  393. data/lib/fox16/pseudomouse.rb +0 -0
  394. data/lib/fox16/responder.rb +0 -0
  395. data/lib/fox16/responder2.rb +0 -0
  396. data/lib/fox16/scintilla.rb +103 -3
  397. data/lib/fox16/settings.rb +0 -0
  398. data/lib/fox16/signal.rb +0 -0
  399. data/lib/fox16/timeout.rb +0 -0
  400. data/lib/fox16/undolist.rb +0 -0
  401. data/lib/fox16/version.rb +1 -5
  402. data/rdoc-sources/FX4Splitter.rb +0 -0
  403. data/rdoc-sources/FXAccelTable.rb +0 -0
  404. data/rdoc-sources/FXApp.rb +0 -0
  405. data/rdoc-sources/FXArrowButton.rb +0 -0
  406. data/rdoc-sources/FXBMPIcon.rb +0 -0
  407. data/rdoc-sources/FXBMPImage.rb +0 -0
  408. data/rdoc-sources/FXBitmap.rb +0 -0
  409. data/rdoc-sources/FXBitmapFrame.rb +0 -0
  410. data/rdoc-sources/FXBitmapView.rb +0 -0
  411. data/rdoc-sources/FXButton.rb +0 -0
  412. data/rdoc-sources/FXCURCursor.rb +0 -0
  413. data/rdoc-sources/FXCanvas.rb +0 -0
  414. data/rdoc-sources/FXCheckButton.rb +0 -0
  415. data/rdoc-sources/FXColorBar.rb +0 -0
  416. data/rdoc-sources/FXColorDialog.rb +0 -0
  417. data/rdoc-sources/FXColorSelector.rb +0 -0
  418. data/rdoc-sources/FXColorWell.rb +0 -0
  419. data/rdoc-sources/FXColorWheel.rb +0 -0
  420. data/rdoc-sources/FXComboBox.rb +0 -0
  421. data/rdoc-sources/FXComposite.rb +0 -0
  422. data/rdoc-sources/FXCursor.rb +0 -0
  423. data/rdoc-sources/FXDC.rb +0 -0
  424. data/rdoc-sources/FXDCPrint.rb +0 -0
  425. data/rdoc-sources/FXDCWindow.rb +0 -0
  426. data/rdoc-sources/FXDataTarget.rb +0 -0
  427. data/rdoc-sources/FXDebugTarget.rb +0 -0
  428. data/rdoc-sources/FXDelegator.rb +0 -0
  429. data/rdoc-sources/FXDial.rb +0 -0
  430. data/rdoc-sources/FXDialogBox.rb +0 -0
  431. data/rdoc-sources/FXDict.rb +0 -0
  432. data/rdoc-sources/FXDirBox.rb +0 -0
  433. data/rdoc-sources/FXDirDialog.rb +0 -0
  434. data/rdoc-sources/FXDirList.rb +0 -0
  435. data/rdoc-sources/FXDirSelector.rb +0 -0
  436. data/rdoc-sources/FXDockBar.rb +0 -0
  437. data/rdoc-sources/FXDockHandler.rb +0 -0
  438. data/rdoc-sources/FXDockTitle.rb +0 -0
  439. data/rdoc-sources/FXDocument.rb +0 -0
  440. data/rdoc-sources/FXDragCorner.rb +0 -0
  441. data/rdoc-sources/FXDrawable.rb +0 -0
  442. data/rdoc-sources/FXDriveBox.rb +0 -0
  443. data/rdoc-sources/FXFileDialog.rb +0 -0
  444. data/rdoc-sources/FXFileDict.rb +0 -0
  445. data/rdoc-sources/FXFileList.rb +0 -0
  446. data/rdoc-sources/FXFileSelector.rb +0 -0
  447. data/rdoc-sources/FXFileStream.rb +0 -0
  448. data/rdoc-sources/FXFoldingList.rb +0 -0
  449. data/rdoc-sources/FXFont.rb +0 -0
  450. data/rdoc-sources/FXFontDialog.rb +0 -0
  451. data/rdoc-sources/FXFontSelector.rb +0 -0
  452. data/rdoc-sources/FXFrame.rb +0 -0
  453. data/rdoc-sources/FXGIFCursor.rb +0 -0
  454. data/rdoc-sources/FXGIFIcon.rb +0 -0
  455. data/rdoc-sources/FXGIFImage.rb +0 -0
  456. data/rdoc-sources/FXGLCanvas.rb +0 -0
  457. data/rdoc-sources/FXGLContext.rb +0 -0
  458. data/rdoc-sources/FXGLObject.rb +0 -0
  459. data/rdoc-sources/FXGLShape.rb +0 -0
  460. data/rdoc-sources/FXGLViewer.rb +0 -0
  461. data/rdoc-sources/FXGLVisual.rb +0 -0
  462. data/rdoc-sources/FXGradientBar.rb +0 -0
  463. data/rdoc-sources/FXGroupBox.rb +0 -0
  464. data/rdoc-sources/FXHeader.rb +0 -0
  465. data/rdoc-sources/FXHorizontalFrame.rb +0 -0
  466. data/rdoc-sources/FXICOIcon.rb +0 -0
  467. data/rdoc-sources/FXICOImage.rb +0 -0
  468. data/rdoc-sources/FXIcon.rb +0 -0
  469. data/rdoc-sources/FXIconList.rb +0 -0
  470. data/rdoc-sources/FXId.rb +0 -0
  471. data/rdoc-sources/FXImage.rb +0 -0
  472. data/rdoc-sources/FXImageFrame.rb +0 -0
  473. data/rdoc-sources/FXImageView.rb +0 -0
  474. data/rdoc-sources/FXInputDialog.rb +0 -0
  475. data/rdoc-sources/FXJPGIcon.rb +0 -0
  476. data/rdoc-sources/FXJPGImage.rb +0 -0
  477. data/rdoc-sources/FXLabel.rb +0 -0
  478. data/rdoc-sources/FXList.rb +0 -0
  479. data/rdoc-sources/FXListBox.rb +0 -0
  480. data/rdoc-sources/FXMDIButton.rb +0 -0
  481. data/rdoc-sources/FXMDIChild.rb +0 -0
  482. data/rdoc-sources/FXMDIClient.rb +0 -0
  483. data/rdoc-sources/FXMainWindow.rb +0 -0
  484. data/rdoc-sources/FXMatrix.rb +0 -0
  485. data/rdoc-sources/FXMemoryBuffer.rb +0 -0
  486. data/rdoc-sources/FXMemoryStream.rb +0 -0
  487. data/rdoc-sources/FXMenuBar.rb +0 -0
  488. data/rdoc-sources/FXMenuButton.rb +0 -0
  489. data/rdoc-sources/FXMenuCaption.rb +0 -0
  490. data/rdoc-sources/FXMenuCascade.rb +0 -0
  491. data/rdoc-sources/FXMenuCheck.rb +0 -0
  492. data/rdoc-sources/FXMenuCommand.rb +0 -0
  493. data/rdoc-sources/FXMenuPane.rb +0 -0
  494. data/rdoc-sources/FXMenuRadio.rb +0 -0
  495. data/rdoc-sources/FXMenuSeparator.rb +0 -0
  496. data/rdoc-sources/FXMenuTitle.rb +0 -0
  497. data/rdoc-sources/FXMessageBox.rb +0 -0
  498. data/rdoc-sources/FXObject.rb +0 -0
  499. data/rdoc-sources/FXOptionMenu.rb +0 -0
  500. data/rdoc-sources/FXPCXIcon.rb +0 -0
  501. data/rdoc-sources/FXPCXImage.rb +0 -0
  502. data/rdoc-sources/FXPNGIcon.rb +0 -0
  503. data/rdoc-sources/FXPNGImage.rb +0 -0
  504. data/rdoc-sources/FXPPMIcon.rb +0 -0
  505. data/rdoc-sources/FXPPMImage.rb +0 -0
  506. data/rdoc-sources/FXPacker.rb +0 -0
  507. data/rdoc-sources/FXPicker.rb +0 -0
  508. data/rdoc-sources/FXPopup.rb +0 -0
  509. data/rdoc-sources/FXPrintDialog.rb +0 -0
  510. data/rdoc-sources/FXProgressBar.rb +0 -0
  511. data/rdoc-sources/FXProgressDialog.rb +0 -0
  512. data/rdoc-sources/FXQuatd.rb +0 -0
  513. data/rdoc-sources/FXQuatf.rb +0 -0
  514. data/rdoc-sources/FXRGBIcon.rb +0 -0
  515. data/rdoc-sources/FXRGBImage.rb +0 -0
  516. data/rdoc-sources/FXRadioButton.rb +0 -0
  517. data/rdoc-sources/FXRanged.rb +0 -0
  518. data/rdoc-sources/FXRangef.rb +0 -0
  519. data/rdoc-sources/FXRealSlider.rb +0 -0
  520. data/rdoc-sources/FXRealSpinner.rb +0 -0
  521. data/rdoc-sources/FXRecentFiles.rb +0 -0
  522. data/rdoc-sources/FXRectangle.rb +0 -0
  523. data/rdoc-sources/FXRegion.rb +0 -0
  524. data/rdoc-sources/FXRegistry.rb +0 -0
  525. data/rdoc-sources/FXReplaceDialog.rb +0 -0
  526. data/rdoc-sources/FXRootWindow.rb +0 -0
  527. data/rdoc-sources/FXRuler.rb +0 -0
  528. data/rdoc-sources/FXRulerView.rb +0 -0
  529. data/rdoc-sources/FXScintilla.rb +0 -0
  530. data/rdoc-sources/FXScrollArea.rb +0 -0
  531. data/rdoc-sources/FXScrollBar.rb +0 -0
  532. data/rdoc-sources/FXScrollPane.rb +0 -0
  533. data/rdoc-sources/FXScrollWindow.rb +0 -0
  534. data/rdoc-sources/FXSearchDialog.rb +0 -0
  535. data/rdoc-sources/FXSeparator.rb +0 -0
  536. data/rdoc-sources/FXSettings.rb +0 -0
  537. data/rdoc-sources/FXShell.rb +0 -0
  538. data/rdoc-sources/FXShutter.rb +0 -0
  539. data/rdoc-sources/FXSize.rb +0 -0
  540. data/rdoc-sources/FXSlider.rb +0 -0
  541. data/rdoc-sources/FXSphered.rb +0 -0
  542. data/rdoc-sources/FXSpheref.rb +0 -0
  543. data/rdoc-sources/FXSpinner.rb +0 -0
  544. data/rdoc-sources/FXSplitter.rb +0 -0
  545. data/rdoc-sources/FXSpring.rb +0 -0
  546. data/rdoc-sources/FXStatusBar.rb +0 -0
  547. data/rdoc-sources/FXStatusLine.rb +0 -0
  548. data/rdoc-sources/FXStream.rb +0 -0
  549. data/rdoc-sources/FXStringDict.rb +0 -0
  550. data/rdoc-sources/FXSwitcher.rb +0 -0
  551. data/rdoc-sources/FXTGAIcon.rb +0 -0
  552. data/rdoc-sources/FXTGAImage.rb +0 -0
  553. data/rdoc-sources/FXTIFIcon.rb +0 -0
  554. data/rdoc-sources/FXTIFImage.rb +0 -0
  555. data/rdoc-sources/FXTabBar.rb +0 -0
  556. data/rdoc-sources/FXTabBook.rb +0 -0
  557. data/rdoc-sources/FXTabItem.rb +0 -0
  558. data/rdoc-sources/FXTable.rb +0 -0
  559. data/rdoc-sources/FXText.rb +0 -0
  560. data/rdoc-sources/FXTextField.rb +0 -0
  561. data/rdoc-sources/FXToggleButton.rb +0 -0
  562. data/rdoc-sources/FXToolBar.rb +0 -0
  563. data/rdoc-sources/FXToolBarGrip.rb +0 -0
  564. data/rdoc-sources/FXToolBarShell.rb +0 -0
  565. data/rdoc-sources/FXToolBarTab.rb +0 -0
  566. data/rdoc-sources/FXToolTip.rb +0 -0
  567. data/rdoc-sources/FXTopWindow.rb +0 -0
  568. data/rdoc-sources/FXTreeList.rb +0 -0
  569. data/rdoc-sources/FXTreeListBox.rb +0 -0
  570. data/rdoc-sources/FXTriStateButton.rb +0 -0
  571. data/rdoc-sources/FXVec2d.rb +0 -0
  572. data/rdoc-sources/FXVec2f.rb +0 -0
  573. data/rdoc-sources/FXVec3d.rb +0 -0
  574. data/rdoc-sources/FXVec3f.rb +0 -0
  575. data/rdoc-sources/FXVec4d.rb +0 -0
  576. data/rdoc-sources/FXVec4f.rb +0 -0
  577. data/rdoc-sources/FXVerticalFrame.rb +0 -0
  578. data/rdoc-sources/FXVisual.rb +0 -0
  579. data/rdoc-sources/FXWindow.rb +0 -0
  580. data/rdoc-sources/FXWizard.rb +0 -0
  581. data/rdoc-sources/FXXBMIcon.rb +0 -0
  582. data/rdoc-sources/FXXBMImage.rb +0 -0
  583. data/rdoc-sources/FXXPMIcon.rb +0 -0
  584. data/rdoc-sources/FXXPMImage.rb +0 -0
  585. data/rdoc-sources/Makefile +23 -0
  586. data/rdoc-sources/README.rdoc +0 -0
  587. data/rdoc-sources/fxdefs.rb +0 -0
  588. data/scripts/build-fox.rb +31 -0
  589. data/scripts/generate_kwargs_lib.rb +414 -0
  590. data/scripts/iface.rb +391 -0
  591. data/swig-interfaces/FX4Splitter.i +149 -0
  592. data/swig-interfaces/FX7Segment.i +141 -0
  593. data/swig-interfaces/FXAccelTable.i +100 -0
  594. data/swig-interfaces/FXApp.i +735 -0
  595. data/swig-interfaces/FXArrowButton.i +136 -0
  596. data/swig-interfaces/FXBMPIcon.i +88 -0
  597. data/swig-interfaces/FXBMPImage.i +54 -0
  598. data/swig-interfaces/FXBitmap.i +90 -0
  599. data/swig-interfaces/FXBitmapFrame.i +72 -0
  600. data/swig-interfaces/FXBitmapView.i +94 -0
  601. data/swig-interfaces/FXButton.i +130 -0
  602. data/swig-interfaces/FXCURCursor.i +49 -0
  603. data/swig-interfaces/FXCanvas.i +61 -0
  604. data/swig-interfaces/FXCheckButton.i +108 -0
  605. data/swig-interfaces/FXChoiceBox.i +91 -0
  606. data/swig-interfaces/FXColorBar.i +110 -0
  607. data/swig-interfaces/FXColorDialog.i +79 -0
  608. data/swig-interfaces/FXColorList.i +99 -0
  609. data/swig-interfaces/FXColorRing.i +148 -0
  610. data/swig-interfaces/FXColorSelector.i +157 -0
  611. data/swig-interfaces/FXColorWell.i +133 -0
  612. data/swig-interfaces/FXColorWheel.i +108 -0
  613. data/swig-interfaces/FXComboBox.i +280 -0
  614. data/swig-interfaces/FXComposeContext.i +66 -0
  615. data/swig-interfaces/FXComposite.i +103 -0
  616. data/swig-interfaces/FXCursor.i +120 -0
  617. data/swig-interfaces/FXDC.i +280 -0
  618. data/swig-interfaces/FXDCPrint.i +141 -0
  619. data/swig-interfaces/FXDCWindow.i +75 -0
  620. data/swig-interfaces/FXDataTarget.i +115 -0
  621. data/swig-interfaces/FXDebugTarget.i +60 -0
  622. data/swig-interfaces/FXDelegator.i +56 -0
  623. data/swig-interfaces/FXDial.i +168 -0
  624. data/swig-interfaces/FXDialogBox.i +131 -0
  625. data/swig-interfaces/FXDict.i +200 -0
  626. data/swig-interfaces/FXDirBox.i +68 -0
  627. data/swig-interfaces/FXDirDialog.i +97 -0
  628. data/swig-interfaces/FXDirList.i +274 -0
  629. data/swig-interfaces/FXDirSelector.i +142 -0
  630. data/swig-interfaces/FXDockBar.i +180 -0
  631. data/swig-interfaces/FXDockHandler.i +94 -0
  632. data/swig-interfaces/FXDockSite.i +91 -0
  633. data/swig-interfaces/FXDockTitle.i +91 -0
  634. data/swig-interfaces/FXDocument.i +70 -0
  635. data/swig-interfaces/FXDragCorner.i +72 -0
  636. data/swig-interfaces/FXDrawable.i +90 -0
  637. data/swig-interfaces/FXDriveBox.i +63 -0
  638. data/swig-interfaces/FXExtentd.i +131 -0
  639. data/swig-interfaces/FXExtentf.i +131 -0
  640. data/swig-interfaces/FXFileDialog.i +268 -0
  641. data/swig-interfaces/FXFileDict.i +121 -0
  642. data/swig-interfaces/FXFileList.i +345 -0
  643. data/swig-interfaces/FXFileSelector.i +347 -0
  644. data/swig-interfaces/FXFileStream.i +49 -0
  645. data/swig-interfaces/FXFoldingList.i +556 -0
  646. data/swig-interfaces/FXFont.i +333 -0
  647. data/swig-interfaces/FXFontDialog.i +63 -0
  648. data/swig-interfaces/FXFontSelector.i +127 -0
  649. data/swig-interfaces/FXFrame.i +245 -0
  650. data/swig-interfaces/FXGIFCursor.i +86 -0
  651. data/swig-interfaces/FXGIFIcon.i +54 -0
  652. data/swig-interfaces/FXGIFImage.i +54 -0
  653. data/swig-interfaces/FXGLCanvas.i +90 -0
  654. data/swig-interfaces/FXGLContext.i +85 -0
  655. data/swig-interfaces/FXGLObject.i +70 -0
  656. data/swig-interfaces/FXGLShape.i +152 -0
  657. data/swig-interfaces/FXGLViewer.i +691 -0
  658. data/swig-interfaces/FXGLVisual.i +136 -0
  659. data/swig-interfaces/FXGradientBar.i +310 -0
  660. data/swig-interfaces/FXGroupBox.i +94 -0
  661. data/swig-interfaces/FXHeader.i +432 -0
  662. data/swig-interfaces/FXHorizontalFrame.i +60 -0
  663. data/swig-interfaces/FXICOIcon.i +92 -0
  664. data/swig-interfaces/FXICOImage.i +54 -0
  665. data/swig-interfaces/FXIcon.i +128 -0
  666. data/swig-interfaces/FXIconDict.i +90 -0
  667. data/swig-interfaces/FXIconList.i +596 -0
  668. data/swig-interfaces/FXIconSource.i +55 -0
  669. data/swig-interfaces/FXId.i +103 -0
  670. data/swig-interfaces/FXImage.i +197 -0
  671. data/swig-interfaces/FXImageFrame.i +66 -0
  672. data/swig-interfaces/FXImageView.i +88 -0
  673. data/swig-interfaces/FXInputDialog.i +180 -0
  674. data/swig-interfaces/FXJPGIcon.i +101 -0
  675. data/swig-interfaces/FXJPGImage.i +67 -0
  676. data/swig-interfaces/FXKnob.i +182 -0
  677. data/swig-interfaces/FXLabel.i +199 -0
  678. data/swig-interfaces/FXList.i +476 -0
  679. data/swig-interfaces/FXListBox.i +234 -0
  680. data/swig-interfaces/FXMDIButton.i +173 -0
  681. data/swig-interfaces/FXMDIChild.i +242 -0
  682. data/swig-interfaces/FXMDIClient.i +149 -0
  683. data/swig-interfaces/FXMainWindow.i +53 -0
  684. data/swig-interfaces/FXMat3d.i +102 -0
  685. data/swig-interfaces/FXMat3f.i +102 -0
  686. data/swig-interfaces/FXMat4d.i +122 -0
  687. data/swig-interfaces/FXMat4f.i +138 -0
  688. data/swig-interfaces/FXMatrix.i +101 -0
  689. data/swig-interfaces/FXMemoryBuffer.i +64 -0
  690. data/swig-interfaces/FXMemoryStream.i +73 -0
  691. data/swig-interfaces/FXMenuBar.i +67 -0
  692. data/swig-interfaces/FXMenuButton.i +152 -0
  693. data/swig-interfaces/FXMenuCaption.i +176 -0
  694. data/swig-interfaces/FXMenuCascade.i +76 -0
  695. data/swig-interfaces/FXMenuCheck.i +90 -0
  696. data/swig-interfaces/FXMenuCommand.i +69 -0
  697. data/swig-interfaces/FXMenuPane.i +60 -0
  698. data/swig-interfaces/FXMenuRadio.i +93 -0
  699. data/swig-interfaces/FXMenuSeparator.i +65 -0
  700. data/swig-interfaces/FXMenuTitle.i +74 -0
  701. data/swig-interfaces/FXMessageBox.i +128 -0
  702. data/swig-interfaces/FXObject.i +169 -0
  703. data/swig-interfaces/FXOptionMenu.i +140 -0
  704. data/swig-interfaces/FXPCXIcon.i +91 -0
  705. data/swig-interfaces/FXPCXImage.i +55 -0
  706. data/swig-interfaces/FXPNGIcon.i +95 -0
  707. data/swig-interfaces/FXPNGImage.i +59 -0
  708. data/swig-interfaces/FXPPMIcon.i +91 -0
  709. data/swig-interfaces/FXPPMImage.i +55 -0
  710. data/swig-interfaces/FXPacker.i +255 -0
  711. data/swig-interfaces/FXPicker.i +54 -0
  712. data/swig-interfaces/FXPoint.i +52 -0
  713. data/swig-interfaces/FXPopup.i +162 -0
  714. data/swig-interfaces/FXPrintDialog.i +154 -0
  715. data/swig-interfaces/FXProgressBar.i +133 -0
  716. data/swig-interfaces/FXProgressDialog.i +105 -0
  717. data/swig-interfaces/FXQuatd.i +128 -0
  718. data/swig-interfaces/FXQuatf.i +122 -0
  719. data/swig-interfaces/FXRGBIcon.i +90 -0
  720. data/swig-interfaces/FXRGBImage.i +56 -0
  721. data/swig-interfaces/FXRadioButton.i +117 -0
  722. data/swig-interfaces/FXRanged.i +163 -0
  723. data/swig-interfaces/FXRangef.i +172 -0
  724. data/swig-interfaces/FXRealSlider.i +166 -0
  725. data/swig-interfaces/FXRealSpinner.i +215 -0
  726. data/swig-interfaces/FXRecentFiles.i +119 -0
  727. data/swig-interfaces/FXRectangle.i +104 -0
  728. data/swig-interfaces/FXRegion.i +88 -0
  729. data/swig-interfaces/FXRegistry.i +96 -0
  730. data/swig-interfaces/FXReplaceDialog.i +131 -0
  731. data/swig-interfaces/FXRootWindow.i +50 -0
  732. data/swig-interfaces/FXRuler.i +245 -0
  733. data/swig-interfaces/FXRulerView.i +233 -0
  734. data/swig-interfaces/FXScintilla.i +192 -0
  735. data/swig-interfaces/FXScrollArea.i +211 -0
  736. data/swig-interfaces/FXScrollBar.i +178 -0
  737. data/swig-interfaces/FXScrollPane.i +83 -0
  738. data/swig-interfaces/FXScrollWindow.i +67 -0
  739. data/swig-interfaces/FXSearchDialog.i +48 -0
  740. data/swig-interfaces/FXSeparator.i +138 -0
  741. data/swig-interfaces/FXSettings.i +160 -0
  742. data/swig-interfaces/FXShell.i +91 -0
  743. data/swig-interfaces/FXShutter.i +140 -0
  744. data/swig-interfaces/FXSize.i +71 -0
  745. data/swig-interfaces/FXSlider.i +181 -0
  746. data/swig-interfaces/FXSphered.i +126 -0
  747. data/swig-interfaces/FXSpheref.i +126 -0
  748. data/swig-interfaces/FXSpinner.i +212 -0
  749. data/swig-interfaces/FXSplashWindow.i +82 -0
  750. data/swig-interfaces/FXSplitter.i +123 -0
  751. data/swig-interfaces/FXSpring.i +79 -0
  752. data/swig-interfaces/FXStatusBar.i +68 -0
  753. data/swig-interfaces/FXStatusLine.i +100 -0
  754. data/swig-interfaces/FXStream.i +150 -0
  755. data/swig-interfaces/FXStringDict.i +61 -0
  756. data/swig-interfaces/FXSwitcher.i +110 -0
  757. data/swig-interfaces/FXTGAIcon.i +85 -0
  758. data/swig-interfaces/FXTGAImage.i +56 -0
  759. data/swig-interfaces/FXTIFIcon.i +73 -0
  760. data/swig-interfaces/FXTIFImage.i +93 -0
  761. data/swig-interfaces/FXTabBar.i +121 -0
  762. data/swig-interfaces/FXTabBook.i +70 -0
  763. data/swig-interfaces/FXTabItem.i +82 -0
  764. data/swig-interfaces/FXTable.i +861 -0
  765. data/swig-interfaces/FXText.i +763 -0
  766. data/swig-interfaces/FXTextField.i +290 -0
  767. data/swig-interfaces/FXToggleButton.i +136 -0
  768. data/swig-interfaces/FXToolBar.i +75 -0
  769. data/swig-interfaces/FXToolBarGrip.i +82 -0
  770. data/swig-interfaces/FXToolBarShell.i +98 -0
  771. data/swig-interfaces/FXToolBarTab.i +114 -0
  772. data/swig-interfaces/FXToolTip.i +93 -0
  773. data/swig-interfaces/FXTopWindow.i +263 -0
  774. data/swig-interfaces/FXTranslator.i +55 -0
  775. data/swig-interfaces/FXTreeList.i +549 -0
  776. data/swig-interfaces/FXTreeListBox.i +317 -0
  777. data/swig-interfaces/FXTriStateButton.i +77 -0
  778. data/swig-interfaces/FXURL.i +35 -0
  779. data/swig-interfaces/FXVec2d.i +87 -0
  780. data/swig-interfaces/FXVec2f.i +87 -0
  781. data/swig-interfaces/FXVec3d.i +111 -0
  782. data/swig-interfaces/FXVec3f.i +109 -0
  783. data/swig-interfaces/FXVec4d.i +115 -0
  784. data/swig-interfaces/FXVec4f.i +115 -0
  785. data/swig-interfaces/FXVerticalFrame.i +69 -0
  786. data/swig-interfaces/FXVisual.i +162 -0
  787. data/swig-interfaces/FXWindow.i +851 -0
  788. data/swig-interfaces/FXWizard.i +125 -0
  789. data/swig-interfaces/FXXBMIcon.i +56 -0
  790. data/swig-interfaces/FXXBMImage.i +118 -0
  791. data/swig-interfaces/FXXPMIcon.i +122 -0
  792. data/swig-interfaces/FXXPMImage.i +56 -0
  793. data/swig-interfaces/README +17 -0
  794. data/swig-interfaces/common.i +48 -0
  795. data/swig-interfaces/core.i +85 -0
  796. data/swig-interfaces/dcmodule.i +36 -0
  797. data/swig-interfaces/dialogs.i +49 -0
  798. data/swig-interfaces/exceptions.i +249 -0
  799. data/swig-interfaces/framesmodule.i +54 -0
  800. data/swig-interfaces/freefuncs.i +93 -0
  801. data/swig-interfaces/fx3d.i +60 -0
  802. data/swig-interfaces/fxdefs.i +419 -0
  803. data/swig-interfaces/handlers.i +615 -0
  804. data/swig-interfaces/iconlistmodule.i +37 -0
  805. data/swig-interfaces/icons.i +48 -0
  806. data/swig-interfaces/ignore-message-handlers.rb +16 -0
  807. data/swig-interfaces/image.i +49 -0
  808. data/swig-interfaces/labelmodule.i +47 -0
  809. data/swig-interfaces/layout.i +47 -0
  810. data/swig-interfaces/listmodule.i +37 -0
  811. data/swig-interfaces/macros.i +1326 -0
  812. data/swig-interfaces/markfuncs.i +210 -0
  813. data/swig-interfaces/mdi.i +38 -0
  814. data/swig-interfaces/menumodule.i +44 -0
  815. data/swig-interfaces/ruby-typemaps.i +772 -0
  816. data/swig-interfaces/scintilla.i +57 -0
  817. data/swig-interfaces/table-module.i +36 -0
  818. data/swig-interfaces/text-module.i +36 -0
  819. data/swig-interfaces/treelist-module.i +37 -0
  820. data/swig-interfaces/ui.i +63 -0
  821. data/{tests → test}/README +0 -0
  822. data/{tests → test}/TC_FXAccelTable.rb +0 -0
  823. data/{tests → test}/TC_FXApp.rb +0 -0
  824. data/{tests → test}/TC_FXArc.rb +0 -0
  825. data/{tests → test}/TC_FXBMPIcon.rb +0 -0
  826. data/{tests → test}/TC_FXBMPImage.rb +0 -0
  827. data/{tests → test}/TC_FXButton.rb +0 -0
  828. data/{tests → test}/TC_FXCheckButton.rb +0 -0
  829. data/{tests → test}/TC_FXComboBox.rb +0 -0
  830. data/{tests → test}/TC_FXDC.rb +0 -0
  831. data/{tests → test}/TC_FXDCPrint.rb +0 -0
  832. data/{tests → test}/TC_FXDCWindow.rb +0 -0
  833. data/{tests → test}/TC_FXDataTarget.rb +0 -0
  834. data/{tests → test}/TC_FXDialogBox.rb +0 -0
  835. data/{tests → test}/TC_FXDirList.rb +0 -0
  836. data/{tests → test}/TC_FXExtentd.rb +0 -0
  837. data/{tests → test}/TC_FXExtentf.rb +0 -0
  838. data/{tests → test}/TC_FXFileAssoc.rb +0 -0
  839. data/{tests → test}/TC_FXFileStream.rb +0 -0
  840. data/{tests → test}/TC_FXFoldingList.rb +0 -0
  841. data/{tests → test}/TC_FXFont.rb +0 -0
  842. data/{tests → test}/TC_FXFontDesc.rb +0 -0
  843. data/{tests → test}/TC_FXGLGroup.rb +0 -0
  844. data/{tests → test}/TC_FXGLShape.rb +0 -0
  845. data/{tests → test}/TC_FXGLViewer.rb +0 -0
  846. data/{tests → test}/TC_FXGradientBar.rb +0 -0
  847. data/{tests → test}/TC_FXHeader.rb +0 -0
  848. data/{tests → test}/TC_FXHiliteStyle.rb +0 -0
  849. data/{tests → test}/TC_FXIconDict.rb +0 -0
  850. data/{tests → test}/TC_FXIconList.rb +0 -0
  851. data/{tests → test}/TC_FXId.rb +0 -0
  852. data/{tests → test}/TC_FXImage.rb +0 -0
  853. data/{tests → test}/TC_FXLight.rb +0 -0
  854. data/{tests → test}/TC_FXList.rb +0 -0
  855. data/{tests → test}/TC_FXListBox.rb +0 -0
  856. data/{tests → test}/TC_FXMainWindow.rb +0 -0
  857. data/{tests → test}/TC_FXMat4f.rb +0 -0
  858. data/{tests → test}/TC_FXMaterial.rb +0 -0
  859. data/{tests → test}/TC_FXMemoryStream.rb +0 -0
  860. data/{tests → test}/TC_FXMenuCheck.rb +0 -0
  861. data/{tests → test}/TC_FXMenuCommand.rb +0 -0
  862. data/{tests → test}/TC_FXMenuRadio.rb +0 -0
  863. data/{tests → test}/TC_FXMessageBox.rb +0 -0
  864. data/{tests → test}/TC_FXPoint.rb +0 -0
  865. data/{tests → test}/TC_FXQuatf.rb +0 -0
  866. data/{tests → test}/TC_FXRadioButton.rb +0 -0
  867. data/{tests → test}/TC_FXRanged.rb +0 -0
  868. data/{tests → test}/TC_FXRangef.rb +0 -0
  869. data/{tests → test}/TC_FXRectangle.rb +0 -0
  870. data/{tests → test}/TC_FXRegion.rb +0 -0
  871. data/{tests → test}/TC_FXRegistry.rb +0 -0
  872. data/{tests → test}/TC_FXScrollArea.rb +0 -0
  873. data/{tests → test}/TC_FXScrollWindow.rb +0 -0
  874. data/{tests → test}/TC_FXSegment.rb +0 -0
  875. data/{tests → test}/TC_FXSettings.rb +0 -0
  876. data/{tests → test}/TC_FXShell.rb +0 -0
  877. data/{tests → test}/TC_FXSize.rb +0 -0
  878. data/{tests → test}/TC_FXStream.rb +0 -0
  879. data/{tests → test}/TC_FXTable.rb +0 -0
  880. data/{tests → test}/TC_FXTableItem.rb +0 -0
  881. data/{tests → test}/TC_FXText.rb +0 -0
  882. data/{tests → test}/TC_FXTopWindow.rb +0 -0
  883. data/{tests → test}/TC_FXTreeList.rb +0 -0
  884. data/{tests → test}/TC_FXTreeListBox.rb +0 -0
  885. data/{tests → test}/TC_FXUndoList.rb +0 -0
  886. data/{tests → test}/TC_FXVec2d.rb +0 -0
  887. data/{tests → test}/TC_FXVec2f.rb +0 -0
  888. data/{tests → test}/TC_FXVec3d.rb +0 -0
  889. data/{tests → test}/TC_FXVec3f.rb +0 -0
  890. data/{tests → test}/TC_FXVec4f.rb +0 -0
  891. data/{tests → test}/TC_FXViewport.rb +0 -0
  892. data/{tests → test}/TC_FXXBMIcon.rb +0 -0
  893. data/{tests → test}/TC_FXXBMImage.rb +0 -0
  894. data/{tests → test}/TC_FXXPMIcon.rb +0 -0
  895. data/{tests → test}/TC_FXXPMImage.rb +0 -0
  896. data/{tests → test}/TC_Misc.rb +0 -0
  897. data/{tests → test}/TC_downcast.rb +0 -0
  898. data/{tests → test}/TS_All.rb +0 -0
  899. data/{tests → test}/blankpage.ps +0 -0
  900. data/{tests → test}/howdypage.ps +0 -0
  901. data/{tests → test}/stress1.rb +0 -0
  902. data/{tests → test}/stress2.rb +0 -0
  903. data/{tests → test}/stress3.rb +0 -0
  904. data/{tests → test}/testcase.rb +0 -0
  905. metadata +724 -208
  906. data/doc/apes02.html +0 -21
  907. data/doc/apes03.html +0 -39
  908. data/doc/book.html +0 -3
  909. data/doc/build.html +0 -132
  910. data/doc/ch03s02.html +0 -23
  911. data/doc/ch03s03.html +0 -52
  912. data/doc/ch03s04.html +0 -36
  913. data/doc/ch03s05.html +0 -60
  914. data/doc/ch04s02.html +0 -71
  915. data/doc/ch04s03.html +0 -37
  916. data/doc/ch04s04.html +0 -72
  917. data/doc/ch05s02.html +0 -260
  918. data/doc/ch05s03.html +0 -127
  919. data/doc/changes.html +0 -777
  920. data/doc/clipboardtut.html +0 -67
  921. data/doc/differences.html +0 -190
  922. data/doc/dragdroptut.html +0 -263
  923. data/doc/events.html +0 -36
  924. data/doc/examples.html +0 -104
  925. data/doc/gems.html +0 -73
  926. data/doc/goals.html +0 -41
  927. data/doc/images/babelfish.png +0 -0
  928. data/doc/images/browser.png +0 -0
  929. data/doc/images/button.png +0 -0
  930. data/doc/images/call-chain-example.png +0 -0
  931. data/doc/images/colordialog.png +0 -0
  932. data/doc/images/datatarget.png +0 -0
  933. data/doc/images/dialog.png +0 -0
  934. data/doc/images/dilbert.png +0 -0
  935. data/doc/images/dirlist.png +0 -0
  936. data/doc/images/dropsite-droprejected.png +0 -0
  937. data/doc/images/foursplit.png +0 -0
  938. data/doc/images/gltest.png +0 -0
  939. data/doc/images/glviewer.png +0 -0
  940. data/doc/images/groupbox.png +0 -0
  941. data/doc/images/header.png +0 -0
  942. data/doc/images/hello-with-button.png +0 -0
  943. data/doc/images/hello-with-icon-1.png +0 -0
  944. data/doc/images/hello-with-icon-2.png +0 -0
  945. data/doc/images/hello-with-icon-3.png +0 -0
  946. data/doc/images/hello-with-tooltip.png +0 -0
  947. data/doc/images/hello-without-button.png +0 -0
  948. data/doc/images/hello.png +0 -0
  949. data/doc/images/hello2.png +0 -0
  950. data/doc/images/iconlist-bigicons.png +0 -0
  951. data/doc/images/iconlist-details.png +0 -0
  952. data/doc/images/image.png +0 -0
  953. data/doc/images/imageviewer.png +0 -0
  954. data/doc/images/inheritance.png +0 -0
  955. data/doc/images/mditest.png +0 -0
  956. data/doc/images/raabrowser.png +0 -0
  957. data/doc/images/scribble.png +0 -0
  958. data/doc/images/shutter.png +0 -0
  959. data/doc/images/splitter.png +0 -0
  960. data/doc/images/tabbook.png +0 -0
  961. data/doc/images/table.png +0 -0
  962. data/doc/images/tutorial1.png +0 -0
  963. data/doc/implementation.html +0 -16
  964. data/doc/infosources.html +0 -33
  965. data/doc/library.html +0 -30
  966. data/doc/opengl.html +0 -73
  967. data/doc/pt01.html +0 -3
  968. data/doc/pt02.html +0 -3
  969. data/doc/scintilla.html +0 -36
  970. data/doc/style.css +0 -247
  971. data/doc/subversion.html +0 -21
  972. data/doc/tutorial1.html +0 -90
  973. data/doc/unicode.html +0 -56
@@ -0,0 +1,2067 @@
1
+ /***********************************************************************
2
+ * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
3
+ * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ *
19
+ * For further information please contact the author by e-mail
20
+ * at "lyle@lylejohnson.name".
21
+ ***********************************************************************/
22
+
23
+ /***********************************************************************
24
+ * $Id: FXRuby.cpp 2933 2008-12-29 20:19:33Z lyle $
25
+ ***********************************************************************/
26
+
27
+ #ifdef _MSC_VER
28
+ #pragma warning (disable : 4786)
29
+ #endif
30
+
31
+ #include "FXRbCommon.h"
32
+
33
+ #ifndef RUBY_1_9
34
+ #include "version.h"
35
+
36
+ #if RUBY_VERSION_CODE < 167
37
+ #define RB_RESCUE2_BROKEN_PROTOTYPE 1
38
+ #endif
39
+
40
+ // The prototype for st_foreach() changed at Ruby version 1.8.2
41
+ #if RUBY_VERSION_CODE < 182
42
+ #define ST_BROKEN_PROTOTYPES 1
43
+ #endif
44
+ #endif /* RUBY_1_9 */
45
+
46
+ #include "impl.h"
47
+
48
+ #ifdef __CYGWIN__
49
+ #include <io.h> // for get_osf_handle()
50
+ #endif
51
+
52
+ #ifdef HAVE_SIGNAL_H
53
+ #include <signal.h> // for definitions of SIGINT, etc.
54
+ #endif
55
+
56
+ #ifndef RUBY_1_9
57
+ extern "C" {
58
+ #include "rubyio.h" // for GetOpenFile(), etc.
59
+ }
60
+ #else
61
+ #include "ruby/io.h"
62
+ #endif
63
+
64
+ // Symbol table functions from Ruby. If we included "st.h" directly
65
+ // we'd be dealing with broken prototypes anyways, so just duplicate
66
+ // the needed declarations here with the correct prototypes.
67
+
68
+ #if defined(ST_BROKEN_PROTOTYPES)
69
+
70
+ extern "C" {
71
+
72
+ struct st_table;
73
+
74
+ typedef char * st_data_t; /* this type changed to unsigned long at Ruby 1.8.2 */
75
+
76
+ st_table *st_init_strtable();
77
+ st_table *st_init_numtable();
78
+ int st_lookup(st_table *table, st_data_t key, st_data_t *value);
79
+ int st_insert(st_table *table, st_data_t key, st_data_t value);
80
+ int st_delete(st_table *table, st_data_t *key, st_data_t *value);
81
+ void st_foreach(st_table *table, int (*func)(st_data_t, st_data_t, st_data_t), st_data_t arg);
82
+
83
+ }
84
+
85
+ #else
86
+
87
+ #ifdef RUBY_1_9
88
+
89
+ #include "ruby/st.h"
90
+
91
+ #else
92
+
93
+ extern "C" {
94
+ #include "st.h"
95
+ }
96
+
97
+ #endif /* RUBY_1_9 */
98
+
99
+ #endif /* ST_BROKEN_PROTOTYPES */
100
+
101
+ // Opaque type declaration from SWIG runtime
102
+ struct swig_type_info;
103
+
104
+ // Wrapper around SWIG_TypeQuery() that caches results for performance
105
+ swig_type_info *FXRbTypeQuery(const char *desc){
106
+ FXASSERT(desc!=0);
107
+ static st_table *types=st_init_strtable();
108
+ swig_type_info *typeinfo=0;
109
+ if(st_lookup(types,reinterpret_cast<st_data_t>(const_cast<char*>(desc)),reinterpret_cast<st_data_t *>(&typeinfo))==0){
110
+ typeinfo=SWIG_Ruby_TypeQuery(desc);
111
+ st_insert(types,reinterpret_cast<st_data_t>(strdup(desc)),reinterpret_cast<st_data_t>(typeinfo));
112
+ }
113
+ FXASSERT(typeinfo!=0);
114
+ return typeinfo;
115
+ }
116
+
117
+
118
+ /**
119
+ * The FXRuby_Objects hash table basically maps C++ objects to Ruby instances.
120
+ * Each key in the table is a pointer to a C++ object we've seen before, and
121
+ * the corresponding value is an FXRubyObjDesc struct (see below) that tells
122
+ * us which Ruby instance corresponds to that C++ object.
123
+ */
124
+
125
+ static st_table * FXRuby_Objects;
126
+
127
+ /**
128
+ * Each value in the FXRuby_Objects hash table is an instance of this
129
+ * struct. It identifies the Ruby instance associated with a C++ object.
130
+ * It also indicates whether this is merely a "borrowed" reference to
131
+ * some C++ object (i.e. it's not one we need to destroy later).
132
+ */
133
+
134
+ struct FXRubyObjDesc {
135
+ VALUE obj;
136
+ bool borrowed;
137
+ };
138
+
139
+
140
+ /**
141
+ * FXRbNewPointerObj() is a wrapper around SWIG_Ruby_NewPointerObj() that also
142
+ * registers this C++ object & Ruby instance pair in our FXRuby_Objects
143
+ * hash table. This function should only get called for methods that return
144
+ * a reference to an already-existing C++ object (i.e. one that FOX "owns")
145
+ * and for that reason we mark these objects as "borrowed".
146
+ */
147
+
148
+ VALUE FXRbNewPointerObj(void *ptr,swig_type_info* ty){
149
+ if(ptr!=0){
150
+ FXASSERT(ty!=0);
151
+ VALUE obj;
152
+ FXRubyObjDesc *desc;
153
+ if(FXMALLOC(&desc,FXRubyObjDesc,1)){
154
+ obj=SWIG_Ruby_NewPointerObj(ptr,ty,1);
155
+ desc->obj=obj;
156
+ desc->borrowed=true;
157
+ st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t>(desc));
158
+ return obj;
159
+ }
160
+ else{
161
+ FXASSERT(FALSE);
162
+ return Qnil;
163
+ }
164
+ }
165
+ else{
166
+ return Qnil;
167
+ }
168
+ }
169
+
170
+
171
+ /**
172
+ * FXRbIsBorrowed() returns true if the specified C++ object is one that
173
+ * FOX owns (i.e. it's borrowed).
174
+ */
175
+
176
+ bool FXRbIsBorrowed(void* ptr){
177
+ FXASSERT(ptr!=0);
178
+ FXRubyObjDesc *desc;
179
+ if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
180
+ return desc->borrowed;
181
+ }
182
+ else{
183
+ return true;
184
+ }
185
+ }
186
+
187
+
188
+ /**
189
+ * FXRbConvertPtr() is just a wrapper around SWIG_Ruby_ConvertPtr().
190
+ */
191
+
192
+ void* FXRbConvertPtr(VALUE obj,swig_type_info* ty){
193
+ void *ptr;
194
+ SWIG_Ruby_ConvertPtr(obj,&ptr,ty,1);
195
+ return ptr;
196
+ }
197
+
198
+
199
+ // Should we catch exceptions thrown by message handlers?
200
+ FXbool FXRbCatchExceptions=FALSE;
201
+
202
+ // Returns an FXInputHandle for this Ruby file object
203
+ FXInputHandle FXRbGetReadFileHandle(VALUE obj) {
204
+ #ifdef RUBY_1_9
205
+ rb_io_t *fptr;
206
+ GetOpenFile(obj, fptr);
207
+ FILE *fpr=fptr->stdio_file;
208
+ #else
209
+ OpenFile *fptr;
210
+ GetOpenFile(obj, fptr);
211
+ FILE *fpr=GetReadFile(fptr);
212
+ #endif /* RUBY_1_9 */
213
+ #ifdef WIN32
214
+ #ifdef __CYGWIN__
215
+ return (FXInputHandle) get_osfhandle(fileno(fpr));
216
+ #else
217
+ return (FXInputHandle) _get_osfhandle(_fileno(fpr));
218
+ #endif
219
+ #else
220
+ return (FXInputHandle) fileno(fpr);
221
+ #endif
222
+ }
223
+
224
+
225
+ // Returns an FXInputHandle for this Ruby file object
226
+ FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
227
+ #ifdef RUBY_1_9
228
+ rb_io_t *fptr;
229
+ GetOpenFile(obj, fptr);
230
+ FILE *fpw=fptr->stdio_file;
231
+ #else
232
+ OpenFile *fptr;
233
+ GetOpenFile(obj, fptr);
234
+ FILE *fpw=GetWriteFile(fptr);
235
+ #endif /* RUBY_1_9 */
236
+ #ifdef WIN32
237
+ #ifdef __CYGWIN__
238
+ return (FXInputHandle) get_osfhandle(fileno(fpw));
239
+ #else
240
+ return (FXInputHandle) _get_osfhandle(_fileno(fpw));
241
+ #endif
242
+ #else
243
+ return (FXInputHandle) fileno(fpw);
244
+ #endif
245
+ }
246
+
247
+
248
+ // Register this Ruby class instance
249
+ void FXRbRegisterRubyObj(VALUE rubyObj,const void* foxObj) {
250
+ FXASSERT(!NIL_P(rubyObj));
251
+ FXASSERT(foxObj!=0);
252
+ FXRubyObjDesc* desc;
253
+ FXTRACE((1,"FXRbRegisterRubyObj(rubyObj=%d,foxObj=%p)\n",static_cast<int>(rubyObj),foxObj));
254
+ if(FXMALLOC(&desc,FXRubyObjDesc,1)){
255
+ desc->obj=rubyObj;
256
+ desc->borrowed=false;
257
+ st_insert(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t>(desc));
258
+ }
259
+ else{
260
+ FXASSERT(FALSE);
261
+ }
262
+ FXASSERT(FXRbGetRubyObj(foxObj,false)==rubyObj);
263
+ }
264
+
265
+
266
+ /**
267
+ * Remove this mapping between a Ruby instance and a C++ object
268
+ */
269
+ void FXRbUnregisterRubyObj(const void* foxObj){
270
+ if(foxObj!=0){
271
+ FXRubyObjDesc* desc;
272
+ if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
273
+ DATA_PTR(desc->obj)=0;
274
+ FXFREE(&desc);
275
+ st_delete(FXRuby_Objects,reinterpret_cast<st_data_t *>(const_cast<void**>(&foxObj)),reinterpret_cast<st_data_t *>(0));
276
+ FXASSERT(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(0))==0);
277
+ }
278
+ }
279
+ }
280
+
281
+
282
+ VALUE to_ruby(const FXObject* obj){
283
+ if(obj!=0){
284
+ FXString className=obj->getClassName();
285
+ if(className.length()>3){
286
+ if(className.left(4)=="FXRb"){ className.replace(0,4,"FX"); }
287
+ }
288
+ FXString desc=className+" *";
289
+ return FXRbGetRubyObj(obj,desc.text());
290
+ }
291
+ return Qnil;
292
+ }
293
+
294
+
295
+ /**
296
+ * Return the registered Ruby class instance associated with this
297
+ * FOX object, or Qnil if not found.
298
+ */
299
+ VALUE FXRbGetRubyObj(const void *foxObj,bool searchBoth){
300
+ FXRubyObjDesc* desc;
301
+ if(foxObj!=0 && st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
302
+ FXASSERT(desc!=0);
303
+ if(searchBoth){
304
+ return desc->obj;
305
+ }
306
+ else{
307
+ return desc->borrowed ? Qnil : desc->obj;
308
+ }
309
+ }
310
+ else{
311
+ return Qnil;
312
+ }
313
+ }
314
+
315
+ /**
316
+ * Return the registered Ruby class instance associated with this
317
+ * FOX object, or a new registered instance if not found.
318
+ */
319
+ VALUE FXRbGetRubyObj(const void *foxObj,swig_type_info* ty){
320
+ if(foxObj!=0){
321
+ VALUE rbObj=FXRbGetRubyObj(foxObj,true);
322
+ return NIL_P(rbObj) ? FXRbNewPointerObj(const_cast<void*>(foxObj),ty) : rbObj;
323
+ }
324
+ else{
325
+ return Qnil;
326
+ }
327
+ }
328
+
329
+ VALUE FXRbGetRubyObj(const void *foxObj,const char *type){
330
+ if(foxObj!=0){
331
+ FXASSERT(type!=0);
332
+ VALUE rbObj=FXRbGetRubyObj(foxObj,true);
333
+ return NIL_P(rbObj) ? FXRbNewPointerObj(const_cast<void*>(foxObj),FXRbTypeQuery(type)) : rbObj;
334
+ }
335
+ else{
336
+ return Qnil;
337
+ }
338
+ }
339
+
340
+ /**
341
+ * Look up the Ruby instance associated with this C++ object, if any, and mark
342
+ * that instance as in use.
343
+ *
344
+ * We previously only marked those Ruby instances that were "non-borrowed"
345
+ * references to C++ objects, as a way to reduce the number of Ruby instances
346
+ * on the heap.
347
+ */
348
+ void FXRbGcMark(void *obj){
349
+ if(obj){
350
+ /**
351
+ * If the 2nd argument to FXRbGetRubyObj() is false, we only mark
352
+ * non-borrowed references. This has led to problems in the past
353
+ * (see e.g. SourceForge Bug #703721). I think the correct solution
354
+ * is to mark any Ruby reference this object, "borrowed" or not;
355
+ * so the 2nd argument to FXRbGetRubyObj() is now true.
356
+ *
357
+ * If you feel compelled to change this back to FXGetRubyObj(obj,false),
358
+ * please think about it first. Especially make sure that the shutter.rb
359
+ * example program works if you invoke the GC in ShutterWindow#create;
360
+ * make sure that the shutter items' contents don't get blown away!
361
+ */
362
+ VALUE value=FXRbGetRubyObj(obj,true);
363
+ if(!NIL_P(value)){
364
+ rb_gc_mark(value);
365
+ }
366
+ }
367
+ }
368
+
369
+ //----------------------------------------------------------------------
370
+
371
+ // Returns a Ruby array of floats
372
+ VALUE FXRbMakeArray(const FXfloat* values,FXint size){
373
+ VALUE result=rb_ary_new();
374
+ for(FXint i=0; i<size; i++)
375
+ rb_ary_push(result,rb_float_new(values[i]));
376
+ return result;
377
+ }
378
+
379
+ // Returns a Ruby array of floats
380
+ VALUE FXRbMakeArray(const FXdouble* values,FXint size){
381
+ VALUE result=rb_ary_new();
382
+ for(FXint i=0; i<size; i++)
383
+ rb_ary_push(result,rb_float_new(values[i]));
384
+ return result;
385
+ }
386
+
387
+ // Returns a Ruby array of integers
388
+ VALUE FXRbMakeArray(const FXint* values,FXint size){
389
+ VALUE result=rb_ary_new();
390
+ for(FXint i=0; i<size; i++)
391
+ rb_ary_push(result,INT2NUM(values[i]));
392
+ return result;
393
+ }
394
+
395
+ // Returns a Ruby array of integers
396
+ VALUE FXRbMakeArray(const FXuint* values,FXint size){
397
+ VALUE result=rb_ary_new();
398
+ for(FXint i=0; i<size; i++)
399
+ rb_ary_push(result,UINT2NUM(values[i]));
400
+ return result;
401
+ }
402
+
403
+ // Returns a Ruby array of integers
404
+ VALUE FXRbMakeArray(const FXchar* dashpattern,FXuint dashlength){
405
+ VALUE result=rb_ary_new();
406
+ for(FXuint i=0; i<dashlength; i++)
407
+ rb_ary_push(result,INT2NUM(dashpattern[i]));
408
+ return result;
409
+ }
410
+
411
+ // Returns a Ruby array of FXArcs
412
+ VALUE FXRbMakeArray(const FXArc* arcs,FXuint narcs){
413
+ VALUE result=rb_ary_new();
414
+ for(FXuint i=0; i<narcs; i++)
415
+ rb_ary_push(result,FXRbGetRubyObj(&arcs[i],"FXArc *"));
416
+ return result;
417
+ }
418
+
419
+ // Returns a Ruby array of FXPoints
420
+ VALUE FXRbMakeArray(const FXPoint* points,FXuint npoints){
421
+ VALUE result=rb_ary_new();
422
+ for(FXuint i=0; i<npoints; i++)
423
+ rb_ary_push(result,FXRbGetRubyObj(&points[i],"FXPoint *"));
424
+ return result;
425
+ }
426
+
427
+ // Returns a Ruby array of FXRectangles
428
+ VALUE FXRbMakeArray(const FXRectangle* rectangles,FXuint nrectangles){
429
+ VALUE result=rb_ary_new();
430
+ for(FXuint i=0; i<nrectangles; i++)
431
+ rb_ary_push(result,FXRbGetRubyObj(&rectangles[i],"FXRectangle *"));
432
+ return result;
433
+ }
434
+
435
+ // Returns a Ruby array of FXSegments
436
+ VALUE FXRbMakeArray(const FXSegment* segments,FXuint nsegments){
437
+ VALUE result=rb_ary_new();
438
+ for(FXuint i=0; i<nsegments; i++)
439
+ rb_ary_push(result,FXRbGetRubyObj(&segments[i],"FXSegment *"));
440
+ return result;
441
+ }
442
+
443
+ // Returns a Ruby array of FXColor values
444
+ VALUE FXRbMakeColorArray(const FXColor* colors,FXint w,FXint h){
445
+ VALUE result=rb_ary_new();
446
+ FXint size=w*h;
447
+ for(FXuint i=0; i<size; i++)
448
+ rb_ary_push(result,to_ruby(colors[i]));
449
+ return result;
450
+ }
451
+
452
+ //----------------------------------------------------------------------
453
+
454
+ /**
455
+ * Based on the sender object's class and the selector, convert the message
456
+ * data stored in the void pointer (ptr) to a suitable Ruby object.
457
+ *
458
+ * This function is used when we need to pass message data into a Ruby
459
+ * code block (or method) that is acting as a FOX message handler.
460
+ */
461
+ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector sel,void* ptr){
462
+ FXTRACE((1,"FXRbConvertMessageData(%s(%p),FXSEL(%s,%d),%p)\n",sender->getClassName(),sender,FXDebugTarget::messageTypeName[FXSELTYPE(sel)],FXSELID(sel),ptr));
463
+ FXInputHandle fff;
464
+ FXushort type=FXSELTYPE(sel);
465
+ FXushort id=FXSELID(sel);
466
+
467
+ FXASSERT(type!=SEL_NONE);
468
+ FXASSERT(type!=SEL_LAST);
469
+
470
+ if(type==SEL_KEYPRESS ||
471
+ type==SEL_KEYRELEASE ||
472
+ type==SEL_LEFTBUTTONPRESS ||
473
+ type==SEL_LEFTBUTTONRELEASE ||
474
+ type==SEL_MIDDLEBUTTONPRESS ||
475
+ type==SEL_MIDDLEBUTTONRELEASE ||
476
+ type==SEL_RIGHTBUTTONPRESS ||
477
+ type==SEL_RIGHTBUTTONRELEASE ||
478
+ type==SEL_MOTION ||
479
+ type==SEL_ENTER ||
480
+ type==SEL_LEAVE ||
481
+ type==SEL_FOCUSIN ||
482
+ type==SEL_FOCUSOUT ||
483
+ type==SEL_KEYMAP ||
484
+ type==SEL_UNGRABBED ||
485
+ type==SEL_PAINT ||
486
+ type==SEL_CREATE ||
487
+ type==SEL_DESTROY ||
488
+ type==SEL_UNMAP ||
489
+ type==SEL_MAP ||
490
+ type==SEL_CONFIGURE ||
491
+ type==SEL_SELECTION_LOST ||
492
+ type==SEL_SELECTION_GAINED ||
493
+ type==SEL_SELECTION_REQUEST ||
494
+ type==SEL_RAISED ||
495
+ type==SEL_LOWERED ||
496
+ type==SEL_MOUSEWHEEL ||
497
+ type==SEL_BEGINDRAG ||
498
+ type==SEL_ENDDRAG ||
499
+ type==SEL_TIMEOUT ||
500
+ type==SEL_CLIPBOARD_LOST ||
501
+ type==SEL_CLIPBOARD_GAINED ||
502
+ type==SEL_CLIPBOARD_REQUEST ||
503
+ type==SEL_CHORE ||
504
+ type==SEL_FOCUS_SELF ||
505
+ type==SEL_FOCUS_RIGHT ||
506
+ type==SEL_FOCUS_LEFT ||
507
+ type==SEL_FOCUS_DOWN ||
508
+ type==SEL_FOCUS_UP ||
509
+ type==SEL_FOCUS_NEXT ||
510
+ type==SEL_FOCUS_PREV ||
511
+ type==SEL_DND_ENTER ||
512
+ type==SEL_DND_LEAVE ||
513
+ type==SEL_DND_DROP ||
514
+ type==SEL_DND_MOTION ||
515
+ type==SEL_DND_REQUEST ||
516
+ type==SEL_PICKED ||
517
+ type==SEL_SESSION_NOTIFY ||
518
+ type==SEL_SESSION_CLOSED) {
519
+ return to_ruby(reinterpret_cast<FXEvent*>(ptr));
520
+ }
521
+ else if(type==SEL_DRAGGED && !sender->isMemberOf(FXMETACLASS(FXGLViewer))){
522
+ return to_ruby(reinterpret_cast<FXEvent*>(ptr));
523
+ }
524
+ else if(type==SEL_SIGNAL){
525
+ return to_ruby(static_cast<int>(reinterpret_cast<long>(ptr)));
526
+ }
527
+ else if(type==SEL_IO_READ ||
528
+ type==SEL_IO_WRITE ||
529
+ type==SEL_IO_EXCEPT){
530
+ #ifdef WIN32
531
+ fff=reinterpret_cast<FXInputHandle>(ptr);
532
+ #else
533
+ fff=static_cast<FXInputHandle>(reinterpret_cast<long>(ptr));
534
+ #endif
535
+ return Qnil;
536
+ }
537
+ else if(type==SEL_CLOSE ||
538
+ type==SEL_DELETE ||
539
+ type==SEL_MINIMIZE ||
540
+ type==SEL_RESTORE ||
541
+ type==SEL_MAXIMIZE ||
542
+ type==SEL_UPDATE ||
543
+ type==SEL_QUERY_HELP ||
544
+ type==SEL_QUERY_TIP){
545
+ FXASSERT(ptr==0);
546
+ return Qnil;
547
+ }
548
+ else if(sender->isMemberOf(FXMETACLASS(FX4Splitter))){
549
+ if(type==SEL_CHANGED||type==SEL_COMMAND) return Qnil;
550
+ }
551
+ else if(sender->isMemberOf(FXMETACLASS(FXArrowButton))){
552
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
553
+ }
554
+ else if(sender->isMemberOf(FXMETACLASS(FXPicker))){
555
+ if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby(reinterpret_cast<FXPoint*>(ptr));
556
+ }
557
+ else if(sender->isMemberOf(FXMETACLASS(FXButton))){
558
+ if(type==SEL_CLICKED ||
559
+ type==SEL_DOUBLECLICKED ||
560
+ type==SEL_TRIPLECLICKED ||
561
+ type==SEL_COMMAND) return to_ruby(static_cast<FXuint>(reinterpret_cast<FXuval>(ptr)));
562
+ }
563
+ else if(sender->isMemberOf(FXMETACLASS(FXCheckButton))){
564
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
565
+ }
566
+ else if(sender->isMemberOf(FXMETACLASS(FXColorBar))){
567
+ if(type==SEL_CHANGED || type==SEL_COMMAND){
568
+ FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
569
+ return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
570
+ }
571
+ }
572
+ else if(sender->isMemberOf(FXMETACLASS(FXColorDialog))){
573
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
574
+ }
575
+ else if(sender->isMemberOf(FXMETACLASS(FXColorRing))){
576
+ if(type==SEL_CHANGED || type==SEL_COMMAND){
577
+ FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
578
+ return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
579
+ }
580
+ }
581
+ else if(sender->isMemberOf(FXMETACLASS(FXColorSelector))){
582
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
583
+ }
584
+ else if(sender->isMemberOf(FXMETACLASS(FXColorWell))){
585
+ if(type==SEL_CHANGED ||
586
+ type==SEL_COMMAND ||
587
+ type==SEL_CLICKED ||
588
+ type==SEL_DOUBLECLICKED ||
589
+ type==SEL_TRIPLECLICKED) {
590
+ VALUE v=to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
591
+ return v;
592
+ }
593
+ }
594
+ else if(sender->isMemberOf(FXMETACLASS(FXColorWheel))){
595
+ if(type==SEL_CHANGED || type==SEL_COMMAND){
596
+ FXfloat* hsv=reinterpret_cast<FXfloat*>(ptr);
597
+ return rb_ary_new3(3,to_ruby(hsv[0]),to_ruby(hsv[1]),to_ruby(hsv[2]));
598
+ }
599
+ }
600
+ else if(sender->isMemberOf(FXMETACLASS(FXComboBox))){
601
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
602
+ }
603
+ else if(sender->isMemberOf(FXMETACLASS(FXDataTarget))){
604
+ if(type==SEL_COMMAND || type==SEL_CHANGED){
605
+ if(recv->isMemberOf(FXMETACLASS(FXWindow))){
606
+ switch(id){
607
+ case FXWindow::ID_SETINTVALUE:
608
+ return to_ruby(*reinterpret_cast<FXint*>(ptr));
609
+ case FXWindow::ID_SETREALVALUE:
610
+ return to_ruby(*reinterpret_cast<FXdouble*>(ptr));
611
+ case FXWindow::ID_SETSTRINGVALUE:
612
+ return to_ruby(*reinterpret_cast<FXString*>(ptr));
613
+ case FXWindow::ID_GETINTVALUE:
614
+ case FXWindow::ID_GETREALVALUE:
615
+ case FXWindow::ID_GETSTRINGVALUE:
616
+ FXASSERT(FALSE);
617
+ break;
618
+ default:
619
+ FXASSERT(FALSE);
620
+ }
621
+ }
622
+ else{
623
+ // It's not a window object...
624
+ FXASSERT(sender->isMemberOf(FXMETACLASS(FXRbDataTarget)));
625
+ return dynamic_cast<FXRbDataTarget*>(sender)->getValue();
626
+ }
627
+ }
628
+ }
629
+ else if(sender->isMemberOf(FXMETACLASS(FXDial))){
630
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
631
+ }
632
+ else if(sender->isMemberOf(FXMETACLASS(FXDirBox))){
633
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
634
+ }
635
+ else if(sender->isMemberOf(FXMETACLASS(FXDockBar))){
636
+ if(type==SEL_DOCKED || type==SEL_FLOATED) return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXDockSite *"));
637
+ }
638
+ else if(sender->isMemberOf(FXMETACLASS(FXFileList))){
639
+ if (type==SEL_CHANGED ||
640
+ type==SEL_CLICKED ||
641
+ type==SEL_DOUBLECLICKED ||
642
+ type==SEL_TRIPLECLICKED ||
643
+ type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
644
+ }
645
+ else if(sender->isMemberOf(FXMETACLASS(FXFoldingList))){
646
+ if(type==SEL_COLLAPSED ||
647
+ type==SEL_EXPANDED ||
648
+ type==SEL_COMMAND ||
649
+ type==SEL_CHANGED ||
650
+ type==SEL_CLICKED ||
651
+ type==SEL_DOUBLECLICKED ||
652
+ type==SEL_TRIPLECLICKED ||
653
+ type==SEL_OPENED ||
654
+ type==SEL_CLOSED ||
655
+ type==SEL_SELECTED ||
656
+ type==SEL_DESELECTED ||
657
+ type==SEL_INSERTED ||
658
+ type==SEL_DELETED){
659
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXFoldingItem *"));
660
+ }
661
+ }
662
+ else if(sender->isMemberOf(FXMETACLASS(FXGLViewer))){
663
+ if(type==SEL_CHANGED ||
664
+ type==SEL_CLICKED ||
665
+ type==SEL_DOUBLECLICKED ||
666
+ type==SEL_TRIPLECLICKED ||
667
+ type==SEL_DRAGGED){
668
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *"));
669
+ }
670
+ else if(type==SEL_COMMAND){
671
+ if(id==FXWindow::ID_QUERY_MENU)
672
+ return to_ruby(reinterpret_cast<FXEvent*>(ptr));
673
+ else
674
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXGLObject *"));
675
+ }
676
+ else if(type==SEL_LASSOED ||
677
+ type==SEL_INSERTED ||
678
+ type==SEL_DELETED ||
679
+ type==SEL_SELECTED ||
680
+ type==SEL_DESELECTED){
681
+ VALUE ary=rb_ary_new();
682
+ // FXGLObject** objlist=reinterpret_cast<FXGLObject**>(ptr);
683
+ // FIXME: objlist is a NULL-terminated array of pointers to FXGLObject
684
+ return ary;
685
+ }
686
+ }
687
+ else if(sender->isMemberOf(FXMETACLASS(FXGradientBar))){
688
+ if(type==SEL_CHANGED){
689
+ return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
690
+ }
691
+ else if(type==SEL_SELECTED || type==SEL_DESELECTED){
692
+ return Qnil;
693
+ }
694
+ }
695
+ else if(sender->isMemberOf(FXMETACLASS(FXHeader))){
696
+ if(type==SEL_COMMAND ||
697
+ type==SEL_CHANGED ||
698
+ type==SEL_CLICKED ||
699
+ type==SEL_REPLACED ||
700
+ type==SEL_INSERTED ||
701
+ type==SEL_DELETED) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
702
+ }
703
+ else if(sender->isMemberOf(FXMETACLASS(FXIconList))){
704
+ if(type==SEL_CHANGED ||
705
+ type==SEL_CLICKED ||
706
+ type==SEL_DOUBLECLICKED ||
707
+ type==SEL_TRIPLECLICKED ||
708
+ type==SEL_COMMAND ||
709
+ type==SEL_SELECTED ||
710
+ type==SEL_DESELECTED ||
711
+ type==SEL_REPLACED ||
712
+ type==SEL_INSERTED ||
713
+ type==SEL_DELETED) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
714
+ }
715
+ else if(sender->isMemberOf(FXMETACLASS(FXKnob))){
716
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
717
+ }
718
+ else if(sender->isMemberOf(FXMETACLASS(FXList))){
719
+ if(type==SEL_CHANGED ||
720
+ type==SEL_CLICKED ||
721
+ type==SEL_DOUBLECLICKED ||
722
+ type==SEL_TRIPLECLICKED ||
723
+ type==SEL_SELECTED ||
724
+ type==SEL_DESELECTED ||
725
+ type==SEL_REPLACED ||
726
+ type==SEL_INSERTED ||
727
+ type==SEL_DELETED ||
728
+ type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
729
+ }
730
+ else if(sender->isMemberOf(FXMETACLASS(FXListBox))){
731
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
732
+ else if(type==SEL_CHANGED) return Qnil;
733
+ }
734
+ else if(sender->isMemberOf(FXMETACLASS(FXMDIChild))){
735
+ if(type==SEL_MINIMIZE ||
736
+ type==SEL_MAXIMIZE ||
737
+ type==SEL_CLOSE ||
738
+ type==SEL_RESTORE){
739
+ return Qnil;
740
+ }
741
+ else if(type==SEL_SELECTED ||
742
+ type==SEL_DESELECTED){
743
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXMDIChild *"));
744
+ }
745
+ }
746
+ else if(sender->isMemberOf(FXMETACLASS(FXMDIClient))){
747
+ if(type==SEL_CHANGED) return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXMDIChild *"));
748
+ }
749
+ else if(sender->isMemberOf(FXMETACLASS(FXMenuCheck))){
750
+ if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXuval>(ptr));
751
+ }
752
+ else if(sender->isMemberOf(FXMETACLASS(FXMenuRadio))){
753
+ if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXuval>(ptr));
754
+ }
755
+ else if(sender->isMemberOf(FXMETACLASS(FXMenuCommand))){
756
+ if(type==SEL_COMMAND) return to_ruby(true);
757
+ }
758
+ else if(sender->isMemberOf(FXMETACLASS(FXOption))){
759
+ if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXEvent*>(ptr));
760
+ }
761
+ else if(sender->isMemberOf(FXMETACLASS(FXOptionMenu))){
762
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
763
+ }
764
+ else if(sender->isMemberOf(FXMETACLASS(FXRadioButton))){
765
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
766
+ }
767
+ else if(sender->isMemberOf(FXMETACLASS(FXRealSlider))){
768
+ if(type==SEL_CHANGED || type==SEL_COMMAND)
769
+ return to_ruby(*(reinterpret_cast<FXdouble *>(ptr)));
770
+ }
771
+ else if(sender->isMemberOf(FXMETACLASS(FXRealSpinner))){
772
+ if(type==SEL_COMMAND || type==SEL_CHANGED) return to_ruby(*(reinterpret_cast<FXdouble *>(ptr)));
773
+ }
774
+ else if(sender->isMemberOf(FXMETACLASS(FXRecentFiles))){
775
+ if(type==SEL_COMMAND) return to_ruby(reinterpret_cast<FXchar*>(ptr));
776
+ }
777
+ else if(sender->isMemberOf(FXMETACLASS(FXRuler))){
778
+ if(type==SEL_CHANGED) return Qnil;
779
+ }
780
+ else if(sender->isMemberOf(FXMETACLASS(FXScrollBar))){
781
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
782
+ }
783
+ else if(sender->isMemberOf(FXMETACLASS(FXShutter))){
784
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
785
+ }
786
+ else if(sender->isMemberOf(FXMETACLASS(FXSlider))){
787
+ if(type==SEL_CHANGED || type==SEL_COMMAND)
788
+ return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
789
+ }
790
+ else if(sender->isMemberOf(FXMETACLASS(FXSpinner))){
791
+ if(type==SEL_CHANGED || type==SEL_COMMAND)
792
+ return to_ruby(static_cast<FXint>(reinterpret_cast<long>(ptr)));
793
+ }
794
+ else if(sender->isMemberOf(FXMETACLASS(FXSplitter))){
795
+ if(type==SEL_CHANGED || type==SEL_COMMAND)
796
+ return to_ruby(reinterpret_cast<FXWindow *>(ptr));
797
+ }
798
+ else if(sender->isMemberOf(FXMETACLASS(FXSwitcher))){
799
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
800
+ }
801
+ else if(sender->isMemberOf(FXMETACLASS(FXTabBar))){
802
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
803
+ }
804
+ else if(sender->isMemberOf(FXMETACLASS(FXTable))){
805
+ if(type==SEL_CLICKED ||
806
+ type==SEL_DOUBLECLICKED ||
807
+ type==SEL_TRIPLECLICKED ||
808
+ type==SEL_CHANGED ||
809
+ type==SEL_COMMAND ||
810
+ type==SEL_SELECTED ||
811
+ type == SEL_DESELECTED) return to_ruby(reinterpret_cast<FXTablePos*>(ptr));
812
+ else if(type == SEL_INSERTED ||
813
+ type == SEL_DELETED ||
814
+ type == SEL_REPLACED){
815
+ return to_ruby(reinterpret_cast<FXTableRange*>(ptr));
816
+ }
817
+ }
818
+ else if(sender->isMemberOf(FXMETACLASS(FXText))){
819
+ if (type == SEL_COMMAND) {
820
+ switch(id){
821
+ case FXText::ID_COPY_SEL:
822
+ case FXText::ID_PASTE_SEL:
823
+ case FXText::ID_DELETE_SEL:
824
+ return Qnil;
825
+ break;
826
+ default:
827
+ FXASSERT(FALSE);
828
+ return reinterpret_cast<VALUE>(ptr); // pass-through as is
829
+ }
830
+ }
831
+ else if(type==SEL_CHANGED){
832
+ return to_ruby(static_cast<FXint>(reinterpret_cast<FXival>(ptr)));
833
+ }
834
+ else if(type==SEL_SELECTED ||
835
+ type == SEL_DESELECTED) {
836
+ FXint* what=reinterpret_cast<FXint*>(ptr);
837
+ FXASSERT(what!=0);
838
+ VALUE ary=rb_ary_new();
839
+ rb_ary_push(ary,to_ruby(what[0])); // start position of text
840
+ rb_ary_push(ary,to_ruby(what[1])); // length of text
841
+ return ary;
842
+ }
843
+ else if(type==SEL_INSERTED || type==SEL_DELETED || type==SEL_REPLACED) {
844
+ return to_ruby(reinterpret_cast<FXTextChange*>(ptr));
845
+ }
846
+ }
847
+ else if(sender->isMemberOf(FXMETACLASS(FXTextField))){
848
+ if(type==SEL_CHANGED ||
849
+ type==SEL_COMMAND ||
850
+ type==SEL_VERIFY) return to_ruby(reinterpret_cast<FXchar*>(ptr));
851
+ }
852
+ else if(sender->isMemberOf(FXMETACLASS(FXToggleButton))){
853
+ if(type==SEL_COMMAND) return to_ruby(static_cast<FXuchar>(reinterpret_cast<FXuval>(ptr)));
854
+ }
855
+ else if(sender->isMemberOf(FXMETACLASS(FXToolBarTab))){
856
+ if (type==SEL_COMMAND) return to_ruby(static_cast<FXbool>(reinterpret_cast<FXuval>(ptr)));
857
+ }
858
+ else if(sender->isMemberOf(FXMETACLASS(FXTopWindow))){
859
+ if(type==SEL_MINIMIZE ||
860
+ type==SEL_MAXIMIZE ||
861
+ type==SEL_RESTORE ||
862
+ type==SEL_CLOSE){
863
+ return Qnil;
864
+ }
865
+ else if (type==SEL_SESSION_NOTIFY ||
866
+ type==SEL_SESSION_CLOSED) {
867
+ return to_ruby(reinterpret_cast<FXEvent*>(ptr));
868
+ }
869
+ }
870
+ else if(sender->isMemberOf(FXMETACLASS(FXTreeList))){
871
+ if(type==SEL_COLLAPSED ||
872
+ type==SEL_EXPANDED ||
873
+ type==SEL_COMMAND ||
874
+ type==SEL_CHANGED ||
875
+ type==SEL_CLICKED ||
876
+ type==SEL_DOUBLECLICKED ||
877
+ type==SEL_TRIPLECLICKED ||
878
+ type==SEL_OPENED ||
879
+ type==SEL_CLOSED ||
880
+ type==SEL_SELECTED ||
881
+ type==SEL_DESELECTED ||
882
+ type==SEL_INSERTED ||
883
+ type==SEL_DELETED){
884
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *"));
885
+ }
886
+ }
887
+ else if(sender->isMemberOf(FXMETACLASS(FXTreeListBox))){
888
+ if(type==SEL_CHANGED || type==SEL_COMMAND)
889
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("FXTreeItem *"));
890
+ }
891
+ #ifdef WITH_FXSCINTILLA
892
+ else if(sender->isMemberOf(FXMETACLASS(FXScintilla))){
893
+ if(type==SEL_COMMAND){
894
+ return FXRbGetRubyObj(ptr,FXRbTypeQuery("SCNotification *"));
895
+ }
896
+ }
897
+ #endif
898
+ else{
899
+ FXTRACE((100,"%s:%d: message data passed through as-is\n",__FILE__,__LINE__));
900
+ return reinterpret_cast<VALUE>(ptr); // pass-through as is
901
+ }
902
+ FXTRACE((100,"%s:%d: message data passed through as-is\n",__FILE__,__LINE__));
903
+ return reinterpret_cast<VALUE>(ptr); // pass-through as is
904
+ }
905
+
906
+
907
+ /**
908
+ * When a Ruby instance (e.g. one of your widgets) calls handle() on another
909
+ * object, e.g.
910
+ *
911
+ * def onUpdAnswer(sender, sel, ptr)
912
+ * if theAnswerIsTwo?
913
+ * sender.handle(self, FXSEL(SEL_COMMAND,FXWindow::ID_SETVALUE), 2)
914
+ * else
915
+ * sender.handle(self, FXSEL(SEL_COMMAND,FXWindow::ID_SETVALUE), 3)
916
+ * end
917
+ * return 1
918
+ * end
919
+ *
920
+ * it's usually the case that this will get passed along to the underlying
921
+ * C++ object. In that case, we need to convert the message data (e.g. the
922
+ * Fixnums "2" or "3" in the example above) from Ruby objects back into
923
+ * the appropriate C++ objects. That's what this function is for.
924
+ */
925
+ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
926
+ void *ptr;
927
+ static FXint intValue;
928
+ static FXint intRange[2];
929
+ static FXdouble realValue;
930
+ static FXdouble realRange[2];
931
+ static FXString stringValue;
932
+ static FXColor colorValue;
933
+ FXushort type=FXSELTYPE(key);
934
+ FXushort id=FXSELID(key);
935
+
936
+ // Extract the FOX object (the receiver) from this Ruby instance
937
+ FXObject* obj;
938
+ Data_Get_Struct(recv,FXObject,obj);
939
+
940
+ FXASSERT(type!=SEL_NONE);
941
+ FXASSERT(type!=SEL_LAST);
942
+ switch(type){
943
+ case SEL_KEYPRESS:
944
+ case SEL_KEYRELEASE:
945
+ case SEL_LEFTBUTTONPRESS:
946
+ case SEL_LEFTBUTTONRELEASE:
947
+ case SEL_MIDDLEBUTTONPRESS:
948
+ case SEL_MIDDLEBUTTONRELEASE:
949
+ case SEL_RIGHTBUTTONPRESS:
950
+ case SEL_RIGHTBUTTONRELEASE:
951
+ case SEL_MOTION:
952
+ case SEL_ENTER:
953
+ case SEL_LEAVE:
954
+ case SEL_FOCUSIN:
955
+ case SEL_FOCUSOUT:
956
+ case SEL_KEYMAP:
957
+ case SEL_UNGRABBED:
958
+ case SEL_PAINT:
959
+ case SEL_CREATE:
960
+ case SEL_DESTROY:
961
+ case SEL_UNMAP:
962
+ case SEL_MAP:
963
+ case SEL_CONFIGURE:
964
+ case SEL_SELECTION_LOST:
965
+ case SEL_SELECTION_GAINED:
966
+ case SEL_SELECTION_REQUEST:
967
+ case SEL_RAISED:
968
+ case SEL_LOWERED:
969
+ case SEL_MOUSEWHEEL:
970
+ case SEL_BEGINDRAG:
971
+ case SEL_ENDDRAG:
972
+ case SEL_LASSOED:
973
+ case SEL_TIMEOUT:
974
+ case SEL_CLIPBOARD_LOST:
975
+ case SEL_CLIPBOARD_GAINED:
976
+ case SEL_CLIPBOARD_REQUEST:
977
+ case SEL_CHORE:
978
+ case SEL_FOCUS_SELF:
979
+ case SEL_FOCUS_RIGHT:
980
+ case SEL_FOCUS_LEFT:
981
+ case SEL_FOCUS_DOWN:
982
+ case SEL_FOCUS_UP:
983
+ case SEL_FOCUS_NEXT:
984
+ case SEL_FOCUS_PREV:
985
+ case SEL_DND_ENTER:
986
+ case SEL_DND_LEAVE:
987
+ case SEL_DND_DROP:
988
+ case SEL_DND_MOTION:
989
+ case SEL_DND_REQUEST:
990
+ case SEL_PICKED:
991
+ SWIG_Ruby_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
992
+ return ptr;
993
+ case SEL_IO_READ:
994
+ case SEL_IO_WRITE:
995
+ case SEL_IO_EXCEPT:
996
+ return 0; // should be an FXInputHandle?
997
+ case SEL_SIGNAL:
998
+ return reinterpret_cast<void*>(static_cast<long>(NUM2INT(value)));
999
+ case SEL_CLOSE:
1000
+ case SEL_DELETE:
1001
+ case SEL_MINIMIZE:
1002
+ case SEL_RESTORE:
1003
+ case SEL_MAXIMIZE:
1004
+ case SEL_UPDATE:
1005
+ case SEL_QUERY_TIP:
1006
+ case SEL_QUERY_HELP:
1007
+ return NULL;
1008
+ case SEL_VERIFY:
1009
+ return reinterpret_cast<void*>(StringValuePtr(value));
1010
+ case SEL_CLICKED:
1011
+ case SEL_DOUBLECLICKED:
1012
+ case SEL_TRIPLECLICKED:
1013
+ case SEL_CHANGED:
1014
+ case SEL_DESELECTED:
1015
+ case SEL_SELECTED:
1016
+ case SEL_INSERTED:
1017
+ case SEL_REPLACED:
1018
+ case SEL_DELETED:
1019
+ case SEL_OPENED:
1020
+ case SEL_CLOSED:
1021
+ case SEL_EXPANDED:
1022
+ case SEL_COLLAPSED:
1023
+ return NULL;
1024
+ default:
1025
+ /* Ignore */
1026
+ break;
1027
+ }
1028
+
1029
+ if(type==SEL_COMMAND){
1030
+ // Handle FXText-specific messages
1031
+ if(obj->isMemberOf(FXMETACLASS(FXText))){
1032
+ switch(id){
1033
+ case FXText::ID_COPY_SEL:
1034
+ case FXText::ID_PASTE_SEL:
1035
+ case FXText::ID_DELETE_SEL:
1036
+ return NULL;
1037
+ default:
1038
+ break;
1039
+ }
1040
+ }
1041
+
1042
+ // Handle FXTextField-specific message
1043
+ if(obj->isMemberOf(FXMETACLASS(FXTextField))){
1044
+ switch(id){
1045
+ case FXTextField::ID_INSERT_STRING:
1046
+ return reinterpret_cast<void*>(StringValuePtr(value));;
1047
+ default:
1048
+ break;
1049
+ }
1050
+ }
1051
+
1052
+ // Handle messages applicable to all FXWindow descendants
1053
+ if(obj->isMemberOf(FXMETACLASS(FXWindow))){
1054
+ switch(id){
1055
+ case FXWindow::ID_HIDE:
1056
+ case FXWindow::ID_SHOW:
1057
+ case FXWindow::ID_TOGGLESHOWN:
1058
+ case FXWindow::ID_LOWER:
1059
+ case FXWindow::ID_RAISE:
1060
+ case FXWindow::ID_DELETE:
1061
+ case FXWindow::ID_DISABLE:
1062
+ case FXWindow::ID_ENABLE:
1063
+ case FXWindow::ID_UNCHECK:
1064
+ case FXWindow::ID_CHECK:
1065
+ case FXWindow::ID_UNKNOWN:
1066
+ case FXWindow::ID_UPDATE:
1067
+ case FXWindow::ID_AUTOSCROLL:
1068
+ case FXWindow::ID_QUERY_MENU:
1069
+ case FXWindow::ID_HOTKEY:
1070
+ case FXWindow::ID_ACCEL:
1071
+ case FXWindow::ID_UNPOST:
1072
+ case FXWindow::ID_POST:
1073
+ case FXWindow::ID_MDI_TILEHORIZONTAL:
1074
+ case FXWindow::ID_MDI_TILEVERTICAL:
1075
+ case FXWindow::ID_MDI_CASCADE:
1076
+ case FXWindow::ID_MDI_MAXIMIZE:
1077
+ case FXWindow::ID_MDI_MINIMIZE:
1078
+ case FXWindow::ID_MDI_RESTORE:
1079
+ case FXWindow::ID_MDI_CLOSE:
1080
+ case FXWindow::ID_MDI_WINDOW:
1081
+ case FXWindow::ID_MDI_MENUWINDOW:
1082
+ case FXWindow::ID_MDI_MENUMINIMIZE:
1083
+ case FXWindow::ID_MDI_MENURESTORE:
1084
+ case FXWindow::ID_MDI_MENUCLOSE:
1085
+ case FXWindow::ID_MDI_NEXT:
1086
+ case FXWindow::ID_MDI_PREV:
1087
+ return NULL;
1088
+ case FXWindow::ID_SETVALUE:
1089
+ if(obj->isMemberOf(FXMETACLASS(FXButton)) ||
1090
+ obj->isMemberOf(FXMETACLASS(FXCheckButton)) ||
1091
+ obj->isMemberOf(FXMETACLASS(FXDial)) ||
1092
+ obj->isMemberOf(FXMETACLASS(FXRadioButton)) ||
1093
+ obj->isMemberOf(FXMETACLASS(FXShutter)) ||
1094
+ obj->isMemberOf(FXMETACLASS(FXSpinner)) ||
1095
+ obj->isMemberOf(FXMETACLASS(FXTabBar)) ||
1096
+ obj->isMemberOf(FXMETACLASS(FXToggleButton)) ||
1097
+ obj->isMemberOf(FXMETACLASS(FXScrollBar)) ||
1098
+ obj->isMemberOf(FXMETACLASS(FXSlider)) ||
1099
+ obj->isMemberOf(FXMETACLASS(FXSwitcher))){
1100
+ return reinterpret_cast<void*>(static_cast<long>(NUM2INT(value)));
1101
+ }
1102
+ else if(obj->isMemberOf(FXMETACLASS(FXColorSelector)) ||
1103
+ obj->isMemberOf(FXMETACLASS(FXColorWell))){
1104
+ return reinterpret_cast<void*>(static_cast<unsigned long>(NUM2UINT(value)));
1105
+ }
1106
+ else if(obj->isMemberOf(FXMETACLASS(FXProgressBar))){
1107
+ return reinterpret_cast<void*>(static_cast<unsigned long>(NUM2UINT(value)));
1108
+ }
1109
+ else if(obj->isMemberOf(FXMETACLASS(FXComboBox)) ||
1110
+ obj->isMemberOf(FXMETACLASS(FXTextField)) ||
1111
+ obj->isMemberOf(FXMETACLASS(FXDirBox)) ||
1112
+ obj->isMemberOf(FXMETACLASS(FXDirList)) ||
1113
+ obj->isMemberOf(FXMETACLASS(FXDriveBox)) ||
1114
+ obj->isMemberOf(FXMETACLASS(FXFileList))){
1115
+ return reinterpret_cast<void*>(StringValuePtr(value));
1116
+ }
1117
+ else if(obj->isMemberOf(FXMETACLASS(FXMenuCheck))){
1118
+ return reinterpret_cast<void*>(static_cast<FXuval>(RTEST(value) ? 1 : 0));
1119
+ }
1120
+ else if(obj->isMemberOf(FXMETACLASS(FXMenuRadio))){
1121
+ return reinterpret_cast<void*>(static_cast<FXuval>(RTEST(value) ? 1 : 0));
1122
+ }
1123
+ else if(obj->isMemberOf(FXMETACLASS(FXMenuCommand))){
1124
+ return reinterpret_cast<void*>(static_cast<FXuval>(RTEST(value) ? 1 : 0));
1125
+ }
1126
+ return NULL;
1127
+ case FXWindow::ID_HSCROLLED:
1128
+ case FXWindow::ID_VSCROLLED:
1129
+ return reinterpret_cast<void*>(static_cast<unsigned long>(NUM2UINT(value)));
1130
+ case FXWindow::ID_SETINTVALUE:
1131
+ if(obj->isMemberOf(FXMETACLASS(FXColorWell))){
1132
+ colorValue=NUM2UINT(value);
1133
+ return reinterpret_cast<void*>(&colorValue);
1134
+ }
1135
+ else{
1136
+ intValue=NUM2INT(value);
1137
+ return reinterpret_cast<void*>(&intValue);
1138
+ }
1139
+ case FXWindow::ID_SETREALVALUE:
1140
+ realValue=NUM2DBL(value);
1141
+ return reinterpret_cast<void*>(&realValue);
1142
+ case FXWindow::ID_SETSTRINGVALUE:
1143
+ stringValue=FXString(StringValuePtr(value));
1144
+ return reinterpret_cast<void*>(&stringValue);
1145
+ case FXWindow::ID_SETINTRANGE:
1146
+ intRange[0]=NUM2INT(rb_ary_entry(value,0));
1147
+ intRange[1]=NUM2INT(rb_ary_entry(value,1));
1148
+ return reinterpret_cast<void*>(intRange);
1149
+ case FXWindow::ID_SETREALRANGE:
1150
+ realRange[0]=NUM2DBL(rb_ary_entry(value,0));
1151
+ realRange[1]=NUM2DBL(rb_ary_entry(value,1));
1152
+ return reinterpret_cast<void*>(realRange);
1153
+ case FXWindow::ID_GETINTVALUE:
1154
+ case FXWindow::ID_GETREALVALUE:
1155
+ case FXWindow::ID_GETSTRINGVALUE:
1156
+ case FXWindow::ID_GETINTRANGE:
1157
+ case FXWindow::ID_GETREALRANGE:
1158
+ return NULL;
1159
+ default:
1160
+ // Pass this data along as-is
1161
+ break;
1162
+ }
1163
+ }
1164
+ }
1165
+
1166
+ if(type==SEL_CHANGED){
1167
+ if(obj->isMemberOf(FXMETACLASS(FXPicker))){
1168
+ SWIG_Ruby_ConvertPtr(value,&ptr,FXRbTypeQuery("FXPoint *"),1);
1169
+ return ptr;
1170
+ }
1171
+ return 0;
1172
+ }
1173
+
1174
+ if(type==SEL_DRAGGED){
1175
+ SWIG_Ruby_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
1176
+ return ptr;
1177
+ }
1178
+
1179
+ // Pass through as-is
1180
+ return reinterpret_cast<void*>(value);
1181
+ }
1182
+
1183
+
1184
+ static ID id_assocs;
1185
+
1186
+
1187
+ /**
1188
+ * Look up the name of the message handler function for this
1189
+ * receiver and message (type, id) combination and return it;
1190
+ * or return zero if the designated receiver doesn't handle this
1191
+ * message.
1192
+ */
1193
+ ID FXRbLookupHandler(FXObject* recv,FXSelector key){
1194
+ FXTRACE((100,"FXRbLookupHandler(recv=%p(%s),FXSEL(%d,%d))\n",recv,recv->getClassName(),FXSELTYPE(key),FXSELID(key)));
1195
+ ID id=0;
1196
+ VALUE rubyObj=to_ruby(recv);
1197
+ FXASSERT((recv==0 && rubyObj==Qnil) || (recv!=0 && rubyObj!=Qnil));
1198
+ if(rb_ivar_defined(rubyObj,id_assocs)==Qtrue){
1199
+ VALUE assocs=rb_ivar_get(rubyObj,id_assocs);
1200
+ VALUE entry;
1201
+ FXSelector keylo,keyhi;
1202
+ for(long i=0;i<RARRAY_LEN(assocs);i++){
1203
+ entry=rb_ary_entry(assocs,i);
1204
+ keylo=NUM2UINT(rb_ary_entry(entry,0));
1205
+ keyhi=NUM2UINT(rb_ary_entry(entry,1));
1206
+ if(keylo<=key && key<=keyhi){
1207
+ id=SYM2ID(rb_ary_entry(entry,2));
1208
+ FXASSERT(id!=0);
1209
+ break;
1210
+ }
1211
+ }
1212
+ }
1213
+ return id;
1214
+ }
1215
+
1216
+
1217
+ struct FXRbHandleArgs {
1218
+ VALUE recv;
1219
+ VALUE id;
1220
+ int nargs;
1221
+ VALUE sender;
1222
+ VALUE key;
1223
+ VALUE data;
1224
+ };
1225
+
1226
+
1227
+ static VALUE handle_body(VALUE args){
1228
+ FXRbHandleArgs* hArgs=reinterpret_cast<FXRbHandleArgs*>(args);
1229
+ FXASSERT(hArgs!=0);
1230
+ return rb_funcall(hArgs->recv,hArgs->id,hArgs->nargs,hArgs->sender,hArgs->key,hArgs->data);
1231
+ }
1232
+
1233
+
1234
+ static ID id_backtrace;
1235
+
1236
+
1237
+ static VALUE handle_rescue(VALUE args,VALUE error){
1238
+ VALUE info=rb_gv_get("$!");
1239
+ VALUE errat=rb_funcall(info,id_backtrace,0);
1240
+ VALUE mesg=RARRAY_PTR(errat)[0];
1241
+ fprintf(stderr,"%s: %s (%s)\n",
1242
+ StringValuePtr(mesg),
1243
+ RSTRING_PTR(rb_obj_as_string(info)),
1244
+ rb_class2name(CLASS_OF(info)));
1245
+ for(int i=1;i<RARRAY_LEN(errat);i++){
1246
+ if(TYPE(RARRAY_PTR(errat)[i])==T_STRING){
1247
+ fprintf(stderr,"\tfrom %s\n",StringValuePtr(RARRAY_PTR(errat)[i]));
1248
+ }
1249
+ }
1250
+ return Qnil;
1251
+ }
1252
+
1253
+
1254
+ // Call the designated function and return its result (which should be a long).
1255
+ long FXRbHandleMessage(FXObject* recv,ID func,FXObject* sender,FXSelector key,void* ptr){
1256
+ FXRbHandleArgs hArgs;
1257
+ hArgs.recv=to_ruby(recv);
1258
+ hArgs.sender=to_ruby(sender);
1259
+ hArgs.key=to_ruby(key);
1260
+ hArgs.data=FXRbConvertMessageData(sender,recv,key,ptr);
1261
+ hArgs.id=func;
1262
+ hArgs.nargs=3;
1263
+ VALUE retval;
1264
+
1265
+ FXTRACE((100,"FXRbHandleMessage(recv=%p(%s),FXSEL(%s,%d)\n",recv,recv->getClassName(),FXDebugTarget::messageTypeName[FXSELTYPE(key)],FXSELID(key)));
1266
+
1267
+ if(FXRbCatchExceptions){
1268
+ #ifdef RB_RESCUE2_BROKEN_PROTOTYPE
1269
+ retval=rb_rescue2((VALUE(*)()) handle_body, reinterpret_cast<VALUE>(&hArgs),
1270
+ (VALUE(*)()) handle_rescue, Qnil,
1271
+ rb_eStandardError, rb_eNameError, 0);
1272
+ #else
1273
+ retval=rb_rescue2((VALUE(*)(ANYARGS)) handle_body, reinterpret_cast<VALUE>(&hArgs),
1274
+ (VALUE(*)(ANYARGS)) handle_rescue, Qnil,
1275
+ rb_eStandardError, rb_eNameError, 0);
1276
+ #endif
1277
+ }
1278
+ else{
1279
+ retval=handle_body(reinterpret_cast<VALUE>(&hArgs));
1280
+ }
1281
+
1282
+ /**
1283
+ * Process the return value. For boolean return values, convert "true"
1284
+ * to 1 and "false" to zero. For numeric types, convert it to a long value
1285
+ * but trap the result to either 0 or 1 since these are usually what
1286
+ * FOX is looking for. For any other type result (including nil) return 1.
1287
+ * Thanks to Ted Meng for this suggestion.
1288
+ */
1289
+ long lresult;
1290
+ switch(TYPE(retval)){
1291
+ case T_TRUE:
1292
+ lresult=1;
1293
+ break;
1294
+ case T_FALSE:
1295
+ lresult=0;
1296
+ break;
1297
+ case T_BIGNUM:
1298
+ lresult=1;
1299
+ break;
1300
+ case T_FIXNUM:
1301
+ case T_FLOAT:
1302
+ lresult=(NUM2LONG(retval) == 0) ? 0 : 1; // trap any numeric result to either 0 or 1
1303
+ break;
1304
+ default:
1305
+ lresult=1;
1306
+ }
1307
+ return lresult;
1308
+ }
1309
+
1310
+ //----------------------------------------------------------------------
1311
+
1312
+ static ID id_begin;
1313
+ static ID id_end;
1314
+ static ID id_exclude_endp;
1315
+
1316
+ void FXRbRange2LoHi(VALUE range,FXint& lo,FXint& hi){
1317
+ if(Qtrue!=rb_obj_is_instance_of(range,rb_cRange)){
1318
+ rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange));
1319
+ }
1320
+ else{
1321
+ VALUE beg=rb_funcall(range,id_begin,0,NULL);
1322
+ VALUE end=rb_funcall(range,id_end,0,NULL);
1323
+ VALUE excl=rb_funcall(range,id_exclude_endp,0,NULL);
1324
+ lo=NUM2INT(beg);
1325
+ hi=NUM2INT(end);
1326
+ if(excl==Qtrue){
1327
+ hi--;
1328
+ }
1329
+ }
1330
+ }
1331
+
1332
+ void FXRbRange2LoHi(VALUE range,FXdouble& lo,FXdouble& hi){
1333
+ if(Qtrue!=rb_obj_is_instance_of(range,rb_cRange)){
1334
+ rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange));
1335
+ }
1336
+ else{
1337
+ VALUE beg=rb_funcall(range,id_begin,0,NULL);
1338
+ VALUE end=rb_funcall(range,id_end,0,NULL);
1339
+ VALUE excl=rb_funcall(range,id_exclude_endp,0,NULL);
1340
+ lo=NUM2DBL(beg);
1341
+ hi=NUM2DBL(end);
1342
+ if(excl==Qtrue){
1343
+ hi--;
1344
+ }
1345
+ }
1346
+ }
1347
+
1348
+ //----------------------------------------------------------------------
1349
+
1350
+ void FXRbCallVoidMethod(FXObject* recv, ID func) {
1351
+ VALUE obj=FXRbGetRubyObj(recv,false);
1352
+ FXASSERT(!NIL_P(obj));
1353
+ rb_funcall(obj,func,0,NULL);
1354
+ }
1355
+
1356
+ void FXRbCallVoidMethod(FXDC* recv,ID func) {
1357
+ VALUE obj=FXRbGetRubyObj(recv,false);
1358
+ FXASSERT(!NIL_P(obj));
1359
+ rb_funcall(obj,func,0,NULL);
1360
+ }
1361
+
1362
+ //----------------------------------------------------------------------
1363
+
1364
+ bool FXRbCallBoolMethod(const FXObject* recv,ID func){
1365
+ VALUE obj=FXRbGetRubyObj(recv,false);
1366
+ FXASSERT(!NIL_P(obj));
1367
+ VALUE v=rb_funcall(obj,func,0,NULL);
1368
+ return (v==Qtrue);
1369
+ }
1370
+
1371
+ //----------------------------------------------------------------------
1372
+
1373
+ // Call function with "FXint" return value
1374
+ FXint FXRbCallIntMethod(const FXObject* recv,ID func){
1375
+ VALUE obj=FXRbGetRubyObj(recv,false);
1376
+ FXASSERT(!NIL_P(obj));
1377
+ VALUE result=rb_funcall(obj,func,0,NULL);
1378
+ return static_cast<FXint>(NUM2INT(result));
1379
+ }
1380
+
1381
+ //----------------------------------------------------------------------
1382
+
1383
+ // Call function with "FXGLObject*" return value
1384
+ FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func){
1385
+ VALUE obj=FXRbGetRubyObj(recv,false);
1386
+ FXASSERT(!NIL_P(obj));
1387
+ VALUE result=rb_funcall(obj,func,0,NULL);
1388
+ return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1389
+ }
1390
+
1391
+ FXGLObject* FXRbCallGLObjectMethod(FXGLViewer* recv,ID func,FXint x,FXint y){
1392
+ VALUE obj=FXRbGetRubyObj(recv,false);
1393
+ FXASSERT(!NIL_P(obj));
1394
+ VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1395
+ return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1396
+ }
1397
+
1398
+ FXGLObject* FXRbCallGLObjectMethod(FXGLObject* recv,ID func,FXuint* path,FXint n){
1399
+ VALUE obj=FXRbGetRubyObj(recv,false);
1400
+ FXASSERT(!NIL_P(obj));
1401
+ VALUE result=rb_funcall(obj,func,1,FXRbMakeArray(path,n));
1402
+ return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1403
+ }
1404
+
1405
+ //----------------------------------------------------------------------
1406
+
1407
+ // Call function with "FXGLObject**" return value
1408
+ FXGLObject** FXRbCallGLObjectArrayMethod(FXGLViewer* recv,ID func,FXint x,FXint y,FXint w,FXint h){
1409
+ FXGLObject** objects=NULL;
1410
+ VALUE obj=FXRbGetRubyObj(recv,false);
1411
+ FXASSERT(!NIL_P(obj));
1412
+ VALUE result=rb_funcall(obj,func,4,INT2NUM(x),INT2NUM(y),INT2NUM(w),INT2NUM(h));
1413
+ if(!NIL_P(result)){
1414
+ Check_Type(result,T_ARRAY);
1415
+ if(FXMALLOC(&objects,FXGLObject*,RARRAY_LEN(result)+1)){
1416
+ for(long i=0; i<RARRAY_LEN(result); i++){
1417
+ objects[i]=reinterpret_cast<FXGLObject*>(DATA_PTR(rb_ary_entry(result,i)));
1418
+ }
1419
+ objects[RARRAY_LEN(result)]=0;
1420
+ }
1421
+ }
1422
+ return objects; // caller must free this
1423
+ }
1424
+
1425
+ //----------------------------------------------------------------------
1426
+
1427
+ FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,const FXString& text,FXIcon* icon,void* ptr){
1428
+ VALUE itemData=(ptr==0)?Qnil:reinterpret_cast<VALUE>(ptr);
1429
+ VALUE obj=FXRbGetRubyObj(recv,false);
1430
+ FXASSERT(!NIL_P(obj));
1431
+ VALUE result=rb_funcall(obj,func,3,to_ruby(text),to_ruby(icon),itemData);
1432
+ return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
1433
+ }
1434
+
1435
+ FXTableItem* FXRbCallTableItemMethod(FXTable* recv,ID func,FXint row,FXint col,FXbool notify){
1436
+ VALUE obj=FXRbGetRubyObj(recv,false);
1437
+ FXASSERT(!NIL_P(obj));
1438
+ VALUE result=rb_funcall(obj,func,3,to_ruby(row),to_ruby(col),to_ruby(notify));
1439
+ return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
1440
+ }
1441
+
1442
+ //----------------------------------------------------------------------
1443
+
1444
+ FXTreeItem* FXRbCallTreeItemMethod(const FXTreeList* recv,ID func,FXint x,FXint y){
1445
+ VALUE obj=FXRbGetRubyObj(recv,false);
1446
+ FXASSERT(!NIL_P(obj));
1447
+ VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1448
+ return NIL_P(result) ? 0 : reinterpret_cast<FXTreeItem*>(DATA_PTR(result));
1449
+ }
1450
+
1451
+ //----------------------------------------------------------------------
1452
+
1453
+ FXFoldingItem* FXRbCallFoldingItemMethod(const FXFoldingList* recv,ID func,FXint x,FXint y){
1454
+ VALUE obj=FXRbGetRubyObj(recv,false);
1455
+ FXASSERT(!NIL_P(obj));
1456
+ VALUE result=rb_funcall(obj,func,2,INT2NUM(x),INT2NUM(y));
1457
+ return NIL_P(result) ? 0 : reinterpret_cast<FXFoldingItem*>(DATA_PTR(result));
1458
+ }
1459
+
1460
+ //----------------------------------------------------------------------
1461
+
1462
+ FXFileAssoc* FXRbCallFileAssocMethod(const FXFileDict* recv,ID func,const char* pathname){
1463
+ VALUE obj=FXRbGetRubyObj(recv,false);
1464
+ FXASSERT(!NIL_P(obj));
1465
+ VALUE result=rb_funcall(obj,func,1,rb_str_new2(pathname));
1466
+ return NIL_P(result) ? 0 : reinterpret_cast<FXFileAssoc*>(DATA_PTR(result));
1467
+ }
1468
+
1469
+ //----------------------------------------------------------------------
1470
+
1471
+ FXIcon* FXRbCallIconMethod(const FXTableItem* recv,ID func){
1472
+ VALUE obj=FXRbGetRubyObj(recv,false);
1473
+ FXASSERT(!NIL_P(obj));
1474
+ if(!NIL_P(obj)){
1475
+ VALUE result=rb_funcall(obj,func,0,NULL);
1476
+ return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result));
1477
+ }
1478
+ else{
1479
+ return 0;
1480
+ }
1481
+ }
1482
+
1483
+ //----------------------------------------------------------------------
1484
+
1485
+ FXWindow* FXRbCallWindowMethod(const FXTableItem* recv,ID func,FXTable* table){
1486
+ VALUE obj=FXRbGetRubyObj(recv,false);
1487
+ FXASSERT(!NIL_P(obj));
1488
+ VALUE result=rb_funcall(obj,func,1,to_ruby(table));
1489
+ return NIL_P(result) ? 0 : reinterpret_cast<FXWindow*>(DATA_PTR(result));
1490
+ }
1491
+
1492
+ //----------------------------------------------------------------------
1493
+
1494
+ // Call function with "FXRange" return value
1495
+ FXRangef FXRbCallRangeMethod(FXObject* recv,ID func){
1496
+ VALUE obj=FXRbGetRubyObj(recv,false);
1497
+ FXASSERT(!NIL_P(obj));
1498
+ VALUE result=rb_funcall(obj,func,0,NULL);
1499
+ return *reinterpret_cast<FXRangef*>(DATA_PTR(result));
1500
+ }
1501
+
1502
+ //----------------------------------------------------------------------
1503
+
1504
+ // Call functions with FXString return value
1505
+ FXString FXRbCallStringMethod(const FXObject* recv, ID func){
1506
+ VALUE obj=FXRbGetRubyObj(recv,false);
1507
+ FXASSERT(!NIL_P(obj));
1508
+ VALUE result=rb_funcall(obj,func,0,NULL);
1509
+ return FXString(StringValuePtr(result));
1510
+ }
1511
+
1512
+ //----------------------------------------------------------------------
1513
+
1514
+ // Call functions with const FXchar* return value
1515
+ const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar* message, const FXchar* hint){
1516
+ VALUE obj=FXRbGetRubyObj(recv,false);
1517
+ FXASSERT(!NIL_P(obj));
1518
+ VALUE result=rb_funcall(obj,func,2,to_ruby(message),to_ruby(hint));
1519
+ return NIL_P(result) ? 0 : StringValuePtr(result);
1520
+ }
1521
+
1522
+ // Call functions with const FXchar* return value
1523
+ const FXchar* FXRbCallCStringMethod(const FXObject* recv, ID func, const FXchar* context, const FXchar* message, const FXchar* hint){
1524
+ VALUE obj=FXRbGetRubyObj(recv,false);
1525
+ FXASSERT(!NIL_P(obj));
1526
+ VALUE result=rb_funcall(obj,func,3,to_ruby(context),to_ruby(message),to_ruby(hint));
1527
+ return NIL_P(result) ? 0 : StringValuePtr(result);
1528
+ }
1529
+ //----------------------------------------------------------------------
1530
+
1531
+ // Call functions with FXwchar return value
1532
+ FXwchar FXRbCallWCharMethod(const FXObject* recv, ID func){
1533
+ VALUE obj=FXRbGetRubyObj(recv,false);
1534
+ FXASSERT(!NIL_P(obj));
1535
+ VALUE result=rb_funcall(obj,func,0,NULL);
1536
+ return static_cast<FXwchar>(NUM2ULONG(result));
1537
+ }
1538
+
1539
+ //----------------------------------------------------------------------
1540
+
1541
+ // Special destructors to handle order dependencies
1542
+ FXRbMenuCommand::~FXRbMenuCommand(){
1543
+ FXAccelTable *table;
1544
+ FXWindow *owner;
1545
+ if(acckey){
1546
+ owner=getShell()->getOwner();
1547
+ if(owner){
1548
+ table=owner->getAccelTable();
1549
+ if(table && table!=reinterpret_cast<FXAccelTable*>(-1)){
1550
+ table->removeAccel(acckey);
1551
+ }
1552
+ }
1553
+ }
1554
+ acckey=(FXHotKey)NULL;
1555
+ FXRbUnregisterRubyObj(this);
1556
+ }
1557
+
1558
+ FXRbMenuCheck::~FXRbMenuCheck(){
1559
+ FXAccelTable *table;
1560
+ FXWindow *owner;
1561
+ if(acckey){
1562
+ owner=getShell()->getOwner();
1563
+ if(owner){
1564
+ table=owner->getAccelTable();
1565
+ if(table && table!=reinterpret_cast<FXAccelTable*>(-1)){
1566
+ table->removeAccel(acckey);
1567
+ }
1568
+ }
1569
+ }
1570
+ acckey=(FXHotKey)NULL;
1571
+ FXRbUnregisterRubyObj(this);
1572
+ }
1573
+
1574
+ FXRbMenuRadio::~FXRbMenuRadio(){
1575
+ FXAccelTable *table;
1576
+ FXWindow *owner;
1577
+ if(acckey){
1578
+ owner=getShell()->getOwner();
1579
+ if(owner){
1580
+ table=owner->getAccelTable();
1581
+ if(table && table!=reinterpret_cast<FXAccelTable*>(-1)){
1582
+ table->removeAccel(acckey);
1583
+ }
1584
+ }
1585
+ }
1586
+ acckey=(FXHotKey)NULL;
1587
+ FXRbUnregisterRubyObj(this);
1588
+ }
1589
+
1590
+ //----------------------------------------------------------------------
1591
+
1592
+ // Visit all of the items between fm and to (inclusive), plus their
1593
+ // child items, and add to the items list
1594
+ void FXRbTreeList::enumerateItem(FXTreeItem* item,FXObjectListOf<FXTreeItem>& items){
1595
+ // Add this item to the list
1596
+ items.append(item);
1597
+
1598
+ // Add this item's children
1599
+ FXRbTreeList::enumerateItems(item->getFirst(),item->getLast(),items);
1600
+ }
1601
+
1602
+
1603
+ // Visit all of the items between fm and to (inclusive), plus their
1604
+ // child items, and add to the items list
1605
+ void FXRbTreeList::enumerateItems(FXTreeItem* fm,FXTreeItem* to,FXObjectListOf<FXTreeItem>& items){
1606
+ register FXTreeItem *item;
1607
+ if(fm && to){
1608
+ do{
1609
+ item=fm;
1610
+ fm=fm->getNext();
1611
+ FXRbTreeList::enumerateItem(item,items);
1612
+ }
1613
+ while(item!=to);
1614
+ }
1615
+ }
1616
+
1617
+ //----------------------------------------------------------------------
1618
+
1619
+ /**
1620
+ * Visit all of the items between fm and to (inclusive), plus their
1621
+ * child items, and add to the items list.
1622
+ */
1623
+ void FXRbFoldingList::enumerateItem(FXFoldingItem* item,FXObjectListOf<FXFoldingItem>& items){
1624
+ // Add this item to the list
1625
+ items.append(item);
1626
+
1627
+ // Add this item's children
1628
+ FXRbFoldingList::enumerateItems(item->getFirst(),item->getLast(),items);
1629
+ }
1630
+
1631
+
1632
+ /**
1633
+ * Visit all of the items between fm and to (inclusive), plus their
1634
+ * child items, and add to the items list.
1635
+ */
1636
+ void FXRbFoldingList::enumerateItems(FXFoldingItem* fm,FXFoldingItem* to,FXObjectListOf<FXFoldingItem>& items){
1637
+ register FXFoldingItem *item;
1638
+ if(fm && to){
1639
+ do{
1640
+ item=fm;
1641
+ fm=fm->getNext();
1642
+ FXRbFoldingList::enumerateItem(item,items);
1643
+ }
1644
+ while(item!=to);
1645
+ }
1646
+ }
1647
+
1648
+
1649
+ //----------------------------------------------------------------------
1650
+
1651
+ static ID id_cmp;
1652
+
1653
+ // Sort function stand-in for FXComboBox
1654
+ FXint FXRbComboBox::sortFunc(const FXListItem* a,const FXListItem* b){
1655
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1656
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1657
+ VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1658
+ return static_cast<FXint>(NUM2INT(result));
1659
+ }
1660
+
1661
+
1662
+ // Sort function stand-in for FXFoldingList
1663
+ FXint FXRbFoldingList::sortFunc(const FXFoldingItem* a,const FXFoldingItem* b){
1664
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXFoldingItem*>(a), "FXFoldingItem *");
1665
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXFoldingItem*>(b), "FXFoldingItem *");
1666
+ VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1667
+ return static_cast<FXint>(NUM2INT(result));
1668
+ }
1669
+
1670
+
1671
+ // Sort function stand-in for FXIconList
1672
+ FXint FXRbIconList::sortFunc(const FXIconItem* a,const FXIconItem* b){
1673
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXIconItem*>(a), "FXIconItem *");
1674
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXIconItem*>(b), "FXIconItem *");
1675
+ VALUE result = rb_funcall(itemA,id_cmp,1,itemB);
1676
+ return static_cast<FXint>(NUM2INT(result));
1677
+ }
1678
+
1679
+
1680
+ // Sort function stand-in for FXList
1681
+ FXint FXRbList::sortFunc(const FXListItem* a,const FXListItem* b){
1682
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1683
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1684
+ VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1685
+ return static_cast<FXint>(NUM2INT(result));
1686
+ }
1687
+
1688
+
1689
+ // Sort function stand-in for FXListBox
1690
+ FXint FXRbListBox::sortFunc(const FXListItem* a,const FXListItem* b){
1691
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXListItem*>(a), "FXListItem *");
1692
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXListItem*>(b), "FXListItem *");
1693
+ VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1694
+ return static_cast<FXint>(NUM2INT(result));
1695
+ }
1696
+
1697
+
1698
+ // Sort function stand-in for FXTreeList
1699
+ FXint FXRbTreeList::sortFunc(const FXTreeItem* a,const FXTreeItem* b){
1700
+ VALUE itemA = FXRbGetRubyObj(const_cast<FXTreeItem*>(a), "FXTreeItem *");
1701
+ VALUE itemB = FXRbGetRubyObj(const_cast<FXTreeItem*>(b), "FXTreeItem *");
1702
+ VALUE result=rb_funcall(itemA,id_cmp,1,itemB);
1703
+ return static_cast<FXint>(NUM2INT(result));
1704
+ }
1705
+
1706
+
1707
+ // Feedback buffer sort routine stand-in for FXGLViewer
1708
+ FXbool FXRbGLViewer::sortProc(FXfloat*& buffer,FXint& used,FXint& size){
1709
+ return TRUE;
1710
+ }
1711
+
1712
+ //----------------------------------------------------------------------
1713
+
1714
+ // Copied from the Ruby 1.8.6 sources (signal.c)
1715
+ static struct signals {
1716
+ const char *signm;
1717
+ int signo;
1718
+ } siglist [] = {
1719
+ {"EXIT", 0},
1720
+ #ifdef SIGHUP
1721
+ {"HUP", SIGHUP},
1722
+ #endif
1723
+ {"INT", SIGINT},
1724
+ #ifdef SIGQUIT
1725
+ {"QUIT", SIGQUIT},
1726
+ #endif
1727
+ #ifdef SIGILL
1728
+ {"ILL", SIGILL},
1729
+ #endif
1730
+ #ifdef SIGTRAP
1731
+ {"TRAP", SIGTRAP},
1732
+ #endif
1733
+ #ifdef SIGIOT
1734
+ {"IOT", SIGIOT},
1735
+ #endif
1736
+ #ifdef SIGABRT
1737
+ {"ABRT", SIGABRT},
1738
+ #endif
1739
+ #ifdef SIGEMT
1740
+ {"EMT", SIGEMT},
1741
+ #endif
1742
+ #ifdef SIGFPE
1743
+ {"FPE", SIGFPE},
1744
+ #endif
1745
+ #ifdef SIGKILL
1746
+ {"KILL", SIGKILL},
1747
+ #endif
1748
+ #ifdef SIGBUS
1749
+ {"BUS", SIGBUS},
1750
+ #endif
1751
+ #ifdef SIGSEGV
1752
+ {"SEGV", SIGSEGV},
1753
+ #endif
1754
+ #ifdef SIGSYS
1755
+ {"SYS", SIGSYS},
1756
+ #endif
1757
+ #ifdef SIGPIPE
1758
+ {"PIPE", SIGPIPE},
1759
+ #endif
1760
+ #ifdef SIGALRM
1761
+ {"ALRM", SIGALRM},
1762
+ #endif
1763
+ #ifdef SIGTERM
1764
+ {"TERM", SIGTERM},
1765
+ #endif
1766
+ #ifdef SIGURG
1767
+ {"URG", SIGURG},
1768
+ #endif
1769
+ #ifdef SIGSTOP
1770
+ {"STOP", SIGSTOP},
1771
+ #endif
1772
+ #ifdef SIGTSTP
1773
+ {"TSTP", SIGTSTP},
1774
+ #endif
1775
+ #ifdef SIGCONT
1776
+ {"CONT", SIGCONT},
1777
+ #endif
1778
+ #ifdef SIGCHLD
1779
+ {"CHLD", SIGCHLD},
1780
+ #endif
1781
+ #ifdef SIGCLD
1782
+ {"CLD", SIGCLD},
1783
+ #else
1784
+ # ifdef SIGCHLD
1785
+ {"CLD", SIGCHLD},
1786
+ # endif
1787
+ #endif
1788
+ #ifdef SIGTTIN
1789
+ {"TTIN", SIGTTIN},
1790
+ #endif
1791
+ #ifdef SIGTTOU
1792
+ {"TTOU", SIGTTOU},
1793
+ #endif
1794
+ #ifdef SIGIO
1795
+ {"IO", SIGIO},
1796
+ #endif
1797
+ #ifdef SIGXCPU
1798
+ {"XCPU", SIGXCPU},
1799
+ #endif
1800
+ #ifdef SIGXFSZ
1801
+ {"XFSZ", SIGXFSZ},
1802
+ #endif
1803
+ #ifdef SIGVTALRM
1804
+ {"VTALRM", SIGVTALRM},
1805
+ #endif
1806
+ #ifdef SIGPROF
1807
+ {"PROF", SIGPROF},
1808
+ #endif
1809
+ #ifdef SIGWINCH
1810
+ {"WINCH", SIGWINCH},
1811
+ #endif
1812
+ #ifdef SIGUSR1
1813
+ {"USR1", SIGUSR1},
1814
+ #endif
1815
+ #ifdef SIGUSR2
1816
+ {"USR2", SIGUSR2},
1817
+ #endif
1818
+ #ifdef SIGLOST
1819
+ {"LOST", SIGLOST},
1820
+ #endif
1821
+ #ifdef SIGMSG
1822
+ {"MSG", SIGMSG},
1823
+ #endif
1824
+ #ifdef SIGPWR
1825
+ {"PWR", SIGPWR},
1826
+ #endif
1827
+ #ifdef SIGPOLL
1828
+ {"POLL", SIGPOLL},
1829
+ #endif
1830
+ #ifdef SIGDANGER
1831
+ {"DANGER", SIGDANGER},
1832
+ #endif
1833
+ #ifdef SIGMIGRATE
1834
+ {"MIGRATE", SIGMIGRATE},
1835
+ #endif
1836
+ #ifdef SIGPRE
1837
+ {"PRE", SIGPRE},
1838
+ #endif
1839
+ #ifdef SIGGRANT
1840
+ {"GRANT", SIGGRANT},
1841
+ #endif
1842
+ #ifdef SIGRETRACT
1843
+ {"RETRACT", SIGRETRACT},
1844
+ #endif
1845
+ #ifdef SIGSOUND
1846
+ {"SOUND", SIGSOUND},
1847
+ #endif
1848
+ #ifdef SIGINFO
1849
+ {"INFO", SIGINFO},
1850
+ #endif
1851
+ {NULL, 0}
1852
+ };
1853
+
1854
+ FXint FXRbSignalNameToNumber(const char* s){
1855
+ #ifdef HAVE_SIGNAL_H
1856
+ const char *nm=s;
1857
+ if(strncmp("SIG",nm,3)==0){
1858
+ nm+=3;
1859
+ }
1860
+ for(signals* sigs=siglist;sigs->signm;sigs++){
1861
+ if(strcmp(sigs->signm,nm)==0)
1862
+ return sigs->signo;
1863
+ }
1864
+ #endif /* HAVE_SIGNAL_H */
1865
+ return 0;
1866
+ }
1867
+
1868
+ //----------------------------------------------------------------------
1869
+
1870
+ /*
1871
+ * The Ruby header files define a TYPE(x) macro that conflicts with the
1872
+ * TYPE template parameter used in FXArray.h and FXElement.h.
1873
+ */
1874
+ #ifdef TYPE
1875
+ #undef TYPE
1876
+ #endif
1877
+
1878
+ #include <new>
1879
+
1880
+ #include "FXArray.h"
1881
+ #include "FXElement.h"
1882
+
1883
+ static st_table * appSensitiveObjs;
1884
+ static st_table * appSensitiveDCs;
1885
+
1886
+ void FXRbRegisterAppSensitiveObject(FXObject* obj){
1887
+ FXASSERT(obj!=0);
1888
+ FXTRACE((100,"%s:%d: FXRbRegisterAppSensitiveObject(obj=%p(%s))\n",__FILE__,__LINE__,obj,obj->getClassName()));
1889
+ st_insert(appSensitiveObjs,reinterpret_cast<st_data_t>(obj),(st_data_t)0);
1890
+ FXASSERT(st_lookup(appSensitiveObjs,reinterpret_cast<st_data_t>(obj),reinterpret_cast<st_data_t *>(0))!=0);
1891
+ }
1892
+
1893
+ void FXRbRegisterAppSensitiveObject(FXDC* dc){
1894
+ FXASSERT(dc!=0);
1895
+ FXTRACE((100,"%s:%d: FXRbRegisterAppSensitiveObject(dc=%p)\n",__FILE__,__LINE__,dc));
1896
+ st_insert(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),(st_data_t)0);
1897
+ FXASSERT(st_lookup(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),reinterpret_cast<st_data_t *>(0))!=0);
1898
+ }
1899
+
1900
+ void FXRbUnregisterAppSensitiveObject(FXObject* obj){
1901
+ FXASSERT(obj!=0);
1902
+ FXTRACE((100,"%s:%d: FXRbUnregisterAppSensitiveObject(obj=%p(%s))\n",__FILE__,__LINE__,obj,obj->getClassName()));
1903
+ st_delete(appSensitiveObjs,reinterpret_cast<st_data_t *>(&obj),reinterpret_cast<st_data_t *>(0));
1904
+ FXASSERT(st_lookup(appSensitiveObjs,reinterpret_cast<st_data_t>(obj),reinterpret_cast<st_data_t *>(0))==0);
1905
+ }
1906
+
1907
+ void FXRbUnregisterAppSensitiveObject(FXDC* dc){
1908
+ FXASSERT(dc!=0);
1909
+ FXTRACE((100,"%s:%d: FXRbUnregisterAppSensitiveObject(dc=%p)\n",__FILE__,__LINE__,dc));
1910
+ st_delete(appSensitiveDCs,reinterpret_cast<st_data_t *>(&dc),reinterpret_cast<st_data_t *>(0));
1911
+ FXASSERT(st_lookup(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),reinterpret_cast<st_data_t *>(0))==0);
1912
+ }
1913
+
1914
+ #ifdef ST_BROKEN_PROTOTYPES
1915
+ static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg){
1916
+ #else
1917
+ static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg,int){
1918
+ #endif
1919
+ FXASSERT(key!=0);
1920
+ FXASSERT(arg!=0);
1921
+ FXObjectListOf<FXObject> *pObjectList=reinterpret_cast<FXObjectListOf<FXObject>*>(arg);
1922
+ FXObject *pObject=reinterpret_cast<FXObject*>(key);
1923
+ pObjectList->append(pObject);
1924
+ return 0;
1925
+ }
1926
+
1927
+ #ifdef ST_BROKEN_PROTOTYPES
1928
+ static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg){
1929
+ #else
1930
+ static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg,int){
1931
+ #endif
1932
+ FXASSERT(key!=0);
1933
+ FXASSERT(arg!=0);
1934
+ FXArray<FXDC*> *pDCArray=reinterpret_cast<FXArray<FXDC*>*>(arg);
1935
+ FXDC *pDC=reinterpret_cast<FXDC*>(key);
1936
+ pDCArray->append(pDC);
1937
+ return 0;
1938
+ }
1939
+
1940
+ void FXRbDestroyAppSensitiveObjects(){
1941
+ FXTRACE((100,"%s:%d: Begin destroying objects that hold references to the FXApp...\n",__FILE__,__LINE__));
1942
+
1943
+ FXObjectListOf<FXObject> objs;
1944
+ #ifdef ST_BROKEN_PROTOTYPES
1945
+ st_foreach(appSensitiveObjs,st_cbfunc_obj,reinterpret_cast<st_data_t>(&objs));
1946
+ #else
1947
+ st_foreach(appSensitiveObjs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_obj),reinterpret_cast<st_data_t>(&objs));
1948
+ #endif
1949
+ for(FXint i=0;i<objs.no();i++){
1950
+ if(objs[i]->isMemberOf(FXMETACLASS(FXRbCursor))){
1951
+ if(dynamic_cast<FXRbCursor*>(objs[i])->ownedByApp)
1952
+ continue;
1953
+ }
1954
+ else if(objs[i]->isMemberOf(FXMETACLASS(FXRbCURCursor))){
1955
+ if(dynamic_cast<FXRbCURCursor*>(objs[i])->ownedByApp)
1956
+ continue;
1957
+ }
1958
+ else if(objs[i]->isMemberOf(FXMETACLASS(FXRbGIFCursor))){
1959
+ if(dynamic_cast<FXRbGIFCursor*>(objs[i])->ownedByApp)
1960
+ continue;
1961
+ }
1962
+ else if(objs[i]->isMemberOf(FXMETACLASS(FXRbFont))){
1963
+ if(dynamic_cast<FXRbFont*>(objs[i])->ownedByApp)
1964
+ continue;
1965
+ }
1966
+ else if(objs[i]->isMemberOf(FXMETACLASS(FXRbGLVisual))){
1967
+ if(dynamic_cast<FXRbGLVisual*>(objs[i])->ownedByApp)
1968
+ continue;
1969
+ }
1970
+ else if(objs[i]->isMemberOf(FXMETACLASS(FXRbVisual))){
1971
+ if(dynamic_cast<FXRbVisual*>(objs[i])->ownedByApp)
1972
+ continue;
1973
+ }
1974
+ delete objs[i];
1975
+ }
1976
+
1977
+ FXArray<FXDC*> dcs;
1978
+ #ifdef ST_BROKEN_PROTOTYPES
1979
+ st_foreach(appSensitiveDCs,st_cbfunc_dc,reinterpret_cast<st_data_t>(&dcs));
1980
+ #else
1981
+ st_foreach(appSensitiveDCs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_dc),reinterpret_cast<st_data_t>(&dcs));
1982
+ #endif
1983
+ for(FXint j=0;j<dcs.no();j++){
1984
+ delete dcs[j];
1985
+ }
1986
+
1987
+ FXTRACE((100,"%s:%d: Finished destroying objects that hold references to the FXApp.\n",__FILE__,__LINE__));
1988
+ }
1989
+
1990
+ //----------------------------------------------------------------------
1991
+
1992
+ extern "C" void Init_core(void);
1993
+ extern "C" void Init_dc(void);
1994
+ extern "C" void Init_dialogs(void);
1995
+ extern "C" void Init_frames(void);
1996
+ extern "C" void Init_fx3d(void);
1997
+ extern "C" void Init_image(void);
1998
+ extern "C" void Init_iconlist(void);
1999
+ extern "C" void Init_icons(void);
2000
+ extern "C" void Init_label(void);
2001
+ extern "C" void Init_layout(void);
2002
+ extern "C" void Init_list(void);
2003
+ extern "C" void Init_mdi(void);
2004
+ extern "C" void Init_menu(void);
2005
+ #ifdef WITH_FXSCINTILLA
2006
+ extern "C" void Init_scintilla(void);
2007
+ #endif
2008
+ extern "C" void Init_table(void);
2009
+ extern "C" void Init_text(void);
2010
+ extern "C" void Init_treelist(void);
2011
+ extern "C" void Init_ui(void);
2012
+
2013
+ #ifdef USE_RB_REQUIRE
2014
+ #define REQUIRE(fname) rb_require((fname))
2015
+ #else
2016
+ #define REQUIRE(fname) rb_funcall(rb_mKernel,rb_intern("require"),1,rb_str_new2((fname)))
2017
+ #endif
2018
+
2019
+ extern "C" void
2020
+ #if defined _WIN32
2021
+ __declspec(dllexport)
2022
+ #endif
2023
+ Init_fox16(void) {
2024
+ Init_core();
2025
+ Init_dc();
2026
+ Init_frames();
2027
+ Init_layout();
2028
+ Init_label();
2029
+ Init_ui();
2030
+ Init_iconlist();
2031
+ Init_list();
2032
+ Init_dialogs();
2033
+ Init_image();
2034
+ Init_icons();
2035
+ Init_menu();
2036
+ Init_mdi();
2037
+ Init_fx3d();
2038
+ #ifdef WITH_FXSCINTILLA
2039
+ Init_scintilla();
2040
+ #endif
2041
+ Init_table();
2042
+ Init_text();
2043
+ Init_treelist();
2044
+ REQUIRE("fox16/core");
2045
+ REQUIRE("fox16/dict");
2046
+ REQUIRE("fox16/settings");
2047
+ REQUIRE("fox16/iterators");
2048
+ REQUIRE("fox16/keys");
2049
+ REQUIRE("fox16/aliases");
2050
+ REQUIRE("fox16/responder2");
2051
+ REQUIRE("fox16/glgroup");
2052
+ REQUIRE("fox16/execute_nonmodal");
2053
+ REQUIRE("fox16/version");
2054
+ REQUIRE("fox16/kwargs");
2055
+ REQUIRE("fox16/exceptions_for_fxerror");
2056
+
2057
+ id_assocs=rb_intern("@assocs");
2058
+ id_backtrace=rb_intern("backtrace");
2059
+ id_cmp=rb_intern("<=>");
2060
+ id_begin=rb_intern("begin");
2061
+ id_end=rb_intern("end");
2062
+ id_exclude_endp=rb_intern("exclude_end?");
2063
+
2064
+ FXRuby_Objects=st_init_numtable();
2065
+ appSensitiveObjs=st_init_numtable();
2066
+ appSensitiveDCs=st_init_numtable();
2067
+ }