fxruby 1.6.50 → 1.6.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/binary.yml +17 -0
  4. data/.github/workflows/ci.yml +13 -2
  5. data/Gemfile +7 -2
  6. data/History.md +14 -0
  7. data/Rakefile +28 -46
  8. data/doap.rdf +2 -2
  9. data/docs/Fox/Canvas/CanvasError.html +2 -2
  10. data/docs/Fox/Canvas/CircleShape.html +2 -2
  11. data/docs/Fox/Canvas/ImageShape.html +2 -2
  12. data/docs/Fox/Canvas/LineShape.html +2 -2
  13. data/docs/Fox/Canvas/PolygonShape.html +2 -2
  14. data/docs/Fox/Canvas/RectangleShape.html +2 -2
  15. data/docs/Fox/Canvas/SelectionPolicy.html +2 -2
  16. data/docs/Fox/Canvas/Shape.html +3 -3
  17. data/docs/Fox/Canvas/ShapeCanvas.html +2 -2
  18. data/docs/Fox/Canvas/ShapeGroup.html +2 -2
  19. data/docs/Fox/Canvas/SingleSelectionPolicy.html +2 -2
  20. data/docs/Fox/Canvas/TextShape.html +7 -9
  21. data/docs/Fox/Canvas.html +3 -3
  22. data/docs/Fox/FTNonModal.html +2 -2
  23. data/docs/Fox/FX4Splitter.html +41 -41
  24. data/docs/Fox/FX7Segment.html +5 -5
  25. data/docs/Fox/FXAccelTable.html +2 -2
  26. data/docs/Fox/FXApp.html +54 -54
  27. data/docs/Fox/FXArc.html +2 -2
  28. data/docs/Fox/FXArrowButton.html +22 -22
  29. data/docs/Fox/FXBMPIcon.html +10 -10
  30. data/docs/Fox/FXBMPImage.html +9 -9
  31. data/docs/Fox/FXBitmap.html +7 -7
  32. data/docs/Fox/FXBitmapFrame.html +3 -3
  33. data/docs/Fox/FXBitmapView.html +4 -4
  34. data/docs/Fox/FXButton.html +21 -21
  35. data/docs/Fox/FXCURCursor.html +2 -2
  36. data/docs/Fox/FXCalendar.html +4 -4
  37. data/docs/Fox/FXCanvas.html +7 -7
  38. data/docs/Fox/FXCheckButton.html +13 -13
  39. data/docs/Fox/FXChoiceBox.html +20 -20
  40. data/docs/Fox/FXColor.html +2 -2
  41. data/docs/Fox/FXColorBar.html +10 -10
  42. data/docs/Fox/FXColorDialog.html +7 -7
  43. data/docs/Fox/FXColorItem.html +2 -2
  44. data/docs/Fox/FXColorList.html +2 -2
  45. data/docs/Fox/FXColorRing.html +7 -7
  46. data/docs/Fox/FXColorSelector.html +36 -36
  47. data/docs/Fox/FXColorWell.html +19 -19
  48. data/docs/Fox/FXColorWheel.html +20 -20
  49. data/docs/Fox/FXComboBox.html +31 -31
  50. data/docs/Fox/FXComboTableItem.html +2 -2
  51. data/docs/Fox/FXCommand.html +2 -2
  52. data/docs/Fox/FXComposite.html +5 -5
  53. data/docs/Fox/FXCursor.html +14 -14
  54. data/docs/Fox/FXDC.html +207 -207
  55. data/docs/Fox/FXDCPrint.html +2 -2
  56. data/docs/Fox/FXDCWindow.html +2 -2
  57. data/docs/Fox/FXDataTarget.html +8 -8
  58. data/docs/Fox/FXDebugTarget.html +3 -3
  59. data/docs/Fox/FXDelegator.html +2 -2
  60. data/docs/Fox/FXDial.html +28 -28
  61. data/docs/Fox/FXDialogBox.html +5 -5
  62. data/docs/Fox/FXDict.html +2 -2
  63. data/docs/Fox/FXDirBox.html +7 -7
  64. data/docs/Fox/FXDirDialog.html +2 -2
  65. data/docs/Fox/FXDirItem.html +2 -2
  66. data/docs/Fox/FXDirList.html +19 -19
  67. data/docs/Fox/FXDirSelector.html +15 -15
  68. data/docs/Fox/FXDockBar.html +27 -27
  69. data/docs/Fox/FXDockHandler.html +5 -5
  70. data/docs/Fox/FXDockSite.html +14 -14
  71. data/docs/Fox/FXDockTitle.html +2 -2
  72. data/docs/Fox/FXDocument.html +5 -5
  73. data/docs/Fox/FXDragCorner.html +2 -2
  74. data/docs/Fox/FXDrawable.html +5 -5
  75. data/docs/Fox/FXDriveBox.html +5 -5
  76. data/docs/Fox/FXEvent.html +62 -60
  77. data/docs/Fox/FXExtentd.html +2 -2
  78. data/docs/Fox/FXExtentf.html +2 -2
  79. data/docs/Fox/FXFileAssoc.html +2 -2
  80. data/docs/Fox/FXFileDialog.html +32 -32
  81. data/docs/Fox/FXFileDict.html +7 -7
  82. data/docs/Fox/FXFileItem.html +2 -2
  83. data/docs/Fox/FXFileList.html +27 -27
  84. data/docs/Fox/FXFileSelector.html +35 -35
  85. data/docs/Fox/FXFileStream.html +6 -6
  86. data/docs/Fox/FXFoldingItem.html +2 -2
  87. data/docs/Fox/FXFoldingList.html +41 -41
  88. data/docs/Fox/FXFont.html +172 -170
  89. data/docs/Fox/FXFontDesc.html +2 -2
  90. data/docs/Fox/FXFontDialog.html +2 -2
  91. data/docs/Fox/FXFontSelector.html +14 -14
  92. data/docs/Fox/FXFrame.html +4 -4
  93. data/docs/Fox/FXGIFCursor.html +2 -2
  94. data/docs/Fox/FXGIFIcon.html +10 -10
  95. data/docs/Fox/FXGIFImage.html +9 -9
  96. data/docs/Fox/FXGLCanvas.html +2 -2
  97. data/docs/Fox/FXGLCone.html +2 -2
  98. data/docs/Fox/FXGLContext.html +2 -2
  99. data/docs/Fox/FXGLCube.html +2 -2
  100. data/docs/Fox/FXGLCylinder.html +2 -2
  101. data/docs/Fox/FXGLGroup.html +2 -2
  102. data/docs/Fox/FXGLLine.html +2 -2
  103. data/docs/Fox/FXGLObject.html +14 -14
  104. data/docs/Fox/FXGLPoint.html +2 -2
  105. data/docs/Fox/FXGLShape.html +26 -26
  106. data/docs/Fox/FXGLSphere.html +2 -2
  107. data/docs/Fox/FXGLViewer.html +74 -74
  108. data/docs/Fox/FXGLVisual.html +2 -2
  109. data/docs/Fox/FXGradient.html +2 -2
  110. data/docs/Fox/FXGradientBar.html +34 -34
  111. data/docs/Fox/FXGroupBox.html +7 -7
  112. data/docs/Fox/FXHeader.html +20 -20
  113. data/docs/Fox/FXHeaderItem.html +19 -19
  114. data/docs/Fox/FXHiliteStyle.html +2 -2
  115. data/docs/Fox/FXHorizontalFrame.html +15 -15
  116. data/docs/Fox/FXHorizontalSeparator.html +13 -13
  117. data/docs/Fox/FXICOIcon.html +10 -10
  118. data/docs/Fox/FXICOImage.html +9 -9
  119. data/docs/Fox/FXIcon.html +10 -10
  120. data/docs/Fox/FXIconDict.html +2 -2
  121. data/docs/Fox/FXIconItem.html +2 -2
  122. data/docs/Fox/FXIconList.html +43 -43
  123. data/docs/Fox/FXIconSource.html +2 -2
  124. data/docs/Fox/FXId.html +2 -2
  125. data/docs/Fox/FXImage.html +120 -297
  126. data/docs/Fox/FXImageFrame.html +14 -14
  127. data/docs/Fox/FXImageView.html +13 -13
  128. data/docs/Fox/FXInputDialog.html +7 -7
  129. data/docs/Fox/FXIrb.html +2 -2
  130. data/docs/Fox/FXJPGIcon.html +11 -11
  131. data/docs/Fox/FXJPGImage.html +10 -10
  132. data/docs/Fox/FXKnob.html +17 -17
  133. data/docs/Fox/FXLabel.html +25 -25
  134. data/docs/Fox/FXLight.html +2 -2
  135. data/docs/Fox/FXList.html +29 -29
  136. data/docs/Fox/FXListBox.html +8 -8
  137. data/docs/Fox/FXListItem.html +2 -2
  138. data/docs/Fox/FXMDIChild.html +21 -21
  139. data/docs/Fox/FXMDIClient.html +224 -28
  140. data/docs/Fox/FXMDIDeleteButton.html +2 -2
  141. data/docs/Fox/FXMDIMaximizeButton.html +2 -2
  142. data/docs/Fox/FXMDIMenu.html +2 -2
  143. data/docs/Fox/FXMDIMinimizeButton.html +2 -2
  144. data/docs/Fox/FXMDIRestoreButton.html +2 -2
  145. data/docs/Fox/FXMDIWindowButton.html +2 -2
  146. data/docs/Fox/FXMainWindow.html +4 -4
  147. data/docs/Fox/FXMaterial.html +2 -2
  148. data/docs/Fox/FXMatrix.html +5 -5
  149. data/docs/Fox/FXMemoryBuffer.html +4 -4
  150. data/docs/Fox/FXMemoryStream.html +8 -8
  151. data/docs/Fox/FXMenuBar.html +2 -2
  152. data/docs/Fox/FXMenuButton.html +24 -24
  153. data/docs/Fox/FXMenuCaption.html +5 -5
  154. data/docs/Fox/FXMenuCascade.html +2 -2
  155. data/docs/Fox/FXMenuCheck.html +4 -4
  156. data/docs/Fox/FXMenuCommand.html +4 -4
  157. data/docs/Fox/FXMenuPane.html +2 -2
  158. data/docs/Fox/FXMenuRadio.html +4 -4
  159. data/docs/Fox/FXMenuSeparator.html +2 -2
  160. data/docs/Fox/FXMenuTitle.html +7 -7
  161. data/docs/Fox/FXMessageBox.html +21 -21
  162. data/docs/Fox/FXObject.html +2 -2
  163. data/docs/Fox/FXOption.html +8 -8
  164. data/docs/Fox/FXOptionMenu.html +8 -8
  165. data/docs/Fox/FXPCXIcon.html +10 -10
  166. data/docs/Fox/FXPCXImage.html +9 -9
  167. data/docs/Fox/FXPNGIcon.html +10 -10
  168. data/docs/Fox/FXPNGImage.html +9 -9
  169. data/docs/Fox/FXPPMIcon.html +10 -10
  170. data/docs/Fox/FXPPMImage.html +9 -9
  171. data/docs/Fox/FXPSBounds.html +2 -2
  172. data/docs/Fox/FXPacker.html +2 -2
  173. data/docs/Fox/FXPicker.html +5 -5
  174. data/docs/Fox/FXPopup.html +6 -6
  175. data/docs/Fox/FXPrintDialog.html +23 -23
  176. data/docs/Fox/FXPrinter.html +22 -22
  177. data/docs/Fox/FXProgressBar.html +8 -8
  178. data/docs/Fox/FXProgressDialog.html +6 -6
  179. data/docs/Fox/FXPseudoKeyboard.html +2 -2
  180. data/docs/Fox/FXPseudoMouse.html +2 -2
  181. data/docs/Fox/FXPseudoTarget.html +2 -2
  182. data/docs/Fox/FXQuatd.html +19 -19
  183. data/docs/Fox/FXQuatf.html +24 -24
  184. data/docs/Fox/FXRGBIcon.html +10 -10
  185. data/docs/Fox/FXRGBImage.html +9 -9
  186. data/docs/Fox/FXRadioButton.html +12 -12
  187. data/docs/Fox/FXRanged.html +2 -2
  188. data/docs/Fox/FXRangef.html +2 -2
  189. data/docs/Fox/FXRealSlider.html +40 -40
  190. data/docs/Fox/FXRealSpinner.html +32 -32
  191. data/docs/Fox/FXRecentFiles.html +17 -17
  192. data/docs/Fox/FXRectangle.html +15 -15
  193. data/docs/Fox/FXRegion.html +2 -2
  194. data/docs/Fox/FXRegistry.html +2 -2
  195. data/docs/Fox/FXReplaceDialog.html +29 -29
  196. data/docs/Fox/FXRootWindow.html +5 -5
  197. data/docs/Fox/FXRuler.html +31 -31
  198. data/docs/Fox/FXRulerView.html +2 -2
  199. data/docs/Fox/FXScintilla.html +9116 -2763
  200. data/docs/Fox/FXScrollArea.html +21 -21
  201. data/docs/Fox/FXScrollBar.html +31 -31
  202. data/docs/Fox/FXScrollCorner.html +2 -2
  203. data/docs/Fox/FXScrollPane.html +6 -6
  204. data/docs/Fox/FXScrollWindow.html +9 -9
  205. data/docs/Fox/FXSearchDialog.html +11 -11
  206. data/docs/Fox/FXSegment.html +2 -2
  207. data/docs/Fox/FXSeparator.html +7 -7
  208. data/docs/Fox/FXSettings.html +56 -56
  209. data/docs/Fox/FXShell.html +2 -2
  210. data/docs/Fox/FXShutter.html +24 -24
  211. data/docs/Fox/FXShutterItem.html +19 -19
  212. data/docs/Fox/FXSize.html +12 -12
  213. data/docs/Fox/FXSlider.html +40 -40
  214. data/docs/Fox/FXSphered.html +2 -2
  215. data/docs/Fox/FXSpheref.html +2 -2
  216. data/docs/Fox/FXSpinner.html +31 -31
  217. data/docs/Fox/FXSplashScreen.html +3 -3
  218. data/docs/Fox/FXSplashWindow.html +7 -7
  219. data/docs/Fox/FXSplitter.html +22 -22
  220. data/docs/Fox/FXSpring.html +17 -17
  221. data/docs/Fox/FXStatusBar.html +17 -17
  222. data/docs/Fox/FXStatusLine.html +8 -8
  223. data/docs/Fox/FXStream.html +26 -26
  224. data/docs/Fox/FXStreamAllocError.html +2 -2
  225. data/docs/Fox/FXStreamEndError.html +2 -2
  226. data/docs/Fox/FXStreamError.html +2 -2
  227. data/docs/Fox/FXStreamFailureError.html +2 -2
  228. data/docs/Fox/FXStreamFormatError.html +2 -2
  229. data/docs/Fox/FXStreamFullError.html +2 -2
  230. data/docs/Fox/FXStreamNoReadError.html +2 -2
  231. data/docs/Fox/FXStreamNoWriteError.html +2 -2
  232. data/docs/Fox/FXStreamUnknownError.html +2 -2
  233. data/docs/Fox/FXStringDict.html +2 -2
  234. data/docs/Fox/FXSwitcher.html +30 -30
  235. data/docs/Fox/FXTGAIcon.html +10 -10
  236. data/docs/Fox/FXTGAImage.html +9 -9
  237. data/docs/Fox/FXTIFIcon.html +10 -10
  238. data/docs/Fox/FXTIFImage.html +9 -9
  239. data/docs/Fox/FXTabBar.html +37 -37
  240. data/docs/Fox/FXTabBook.html +15 -15
  241. data/docs/Fox/FXTabItem.html +27 -27
  242. data/docs/Fox/FXTable.html +89 -89
  243. data/docs/Fox/FXTableItem.html +6 -6
  244. data/docs/Fox/FXTablePos.html +2 -2
  245. data/docs/Fox/FXTableRange.html +2 -2
  246. data/docs/Fox/FXText.html +115 -115
  247. data/docs/Fox/FXTextChange.html +2 -2
  248. data/docs/Fox/FXTextField.html +55 -55
  249. data/docs/Fox/FXToggleButton.html +31 -31
  250. data/docs/Fox/FXToolBar.html +15 -15
  251. data/docs/Fox/FXToolBarGrip.html +14 -14
  252. data/docs/Fox/FXToolBarShell.html +11 -11
  253. data/docs/Fox/FXToolBarTab.html +21 -21
  254. data/docs/Fox/FXToolTip.html +12 -10
  255. data/docs/Fox/FXTopWindow.html +34 -34
  256. data/docs/Fox/FXTranslator.html +2 -2
  257. data/docs/Fox/FXTreeItem.html +2 -2
  258. data/docs/Fox/FXTreeList.html +41 -41
  259. data/docs/Fox/FXTreeListBox.html +23 -23
  260. data/docs/Fox/FXTriStateButton.html +21 -21
  261. data/docs/Fox/FXUndoList.html +3 -3
  262. data/docs/Fox/FXVec2d.html +2 -2
  263. data/docs/Fox/FXVec2f.html +2 -2
  264. data/docs/Fox/FXVec3d.html +2 -2
  265. data/docs/Fox/FXVec3f.html +2 -2
  266. data/docs/Fox/FXVec4d.html +2 -2
  267. data/docs/Fox/FXVec4f.html +2 -2
  268. data/docs/Fox/FXVerticalFrame.html +15 -15
  269. data/docs/Fox/FXVerticalSeparator.html +13 -13
  270. data/docs/Fox/FXViewport.html +2 -2
  271. data/docs/Fox/FXVisual.html +24 -24
  272. data/docs/Fox/FXWindow.html +143 -143
  273. data/docs/Fox/FXWizard.html +5 -5
  274. data/docs/Fox/FXXBMIcon.html +11 -11
  275. data/docs/Fox/FXXBMImage.html +10 -10
  276. data/docs/Fox/FXXPMIcon.html +10 -10
  277. data/docs/Fox/FXXPMImage.html +9 -9
  278. data/docs/Fox/NotifyHeader.html +2 -2
  279. data/docs/Fox/SCNotification.html +2 -2
  280. data/docs/Fox/TextRange.html +2 -2
  281. data/docs/Fox.html +89 -89
  282. data/docs/IRB.html +2 -2
  283. data/docs/Responder.html +2 -2
  284. data/docs/Responder2.html +2 -2
  285. data/docs/_index.html +2 -2
  286. data/docs/css/style.css +2 -15
  287. data/docs/file.History.html +1432 -842
  288. data/docs/file.README.html +9 -9
  289. data/docs/index.html +94 -53
  290. data/docs/js/app.js +91 -40
  291. data/docs/js/full_list.js +22 -20
  292. data/docs/method_list.html +2854 -2286
  293. data/docs/top-level-namespace.html +2 -2
  294. data/examples/canvasdemo.rb +4 -4
  295. data/examples/iconlist.rb +79 -4
  296. data/examples/inputs.rb +1 -1
  297. data/examples/rmagick.rb +9 -9
  298. data/ext/fox16_c/FXRbApp.cpp +2 -1
  299. data/ext/fox16_c/FXRbDataTarget.cpp +1 -0
  300. data/ext/fox16_c/FXRbGLViewer.cpp +1 -0
  301. data/ext/fox16_c/FXRbObjRegistry.cpp +12 -5
  302. data/ext/fox16_c/FXRuby.cpp +57 -37
  303. data/ext/fox16_c/core_wrap.cpp +2593 -2155
  304. data/ext/fox16_c/dc_wrap.cpp +1033 -707
  305. data/ext/fox16_c/dialogs_wrap.cpp +1865 -1513
  306. data/ext/fox16_c/extconf.rb +11 -8
  307. data/ext/fox16_c/frames_wrap.cpp +3257 -2876
  308. data/ext/fox16_c/fx3d_wrap.cpp +2170 -1780
  309. data/ext/fox16_c/gvl_wrappers.cpp +1 -0
  310. data/ext/fox16_c/iconlist_wrap.cpp +1209 -882
  311. data/ext/fox16_c/icons_wrap.cpp +1132 -775
  312. data/ext/fox16_c/image_wrap.cpp +1116 -756
  313. data/ext/fox16_c/impl.cpp +1 -0
  314. data/ext/fox16_c/include/FXRbDCWindow.h +1 -1
  315. data/ext/fox16_c/include/FXRuby.h +6 -6
  316. data/ext/fox16_c/label_wrap.cpp +1702 -1354
  317. data/ext/fox16_c/layout_wrap.cpp +1752 -1392
  318. data/ext/fox16_c/list_wrap.cpp +899 -572
  319. data/ext/fox16_c/make_impl.rb +1 -0
  320. data/ext/fox16_c/markfuncs.cpp +1 -0
  321. data/ext/fox16_c/mdi_wrap.cpp +1220 -881
  322. data/ext/fox16_c/menu_wrap.cpp +1402 -1057
  323. data/ext/fox16_c/scintilla_wrap.cpp +658 -337
  324. data/ext/fox16_c/swigruby.h +262 -119
  325. data/ext/fox16_c/table_wrap.cpp +1064 -741
  326. data/ext/fox16_c/text_wrap.cpp +1062 -741
  327. data/ext/fox16_c/treelist_wrap.cpp +1522 -1189
  328. data/ext/fox16_c/ui_wrap.cpp +3610 -3216
  329. data/ext/fox16_c/unregisterOwnedObjects.cpp +1 -0
  330. data/fxruby.gemspec +6 -1
  331. data/lib/fox16/canvas.rb +1 -1
  332. data/lib/fox16/core.rb +97 -26
  333. data/lib/fox16/undolist.rb +32 -32
  334. data/lib/fox16/version.rb +1 -1
  335. data/rdoc-sources/FXApp.rb +12 -0
  336. data/rdoc-sources/FXFont.rb +2 -0
  337. data/rdoc-sources/FXMDIClient.rb +15 -0
  338. data/scripts/iface.rb +1 -0
  339. data/swig-interfaces/FXScintilla.i +1 -1
  340. data/swig-interfaces/FXText.i +1 -1
  341. data/swig-interfaces/freefuncs.i +1 -0
  342. data/swig-interfaces/ruby-typemaps.i +19 -19
  343. data/test/TC_FXBMPImage.rb +1 -1
  344. data/test/TC_FXDC.rb +24 -0
  345. data/test/TC_FXMat4f.rb +23 -14
  346. data/test/TC_FXSize.rb +8 -4
  347. data/test/TS_All.rb +4 -0
  348. data.tar.gz.sig +0 -0
  349. metadata +18 -15
  350. metadata.gz.sig +0 -0
