fxruby 1.6.27-x64-mingw32

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