Update of /cvsroot/fxruby/FXRuby/swig-interfaces
In directory usw-pr-cvs1:/tmp/cvs-serv14569/swig-interfaces
Modified Files:
Tag: release10
typemaps.i
Log Message:
Modified the input typemaps for "const void *pix" and "const FXuchar*
PIXELS" so that the constructors for icons and images can accept either
strings (as before) or MemoryBuffer instances (see SF Bug #550996).
Index: typemaps.i
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/typemaps.i,v
retrieving revision 1.35.2.3
retrieving revision 1.35.2.4
diff -C2 -d -r1.35.2.3 -r1.35.2.4
*** typemaps.i 29 Apr 2002 22:23:41 -0000 1.35.2.3
--- typemaps.i 9 May 2002 20:22:28 -0000 1.35.2.4
***************
*** 71,91 ****
/**
* Used by constructors for icons and images that require an array
! * of bytes as input; uses a Ruby string instead. Also accepts "nil"
! * in place of a NULL pointer.
*/
! %typemap(ruby, in) const void* pix {
! if ($input != Qnil) {
! Check_Type($input, T_STRING);
! $1 = (void*) RSTRING($input)->ptr;
! } else {
! $1 = NULL;
! }
! }
!
! /* Same as above, but when the pixels array is typed as unsigned chars */
! %typemap(ruby, in) const FXuchar* PIXELS {
if ($input != Qnil) {
! Check_Type($input, T_STRING);
! $1 = (FXuchar *) RSTRING($input)->ptr;
} else {
$1 = NULL;
--- 71,86 ----
/**
* Used by constructors for icons and images that require an array
! * of bytes as input; uses a Ruby string or a MemoryBuffer instance
! * instead. Also accepts "nil" in place of a NULL pointer.
*/
! %typemap(ruby, in) const void* pix, const FXuchar* PIXELS {
if ($input != Qnil) {
! if (TYPE($input) == T_STRING) {
! $1 = reinterpret_cast<$1_ltype>(RSTRING($input)->ptr);
! } else {
! FXMemoryBuffer *memoryBuffer =
! reinterpret_cast<FXMemoryBuffer*>(FXRbConvertPtr($input, FXRbTypeQuery("FXMemoryBuffer *")));
! $1 = reinterpret_cast<$1_ltype>(memoryBuffer->getData());
! }
} else {
$1 = NULL;
|