* ext/curses/curses.c (curses_use_default_colors): add new
method. a patch from Giancarlo F Bellido <support at coaxialhost.com> in [ruby-core:20434]. * ext/curses/curses.c (curses_tabsize_set): ditto. * ext/curses/curses.c (curses_tabsize_get): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fe867f47ac
commit
3cde544d47
10
ChangeLog
10
ChangeLog
@ -6,6 +6,16 @@ Tue Dec 9 13:25:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
|
|
||||||
* vm_insnhelper.c (check_cfunc): use function pointer.
|
* vm_insnhelper.c (check_cfunc): use function pointer.
|
||||||
|
|
||||||
|
Tue Dec 9 13:23:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/curses/curses.c (curses_use_default_colors): add new
|
||||||
|
method. a patch from Giancarlo F Bellido
|
||||||
|
<support at coaxialhost.com> in [ruby-core:20434].
|
||||||
|
|
||||||
|
* ext/curses/curses.c (curses_tabsize_set): ditto.
|
||||||
|
|
||||||
|
* ext/curses/curses.c (curses_tabsize_get): ditto.
|
||||||
|
|
||||||
Tue Dec 9 12:08:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Dec 9 12:08:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* .gdbinit (rp): fixed typo for T_STRUCT.
|
* .gdbinit (rp): fixed typo for T_STRUCT.
|
||||||
|
@ -499,6 +499,12 @@ curses_cols(void)
|
|||||||
return INT2FIX(COLS);
|
return INT2FIX(COLS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets Cursor Visibility.
|
||||||
|
* 0: invisible
|
||||||
|
* 1: visible
|
||||||
|
* 2: very visible
|
||||||
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_curs_set(VALUE obj, VALUE visibility)
|
curses_curs_set(VALUE obj, VALUE visibility)
|
||||||
{
|
{
|
||||||
@ -572,6 +578,38 @@ curses_bkgd(VALUE obj, VALUE ch)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
curses_use_default_colors(VALUE obj)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_USE_DEFAULT_COLORS)
|
||||||
|
use_default_colors();
|
||||||
|
return Qnil;
|
||||||
|
#else
|
||||||
|
rb_notimplement();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
curses_tabsize_set(VALUE obj, VALUE val)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_TABSIZE)
|
||||||
|
TABSIZE=NUM2INT(val);
|
||||||
|
return INT2NUM(TABSIZE);
|
||||||
|
#else
|
||||||
|
rb_notimplement();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
curses_tabsize_get(VALUE ojb)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_TABSIZE)
|
||||||
|
return INT2NUM(TABSIZE);
|
||||||
|
#else
|
||||||
|
rb_notimplement();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_escdelay_set(VALUE obj, VALUE val)
|
curses_escdelay_set(VALUE obj, VALUE val)
|
||||||
{
|
{
|
||||||
@ -1442,6 +1480,10 @@ Init_curses(void)
|
|||||||
|
|
||||||
rb_define_module_function(mCurses, "ESCDELAY=", curses_escdelay_set, 1);
|
rb_define_module_function(mCurses, "ESCDELAY=", curses_escdelay_set, 1);
|
||||||
rb_define_module_function(mCurses, "ESCDELAY", curses_escdelay_get, 0);
|
rb_define_module_function(mCurses, "ESCDELAY", curses_escdelay_get, 0);
|
||||||
|
rb_define_module_function(mCurses, "TABSIZE", curses_tabsize_get, 0);
|
||||||
|
rb_define_module_function(mCurses, "TABSIZE=", curses_tabsize_set, 1);
|
||||||
|
|
||||||
|
rb_define_module_function(mCurses, "use_default_colors", curses_use_default_colors, 0);
|
||||||
rb_define_module_function(mCurses, "init_screen", curses_init_screen, 0);
|
rb_define_module_function(mCurses, "init_screen", curses_init_screen, 0);
|
||||||
rb_define_module_function(mCurses, "close_screen", curses_close_screen, 0);
|
rb_define_module_function(mCurses, "close_screen", curses_close_screen, 0);
|
||||||
rb_define_module_function(mCurses, "closed?", curses_closed, 0);
|
rb_define_module_function(mCurses, "closed?", curses_closed, 0);
|
||||||
|
@ -21,7 +21,7 @@ elsif have_header(*curses=%w"curses.h") and have_library("curses", "initscr")
|
|||||||
end
|
end
|
||||||
|
|
||||||
if make
|
if make
|
||||||
for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set)
|
for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set use_default_colors)
|
||||||
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
|
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
|
||||||
end
|
end
|
||||||
flag = "-D_XOPEN_SOURCE_EXTENDED"
|
flag = "-D_XOPEN_SOURCE_EXTENDED"
|
||||||
@ -29,5 +29,6 @@ if make
|
|||||||
$defs << flag
|
$defs << flag
|
||||||
end
|
end
|
||||||
have_var("ESCDELAY", curses)
|
have_var("ESCDELAY", curses)
|
||||||
|
have_var("TABSIZE", curses)
|
||||||
create_makefile("curses")
|
create_makefile("curses")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user