@@ -204,9 +204,9 @@
204
204
  </div>
205
205
 
206
206
  <div id="footer">
207
- Generated on Tue Mar 11 16:01:29 2025 by
207
+ Generated on Thu Mar 26 09:48:22 2026 by
208
208
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
209
- 0.9.37 (ruby-3.5.0).
209
+ 0.9.38 (ruby-4.0.0).
210
210
  </div>
211
211
 
212
212
  </div>
@@ -1,10 +1,10 @@
1
1
  require 'fox16'
2
2
  require 'fox16/canvas'
3
3
 
4
- include Fox
5
- include Canvas
4
+ class CanvasDemo < Fox::FXMainWindow
5
+ include Fox
6
+ include Canvas
6
7
 
7
- class CanvasDemo < FXMainWindow
8
8
  def initialize(app)
9
9
  # Initialize base class first
10
10
  super(app, "Canvas Demo", nil, nil, DECOR_ALL, 0, 0, 800, 600)
@@ -85,7 +85,7 @@ class CanvasDemo < FXMainWindow
85
85
  end
86
86
 
87
87
  if __FILE__ == $0
88
- app = FXApp.new("CanvasDemo", "FXRuby")
88
+ app = Fox::FXApp.new("CanvasDemo", "FXRuby")
89
89
  CanvasDemo.new(app)
