ncursesw 1.4.0.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/extconf.rb +3 -0
- data/form_wrap.h +2 -0
- data/ncurses_wrap.c +16 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
data/extconf.rb
CHANGED
@@ -146,6 +146,9 @@ if have_library("formw", "form_driver_w")
|
|
146
146
|
$CFLAGS += " -DHAVE_FORM_DRIVER_W"
|
147
147
|
end
|
148
148
|
|
149
|
+
have_func("add_wch")
|
150
|
+
have_func("get_wch")
|
151
|
+
|
149
152
|
puts "checking for the menu library..."
|
150
153
|
if have_header("menu.h")
|
151
154
|
have_library("menu", "new_menu")
|
data/form_wrap.h
CHANGED
data/ncurses_wrap.c
CHANGED
@@ -573,10 +573,12 @@ static chtype * RB2CHSTR(VALUE array)
|
|
573
573
|
static VALUE rbncurs_addch(VALUE dummy, VALUE arg1) {
|
574
574
|
return INT2NUM(addch((int) NUM2ULONG(arg1)));
|
575
575
|
}
|
576
|
+
#ifdef HAVE_ADD_WCH
|
576
577
|
static VALUE rbncurs_add_wch(VALUE dummy, VALUE arg1) {
|
577
578
|
wchar_t c = NUM2ULONG(arg1);
|
578
579
|
return INT2NUM(add_wch((cchar_t *)&c));
|
579
580
|
}
|
581
|
+
#endif
|
580
582
|
static VALUE rbncurs_addchnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
|
581
583
|
chtype * chstr = RB2CHSTR(arg1);
|
582
584
|
VALUE return_value = INT2NUM(addchnstr(chstr, NUM2INT(arg2)));
|
@@ -918,6 +920,7 @@ static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win) {
|
|
918
920
|
return rbncurshelper_do_wgetch_functor (c_win, &wgetch);
|
919
921
|
}
|
920
922
|
|
923
|
+
#ifdef HAVE_GET_WCH
|
921
924
|
/* not thread safe: wide char getch */
|
922
925
|
static wint_t wget_wch_back;
|
923
926
|
static int my_wget_wch (WINDOW *c_win) {
|
@@ -931,14 +934,17 @@ static VALUE rbncurshelper_nonblocking_wget_wch(WINDOW *c_win) {
|
|
931
934
|
VALUE r = rb_assoc_new (INT2NUM(retcode), LONG2NUM(wget_wch_back));
|
932
935
|
return r;
|
933
936
|
}
|
937
|
+
#endif
|
934
938
|
|
935
939
|
static VALUE rbncurs_getch(VALUE dummy) {
|
936
940
|
return INT2NUM(rbncurshelper_nonblocking_wgetch(stdscr));
|
937
941
|
}
|
938
942
|
|
943
|
+
#ifdef HAVE_GET_WCH
|
939
944
|
static VALUE rbncurs_get_wch(VALUE dummy) {
|
940
945
|
return rbncurshelper_nonblocking_wget_wch(stdscr);
|
941
946
|
}
|
947
|
+
#endif
|
942
948
|
|
943
949
|
static VALUE rbncurs_halfdelay(VALUE dummy, VALUE arg1) {
|
944
950
|
return INT2NUM(rbncurshelper_halfdelay_cbreak(NUM2INT(arg1), 1));
|
@@ -1506,10 +1512,12 @@ static VALUE rbncurs_vline(VALUE dummy, VALUE arg1, VALUE arg2) {
|
|
1506
1512
|
static VALUE rbncurs_waddch(VALUE dummy, VALUE arg1, VALUE arg2) {
|
1507
1513
|
return INT2NUM(waddch(get_window(arg1), (int) NUM2ULONG(arg2)));
|
1508
1514
|
}
|
1515
|
+
#ifdef HAVE_ADD_WCH
|
1509
1516
|
static VALUE rbncurs_wadd_wch(VALUE dummy, VALUE arg1, VALUE arg2) {
|
1510
1517
|
cchar_t t = { 0, { NUM2ULONG(arg2), 0 } };
|
1511
1518
|
return INT2NUM(wadd_wch(get_window(arg1), &t));
|
1512
1519
|
}
|
1520
|
+
#endif
|
1513
1521
|
static VALUE rbncurs_waddchnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
|
1514
1522
|
chtype * chstr = RB2CHSTR(arg2);
|
1515
1523
|
VALUE return_value = INT2NUM(waddchnstr(get_window(arg1), chstr,
|
@@ -1585,9 +1593,11 @@ static VALUE rbncurs_wgetch(VALUE dummy, VALUE arg1) {
|
|
1585
1593
|
return INT2NUM(rbncurshelper_nonblocking_wgetch(get_window(arg1)));
|
1586
1594
|
}
|
1587
1595
|
|
1596
|
+
#ifdef HAVE_GET_WCH
|
1588
1597
|
static VALUE rbncurs_wget_wch(VALUE dummy, VALUE arg1) {
|
1589
1598
|
return rbncurshelper_nonblocking_wget_wch(get_window(arg1));
|
1590
1599
|
}
|
1600
|
+
#endif
|
1591
1601
|
|
1592
1602
|
static VALUE rbncurs_whline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
|
1593
1603
|
return INT2NUM(whline(get_window(arg1), (int) NUM2ULONG(arg2), NUM2INT(arg3)));
|
@@ -1731,7 +1741,9 @@ static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE r
|
|
1731
1741
|
|
1732
1742
|
static void init_functions_2(void) {
|
1733
1743
|
NCFUNC(addch, 1);
|
1744
|
+
#ifdef HAVE_ADD_WCH
|
1734
1745
|
NCFUNC(add_wch, 1);
|
1746
|
+
#endif
|
1735
1747
|
NCFUNC(addchnstr, 2);
|
1736
1748
|
NCFUNC(addchstr, 1);
|
1737
1749
|
NCFUNC(addnstr, 2);
|
@@ -1814,8 +1826,10 @@ static void init_functions_2(void) {
|
|
1814
1826
|
NCFUNC(flushinp, 0);
|
1815
1827
|
NCFUNC(getbkgd, 1);
|
1816
1828
|
NCFUNC(getch, 0);
|
1829
|
+
#ifdef HAVE_GET_WCH
|
1817
1830
|
NCFUNC(get_wch, 0);
|
1818
1831
|
NCFUNC(wget_wch, 1);
|
1832
|
+
#endif
|
1819
1833
|
NCFUNC(halfdelay, 1);
|
1820
1834
|
rb_define_module_function(mNcurses, "has_colors?",
|
1821
1835
|
(&rbncurs_has_colors),
|
@@ -1995,7 +2009,9 @@ static void init_functions_2(void) {
|
|
1995
2009
|
#endif
|
1996
2010
|
NCFUNC(vline, 2);
|
1997
2011
|
NCFUNC(waddch, 2);
|
2012
|
+
#ifdef HAVE_ADD_WCH
|
1998
2013
|
NCFUNC(wadd_wch, 2);
|
2014
|
+
#endif
|
1999
2015
|
NCFUNC(waddchnstr, 3);
|
2000
2016
|
NCFUNC(waddchstr, 2);
|
2001
2017
|
NCFUNC(waddnstr, 3);
|