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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/binary.yml +17 -0
- data/.github/workflows/ci.yml +13 -2
- data/Gemfile +7 -2
- data/History.md +14 -0
- data/Rakefile +28 -46
- data/doap.rdf +2 -2
- data/docs/Fox/Canvas/CanvasError.html +2 -2
- data/docs/Fox/Canvas/CircleShape.html +2 -2
- data/docs/Fox/Canvas/ImageShape.html +2 -2
- data/docs/Fox/Canvas/LineShape.html +2 -2
- data/docs/Fox/Canvas/PolygonShape.html +2 -2
- data/docs/Fox/Canvas/RectangleShape.html +2 -2
- data/docs/Fox/Canvas/SelectionPolicy.html +2 -2
- data/docs/Fox/Canvas/Shape.html +3 -3
- data/docs/Fox/Canvas/ShapeCanvas.html +2 -2
- data/docs/Fox/Canvas/ShapeGroup.html +2 -2
- data/docs/Fox/Canvas/SingleSelectionPolicy.html +2 -2
- data/docs/Fox/Canvas/TextShape.html +7 -9
- data/docs/Fox/Canvas.html +3 -3
- data/docs/Fox/FTNonModal.html +2 -2
- data/docs/Fox/FX4Splitter.html +41 -41
- data/docs/Fox/FX7Segment.html +5 -5
- data/docs/Fox/FXAccelTable.html +2 -2
- data/docs/Fox/FXApp.html +54 -54
- data/docs/Fox/FXArc.html +2 -2
- data/docs/Fox/FXArrowButton.html +22 -22
- data/docs/Fox/FXBMPIcon.html +10 -10
- data/docs/Fox/FXBMPImage.html +9 -9
- data/docs/Fox/FXBitmap.html +7 -7
- data/docs/Fox/FXBitmapFrame.html +3 -3
- data/docs/Fox/FXBitmapView.html +4 -4
- data/docs/Fox/FXButton.html +21 -21
- data/docs/Fox/FXCURCursor.html +2 -2
- data/docs/Fox/FXCalendar.html +4 -4
- data/docs/Fox/FXCanvas.html +7 -7
- data/docs/Fox/FXCheckButton.html +13 -13
- data/docs/Fox/FXChoiceBox.html +20 -20
- data/docs/Fox/FXColor.html +2 -2
- data/docs/Fox/FXColorBar.html +10 -10
- data/docs/Fox/FXColorDialog.html +7 -7
- data/docs/Fox/FXColorItem.html +2 -2
- data/docs/Fox/FXColorList.html +2 -2
- data/docs/Fox/FXColorRing.html +7 -7
- data/docs/Fox/FXColorSelector.html +36 -36
- data/docs/Fox/FXColorWell.html +19 -19
- data/docs/Fox/FXColorWheel.html +20 -20
- data/docs/Fox/FXComboBox.html +31 -31
- data/docs/Fox/FXComboTableItem.html +2 -2
- data/docs/Fox/FXCommand.html +2 -2
- data/docs/Fox/FXComposite.html +5 -5
- data/docs/Fox/FXCursor.html +14 -14
- data/docs/Fox/FXDC.html +207 -207
- data/docs/Fox/FXDCPrint.html +2 -2
- data/docs/Fox/FXDCWindow.html +2 -2
- data/docs/Fox/FXDataTarget.html +8 -8
- data/docs/Fox/FXDebugTarget.html +3 -3
- data/docs/Fox/FXDelegator.html +2 -2
- data/docs/Fox/FXDial.html +28 -28
- data/docs/Fox/FXDialogBox.html +5 -5
- data/docs/Fox/FXDict.html +2 -2
- data/docs/Fox/FXDirBox.html +7 -7
- data/docs/Fox/FXDirDialog.html +2 -2
- data/docs/Fox/FXDirItem.html +2 -2
- data/docs/Fox/FXDirList.html +19 -19
- data/docs/Fox/FXDirSelector.html +15 -15
- data/docs/Fox/FXDockBar.html +27 -27
- data/docs/Fox/FXDockHandler.html +5 -5
- data/docs/Fox/FXDockSite.html +14 -14
- data/docs/Fox/FXDockTitle.html +2 -2
- data/docs/Fox/FXDocument.html +5 -5
- data/docs/Fox/FXDragCorner.html +2 -2
- data/docs/Fox/FXDrawable.html +5 -5
- data/docs/Fox/FXDriveBox.html +5 -5
- data/docs/Fox/FXEvent.html +62 -60
- data/docs/Fox/FXExtentd.html +2 -2
- data/docs/Fox/FXExtentf.html +2 -2
- data/docs/Fox/FXFileAssoc.html +2 -2
- data/docs/Fox/FXFileDialog.html +32 -32
- data/docs/Fox/FXFileDict.html +7 -7
- data/docs/Fox/FXFileItem.html +2 -2
- data/docs/Fox/FXFileList.html +27 -27
- data/docs/Fox/FXFileSelector.html +35 -35
- data/docs/Fox/FXFileStream.html +6 -6
- data/docs/Fox/FXFoldingItem.html +2 -2
- data/docs/Fox/FXFoldingList.html +41 -41
- data/docs/Fox/FXFont.html +172 -170
- data/docs/Fox/FXFontDesc.html +2 -2
- data/docs/Fox/FXFontDialog.html +2 -2
- data/docs/Fox/FXFontSelector.html +14 -14
- data/docs/Fox/FXFrame.html +4 -4
- data/docs/Fox/FXGIFCursor.html +2 -2
- data/docs/Fox/FXGIFIcon.html +10 -10
- data/docs/Fox/FXGIFImage.html +9 -9
- data/docs/Fox/FXGLCanvas.html +2 -2
- data/docs/Fox/FXGLCone.html +2 -2
- data/docs/Fox/FXGLContext.html +2 -2
- data/docs/Fox/FXGLCube.html +2 -2
- data/docs/Fox/FXGLCylinder.html +2 -2
- data/docs/Fox/FXGLGroup.html +2 -2
- data/docs/Fox/FXGLLine.html +2 -2
- data/docs/Fox/FXGLObject.html +14 -14
- data/docs/Fox/FXGLPoint.html +2 -2
- data/docs/Fox/FXGLShape.html +26 -26
- data/docs/Fox/FXGLSphere.html +2 -2
- data/docs/Fox/FXGLViewer.html +74 -74
- data/docs/Fox/FXGLVisual.html +2 -2
- data/docs/Fox/FXGradient.html +2 -2
- data/docs/Fox/FXGradientBar.html +34 -34
- data/docs/Fox/FXGroupBox.html +7 -7
- data/docs/Fox/FXHeader.html +20 -20
- data/docs/Fox/FXHeaderItem.html +19 -19
- data/docs/Fox/FXHiliteStyle.html +2 -2
- data/docs/Fox/FXHorizontalFrame.html +15 -15
- data/docs/Fox/FXHorizontalSeparator.html +13 -13
- data/docs/Fox/FXICOIcon.html +10 -10
- data/docs/Fox/FXICOImage.html +9 -9
- data/docs/Fox/FXIcon.html +10 -10
- data/docs/Fox/FXIconDict.html +2 -2
- data/docs/Fox/FXIconItem.html +2 -2
- data/docs/Fox/FXIconList.html +43 -43
- data/docs/Fox/FXIconSource.html +2 -2
- data/docs/Fox/FXId.html +2 -2
- data/docs/Fox/FXImage.html +120 -297
- data/docs/Fox/FXImageFrame.html +14 -14
- data/docs/Fox/FXImageView.html +13 -13
- data/docs/Fox/FXInputDialog.html +7 -7
- data/docs/Fox/FXIrb.html +2 -2
- data/docs/Fox/FXJPGIcon.html +11 -11
- data/docs/Fox/FXJPGImage.html +10 -10
- data/docs/Fox/FXKnob.html +17 -17
- data/docs/Fox/FXLabel.html +25 -25
- data/docs/Fox/FXLight.html +2 -2
- data/docs/Fox/FXList.html +29 -29
- data/docs/Fox/FXListBox.html +8 -8
- data/docs/Fox/FXListItem.html +2 -2
- data/docs/Fox/FXMDIChild.html +21 -21
- data/docs/Fox/FXMDIClient.html +224 -28
- data/docs/Fox/FXMDIDeleteButton.html +2 -2
- data/docs/Fox/FXMDIMaximizeButton.html +2 -2
- data/docs/Fox/FXMDIMenu.html +2 -2
- data/docs/Fox/FXMDIMinimizeButton.html +2 -2
- data/docs/Fox/FXMDIRestoreButton.html +2 -2
- data/docs/Fox/FXMDIWindowButton.html +2 -2
- data/docs/Fox/FXMainWindow.html +4 -4
- data/docs/Fox/FXMaterial.html +2 -2
- data/docs/Fox/FXMatrix.html +5 -5
- data/docs/Fox/FXMemoryBuffer.html +4 -4
- data/docs/Fox/FXMemoryStream.html +8 -8
- data/docs/Fox/FXMenuBar.html +2 -2
- data/docs/Fox/FXMenuButton.html +24 -24
- data/docs/Fox/FXMenuCaption.html +5 -5
- data/docs/Fox/FXMenuCascade.html +2 -2
- data/docs/Fox/FXMenuCheck.html +4 -4
- data/docs/Fox/FXMenuCommand.html +4 -4
- data/docs/Fox/FXMenuPane.html +2 -2
- data/docs/Fox/FXMenuRadio.html +4 -4
- data/docs/Fox/FXMenuSeparator.html +2 -2
- data/docs/Fox/FXMenuTitle.html +7 -7
- data/docs/Fox/FXMessageBox.html +21 -21
- data/docs/Fox/FXObject.html +2 -2
- data/docs/Fox/FXOption.html +8 -8
- data/docs/Fox/FXOptionMenu.html +8 -8
- data/docs/Fox/FXPCXIcon.html +10 -10
- data/docs/Fox/FXPCXImage.html +9 -9
- data/docs/Fox/FXPNGIcon.html +10 -10
- data/docs/Fox/FXPNGImage.html +9 -9
- data/docs/Fox/FXPPMIcon.html +10 -10
- data/docs/Fox/FXPPMImage.html +9 -9
- data/docs/Fox/FXPSBounds.html +2 -2
- data/docs/Fox/FXPacker.html +2 -2
- data/docs/Fox/FXPicker.html +5 -5
- data/docs/Fox/FXPopup.html +6 -6
- data/docs/Fox/FXPrintDialog.html +23 -23
- data/docs/Fox/FXPrinter.html +22 -22
- data/docs/Fox/FXProgressBar.html +8 -8
- data/docs/Fox/FXProgressDialog.html +6 -6
- data/docs/Fox/FXPseudoKeyboard.html +2 -2
- data/docs/Fox/FXPseudoMouse.html +2 -2
- data/docs/Fox/FXPseudoTarget.html +2 -2
- data/docs/Fox/FXQuatd.html +19 -19
- data/docs/Fox/FXQuatf.html +24 -24
- data/docs/Fox/FXRGBIcon.html +10 -10
- data/docs/Fox/FXRGBImage.html +9 -9
- data/docs/Fox/FXRadioButton.html +12 -12
- data/docs/Fox/FXRanged.html +2 -2
- data/docs/Fox/FXRangef.html +2 -2
- data/docs/Fox/FXRealSlider.html +40 -40
- data/docs/Fox/FXRealSpinner.html +32 -32
- data/docs/Fox/FXRecentFiles.html +17 -17
- data/docs/Fox/FXRectangle.html +15 -15
- data/docs/Fox/FXRegion.html +2 -2
- data/docs/Fox/FXRegistry.html +2 -2
- data/docs/Fox/FXReplaceDialog.html +29 -29
- data/docs/Fox/FXRootWindow.html +5 -5
- data/docs/Fox/FXRuler.html +31 -31
- data/docs/Fox/FXRulerView.html +2 -2
- data/docs/Fox/FXScintilla.html +9116 -2763
- data/docs/Fox/FXScrollArea.html +21 -21
- data/docs/Fox/FXScrollBar.html +31 -31
- data/docs/Fox/FXScrollCorner.html +2 -2
- data/docs/Fox/FXScrollPane.html +6 -6
- data/docs/Fox/FXScrollWindow.html +9 -9
- data/docs/Fox/FXSearchDialog.html +11 -11
- data/docs/Fox/FXSegment.html +2 -2
- data/docs/Fox/FXSeparator.html +7 -7
- data/docs/Fox/FXSettings.html +56 -56
- data/docs/Fox/FXShell.html +2 -2
- data/docs/Fox/FXShutter.html +24 -24
- data/docs/Fox/FXShutterItem.html +19 -19
- data/docs/Fox/FXSize.html +12 -12
- data/docs/Fox/FXSlider.html +40 -40
- data/docs/Fox/FXSphered.html +2 -2
- data/docs/Fox/FXSpheref.html +2 -2
- data/docs/Fox/FXSpinner.html +31 -31
- data/docs/Fox/FXSplashScreen.html +3 -3
- data/docs/Fox/FXSplashWindow.html +7 -7
- data/docs/Fox/FXSplitter.html +22 -22
- data/docs/Fox/FXSpring.html +17 -17
- data/docs/Fox/FXStatusBar.html +17 -17
- data/docs/Fox/FXStatusLine.html +8 -8
- data/docs/Fox/FXStream.html +26 -26
- data/docs/Fox/FXStreamAllocError.html +2 -2
- data/docs/Fox/FXStreamEndError.html +2 -2
- data/docs/Fox/FXStreamError.html +2 -2
- data/docs/Fox/FXStreamFailureError.html +2 -2
- data/docs/Fox/FXStreamFormatError.html +2 -2
- data/docs/Fox/FXStreamFullError.html +2 -2
- data/docs/Fox/FXStreamNoReadError.html +2 -2
- data/docs/Fox/FXStreamNoWriteError.html +2 -2
- data/docs/Fox/FXStreamUnknownError.html +2 -2
- data/docs/Fox/FXStringDict.html +2 -2
- data/docs/Fox/FXSwitcher.html +30 -30
- data/docs/Fox/FXTGAIcon.html +10 -10
- data/docs/Fox/FXTGAImage.html +9 -9
- data/docs/Fox/FXTIFIcon.html +10 -10
- data/docs/Fox/FXTIFImage.html +9 -9
- data/docs/Fox/FXTabBar.html +37 -37
- data/docs/Fox/FXTabBook.html +15 -15
- data/docs/Fox/FXTabItem.html +27 -27
- data/docs/Fox/FXTable.html +89 -89
- data/docs/Fox/FXTableItem.html +6 -6
- data/docs/Fox/FXTablePos.html +2 -2
- data/docs/Fox/FXTableRange.html +2 -2
- data/docs/Fox/FXText.html +115 -115
- data/docs/Fox/FXTextChange.html +2 -2
- data/docs/Fox/FXTextField.html +55 -55
- data/docs/Fox/FXToggleButton.html +31 -31
- data/docs/Fox/FXToolBar.html +15 -15
- data/docs/Fox/FXToolBarGrip.html +14 -14
- data/docs/Fox/FXToolBarShell.html +11 -11
- data/docs/Fox/FXToolBarTab.html +21 -21
- data/docs/Fox/FXToolTip.html +12 -10
- data/docs/Fox/FXTopWindow.html +34 -34
- data/docs/Fox/FXTranslator.html +2 -2
- data/docs/Fox/FXTreeItem.html +2 -2
- data/docs/Fox/FXTreeList.html +41 -41
- data/docs/Fox/FXTreeListBox.html +23 -23
- data/docs/Fox/FXTriStateButton.html +21 -21
- data/docs/Fox/FXUndoList.html +3 -3
- data/docs/Fox/FXVec2d.html +2 -2
- data/docs/Fox/FXVec2f.html +2 -2
- data/docs/Fox/FXVec3d.html +2 -2
- data/docs/Fox/FXVec3f.html +2 -2
- data/docs/Fox/FXVec4d.html +2 -2
- data/docs/Fox/FXVec4f.html +2 -2
- data/docs/Fox/FXVerticalFrame.html +15 -15
- data/docs/Fox/FXVerticalSeparator.html +13 -13
- data/docs/Fox/FXViewport.html +2 -2
- data/docs/Fox/FXVisual.html +24 -24
- data/docs/Fox/FXWindow.html +143 -143
- data/docs/Fox/FXWizard.html +5 -5
- data/docs/Fox/FXXBMIcon.html +11 -11
- data/docs/Fox/FXXBMImage.html +10 -10
- data/docs/Fox/FXXPMIcon.html +10 -10
- data/docs/Fox/FXXPMImage.html +9 -9
- data/docs/Fox/NotifyHeader.html +2 -2
- data/docs/Fox/SCNotification.html +2 -2
- data/docs/Fox/TextRange.html +2 -2
- data/docs/Fox.html +89 -89
- data/docs/IRB.html +2 -2
- data/docs/Responder.html +2 -2
- data/docs/Responder2.html +2 -2
- data/docs/_index.html +2 -2
- data/docs/css/style.css +2 -15
- data/docs/file.History.html +1432 -842
- data/docs/file.README.html +9 -9
- data/docs/index.html +94 -53
- data/docs/js/app.js +91 -40
- data/docs/js/full_list.js +22 -20
- data/docs/method_list.html +2854 -2286
- data/docs/top-level-namespace.html +2 -2
- data/examples/canvasdemo.rb +4 -4
- data/examples/iconlist.rb +79 -4
- data/examples/inputs.rb +1 -1
- data/examples/rmagick.rb +9 -9
- data/ext/fox16_c/FXRbApp.cpp +2 -1
- data/ext/fox16_c/FXRbDataTarget.cpp +1 -0
- data/ext/fox16_c/FXRbGLViewer.cpp +1 -0
- data/ext/fox16_c/FXRbObjRegistry.cpp +12 -5
- data/ext/fox16_c/FXRuby.cpp +57 -37
- data/ext/fox16_c/core_wrap.cpp +2593 -2155
- data/ext/fox16_c/dc_wrap.cpp +1033 -707
- data/ext/fox16_c/dialogs_wrap.cpp +1865 -1513
- data/ext/fox16_c/extconf.rb +11 -8
- data/ext/fox16_c/frames_wrap.cpp +3257 -2876
- data/ext/fox16_c/fx3d_wrap.cpp +2170 -1780
- data/ext/fox16_c/gvl_wrappers.cpp +1 -0
- data/ext/fox16_c/iconlist_wrap.cpp +1209 -882
- data/ext/fox16_c/icons_wrap.cpp +1132 -775
- data/ext/fox16_c/image_wrap.cpp +1116 -756
- data/ext/fox16_c/impl.cpp +1 -0
- data/ext/fox16_c/include/FXRbDCWindow.h +1 -1
- data/ext/fox16_c/include/FXRuby.h +6 -6
- data/ext/fox16_c/label_wrap.cpp +1702 -1354
- data/ext/fox16_c/layout_wrap.cpp +1752 -1392
- data/ext/fox16_c/list_wrap.cpp +899 -572
- data/ext/fox16_c/make_impl.rb +1 -0
- data/ext/fox16_c/markfuncs.cpp +1 -0
- data/ext/fox16_c/mdi_wrap.cpp +1220 -881
- data/ext/fox16_c/menu_wrap.cpp +1402 -1057
- data/ext/fox16_c/scintilla_wrap.cpp +658 -337
- data/ext/fox16_c/swigruby.h +262 -119
- data/ext/fox16_c/table_wrap.cpp +1064 -741
- data/ext/fox16_c/text_wrap.cpp +1062 -741
- data/ext/fox16_c/treelist_wrap.cpp +1522 -1189
- data/ext/fox16_c/ui_wrap.cpp +3610 -3216
- data/ext/fox16_c/unregisterOwnedObjects.cpp +1 -0
- data/fxruby.gemspec +6 -1
- data/lib/fox16/canvas.rb +1 -1
- data/lib/fox16/core.rb +97 -26
- data/lib/fox16/undolist.rb +32 -32
- data/lib/fox16/version.rb +1 -1
- data/rdoc-sources/FXApp.rb +12 -0
- data/rdoc-sources/FXFont.rb +2 -0
- data/rdoc-sources/FXMDIClient.rb +15 -0
- data/scripts/iface.rb +1 -0
- data/swig-interfaces/FXScintilla.i +1 -1
- data/swig-interfaces/FXText.i +1 -1
- data/swig-interfaces/freefuncs.i +1 -0
- data/swig-interfaces/ruby-typemaps.i +19 -19
- data/test/TC_FXBMPImage.rb +1 -1
- data/test/TC_FXDC.rb +24 -0
- data/test/TC_FXMat4f.rb +23 -14
- data/test/TC_FXSize.rb +8 -4
- data/test/TS_All.rb +4 -0
- data.tar.gz.sig +0 -0
- metadata +18 -15
- metadata.gz.sig +0 -0
|
@@ -204,9 +204,9 @@
|
|
|
204
204
|
</div>
|
|
205
205
|
|
|
206
206
|
<div id="footer">
|
|
207
|
-
Generated on
|
|
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.
|
|
209
|
+
0.9.38 (ruby-4.0.0).
|
|
210
210
|
</div>
|
|
211
211
|
|
|
212
212
|
</div>
|
data/examples/canvasdemo.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require 'fox16'
|
|
2
2
|
require 'fox16/canvas'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
include
|
|
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 '
|
|
3
|
+
require 'rmagick'
|
|
4
4
|
rescue LoadError
|
|
5
|
-
warn("LoadError: To execute this app you need to have '
|
|
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.
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
data/ext/fox16_c/FXRbApp.cpp
CHANGED
|
@@ -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
|
-
|
|
175
|
+
FXRbConvertPtr(myRegistry, FXRbTypeQuery("FXApp *"), SWIG_POINTER_RELEASE);
|
|
175
176
|
}
|
|
176
177
|
FXRbUnregisterRubyObj(this);
|
|
177
178
|
}
|
|
@@ -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(
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
data/ext/fox16_c/FXRuby.cpp
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
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
|
|
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 %
|
|
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*
|
|
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 *"),
|
|
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 *"),
|
|
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 *"),
|
|
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(
|
|
1189
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 *
|
|
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,
|
|
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
|
-
|
|
1656
|
-
|
|
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,
|
|
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,
|
|
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
|
}
|