90
90
  app.create
91
91
  app.run
data/examples/iconlist.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'fox16'
2
+ require 'uri'
2
3
 
3
4
  include Fox
4
5
 
@@ -47,14 +48,23 @@ class IconListWindow < FXMainWindow
47
48
  iconlist.appendHeader("User", nil, 50)
48
49
  iconlist.appendHeader("Group", nil, 50)
49
50
 
50
- big_folder = loadIcon("bigfolder.png")
51
- mini_folder = loadIcon("minifolder.png")
51
+ @big_folder = loadIcon("bigfolder.png")
52
+ @mini_folder = loadIcon("minifolder.png")
52
53
 
53
- iconlist.appendItem("Really BIG and wide item to test\tDocument\t10000\tJune 13, 1999\tUser\tSoftware", big_folder, mini_folder)
54
+ iconlist.appendItem("Really BIG and wide item to test\tDocument\t10000\tJune 13, 1999\tUser\tSoftware", @big_folder, @mini_folder)
54
55
  1.upto(400) do |i|
55
- iconlist.appendItem("Filename_#{i}\tDocument\t10000\tJune 13, 1999\tUser\tSoftware", big_folder, mini_folder)
56
+ iconlist.appendItem("Filename_#{i}\tDocument\t10000\tJune 13, 1999\tUser\tSoftware", @big_folder, @mini_folder)
56
57
  end
