From: Paul Duncan Date: 2005-02-08T03:36:30+09:00 Subject: [PATCH] add color_set support to curses.c --jV48Xe8MDR38G6iU Content-Type: multipart/mixed; boundary="4sIINvUYgVdCJqz2" Content-Disposition: inline --4sIINvUYgVdCJqz2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm not sure why this is missing from the Curses binding, but the attached patch adds support for color_set to curses.c. --=20 Paul Duncan OpenPGP Key ID: 0x82C29562 http://www.pablotron.org/ http://www.paulduncan.org/ --4sIINvUYgVdCJqz2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ruby-1.8.2-curses_color_set.patch" Content-Transfer-Encoding: quoted-printable diff -ur ruby-1.8.2/ext/curses/curses.c ruby-1.8.2-curses_color_set/ext/cur= ses/curses.c --- ruby-1.8.2/ext/curses/curses.c 2003-12-10 03:26:33.000000000 -0500 +++ ruby-1.8.2-curses_color_set/ext/curses/curses.c 2005-02-06 04:30:08.000= 000000 -0500 @@ -1188,6 +1188,21 @@ } =20 static VALUE +window_color_set(VALUE obj, VALUE col)=20 +{ + struct windata *winp; + int res; + + GetWINDOW(obj, winp); +#ifdef USE_COLOR + res =3D wcolor_set(winp->window, NUM2INT(col), NULL); + return (res =3D=3D OK) ? Qtrue : Qfalse; +#else + return Qfalse; +#endif /* USE_COLOR */ +} + +static VALUE window_scroll(VALUE obj) { struct windata *winp; @@ -1463,6 +1478,7 @@ rb_define_method(cWindow, "box", window_box, -1); rb_define_method(cWindow, "move", window_move, 2); rb_define_method(cWindow, "setpos", window_setpos, 2); + rb_define_method(cWindow, "color_set", window_color_set, 1); rb_define_method(cWindow, "cury", window_cury, 0); rb_define_method(cWindow, "curx", window_curx, 0); rb_define_method(cWindow, "maxy", window_maxy, 0); --4sIINvUYgVdCJqz2-- --jV48Xe8MDR38G6iU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCB7U9zdlT34LClWIRAreuAJwK3etBJEj8/m4COQc6O5UVWfIELgCgqDen dd/Di3AT7dLk4nerZ/0LRbc= =D+rX -----END PGP SIGNATURE----- --jV48Xe8MDR38G6iU--