fxrubi 1.6.22.pre1-x86-mingw32

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