57
58
  iconlist.currentItem = iconlist.numItems - 1
59
+ @iconlist = iconlist
60
+
61
+ FXMenuPane.new(self) do |menuPane|
62
+ paste_icon = loadIcon("paste.png")
63
+ FXMenuCommand.new(menuPane, "&Insert from clipboard\tCtrl-V", paste_icon) do |mc|
64
+ mc.connect(SEL_COMMAND) { insert_from_clipboard }
65
+ end
66
+ FXMenuTitle.new(menubar, "&Edit", nil, menuPane)
67
+ end
58
68
 
59
69
  # Arrange menu
60
70
  FXMenuPane.new(self) do |menuPane|
@@ -67,6 +77,12 @@ class IconListWindow < FXMainWindow
67
77
  end
68
78
  # Let's see a tooltip
69
79
  FXToolTip.new(getApp())
80
+
81
+ # Register the drag types for copy files from the clipboard
82
+ @dragtype_urilist = app.registerDragType("text/uri-list")
83
+ @dragtype_filename = app.registerDragType("FileNameW")
84
+ @dragtype_filegroup = app.registerDragType("FileGroupDescriptorW")
85
+
70
86
  end
71
87
 
72
88
  # Overrides base class version
@@ -74,6 +90,65 @@ class IconListWindow < FXMainWindow
74
90
  super
75
91
  show(PLACEMENT_SCREEN)
76
92
  end
