[Fxruby-commits] CVS: FXRuby/ext/fox FXRuby.cpp,1.40.2.3,1.40.2.4 core_wrap.cpp,1.62.2.12,1.62.2.13
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@us...> - 2002-05-14 14:16:15
|
Update of /cvsroot/fxruby/FXRuby/ext/fox In directory usw-pr-cvs1:/tmp/cvs-serv23733/ext/fox Modified Files: Tag: release10 FXRuby.cpp core_wrap.cpp dialogs_wrap.cpp icons_wrap.cpp image_wrap.cpp layout_wrap.cpp mdi_wrap.cpp opengl_wrap.cpp ui_wrap.cpp Log Message: Modified the range and range= methods for FXDial, FXSlider and FXSpinner to work with Ruby Range objects instead of (lo, hi) Fixnum pairs. Index: FXRuby.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/FXRuby.cpp,v retrieving revision 1.40.2.3 retrieving revision 1.40.2.4 diff -C2 -d -r1.40.2.3 -r1.40.2.4 *** FXRuby.cpp 8 May 2002 22:37:46 -0000 1.40.2.3 --- FXRuby.cpp 14 May 2002 14:15:42 -0000 1.40.2.4 *************** *** 862,865 **** --- 862,883 ---- //---------------------------------------------------------------------- + void FXRbRange2LoHi(VALUE range,FXint& lo,FXint& hi){ + if(Qtrue!=rb_obj_is_instance_of(range,rb_cRange)){ + rb_raise(rb_eTypeError,"wrong argument type %s (expected %s)",rb_class2name(CLASS_OF(range)),rb_class2name(rb_cRange)); + } + else{ + VALUE beg=rb_funcall(range,rb_intern("begin"),0,NULL); + VALUE end=rb_funcall(range,rb_intern("end"),0,NULL); + VALUE excl=rb_funcall(range,rb_intern("exclude_end?"),0,NULL); + lo=NUM2INT(beg); + hi=NUM2INT(end); + if(excl==Qtrue){ + hi--; + } + } + } + + //---------------------------------------------------------------------- + void FXRbCallVoidMethod(FXObject* recv, const char *func) { /* Index: core_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/core_wrap.cpp,v retrieving revision 1.62.2.12 retrieving revision 1.62.2.13 diff -C2 -d -r1.62.2.12 -r1.62.2.13 *** core_wrap.cpp 10 May 2002 20:12:31 -0000 1.62.2.12 --- core_wrap.cpp 14 May 2002 14:15:43 -0000 1.62.2.13 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: dialogs_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/dialogs_wrap.cpp,v retrieving revision 1.34.2.10 retrieving revision 1.34.2.11 diff -C2 -d -r1.34.2.10 -r1.34.2.11 *** dialogs_wrap.cpp 10 May 2002 22:23:13 -0000 1.34.2.10 --- dialogs_wrap.cpp 14 May 2002 14:15:51 -0000 1.34.2.11 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: icons_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/icons_wrap.cpp,v retrieving revision 1.37.2.11 retrieving revision 1.37.2.12 diff -C2 -d -r1.37.2.11 -r1.37.2.12 *** icons_wrap.cpp 10 May 2002 20:12:30 -0000 1.37.2.11 --- icons_wrap.cpp 14 May 2002 14:15:52 -0000 1.37.2.12 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: image_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/image_wrap.cpp,v retrieving revision 1.39.2.11 retrieving revision 1.39.2.12 diff -C2 -d -r1.39.2.11 -r1.39.2.12 *** image_wrap.cpp 10 May 2002 20:12:30 -0000 1.39.2.11 --- image_wrap.cpp 14 May 2002 14:15:52 -0000 1.39.2.12 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: layout_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/layout_wrap.cpp,v retrieving revision 1.8.2.10 retrieving revision 1.8.2.11 diff -C2 -d -r1.8.2.10 -r1.8.2.11 *** layout_wrap.cpp 10 May 2002 22:23:14 -0000 1.8.2.10 --- layout_wrap.cpp 14 May 2002 14:15:53 -0000 1.8.2.11 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: mdi_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/mdi_wrap.cpp,v retrieving revision 1.36.2.10 retrieving revision 1.36.2.11 diff -C2 -d -r1.36.2.10 -r1.36.2.11 *** mdi_wrap.cpp 10 May 2002 22:23:14 -0000 1.36.2.10 --- mdi_wrap.cpp 14 May 2002 14:15:53 -0000 1.36.2.11 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: opengl_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/opengl_wrap.cpp,v retrieving revision 1.41.2.11 retrieving revision 1.41.2.12 diff -C2 -d -r1.41.2.11 -r1.41.2.12 *** opengl_wrap.cpp 10 May 2002 22:23:14 -0000 1.41.2.11 --- opengl_wrap.cpp 14 May 2002 14:15:54 -0000 1.41.2.12 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of Index: ui_wrap.cpp =================================================================== RCS file: /cvsroot/fxruby/FXRuby/ext/fox/ui_wrap.cpp,v retrieving revision 1.9.2.10 retrieving revision 1.9.2.11 diff -C2 -d -r1.9.2.10 -r1.9.2.11 *** ui_wrap.cpp 10 May 2002 22:23:17 -0000 1.9.2.10 --- ui_wrap.cpp 14 May 2002 14:15:55 -0000 1.9.2.11 *************** *** 1,5 **** /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020510-1423 * * This file is not intended to be easily readable and contains a number of --- 1,5 ---- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). ! * Version 1.3.12u-20020513-1710 * * This file is not intended to be easily readable and contains a number of *************** *** 635,645 **** swig_class cFXLabel; static void free_FXRbLabel(FXRbLabel *); VALUE FXDial_getRange(FXDial const *self){ ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; } --- 635,647 ---- swig_class cFXLabel; static void free_FXRbLabel(FXRbLabel *); + void FXDial_setRange(FXDial *self,VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } VALUE FXDial_getRange(FXDial const *self){ ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); } *************** *** 723,734 **** swig_class cFXPacker; static void free_FXRbPacker(FXRbPacker *); VALUE FXSpinner_getRange(FXSpinner const *self){ ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; ! } swig_class cFX_Spinner; --- 725,738 ---- swig_class cFXPacker; static void free_FXRbPacker(FXRbPacker *); + void FXSpinner_setRange(FXSpinner *self,VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } VALUE FXSpinner_getRange(FXSpinner const *self){ ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); ! } swig_class cFX_Spinner; *************** *** 1228,1239 **** swig_class cFXDirList; static void free_FXRbDirList(FXRbDirList *); VALUE FXSlider_getRange(FXSlider const *self){ ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; ! } swig_class cFX_Slider; --- 1232,1245 ---- swig_class cFXDirList; static void free_FXRbDirList(FXRbDirList *); + void FXSlider_setRange(FXSlider *self,VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } VALUE FXSlider_getRange(FXSlider const *self){ ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); ! } swig_class cFX_Slider; *************** *** 9298,9310 **** _wrap_FX_Dial_setRange(int argc, VALUE *argv, VALUE self) { FXDial *arg1 ; ! FXint arg2 ; ! FXint arg3 ; ! if ((argc < 2) || (argc > 2)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); arg1 = (FXDial *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXDial); ! arg2 = NUM2INT(argv[0]); ! arg3 = NUM2INT(argv[1]); ! (arg1)->setRange(arg2,arg3); return Qnil; --- 9304,9314 ---- _wrap_FX_Dial_setRange(int argc, VALUE *argv, VALUE self) { FXDial *arg1 ; ! VALUE arg2 ; ! if ((argc < 1) || (argc > 1)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); arg1 = (FXDial *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXDial); ! arg2 = argv[0]; ! FXDial_setRange(arg1,arg2); return Qnil; *************** *** 26965,26977 **** _wrap_FX_Spinner_setRange(int argc, VALUE *argv, VALUE self) { FXSpinner *arg1 ; ! FXint arg2 ; ! FXint arg3 ; ! if ((argc < 2) || (argc > 2)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); arg1 = (FXSpinner *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXSpinner); ! arg2 = NUM2INT(argv[0]); ! arg3 = NUM2INT(argv[1]); ! (arg1)->setRange(arg2,arg3); return Qnil; --- 26969,26979 ---- _wrap_FX_Spinner_setRange(int argc, VALUE *argv, VALUE self) { FXSpinner *arg1 ; ! VALUE arg2 ; ! if ((argc < 1) || (argc > 1)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); arg1 = (FXSpinner *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXSpinner); ! arg2 = argv[0]; ! FXSpinner_setRange(arg1,arg2); return Qnil; *************** *** 72045,72057 **** _wrap_FX_Slider_setRange(int argc, VALUE *argv, VALUE self) { FXSlider *arg1 ; ! FXint arg2 ; ! FXint arg3 ; ! if ((argc < 2) || (argc > 2)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); arg1 = (FXSlider *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXSlider); ! arg2 = NUM2INT(argv[0]); ! arg3 = NUM2INT(argv[1]); ! (arg1)->setRange(arg2,arg3); return Qnil; --- 72047,72057 ---- _wrap_FX_Slider_setRange(int argc, VALUE *argv, VALUE self) { FXSlider *arg1 ; ! VALUE arg2 ; ! if ((argc < 1) || (argc > 1)) ! rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); arg1 = (FXSlider *) SWIG_ConvertPtr(self, SWIGTYPE_p_FXSlider); ! arg2 = argv[0]; ! FXSlider_setRange(arg1,arg2); return Qnil; |