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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed6a99bc0bc081a4d7023f5c2e487aa31b2736b8
4
- data.tar.gz: 9a9181fca6c0f623277ec99f20f821abf37a5e38
3
+ metadata.gz: cb99c35ac3745ca7c0ad7d263a17a5b1e4ba062e
4
+ data.tar.gz: bfe75799c36d3d7d7cce20fc74c3f71a5c8538c5
5
5
  SHA512:
6
- metadata.gz: a898b5e027249f722b713d88264fd8d6c954c4bf158e434c387b709b83ae9c897037445658a608e90ea0a6dd7f069522dcaf90f15dc88e793681811034d1f56c
7
- data.tar.gz: 80759911360084014eba6f71abb2b4e57964afc5d56a560df65352e79f87a35d28d5da21eb5f7ebb457d54da3a37af880dd0db3b16cb58b354a327144c7ecfbf
6
+ metadata.gz: 8c7d056f6d65d971112ade3799b6788255da86c9141f3c31a032fe4428e7e7893c397c418ba5612b2a706bf7401f02cc7b3e77a9a8bf796b4d23c45b97cbb855
7
+ data.tar.gz: c10992c9292f16fca86d66173e0f78367c31c35f785e27b6fb77029c36fe71a9e1422cbc7a5f5f4da82008dab5a1057eb34285d42e7390bdc9e168863b3dbd44
data/.gitignore CHANGED
@@ -10,4 +10,5 @@
10
10
  /Gemfile.lock
11
11
  /vendor/x86-mingw32
12
12
  /vendor/x64-mingw32
13
+ /ext/curses/Makefile
13
14
  .ruby-version
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:
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new { |s|
2
2
  s.name = "curses"
3
- s.version = "1.2.0"
3
+ s.version = "1.2.1"
4
4
  s.author = ["Shugo Maeda", 'Eric Hodel']
5
5
  s.email = ["shugo@ruby-lang.org", 'drbrain@segment7.net']
6
6
  s.homepage = "https://github.com/ruby/curses"
@@ -954,7 +954,7 @@ curses_bkgdset(VALUE obj, VALUE ch)
954
954
  {
955
955
  #ifdef HAVE_BKGDSET
956
956
  curses_stdscr();
957
- bkgdset(NUM2ULONG(ch));
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(NUM2ULONG(ch)) == OK) ? Qtrue : Qfalse;
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
- * Dedraws the entire window.
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, NUM2ULONG(ch));
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, NUM2ULONG(ch)) == OK) ? Qtrue : Qfalse;
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 *subpad;
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
- subpad = subwin(padp->window, h, w, x, y);
2630
- pad = prep_window(rb_obj_class(obj), subpad);
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);
@@ -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 try_static_assert("sizeof(char*)>sizeof(int)",
70
- %w[stdio.h stdlib.h]+curses,
71
- flag)
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
Binary file
Binary file
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.0
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-02-19 00:00:00.000000000 Z
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.10
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