93
+
94
+ def get_clipboard_files
95
+ # Show the avaliable clipboard formats:
96
+ puts "Avaliable clipboard formats:"
97
+ type_ids = inquireDNDTypes(FROM_CLIPBOARD)
98
+ pp type_ids.map{|id| [id, app.getDragTypeName(id), getDNDData(FROM_CLIPBOARD, id)] }
99
+
100
+ # Process copied files with standard uri list (on Linux)
101
+ paths = getDNDData(FROM_CLIPBOARD, @dragtype_urilist)
102
+ if paths
103
+ files = paths.each_line.map do |file|
104
+ # file.chomp.sub(%r{^file://}, "")
105
+ URI.decode_uri_component(URI(file.chomp).path)
106
+ end
107
+ return files
108
+ end
109
+
110
+ # Process copied data from Windows Explorer
111
+ # This works for files only, but not for directories.
112
+ path = getDNDData(FROM_CLIPBOARD, @dragtype_filename)
113
+ filesdata = getDNDData(FROM_CLIPBOARD, @dragtype_filegroup)
114
+ if path && filesdata
115
+ path = path.encode("UTF-8", "UTF-16LE").rstrip("\0")
116
+ path = File.dirname(path)
117
+ cnt, rest = filesdata.unpack("Ia*")
118
+ files = cnt.times.map do
119
+ # Unpack the FILEGROUPDESCRIPTORW struct
120
+ # DWORD dwFlags;
121
+ # CLSID clsid;
122
+ # SIZEL sizel;
123
+ # POINTL pointl;
124
+ # DWORD dwFileAttributes;
125
+ # FILETIME ftCreationTime;
126
+ # FILETIME ftLastAccessTime;
127
+ # FILETIME ftLastWriteTime;
128
+ # DWORD nFileSizeHigh;
129
+ # DWORD nFileSizeLow;
130
+ # CHAR cFileName[MAX_PATH];
131
+ dwFlags, clsid, sizel, pointl, dwFileAttributes,
132
+ ftCreationTime, ftLastAccessTime, ftLastAccessTime,
133
+ nFileSizeHigh, nFileSizeLow, cFileName, rest =
134
+ rest.unpack("La16a8a8La8a8a8LLa520a*")
135
+ fname = cFileName.encode("UTF-8", "UTF-16LE").rstrip("\0")
136
+ File.join(path, fname)
137
+ end
138
+ return files
139
+ end
140
+ end
141
+
142
+ def insert_from_clipboard
143
+ files = get_clipboard_files
144
+
145
+ files&.each do |file|
146
+ ftype = File.ftype(file)
147
+ fsize = File.size(file)
148
+ mtime = File.mtime(file)
149
+ @iconlist.prependItem([file, ftype, fsize, mtime].join("\t"), @big_folder, @mini_folder)
150
+ end
151
+ end
77
152
  end
78
153
 
79
154
  if __FILE__ == $0
data/examples/inputs.rb CHANGED
@@ -21,7 +21,7 @@ class InputHandlerWindow < FXMainWindow
21
21
 
22
22
  # Output will be displayed in a multiline text area
