[Fxruby-commits] CVS: FXRuby/swig-interfaces FXDict.i,1.17.2.1,1.17.2.2 FXDirList.i,1.20,1.20.2.1 FX
Status: Inactive
Brought to you by:
lyle
Update of /cvsroot/fxruby/FXRuby/swig-interfaces In directory usw-pr-cvs1:/tmp/cvs-serv13212/swig-interfaces Modified Files: Tag: release10 FXDict.i FXDirList.i FXFileList.i FXFileSelector.i FXFont.i FXGLObject.i FXWindow.i Log Message: Replaced inlined %name directives in SWIG interface files with the newer %rename directives; a little tweaking of FXDict as well. Index: FXDict.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXDict.i,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** FXDict.i 6 May 2002 19:16:29 -0000 1.17.2.1 --- FXDict.i 24 May 2002 22:20:57 -0000 1.17.2.2 *************** *** 21,28 **** --- 21,40 ---- ***********************************************************************/ + // Do not wrap these functions + %ignore FXDict::size() const; + %ignore FXDict::size(FXint m); %ignore FXDict::insert(const FXchar* ky,const void* ptr,FXbool mrk); + %ignore FXDict::remove(const FXchar* ky); %ignore FXDict::replace(const FXchar* ky,const void* ptr,FXbool mrk); + %ignore FXDict::find(const FXchar* ky) const; %ignore FXDict::data(FXuint pos) const; + // Rename this one + %rename("length") FXDict::no() const; + + // Mark these as predicate methods + %predicate FXDict::empty() const; + %predicate FXDict::has_key(const FXchar* ky) const; + %exception FXDict::FXDict "$action FXRbRegisterRubyObj(self, result);"; *************** *** 72,81 **** * Return the size of the table, including the empty slots. */ ! %name(getSize) FXint size() const; /** * Resize the table to the given size. */ ! %name(setSize) void size(FXint m); /** --- 84,93 ---- * Return the size of the table, including the empty slots. */ ! FXint size() const; /** * Resize the table to the given size. */ ! void size(FXint m); /** *************** *** 101,137 **** * Remove data given key. */ ! // void* remove(const FXchar* ky); // FIXME /** * Find data pointer given key. */ ! // void* find(const FXchar* ky) const; // FIXME ! ! #ifdef SWIGRUBY ! ! %extend { ! // Returns a new array populated with the keys from this hash ! VALUE keys() const { ! VALUE arr = rb_ary_new(); ! return arr; ! } ! } ! ! %extend { ! // Returns true if the given key is present ! FXbool has_key(const FXchar* ky) { ! return (self->find(ky) != 0); ! } ! } ! ! %extend { ! // Returns true if hash contains no key-value pairs ! FXbool empty() const { ! return (self->no() == 0); ! } ! } - #endif /* SWIGRUBY */ - /** * Return key at position pos. --- 113,123 ---- * Remove data given key. */ ! void* remove(const FXchar* ky); /** * Find data pointer given key. */ ! void* find(const FXchar* ky) const; /** * Return key at position pos. *************** *** 174,177 **** --- 160,189 ---- /// Clear all entries void clear(); + + #ifdef SWIGRUBY + + // Add methods similar to those for Ruby's Hash class + %extend { + // Returns a new array populated with the keys from this hash + VALUE keys() const { + VALUE arr = rb_ary_new(); + for(FXint p=self->first(); p<self->size(); p=self->next(p)){ + rb_ary_push(arr,rb_str_new2(self->key(p))); + } + return arr; + } + + // Returns true if the given key is present + FXbool has_key(const FXchar* ky) const { + return (self->find(ky) != 0); + } + + // Returns true if hash contains no key-value pairs + FXbool empty() const { + return (self->no() == 0); + } + } + + #endif /* SWIGRUBY */ /// Destructor Index: FXDirList.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXDirList.i,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -C2 -d -r1.20 -r1.20.2.1 *** FXDirList.i 2 Apr 2002 03:44:27 -0000 1.20 --- FXDirList.i 24 May 2002 22:20:57 -0000 1.20.2.1 *************** *** 86,89 **** --- 86,95 ---- }; + // Rename these methods + %rename(getShowFiles) FXDirList::showFiles() const; + %rename(setShowFiles) FXDirList::showFiles(FXbool showing); + %rename(getShowHiddenFiles) FXDirList::showHiddenFiles() const; + %rename(setShowHiddenFiles) FXDirList::showHiddenFiles(FXbool showing); + %exception FXDirList::FXDirList "$action FXRbRegisterRubyObj(self, result);"; *************** *** 211,224 **** /// Return TRUE if showing files as well as directories ! %name(getShowFiles) FXbool showFiles() const; /// Show or hide normal files ! %name(setShowFiles) void showFiles(FXbool showing); /// Return TRUE if showing hidden files and directories ! %name(getShowHiddenFiles) FXbool showHiddenFiles() const; /// Show or hide hidden files and directories ! %name(setShowHiddenFiles) void showHiddenFiles(FXbool showing); /// Change file associations --- 217,230 ---- /// Return TRUE if showing files as well as directories ! FXbool showFiles() const; /// Show or hide normal files ! void showFiles(FXbool showing); /// Return TRUE if showing hidden files and directories ! FXbool showHiddenFiles() const; /// Show or hide hidden files and directories ! void showHiddenFiles(FXbool showing); /// Change file associations Index: FXFileList.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXFileList.i,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** FXFileList.i 2 Apr 2002 03:44:27 -0000 1.21 --- FXFileList.i 24 May 2002 22:20:57 -0000 1.21.2.1 *************** *** 106,109 **** --- 106,116 ---- }; + + // Rename these methods + %rename(getHiddenFilesShown) FXFileList::showHiddenFiles() const; + %rename(setHiddenFilesShown) FXFileList::showHiddenFiles(FXbool showing); + %rename(getOnlyDirectoriesShown) FXFileList::showOnlyDirectories() const; + %rename(setOnlyDirectoriesShown) FXFileList::showOnlyDirectories(FXbool shown); + %exception FXFileList::FXFileList "$action FXRbRegisterRubyObj(self, result);"; Index: FXFileSelector.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXFileSelector.i,v retrieving revision 1.19.2.1 retrieving revision 1.19.2.2 diff -C2 -d -r1.19.2.1 -r1.19.2.2 *** FXFileSelector.i 6 May 2002 19:16:29 -0000 1.19.2.1 --- FXFileSelector.i 24 May 2002 22:20:57 -0000 1.19.2.2 *************** *** 40,43 **** --- 40,48 ---- }; + + // Rename these methods + %rename(setReadOnlyShown) FXFileSelector::showReadOnly(FXbool show); + %rename(getReadOnlyShown) FXFileSelector::shownReadOnly() const; + %exception FXFileSelector::FXFileSelector "$action FXRbRegisterRubyObj(self, result);"; *************** *** 262,269 **** /// Show readonly button ! %name(setReadOnlyShown) void showReadOnly(FXbool show); /// Return TRUE if readonly is shown ! %name(getReadOnlyShown) FXbool shownReadOnly() const; /// Set initial state of readonly button --- 267,274 ---- /// Show readonly button ! void showReadOnly(FXbool show); /// Return TRUE if readonly is shown ! FXbool shownReadOnly() const; /// Set initial state of readonly button Index: FXFont.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXFont.i,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -C2 -d -r1.15.2.1 -r1.15.2.2 *** FXFont.i 6 May 2002 19:16:29 -0000 1.15.2.1 --- FXFont.i 24 May 2002 22:20:57 -0000 1.15.2.2 *************** *** 341,344 **** %} ! %name(fxparsefontdesc) FXFontDesc* fxparsefontdesc2(const FXchar* string); %name(fxunparsefontdesc) FXString fxunparsefontdesc2(const FXFontDesc& fontdesc); --- 341,344 ---- %} ! %name(fxparsefontdesc) FXFontDesc *fxparsefontdesc2(const FXchar* string); %name(fxunparsefontdesc) FXString fxunparsefontdesc2(const FXFontDesc& fontdesc); Index: FXGLObject.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXGLObject.i,v retrieving revision 1.23.2.1 retrieving revision 1.23.2.2 diff -C2 -d -r1.23.2.1 -r1.23.2.2 *** FXGLObject.i 6 May 2002 19:16:29 -0000 1.23.2.1 --- FXGLObject.i 24 May 2002 22:20:57 -0000 1.23.2.2 *************** *** 113,116 **** --- 113,121 ---- %} + + // Rename these methods + %rename(removeObj) FXGLGroup::remove(FXGLObject* obj); + %rename(removePos) FXGLGroup::remove(FXint pos); + %exception FXGLGroup::FXGLGroup "$action FXRbRegisterRubyObj(self, result);"; *************** *** 158,165 **** /// Remove child object ! %name(removeObj) void remove(FXGLObject* obj); /// Remove child object at given position ! %name(removePos) void remove(FXint pos); /// Remove all children --- 163,170 ---- /// Remove child object ! void remove(FXGLObject* obj); /// Remove child object at given position ! void remove(FXint pos); /// Remove all children Index: FXWindow.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXWindow.i,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -C2 -d -r1.32.2.1 -r1.32.2.2 *** FXWindow.i 6 May 2002 19:16:29 -0000 1.32.2.1 --- FXWindow.i 24 May 2002 22:20:57 -0000 1.32.2.2 *************** *** 83,86 **** --- 83,94 ---- } + + // Rename these methods + %rename(updateArea) FXWindow::update(FXint x,FXint y,FXint w,FXint h); + %rename(updateWindow) FXWindow::update(); + %rename(repaintArea) FXWindow::repaint(FXint x,FXint y,FXint w,FXint h); + %rename(repaintWindow) FXWindow::repaint(); + + /// Base class for all windows class FXWindow : public FXDrawable { *************** *** 547,560 **** /// Mark the specified rectangle dirty, i.e. to be repainted ! %name(updateArea) void update(FXint x,FXint y,FXint w,FXint h); /// Mark the entire window client area dirty ! %name(updateWindow) void update(); /// If marked but not yet painted, paint the given area ! %name(repaintArea) void repaint(FXint x,FXint y,FXint w,FXint h); /// If marked but not yet painted, paint the entire window ! %name(repaintWindow) void repaint(); /** --- 555,568 ---- /// Mark the specified rectangle dirty, i.e. to be repainted ! void update(FXint x,FXint y,FXint w,FXint h); /// Mark the entire window client area dirty ! void update(); /// If marked but not yet painted, paint the given area ! void repaint(FXint x,FXint y,FXint w,FXint h); /// If marked but not yet painted, paint the entire window ! void repaint(); /** |