├── .gemtest ├── docs ├── css │ └── common.css └── frames.html ├── web └── images │ ├── dots.jpg │ ├── menu.jpg │ ├── page.gif │ ├── quote.gif │ ├── bullet.gif │ ├── comment.gif │ ├── content.jpg │ ├── footer.jpg │ ├── header.png │ ├── button-bg.jpg │ ├── fxruby-book.jpg │ └── square-green.png ├── examples ├── icons │ ├── Net.ico │ ├── big.png │ ├── copy.png │ ├── cut.png │ ├── fox.png │ ├── help.png │ ├── kill.png │ ├── prop.png │ ├── redo.png │ ├── undo.png │ ├── zoom.png │ ├── FatBot.ico │ ├── LeGoon.ico │ ├── camera.png │ ├── dippy.png │ ├── fonts.png │ ├── hello2.png │ ├── indent.png │ ├── jbevel.png │ ├── jmiter.png │ ├── jround.png │ ├── light.png │ ├── paste.png │ ├── saveas.png │ ├── small.png │ ├── winapp.png │ ├── RedMacOS.ico │ ├── SawBlade.ico │ ├── backview.png │ ├── bigfolder.png │ ├── capbutt.png │ ├── capproj.png │ ├── capround.png │ ├── colorpal.png │ ├── delimit.png │ ├── filenew.png │ ├── fileopen.png │ ├── filesave.png │ ├── foxicon.png │ ├── frontview.png │ ├── gem_big.png │ ├── gem_small.png │ ├── leftview.png │ ├── minidoc.png │ ├── newfolder.png │ ├── nolight.png │ ├── palette.png │ ├── parallel.png │ ├── pattern.png │ ├── penguin.png │ ├── printicon.png │ ├── rightview.png │ ├── shutter1.png │ ├── shutter2.png │ ├── tbuplevel.png │ ├── topview.png │ ├── bigpenguin.png │ ├── bottomview.png │ ├── capnotlast.png │ ├── double_dash.png │ ├── filesaveas.png │ ├── minifolder.png │ ├── onoff_dash.png │ ├── perspective.png │ ├── smoothlight.png │ ├── solid_line.png │ ├── FlippedySwitch.ico │ ├── minifolderopen.png │ ├── bluebullet14x14.gif │ ├── AngryGuyInBunnySuit.ico │ └── transpbullet14x14.gif ├── hello.rb ├── unicode.rb ├── rulerview.rb ├── RAA.rb ├── charts.rb └── rmagick.rb ├── lib ├── fox16 │ ├── version.rb │ ├── settings.rb │ ├── missingdep.rb │ ├── exceptions_for_fxerror.rb │ ├── dict.rb │ ├── pseudokeyboard.rb │ └── thread.rb └── fox16.rb ├── ext └── fox16_c │ ├── include │ ├── FXRbDrawableVirtuals.h │ ├── FXRbShutterVirtuals.h │ ├── FXRbSpinnerVirtuals.h │ ├── FXRbDialogBoxVirtuals.h │ ├── FXRbRealSpinnerVirtuals.h │ ├── FXRbTabBarVirtuals.h │ ├── FXRbListBoxVirtuals.h │ ├── FXRbTreeListBoxVirtuals.h │ ├── FXRbTranslatorVirtuals.h │ ├── FXRbCursorVirtuals.h │ ├── FXRbPopupVirtuals.h │ ├── FXRbGLShapeVirtuals.h │ ├── FXRbIdVirtuals.h │ ├── FXRbStreamVirtuals.h │ ├── FXRbObjectVirtuals.h │ ├── FXRbGLViewerVirtuals.h │ ├── FXRbFileDictVirtuals.h │ ├── FXRbGLCanvasVirtuals.h │ ├── FXRbDockBarVirtuals.h │ ├── FXRbMDIChildVirtuals.h │ ├── FXRbScrollAreaVirtuals.h │ ├── FXRbAppVirtuals.h │ ├── FXRbMDIClientVirtuals.h │ ├── FXRbDockSiteVirtuals.h │ ├── FXRbTopWindowVirtuals.h │ ├── FXRbHeaderItemVirtuals.h │ ├── FXRbGLObjectVirtuals.h │ ├── FXRbListItemVirtuals.h │ ├── FXRbListVirtuals.h │ ├── FXRbBitmapVirtuals.h │ ├── FXRbIconListVirtuals.h │ ├── FXRbFoldingItemVirtuals.h │ └── FXRbTreeItemVirtuals.h │ └── gvl_wrappers.cpp ├── test ├── TC_FXStream.rb ├── TC_FXMenuCommand.rb ├── TS_All.rb ├── TC_FXBMPIcon.rb ├── TC_FXXBMIcon.rb ├── TC_FXXBMImage.rb ├── TC_FXXPMIcon.rb ├── TC_FXXPMImage.rb ├── TC_FXDialogBox.rb ├── TC_downcast.rb ├── TC_FXId.rb ├── TC_FXDCWindow.rb ├── TC_FXExtentd.rb ├── TC_FXExtentf.rb ├── TC_FXSegment.rb ├── TC_FXMainWindow.rb ├── TC_FXHiliteStyle.rb ├── TC_FXDirList.rb ├── TC_FXWindow.rb ├── TC_FXArc.rb ├── TC_FXScrollWindow.rb ├── TC_FXBMPImage.rb ├── README ├── TC_FXGLGroup.rb ├── TC_FXDataTarget.rb ├── TC_FXGLShape.rb ├── TC_FXShell.rb ├── TC_FXScrollArea.rb ├── TC_FXSettings.rb ├── TC_FXFoldingList.rb ├── TC_FXViewport.rb ├── TC_FXMessageBox.rb ├── TC_FXRanged.rb ├── TC_FXRangef.rb ├── TC_FXUndoList.rb ├── TC_FXLight.rb ├── TC_FXRegistry.rb ├── testcase.rb ├── TC_FXTopWindow.rb ├── TC_FXTableItem.rb ├── TC_FXGLViewer.rb ├── TC_FXJPGImage.rb ├── TC_FXTreeListBox.rb ├── TC_FXListBox.rb ├── TC_FXIconDict.rb ├── TC_FXFontDesc.rb ├── TC_FXRegion.rb ├── stress2.rb ├── TC_FXMenuCheck.rb ├── TC_FXMenuRadio.rb ├── TC_FXRadioButton.rb ├── TC_FXCheckButton.rb └── TC_FXPoint.rb ├── rdoc-sources ├── FXShell.rb ├── FXMenuPane.rb ├── FXCURCursor.rb ├── FXFontDialog.rb ├── FXRootWindow.rb ├── FXMenuCascade.rb ├── FXDragCorner.rb ├── FXMenuSeparator.rb ├── FXDocument.rb ├── FXDebugTarget.rb ├── FXDrawable.rb ├── FXDelegator.rb ├── FXTranslator.rb ├── FXCanvas.rb ├── FXSearchDialog.rb ├── FXMemoryBuffer.rb ├── FXMenuCommand.rb ├── FXGIFImage.rb ├── FXBMPImage.rb ├── FXFileStream.rb ├── FXICOImage.rb ├── FXPCXImage.rb ├── FXTGAImage.rb ├── FXDockHandler.rb ├── FXDockTitle.rb ├── FXRGBImage.rb ├── FXXPMImage.rb ├── FXPPMImage.rb ├── FXId.rb ├── FXScrollPane.rb ├── FXGIFIcon.rb ├── FXMenuBar.rb ├── FXFontSelector.rb ├── FXObject.rb ├── FXXBMImage.rb ├── FXPNGImage.rb ├── FXMenuTitle.rb ├── FXMenuCheck.rb ├── FXPrintDialog.rb ├── FXStringDict.rb ├── FXPPMIcon.rb ├── FXPicker.rb ├── FXTIFImage.rb ├── FXSplashWindow.rb ├── FXComposite.rb ├── FXJPGImage.rb ├── FXBitmapFrame.rb ├── FXMainWindow.rb ├── FXToolTip.rb ├── FXXBMIcon.rb ├── FXMenuRadio.rb ├── FXImageView.rb ├── FXProgressDialog.rb ├── FXGroupBox.rb ├── FXDCWindow.rb ├── FXPopup.rb ├── FXColorDialog.rb ├── FXDriveBox.rb ├── FXToolBarShell.rb ├── FXMenuCaption.rb ├── FXVerticalFrame.rb ├── FXHorizontalFrame.rb ├── FXImageFrame.rb ├── FXDirDialog.rb ├── FXGLContext.rb └── FXStatusBar.rb ├── fox-includes ├── README ├── fxver.h ├── FXCP437Codec.h ├── FXCP852Codec.h ├── FXCP855Codec.h ├── FXCP856Codec.h ├── FXCP857Codec.h ├── FXCP860Codec.h ├── FXCP861Codec.h ├── FXCP862Codec.h ├── FXCP863Codec.h ├── FXCP864Codec.h ├── FXCP865Codec.h ├── FXCP866Codec.h ├── FXCP869Codec.h ├── FXCP874Codec.h ├── FX88591Codec.h ├── FX88592Codec.h ├── FX88593Codec.h ├── FX88594Codec.h ├── FX88595Codec.h ├── FX88596Codec.h ├── FX88597Codec.h ├── FX88598Codec.h ├── FX88599Codec.h ├── FXCP850Codec.h ├── FXCP1250Codec.h ├── FXCP1251Codec.h ├── FXCP1252Codec.h ├── FXCP1253Codec.h ├── FXCP1254Codec.h ├── FXCP1255Codec.h ├── FXCP1256Codec.h ├── FXCP1257Codec.h ├── FXCP1258Codec.h ├── FX885910Codec.h ├── FX885911Codec.h ├── FX885913Codec.h ├── FX885914Codec.h ├── FX885915Codec.h ├── FX885916Codec.h └── FXKOI8RCodec.h ├── .yardopts ├── swig-interfaces ├── ignore-message-handlers.rb ├── README ├── text-module.i ├── FXURL.i ├── dcmodule.i └── table-module.i ├── .gitignore ├── Gemfile ├── .travis.yml ├── index.html ├── scripts └── build-fox.rb └── appveyor.yml /.gemtest: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/css/common.css: -------------------------------------------------------------------------------- 1 | /* Override this file with custom rules */ -------------------------------------------------------------------------------- /web/images/dots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/dots.jpg -------------------------------------------------------------------------------- /web/images/menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/menu.jpg -------------------------------------------------------------------------------- /web/images/page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/page.gif -------------------------------------------------------------------------------- /web/images/quote.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/quote.gif -------------------------------------------------------------------------------- /examples/icons/Net.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/Net.ico -------------------------------------------------------------------------------- /examples/icons/big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/big.png -------------------------------------------------------------------------------- /examples/icons/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/copy.png -------------------------------------------------------------------------------- /examples/icons/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/cut.png -------------------------------------------------------------------------------- /examples/icons/fox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/fox.png -------------------------------------------------------------------------------- /examples/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/help.png -------------------------------------------------------------------------------- /examples/icons/kill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/kill.png -------------------------------------------------------------------------------- /examples/icons/prop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/prop.png -------------------------------------------------------------------------------- /examples/icons/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/redo.png -------------------------------------------------------------------------------- /examples/icons/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/undo.png -------------------------------------------------------------------------------- /examples/icons/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/zoom.png -------------------------------------------------------------------------------- /lib/fox16/version.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | def Fox.fxrubyversion 3 | "1.6.49" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /web/images/bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/bullet.gif -------------------------------------------------------------------------------- /web/images/comment.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/comment.gif -------------------------------------------------------------------------------- /web/images/content.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/content.jpg -------------------------------------------------------------------------------- /web/images/footer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/footer.jpg -------------------------------------------------------------------------------- /web/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/header.png -------------------------------------------------------------------------------- /examples/icons/FatBot.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/FatBot.ico -------------------------------------------------------------------------------- /examples/icons/LeGoon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/LeGoon.ico -------------------------------------------------------------------------------- /examples/icons/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/camera.png -------------------------------------------------------------------------------- /examples/icons/dippy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/dippy.png -------------------------------------------------------------------------------- /examples/icons/fonts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/fonts.png -------------------------------------------------------------------------------- /examples/icons/hello2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/hello2.png -------------------------------------------------------------------------------- /examples/icons/indent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/indent.png -------------------------------------------------------------------------------- /examples/icons/jbevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/jbevel.png -------------------------------------------------------------------------------- /examples/icons/jmiter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/jmiter.png -------------------------------------------------------------------------------- /examples/icons/jround.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/jround.png -------------------------------------------------------------------------------- /examples/icons/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/light.png -------------------------------------------------------------------------------- /examples/icons/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/paste.png -------------------------------------------------------------------------------- /examples/icons/saveas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/saveas.png -------------------------------------------------------------------------------- /examples/icons/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/small.png -------------------------------------------------------------------------------- /examples/icons/winapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/winapp.png -------------------------------------------------------------------------------- /web/images/button-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/button-bg.jpg -------------------------------------------------------------------------------- /examples/icons/RedMacOS.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/RedMacOS.ico -------------------------------------------------------------------------------- /examples/icons/SawBlade.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/SawBlade.ico -------------------------------------------------------------------------------- /examples/icons/backview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/backview.png -------------------------------------------------------------------------------- /examples/icons/bigfolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/bigfolder.png -------------------------------------------------------------------------------- /examples/icons/capbutt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/capbutt.png -------------------------------------------------------------------------------- /examples/icons/capproj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/capproj.png -------------------------------------------------------------------------------- /examples/icons/capround.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/capround.png -------------------------------------------------------------------------------- /examples/icons/colorpal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/colorpal.png -------------------------------------------------------------------------------- /examples/icons/delimit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/delimit.png -------------------------------------------------------------------------------- /examples/icons/filenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/filenew.png -------------------------------------------------------------------------------- /examples/icons/fileopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/fileopen.png -------------------------------------------------------------------------------- /examples/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/filesave.png -------------------------------------------------------------------------------- /examples/icons/foxicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/foxicon.png -------------------------------------------------------------------------------- /examples/icons/frontview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/frontview.png -------------------------------------------------------------------------------- /examples/icons/gem_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/gem_big.png -------------------------------------------------------------------------------- /examples/icons/gem_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/gem_small.png -------------------------------------------------------------------------------- /examples/icons/leftview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/leftview.png -------------------------------------------------------------------------------- /examples/icons/minidoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/minidoc.png -------------------------------------------------------------------------------- /examples/icons/newfolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/newfolder.png -------------------------------------------------------------------------------- /examples/icons/nolight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/nolight.png -------------------------------------------------------------------------------- /examples/icons/palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/palette.png -------------------------------------------------------------------------------- /examples/icons/parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/parallel.png -------------------------------------------------------------------------------- /examples/icons/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/pattern.png -------------------------------------------------------------------------------- /examples/icons/penguin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/penguin.png -------------------------------------------------------------------------------- /examples/icons/printicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/printicon.png -------------------------------------------------------------------------------- /examples/icons/rightview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/rightview.png -------------------------------------------------------------------------------- /examples/icons/shutter1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/shutter1.png -------------------------------------------------------------------------------- /examples/icons/shutter2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/shutter2.png -------------------------------------------------------------------------------- /examples/icons/tbuplevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/tbuplevel.png -------------------------------------------------------------------------------- /examples/icons/topview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/topview.png -------------------------------------------------------------------------------- /web/images/fxruby-book.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/fxruby-book.jpg -------------------------------------------------------------------------------- /web/images/square-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/web/images/square-green.png -------------------------------------------------------------------------------- /examples/icons/bigpenguin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/bigpenguin.png -------------------------------------------------------------------------------- /examples/icons/bottomview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/bottomview.png -------------------------------------------------------------------------------- /examples/icons/capnotlast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/capnotlast.png -------------------------------------------------------------------------------- /examples/icons/double_dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/double_dash.png -------------------------------------------------------------------------------- /examples/icons/filesaveas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/filesaveas.png -------------------------------------------------------------------------------- /examples/icons/minifolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/minifolder.png -------------------------------------------------------------------------------- /examples/icons/onoff_dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/onoff_dash.png -------------------------------------------------------------------------------- /examples/icons/perspective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/perspective.png -------------------------------------------------------------------------------- /examples/icons/smoothlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/smoothlight.png -------------------------------------------------------------------------------- /examples/icons/solid_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/solid_line.png -------------------------------------------------------------------------------- /examples/icons/FlippedySwitch.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/FlippedySwitch.ico -------------------------------------------------------------------------------- /examples/icons/minifolderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/minifolderopen.png -------------------------------------------------------------------------------- /examples/icons/bluebullet14x14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/bluebullet14x14.gif -------------------------------------------------------------------------------- /examples/icons/AngryGuyInBunnySuit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/AngryGuyInBunnySuit.ico -------------------------------------------------------------------------------- /examples/icons/transpbullet14x14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/larskanis/fxruby/HEAD/examples/icons/transpbullet14x14.gif -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbDrawableVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of resize() 3 | virtual void resize(FXint w,FXint h); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbShutterVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setCurrent() 3 | virtual void setCurrent(FXint panel); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbSpinnerVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setValue() 3 | virtual void setValue(FXint value,FXbool notify=FALSE); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbDialogBoxVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of execute() 3 | virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbRealSpinnerVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setValue() 3 | virtual void setValue(FXdouble value,FXbool notify=FALSE); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbTabBarVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setCurrent() 3 | virtual void setCurrent(FXint panel,FXbool notify=FALSE); 4 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbListBoxVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | /// Overrides the base class version of setCurrentItem() 3 | virtual void setCurrentItem(FXint index,FXbool notify=FALSE); 4 | 5 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbTreeListBoxVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setCurrentItem() 3 | virtual void setCurrentItem(FXTreeItem* item,FXbool notify=FALSE); 4 | 5 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbTranslatorVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of tr() 3 | virtual const FXchar* tr(const FXchar* context,const FXchar* message,const FXchar* hint) const; 4 | 5 | -------------------------------------------------------------------------------- /test/TC_FXStream.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXStream < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /rdoc-sources/FXShell.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The Shell widget is used as the base class for top level windows, i.e. 4 | # windows which are direct children of the root window. 5 | # 6 | class FXShell < FXComposite 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbCursorVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of savePixels() 3 | virtual bool savePixels(FXStream& store) const; 4 | 5 | // Overrides the base class version of loadPixels() 6 | virtual bool loadPixels(FXStream& store); 7 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbPopupVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of popup() 3 | virtual void popup(FXWindow* grabto,FXint x,FXint y,FXint w=0,FXint h=0); 4 | 5 | // Overrides the base class version of popdown() 6 | virtual void popdown(); 7 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuPane.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Popup menu pane 4 | # 5 | class FXMenuPane < FXPopup 6 | # 7 | # Construct menu pane 8 | # 9 | def initialize(owner, opts=0) # :yields: theMenuPane 10 | end 11 | end 12 | end 13 | 14 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbGLShapeVirtuals.h: -------------------------------------------------------------------------------- 1 | protected: 2 | // Overrides the base class version of drawshape() 3 | virtual void drawshape(FXGLViewer* viewer); 4 | 5 | public: 6 | // This is the publically accessible version 7 | void _drawshape(FXGLViewer* viewer); 8 | 9 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbIdVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides base class version of create() 3 | virtual void create(); 4 | 5 | // Overrides base class version of detach() 6 | virtual void detach(); 7 | 8 | // Overrides base class version of destroy() 9 | virtual void destroy(); 10 | -------------------------------------------------------------------------------- /fox-includes/README: -------------------------------------------------------------------------------- 1 | This directory just contains an archived copy of the include files from the 2 | standard FOX distribution on which this release of FXRuby is based. This 3 | gives the maintainer a good frame of reference for comparing against newer 4 | FOX releases, to see what's changed in the API. 5 | -------------------------------------------------------------------------------- /fox-includes/fxver.h: -------------------------------------------------------------------------------- 1 | #ifndef FXVER_H 2 | #define FXVER_H 3 | 4 | 5 | // FOX version 6 | #define FOX_MAJOR 1 7 | #define FOX_MINOR 6 8 | #define FOX_LEVEL 0 9 | 10 | 11 | 12 | // FOX byte order 13 | #ifndef FOX_BIGENDIAN 14 | #define FOX_BIGENDIAN 1 15 | #endif 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /test/TC_FXMenuCommand.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXMenuCommand < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @menuCommand = FXMenuCommand.new(mainWindow, "menuCommand") 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/TS_All.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | 4 | if __FILE__ == $0 5 | testdir = File.expand_path("..", __FILE__) 6 | $: << testdir 7 | Dir.chdir(testdir) do 8 | Dir.glob("TC_*.rb").each do |testcase| 9 | require "#{testcase}" 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --readme README.md 2 | --title "FXRuby API Documentation" 3 | --exclude '/aliases|kwargs|missingdep|responder/' 4 | --protected 5 | --no-private 6 | --charset utf-8 7 | rdoc-sources/*.rb 8 | lib/fox16/*.rb 9 | - 10 | History.md 11 | rdoc-sources/*.rdoc 12 | README.md 13 | -------------------------------------------------------------------------------- /test/TC_FXBMPIcon.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXBMPIcon < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("bmp", FXBMPIcon.fileExt) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXXBMIcon.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXXBMIcon < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("xbm", FXXBMIcon.fileExt) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXXBMImage.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXXBMImage < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("xbm", FXXBMImage.fileExt) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXXPMIcon.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXXPMIcon < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("xpm", FXXPMIcon.fileExt) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXXPMImage.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXXPMImage < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("xpm", FXXPMImage.fileExt) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXDialogBox.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXDialogBox < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_nil_app_raises_argument_error 8 | err = assert_raise do 9 | FXDialogBox.new(nil, "title") 10 | end 11 | assert_match(/NULL pointer/, err.to_s) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbStreamVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | /// Overrides the base class version of close() 3 | virtual bool close(); 4 | 5 | /// Overrides the base class version of flush() 6 | virtual bool flush(); 7 | 8 | // Overrides the base class version of position() 9 | virtual bool position(FXlong p,FXWhence whence=FXFromStart); 10 | -------------------------------------------------------------------------------- /rdoc-sources/FXCURCursor.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # CUR Cursor class 4 | # 5 | class FXCURCursor < FXCursor 6 | # 7 | # Construct a cursor from memory stream in Microsoft CUR format. 8 | # The image is limited to 32x32 pixels. 9 | # 10 | def initialize(app, pixels) # :yields: theCursor 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/TC_downcast.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_downcast < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | def test_downcast 12 | fs = FXFileSelector.new(mainWindow) 13 | assert_kind_of(FXHorizontalFrame, fs.first) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /examples/hello.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'fox16' 4 | 5 | include Fox 6 | 7 | application = FXApp.new("Hello", "FoxTest") 8 | main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL) 9 | FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT) 10 | application.create() 11 | main.show(PLACEMENT_SCREEN) 12 | application.run() 13 | -------------------------------------------------------------------------------- /rdoc-sources/FXFontDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Font selection dialog 4 | # 5 | class FXFontDialog < FXDialogBox 6 | 7 | # Current font selection {FXFontDesc} 8 | attr_accessor :fontSelection 9 | 10 | # Return an initialized FXFontDialog instance. 11 | def initialize(owner, name, opts=0, x=0, y=0, width=600, height=380); end 12 | end 13 | end 14 | 15 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbObjectVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of onDefault() 3 | // virtual long onDefault(FXObject* sender,FXSelector sel,void* ptr); 4 | 5 | // Overrides the base class version of save() 6 | virtual void save(FXStream& store) const; 7 | 8 | // Overrides the base class version of load() 9 | virtual void load(FXStream& store); 10 | -------------------------------------------------------------------------------- /swig-interfaces/ignore-message-handlers.rb: -------------------------------------------------------------------------------- 1 | handlers = {} 2 | 3 | Dir.glob('FX*.i') do |filename| 4 | decls = `grep "long on" #{filename}` 5 | decls.each_line do |decl| 6 | decl.strip! 7 | handlers[decl] = decl 8 | end 9 | end 10 | 11 | handlers.each_key do |decl| 12 | parts = decl.split 13 | parts.delete_at(0) 14 | puts "%ignore #{parts.join(' ')}" 15 | end 16 | 17 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbGLViewerVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of select() 3 | virtual FXGLObject** select(FXint x,FXint y,FXint w,FXint h); 4 | 5 | // Overrides the base class version of pick() 6 | virtual FXGLObject* pick(FXint x,FXint y); 7 | 8 | // Overrides the base class version of setBounds() 9 | virtual FXbool setBounds(const FXRangef& box); 10 | 11 | -------------------------------------------------------------------------------- /lib/fox16/settings.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Adds some methods to FOX's FXSettings class 3 | # 4 | module Fox 5 | class FXSettings 6 | # 7 | # Iterate over sections (where each section is a dictionary). 8 | # 9 | def each_section 10 | pos = first 11 | while pos < getTotalSize() 12 | yield data(pos) 13 | pos = self.next(pos) 14 | end 15 | end 16 | end 17 | end 18 | 19 | -------------------------------------------------------------------------------- /rdoc-sources/FXRootWindow.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Root window 4 | # 5 | class FXRootWindow < FXComposite 6 | # 7 | # Return an initialized FXRootWindow instance. 8 | # 9 | # ==== Parameters: 10 | # 11 | # +a+:: an application instance {FXApp} 12 | # +vis+:: a visual {FXVisual} 13 | # 14 | def initialize(a, vis) # :yield: theRootWindow 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /ext/fox16_c/gvl_wrappers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * gvl_wrappers.c - Wrapper functions for locking/unlocking the Ruby GVL 3 | * 4 | */ 5 | 6 | #include "FXRbCommon.h" 7 | 8 | #ifdef HAVE___THREAD 9 | __thread int g_fxrb_thread_has_gvl = 1; 10 | #endif 11 | 12 | FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_WRAPPER_STRUCT ); 13 | FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_SKELETON ); 14 | FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB ); 15 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbFileDictVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of findFileBinding() 3 | virtual FXFileAssoc* findFileBinding(const FXchar* pathname); 4 | 5 | // Overrides the base class version of findDirBinding() 6 | virtual FXFileAssoc* findDirBinding(const FXchar* pathname); 7 | 8 | // Overrides the base class version of findExecBinding() 9 | virtual FXFileAssoc* findExecBinding(const FXchar* pathname); 10 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbGLCanvasVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of makeCurrent() 3 | virtual FXbool makeCurrent(); 4 | 5 | // Overrides the base class version of makeNonCurrent() 6 | virtual FXbool makeNonCurrent(); 7 | 8 | // Overrides the base class version of isCurrent() 9 | virtual FXbool isCurrent() const; 10 | 11 | // Overrides the base class version of swapBuffers() 12 | virtual void swapBuffers(); 13 | 14 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbDockBarVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of dock() 3 | virtual void dock(FXDockSite* docksite,FXWindow* before=NULL,FXbool notify=FALSE); 4 | 5 | // Overrides the base class version of dock() 6 | virtual void dock(FXDockSite* docksite,FXint localx,FXint localy,FXbool notify); 7 | 8 | // Overrides the base class version of undock() 9 | virtual void undock(FXint rootx,FXint rooty,FXbool notify=FALSE); 10 | 11 | -------------------------------------------------------------------------------- /test/TC_FXId.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXId < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_created? 13 | assert !mainWindow.created? 14 | mainWindow.create 15 | assert mainWindow.created?, "main window should be created after call to FXApp#create" 16 | mainWindow.destroy 17 | assert !mainWindow.created? 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbMDIChildVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of minimize() 3 | virtual FXbool minimize(FXbool notify=FALSE); 4 | 5 | // Overrides the base class version of maximize() 6 | virtual FXbool maximize(FXbool notify=FALSE); 7 | 8 | // Overrides the base class version of restore() 9 | virtual FXbool restore(FXbool notify=FALSE); 10 | 11 | // Overrides the base class version of close() 12 | virtual FXbool close(FXbool notify=FALSE); 13 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbScrollAreaVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of getContentWidth() 3 | virtual FXint getContentWidth(); 4 | 5 | // Overrides the base class version of getContentHeight() 6 | virtual FXint getContentHeight(); 7 | 8 | // Overrides the base class version of getViewportWidth() 9 | virtual FXint getViewportWidth(); 10 | 11 | // Overrides the base class version of getViewportHeight() 12 | virtual FXint getViewportHeight(); 13 | 14 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuCascade.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The cascade menu widget is used to bring up a sub menu from a 4 | # pull down menu. 5 | # 6 | class FXMenuCascade < FXMenuCaption 7 | 8 | # The popup menu {FXPopup} 9 | attr_accessor :menu 10 | 11 | # 12 | # Construct a menu cascade responsible for the given popup menu 13 | # 14 | def initialize(parent, text, icon=nil, popupMenu=nil, opts=0) # :yields: theMenuCascade 15 | end 16 | end 17 | end 18 | 19 | -------------------------------------------------------------------------------- /rdoc-sources/FXDragCorner.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A drag corner widget may be placed in the bottom right corner 4 | # so as to allow the window to be resized more easily. 5 | # 6 | class FXDragCorner < FXWindow 7 | 8 | # Highlight color {FXColor} 9 | attr_accessor :hiliteColor 10 | 11 | # Shadow color {FXColor} 12 | attr_accessor :shadowColor 13 | 14 | # Construct a drag corner 15 | def initialize(p) # :yields: theDragCorner 16 | end 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | doap.rdf 2 | *.tmproj 3 | doc/api 4 | users_guide/*.html 5 | ext/fox16_c/*_wrap.cpp 6 | ext/fox16_c/*.o 7 | ext/fox16_c/conftest.dSYM 8 | ext/fox16_c/include/inlinestubs.h 9 | ext/fox16_c/extconf.h 10 | ext/fox16_c/swigruby.h 11 | ext/fox16_c/fox16.bundle 12 | ext/fox16_c/mkmf.log 13 | lib/fox16/kwargs.rb 14 | lib/[0-9].[0-9] 15 | lib/*.so 16 | fox-includes/diffs.py 17 | fox-includes/diffs.txt 18 | pkg 19 | tmp 20 | vendor 21 | *.orig 22 | *.rej 23 | /Gemfile.lock 24 | /ports 25 | /.bundle 26 | /.yardoc 27 | -------------------------------------------------------------------------------- /examples/unicode.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # -*- encoding: UTF-8 -*- 3 | 4 | require 'fox16' 5 | 6 | # Pass UTF-8 encoded Unicode strings to FXRuby. 7 | label = "Les enfants vont \u00E0 l'\u00E9cole.\nLa boulang\u00E8re vend-elle le pain en ao\u00FBt?" 8 | 9 | Fox::FXApp.new("Unicode Example", "FoxTest") do |app| 10 | main = Fox::FXMainWindow.new(app, "Unicode Text", nil, nil, Fox::DECOR_ALL) 11 | Fox::FXLabel.new(main, label) 12 | app.create 13 | main.show(Fox::PLACEMENT_SCREEN) 14 | app.run 15 | end 16 | -------------------------------------------------------------------------------- /test/TC_FXDCWindow.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXDCWindow < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | app.create 11 | mainWindow.create 12 | end 13 | 14 | def test_new 15 | dc = FXDCWindow.new(mainWindow) 16 | dc.drawPoint(0, 0) 17 | dc.end 18 | end 19 | 20 | def test_new_with_block 21 | FXDCWindow.new(mainWindow) do |dc| 22 | dc.drawPoint(0, 0) 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuSeparator.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The menu separator is a simple decorative groove 4 | # used to delineate items in a popup menu. 5 | # 6 | class FXMenuSeparator < FXWindow 7 | 8 | # Highlight color {FXColor} 9 | attr_accessor :hiliteColor 10 | 11 | # Shadow color {FXColor} 12 | attr_accessor :shadowColor 13 | 14 | # 15 | # Construct a menu separator 16 | # 17 | def initialize(parent, opts=0) # :yields: theMenuSeparator 18 | end 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbAppVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of create() 3 | virtual void create(); 4 | 5 | // Overrides the base class version of detach() 6 | virtual void detach(); 7 | 8 | // Overrides the base class version of destroy() 9 | virtual void destroy(); 10 | 11 | // Overrides the base class version of init() 12 | virtual void init(int& argc, char** argv,bool connect=true); 13 | 14 | // Overrides the base class version of exit() 15 | virtual void exit(FXint code=0); 16 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbMDIClientVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setActiveChild() 3 | virtual FXbool setActiveChild(FXMDIChild* child=NULL,FXbool notify=FALSE); 4 | 5 | // Overrides the base class version of cascade() 6 | virtual void cascade(FXbool notify=FALSE); 7 | 8 | // Overrides the base class version of horizontal() 9 | virtual void horizontal(FXbool notify=FALSE); 10 | 11 | // Overrides the base class version of vertical() 12 | virtual void vertical(FXbool notify=FALSE); 13 | -------------------------------------------------------------------------------- /test/TC_FXExtentd.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXExtentd < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_lower_always_returns_same_instance 8 | e = FXExtentd.new(0, 1, 0, 1) 9 | assert_same e.lower, e.lower 10 | end 11 | 12 | def test_upper_always_returns_same_instance 13 | e = FXExtentd.new(0, 1, 0, 1) 14 | assert_same e.upper, e.upper 15 | end 16 | 17 | def test_index_always_returns_same_instance 18 | e = FXExtentd.new(0, 1, 0, 1) 19 | assert_same e[0], e[0] 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/TC_FXExtentf.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXExtentf < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_lower_always_returns_same_instance 8 | e = FXExtentf.new(0, 1, 0, 1) 9 | assert_same e.lower, e.lower 10 | end 11 | 12 | def test_upper_always_returns_same_instance 13 | e = FXExtentf.new(0, 1, 0, 1) 14 | assert_same e.upper, e.upper 15 | end 16 | 17 | def test_index_always_returns_same_instance 18 | e = FXExtentf.new(0, 1, 0, 1) 19 | assert_same e[0], e[0] 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/TC_FXSegment.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXSegment < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_new 8 | aSeg = FXSegment.new 9 | assert_equal(0, aSeg.x1) 10 | assert_equal(0, aSeg.y1) 11 | assert_equal(0, aSeg.x2) 12 | assert_equal(0, aSeg.y2) 13 | end 14 | def test_new_with_values 15 | aSeg = FXSegment.new(1, 2, 3, 4) 16 | assert_equal(1, aSeg.x1) 17 | assert_equal(2, aSeg.y1) 18 | assert_equal(3, aSeg.x2) 19 | assert_equal(4, aSeg.y2) 20 | end 21 | end 22 | 23 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbDockSiteVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of moveToolBar() 3 | virtual void moveToolBar(FXDockBar* bar,FXint barx,FXint bary); 4 | 5 | // Overrides the base class version of dockToolBar() 6 | virtual void dockToolBar(FXDockBar* bar,FXWindow* before); 7 | 8 | // Overrides the base class version of dockToolBar() 9 | virtual void dockToolBar(FXDockBar* bar,FXint barx,FXint bary); 10 | 11 | // Overrides the base class version of undockToolBar() 12 | virtual void undockToolBar(FXDockBar* bar); 13 | 14 | -------------------------------------------------------------------------------- /test/TC_FXMainWindow.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXMainWindow < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_nil_app_raises_argument_error 8 | err = assert_raise do 9 | FXMainWindow.new(nil, "title") 10 | end 11 | assert_match(/NULL pointer/, err.to_s) 12 | end 13 | 14 | def test_non_created_app_raises_runtime_error 15 | pend "two FXApp are not allowed" 16 | app = FXApp.new 17 | assert_raise RuntimeError do 18 | FXMainWindow.new(app, "title").create 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's runtime dependencies in fxruby.gemspec 4 | gemspec 5 | 6 | # For some reason this is required in addition to the gemspec 7 | # when 'bundle config force_ruby_platform true' is active: 8 | gem 'mini_portile2' 9 | 10 | group :development do 11 | gem 'rake-compiler', '~> 1.0' 12 | gem 'rake-compiler-dock', '~> 1.9.1' 13 | gem 'yard', '~> 0.8' 14 | gem "bundler", ">= 1.12", "< 5.a" 15 | gem "rake", "~> 13.0" 16 | end 17 | 18 | group :test do 19 | gem 'opengl-bindings2', '~> 2.0' 20 | gem 'test-unit', '~> 3.1' 21 | end 22 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbTopWindowVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of show() with placement 3 | virtual void show(FXuint placement); 4 | 5 | // Overrides the base class version of maximize() 6 | virtual FXbool maximize(FXbool notify=FALSE); 7 | 8 | // Overrides the base class version of minimize() 9 | virtual FXbool minimize(FXbool notify=FALSE); 10 | 11 | // Overrides the base class version of restore() 12 | virtual FXbool restore(FXbool notify=FALSE); 13 | 14 | // Overrides the base class version of close() 15 | virtual FXbool close(FXbool notify=FALSE); 16 | -------------------------------------------------------------------------------- /lib/fox16/missingdep.rb: -------------------------------------------------------------------------------- 1 | # This is a little helper function used by some of the examples to report 2 | # missing dependencies information on startup. It's especially useful for the 3 | # Windows distribution since people will often start the examples by double- 4 | # clicking on an icon instead of running from the command line. 5 | 6 | def missingDependency(msg) 7 | app = Fox::FXApp.new("Dummy", "FoxTest") 8 | app.init(ARGV) 9 | mainWindow = Fox::FXMainWindow.new(app, "") 10 | app.create 11 | Fox::FXMessageBox.error(mainWindow, Fox::MBOX_OK, "Dependencies Missing", msg) 12 | raise SystemExit 13 | end 14 | 15 | -------------------------------------------------------------------------------- /test/TC_FXHiliteStyle.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | 4 | class TC_FXHiliteStyle < Test::Unit::TestCase 5 | include Fox 6 | 7 | 8 | def setup 9 | @style = FXHiliteStyle.new 10 | end 11 | 12 | def test_new_object_is_initialized 13 | assert_equal(0, @style.normalForeColor) 14 | assert_equal(0, @style.normalBackColor) 15 | assert_equal(0, @style.selectForeColor) 16 | assert_equal(0, @style.selectBackColor) 17 | assert_equal(0, @style.hiliteForeColor) 18 | assert_equal(0, @style.hiliteBackColor) 19 | assert_equal(0, @style.activeBackColor) 20 | assert_equal(0, @style.style) 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /test/TC_FXDirList.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXDirList < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @dirList = FXDirList.new(mainWindow) 11 | end 12 | 13 | def test_setCurrentFile 14 | file = "" 15 | @dirList.setCurrentFile(file) 16 | @dirList.setCurrentFile(file, true) 17 | end 18 | 19 | def test_setDirectory 20 | path = "" 21 | @dirList.setDirectory(path) 22 | @dirList.setDirectory(path, true) 23 | end 24 | 25 | def test_getPathnameItem 26 | path = "" 27 | @dirList.getPathnameItem(path) 28 | end 29 | end 30 | 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXDocument.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Abstract base class for documents 4 | # 5 | # === Message identifiers 6 | # 7 | # +ID_TITLE+:: x 8 | # +ID_FILENAME+:: x 9 | # 10 | class FXDocument < FXObject 11 | 12 | # Modified state for the document [Boolean] 13 | attr_writer :modified 14 | 15 | # Document title 16 | attr_accessor :title 17 | 18 | # Document filename 19 | attr_accessor :filename 20 | 21 | # Return an initialized FXDocument instance 22 | def initialize # :yields: theDocument 23 | end 24 | 25 | # Return +true+ if document is modified 26 | def modified?; end 27 | end 28 | end 29 | 30 | -------------------------------------------------------------------------------- /docs/frames.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FXRuby API Documentation 6 | 7 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /lib/fox16/exceptions_for_fxerror.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | FXWindow.subclasses.each do |klass| 3 | klass.send(:alias_method, :create_without_parent_created_check, :create) 4 | klass.send(:define_method, :create) do 5 | unless parent.created? 6 | raise RuntimeError, "trying to create window before creating parent window" 7 | end 8 | if owner && !owner.created? 9 | raise RuntimeError, "trying to create window before creating owner window" 10 | end 11 | if visual.nil? 12 | raise RuntimeError, "trying to create window without a visual" 13 | end 14 | create_without_parent_created_check 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/TC_FXWindow.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXWindow < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @window = FXWindow.new(mainWindow) 11 | end 12 | 13 | def test_width_accessor 14 | pos = @window.width 15 | assert_kind_of(Integer, pos) 16 | @window.width = pos + 1 17 | assert_equal(pos + 1, @window.width) 18 | @window.width = pos + 2.7 19 | assert_equal(pos + 2, @window.width) 20 | assert_kind_of(Integer, @window.width) 21 | end 22 | 23 | def test_width_invalid 24 | assert_raise(TypeError){ @window.width = nil } 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /test/TC_FXArc.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXArc < Test::Unit::TestCase 5 | include Fox 6 | 7 | def test_new 8 | anArc = FXArc.new 9 | assert_equal(0, anArc.x) 10 | assert_equal(0, anArc.y) 11 | assert_equal(0, anArc.w) 12 | assert_equal(0, anArc.h) 13 | assert_equal(0, anArc.a) 14 | assert_equal(0, anArc.b) 15 | end 16 | def test_new_with_values 17 | anArc = FXArc.new(1, 2, 3, 4, 5, 6) 18 | assert_equal(1, anArc.x) 19 | assert_equal(2, anArc.y) 20 | assert_equal(3, anArc.w) 21 | assert_equal(4, anArc.h) 22 | assert_equal(5, anArc.a) 23 | assert_equal(6, anArc.b) 24 | end 25 | end 26 | 27 | -------------------------------------------------------------------------------- /test/TC_FXScrollWindow.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXScrollWindow < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @scrollWindow = FXScrollWindow.new(mainWindow) 11 | end 12 | 13 | def test_position_get 14 | pos = @scrollWindow.position 15 | assert_instance_of(Array, pos) 16 | assert_equal(2, pos.size) 17 | assert_kind_of(Integer, pos[0]) 18 | assert_kind_of(Integer, pos[1]) 19 | end 20 | 21 | def test_setPosition 22 | @scrollWindow.setPosition(0, 0) 23 | end 24 | 25 | def test_position_move_and_resize 26 | @scrollWindow.position(0, 0, 1, 1) 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /fox-includes/FXCP437Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP437CODEC_H 2 | #define FXCP437CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP437 Codec 11 | class FXAPI FXCP437Codec : public FXTextCodec { 12 | FXDECLARE(FXCP437Codec) 13 | public: 14 | FXCP437Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP437Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP852Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP852CODEC_H 2 | #define FXCP852CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP852 Codec 11 | class FXAPI FXCP852Codec : public FXTextCodec { 12 | FXDECLARE(FXCP852Codec) 13 | public: 14 | FXCP852Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP852Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP855Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP855CODEC_H 2 | #define FXCP855CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP855 Codec 11 | class FXAPI FXCP855Codec : public FXTextCodec { 12 | FXDECLARE(FXCP855Codec) 13 | public: 14 | FXCP855Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP855Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP856Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP856CODEC_H 2 | #define FXCP856CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP856 Codec 11 | class FXAPI FXCP856Codec : public FXTextCodec { 12 | FXDECLARE(FXCP856Codec) 13 | public: 14 | FXCP856Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP856Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP857Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP857CODEC_H 2 | #define FXCP857CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP857 Codec 11 | class FXAPI FXCP857Codec : public FXTextCodec { 12 | FXDECLARE(FXCP857Codec) 13 | public: 14 | FXCP857Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP857Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP860Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP860CODEC_H 2 | #define FXCP860CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP860 Codec 11 | class FXAPI FXCP860Codec : public FXTextCodec { 12 | FXDECLARE(FXCP860Codec) 13 | public: 14 | FXCP860Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP860Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP861Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP861CODEC_H 2 | #define FXCP861CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP861 Codec 11 | class FXAPI FXCP861Codec : public FXTextCodec { 12 | FXDECLARE(FXCP861Codec) 13 | public: 14 | FXCP861Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP861Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP862Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP862CODEC_H 2 | #define FXCP862CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP862 Codec 11 | class FXAPI FXCP862Codec : public FXTextCodec { 12 | FXDECLARE(FXCP862Codec) 13 | public: 14 | FXCP862Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP862Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP863Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP863CODEC_H 2 | #define FXCP863CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP863 Codec 11 | class FXAPI FXCP863Codec : public FXTextCodec { 12 | FXDECLARE(FXCP863Codec) 13 | public: 14 | FXCP863Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP863Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP864Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP864CODEC_H 2 | #define FXCP864CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP864 Codec 11 | class FXAPI FXCP864Codec : public FXTextCodec { 12 | FXDECLARE(FXCP864Codec) 13 | public: 14 | FXCP864Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP864Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP865Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP865CODEC_H 2 | #define FXCP865CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP865 Codec 11 | class FXAPI FXCP865Codec : public FXTextCodec { 12 | FXDECLARE(FXCP865Codec) 13 | public: 14 | FXCP865Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP865Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP866Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP866CODEC_H 2 | #define FXCP866CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP866 Codec 11 | class FXAPI FXCP866Codec : public FXTextCodec { 12 | FXDECLARE(FXCP866Codec) 13 | public: 14 | FXCP866Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP866Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP869Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP869CODEC_H 2 | #define FXCP869CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP869 Codec 11 | class FXAPI FXCP869Codec : public FXTextCodec { 12 | FXDECLARE(FXCP869Codec) 13 | public: 14 | FXCP869Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP869Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP874Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP874CODEC_H 2 | #define FXCP874CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP874 Codec 11 | class FXAPI FXCP874Codec : public FXTextCodec { 12 | FXDECLARE(FXCP874Codec) 13 | public: 14 | FXCP874Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP874Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88591Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88591CODEC_H 2 | #define FX88591CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-1 Codec 11 | class FXAPI FX88591Codec : public FXTextCodec { 12 | FXDECLARE(FX88591Codec) 13 | public: 14 | FX88591Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88591Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88592Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88592CODEC_H 2 | #define FX88592CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-2 Codec 11 | class FXAPI FX88592Codec : public FXTextCodec { 12 | FXDECLARE(FX88592Codec) 13 | public: 14 | FX88592Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88592Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88593Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88593CODEC_H 2 | #define FX88593CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-3 Codec 11 | class FXAPI FX88593Codec : public FXTextCodec { 12 | FXDECLARE(FX88593Codec) 13 | public: 14 | FX88593Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88593Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88594Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88594CODEC_H 2 | #define FX88594CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-4 Codec 11 | class FXAPI FX88594Codec : public FXTextCodec { 12 | FXDECLARE(FX88594Codec) 13 | public: 14 | FX88594Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88594Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88595Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88595CODEC_H 2 | #define FX88595CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-5 Codec 11 | class FXAPI FX88595Codec : public FXTextCodec { 12 | FXDECLARE(FX88595Codec) 13 | public: 14 | FX88595Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88595Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88596Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88596CODEC_H 2 | #define FX88596CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-6 Codec 11 | class FXAPI FX88596Codec : public FXTextCodec { 12 | FXDECLARE(FX88596Codec) 13 | public: 14 | FX88596Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88596Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88597Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88597CODEC_H 2 | #define FX88597CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-7 Codec 11 | class FXAPI FX88597Codec : public FXTextCodec { 12 | FXDECLARE(FX88597Codec) 13 | public: 14 | FX88597Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88597Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88598Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88598CODEC_H 2 | #define FX88598CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-8 Codec 11 | class FXAPI FX88598Codec : public FXTextCodec { 12 | FXDECLARE(FX88598Codec) 13 | public: 14 | FX88598Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88598Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX88599Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX88599CODEC_H 2 | #define FX88599CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-9 Codec 11 | class FXAPI FX88599Codec : public FXTextCodec { 12 | FXDECLARE(FX88599Codec) 13 | public: 14 | FX88599Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX88599Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP850Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP850CODEC_H 2 | #define FXCP850CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP8502 Codec 11 | class FXAPI FXCP850Codec : public FXTextCodec { 12 | FXDECLARE(FXCP850Codec) 13 | public: 14 | FXCP850Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP850Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: xenial 2 | language: ruby 3 | 4 | addons: 5 | apt: 6 | packages: 7 | - xpra 8 | - xserver-xorg-video-dummy 9 | - g++ 10 | - libxrandr-dev 11 | - libfox-1.6-dev 12 | - libfxscintilla-dev 13 | - swig 14 | 15 | install: 16 | - swig -version 17 | - ls -l /usr/lib/libfxscintilla* 18 | - bundle install 19 | 20 | before_script: 21 | - "xpra --xvfb=\"Xorg +extension GLX -config `pwd`/test/dummy.xorg.conf -logfile ${HOME}/.xpra/xorg.log\" start :9" 22 | 23 | script: bundle exec rake test DISPLAY=:9 24 | 25 | after_failure: 26 | - "cat ~/.xpra/*" 27 | 28 | after_script: 29 | - "xpra stop :9" 30 | 31 | rvm: 32 | - "ruby-head" 33 | - "3.0.0" 34 | - "2.3" 35 | -------------------------------------------------------------------------------- /fox-includes/FXCP1250Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1250CODEC_H 2 | #define FXCP1250CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1250 Codec 11 | class FXAPI FXCP1250Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1250Codec) 13 | public: 14 | FXCP1250Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1250Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1251Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1251CODEC_H 2 | #define FXCP1251CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1251 Codec 11 | class FXAPI FXCP1251Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1251Codec) 13 | public: 14 | FXCP1251Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1251Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1252Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1252CODEC_H 2 | #define FXCP1252CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1252 Codec 11 | class FXAPI FXCP1252Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1252Codec) 13 | public: 14 | FXCP1252Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1252Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1253Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1253CODEC_H 2 | #define FXCP1253CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1253 Codec 11 | class FXAPI FXCP1253Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1253Codec) 13 | public: 14 | FXCP1253Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1253Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1254Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1254CODEC_H 2 | #define FXCP1254CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1254 Codec 11 | class FXAPI FXCP1254Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1254Codec) 13 | public: 14 | FXCP1254Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1254Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1255Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1255CODEC_H 2 | #define FXCP1255CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1255 Codec 11 | class FXAPI FXCP1255Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1255Codec) 13 | public: 14 | FXCP1255Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1255Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1256Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1256CODEC_H 2 | #define FXCP1256CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1256 Codec 11 | class FXAPI FXCP1256Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1256Codec) 13 | public: 14 | FXCP1256Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1256Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1257Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1257CODEC_H 2 | #define FXCP1257CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1257 Codec 11 | class FXAPI FXCP1257Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1257Codec) 13 | public: 14 | FXCP1257Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1257Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXCP1258Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXCP1258CODEC_H 2 | #define FXCP1258CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// CP1258 Codec 11 | class FXAPI FXCP1258Codec : public FXTextCodec { 12 | FXDECLARE(FXCP1258Codec) 13 | public: 14 | FXCP1258Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FXCP1258Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /rdoc-sources/FXDebugTarget.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A debug target prints out every message it receives. 4 | # To use it, simply make the FXDebugTarget a target of the widget 5 | # whose messages you want to see. 6 | # 7 | class FXDebugTarget < FXObject 8 | # 9 | # Returns an array of strings containing the names of the message types. 10 | # So, for example, 11 | # 12 | # puts FXDebugTarget.messageTypeName[SEL_COMMAND] 13 | # 14 | # should print the text "SEL_COMMAND". 15 | # 16 | def FXDebugTarget.messageTypeName ; end 17 | 18 | # 19 | # Construct a debug target. 20 | # 21 | def initialize # :yields: theDebugTarget 22 | end 23 | end 24 | end 25 | 26 | -------------------------------------------------------------------------------- /fox-includes/FX885910Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885910CODEC_H 2 | #define FX885910CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-10 Codec 11 | class FXAPI FX885910Codec : public FXTextCodec { 12 | FXDECLARE(FX885910Codec) 13 | public: 14 | FX885910Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885910Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX885911Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885911CODEC_H 2 | #define FX885911CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-11 Codec 11 | class FXAPI FX885911Codec : public FXTextCodec { 12 | FXDECLARE(FX885911Codec) 13 | public: 14 | FX885911Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885911Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX885913Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885913CODEC_H 2 | #define FX885913CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-13 Codec 11 | class FXAPI FX885913Codec : public FXTextCodec { 12 | FXDECLARE(FX885913Codec) 13 | public: 14 | FX885913Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885913Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX885914Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885914CODEC_H 2 | #define FX885914CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-14 Codec 11 | class FXAPI FX885914Codec : public FXTextCodec { 12 | FXDECLARE(FX885914Codec) 13 | public: 14 | FX885914Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885914Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX885915Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885915CODEC_H 2 | #define FX885915CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-15 Codec 11 | class FXAPI FX885915Codec : public FXTextCodec { 12 | FXDECLARE(FX885915Codec) 13 | public: 14 | FX885915Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885915Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FX885916Codec.h: -------------------------------------------------------------------------------- 1 | #ifndef FX885916CODEC_H 2 | #define FX885916CODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | namespace FX { 9 | 10 | /// ISO-8859-16 Codec 11 | class FXAPI FX885916Codec : public FXTextCodec { 12 | FXDECLARE(FX885916Codec) 13 | public: 14 | FX885916Codec(){} 15 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 16 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 17 | virtual FXint mibEnum() const; 18 | virtual const FXchar* name() const; 19 | virtual const FXchar* mimeName() const; 20 | virtual const FXchar* const* aliases() const; 21 | virtual ~FX885916Codec(){} 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /fox-includes/FXKOI8RCodec.h: -------------------------------------------------------------------------------- 1 | #ifndef FXKOI8RCODEC_H 2 | #define FXKOI8RCODEC_H 3 | 4 | #ifndef FXTEXTCODEC_H 5 | #include "FXTextCodec.h" 6 | #endif 7 | 8 | 9 | 10 | namespace FX { 11 | 12 | 13 | /// KOI8-R Codec 14 | class FXAPI FXKOI8RCodec : public FXTextCodec { 15 | FXDECLARE(FXKOI8RCodec) 16 | public: 17 | FXKOI8RCodec(){} 18 | virtual FXint mb2wc(FXwchar& wc,const FXchar* src,FXint nsrc) const; 19 | virtual FXint wc2mb(FXchar* dst,FXint ndst,FXwchar wc) const; 20 | virtual FXint mibEnum() const; 21 | virtual const FXchar* name() const; 22 | virtual const FXchar* mimeName() const; 23 | virtual const FXchar* const* aliases() const; 24 | virtual ~FXKOI8RCodec(){} 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /test/TC_FXBMPImage.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | 5 | class TC_FXBMPImage < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_fileExt 13 | assert_equal("bmp", FXBMPImage.fileExt) 14 | end 15 | 16 | def test_image_from_pixel_data 17 | img = FXBMPImage.new app 18 | img.setPixels +"rgbaRGBA", 0, 1, 2 19 | bmp_data = FXMemoryStream.open(FXStreamSave, nil) do |outfile| 20 | img.savePixels(outfile) 21 | outfile.takeBuffer 22 | end 23 | assert_not_equal "rgbaRGBA", bmp_data 24 | 25 | img2 = FXBMPImage.new app, bmp_data 26 | assert_equal "rgbaRGBA", img2.pixel_string 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /rdoc-sources/FXDrawable.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # FXDrawable is an abstract base class for any surface that can be 4 | # drawn upon, such as an FXWindow or an FXImage. 5 | # 6 | class FXDrawable < FXId 7 | 8 | # Width of drawable, in pixels [Integer] 9 | attr_reader :width 10 | 11 | # Height of drawable, in pixels [Integer] 12 | attr_reader :height 13 | 14 | # Visual {FXVisual} 15 | attr_accessor :visual 16 | 17 | # 18 | # Resize drawable to the specified width and height. 19 | # 20 | # ==== Parameters: 21 | # 22 | # +width+:: new drawable width, in pixels [Integer] 23 | # +height+:: new drawable height, in pixels [Integer] 24 | # 25 | def resize(w, h); end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /rdoc-sources/FXDelegator.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A delegator forwards messages to a delegate object. 4 | # Delegators are used when you need to multiplex messages 5 | # toward any number of target objects. 6 | # For example, many controls may be connected to FXDelegator, 7 | # instead of directly to the document object. Changing the 8 | # delegate in FXDelegator will then reconnect the controls with their 9 | # new target. 10 | # 11 | class FXDelegator < FXObject 12 | 13 | # The object to which all messages are delegated {FXObject} 14 | attr_accessor :delegate 15 | 16 | # 17 | # Construct a new delegator 18 | # 19 | def initialize(delegate=nil) # :yields: theDelegate 20 | end 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | This is the test suite for FXRuby (obviously still under development). It's 2 | mainly intended for use by Lyle to test new releases of FXRuby, but if you'd 3 | like to run the test suite yourself you will need to have installed a recent 4 | version of TestUnit, available here: 5 | 6 | http://testunit.talbott.ws 7 | 8 | Each of the test cases has a file name of the form "TC_classname.rb". To run a 9 | particular test case, just type: 10 | 11 | ruby TC_classname.rb 12 | 13 | and scan the results for any failures. To run the entire suite of test cases, 14 | type: 15 | 16 | ruby TS_All.rb 17 | 18 | If you notice any failures in a (public) release of FXRuby, please notify 19 | Lyle. He wouldn't intentionally have let it go ;) 20 | -------------------------------------------------------------------------------- /examples/rulerview.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | 3 | include Fox 4 | 5 | class RulerViewExample < FXMainWindow 6 | def initialize(app) 7 | # Initialize base class 8 | super(app, "Ruler View", :opts => DECOR_ALL, :width => 400, :height => 400) 9 | 10 | # Construct a ruler view inside 11 | ruler_view = FXRulerView.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) 12 | 13 | # And put some content inside that 14 | contents = FXText.new(ruler_view, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) 15 | contents.text = "This is a test." 16 | end 17 | end 18 | 19 | if __FILE__ == $0 20 | FXApp.new do |app| 21 | main = RulerViewExample.new(app) 22 | app.create 23 | main.show(PLACEMENT_SCREEN) 24 | app.run 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /rdoc-sources/FXTranslator.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A translator translates a message to another language. 4 | # 5 | class FXTranslator 6 | 7 | # The application associated with this translator {FXApp} 8 | attr_reader :app 9 | 10 | # 11 | # Return a new translator for the application _a_ (an FXApp instance). 12 | # 13 | def initialize(a); end 14 | 15 | # 16 | # Translate a message. 17 | # 18 | def tr(context, message, hint=nil); end 19 | 20 | # 21 | # Change the text codec used to decode the messages embedded in the 22 | # source. 23 | # 24 | def textCodec=(codec); end 25 | 26 | # 27 | # Return a reference to the text codec. 28 | # 29 | def textCodec; end 30 | end 31 | end 32 | 33 | -------------------------------------------------------------------------------- /test/TC_FXGLGroup.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXGLGroup < Test::Unit::TestCase 5 | include Fox 6 | 7 | def setup 8 | @group = FXGLGroup.new 9 | end 10 | 11 | def test_append 12 | assert_equal(0, @group.size) 13 | @group.append(FXGLObject.new) 14 | assert_equal(1, @group.size) 15 | end 16 | 17 | def test_appendOp 18 | assert_equal(0, @group.size) 19 | @group << FXGLObject.new 20 | assert_equal(1, @group.size) 21 | end 22 | 23 | def test_each_child_yields_to_block 24 | @group << FXGLObject.new 25 | @group << FXGLObject.new 26 | count = 0 27 | assert_nothing_raised { 28 | @group.each_child { |c| count += 1 } 29 | } 30 | assert_equal(2, count) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /test/TC_FXDataTarget.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXDataTarget < Test::Unit::TestCase 5 | include Fox 6 | 7 | def setup 8 | @nilTarget = FXDataTarget.new 9 | @intTarget = FXDataTarget.new(42) 10 | @floatTarget = FXDataTarget.new(3.14159) 11 | @stringTarget = FXDataTarget.new("foo") 12 | @trueTarget = FXDataTarget.new(true) 13 | @falseTarget = FXDataTarget.new(false) 14 | end 15 | def test_to_s 16 | assert_equal("", @nilTarget.to_s) 17 | assert_equal("42", @intTarget.to_s) 18 | assert_equal("3.14159", @floatTarget.to_s) 19 | assert_equal("foo", @stringTarget.to_s) 20 | assert_equal("true", @trueTarget.to_s) 21 | assert_equal("false", @falseTarget.to_s) 22 | end 23 | end 24 | 25 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbHeaderItemVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setText() 3 | virtual void setText(const FXString& text); 4 | 5 | // Overrides the base class version of setIcon() 6 | virtual void setIcon(FXIcon* icn); 7 | 8 | // Overrides the base class version of getWidth() 9 | virtual FXint getWidth(const FXHeader* header) const; 10 | 11 | // Overrides the base class version of getHeight() 12 | virtual FXint getHeight(const FXHeader* header) const; 13 | 14 | // Overrides the base class version of create() 15 | virtual void create(); 16 | 17 | // Overrides the base class version of detach() 18 | virtual void detach(); 19 | 20 | // Overrides the base class version of destroy() 21 | virtual void destroy(); 22 | 23 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbGLObjectVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of bounds() 3 | virtual void bounds(FXRangef& box); 4 | 5 | // Overrides the base class version of draw() 6 | virtual void draw(FXGLViewer* viewer); 7 | 8 | // Overrides the base class version of hit() 9 | virtual void hit(FXGLViewer* viewer); 10 | 11 | // Overrides the base class version of copy() 12 | virtual FXGLObject* copy(); 13 | 14 | // Overrides the base class version of canDrag() 15 | virtual FXbool canDrag() const; 16 | 17 | // Overrides the base class version of canDelete() 18 | virtual FXbool canDelete() const; 19 | 20 | // Overrides the base class version of drag() 21 | virtual FXbool drag(FXGLViewer* viewer,FXint fx,FXint fy,FXint tx,FXint ty); 22 | 23 | -------------------------------------------------------------------------------- /lib/fox16/dict.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Adds some methods similar to those for Ruby's Hash class 3 | # to FOX's FXDict class. 4 | # 5 | module Fox 6 | class FXDict 7 | # 8 | # Returns a new array populated with the keys from this dictionary. 9 | # 10 | def keys 11 | ary = [] 12 | each_key { |k| ary << k } 13 | ary 14 | end 15 | 16 | # 17 | # Iterate over the keys in this dictionary. 18 | # 19 | def each_key 20 | pos = first 21 | while pos < self.getTotalSize() 22 | yield key(pos) 23 | pos = self.next(pos) 24 | end 25 | end 26 | 27 | # 28 | # Returns +true+ if this dictionary contains no key-value pairs. 29 | # 30 | def empty? 31 | self.size == 0 32 | end 33 | end 34 | end 35 | 36 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FXRuby - Home Page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/RAA.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require 'soap/rpc/driver' 3 | require 'iRAA' 4 | rescue LoadError 5 | warn("Sorry, at the moment this example is not working.") 6 | sleep(5) 7 | exit(false) 8 | end 9 | 10 | module RAA 11 | extend SOAP 12 | 13 | class Driver 14 | def initialize(server = 'http://raa.ruby-lang.org/soap/1.0/', proxy = nil) 15 | @drv = SOAP::RPC::Driver.new(server, RAA::InterfaceNS) 16 | @drv.httpproxy = proxy if proxy 17 | @drv.mapping_registry = RAA::MappingRegistry 18 | RAA::Methods.each do |name, *params| 19 | @drv.add_method(name, params) 20 | end 21 | end 22 | 23 | def setLogDev(logdev) 24 | # ignored. 25 | end 26 | 27 | def method_missing(msg_id, *a, &b) 28 | @drv.__send__(msg_id, *a, &b) 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXCanvas.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # Canvas, an area drawn by another object 3 | # 4 | # === Events 5 | # 6 | # The following messages are sent by FXCanvas to its target: 7 | # 8 | # +SEL_KEYPRESS+:: sent when a key goes down; the message data is an FXEvent instance. 9 | # +SEL_KEYRELEASE+:: sent when a key goes up; the message data is an FXEvent instance. 10 | # +SEL_MOTION+:: sent when the mouse moves; the message data is an FXEvent instance. 11 | # +SEL_PAINT+:: sent when the canvas needs to be redrawn; the message data is an FXEvent instance. 12 | 13 | class FXCanvas < FXWindow 14 | # Construct new drawing canvas widget 15 | def initialize(parent, target=nil, selector=0, opts=FRAME_NORMAL, x=0, y=0, width=0, height=0) # :yields: theCanvas 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /rdoc-sources/FXSearchDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Text search dialog 4 | # 5 | class FXSearchDialog < FXReplaceDialog 6 | # 7 | # Return an initialized FXSearchDialog instance. 8 | # 9 | # ==== Parameters: 10 | # 11 | # +owner+:: the owner window for this dialog box {FXWindow} 12 | # +caption+:: the caption (title) string for this dialog box [String] 13 | # +ic+:: the icon {FXIcon} 14 | # +opts+:: the options [Integer] 15 | # +x+:: initial x-position [Integer] 16 | # +y+:: initial y-position [Integer] 17 | # +width+:: initial width [Integer] 18 | # +height+:: initial height [Integer] 19 | # 20 | def initialize(owner, caption, ic=nil, opts=0, x=0, y=0, width=0, height=0) # :yields: theSearchDialog 21 | end 22 | end 23 | end 24 | 25 | -------------------------------------------------------------------------------- /rdoc-sources/FXMemoryBuffer.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # This class is deprecated. Use FXImage methods instead. 3 | class FXMemoryBuffer 4 | 5 | # 6 | # Return a new FXMemoryBuffer instance, initialized with the 7 | # provided array of FXColor values. 8 | # 9 | # ==== Parameters: 10 | # 11 | # +data+:: the initial array of FXColor values. 12 | # 13 | def initialize(data); end 14 | 15 | # Return a copy of the pixel buffer, as an array of FXColor values [Array] 16 | def data; end 17 | alias to_a data 18 | 19 | # Return the size of the pixel buffer 20 | def size; end 21 | 22 | # Return the specified element (an FXColor value) 23 | def [](index); end 24 | 25 | # Set the specified element to _clr_. 26 | def []=(index, clr); end 27 | end 28 | end 29 | 30 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuCommand.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The FXMenuCommand widget is used to invoke a command in the 4 | # application from a menu. Menu commands may reflect 5 | # the state of the application by graying out or becoming hidden. 6 | # When activated, a menu command sends a +SEL_COMMAND+ to its target. 7 | # 8 | # === Events 9 | # 10 | # The following messages are sent by FXMenuCommand to its target: 11 | # 12 | # +SEL_COMMAND+:: sent when the command is activated 13 | # 14 | class FXMenuCommand < FXMenuCaption 15 | 16 | # Accelerator text [String] 17 | attr_accessor :accelText 18 | 19 | # 20 | # Construct a menu command 21 | # 22 | def initialize(p, text, ic=nil, target=nil, selector=0, opts=0) # :yields: theMenuCommand 23 | end 24 | end 25 | end 26 | 27 | -------------------------------------------------------------------------------- /test/TC_FXGLShape.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXGLShape < Test::Unit::TestCase 5 | include Fox 6 | 7 | 8 | DELTA = 1.0e-5 9 | 10 | def setup 11 | @shape = FXGLShape.new(0.0, 0.0, 0.0, 0) 12 | end 13 | def test_getPosition 14 | assert_kind_of(FXVec3f, @shape.position) 15 | end 16 | def test_setPosition 17 | @shape.position = FXVec3f.new(0.1, 0.2, 0.3) 18 | assert_in_delta(0.1, @shape.position[0], DELTA) 19 | assert_in_delta(0.2, @shape.position[1], DELTA) 20 | assert_in_delta(0.3, @shape.position[2], DELTA) 21 | 22 | @shape.position = [0.4, 0.5, 0.6] 23 | assert_in_delta(0.4, @shape.position[0], DELTA) 24 | assert_in_delta(0.5, @shape.position[1], DELTA) 25 | assert_in_delta(0.6, @shape.position[2], DELTA) 26 | end 27 | end 28 | 29 | -------------------------------------------------------------------------------- /test/TC_FXShell.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXShell < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | if FXApp.instance.nil? 10 | @app = FXApp.new('TC_FXShell', 'FXRuby') 11 | @app.init([]) 12 | else 13 | @app = FXApp.instance 14 | end 15 | @mainWin = FXMainWindow.new(@app, 'TC_FXShell') 16 | end 17 | 18 | def test_nil_parent_raises_argument_error 19 | err = assert_raise{ FXShell.new(nil, 0, 0, 0, 0, 0) } 20 | assert_match(/NULL pointer/, err.to_s) 21 | end 22 | 23 | def test_new 24 | # Free-floating 25 | shell1 = FXShell.new(@app, 0, 0, 0, 0, 0) 26 | assert_nil(shell1.owner) 27 | 28 | # Owned 29 | shell2 = FXShell.new(@mainWin, 0, 0, 0, 0, 0) 30 | assert_same(@mainWin, shell2.owner) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /rdoc-sources/FXGIFImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # GIF Image class 3 | class FXGIFImage < FXImage 4 | # 5 | # Return the suggested file extension for this image type ("bmp"). 6 | # 7 | def FXGIFImage.fileExt; end 8 | 9 | # 10 | # Return the suggested MIME type for this image type. 11 | # 12 | def FXGIFImage.mimeType; end 13 | 14 | # 15 | # Return an initialized FXGIFImage instance. 16 | # 17 | # ==== Parameters: 18 | # 19 | # +a+:: an application instance {FXApp} 20 | # +pix+:: a memory buffer formatted in GIF file format [String] 21 | # +opts+:: options [Integer] 22 | # +width+:: width [Integer] 23 | # +height+:: height [Integer] 24 | # 25 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theGIFImage 26 | end 27 | end 28 | end 29 | 30 | -------------------------------------------------------------------------------- /rdoc-sources/FXBMPImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Microsoft Bitmap image. 4 | # 5 | class FXBMPImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("bmp"). 8 | # 9 | def FXBMPImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXBMPImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXBMPImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in BMP file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theBMPImage 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXFileStream.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # File Store Definition 3 | class FXFileStream < FXStream 4 | 5 | attr_reader :position 6 | 7 | # 8 | # Return an initialized FXFileStream instance. 9 | # 10 | def initialize(cont=nil) # :yields: theFileStream 11 | end 12 | 13 | # 14 | # Open binary data file stream; allocate a buffer of the given _size_ 15 | # for the file I/O; the buffer must be at least 16 bytes. Returns 16 | # +true+ on success, +false+ on failure. 17 | # 18 | # ==== Parameters: 19 | # 20 | # +filename+:: name of the file to open [String] 21 | # +save_or_load+:: access mode, either +FXStreamSave+ or +FXStreamLoad+ [Integer] 22 | # +size+:: buffer size [Integer] 23 | # 24 | def open(filename, save_or_load, size=8192); end 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /rdoc-sources/FXICOImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # ICO graphics file 4 | # 5 | class FXICOImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("ico"). 8 | # 9 | def FXICOImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXICOImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXICOImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in ICO file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theICOImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXPCXImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # PCX graphics file 4 | # 5 | class FXPCXImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("pcx"). 8 | # 9 | def FXPCXImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXPCXImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXPCXImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in PCX file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: thePCXImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXTGAImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Targa Image 4 | # 5 | class FXTGAImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("tga"). 8 | # 9 | def FXTGAImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXTGAImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXTGAImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in Targa file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theTGAImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXDockHandler.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The dock handler exists as a common base class for tool bar grip 4 | # and dock title. 5 | # 6 | # === Events 7 | # 8 | # The following messages are sent by FXDockHandler to its target: 9 | # 10 | # +SEL_KEYPRESS+:: sent when a key goes down; the message data is an FXEvent instance. 11 | # +SEL_KEYRELEASE+:: sent when a key goes up; the message data is an FXEvent instance. 12 | # 13 | class FXDockHandler < FXFrame 14 | # Status line help text [String] 15 | attr_accessor :helpText 16 | 17 | # Tool tip text [String] 18 | attr_accessor :tipText 19 | 20 | # 21 | # Return an initialized FXDockHandler instance. 22 | # 23 | def initialize(p, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb) # :yields: aDockHandler 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /rdoc-sources/FXDockTitle.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A dock title is used to move its container, a dock bar. 4 | # The dock title is also used simultaneously to provide a 5 | # caption above the dock bar. 6 | # 7 | class FXDockTitle < FXDockHandler 8 | # Caption text for the grip [String] 9 | attr_accessor :caption 10 | 11 | # Caption font {FXFont} 12 | attr_accessor :font 13 | 14 | # Caption color {FXColor} 15 | attr_accessor :captionColor 16 | 17 | # Current justification mode [Integer] 18 | attr_accessor :justify 19 | 20 | # 21 | # Construct dock bar title widget 22 | # 23 | def initialize(p, text, target=nil, selector=0, opts=FRAME_NORMAL|JUSTIFY_CENTER_X|JUSTIFY_CENTER_Y, x=0, y=0, width=0, height=0, padLeft=0, padRight=0, padTop=0, padBottom=0) 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /rdoc-sources/FXRGBImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Iris RGB Image 4 | # 5 | class FXRGBImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("rgb"). 8 | # 9 | def FXRGBImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXRGBImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXRGBImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in IRIS RGB file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theRGBImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXXPMImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # X Pixmap (XPM) Image 4 | # 5 | class FXXPMImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("xpm"). 8 | # 9 | def FXXPMImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXXPMImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXXPMImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in XPM file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theXPMImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXPPMImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Portable Pixmap (PPM) Image 4 | # 5 | class FXPPMImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("ppm"). 8 | # 9 | def FXPPMImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXPNGImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXPPMImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in PPM file format [String] 23 | # +opts+:: options [Integer] 24 | # +width+:: width [Integer] 25 | # +height+:: height [Integer] 26 | # 27 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: thePPMImage 28 | end 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /test/TC_FXScrollArea.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXScrollArea < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @scrollArea = FXScrollArea.new(mainWindow) 11 | end 12 | 13 | def test_nil_parent_raises_argument_error 14 | err = assert_raise{ FXScrollArea.new(nil) } 15 | assert_match(/NULL pointer/, err.to_s) 16 | end 17 | 18 | def test_position_get 19 | pos = @scrollArea.position 20 | assert_instance_of(Array, pos) 21 | assert_equal(2, pos.size) 22 | assert_kind_of(Integer, pos[0]) 23 | assert_kind_of(Integer, pos[1]) 24 | end 25 | 26 | def test_setPosition 27 | @scrollArea.setPosition(0, 0) 28 | end 29 | 30 | def test_position_move_and_resize 31 | @scrollArea.position(0, 0, 1, 1) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /rdoc-sources/FXId.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Encapsulates a server side resource. 4 | # 5 | class FXId < FXObject 6 | 7 | # Application {FXApp} 8 | attr_reader :app 9 | 10 | # User data [Object] 11 | attr_accessor :userData 12 | 13 | # XID handle for the server-side resource [Integer] 14 | attr_reader :xid 15 | 16 | # 17 | # Create resource. 18 | # 19 | def create(); end 20 | 21 | # Returns true if this resource has been created. 22 | def created?; end 23 | 24 | # 25 | # Detach resource. 26 | # 27 | def detach(); end 28 | 29 | # 30 | # Destroy resource. 31 | # 32 | def destroy(); end 33 | 34 | # Runs the specified block on the UI thread. 35 | # 36 | # The block is posted to the event queue of the UI thread. 37 | def runOnUiThread(&block); end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /rdoc-sources/FXScrollPane.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A Scroll Pane is a menu pane which provides scrolling of menu entries. 4 | # It is useful when menus are populated programmatically and it is not 5 | # known in advance how many entries will be added. 6 | # 7 | class FXScrollPane < FXMenuPane 8 | 9 | # Index of top-most menu item [Integer] 10 | attr_accessor :topItem 11 | 12 | # Number of visible items [Integer] 13 | attr_accessor :numVisible 14 | 15 | # 16 | # Return an initialized FXScrollPane instance. 17 | # 18 | # ==== Parameters: 19 | # 20 | # +owner+:: owner window for this menu pane {FXWindow} 21 | # +nvis+:: maximum number of visible items [Integer] 22 | # +opts+:: options [Integer] 23 | # 24 | def initialize(owner, nvis, opts=0) # :yields: theScrollPane 25 | end 26 | end 27 | end 28 | 29 | -------------------------------------------------------------------------------- /test/TC_FXSettings.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXSettings < Fox::TestCase 6 | include Fox 7 | 8 | 9 | def setup 10 | super(self.class.name) 11 | end 12 | 13 | def test_each_section_empty_settings 14 | empty = FXSettings.new 15 | num_sections = 0 16 | empty.each_section do |sect| 17 | num_sections = num_sections + 1 18 | end 19 | assert_equal(0, num_sections) 20 | end 21 | 22 | def test_each_section 23 | settings = FXSettings.new 24 | settings.writeStringEntry('sect1', 'key1', 'value1') 25 | settings.writeStringEntry('sect2', 'key2', 'value2') 26 | keys = [] 27 | settings.each_section do |sect| 28 | sect.each_key do |key| 29 | keys << key 30 | end 31 | end 32 | assert_equal(['key1', 'key2'], keys.sort) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /swig-interfaces/README: -------------------------------------------------------------------------------- 1 | This directory contains the SWIG interface files used to generate the C++ 2 | "wrapper" code for Ruby/FOX as well as a Makefile to assist in the build 3 | process. 4 | 5 | Ruby/FOX uses a development version of SWIG (version 1.3a5) to automatically 6 | generate the extension code wrappers. This version of SWIG has some problems 7 | that will hopefully get worked out in later versions. 8 | 9 | Some functions and classes are not yet wrapped. These are currently commented 10 | out with the following identifiers: 11 | 12 | IDPROB - not sure what to do with the FXID type 13 | INPUTPROB - not sure what to do with the FXInputHandle type 14 | ENDIANNESS - problems for definition of FXRGB macro 15 | OVERLOAD - used for overloaded functions 16 | OPERATOR - function is an operator overload (not supported by SWIG yet) 17 | FIXME - catchall 18 | -------------------------------------------------------------------------------- /test/TC_FXFoldingList.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXFoldingList < Fox::TestCase 6 | include Fox 7 | 8 | 9 | def setup 10 | super(self.class.name) 11 | @foldingList = FXFoldingList.new(mainWindow) 12 | end 13 | 14 | def test_each_for_empty_list 15 | count = 0 16 | @foldingList.each { |item| count += 1 } 17 | assert_equal(0, count, "count for empty list should be zero") 18 | end 19 | 20 | def test_each 21 | @foldingList.appendItem(nil, "1") 22 | @foldingList.appendItem(nil, "2") 23 | @foldingList.appendItem(nil, "3") 24 | @foldingList.appendItem(nil, "4") 25 | @foldingList.appendItem(nil, "5") 26 | count = 0 27 | @foldingList.each { |item| count += 1 } 28 | assert_equal(5, count, "count didn't match expected number of items") 29 | end 30 | 31 | end 32 | 33 | -------------------------------------------------------------------------------- /test/TC_FXViewport.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXViewport < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | @viewport = FXViewport.new 10 | end 11 | 12 | def testAttributes 13 | assert(@viewport.w) 14 | assert_kind_of(Integer, @viewport.w) 15 | assert(@viewport.h) 16 | assert_kind_of(Integer, @viewport.h) 17 | assert(@viewport.left) 18 | assert_kind_of(Float, @viewport.left) 19 | assert(@viewport.right) 20 | assert_kind_of(Float, @viewport.right) 21 | assert(@viewport.bottom) 22 | assert_kind_of(Float, @viewport.bottom) 23 | assert(@viewport.top) 24 | assert_kind_of(Float, @viewport.top) 25 | assert(@viewport.hither) 26 | assert_kind_of(Float, @viewport.hither) 27 | assert(@viewport.yon) 28 | assert_kind_of(Float, @viewport.yon) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXGIFIcon.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # GIF Icon class. 4 | # 5 | class FXGIFIcon < FXIcon 6 | # 7 | # Return the suggested file extension for this image type ("bmp"). 8 | # 9 | def FXGIFIcon.fileExt; end 10 | 11 | # 12 | # Return the suggested MIME type for this image type 13 | # 14 | def FXGIFIcon.mimeType; end 15 | 16 | # 17 | # Return an initialized FXGIFIcon instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in GIF file format [String] 23 | # +clr+:: transparency color {FXColor} 24 | # +opts+:: options [Integer] 25 | # +width+:: width [Integer] 26 | # +height+:: height [Integer] 27 | # 28 | def initialize(a, pix=nil, clr=0, opts=0, width=1, height=1) # :yields: theGIFIcon 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuBar.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Menu bar 4 | # 5 | class FXMenuBar < FXToolBar 6 | # 7 | # Construct a floatable menubar. 8 | # Normally, the menubar is docked under window _p_. 9 | # When floated, the menubar can be docked under window _q_, which is 10 | # typically an FXToolBarShell window. 11 | # 12 | def initialize(p, q, opts=LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, x=0, y=0, width=0, height=0, padLeft=3, padRight=3, padTop=2, padBottom=2, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theMenuBar 13 | end 14 | 15 | # 16 | # Construct a non-floatable menubar. 17 | # The menubar can not be undocked. 18 | # 19 | def initialize(p, opts, x=0, y=0, width=0, height=0, padLeft=3, padRight=3, padTop=2, padBottom=2, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theMenuBar 20 | end 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /test/TC_FXMessageBox.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXMessageBox < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_nil_app_raises_argument_error 13 | err = assert_raise{ FXMessageBox.new(nil, "Save?", "Save?", :opts => MBOX_SAVE_CANCEL_DONTSAVE) } 14 | assert_match(/NULL pointer/, err.to_s) 15 | end 16 | 17 | def test_construct_with_save_cancel_dontsave 18 | assert_nothing_raised(RangeError) do 19 | FXMessageBox.new(mainWindow, "Save?", "Save?", :opts => MBOX_SAVE_CANCEL_DONTSAVE) 20 | end 21 | end 22 | 23 | def test_mbox_clicked_dontsave_defined 24 | assert(Fox.const_defined?(:MBOX_CLICKED_DONTSAVE)) 25 | end 26 | 27 | def test_mbox_clicked_dontsave_equal_to_mbox_clicked_no 28 | assert_equal(MBOX_CLICKED_NO, MBOX_CLICKED_DONTSAVE) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXFontSelector.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Font selection widget 4 | # 5 | # === Message identifiers 6 | # 7 | # +ID_FAMILY+:: x 8 | # +ID_WEIGHT+:: x 9 | # +ID_STYLE+:: x 10 | # +ID_STYLE_TEXT+:: x 11 | # +ID_SIZE+:: x 12 | # +ID_SIZE_TEXT+:: x 13 | # +ID_CHARSET+:: x 14 | # +ID_SETWIDTH+:: x 15 | # +ID_PITCH+:: x 16 | # +ID_SCALABLE+:: x 17 | # +ID_ALLFONTS+:: x 18 | # 19 | class FXFontSelector < FXPacker 20 | 21 | # The "Accept" button {FXButton} 22 | attr_reader :acceptButton 23 | 24 | # The "Cancel" button {FXButton} 25 | attr_reader :cancelButton 26 | 27 | # Font selection {FXFontDesc} 28 | attr_accessor :fontSelection 29 | 30 | # 31 | # Return an initialized FXFontSelector instance. 32 | # 33 | def initialize(p, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theFontSelector 34 | end 35 | end 36 | end 37 | 38 | -------------------------------------------------------------------------------- /rdoc-sources/FXObject.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # FXObject is the base class for all objects in FOX; in order to receive 4 | # messages from the user interface, your class must derive from FXObject. 5 | # The FXObject class also provides serialization facilities, with which 6 | # you can save and restore the object's state. If you've subclassed 7 | # from FXObject, you can save your subclasses' state by overloading the 8 | # save() and load() functions and use the stream API to serialize its 9 | # member data. 10 | # 11 | class FXObject 12 | # 13 | # Handle a message sent from _sender_, with given _selector_ 14 | # and message _data_. 15 | # 16 | def handle(sender, selector, data); end 17 | 18 | # 19 | # Save object to stream. 20 | # 21 | def save(stream) ; end 22 | 23 | # 24 | # Load object from _stream_. 25 | # 26 | def load(stream) ; end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /rdoc-sources/FXXBMImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # X Bitmap (XBM) image 4 | # 5 | class FXXBMImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("xbm"). 8 | # 9 | def FXXBMImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXXBMImage.mimeType; end 15 | 16 | # 17 | # Return an initialized FXXBMImage instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pixels+:: a memory buffer formatted in XBM file format [String] 23 | # +mask+:: a memory buffer formatted in XBM file format [String] 24 | # +opts+:: options [Integer] 25 | # +width+:: width [Integer] 26 | # +height+:: height [Integer] 27 | # 28 | def initialize(a, pixels=nil, mask=nil, opts=0, width=1, height=1) # :yields: theXBMImage 29 | end 30 | end 31 | end 32 | 33 | -------------------------------------------------------------------------------- /rdoc-sources/FXPNGImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Portable Network Graphics (PNG) Image 4 | # 5 | class FXPNGImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("png"). 8 | # 9 | def FXPNGImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXPNGImage.mimeType; end 15 | 16 | # Return +true+ if PNG image file format is supported. 17 | def FXPNGImage.supported? ; end 18 | 19 | # 20 | # Return an initialized FXPNGImage instance. 21 | # 22 | # ==== Parameters: 23 | # 24 | # +a+:: an application instance {FXApp} 25 | # +pix+:: a memory buffer formatted in PNG file format [String] 26 | # +opts+:: options [Integer] 27 | # +width+:: width [Integer] 28 | # +height+:: height [Integer] 29 | # 30 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: thePNGImage 31 | end 32 | end 33 | end 34 | 35 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuTitle.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A menu title is a child of a menu bar which is responsible 4 | # for popping up a pulldown menu. 5 | # 6 | # === Events 7 | # 8 | # The following messages are sent by FXMenuTitle to its target: 9 | # 10 | # +SEL_KEYPRESS+:: sent when a key goes down; the message data is an FXEvent instance. 11 | # +SEL_KEYRELEASE+:: sent when a key goes up; the message data is an FXEvent instance. 12 | # +SEL_LEFTBUTTONPRESS+:: sent when the left mouse button goes down; the message data is an FXEvent instance. 13 | # +SEL_LEFTBUTTONRELEASE+:: sent when the left mouse button goes up; the message data is an FXEvent instance. 14 | # 15 | class FXMenuTitle < FXMenuCaption 16 | 17 | # The popup menu {FXPopup} 18 | attr_accessor :menu 19 | 20 | # 21 | # Constructor 22 | # 23 | def initialize(parent, text, icon=nil, popupMenu=nil, opts=0) # :yields: theMenuTitle 24 | end 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /test/TC_FXRanged.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXRanged < Test::Unit::TestCase 6 | include Fox 7 | 8 | 9 | WIDTH, HEIGHT, DEPTH = 2, 4, 6 10 | 11 | def setup 12 | @range = FXRanged.new(0, WIDTH, 0, HEIGHT, 0, DEPTH) 13 | end 14 | 15 | def test_lower_is_a_vector 16 | assert_instance_of(FXVec3d, @range.lower) 17 | end 18 | 19 | def test_upper_is_a_vector 20 | assert_instance_of(FXVec3d, @range.upper) 21 | end 22 | 23 | def test_width 24 | assert_equal(@range.width, WIDTH) 25 | end 26 | 27 | def test_height 28 | assert_equal(@range.height, HEIGHT) 29 | end 30 | 31 | def test_depth 32 | assert_equal(@range.depth, DEPTH) 33 | end 34 | 35 | def test_longest 36 | assert_equal([@range.width, @range.height, @range.depth].max, @range.longest) 37 | end 38 | 39 | def test_shortest 40 | assert_equal([@range.width, @range.height, @range.depth].min, @range.shortest) 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /test/TC_FXRangef.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXRangef < Test::Unit::TestCase 6 | include Fox 7 | 8 | 9 | WIDTH, HEIGHT, DEPTH = 2, 4, 6 10 | 11 | def setup 12 | @range = FXRangef.new(0, WIDTH, 0, HEIGHT, 0, DEPTH) 13 | end 14 | 15 | def test_lower_is_a_vector 16 | assert_instance_of(FXVec3f, @range.lower) 17 | end 18 | 19 | def test_upper_is_a_vector 20 | assert_instance_of(FXVec3f, @range.upper) 21 | end 22 | 23 | def test_width 24 | assert_equal(@range.width, WIDTH) 25 | end 26 | 27 | def test_height 28 | assert_equal(@range.height, HEIGHT) 29 | end 30 | 31 | def test_depth 32 | assert_equal(@range.depth, DEPTH) 33 | end 34 | 35 | def test_longest 36 | assert_equal([@range.width, @range.height, @range.depth].max, @range.longest) 37 | end 38 | 39 | def test_shortest 40 | assert_equal([@range.width, @range.height, @range.depth].min, @range.shortest) 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /test/TC_FXUndoList.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'fox16/undolist' 4 | 5 | class DummyCommand < Fox::FXCommand 6 | def undo ; end 7 | def redo ; end 8 | def undoName 9 | "My Undo Name" 10 | end 11 | def redoName 12 | "My Redo Name" 13 | end 14 | end 15 | 16 | class TC_FXUndoList < Test::Unit::TestCase 17 | include Fox 18 | 19 | def test_cut_with_nil_marker 20 | undoList = FXUndoList.new 21 | assert_nothing_raised { 22 | undoList.cut 23 | } 24 | end 25 | 26 | def test_undoName 27 | undoList = FXUndoList.new 28 | assert_nil(undoList.undoName) 29 | c = DummyCommand.new 30 | undoList.add(c) 31 | assert_equal(c.undoName, undoList.undoName) 32 | end 33 | 34 | def test_redoName 35 | undoList = FXUndoList.new 36 | assert_nil(undoList.redoName) 37 | c = DummyCommand.new 38 | undoList.add(c) 39 | undoList.undo 40 | assert_equal(c.redoName, undoList.redoName) 41 | end 42 | end 43 | 44 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuCheck.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The FXMenuCheck widget is used to change a state in the application from a menu. 4 | # Menu checks may reflect the state of the application by graying out, becoming 5 | # hidden, or by a check mark. 6 | # When activated, a menu check sends a +SEL_COMMAND+ message to its target; 7 | # the message data contains the new state (one of +TRUE+, +FALSE+ or +MAYBE+). 8 | # 9 | # === Events 10 | # 11 | # The following messages are sent by FXMenuCheck to its target: 12 | # 13 | # +SEL_COMMAND+:: sent when the command is activated 14 | # 15 | class FXMenuCheck < FXMenuCommand 16 | 17 | # Check state, one of +TRUE+, +FALSE+ or +MAYBE+ 18 | attr_accessor :check 19 | 20 | # Box background color {FXColor} 21 | attr_accessor :boxColor 22 | 23 | # 24 | # Construct a menu check 25 | # 26 | def initialize(p, text, target=nil, selector=0, opts=0) # :yields: theMenuCheck 27 | end 28 | end 29 | end 30 | 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXPrintDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Printer selection dialog 4 | # 5 | # == Message identifiers 6 | # 7 | # +ID_TO_PRINTER+:: x 8 | # +ID_TO_FILE+:: x 9 | # +ID_PRINTER_NAME+:: x 10 | # +ID_FILE_NAME+:: x 11 | # +ID_LANDSCAPE+:: x 12 | # +ID_PORTRAIT+:: x 13 | # +ID_MEDIA+:: x 14 | # +ID_COLLATE_NORMAL+:: x 15 | # +ID_COLLATE_REVERSED+:: x 16 | # +ID_PAGES_ALL+:: x 17 | # +ID_PAGES_EVEN+:: x 18 | # +ID_PAGES_ODD+:: x 19 | # +ID_PAGES_RANGE+:: x 20 | # +ID_PAGES_FIRST+:: x 21 | # +ID_PAGES_LAST+:: x 22 | # +ID_BROWSE_FILE+:: x 23 | # +ID_PROPERTIES+:: x 24 | # +ID_COLOR_PRINTER+:: x 25 | # +ID_GRAY_PRINTER+:: x 26 | # +ID_NUM_COPIES+:: x 27 | # 28 | class FXPrintDialog < FXDialogBox 29 | # Printer information {FXPrinter} 30 | attr_accessor :printer 31 | 32 | # Construct print dialog 33 | def initialize(owner, name, opts=0, x=0, y=0, width=0, height=0) # :yields: thePrintDialog 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /test/TC_FXLight.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXLight < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | @light = FXLight.new 10 | end 11 | def testAttributes 12 | assert(@light.ambient) 13 | assert_kind_of(FXVec4f, @light.ambient) 14 | assert(@light.diffuse) 15 | assert_kind_of(FXVec4f, @light.diffuse) 16 | assert(@light.specular) 17 | assert_kind_of(FXVec4f, @light.specular) 18 | assert(@light.position) 19 | assert_kind_of(FXVec4f, @light.position) 20 | assert(@light.direction) 21 | assert_kind_of(FXVec3f, @light.direction) 22 | assert(@light.exponent) 23 | assert_kind_of(Float, @light.exponent) 24 | assert(@light.cutoff) 25 | assert_kind_of(Float, @light.cutoff) 26 | assert(@light.c_attn) 27 | assert_kind_of(Float, @light.c_attn) 28 | assert(@light.l_attn) 29 | assert_kind_of(Float, @light.l_attn) 30 | assert(@light.q_attn) 31 | assert_kind_of(Float, @light.q_attn) 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /test/TC_FXRegistry.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | class TC_FXRegistry < Test::Unit::TestCase 5 | include Fox 6 | 7 | def setup 8 | @reg = FXRegistry.new("TC_FXRegistry", "FXRuby") 9 | end 10 | 11 | def test_boolEntries 12 | assert(@reg.writeBoolEntry("SETTINGS", "trueEntry", true)) 13 | assert(@reg.writeBoolEntry("SETTINGS", "falseEntry", false)) 14 | 15 | assert(@reg.readBoolEntry("SETTINGS", "trueEntry")) 16 | assert(@reg.readBoolEntry("SETTINGS", "trueEntry", true)) 17 | assert(@reg.readBoolEntry("SETTINGS", "trueEntry", false)) 18 | 19 | assert(!@reg.readBoolEntry("SETTINGS", "falseEntry")) 20 | assert(!@reg.readBoolEntry("SETTINGS", "falseEntry", true)) 21 | assert(!@reg.readBoolEntry("SETTINGS", "falseEntry", false)) 22 | 23 | assert(!@reg.readBoolEntry("SETTINGS", "missingEntry")) 24 | assert(!@reg.readBoolEntry("SETTINGS", "missingEntry", false)) 25 | assert( @reg.readBoolEntry("SETTINGS", "missingEntry", true)) 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /rdoc-sources/FXStringDict.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # An FXStringDict (string dictionary) object maps one string to another 4 | # string. The inserted strings are copied when they're inserted. 5 | # 6 | class FXStringDict < FXDict 7 | # 8 | # Return an initialized FXStringDict instance. 9 | # 10 | def initialize; end 11 | 12 | # 13 | # Insert a new string indexed by key, with given mark flag. 14 | # 15 | def insert(key, value, mrk=false); end 16 | 17 | # 18 | # Replace or insert a new string indexed by key, unless given mark is lower than the existing mark. 19 | # 20 | def replace(key, value, mrk=false); end 21 | 22 | # 23 | # Remove entry indexed by key. 24 | # 25 | def remove(key); end 26 | 27 | # 28 | # Return the entry indexed by _key_, or nil if the key does not exist. 29 | # 30 | def find(key); end 31 | 32 | # 33 | # Return the string at integer position _pos_. 34 | # 35 | def data(pos); end 36 | end 37 | end 38 | 39 | -------------------------------------------------------------------------------- /test/testcase.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | 4 | module Fox 5 | class TestCase < Test::Unit::TestCase 6 | # 7 | # Construct an application and main window for this test case's 8 | # use, based on the supplied application name. 9 | # 10 | def setup(*args) 11 | unless args.empty? 12 | appName = args[0] 13 | if FXApp.instance.nil? 14 | @theApp = FXApp.new(appName, 'FXRuby') 15 | @theApp.init([]) 16 | else 17 | @theApp = FXApp.instance 18 | end 19 | @theMainWindow = FXMainWindow.new(@theApp, appName) 20 | end 21 | end 22 | 23 | # Return a reference to the application 24 | def app 25 | @theApp 26 | end 27 | 28 | # Return a reference to the main window 29 | def mainWindow 30 | @theMainWindow 31 | end 32 | 33 | # Override the base class version of default_test() so that 34 | # a test case with no tests doesn't trigger an error. 35 | def default_test; end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /rdoc-sources/FXPPMIcon.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Portable Pixmap (PPM) icon class. 4 | # 5 | class FXPPMIcon < FXIcon 6 | # 7 | # Return the suggested file extension for this image type ("ppm"). 8 | # 9 | def FXPPMIcon.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXPPMIcon.mimeType; end 15 | 16 | # 17 | # Return an initialized FXPPMIcon instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pix+:: a memory buffer formatted in PPM file format [String] 23 | # +clr+:: transparency color {FXColor} 24 | # +opts+:: options [Integer] 25 | # +width+:: width [Integer] 26 | # +height+:: height [Integer] 27 | # 28 | def initialize(a, pix=nil, clr=0, opts=0, width=1, height=1) # :yields: thePPMIcon 29 | end 30 | end 31 | 32 | # 33 | # Return +true+ if _store_ (an FXStream instance) contains a PPM image. 34 | # 35 | def Fox.fxcheckPPM(store); end 36 | end 37 | -------------------------------------------------------------------------------- /rdoc-sources/FXPicker.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A picker button allows you to identify an arbitrary 4 | # location on the screen. 5 | # 6 | # === Events 7 | # 8 | # The following messages are sent by FXPicker to its target: 9 | # 10 | # +SEL_CHANGED+:: 11 | # sent continuously while the position is changing; the message data is an 12 | # FXPoint instance indicating the current root window position of the mouse 13 | # pointer. 14 | # +SEL_COMMAND+:: 15 | # sent when the left mouse button is clicked the second time (i.e. to 16 | # "pick" a position); the message data is an FXPoint instance indicating 17 | # the picked position in root window coordinates. 18 | # 19 | class FXPicker < FXButton 20 | # 21 | # Constructor 22 | # 23 | def initialize(p, text, ic=nil, target=nil, selector=0, opts=BUTTON_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: thePicker 24 | end 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /rdoc-sources/FXTIFImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Tagged Image File Format (TIFF) Image 4 | # 5 | class FXTIFImage < FXImage 6 | # 7 | # Return the suggested file extension for this image type ("tif"). 8 | # 9 | def FXTIFImage.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXTIFImage.mimeType; end 15 | 16 | # Return +true+ if TIF image file format is supported. 17 | def FXTIFImage.supported? ; end 18 | 19 | # Codec setting [Integer] 20 | attr_accessor :codec 21 | 22 | # 23 | # Return an initialized FXTIFImage instance. 24 | # 25 | # ==== Parameters: 26 | # 27 | # +a+:: an application instance {FXApp} 28 | # +pix+:: a memory buffer formatted in TIF file format [String] 29 | # +opts+:: options [Integer] 30 | # +width+:: width [Integer] 31 | # +height+:: height [Integer] 32 | # 33 | def initialize(a, pix=nil, opts=0, width=1, height=1) # :yields: theTIFImage 34 | end 35 | end 36 | end 37 | 38 | -------------------------------------------------------------------------------- /rdoc-sources/FXSplashWindow.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The Splash Window is a window typically shown during startup 4 | # of an application. It comprises a large icon, which is also 5 | # used as the shape of the window if +SPLASH_SHAPED+ is passed; 6 | # with the +SPLASH_SIMPLE+ option the window will be simply rectangular. 7 | # 8 | # === Splash window options 9 | # 10 | # +SPLASH_SIMPLE+:: Simple rectangular splash window 11 | # +SPLASH_SHAPED+:: Shaped splash window 12 | # +SPLASH_OWNS_ICON+:: Does nothing - for backward compatibility only 13 | # +SPLASH_DESTROY+:: Splash window will destroy itself when timer expires 14 | # 15 | class FXSplashWindow < FXTopWindow 16 | # The splash window's icon {FXIcon} 17 | attr_accessor :icon 18 | 19 | # The delay before hiding the splash window, in milliseconds [Integer] 20 | attr_accessor :delay 21 | 22 | # Construct splash window 23 | def initialize(owner, icon, opts=SPLASH_SIMPLE, ms=5000) # :yields: theSplashWindow 24 | end 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /scripts/build-fox.rb: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/ruby 2 | 3 | def build_project(topdir, project) 4 | dspfile = [topdir, 'windows', 'vcpp', project, project + '.dsp'].join(File::ALT_SEPARATOR) 5 | 6 | # Modify the project file to compile-in support for non-native 7 | # image file formats 8 | bytes = nil 9 | File.open(dspfile, 'rb') { |f| bytes = f.read } 10 | bytes.sub!('/D "HAVE_GL_H" /D "HAVE_GLU_H"', 11 | '/D "HAVE_GL_H" /D "HAVE_GLU_H" /D "HAVE_JPEG_H" /D "HAVE_PNG_H" /D "HAVE_TIFF_H"') 12 | bytes.sub!('glu32.lib', 13 | 'glu32.lib libpng.lib zlib.lib libjpeg.lib libtiff.lib') 14 | File.open(dspfile, 'wb') { |f| f.write(bytes) } 15 | 16 | # Build the library 17 | system("msdev #{dspfile} /make \"#{project} - Win32 Release\"") 18 | end 19 | 20 | if __FILE__ == $0 21 | if ARGV.length != 1 22 | puts 'Usage: build-fox [fox-src-dir]' 23 | exit 24 | end 25 | 26 | topdir = ARGV[0] 27 | puts "Building library in #{topdir}..." 28 | 29 | build_project(topdir, 'fox') 30 | # build_project(topdir, 'foxdll') 31 | end 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXComposite.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Base composite 4 | # 5 | # === Events 6 | # 7 | # The following messages are sent from FXComposite to its target: 8 | # 9 | # +SEL_KEYPRESS+:: 10 | # sent when a key goes down, but only if there is no other widget with the 11 | # focus (or if the focused widget doesn't handle this keypress). The message 12 | # data is an FXEvent instance. 13 | # +SEL_KEYRELEASE+:: 14 | # sent when a key goes up, but only if there is no other widget with the 15 | # focus (or if the focused widget doesn't handle this key release). The message 16 | # data is an FXEvent instance. 17 | # 18 | class FXComposite < FXWindow 19 | # Constructor 20 | def initialize(parent, opts=0, x=0, y=0, width=0, height=0) # :yields: theComposite 21 | end 22 | 23 | # 24 | # Return the width of the widest child window. 25 | # 26 | def maxChildWidth() ; end 27 | 28 | # 29 | # Return the height of the tallest child window. 30 | # 31 | def maxChildHeight() ; end 32 | end 33 | end 34 | 35 | -------------------------------------------------------------------------------- /rdoc-sources/FXJPGImage.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # JPEG Image class 4 | # 5 | class FXJPGImage < FXImage 6 | 7 | # 8 | # Return the suggested file extension for this image type ("jpg"). 9 | # 10 | def FXJPGImage.fileExt; end 11 | 12 | # 13 | # Return the MIME type for this image type 14 | # 15 | def FXJPGImage.mimeType; end 16 | 17 | # Return +true+ if JPEG image file format is supported. 18 | def FXJPGImage.supported? ; end 19 | 20 | # Image quality 21 | attr_accessor :quality 22 | 23 | # 24 | # Return an initialized FXJPGImage instance. 25 | # 26 | # ==== Parameters: 27 | # 28 | # +a+:: an application instance {FXApp} 29 | # +pix+:: a memory buffer formatted in JPEG file format [String] 30 | # +opts+:: options [Integer] 31 | # +width+:: width [Integer] 32 | # +height+:: height [Integer] 33 | # +quality+:: JPEG image quality [Integer] 34 | # 35 | def initialize(a, pix=nil, opts=0, width=1, height=1, quality=75) # :yields: theJPGImage 36 | end 37 | end 38 | end 39 | 40 | -------------------------------------------------------------------------------- /rdoc-sources/FXBitmapFrame.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The bitmap frame is a simple frame widget displaying an monochrome bitmap 4 | # image; the bitmap is not owned by the bitmap frame so it must be explicitly 5 | # deleted elsewhere. 6 | # 7 | class FXBitmapFrame < FXFrame 8 | 9 | # The current image being displayed {FXBitmap} 10 | attr_accessor :bitmap 11 | 12 | # The color used for the "on" bits in the bitmap {FXColor} 13 | attr_accessor :onColor 14 | 15 | # The color used for the "off" bits in the bitmap {FXColor} 16 | attr_accessor :offColor 17 | 18 | # 19 | # The current justification mode, some combination of the flags 20 | # +JUSTIFY_LEFT+, +JUSTIFY_RIGHT+, +JUSTIFY_TOP+ and +JUSTIFY_BOTTOM+ 21 | # [Integer] 22 | # 23 | attr_accessor :justify 24 | 25 | # 26 | # Return an initialized FXBitmapFrame instance. 27 | # 28 | def initialize(p, bmp, opts=FRAME_SUNKEN|FRAME_THICK, x=0, y=0, width=0, height=0, padLeft=0, padRight=0, padTop=0, padBottom=0) # :yields: theBitmapFrame 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /rdoc-sources/FXMainWindow.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The Main Window is usually the central window of an application. Applications 4 | # may have any number of main windows. 5 | # When a MainWindow is closed, it sends a SEL_CLOSE message to its target; the target 6 | # should return 0 if there is no objection against proceeding with the close, and 7 | # return 1 otherwise. 8 | # After the SEL_CLOSE message has been sent and no objection was raised, the main 9 | # window will delete itself. 10 | # 11 | # === Events 12 | # 13 | # The following messages are sent by FXMainWindow to its target: 14 | # 15 | # +SEL_CLOSE+:: 16 | # sent when the user clicks the close button in the upper right-hand 17 | # corner of the main window. 18 | # 19 | class FXMainWindow < FXTopWindow 20 | # 21 | # Construct a main window 22 | # 23 | def initialize(app, title, icon=nil, miniIcon=nil, opts=DECOR_ALL, x=0, y=0, width=0, height=0, padLeft=0, padRight=0, padTop=0, padBottom=0, hSpacing=4, vSpacing=4) # :yields: theMainWindow 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /rdoc-sources/FXToolTip.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # Hopefully Helpful Hint message 3 | # 4 | # = Tooltip styles 5 | # TOOLTIP_PERMANENT:: Tooltip stays up indefinitely 6 | # TOOLTIP_VARIABLE:: Tooltip stays up variable time, depending on the length of the string 7 | # TOOLTIP_NORMAL:: Normal tooltip 8 | # 9 | # = Message identifiers 10 | # 11 | # ID_TIP_SHOW:: Show it 12 | # ID_TIP_HIDE:: Hide it 13 | # 14 | class FXToolTip < FXShell 15 | # Construct a tool tip 16 | def initialize(app, opts=TOOLTIP_NORMAL, x=0, y=0, width=0, height=0); end 17 | 18 | # Set the text for this tip 19 | def text=(text); end 20 | 21 | # Get the text for this tip 22 | def text() ; end 23 | 24 | # Set the tip text font 25 | def font=(font) ; end 26 | 27 | # Get the tip text font 28 | def font() ; end 29 | 30 | # Get the current tip text color 31 | def textColor() ; end 32 | 33 | # Set the current tip text color 34 | def textColor=(color); end 35 | 36 | # Return the tool tip's text 37 | def to_s; text; end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /examples/charts.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | 3 | begin 4 | require 'google_chart' 5 | require 'open-uri' 6 | rescue LoadError 7 | warn("LoadError: To execute this app you need to have 'google_chart' gem installed.") 8 | sleep(5) 9 | exit(false) 10 | end 11 | 12 | include Fox 13 | 14 | class ChartsWindow < FXMainWindow 15 | def initialize(app) 16 | super(app, "Google Charts Demo", :width => 650, :height => 250) 17 | FXImageFrame.new(self, nil, :opts => LAYOUT_FILL) do |f| 18 | f.image = FXPNGImage.new(app, open(bar_chart.to_escaped_url, "rb").read) 19 | end 20 | end 21 | 22 | def bar_chart 23 | GoogleChart::BarChart.new('600x200', 'My Chart', :vertical) do |bc| 24 | bc.data 'Trend 1', [5,4,3,1,3,5], '0000ff' 25 | bc.data 'Trend 2', [1,2,3,4,5,6], 'ff0000' 26 | bc.data 'Trend 3', [6,5,4,4,5,6], '00ff00' 27 | end 28 | end 29 | 30 | def create 31 | super 32 | show(PLACEMENT_SCREEN) 33 | end 34 | end 35 | 36 | if __FILE__ == $0 37 | FXApp.new do |app| 38 | ChartsWindow.new(app) 39 | app.create 40 | app.run 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /rdoc-sources/FXXBMIcon.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # X Bitmap (XBM) Icon 4 | # 5 | class FXXBMIcon < FXIcon 6 | # 7 | # Return the suggested file extension for this image type ("xbm"). 8 | # 9 | def FXXBMIcon.fileExt; end 10 | 11 | # 12 | # Return the MIME type for this image type 13 | # 14 | def FXXBMIcon.mimeType; end 15 | 16 | # 17 | # Return an initialized FXXBMIcon instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +a+:: an application instance {FXApp} 22 | # +pixels+:: a memory buffer formatted in XBM file format [String] 23 | # +mask+:: a memory buffer formatted in XBM file format [String] 24 | # +clr+:: transparency color {FXColor} 25 | # +opts+:: options [Integer] 26 | # +width+:: width [Integer] 27 | # +height+:: height [Integer] 28 | # 29 | def initialize(a, pixels=nil, mask=nil, clr=0, opts=0, width=1, height=1) # :yields: theXBMIcon 30 | end 31 | end 32 | 33 | # 34 | # Return +true+ if _store_ (an FXStream instance) contains an XBM image. 35 | # 36 | def Fox.fxcheckXBM(store); end 37 | end 38 | -------------------------------------------------------------------------------- /test/TC_FXTopWindow.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXTopWindow < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | if FXApp.instance.nil? 10 | @app = FXApp.new('TC_FXTopWindow', 'FXRuby') 11 | @app.init([]) 12 | else 13 | @app = FXApp.instance 14 | end 15 | @mainWin = FXMainWindow.new(@app, 'TC_FXButton') 16 | end 17 | 18 | def test_nil_app_raises_argument_error 19 | assert_raise(ArgumentError){ FXTopWindow.new(nil, 'TC_FXButton') } 20 | end 21 | 22 | def test_new 23 | # Free-floating 24 | top1 = FXTopWindow.new(@app, "top1", nil, nil, DECOR_ALL, 0, 0, 0, 0, 25 | DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, 26 | DEFAULT_SPACING, DEFAULT_SPACING) 27 | assert_equal("top1", top1.title) 28 | 29 | # Owned 30 | top2 = FXTopWindow.new(@mainWin, "top2", nil, nil, DECOR_ALL, 0, 0, 0, 0, 31 | DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, DEFAULT_PAD, 32 | DEFAULT_SPACING, DEFAULT_SPACING) 33 | assert_same(@mainWin, top2.owner) 34 | assert_equal("top2", top2.title) 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /test/TC_FXTableItem.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class OverrideError < Exception 6 | end 7 | 8 | class CustomTableItem < Fox::FXTableItem 9 | def getText 10 | raise OverrideError 11 | end 12 | def getIcon 13 | raise OverrideError 14 | end 15 | end 16 | 17 | class TC_FXTableItem < Fox::TestCase 18 | include Fox 19 | 20 | def setup 21 | super(self.class.name) 22 | @table = FXTable.new(mainWindow) 23 | @table.setTableSize(1, 1) 24 | @tableItem = FXTableItem.new("item") 25 | end 26 | 27 | def test_setStipple 28 | @tableItem.stipple = STIPPLE_CROSSDIAG 29 | end 30 | 31 | def test_getStipple 32 | assert_kind_of(Integer, @tableItem.stipple) 33 | end 34 | 35 | def test_overridden_getText 36 | @table.setItem(0, 0, CustomTableItem.new("")) 37 | assert_raises(OverrideError) { 38 | @table.getItemText(0, 0) 39 | } 40 | end 41 | 42 | def test_overridden_getIcon 43 | @table.setItem(0, 0, CustomTableItem.new("")) 44 | assert_raises(OverrideError) { 45 | @table.getItemIcon(0, 0) 46 | } 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2022 2 | 3 | clone_depth: 1 4 | 5 | init: 6 | - SET PATH=c:/Ruby%ruby_version%/bin;%PATH% 7 | install: 8 | - ps: | 9 | if ($env:ruby_version -like "*head*") { 10 | $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe") 11 | cmd /c ruby-setup.exe /currentuser /verysilent /dir=C:/Ruby$env:ruby_version 12 | } 13 | - ruby --version 14 | - gem --version 15 | - ridk version 16 | - ridk enable 17 | # Install required packages 18 | - c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-pkgconf ${MINGW_PACKAGE_PREFIX}-fox ${MINGW_PACKAGE_PREFIX}-swig ${MINGW_PACKAGE_PREFIX}-gcc" 19 | - gcc -v 20 | - swig -version 21 | - gem install bundler --conservative 22 | - bundle config set force_ruby_platform true 23 | - bundle install 24 | build_script: 25 | - bundle exec rake compile 26 | test_script: 27 | - bundle exec rake test 28 | environment: 29 | matrix: 30 | - ruby_version: "head-x64" 31 | - ruby_version: "32" 32 | -------------------------------------------------------------------------------- /test/TC_FXGLViewer.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXGLViewer < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | vis = FXGLVisual.new(app, VISUAL_DOUBLEBUFFER) 11 | @viewer = FXGLViewer.new(mainWindow, vis) 12 | end 13 | 14 | def test_supported 15 | arr = FXGLVisual.supported(app) 16 | assert_equal 3, arr.length, "return array should have elements [support, major, minor]" 17 | assert_true arr[0], "OpenGL should be supported" 18 | assert_operator 1, :<=, arr[1], "OpenGL should be version 1.0 or greater" 19 | end 20 | 21 | def test_supported? 22 | assert_true FXGLVisual.supported?(app), "OpenGL should be supported" 23 | end 24 | 25 | def test_nil_app_raises_argument_error 26 | err = assert_raise{ FXGLVisual.supported?(nil) } 27 | assert_match(/NULL pointer/, err.to_s) 28 | end 29 | 30 | =begin 31 | def test_readPixels 32 | pixels = @viewer.readPixels(0, 0, @viewer.width, @viewer.height) 33 | assert(pixels) 34 | assert_equal(3*@viewer.width*@viewer.height, pixels.size) 35 | end 36 | =end 37 | end 38 | -------------------------------------------------------------------------------- /test/TC_FXJPGImage.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | require 'test/unit' 3 | require 'testcase' 4 | require 'openssl' 5 | 6 | class TC_FXJPGImage < Fox::TestCase 7 | include Fox 8 | 9 | def setup 10 | super(self.class.name) 11 | end 12 | 13 | def test_save_with_thread 14 | w, h = 4000, 3000 15 | img_data = OpenSSL::Random.random_bytes(w) * h * 4 16 | 17 | count = 0 18 | th = Thread.new do 19 | loop do 20 | count += 1 21 | end 22 | end 23 | 24 | img = FXJPGImage.new(app) 25 | img.setPixels( img_data, 0, w, h ) 26 | 27 | jpeg_data = FXMemoryStream.open(FXStreamSave, nil) do |outfile| 28 | img.savePixels(outfile) 29 | outfile.takeBuffer 30 | end 31 | 32 | assert_operator(count, :>=, 500000) 33 | assert_operator(jpeg_data.bytesize, :>=, 1000) 34 | 35 | count = 0 36 | img = FXJPGImage.new(app) 37 | FXMemoryStream.open(FXStreamLoad, jpeg_data) do |infile| 38 | img.loadPixels(infile) 39 | end 40 | 41 | th.kill 42 | 43 | assert_equal 4000, img.width 44 | assert_equal 3000, img.height 45 | assert_operator(count, :>=, 500000) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuRadio.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The FXMenuRadio widget is used to change a state in the application from a menu. 4 | # Menu radio commands may reflect the state of the application by graying out, becoming 5 | # hidden, or by displaying a bullet. 6 | # When activated, a menu radio sends a +SEL_COMMAND+ to its target; 7 | # the message data contains the new state. 8 | # A collection of menu radio widgets which belong to each other 9 | # is supposed to be updated by a common +SEL_UPDATE+ handler to 10 | # properly maintain the state between them. 11 | # 12 | # === Events 13 | # 14 | # The following messages are sent by FXMenuRadio to its target: 15 | # 16 | # +SEL_COMMAND+:: sent when the command is activated 17 | # 18 | class FXMenuRadio < FXMenuCommand 19 | 20 | # Radio button state, one of +TRUE+, +FALSE+ or +MAYBE+ 21 | attr_accessor :check 22 | 23 | # Radio background color {FXColor} 24 | attr_accessor :radioColor 25 | 26 | # 27 | # Construct a menu radio 28 | # 29 | def initialize(p, text, target=nil, selector=0, opts=0) # :yields: theMenuRadio 30 | end 31 | end 32 | end 33 | 34 | -------------------------------------------------------------------------------- /rdoc-sources/FXImageView.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The FXImageView widget displays a scrollable view of an image. 4 | # 5 | # === Image alignment styles 6 | # 7 | # +IMAGEVIEW_NORMAL+:: Normal mode is centered 8 | # +IMAGEVIEW_CENTER_X+:: Centered horizontally 9 | # +IMAGEVIEW_LEFT+:: Left-aligned 10 | # +IMAGEVIEW_RIGHT+:: Right-aligned 11 | # +IMAGEVIEW_CENTER_Y+:: Centered vertically 12 | # +IMAGEVIEW_TOP+:: Top-aligned 13 | # +IMAGEVIEW_BOTTOM+:: Bottom-aligned 14 | # 15 | # === Events 16 | # 17 | # +SEL_RIGHTBUTTONPRESS+:: sent when the right mouse button goes down; the message data is an FXEvent instance. 18 | # +SEL_RIGHTBUTTONRELEASE+:: sent when the right mouse button goes up; the message data is an FXEvent instance. 19 | # 20 | class FXImageView < FXScrollArea 21 | 22 | # The image {FXImage} 23 | attr_accessor :image 24 | 25 | # Current alignment [Integer] 26 | attr_accessor :alignment 27 | 28 | # 29 | # Return an initialized FXImageView instance. 30 | # 31 | def initialize(p, img=nil, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theImageView 32 | end 33 | end 34 | end 35 | 36 | -------------------------------------------------------------------------------- /test/TC_FXTreeListBox.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXTreeListBox < Fox::TestCase 6 | include Fox 7 | 8 | 9 | def setup 10 | super(self.class.name) 11 | @treeListBox = FXTreeListBox.new(mainWindow) 12 | end 13 | 14 | def test_sortRootItems 15 | @treeListBox.appendItem(nil, "B") 16 | @treeListBox.appendItem(nil, "A") 17 | @treeListBox.appendItem(nil, "C") 18 | @treeListBox.sortRootItems 19 | assert_equal("A", @treeListBox.firstItem.text) 20 | assert_equal("B", @treeListBox.firstItem.next.text) 21 | assert_equal("C", @treeListBox.lastItem.text) 22 | end 23 | 24 | def test_each_for_empty_list 25 | count = 0 26 | @treeListBox.each { |item| count += 1 } 27 | assert_equal(0, count, "count for empty list should be zero") 28 | end 29 | 30 | def test_each 31 | @treeListBox.appendItem(nil, "1") 32 | @treeListBox.appendItem(nil, "2") 33 | @treeListBox.appendItem(nil, "3") 34 | @treeListBox.appendItem(nil, "4") 35 | count = 0 36 | @treeListBox.each { |item| count += 1 } 37 | assert_equal(4, count, "count didn't match expected number of items") 38 | end 39 | 40 | end 41 | 42 | -------------------------------------------------------------------------------- /lib/fox16/pseudokeyboard.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # An FXPseudoKeyboard object provides a simple means to operate widgets 4 | # programmatically, to aid test driven design. An FXPseudoKeyboard instance 5 | # can be pointed at an FXObject and will manage the sending of events to 6 | # it. 7 | # 8 | # For example: 9 | # 10 | # textfield = FXTextField.new(...) 11 | # pk = FXPseudoKeyboard.new(textfield) 12 | # pk.doKeyPress # sends a SEL_KEYPRESS message to the textfield 13 | # pk.doKeyRelease # sends a SEL_KEYRELEASE message to the textfield 14 | # 15 | class FXPseudoKeyboard 16 | 17 | attr_accessor :target 18 | 19 | def initialize(tgt=nil) 20 | @target = tgt 21 | end 22 | 23 | def doKeyPress 24 | unless @target.nil? 25 | evt = FXEvent.new 26 | evt.type = Fox::SEL_KEYPRESS 27 | @target.handle(self, Fox.FXSEL(Fox::SEL_KEYPRESS, 0), evt) 28 | end 29 | end 30 | 31 | def doKeyRelease 32 | unless @target.nil? 33 | evt = FXEvent.new 34 | evt.type = Fox::SEL_KEYRELEASE 35 | @target.handle(self, Fox.FXSEL(Fox::SEL_KEYRELEASE, 0), evt) 36 | end 37 | end 38 | end 39 | end 40 | 41 | -------------------------------------------------------------------------------- /rdoc-sources/FXProgressDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A progress dialog is a simple dialog which is used to 4 | # keep a user informed of the progress of a lengthy operation 5 | # in a program and that the program is in fact still working. 6 | # 7 | # === Options 8 | # 9 | # +PROGRESSDIALOG_NOCANCEL+:: Default is no cancel button 10 | # +PROGRESSDIALOG_CANCEL+:: Enable the cancel button 11 | # +PROGRESSDIALOG_NORMAL+:: same as DECOR_TITLE|DECOR_BORDER 12 | # 13 | class FXProgressDialog < FXDialogBox 14 | # Progress message [String] 15 | attr_accessor :message 16 | 17 | # Amount of progress [Integer] 18 | attr_accessor :progress 19 | 20 | # Maximum value for progress [Integer] 21 | attr_accessor :total 22 | 23 | # 24 | # Construct progress dialog box with given caption and message string. 25 | # 26 | def initialize(owner, caption, label, opts=PROGRESSDIALOG_NORMAL, x=0, y=0, width=0, height=0) # :yields: theProgressDialog 27 | end 28 | 29 | # Increment progress by given _amount_. 30 | def increment(amount); end 31 | 32 | # Return true if the operation was cancelled. 33 | def cancelled?; end 34 | end 35 | end 36 | 37 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbListItemVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of create() 3 | virtual void create(); 4 | 5 | // Overrides the base class version of detach() 6 | virtual void detach(); 7 | 8 | // Overrides the base class version of destroy() 9 | virtual void destroy(); 10 | 11 | // Overrides the base class version of setText() 12 | virtual void setText(const FXString& txt); 13 | 14 | // Overrides the base class version of setIcon() 15 | virtual void setIcon(FXIcon* icn,FXbool owned=FALSE); 16 | 17 | // Overrides the base class version of setFocus() 18 | virtual void setFocus(FXbool focus); 19 | 20 | // Overrides the base class version of setSelected() 21 | virtual void setSelected(FXbool selected); 22 | 23 | // Overrides the base class version of setEnabled() 24 | virtual void setEnabled(FXbool enabled); 25 | 26 | // Overrides the base class version of setDraggable() 27 | virtual void setDraggable(FXbool draggable); 28 | 29 | // Overrides the base class version of getWidth() 30 | virtual FXint getWidth(const FXList* list) const; 31 | 32 | // Overrides the base class version of getHeight() 33 | virtual FXint getHeight(const FXList* list) const; 34 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbListVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | /// Overrides the base class version of enableItem() 3 | virtual FXbool enableItem(FXint index); 4 | 5 | /// Overrides the base class version of disableItem() 6 | virtual FXbool disableItem(FXint index); 7 | 8 | /// Overrides the base class version of makeItemVisible() 9 | virtual void makeItemVisible(FXint index); 10 | 11 | /// Overrides the base class version of getItemAt() 12 | virtual FXint getItemAt(FXint x,FXint y) const; 13 | 14 | /// Overrides the base class version of selectItem() 15 | virtual FXbool selectItem(FXint index,FXbool notify=FALSE); 16 | 17 | /// Overrides the base class version of deselectItem() 18 | virtual FXbool deselectItem(FXint index,FXbool notify=FALSE); 19 | 20 | /// Overrides the base class version of toggleItem() 21 | virtual FXbool toggleItem(FXint index,FXbool notify=FALSE); 22 | 23 | /// Overrides the base class version of extendSelection() 24 | virtual FXbool extendSelection(FXint index,FXbool notify=FALSE); 25 | 26 | /// Overrides the base class version of killSelection() 27 | virtual FXbool killSelection(FXbool notify=FALSE); 28 | 29 | /// Overrides the base class version of setCurrentItem() 30 | virtual void setCurrentItem(FXint index,FXbool notify=FALSE); 31 | -------------------------------------------------------------------------------- /rdoc-sources/FXGroupBox.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # An FXGroupBox widget provides a nice raised or sunken border 3 | # around a group of widgets, providing a visual delineation. 4 | # Typically, a title is placed over the border to provide some 5 | # clarification. 6 | # 7 | # === Group box options 8 | # 9 | # +GROUPBOX_TITLE_LEFT+:: Title is left-justified 10 | # +GROUPBOX_TITLE_CENTER+:: Title is centered 11 | # +GROUPBOX_TITLE_RIGHT+:: Title is right-justified 12 | # +GROUPBOX_NORMAL+:: same as GROUPBOX_TITLE_LEFT 13 | 14 | class FXGroupBox < FXPacker 15 | 16 | # Group box title text [String] 17 | attr_accessor :text 18 | 19 | # Group box style [Integer] 20 | attr_accessor :groupBoxStyle 21 | 22 | # Title font {FXFont} 23 | attr_accessor :font 24 | 25 | # Title text color {FXColor} 26 | attr_accessor :textColor 27 | 28 | # Construct group box layout manager 29 | def initialize(parent, text, opts=GROUPBOX_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_SPACING, padRight=DEFAULT_SPACING, padTop=DEFAULT_SPACING, padBottom=DEFAULT_SPACING, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theGroupBox 30 | end 31 | 32 | # Return the group box's title text 33 | def to_s; text; end 34 | end 35 | end 36 | 37 | -------------------------------------------------------------------------------- /test/TC_FXListBox.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXListBox < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @listBox = FXListBox.new(mainWindow) 11 | end 12 | 13 | def test_appendItem 14 | assert_equal(0, @listBox.numItems) 15 | @listBox.appendItem("An item") 16 | assert_equal(1, @listBox.numItems) 17 | end 18 | 19 | def test_appendOp 20 | assert_equal(0, @listBox.numItems) 21 | @listBox << "An item" 22 | assert_equal(1, @listBox.numItems) 23 | end 24 | 25 | def test_moveItem 26 | @listBox.appendItem("First") 27 | @listBox.appendItem("Second") 28 | assert_raises(IndexError) { 29 | @listBox.moveItem(0, -1) 30 | } 31 | assert_raises(IndexError) { 32 | @listBox.moveItem(0, 2) 33 | } 34 | assert_raises(IndexError) { 35 | @listBox.moveItem(-1, 0) 36 | } 37 | assert_raises(IndexError) { 38 | @listBox.moveItem(2, 0) 39 | } 40 | assert_nothing_raised { 41 | @listBox.moveItem(0, 0) 42 | @listBox.moveItem(0, 1) 43 | @listBox.moveItem(1, 0) 44 | @listBox.moveItem(1, 1) 45 | } 46 | assert_equal(0, @listBox.moveItem(0, 1)) 47 | assert_equal(1, @listBox.moveItem(1, 0)) 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbBitmapVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of restore() 3 | virtual void restore(); 4 | 5 | // Overrides the base class version of render() 6 | virtual void render(); 7 | 8 | // Overrides the base class version of release() 9 | virtual void release(); 10 | 11 | // Overrides the base class version of savePixels() 12 | virtual bool savePixels(FXStream& store) const; 13 | 14 | // Overrides the base class version of loadPixels() 15 | virtual bool loadPixels(FXStream& store); 16 | 17 | /// Rescale pixels to the specified width and height 18 | virtual void scale(FXint w,FXint h); 19 | 20 | /// Mirror bitmap horizontally and/or vertically 21 | virtual void mirror(FXbool horizontal,FXbool vertical); 22 | 23 | /// Rotate bitmap by degrees ccw 24 | virtual void rotate(FXint degrees); 25 | 26 | /// Crop bitmap to given rectangle 27 | virtual void crop(FXint x,FXint y,FXint w,FXint h,FXbool color=0); 28 | 29 | /// Fill bitmap with uniform value 30 | virtual void fill(FXbool color); 31 | 32 | // Overrides the base class version of setData() 33 | virtual void setData(FXuchar *pix,FXuint opts=0); 34 | 35 | // Overrides the base class version of setData() 36 | virtual void setData(FXuchar *pix,FXuint opts,FXint w,FXint h); 37 | 38 | -------------------------------------------------------------------------------- /lib/fox16/thread.rb: -------------------------------------------------------------------------------- 1 | require 'thread' 2 | 3 | module Fox 4 | 5 | class FXApp 6 | 7 | alias initialize_before_thread initialize # :nodoc: 8 | 9 | def initialize(*args, &block) 10 | initialize_before_thread(*args) 11 | event_handler_setup 12 | block.call(self) if block_given? 13 | end 14 | 15 | def runOnUiThread(&block) 16 | @event_handler_events << block 17 | @event_handler_pwr.write 'e' 18 | end 19 | 20 | private 21 | 22 | def event_handler_setup 23 | if RUBY_PLATFORM =~ /mingw|mswin/i 24 | require 'socket' 25 | gs = TCPServer.open('localhost', 0) 26 | prd = TCPSocket.open('localhost', gs.addr[1]) 27 | pwr = gs.accept 28 | gs.close 29 | else 30 | prd, pwr = IO.pipe 31 | end 32 | self.addInput(prd, Fox::INPUT_READ){ event_handler_pull(prd) } 33 | @event_handler_pwr = pwr 34 | @event_handler_events = Queue.new 35 | end 36 | 37 | def event_handler_pull(prd) 38 | prd.read(1) 39 | while !@event_handler_events.empty? 40 | ev = @event_handler_events.shift 41 | ev.call 42 | end 43 | end 44 | 45 | end # class FXApp 46 | 47 | class FXId 48 | def runOnUiThread(&block) 49 | app.runOnUiThread(&block) 50 | end 51 | end 52 | end # module Fox 53 | -------------------------------------------------------------------------------- /rdoc-sources/FXDCWindow.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A window device context allows drawing into an FXDrawable, such as an 4 | # on-screen window (i.e. FXWindow and its derivatives) or an off-screen image (FXImage 5 | # and its derivatives). 6 | # Because certain hardware resources are locked down, only one FXDCWindow may be 7 | # locked on a drawable at any one time. 8 | # 9 | class FXDCWindow < FXDC 10 | # 11 | # Construct a device context for drawing into a window (specified by _drawable_). 12 | # If _event_ is +nil_, the device context is constructed for normal drawing, and the 13 | # clip rectangle is set to the whole rectange. 14 | # If _event_ is a reference to an FXEvent, the device context is constructed for 15 | # painting in response to an expose; this sets the clip rectangle to the exposed rectangle. 16 | # If an optional code block is provided, the new device context will be passed into the block as an 17 | # argument and {#end} will be called automatically when the block terminates. 18 | # 19 | def initialize(drawable, event=nil) # :yields: dc 20 | end 21 | 22 | # 23 | # Lock in a drawable surface. 24 | # 25 | def begin(drawable) ; end 26 | 27 | # 28 | # Unlock the drawable surface. 29 | # 30 | def end() ; end 31 | end 32 | end 33 | 34 | -------------------------------------------------------------------------------- /examples/rmagick.rb: -------------------------------------------------------------------------------- 1 | require 'fox16' 2 | begin 3 | require 'RMagick' 4 | rescue LoadError 5 | warn("LoadError: To execute this app you need to have 'RMagick' gem installed.") 6 | sleep(5) 7 | exit(false) 8 | end 9 | 10 | include Fox 11 | 12 | class RMagickExample < FXMainWindow 13 | 14 | def initialize(app) 15 | super(app, "RMagick Example", :width => 800, :height => 600) 16 | 17 | # Construct an ImageList 18 | dippy = Magick::ImageList.new(File.join("icons", "dippy.png")) 19 | 20 | # Manipulate the image 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 28 | end 29 | 30 | # Extract image data and use it to construct FXPNGImage 31 | dippy_image = FXPNGImage.new(app, dippy.to_blob) 32 | 33 | # Display it inside an FXImageFrame 34 | FXImageFrame.new(self, dippy_image, :opts => LAYOUT_FILL) 35 | end 36 | 37 | def create 38 | super 39 | show(PLACEMENT_SCREEN) 40 | end 41 | 42 | end 43 | 44 | if __FILE__ == $0 45 | FXApp.new("RMagick Example", "FXRuby") do |app| 46 | RMagickExample.new(app) 47 | app.create 48 | app.run 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /test/TC_FXIconDict.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'fox16' 3 | require 'testcase' 4 | 5 | class TC_FXIconDict < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | end 11 | 12 | def test_defaultIconPath_s 13 | assert_equal("~/.foxicons:/usr/local/share/icons:/usr/share/icons", FXIconDict.defaultIconPath) 14 | end 15 | 16 | def test_empty 17 | iconDict = FXIconDict.new(app) 18 | assert(iconDict.empty?) 19 | end 20 | 21 | def test_defaultIconPath 22 | iconDict = FXIconDict.new(app) 23 | assert_equal(FXIconDict.defaultIconPath, iconDict.iconPath) 24 | end 25 | 26 | def test_iconPath 27 | iconDict = FXIconDict.new(app, "foo") 28 | assert_equal("foo", iconDict.iconPath) 29 | iconDict.iconPath = "bar" 30 | assert_equal("bar", iconDict.iconPath) 31 | end 32 | 33 | def test_insert 34 | end 35 | =begin 36 | def test_remove_existing_icon 37 | iconDict = FXIconDict.new(app) 38 | iconDict.insert("gnu-animal.xpm") 39 | assert_equal(1, iconDict.size) 40 | assert_nil(iconDict.remove("gnu-animal.xpm")) 41 | assert_equal(0, iconDict.size) 42 | end 43 | 44 | def test_remove_nonexistent_icon 45 | iconDict = FXIconDict.new(app) 46 | assert_nil(iconDict.remove("xxxxx.png")) 47 | end 48 | =end 49 | def test_find 50 | end 51 | end 52 | 53 | -------------------------------------------------------------------------------- /rdoc-sources/FXPopup.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Popup window 4 | # 5 | # === Popup internal orientation 6 | # 7 | # +POPUP_VERTICAL+:: Vertical orientation 8 | # +POPUP_HORIZONTAL+:: Horizontal orientation 9 | # +POPUP_SHRINKWRAP+:: Shrinkwrap to content 10 | # 11 | class FXPopup < FXShell 12 | 13 | # Frame style [Integer] 14 | attr_accessor :frameStyle 15 | 16 | # Border width [Integer] 17 | attr_reader :borderWidth 18 | 19 | # Highlight color {FXColor} 20 | attr_accessor :hiliteColor 21 | 22 | # Shadow color {FXColor} 23 | attr_accessor :shadowColor 24 | 25 | # Border color {FXColor} 26 | attr_accessor :borderColor 27 | 28 | # Base color {FXColor} 29 | attr_accessor :baseColor 30 | 31 | # Current grab owner {FXWindow} 32 | attr_reader :grabOwner 33 | 34 | # Popup orientation [Integer] 35 | attr_accessor :orientation 36 | 37 | # Shrinkwrap mode [Boolean] 38 | attr_accessor :shrinkWrap 39 | 40 | # 41 | # Construct popup pane 42 | # 43 | def initialize(owner, opts=POPUP_VERTICAL|FRAME_RAISED|FRAME_THICK, x=0, y=0, width=0, height=0) # :yields: thePopup 44 | end 45 | 46 | # Pop it up 47 | def popup(grabto, x, y, width=0, height=0); end 48 | 49 | # Pop it down 50 | def popdown(); end 51 | end 52 | end 53 | 54 | -------------------------------------------------------------------------------- /rdoc-sources/FXColorDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # FXColorDialog is a standard dialog panel used to edit colors. 4 | # Colors can be edited via RGB (Red, Green, Blue additive color model), 5 | # via HSV (Hue, Saturation, Value color modal), via CMY (Cyan, Magenta, 6 | # Yellow subtractive color model), or by name. 7 | # Commonly used colors can be dragged into a number of small color wells 8 | # to be used repeatedly; colors dropped into the small color wells are 9 | # automatically saved into the registry for future use. 10 | # 11 | # === Events 12 | # 13 | # The following messages are sent by FXColorDialog to its target: 14 | # 15 | # +SEL_CHANGED+:: sent continuously, while the color selector's color is changing 16 | # +SEL_COMMAND+:: sent when the new color is set 17 | # 18 | # === Message identifiers 19 | # 20 | # +ID_COLORSELECTOR+:: used internally to identify messages from the FXColorSelector 21 | 22 | class FXColorDialog < FXDialogBox 23 | 24 | # The color {FXColor} 25 | attr_accessor :rgba 26 | 27 | # Only opaque colors allowed [Boolean] 28 | attr_writer :opaqueOnly 29 | 30 | # Construct color dialog 31 | def initialize(owner, title, opts=0, x=0, y=0, width=0, height=0) # :yields: theColorDialog 32 | end 33 | 34 | # Return +true+ if only opaque colors allowed 35 | def opaqueOnly?() ; end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/TC_FXFontDesc.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXFontDesc < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | @fontdesc = FXFontDesc.new 10 | end 11 | 12 | def test_face 13 | @fontdesc.face = "Times New Roman" 14 | assert_equal("Times New Roman", @fontdesc.face) 15 | end 16 | 17 | def test_size 18 | @fontdesc.size = 120 19 | assert_equal(120, @fontdesc.size) 20 | end 21 | 22 | def test_weight 23 | weights = [FXFont::Thin, 24 | FXFont::ExtraLight, 25 | FXFont::Light, 26 | FXFont::Normal, 27 | FXFont::Medium, 28 | FXFont::DemiBold, 29 | FXFont::Bold, 30 | FXFont::ExtraBold, 31 | FXFont::Black] 32 | weights.each do |weight| 33 | @fontdesc.weight = weight 34 | assert_equal(weight, @fontdesc.weight) 35 | end 36 | end 37 | 38 | def test_slant 39 | slants = [FXFont::ReverseOblique, 40 | FXFont::ReverseItalic, 41 | FXFont::Straight, 42 | FXFont::Italic, 43 | FXFont::Oblique] 44 | slants.each do |slant| 45 | @fontdesc.slant = slant 46 | assert_equal(slant, @fontdesc.slant) 47 | end 48 | end 49 | 50 | def test_encoding 51 | end 52 | 53 | def test_setwidth 54 | end 55 | 56 | def test_flags 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /rdoc-sources/FXDriveBox.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Drive box 4 | # 5 | # === Events 6 | # 7 | # The following messages are sent by FXDriveBox to its target: 8 | # 9 | # +SEL_CHANGED+:: sent when the current item changes; the message data is the current drive 10 | # +SEL_COMMAND+:: sent when a new item is selected from the list; the message data is the drive 11 | # 12 | class FXDriveBox < FXListBox 13 | 14 | # Current drive [String] 15 | attr_accessor :drive 16 | 17 | # File associations {FXFileDict} 18 | attr_accessor :associations 19 | 20 | # Returns an initialized FXDriveBox instance 21 | def initialize(p, target=nil, selector=0, opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theDriveBox 22 | end 23 | 24 | # 25 | # Set current drive, where _drive_ is a string. 26 | # Returns +true+ on success, +false+ on failure. 27 | # 28 | def setDrive(drive); end 29 | 30 | # 31 | # Return current drive as a string. 32 | # 33 | def getDrive(); end 34 | 35 | # 36 | # Change file associations, where _assoc_ is an FXFileDict instance. 37 | # 38 | def setAssociations(assoc); end 39 | 40 | # 41 | # Return file associations (an FXFileDict instance). 42 | # 43 | def getAssociations(); end 44 | end 45 | end 46 | 47 | -------------------------------------------------------------------------------- /rdoc-sources/FXToolBarShell.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # An FXToolBarShell is a widget floating around over the main window. 4 | # It typically contains an undocked tool bar. 5 | # 6 | class FXToolBarShell < FXTopWindow 7 | 8 | # Frame style [Integer] 9 | attr_accessor :frameStyle 10 | 11 | # Border width [Integer] 12 | attr_reader :borderWidth 13 | 14 | # Highlight color {FXColor} 15 | attr_accessor :hiliteColor 16 | 17 | # Shadow color {FXColor} 18 | attr_accessor :shadowColor 19 | 20 | # Border color {FXColor} 21 | attr_accessor :borderColor 22 | 23 | # Base GUI color {FXColor} 24 | attr_accessor :baseColor 25 | 26 | # 27 | # Return an initialized FXToolBarShell instance. 28 | # 29 | # ==== Parameters: 30 | # 31 | # +owner+:: the owner window for this tool bar shell {FXWindow} 32 | # +opts+:: tool bar shell options [Integer] 33 | # +x+:: initial x-position [Integer] 34 | # +y+:: initial y-position [Integer] 35 | # +width+:: initial width [Integer] 36 | # +height+:: initial height [Integer] 37 | # +hSpacing+:: horizontal spacing between widgets, in pixels [Integer] 38 | # +vSpacing+:: vertical spacing between widgets, in pixels [Integer] 39 | # 40 | def initialize(owner, opts=FRAME_RAISED|FRAME_THICK, x=0, y=0, width=0, height=0, hSpacing=4, vSpacing=4) # :yields: theToolBarShell 41 | end 42 | end 43 | end 44 | 45 | -------------------------------------------------------------------------------- /test/TC_FXRegion.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXRegion < Test::Unit::TestCase 6 | include Fox 7 | 8 | 9 | def setup 10 | @region = FXRegion.new(5, 5, 10, 10) 11 | end 12 | 13 | def test_construct_from_points 14 | points = [ 15 | FXPoint.new(0, 0), 16 | FXPoint.new(0, 100), 17 | FXPoint.new(100, 100), 18 | FXPoint.new(0, 0) 19 | ] 20 | FXRegion.new(points, true) 21 | FXRegion.new(points, false) 22 | FXRegion.new(points) 23 | end 24 | 25 | def test_copy_constructor 26 | assert_equal(@region, FXRegion.new(@region)) 27 | end 28 | 29 | def test_empty 30 | assert(!@region.empty?) 31 | empty_region = FXRegion.new(5, 5, 0, 0) 32 | assert(empty_region.empty?) 33 | end 34 | 35 | def test_containsPoint 36 | # Definitely out of bounds 37 | assert(!@region.contains?(2, 3)) 38 | 39 | # Definitely in bounds 40 | assert(@region.contains?(6, 6)) 41 | 42 | # Check corners too 43 | assert(@region.contains?(5, 5)) 44 | assert(@region.contains?(5, 14)) 45 | assert(@region.contains?(14, 14)) 46 | assert(@region.contains?(14, 5)) 47 | end 48 | 49 | def test_containsRectangle 50 | assert(@region.contains?(2, 3, 15, 15)) # why doesn't this fail? 51 | assert(@region.contains?(5, 5, 10, 10)) 52 | assert(@region.contains?(6, 6, 5, 5)) 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /rdoc-sources/FXMenuCaption.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The menu caption is a widget which can be used as a caption 4 | # above a number of menu commands in a menu. 5 | # 6 | # === Menu caption options 7 | # 8 | # +MENU_AUTOGRAY+:: Automatically gray out when not updated 9 | # +MENU_AUTOHIDE+:: Automatically hide button when not updated 10 | # 11 | class FXMenuCaption < FXWindow 12 | 13 | # The text for this menu [String] 14 | attr_accessor :text 15 | 16 | # The icon for this menu {FXIcon} 17 | attr_accessor :icon 18 | 19 | # The text font {FXFont} 20 | attr_accessor :font 21 | 22 | # Text color {FXColor} 23 | attr_accessor :textColor 24 | 25 | # Selection background color {FXColor} 26 | attr_accessor :selBackColor 27 | 28 | # Selection text color {FXColor} 29 | attr_accessor :selTextColor 30 | 31 | # Highlight color {FXColor} 32 | attr_accessor :hiliteColor 33 | 34 | # Shadow color {FXColor} 35 | attr_accessor :shadowColor 36 | 37 | # Status line help text for this menu [String] 38 | attr_accessor :helpText 39 | 40 | # Tool tip message for this menu [String] 41 | attr_accessor :tipText 42 | 43 | # 44 | # Construct a new menu caption 45 | # 46 | def initialize(parent, text, icon=nil, opts=0) # :yields: theMenuCaption 47 | end 48 | 49 | # Return the menu caption's text 50 | def to_s; text; end 51 | end 52 | end 53 | 54 | -------------------------------------------------------------------------------- /rdoc-sources/FXVerticalFrame.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Vertical frame layout manager widget is used to automatically 4 | # place child-windows vertically from top-to-bottom, or bottom-to-top, 5 | # depending on the child window's layout hints. 6 | # 7 | class FXVerticalFrame < FXPacker 8 | # 9 | # Return an initialized FXVerticalFrame instance. 10 | # 11 | # ==== Parameters: 12 | # 13 | # +p+:: the parent window for this vertical frame {FXComposite} 14 | # +opts+:: frame options [Integer] 15 | # +x+:: initial x-position [Integer] 16 | # +y+:: initial y-position [Integer] 17 | # +width+:: initial width [Integer] 18 | # +height+:: initial height [Integer] 19 | # +padLeft+:: internal padding on the left side, in pixels [Integer] 20 | # +padRight+:: internal padding on the right side, in pixels [Integer] 21 | # +padTop+:: internal padding on the top side, in pixels [Integer] 22 | # +padBottom+:: internal padding on the bottom side, in pixels [Integer] 23 | # +hSpacing+:: horizontal spacing between widgets, in pixels [Integer] 24 | # +vSpacing+:: vertical spacing between widgets, in pixels [Integer] 25 | # 26 | def initialize(p, opts=0, x=0, y=0, width=0, height=0, padLeft=DEFAULT_SPACING, padRight=DEFAULT_SPACING, padTop=DEFAULT_SPACING, padBottom=DEFAULT_SPACING, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theVerticalFrame 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/fox16.rb: -------------------------------------------------------------------------------- 1 | begin 2 | require 'fox16_c' 3 | rescue LoadError 4 | # If it's a Windows binary gem, try the . subdirectory 5 | if RUBY_PLATFORM =~/(mswin|mingw)/i 6 | major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or 7 | raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}" 8 | 9 | add_dll_path = proc do |path, &block| 10 | begin 11 | require 'ruby_installer/runtime' 12 | RubyInstaller::Runtime.add_dll_directory(path, &block) 13 | rescue LoadError 14 | old_path = ENV['PATH'] 15 | ENV['PATH'] = "#{path};#{old_path}" 16 | block.call 17 | ENV['PATH'] = old_path 18 | end 19 | end 20 | 21 | ruby_plat = RUBY_PLATFORM.gsub("i386", "x86") 22 | # Temporary add this directory for DLL search, so that bundled DLLs can be found. 23 | ports_bin = File.expand_path("../../ports/#{ruby_plat}/bin", __FILE__) 24 | add_dll_path.call(ports_bin) do 25 | require "#{major_minor}/fox16_c" 26 | end 27 | else 28 | raise 29 | end 30 | end 31 | 32 | require "fox16/core" 33 | require "fox16/dict" 34 | require "fox16/settings" 35 | require "fox16/iterators" 36 | require "fox16/keys" 37 | require "fox16/aliases" 38 | require "fox16/responder2" 39 | require "fox16/glgroup" 40 | require "fox16/execute_nonmodal" 41 | require "fox16/version" 42 | require "fox16/kwargs" 43 | require "fox16/exceptions_for_fxerror" 44 | require "fox16/thread" 45 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbIconListVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | /// Overrides the base class version of selectItem() 3 | virtual FXbool selectItem(FXint index,FXbool notify=FALSE); 4 | 5 | /// Overrides the base class version of deselectItem() 6 | virtual FXbool deselectItem(FXint index,FXbool notify=FALSE); 7 | 8 | /// Overrides the base class version of toggleItem() 9 | virtual FXbool toggleItem(FXint index,FXbool notify=FALSE); 10 | 11 | /// Overrides the base class version of selectInRectangle() 12 | virtual FXbool selectInRectangle(FXint x,FXint y,FXint w,FXint h,FXbool notify=FALSE); 13 | 14 | /// Overrides the base class version of extendSelection() 15 | virtual FXbool extendSelection(FXint index,FXbool notify=FALSE); 16 | 17 | /// Overrides the base class version of killSelection() 18 | virtual FXbool killSelection(FXbool notify=FALSE); 19 | 20 | /// Overrides the base class version of setCurrentItem() 21 | virtual void setCurrentItem(FXint index,FXbool notify=FALSE); 22 | 23 | /// Overrides the base class version of getItemAt() 24 | virtual FXint getItemAt(FXint x,FXint y) const; 25 | 26 | /// Overrides the base class version of makeItemVisible() 27 | virtual void makeItemVisible(FXint index); 28 | 29 | /// Overrides the base class version of enableItem() 30 | virtual FXbool enableItem(FXint index); 31 | 32 | /// Overrides the base class version of disableItem() 33 | virtual FXbool disableItem(FXint index); 34 | 35 | 36 | -------------------------------------------------------------------------------- /rdoc-sources/FXHorizontalFrame.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # The horizontal frame layout manager widget is used to automatically 4 | # place child-windows horizontally from left-to-right, or right-to-left, 5 | # depending on the child windows' layout hints. 6 | # 7 | class FXHorizontalFrame < FXPacker 8 | # 9 | # Return an initialized FXHorizontalFrame instance. 10 | # 11 | # ==== Parameters: 12 | # 13 | # +p+:: the parent window for this horizontal frame {FXComposite} 14 | # +opts+:: frame options [Integer] 15 | # +x+:: initial x-position [Integer] 16 | # +y+:: initial y-position [Integer] 17 | # +width+:: initial width [Integer] 18 | # +height+:: initial height [Integer] 19 | # +padLeft+:: internal padding on the left side, in pixels [Integer] 20 | # +padRight+:: internal padding on the right side, in pixels [Integer] 21 | # +padTop+:: internal padding on the top side, in pixels [Integer] 22 | # +padBottom+:: internal padding on the bottom side, in pixels [Integer] 23 | # +hSpacing+:: horizontal spacing between widgets, in pixels [Integer] 24 | # +vSpacing+:: vertical spacing between widgets, in pixels [Integer] 25 | # 26 | def initialize(p, opts=0, x=0, y=0, width=0, height=0, padLeft=DEFAULT_SPACING, padRight=DEFAULT_SPACING, padTop=DEFAULT_SPACING, padBottom=DEFAULT_SPACING, hSpacing=DEFAULT_SPACING, vSpacing=DEFAULT_SPACING) # :yields: theHorizontalFrame 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /test/stress2.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'thread' 3 | require 'fox16' 4 | 5 | include Fox 6 | 7 | class TC_stress2 < Test::Unit::TestCase 8 | def set_up_main_window(theApp) 9 | theMainWindow = FXMainWindow.new(theApp, "TC_stress2", nil, nil, DECOR_ALL, 0, 0, 200, 100) 10 | @countLabel = FXLabel.new(theMainWindow, "0", nil, LAYOUT_FILL_X|LAYOUT_FILL_Y) 11 | theMainWindow 12 | end 13 | 14 | def on_timeout(sender, sel, ptr) 15 | safeToQuit = false 16 | $lock.synchronize { 17 | if $count > 1000000 18 | # if it were going to crash, it probably would have done 19 | # so by now, so it's safe to quit. 20 | safeToQuit = true 21 | end 22 | @countLabel.setText($count.to_s) 23 | } 24 | if safeToQuit 25 | @theApp.handle(@theMainWindow, MKUINT(FXApp::ID_QUIT, SEL_COMMAND), nil) 26 | else 27 | @theApp.addTimeout(100, method(:on_timeout)) 28 | end 29 | end 30 | 31 | def test_run 32 | # Set up the counter thread 33 | $count = 0 34 | $lock = Mutex.new 35 | w = Thread.new do 36 | loop do 37 | $lock.synchronize { $count += 1 } 38 | sleep 0 39 | end 40 | end 41 | 42 | # Start the app 43 | @theApp = FXApp.new("TC_stress2", "FXRuby") 44 | @theMainWindow = set_up_main_window(@theApp) 45 | @theApp.create 46 | @theMainWindow.show(PLACEMENT_SCREEN) 47 | @theApp.addTimeout(100, method(:on_timeout)) 48 | @theApp.run 49 | end 50 | end 51 | 52 | -------------------------------------------------------------------------------- /rdoc-sources/FXImageFrame.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # An FXImageFrame is a simple frame widget that displays an FXImage image. 4 | # 5 | class FXImageFrame < FXFrame 6 | 7 | # The current image being displayed {FXImage} 8 | attr_accessor :image 9 | 10 | # 11 | # The current justification mode, some combination of the flags 12 | # +JUSTIFY_LEFT+, +JUSTIFY_RIGHT+, +JUSTIFY_TOP+ and +JUSTIFY_BOTTOM+ [Integer] 13 | # 14 | attr_accessor :justify 15 | 16 | # 17 | # Return an initialized FXImageFrame instance. 18 | # 19 | # ==== Parameters: 20 | # 21 | # +p+:: the parent window for this image frame {FXComposite} 22 | # +img+:: the image to display {FXImage} 23 | # +opts+:: frame options [Integer] 24 | # +x+:: initial x-position [Integer] 25 | # +y+:: initial y-position [Integer] 26 | # +width+:: initial width [Integer] 27 | # +height+:: initial height [Integer] 28 | # +padLeft+:: internal padding on the left side, in pixels [Integer] 29 | # +padRight+:: internal padding on the right side, in pixels [Integer] 30 | # +padTop+:: internal padding on the top side, in pixels [Integer] 31 | # +padBottom+:: internal padding on the bottom side, in pixels [Integer] 32 | # 33 | def initialize(p, img, opts=FRAME_SUNKEN|FRAME_THICK, x=0, y=0, width=0, height=0, padLeft=0, padRight=0, padTop=0, padBottom=0) # :yields: theImageFrame 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /rdoc-sources/FXDirDialog.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Directory selection dialog 4 | # 5 | class FXDirDialog < FXDialogBox 6 | 7 | # Directory [String] 8 | attr_accessor :directory 9 | 10 | # Wildcard matching mode, some combination of file matching flags [Integer] 11 | attr_accessor :matchMode 12 | 13 | # Directory list style [Integer] 14 | attr_accessor :dirBoxStyle 15 | 16 | # Returns an initialized FXDirDialog instance. 17 | def initialize(owner, name, opts=0, x=0, y=0, width=500, height=300) # :yields: theDirDialog 18 | end 19 | 20 | # Return +true+ if showing files as well as directories 21 | def filesShown?; end 22 | 23 | # 24 | # If _state_ is +true+, the directory list will show files as well as 25 | # directories; otherwise, it will only show directories. 26 | # 27 | def filesShown=(state); end 28 | 29 | # Return +true+ if showing hidden files and directories 30 | def hiddenFilesShown?; end 31 | 32 | # 33 | # If _state_ is +true+, the directory list will show hidden files and 34 | # directories; otherwise, it won't. 35 | # 36 | def hiddenFilesShown=(state); end 37 | 38 | # 39 | # Display a directory dialog with the specified owner window, caption 40 | # string and initial path string. 41 | # Return the selected directory name (a string) or +nil+ if the dialog 42 | # was cancelled. 43 | # 44 | def FXDirDialog.getOpenDirectory(owner, caption, path); end 45 | end 46 | end 47 | 48 | -------------------------------------------------------------------------------- /test/TC_FXMenuCheck.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXMenuCheck < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @menuCheck = FXMenuCheck.new(mainWindow, "menuCheck") 11 | end 12 | 13 | def test_setCheck_TRUE 14 | @menuCheck.check = Fox::TRUE 15 | assert_equal(Fox::TRUE, @menuCheck.checkState) 16 | assert(@menuCheck.checked?) 17 | assert(!@menuCheck.unchecked?) 18 | assert(!@menuCheck.maybe?) 19 | end 20 | 21 | def test_setCheck_FALSE 22 | @menuCheck.check = Fox::FALSE 23 | assert_equal(Fox::FALSE, @menuCheck.checkState) 24 | assert(!@menuCheck.checked?) 25 | assert(@menuCheck.unchecked?) 26 | assert(!@menuCheck.maybe?) 27 | end 28 | 29 | def test_setCheck_MAYBE 30 | @menuCheck.check = Fox::MAYBE 31 | assert_equal(Fox::MAYBE, @menuCheck.checkState) 32 | assert(!@menuCheck.checked?) 33 | assert(!@menuCheck.unchecked?) 34 | assert(@menuCheck.maybe?) 35 | end 36 | 37 | def test_setCheck_true 38 | @menuCheck.check = true 39 | assert_equal(Fox::TRUE, @menuCheck.checkState) 40 | assert(@menuCheck.checked?) 41 | assert(!@menuCheck.unchecked?) 42 | assert(!@menuCheck.maybe?) 43 | end 44 | 45 | def test_setCheck_false 46 | @menuCheck.check = false 47 | assert_equal(Fox::FALSE, @menuCheck.checkState) 48 | assert(!@menuCheck.checked?) 49 | assert(@menuCheck.unchecked?) 50 | assert(!@menuCheck.maybe?) 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /test/TC_FXMenuRadio.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXMenuRadio < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @menuRadio = FXMenuRadio.new(mainWindow, "menuRadio") 11 | end 12 | 13 | def test_setCheck_TRUE 14 | @menuRadio.check = Fox::TRUE 15 | assert_equal(Fox::TRUE, @menuRadio.checkState) 16 | assert(@menuRadio.checked?) 17 | assert(!@menuRadio.unchecked?) 18 | assert(!@menuRadio.maybe?) 19 | end 20 | 21 | def test_setCheck_FALSE 22 | @menuRadio.check = Fox::FALSE 23 | assert_equal(Fox::FALSE, @menuRadio.checkState) 24 | assert(!@menuRadio.checked?) 25 | assert(@menuRadio.unchecked?) 26 | assert(!@menuRadio.maybe?) 27 | end 28 | 29 | def test_setCheck_MAYBE 30 | @menuRadio.check = Fox::MAYBE 31 | assert_equal(Fox::MAYBE, @menuRadio.checkState) 32 | assert(!@menuRadio.checked?) 33 | assert(!@menuRadio.unchecked?) 34 | assert(@menuRadio.maybe?) 35 | end 36 | 37 | def test_setCheck_true 38 | @menuRadio.check = true 39 | assert_equal(Fox::TRUE, @menuRadio.checkState) 40 | assert(@menuRadio.checked?) 41 | assert(!@menuRadio.unchecked?) 42 | assert(!@menuRadio.maybe?) 43 | end 44 | 45 | def test_setCheck_false 46 | @menuRadio.check = false 47 | assert_equal(Fox::FALSE, @menuRadio.checkState) 48 | assert(!@menuRadio.checked?) 49 | assert(@menuRadio.unchecked?) 50 | assert(!@menuRadio.maybe?) 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /rdoc-sources/FXGLContext.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # A GL context is an object representing the OpenGL state information. 4 | # Multiple GL context may share display lists to conserve memory. 5 | # When drawing multiple windows, it may be advantageous to share not only 6 | # display lists, but also GL contexts. Since the GL context is created 7 | # for a certain frame-buffer configuration, sharing of GL contexts is 8 | # only possible if the windows sharing the GL context all have the same 9 | # GL visual. 10 | # However, display lists may be shared between different GL contexts. 11 | # 12 | class FXGLContext < FXId 13 | 14 | # The visual {FXGLVisual} 15 | attr_reader :visual 16 | 17 | # Construct an OpenGL context. 18 | # If _other_ is a reference to an existing FXGLContext, this context will 19 | # share display lists with that other context. 20 | # Otherwise, this context will use its own private display list. 21 | def initialize(app, visual, other=nil) # :yields: theGLContext 22 | end 23 | 24 | # Return +true+ if it is sharing display lists. 25 | def shared?; end 26 | 27 | # Make this OpenGL context current prior to performing OpenGL commands. 28 | def begin(drawable); end 29 | 30 | # Make this OpenGL context non-current. 31 | def end(); end 32 | 33 | # Swap front and back buffer 34 | def swapBuffers(); end 35 | 36 | # Copy part of backbuffer to front buffer [Mesa] 37 | def swapSubBuffers(x, y, w, h); end 38 | end 39 | end 40 | 41 | -------------------------------------------------------------------------------- /test/TC_FXRadioButton.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXRadioButton < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super(self.class.name) 10 | @radioButton = FXRadioButton.new(mainWindow, "cbText") 11 | end 12 | 13 | def test_setCheck_TRUE 14 | @radioButton.check = Fox::TRUE 15 | assert_equal(Fox::TRUE, @radioButton.checkState) 16 | assert(@radioButton.checked?) 17 | assert(!@radioButton.unchecked?) 18 | assert(!@radioButton.maybe?) 19 | end 20 | 21 | def test_setCheck_FALSE 22 | @radioButton.check = Fox::FALSE 23 | assert_equal(Fox::FALSE, @radioButton.checkState) 24 | assert(!@radioButton.checked?) 25 | assert(@radioButton.unchecked?) 26 | assert(!@radioButton.maybe?) 27 | end 28 | 29 | def test_setCheck_MAYBE 30 | @radioButton.check = Fox::MAYBE 31 | assert_equal(Fox::MAYBE, @radioButton.checkState) 32 | assert(!@radioButton.checked?) 33 | assert(!@radioButton.unchecked?) 34 | assert(@radioButton.maybe?) 35 | end 36 | 37 | def test_setCheck_true 38 | @radioButton.check = true 39 | assert_equal(Fox::TRUE, @radioButton.checkState) 40 | assert(@radioButton.checked?) 41 | assert(!@radioButton.unchecked?) 42 | assert(!@radioButton.maybe?) 43 | end 44 | 45 | def test_setCheck_false 46 | @radioButton.check = false 47 | assert_equal(Fox::FALSE, @radioButton.checkState) 48 | assert(!@radioButton.checked?) 49 | assert(@radioButton.unchecked?) 50 | assert(!@radioButton.maybe?) 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /swig-interfaces/text-module.i: -------------------------------------------------------------------------------- 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: text-module.i 1439 2003-03-26 15:25:24Z lyle $ 25 | ***********************************************************************/ 26 | 27 | %module text 28 | 29 | %include common.i 30 | 31 | %import fxdefs.i 32 | %import core.i 33 | %import ui.i 34 | 35 | 36 | %include FXText.i 37 | -------------------------------------------------------------------------------- /test/TC_FXCheckButton.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require 'testcase' 3 | require 'fox16' 4 | 5 | class TC_FXCheckButton < Fox::TestCase 6 | include Fox 7 | 8 | def setup 9 | super("TC_FXCheckButton") 10 | @checkButton = FXCheckButton.new(mainWindow, "cbText") 11 | end 12 | 13 | def test_setCheck_TRUE 14 | @checkButton.check = Fox::TRUE 15 | assert_equal(Fox::TRUE, @checkButton.checkState) 16 | assert(@checkButton.checked?) 17 | assert(!@checkButton.unchecked?) 18 | assert(!@checkButton.maybe?) 19 | end 20 | 21 | def test_setCheck_FALSE 22 | @checkButton.check = Fox::FALSE 23 | assert_equal(Fox::FALSE, @checkButton.checkState) 24 | assert(!@checkButton.checked?) 25 | assert(@checkButton.unchecked?) 26 | assert(!@checkButton.maybe?) 27 | end 28 | 29 | def test_setCheck_MAYBE 30 | @checkButton.check = Fox::MAYBE 31 | assert_equal(Fox::MAYBE, @checkButton.checkState) 32 | assert(!@checkButton.checked?) 33 | assert(!@checkButton.unchecked?) 34 | assert(@checkButton.maybe?) 35 | end 36 | 37 | def test_setCheck_true 38 | @checkButton.check = true 39 | assert_equal(Fox::TRUE, @checkButton.checkState) 40 | assert(@checkButton.checked?) 41 | assert(!@checkButton.unchecked?) 42 | assert(!@checkButton.maybe?) 43 | end 44 | 45 | def test_setCheck_false 46 | @checkButton.check = false 47 | assert_equal(Fox::FALSE, @checkButton.checkState) 48 | assert(!@checkButton.checked?) 49 | assert(@checkButton.unchecked?) 50 | assert(!@checkButton.maybe?) 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbFoldingItemVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setText() 3 | virtual void setText(const FXString& txt); 4 | 5 | // Overrides the base class version of setOpenIcon() 6 | virtual void setOpenIcon(FXIcon* icn,FXbool owned); 7 | 8 | // Overrides the base class version of setClosedIcon() 9 | virtual void setClosedIcon(FXIcon* icn,FXbool owned); 10 | 11 | // Overrides the base class version of setFocus() 12 | virtual void setFocus(FXbool focus); 13 | 14 | // Overrides the base class version of setSelected() 15 | virtual void setSelected(FXbool selected); 16 | 17 | // Overrides the base class version of setOpened() 18 | virtual void setOpened(FXbool opened); 19 | 20 | // Overrides the base class version of setExpanded() 21 | virtual void setExpanded(FXbool expanded); 22 | 23 | // Overrides the base class version of setEnabled() 24 | virtual void setEnabled(FXbool enabled); 25 | 26 | // Overrides the base class version of setDraggable() 27 | virtual void setDraggable(FXbool draggable); 28 | 29 | // Overrides the base class version of getWidth() 30 | virtual FXint getWidth(const FXFoldingList* list) const; 31 | 32 | // Overrides the base class version of getHeight() 33 | virtual FXint getHeight(const FXFoldingList* list) const; 34 | 35 | // Overrides the base class version of create() 36 | virtual void create(); 37 | 38 | // Overrides the base class version of detach() 39 | virtual void detach(); 40 | 41 | // Overrides the base class version of destroy() 42 | virtual void destroy(); 43 | -------------------------------------------------------------------------------- /rdoc-sources/FXStatusBar.rb: -------------------------------------------------------------------------------- 1 | module Fox 2 | # 3 | # Status bar 4 | # 5 | # === Status bar options 6 | # 7 | # +STATUSBAR_WITH_DRAGCORNER+:: Causes the drag corner to be shown 8 | # 9 | class FXStatusBar < FXHorizontalFrame 10 | 11 | # The status line widget {FXStatusLine} 12 | attr_reader :statusLine 13 | 14 | # The drag corner widget {FXDragCorner} 15 | attr_reader :dragCorner 16 | 17 | # If +true+, the drag corner is shown [Boolean] 18 | attr_accessor :cornerStyle 19 | 20 | # 21 | # Return an initialized FXStatusBar instance. 22 | # 23 | # ==== Parameters: 24 | # 25 | # +p+:: the parent window for this status bar {FXComposite} 26 | # +opts+:: status bar options [Integer] 27 | # +x+:: initial x-position [Integer] 28 | # +y+:: initial y-position [Integer] 29 | # +width+:: initial width [Integer] 30 | # +height+:: initial height [Integer] 31 | # +padLeft+:: internal padding on the left side, in pixels [Integer] 32 | # +padRight+:: internal padding on the right side, in pixels [Integer] 33 | # +padTop+:: internal padding on the top side, in pixels [Integer] 34 | # +padBottom+:: internal padding on the bottom side, in pixels [Integer] 35 | # +hSpacing+:: horizontal spacing between widgets, in pixels [Integer] 36 | # +vSpacing+:: vertical spacing between widgets, in pixels [Integer] 37 | # 38 | def initialize(p, opts=0, x=0, y=0, width=0, height=0, padLeft=3, padRight=3, padTop=2, padBottom=2, hSpacing=4, vSpacing=0) # :yields: theStatusBar 39 | end 40 | end 41 | end 42 | 43 | -------------------------------------------------------------------------------- /ext/fox16_c/include/FXRbTreeItemVirtuals.h: -------------------------------------------------------------------------------- 1 | public: 2 | // Overrides the base class version of setText() 3 | virtual void setText(const FXString& txt); 4 | 5 | // Overrides the base class version of setOpenIcon() 6 | virtual void setOpenIcon(FXIcon* icn,FXbool owned=FALSE); 7 | 8 | // Overrides the base class version of setClosedIcon() 9 | virtual void setClosedIcon(FXIcon* icn,FXbool owned=FALSE); 10 | 11 | // Overrides the base class version of setFocus() 12 | virtual void setFocus(FXbool focus); 13 | 14 | // Overrides the base class version of setSelected() 15 | virtual void setSelected(FXbool selected); 16 | 17 | // Overrides the base class version of setOpened() 18 | virtual void setOpened(FXbool opened); 19 | 20 | // Overrides the base class version of setExpanded() 21 | virtual void setExpanded(FXbool expanded); 22 | 23 | // Overrides the base class version of setEnabled() 24 | virtual void setEnabled(FXbool enabled); 25 | 26 | // Overrides the base class version of setDraggable() 27 | virtual void setDraggable(FXbool draggable); 28 | 29 | // Overrides the base class version of getWidth() 30 | virtual FXint getWidth(const FXTreeList* list) const; 31 | 32 | // Overrides the base class version of getHeight() 33 | virtual FXint getHeight(const FXTreeList* list) const; 34 | 35 | // Overrides the base class version of create() 36 | virtual void create(); 37 | 38 | // Overrides the base class version of detach() 39 | virtual void detach(); 40 | 41 | // Overrides the base class version of destroy() 42 | virtual void destroy(); 43 | -------------------------------------------------------------------------------- /swig-interfaces/FXURL.i: -------------------------------------------------------------------------------- 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 | /// This will be a namespace before long 24 | class FXURL { 25 | public: 26 | 27 | /// Return host name 28 | static FXString hostname(); 29 | 30 | /// Return URL of filename 31 | static FXString fileToURL(const FXString& file); 32 | 33 | /// Return filename from URL, empty if url is not a local file 34 | static FXString fileFromURL(const FXString& url); 35 | }; 36 | -------------------------------------------------------------------------------- /swig-interfaces/dcmodule.i: -------------------------------------------------------------------------------- 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: dcmodule.i 1439 2003-03-26 15:25:24Z lyle $ 25 | ***********************************************************************/ 26 | 27 | %module dc 28 | 29 | %include common.i 30 | 31 | %import fxdefs.i 32 | %import core.i 33 | 34 | %include FXDC.i 35 | %include FXDCWindow.i 36 | %include FXDCPrint.i 37 | -------------------------------------------------------------------------------- /swig-interfaces/table-module.i: -------------------------------------------------------------------------------- 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: table-module.i 1439 2003-03-26 15:25:24Z lyle $ 25 | ***********************************************************************/ 26 | 27 | %module table 28 | 29 | %include common.i 30 | 31 | %import fxdefs.i 32 | %import core.i 33 | %import ui.i 34 | %import dcmodule.i 35 | 36 | %include FXTable.i 37 | -------------------------------------------------------------------------------- /test/TC_FXPoint.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | 3 | require 'fox16' 4 | 5 | class TC_FXPoint < Test::Unit::TestCase 6 | include Fox 7 | 8 | def setup 9 | @point1 = FXPoint.new 10 | @point2 = FXPoint.new(300, 200) 11 | @point3 = FXPoint.new(FXSize.new(300, 200)) 12 | end 13 | 14 | def test_copy 15 | assert_equal(@point1, FXPoint.new(@point1)) 16 | assert_equal(@point2, FXPoint.new(@point2)) 17 | end 18 | 19 | # The assertEqual() method will test the implementation of 20 | # FXPoint's '==' method, which is the point of this test 21 | def test_equals 22 | assert_equal(@point2, @point3) 23 | 24 | samePoint1 = FXPoint.new 25 | samePoint1.x = @point1.x 26 | samePoint1.y = @point1.y 27 | assert_equal(@point1, samePoint1) 28 | assert_equal(samePoint1, @point1) 29 | 30 | samePoint2 = FXPoint.new(300, 200) 31 | assert_equal(@point2, samePoint2) 32 | assert_equal(samePoint2, @point2) 33 | end 34 | 35 | def test_uminus 36 | point1 = -(@point1) 37 | assert(point1.x == -(@point1.x) && point1.y == -(@point1.y)) 38 | point2 = -(@point2) 39 | assert(point2.x == -(@point2.x) && point2.y == -(@point2.y)) 40 | end 41 | 42 | def test_add 43 | assert(FXPoint.new(1, 2) + FXPoint.new(3, 4) == FXPoint.new(4, 6)) 44 | end 45 | 46 | def test_sub 47 | assert(FXPoint.new(4, 6) - FXPoint.new(3, 4) == FXPoint.new(1, 2)) 48 | end 49 | 50 | def test_mul 51 | assert(FXPoint.new(1, 2)*3 == FXPoint.new(3, 6)) 52 | end 53 | 54 | def test_div 55 | assert(FXPoint.new(3, 6)/3 == FXPoint.new(1, 2)) 56 | end 57 | end 58 | --------------------------------------------------------------------------------