23
23
  @cmdOutput = FXText.new(textFrame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
24
- @cmdInput.text = "ping rubyinstaller.org"
24
+ @cmdInput.text = "ping rubyinstaller.org -c4"
25
25
 
26
26
  # Initialize the pipe
27
27
  @pipe = nil
data/examples/rmagick.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require 'fox16'
2
2
  begin
3
- require 'RMagick'
3
+ require 'rmagick'
4
4
  rescue LoadError
5
- warn("LoadError: To execute this app you need to have 'RMagick' gem installed.")
5
+ warn("LoadError: To execute this app you need to have 'rmagick' gem installed.")
6
6
  sleep(5)
7
7
  exit(false)
8
8
  end
@@ -15,16 +15,16 @@ class RMagickExample < FXMainWindow
15
15
  super(app, "RMagick Example", :width => 800, :height => 600)
16
16
 
17
17
  # Construct an ImageList
18
- dippy = Magick::ImageList.new(File.join("icons", "dippy.png"))
18
+ dippy = Magick::ImageList.new(File.expand_path("icons/dippy.png", __dir__))
19
19
 
20
20
  # Manipulate the image
21
21
  text = Magick::Draw.new
22
- text.annotate(dippy, 0, 0, 0, 60, "Dippy Duck") do
23
- self.gravity = Magick::SouthGravity
24
- self.pointsize = 24
25
- self.stroke = 'transparent'
26
- self.fill = '#0000A9'
27
- self.font_weight = Magick::BoldWeight
22
+ text.annotate(dippy, 0, 0, 0, 60, "Dippy Duck") do |a|
23
+ a.gravity = Magick::SouthGravity
24
+ a.pointsize = 24
25
+ a.stroke = 'transparent'
26
+ a.fill = '#80C0A9'
27
+ a.font_weight = Magick::BoldWeight
28
28
  end
29
29
 
30
30
  # Extract image data and use it to construct FXPNGImage
@@ -24,6 +24,7 @@
24
24
  * $Id: FXRbApp.cpp 2902 2008-12-11 14:09:20Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
+ #include "swigruby.h"
27
28
  #include "FXRbCommon.h"
28
29
 
29
30
  #ifdef HAVE_SYS_TIME_H
@@ -171,7 +172,7 @@ FXRbApp::~FXRbApp(){
171
172
  FXRbDestroyAppSensitiveObjects();
172
173
  myRegistry=FXRbGetRubyObj(&(reg()),true);
173
174
  if(!NIL_P(myRegistry)){
174
- DATA_PTR(myRegistry)=0;
175
+ FXRbConvertPtr(myRegistry, FXRbTypeQuery("FXApp *"), SWIG_POINTER_RELEASE);
175
176
  }
176
177
  FXRbUnregisterRubyObj(this);
177
178
  }
@@ -24,6 +24,7 @@
24
24
  * $Id: FXRbDataTarget.cpp 2713 2007-11-14 15:27:36Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
+ #include "swigruby.h"
27
28
  #include "FXRbCommon.h"
28
29
 
29
30
  /**
@@ -24,6 +24,7 @@
24
24
  * $Id: FXRbGLViewer.cpp 2190 2005-08-24 07:58:47Z lyle $
25
25
  ***********************************************************************/
26
26
 
27
+ #include "swigruby.h"
27
28
  #include "FXRbCommon.h"
28
29
 
29
30
  // Process picks
@@ -20,9 +20,9 @@
20
20
  * at "lars@greiz-reinsdorf.de".
21
21
  ***********************************************************************/
22
22
 
23
+ #include "swigruby.h"
23
24
  #include "FXRbCommon.h"
24
25
  #include "FXRbObjRegistry.h"
25
- #include "swigruby.h"
26
26
 
27
27
  FXRbObjRegistry::FXRbObjRegistry(){
28
28
  FXRuby_Objects=st_init_numtable();
@@ -31,7 +31,7 @@ FXRbObjRegistry::FXRbObjRegistry(){
31
31
  const char * FXRbObjRegistry::safe_rb_obj_classname(VALUE obj)
32
32
  {
33
33
  int tdata = TYPE(obj)==T_DATA;
34
- if( (tdata && IsInGC(DATA_PTR(obj)))
34
+ if( (tdata && IsInGC(FXRbConvertPtr(obj, NULL, 0)))
35
35
  #ifdef HAVE_RB_DURING_GC
36
36
  || rb_during_gc()
37
37
  #endif
@@ -52,7 +52,7 @@ VALUE FXRbObjRegistry::NewBorrowedObj(void *ptr,swig_type_info* ty){
52
52
  ObjDesc *desc;
53
53
 
54
54
  if(FXMALLOC(&desc,ObjDesc,1)){
55
- VALUE obj = SWIG_Ruby_NewPointerObj(ptr,ty,1);
55
+ VALUE obj = SWIG_Ruby_NewPointerObj(ptr,ty,SWIG_POINTER_OWN);
56
56
  FXTRACE((1,"FXRbNewPointerObj(foxObj=%p) => rubyObj=%p (%s)\n",ptr,(void *)obj,safe_rb_obj_classname(obj)));
57
57
  desc->obj = obj;
58
58
  desc->type = borrowed;
@@ -84,7 +84,7 @@ void FXRbObjRegistry::RegisterRubyObj(VALUE rubyObj,const void* foxObj) {
84
84
  * To avoid double references to the same foxObj from different Ruby objects,
85
85
  * we decouple the foxObj from previoius ruby object and point to the new one.
86
86
  */
87
- DATA_PTR(desc->obj) = 0;
87
+ FXRbConvertPtr(desc->obj, NULL, SWIG_POINTER_RELEASE);
88
88
  desc->obj = rubyObj;
89
89
  desc->type = own;
90
90
  } else {
@@ -107,7 +107,14 @@ void FXRbObjRegistry::UnregisterRubyObj(const void* foxObj, bool alsoOwned){
107
107
  if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
108
108
  if( !alsoOwned && desc->type!=borrowed ) return;
109
109
  FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)desc->obj,safe_rb_obj_classname(desc->obj),foxObj));
110
- DATA_PTR(desc->obj)=0;
110
+
111
+ /* Release unless it's already T_ZOMBIE */
112
+ if(RB_TYPE_P(desc->obj, RUBY_T_DATA)) {
113
+ int res = SWIG_ConvertPtr(desc->obj, NULL, NULL, SWIG_POINTER_CLEAR);
114
+ if (res != SWIG_OK){
115
+ rb_bug( "UnregisterRubyObj(rubyObj=%p) error: %d", (void*)desc->obj, res);
116
+ }
117
+ }
111
118
  FXFREE(&desc);
112
119
  st_delete(FXRuby_Objects,reinterpret_cast<st_data_t *>(const_cast<void**>(&foxObj)),reinterpret_cast<st_data_t *>(0));
113
120
  FXASSERT(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(0))==0);
@@ -28,13 +28,13 @@
28
28
  #pragma warning (disable : 4786)
29
29
  #endif
30
30
 
31
+ // SWIG runtime functions we need
32
+ #include "swigruby.h"
33
+
31
34
  #include "FXRbCommon.h"
32
35
  #include "FXRbObjRegistry.h"
33
36
  #include "impl.h"
34
37
 
35
- // SWIG runtime functions we need
36
- #include "swigruby.h"
37
-
38
38
  #ifdef __CYGWIN__
39
39
  #include <io.h> // for get_osf_handle()
40
40
  #endif
@@ -74,7 +74,7 @@ VALUE FXRbNewPointerObj(void *ptr,swig_type_info* ty){
74
74
  }
75
75
 
76
76
  VALUE FXRbNewPointerObjCb(void *ptr,swig_type_info* ty){
77
- return SWIG_Ruby_NewPointerObj(ptr, ty, 1);
77
+ return SWIG_Ruby_NewPointerObj(ptr, ty, SWIG_POINTER_OWN);
78
78
  }
79
79
 
80
80
 
@@ -126,7 +126,7 @@ void FXRbUnregisterRubyObj(const void* foxObj){
126
126
  * They are free'd by libfox when the owning fox object gets destroyed.
127
127
  * Only the ruby wrapper is GC'ed.
128
128
  * They are registered in FXRbObjRegistry as borrowed object.
129
- * They are built per FXGetRubyObj().
129
+ * They are built per FXRbGetRubyObj().
130
130
  *
131
131
  * Callback objects :
132
132
  * This is the new type.
@@ -135,7 +135,7 @@ void FXRbUnregisterRubyObj(const void* foxObj){
135
135
  * They are not registered in FXRbObjRegistry, but stored on the stack only.
136
136
  * Therefore callback objects aren't re-used, but newly wrapped for each call.
137
137
  * The same goes for arguments to ruby blocks.
138
- * They are built per FXGetRubyObjCb().
138
+ * They are built per FXRbGetRubyObjCb().
139
139
  */
140
140
 
141
141
  /**
@@ -232,7 +232,7 @@ void FXRbGcMark(void *obj){
232
232
  * is to mark any Ruby reference this object, "borrowed" or not;
233
233
  * so the 2nd argument to FXRbGetRubyObj() is now true.
234
234
  *
235
- * If you feel compelled to change this back to FXGetRubyObj(obj,false),
235
+ * If you feel compelled to change this back to FXRbGetRubyObj(obj,false),
236
236
  * please think about it first. Especially make sure that the shutter.rb
237
237
  * example program works if you invoke the GC in ShutterWindow#create;
238
238
  * make sure that the shutter items' contents don't get blown away!
@@ -335,7 +335,7 @@ FXuint FXRbNumberOfFXColors(VALUE string_or_ary){
335
335
  }else{
336
336
  Check_Type(string_or_ary,T_STRING);
337
337
  if(RSTRING_LEN(string_or_ary) % sizeof(FXColor) != 0 )
338
- rb_raise( rb_eArgError, "String size is no multiple of %lu", sizeof(FXColor) );
338
+ rb_raise( rb_eArgError, "String size is no multiple of %zu", sizeof(FXColor) );
339
339
  len = RSTRING_LEN(string_or_ary) / sizeof(FXColor);
340
340
  }
341
341
  return len;
@@ -842,8 +842,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
842
842
  FXushort id=FXSELID(key);
843
843
 
844
844
  // Extract the FOX object (the receiver) from this Ruby instance
845
- FXObject* obj;
846
- Data_Get_Struct(recv,FXObject,obj);
845
+ FXObject *obj = (FXObject*)FXRbConvertPtr(recv, NULL, 0);
847
846
 
848
847
  FXASSERT(type!=SEL_NONE);
849
848
  FXASSERT(type!=SEL_LAST);
@@ -896,7 +895,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
896
895
  case SEL_DND_MOTION:
897
896
  case SEL_DND_REQUEST:
898
897
  case SEL_PICKED:
899
- SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
898
+ SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),SWIG_POINTER_DISOWN);
900
899
  return ptr;
901
900
  case SEL_IO_READ:
902
901
  case SEL_IO_WRITE:
@@ -1072,7 +1071,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1072
1071
 
1073
1072
  if(type==SEL_CHANGED){
1074
1073
  if(obj->isMemberOf(FXMETACLASS(FXPicker))){
1075
- SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXPoint *"),1);
1074
+ SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXPoint *"),SWIG_POINTER_DISOWN);
1076
1075
  return ptr;
1077
1076
  }
1078
1077
  if(obj->isMemberOf(FXMETACLASS(FXWindow))){
@@ -1086,7 +1085,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1086
1085
  }
1087
1086
 
1088
1087
  if(type==SEL_DRAGGED){
1089
- SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
1088
+ SWIG_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),SWIG_POINTER_DISOWN);
1090
1089
  return ptr;
1091
1090
  }
1092
1091
 
@@ -1185,8 +1184,8 @@ long FXRbHandleMessage_gvlcb(FXObject* recv,ID func,FXObject* sender,FXSelector
1185
1184
  FXTRACE((100,"FXRbHandleMessage(recv=%p(%s),FXSEL(%s,%d)\n",recv,recv->getClassName(),FXDebugTarget::messageTypeName[FXSELTYPE(key)],FXSELID(key)));
1186
1185
 
1187
1186
  if(FXRbCatchExceptions){
1188
- retval=rb_rescue2(RUBY_VALUE_METHOD_FUNC(handle_body), reinterpret_cast<VALUE>(&hArgs),
1189
- RUBY_VALUE_METHOD_FUNC(handle_rescue), Qnil,
1187
+ retval=rb_rescue2(handle_body, reinterpret_cast<VALUE>(&hArgs),
1188
+ handle_rescue, Qnil,
1190
1189
  rb_eStandardError, rb_eNameError, 0);
1191
1190
  }
1192
1191
  else{
@@ -1300,21 +1299,21 @@ FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func){
1300
1299
  VALUE obj=FXRbGetRubyObj(recv,false);
1301
1300
  FXASSERT(!NIL_P(obj));
1302
1301
  VALUE result=rb_funcall(obj,rb_intern(func),0);
1303
- return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1302
+ return (FXGLObject*)FXRbConvertPtr(result, NULL, 0);
1304
1303
  }
1305
1304
 
1306
1305
  FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLViewer* recv,const char *func,FXint x,FXint y){
1307
1306
  VALUE obj=FXRbGetRubyObj(recv,false);
1308
1307
  FXASSERT(!NIL_P(obj));
1309
1308
  VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
1310
- return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1309
+ return (FXGLObject*)FXRbConvertPtr(result, NULL, 0);
1311
1310
  }
1312
1311
 
1313
1312
  FXGLObject* FXRbCallGLObjectMethod_gvlcb(FXGLObject* recv,const char *func,FXuint* path,FXint n){
1314
1313
  VALUE obj=FXRbGetRubyObj(recv,false);
1315
1314
  FXASSERT(!NIL_P(obj));
1316
1315
  VALUE result=rb_funcall(obj,rb_intern(func),1,FXRbMakeArray(path,n));
1317
- return NIL_P(result) ? 0 : reinterpret_cast<FXGLObject*>(DATA_PTR(result));
1316
+ return (FXGLObject*)FXRbConvertPtr(result, NULL, 0);
1318
1317
  }
1319
1318
 
1320
1319
  //----------------------------------------------------------------------
@@ -1329,7 +1328,8 @@ FXGLObject** FXRbCallGLObjectArrayMethod_gvlcb(FXGLViewer* recv,const char *func
1329
1328
  Check_Type(result,T_ARRAY);
1330
1329
  if(FXMALLOC(&objects,FXGLObject*,RARRAY_LEN(result)+1)){
1331
1330
  for(long i=0; i<RARRAY_LEN(result); i++){
1332
- objects[i]=reinterpret_cast<FXGLObject*>(DATA_PTR(rb_ary_entry(result,i)));
1331
+ VALUE entry = rb_ary_entry(result,i);
1332
+ objects[i]=(FXGLObject*)FXRbConvertPtr(entry, NULL, 0);
1333
1333
  }
1334
1334
  objects[RARRAY_LEN(result)]=0;
1335
1335
  }
@@ -1344,14 +1344,14 @@ FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,const
1344
1344
  VALUE obj=FXRbGetRubyObj(recv,false);
1345
1345
  FXASSERT(!NIL_P(obj));
1346
1346
  VALUE result=rb_funcall(obj,rb_intern(func),3,to_ruby(text),to_ruby_cb(icon),itemData);
1347
- return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
1347
+ return (FXTableItem*)FXRbConvertPtr(result, NULL, 0);
1348
1348
  }
1349
1349
 
1350
1350
  FXTableItem* FXRbCallTableItemMethod_gvlcb(FXTable* recv,const char *func,FXint row,FXint col,FXbool notify){
1351
1351
  VALUE obj=FXRbGetRubyObj(recv,false);
1352
1352
  FXASSERT(!NIL_P(obj));
1353
1353
  VALUE result=rb_funcall(obj,rb_intern(func),3,to_ruby(row),to_ruby(col),to_ruby(notify));
1354
- return NIL_P(result)?0:reinterpret_cast<FXTableItem*>(DATA_PTR(result));
1354
+ return (FXTableItem*)FXRbConvertPtr(result, NULL, 0);
1355
1355
  }
1356
1356
 
1357
1357
  //----------------------------------------------------------------------
@@ -1360,7 +1360,7 @@ FXTreeItem* FXRbCallTreeItemMethod_gvlcb(const FXTreeList* recv,const char *func
1360
1360
  VALUE obj=FXRbGetRubyObj(recv,false);
1361
1361
  FXASSERT(!NIL_P(obj));
1362
1362
  VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
1363
- return NIL_P(result) ? 0 : reinterpret_cast<FXTreeItem*>(DATA_PTR(result));
1363
+ return (FXTreeItem*)FXRbConvertPtr(result, NULL, 0);
1364
1364
  }
1365
1365
 
1366
1366
  //----------------------------------------------------------------------
@@ -1369,7 +1369,7 @@ FXFoldingItem* FXRbCallFoldingItemMethod_gvlcb(const FXFoldingList* recv,const c
1369
1369
  VALUE obj=FXRbGetRubyObj(recv,false);
1370
1370
  FXASSERT(!NIL_P(obj));
1371
1371
  VALUE result=rb_funcall(obj,rb_intern(func),2,INT2NUM(x),INT2NUM(y));
1372
- return NIL_P(result) ? 0 : reinterpret_cast<FXFoldingItem*>(DATA_PTR(result));
1372
+ return (FXFoldingItem*)FXRbConvertPtr(result, NULL, 0);
1373
1373
  }
1374
1374
 
1375
1375
  //----------------------------------------------------------------------
@@ -1378,7 +1378,7 @@ FXFileAssoc* FXRbCallFileAssocMethod_gvlcb(const FXFileDict* recv,const char *fu
1378
1378
  VALUE obj=FXRbGetRubyObj(recv,false);
1379
1379
  FXASSERT(!NIL_P(obj));
1380
1380
  VALUE result=rb_funcall(obj,rb_intern(func),1,to_ruby(pathname));
1381
- return NIL_P(result) ? 0 : reinterpret_cast<FXFileAssoc*>(DATA_PTR(result));
1381
+ return (FXFileAssoc*)FXRbConvertPtr(result, NULL, 0);
1382
1382
  }
1383
1383
 
1384
1384
  //----------------------------------------------------------------------
@@ -1388,7 +1388,7 @@ FXIcon* FXRbCallIconMethod_gvlcb(const FXTableItem* recv,const char *func){
1388
1388
  FXASSERT(!NIL_P(obj));
1389
1389
  if(!NIL_P(obj)){
1390
1390
  VALUE result=rb_funcall(obj,rb_intern(func),0);
1391
- return NIL_P(result) ? 0 : reinterpret_cast<FXIcon*>(DATA_PTR(result));
1391
+ return (FXIcon*)FXRbConvertPtr(result, NULL, 0);
1392
1392
  }
1393
1393
  else{
1394
1394
  return 0;
@@ -1401,7 +1401,7 @@ FXWindow* FXRbCallWindowMethod_gvlcb(const FXTableItem* recv,const char *func,FX
1401
1401
  VALUE obj=FXRbGetRubyObj(recv,false);
1402
1402
  FXASSERT(!NIL_P(obj));
1403
1403
  VALUE result=rb_funcall(obj,rb_intern(func),1,to_ruby_cb(table));
1404
- return NIL_P(result) ? 0 : reinterpret_cast<FXWindow*>(DATA_PTR(result));
1404
+ return (FXWindow*)FXRbConvertPtr(result, NULL, 0);
1405
1405
  }
1406
1406
 
1407
1407
  //----------------------------------------------------------------------
@@ -1411,7 +1411,7 @@ FXRangef FXRbCallRangeMethod_gvlcb(FXObject* recv,const char *func){
1411
1411
  VALUE obj=FXRbGetRubyObj(recv,false);
1412
1412
  FXASSERT(!NIL_P(obj));
1413
1413
  VALUE result=rb_funcall(obj,rb_intern(func),0);
1414
- return *reinterpret_cast<FXRangef*>(DATA_PTR(result));
1414
+ return *(FXRangef*)FXRbConvertPtr(result, NULL, 0);
1415
1415
  }
1416
1416
 
1417
1417
  //----------------------------------------------------------------------
@@ -1606,11 +1606,34 @@ FXbool FXRbGLViewer::sortProc(FXfloat*& buffer,FXint& used,FXint& size){
1606
1606
  * FXRbConvertPtr() is just a wrapper around SWIG_ConvertPtr().
1607
1607
  */
1608
1608
 
1609
- void* FXRbConvertPtr(VALUE obj,swig_type_info* ty){
1609
+ void* FXRbConvertPtr(VALUE obj,swig_type_info* ty, int flags){
1610
1610
  void *ptr;
1611
- SWIG_ConvertPtr(obj,&ptr,ty,1);
1612
- return ptr;
1611
+ int res = SWIG_ConvertPtr(obj,&ptr,ty,flags);
1612
+ if( res == SWIG_OK ) return ptr;
1613
+ #ifdef HAVE_RB_DURING_GC
1614
+ if( rb_during_gc() ){
1615
+ rb_bug( "FXRbConvertPtr got wrong argument type rubyObj=%p", (void*)obj);
1616
+ }
1617
+ #endif
1618
+ if( res == SWIG_ERROR_RELEASE_NOT_OWNED ){
1619
+ rb_raise( rb_eTypeError, "clean and disown of non-owned object is not allowed: %" PRIsVALUE, obj);
1620
+ }
1621
+ if( res == SWIG_NullReferenceError ){
1622
+ rb_raise( rb_eTypeError, "object can not be NULL: %" PRIsVALUE, obj);
1623
+ }
1624
+ if( res == SWIG_ObjectPreviouslyDeletedError ){
1625
+ if(ty){
1626
+ rb_raise( rb_eTypeError, "the object has already been deleted: %" PRIsVALUE, ((swig_class *) (ty->clientdata))->klass);
1627
+ } else {
1628
+ rb_raise( rb_eTypeError, "the object has already been deleted");
1629
+ }
1613
1630
  }
1631
+ if(ty){
1632
+ rb_raise( rb_eTypeError, "wrong argument type %" PRIsVALUE ", expected kind of %" PRIsVALUE, rb_obj_class(obj), ((swig_class *) (ty->clientdata))->klass );
1633
+ } else {
1634
+ rb_raise( rb_eTypeError, "wrong argument type %" PRIsVALUE, rb_obj_class(obj) );
1635
+ }
1636
+ }
1614
1637
 
1615
1638
 
1616
1639
  // Returns an FXInputHandle for this Ruby file object
@@ -1652,11 +1675,8 @@ FXInputHandle FXRbGetWriteFileHandle(VALUE obj,FXuint mode) {
1652
1675
  if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
1653
1676
  fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1654
1677
  #else
1655
- rb_io_t *fptr;
1656
- GetOpenFile(obj, fptr);
1657
- VALUE wrio = fptr->tied_io_for_writing;
1658
- if(wrio) obj = wrio;
1659
- fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1678
+ VALUE wrio = rb_io_get_write_io(obj);
1679
+ fd = FIX2INT(rb_funcall(wrio, rb_intern("fileno"), 0));
1660
1680
  #endif
1661
1681
  #ifdef WIN32
1662
1682
  #ifdef __CYGWIN__
@@ -1909,7 +1929,7 @@ void FXRbDestroyAppSensitiveObjects(){
1909
1929
  FXTRACE((100,"%s:%d: Begin destroying objects that hold references to the FXApp...\n",__FILE__,__LINE__));
1910
1930
 
1911
1931
  FXObjectListOf<FXObject> objs;
1912
- st_foreach(appSensitiveObjs,RUBY_INT_METHOD_FUNC(st_cbfunc_obj),reinterpret_cast<st_data_t>(&objs));
1932
+ st_foreach(appSensitiveObjs,st_cbfunc_obj,reinterpret_cast<st_data_t>(&objs));
1913
1933
  for(FXint i=0;i<objs.no();i++){
1914
1934
  if(objs[i]->isMemberOf(FXMETACLASS(FXRbCursor))){
1915
1935
  if(dynamic_cast<FXRbCursor*>(objs[i])->ownedByApp)
@@ -1939,7 +1959,7 @@ void FXRbDestroyAppSensitiveObjects(){
1939
1959
  }
1940
1960
 
1941
1961
  FXArray<FXDC*> dcs;
1942
- st_foreach(appSensitiveDCs,RUBY_INT_METHOD_FUNC(st_cbfunc_dc),reinterpret_cast<st_data_t>(&dcs));
1962
+ st_foreach(appSensitiveDCs,st_cbfunc_dc,reinterpret_cast<st_data_t>(&dcs));
1943
1963
  for(FXint j=0;j<dcs.no();j++){
1944
1964
  delete dcs[j];
1945
1965
  }