curses 1.2.0-x86-mingw32 → 1.2.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/History.md +11 -0
- data/curses.gemspec +1 -1
- data/ext/curses/curses.c +134 -14
- data/ext/curses/extconf.rb +7 -4
- data/lib/2.2/curses.so +0 -0
- data/lib/2.3/curses.so +0 -0
- data/lib/2.4/curses.so +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb99c35ac3745ca7c0ad7d263a17a5b1e4ba062e
|
4
|
+
data.tar.gz: bfe75799c36d3d7d7cce20fc74c3f71a5c8538c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7d056f6d65d971112ade3799b6788255da86c9141f3c31a032fe4428e7e7893c397c418ba5612b2a706bf7401f02cc7b3e77a9a8bf796b4d23c45b97cbb855
|
7
|
+
data.tar.gz: c10992c9292f16fca86d66173e0f78367c31c35f785e27b6fb77029c36fe71a9e1422cbc7a5f5f4da82008dab5a1057eb34285d42e7390bdc9e168863b3dbd44
|
data/.gitignore
CHANGED
data/History.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### 1.2.1 / 2017-03-27
|
2
|
+
|
3
|
+
New features:
|
4
|
+
|
5
|
+
* Add touch, untouch, touched?, touch_line, and line_touched?.
|
6
|
+
|
7
|
+
Bug fixes:
|
8
|
+
|
9
|
+
* Fix Pad#subpad to use subpad(3). (Issue #23)
|
10
|
+
* Fix build issues on macOS. Pull requests #24, #25, #26, #27 and #28 by nobu.
|
11
|
+
|
1
12
|
### 1.2.0 / 2017-02-19
|
2
13
|
|
3
14
|
New features:
|
data/curses.gemspec
CHANGED
data/ext/curses/curses.c
CHANGED
@@ -954,7 +954,7 @@ curses_bkgdset(VALUE obj, VALUE ch)
|
|
954
954
|
{
|
955
955
|
#ifdef HAVE_BKGDSET
|
956
956
|
curses_stdscr();
|
957
|
-
bkgdset(
|
957
|
+
bkgdset(NUM2CHTYPE(ch));
|
958
958
|
#endif
|
959
959
|
return Qnil;
|
960
960
|
}
|
@@ -975,7 +975,7 @@ curses_bkgd(VALUE obj, VALUE ch)
|
|
975
975
|
{
|
976
976
|
#ifdef HAVE_BKGD
|
977
977
|
curses_stdscr();
|
978
|
-
return (bkgd(
|
978
|
+
return (bkgd(NUM2CHTYPE(ch)) == OK) ? Qtrue : Qfalse;
|
979
979
|
#else
|
980
980
|
return Qfalse;
|
981
981
|
#endif
|
@@ -1680,7 +1680,7 @@ window_noutrefresh(VALUE obj)
|
|
1680
1680
|
/*
|
1681
1681
|
* Document-method: Curses::Window.redraw
|
1682
1682
|
*
|
1683
|
-
*
|
1683
|
+
* Redraws the entire window.
|
1684
1684
|
*/
|
1685
1685
|
static VALUE
|
1686
1686
|
window_redraw(VALUE obj)
|
@@ -1696,6 +1696,125 @@ window_redraw(VALUE obj)
|
|
1696
1696
|
#define window_redraw rb_f_notimplement
|
1697
1697
|
#endif
|
1698
1698
|
|
1699
|
+
#ifdef HAVE_TOUCHWIN
|
1700
|
+
/*
|
1701
|
+
* Document-method: Curses::Window.touch
|
1702
|
+
*
|
1703
|
+
* Treat the window as if it has been modified since the last call of refresh.
|
1704
|
+
*/
|
1705
|
+
static VALUE
|
1706
|
+
window_touch(VALUE obj)
|
1707
|
+
{
|
1708
|
+
struct windata *winp;
|
1709
|
+
|
1710
|
+
GetWINDOW(obj, winp);
|
1711
|
+
touchwin(winp->window);
|
1712
|
+
|
1713
|
+
return Qnil;
|
1714
|
+
}
|
1715
|
+
#else
|
1716
|
+
#define window_touch rb_f_notimplement
|
1717
|
+
#endif
|
1718
|
+
|
1719
|
+
#ifdef HAVE_UNTOUCHWIN
|
1720
|
+
/*
|
1721
|
+
* Document-method: Curses::Window.untouch
|
1722
|
+
*
|
1723
|
+
* Treat the window as if it has not been modified since the last call of
|
1724
|
+
* refresh.
|
1725
|
+
*/
|
1726
|
+
static VALUE
|
1727
|
+
window_untouch(VALUE obj)
|
1728
|
+
{
|
1729
|
+
struct windata *winp;
|
1730
|
+
|
1731
|
+
GetWINDOW(obj, winp);
|
1732
|
+
untouchwin(winp->window);
|
1733
|
+
|
1734
|
+
return Qnil;
|
1735
|
+
}
|
1736
|
+
#else
|
1737
|
+
#define window_touch rb_f_notimplement
|
1738
|
+
#endif
|
1739
|
+
|
1740
|
+
#ifdef HAVE_IS_WINTOUCHED
|
1741
|
+
/*
|
1742
|
+
* Document-method: Curses::Window.touched?
|
1743
|
+
*
|
1744
|
+
* Return true if the window has been modified since the last call of refresh.
|
1745
|
+
*/
|
1746
|
+
static VALUE
|
1747
|
+
window_touched(VALUE obj)
|
1748
|
+
{
|
1749
|
+
struct windata *winp;
|
1750
|
+
|
1751
|
+
GetWINDOW(obj, winp);
|
1752
|
+
return is_wintouched(winp->window) ? Qtrue : Qfalse;
|
1753
|
+
}
|
1754
|
+
#else
|
1755
|
+
#define window_touched rb_f_notimplement
|
1756
|
+
#endif
|
1757
|
+
|
1758
|
+
#ifdef HAVE_WTOUCHLN
|
1759
|
+
/*
|
1760
|
+
* Document-method: Curses::Window.touch_line
|
1761
|
+
* call-seq: touch_line(y, n, changed = true)
|
1762
|
+
*
|
1763
|
+
* Make n lines from line y look as if they have (changed = true) or have not
|
1764
|
+
* (changed = false) been modified since the last call of refresh.
|
1765
|
+
*/
|
1766
|
+
static VALUE
|
1767
|
+
window_touch_line(int argc, VALUE *argv, VALUE obj)
|
1768
|
+
{
|
1769
|
+
struct windata *winp;
|
1770
|
+
VALUE y, n, changed;
|
1771
|
+
int result;
|
1772
|
+
|
1773
|
+
rb_scan_args(argc, argv, "12", &y, &n, &changed);
|
1774
|
+
if (argc < 2) {
|
1775
|
+
n = INT2NUM(1);
|
1776
|
+
}
|
1777
|
+
if (argc < 3) {
|
1778
|
+
changed = Qtrue;
|
1779
|
+
}
|
1780
|
+
GetWINDOW(obj, winp);
|
1781
|
+
result = wtouchln(winp->window, NUM2INT(y), NUM2INT(n), RTEST(changed));
|
1782
|
+
if (result == ERR) {
|
1783
|
+
rb_raise(rb_eRangeError, "Out of window");
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
return Qnil;
|
1787
|
+
}
|
1788
|
+
#else
|
1789
|
+
#define window_touch_line rb_f_notimplement
|
1790
|
+
#endif
|
1791
|
+
|
1792
|
+
#ifdef HAVE_IS_LINETOUCHED
|
1793
|
+
/*
|
1794
|
+
* Document-method: Curses::Window.line_touched?
|
1795
|
+
* call-seq: line_touched?(line)
|
1796
|
+
*
|
1797
|
+
* Return true if the specified line has been modified since the last call of
|
1798
|
+
* refresh.
|
1799
|
+
*/
|
1800
|
+
static VALUE
|
1801
|
+
window_line_touched(VALUE obj, VALUE line)
|
1802
|
+
{
|
1803
|
+
struct windata *winp;
|
1804
|
+
int result, n;
|
1805
|
+
|
1806
|
+
GetWINDOW(obj, winp);
|
1807
|
+
n = NUM2INT(line);
|
1808
|
+
result = is_linetouched(winp->window, n);
|
1809
|
+
if (result == ERR) {
|
1810
|
+
rb_raise(rb_eArgError, "Invalid line %d", n);
|
1811
|
+
}
|
1812
|
+
return result ? Qtrue : Qfalse;
|
1813
|
+
}
|
1814
|
+
#else
|
1815
|
+
#define window_line_touched rb_f_notimplement
|
1816
|
+
#endif
|
1817
|
+
|
1699
1818
|
/*
|
1700
1819
|
* Document-method: Curses::Window.move
|
1701
1820
|
* call-seq: move(y,x)
|
@@ -1779,7 +1898,7 @@ window_maxy(VALUE obj)
|
|
1779
1898
|
return INT2FIX(getmaxy(winp->window));
|
1780
1899
|
#elif defined(getmaxyx)
|
1781
1900
|
{
|
1782
|
-
int x, y;
|
1901
|
+
int RB_UNUSED_VAR(x), y;
|
1783
1902
|
getmaxyx(winp->window, y, x);
|
1784
1903
|
return INT2FIX(y);
|
1785
1904
|
}
|
@@ -1803,7 +1922,7 @@ window_maxx(VALUE obj)
|
|
1803
1922
|
return INT2FIX(getmaxx(winp->window));
|
1804
1923
|
#elif defined(getmaxyx)
|
1805
1924
|
{
|
1806
|
-
int x, y;
|
1925
|
+
int x, RB_UNUSED_VAR(y);
|
1807
1926
|
getmaxyx(winp->window, y, x);
|
1808
1927
|
return INT2FIX(x);
|
1809
1928
|
}
|
@@ -2402,7 +2521,7 @@ window_bkgdset(VALUE obj, VALUE ch)
|
|
2402
2521
|
struct windata *winp;
|
2403
2522
|
|
2404
2523
|
GetWINDOW(obj,winp);
|
2405
|
-
wbkgdset(winp->window,
|
2524
|
+
wbkgdset(winp->window, NUM2CHTYPE(ch));
|
2406
2525
|
#endif
|
2407
2526
|
return Qnil;
|
2408
2527
|
}
|
@@ -2423,7 +2542,7 @@ window_bkgd(VALUE obj, VALUE ch)
|
|
2423
2542
|
struct windata *winp;
|
2424
2543
|
|
2425
2544
|
GetWINDOW(obj,winp);
|
2426
|
-
return (wbkgd(winp->window,
|
2545
|
+
return (wbkgd(winp->window, NUM2CHTYPE(ch)) == OK) ? Qtrue : Qfalse;
|
2427
2546
|
#else
|
2428
2547
|
return Qfalse;
|
2429
2548
|
#endif
|
@@ -2601,9 +2720,6 @@ pad_initialize(VALUE obj, VALUE h, VALUE w)
|
|
2601
2720
|
return obj;
|
2602
2721
|
}
|
2603
2722
|
|
2604
|
-
#if 1
|
2605
|
-
#define pad_subpad window_subwin
|
2606
|
-
#else
|
2607
2723
|
/*
|
2608
2724
|
* Document-method: Curses::Pad.subpad
|
2609
2725
|
* call-seq:
|
@@ -2617,7 +2733,7 @@ static VALUE
|
|
2617
2733
|
pad_subpad(VALUE obj, VALUE height, VALUE width, VALUE begin_x, VALUE begin_y)
|
2618
2734
|
{
|
2619
2735
|
struct windata *padp;
|
2620
|
-
WINDOW *
|
2736
|
+
WINDOW *sub_pad;
|
2621
2737
|
VALUE pad;
|
2622
2738
|
int h, w, x, y;
|
2623
2739
|
|
@@ -2626,12 +2742,11 @@ pad_subpad(VALUE obj, VALUE height, VALUE width, VALUE begin_x, VALUE begin_y)
|
|
2626
2742
|
x = NUM2INT(begin_x);
|
2627
2743
|
y = NUM2INT(begin_y);
|
2628
2744
|
GetWINDOW(obj, padp);
|
2629
|
-
|
2630
|
-
pad = prep_window(rb_obj_class(obj),
|
2745
|
+
sub_pad = subpad(padp->window, h, w, x, y);
|
2746
|
+
pad = prep_window(rb_obj_class(obj), sub_pad);
|
2631
2747
|
|
2632
2748
|
return pad;
|
2633
2749
|
}
|
2634
|
-
#endif
|
2635
2750
|
|
2636
2751
|
/*
|
2637
2752
|
* Document-method: Curses::Pad.refresh
|
@@ -3150,6 +3265,11 @@ Init_curses(void)
|
|
3150
3265
|
rb_define_method(cWindow, "refresh", window_refresh, 0);
|
3151
3266
|
rb_define_method(cWindow, "noutrefresh", window_noutrefresh, 0);
|
3152
3267
|
rb_define_method(cWindow, "redraw", window_redraw, 0);
|
3268
|
+
rb_define_method(cWindow, "touch", window_touch, 0);
|
3269
|
+
rb_define_method(cWindow, "untouch", window_untouch, 0);
|
3270
|
+
rb_define_method(cWindow, "touched?", window_touched, 0);
|
3271
|
+
rb_define_method(cWindow, "touch_line", window_touch_line, -1);
|
3272
|
+
rb_define_method(cWindow, "line_touched?", window_line_touched, 1);
|
3153
3273
|
rb_define_method(cWindow, "box", window_box, -1);
|
3154
3274
|
rb_define_method(cWindow, "move", window_move, 2);
|
3155
3275
|
rb_define_method(cWindow, "setpos", window_setpos, 2);
|
data/ext/curses/extconf.rb
CHANGED
@@ -60,15 +60,17 @@ if header_library
|
|
60
60
|
scrl set setscrreg ungetch
|
61
61
|
wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr
|
62
62
|
wresize wscrl wsetscrreg werase redrawwin
|
63
|
+
touchwin untouchwin wtouchln is_linetouched is_wintouched
|
63
64
|
def_prog_mode reset_prog_mode timeout wtimeout nodelay
|
64
65
|
init_color wcolor_set use_default_colors assume_default_colors
|
65
66
|
newpad unget_wch get_wch wget_wch)
|
66
67
|
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
|
67
68
|
end
|
69
|
+
convertible_int('chtype', [["#undef MOUSE_MOVED\n"]]+curses) or abort
|
68
70
|
flag = "-D_XOPEN_SOURCE_EXTENDED"
|
69
|
-
if
|
70
|
-
|
71
|
-
|
71
|
+
if checking_for("_XOPEN_SOURCE_EXTENDED") {
|
72
|
+
try_compile(cpp_include(%w[stdio.h stdlib.h]+curses), flag, :werror => true)
|
73
|
+
}
|
72
74
|
$defs << flag
|
73
75
|
end
|
74
76
|
have_var("ESCDELAY", curses)
|
@@ -134,8 +136,9 @@ if header_library
|
|
134
136
|
if enable_config("pdcurses-wide")
|
135
137
|
$defs << '-DPDC_WIDE'
|
136
138
|
end
|
137
|
-
|
139
|
+
|
138
140
|
if RUBY_VERSION >= '2.1'
|
141
|
+
create_header
|
139
142
|
create_makefile("curses")
|
140
143
|
else
|
141
144
|
# curses is part of ruby-core pre-2.1.0, so this gem is not required. But
|
data/lib/2.2/curses.so
CHANGED
Binary file
|
data/lib/2.3/curses.so
CHANGED
Binary file
|
data/lib/2.4/curses.so
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.6.
|
112
|
+
rubygems_version: 2.6.11
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: A Ruby binding for curses, ncurses, and PDCurses. curses is an extension
|