curses 1.2.1 → 1.2.2

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: be7e62d906986b92d5aeb5ad8c7dd948833268f8
4
- data.tar.gz: 72f1b3eca9ec5a59946542a035a056acf0f06480
3
+ metadata.gz: 1c4334a25b2d2defa891e6563b7302ab6cd6e1fd
4
+ data.tar.gz: 85c551081b9df4fe67373b4009b952e03b879101
5
5
  SHA512:
6
- metadata.gz: '09b7f6fbe55a30bc30c4eb8217525be91ae62dd4621574a6376c7403d98ce599556be616677ad7d811cb2bfa46365a4d542e0ab7ec87c6b9b14a86ed31cda388'
7
- data.tar.gz: cdc9f6227b7d35a71a31c3bc389e8e4c4c81d898a7fc9ed99c3e2233c6613d5949124878bdf287ba9d9ecc95e5bf2c245f8a82fa001c6db12b2593d625cf3c6e
6
+ metadata.gz: f17ebf960373a51a71635296cfafd607b058df2878fb22e217a72b320f3bde6367b8f5c09c7dbe5d93b144bdf874a712325f05ee432441b89051770eaca2cb54
7
+ data.tar.gz: f57ca3e245404dd7282c41a7745a1044de0e763970cf34c2d27cc3e52b79e61de1b65f63374ad34139fee2b4ea9c31a01536eb004df06f40c3b169c0f315b28d
data/.gitignore CHANGED
@@ -10,5 +10,6 @@
10
10
  /Gemfile.lock
11
11
  /vendor/x86-mingw32
12
12
  /vendor/x64-mingw32
13
+ /vendor/x64-mswin64*
13
14
  /ext/curses/Makefile
14
15
  .ruby-version
@@ -6,9 +6,8 @@ notifications:
6
6
  - drbrain@segment7.net
7
7
  - shugo@ruby-lang.org
8
8
  rvm:
9
- - 2.1.10
10
- - 2.2.6
11
- - 2.3.3
12
- - 2.4.0
9
+ - 2.2.7
10
+ - 2.3.4
11
+ - 2.4.1
13
12
  - ruby-head
14
13
  script: rake compile
data/History.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.2.2 / 2017-04-22
2
+
3
+ New features:
4
+
5
+ * Add Curses.get_key_modifiers, Curses.return_key_modifiers, and
6
+ Curses.save_key_modifiers.
7
+ * Support mswin native build. Pull request #29 by usa.
8
+
1
9
  ### 1.2.1 / 2017-03-27
2
10
 
3
11
  New features:
data/Rakefile CHANGED
@@ -9,6 +9,9 @@ rescue LoadError => e
9
9
  warn "run: bundle install\n\n"
10
10
  end
11
11
 
12
+ $mswin = /mswin/ =~ RUBY_PLATFORM
13
+
14
+ CLOBBER.include("vendor/#{RUBY_PLATFORM}") if $mswin
12
15
  CLOBBER.include("vendor/x86-mingw32")
13
16
  CLOBBER.include("vendor/x64-mingw32")
14
17
  CLOBBER.include("lib/2.*")
@@ -17,11 +20,18 @@ CLOBBER.include("pkg")
17
20
  namespace :build do
18
21
  desc "Build PDCurses"
19
22
  task :pdcurses do
23
+ mkdir_p "vendor/#{RUBY_PLATFORM}/PDCurses" if $mswin
20
24
  mkdir_p "vendor/x86-mingw32/PDCurses"
21
25
  mkdir_p "vendor/x64-mingw32/PDCurses"
22
26
  chdir "vendor/PDCurses/win32" do
27
+ if $mswin
28
+ sh "nmake -f vcwin32.mak clean all WIDE=Y"
29
+ cp "pdcurses.lib", "../../#{RUBY_PLATFORM}/PDCurses"
30
+ end
31
+
23
32
  sh "make -f mingwin32.mak clean all _linux_w32=1 WIDE=Y DLL=Y"
24
33
  cp "pdcurses.dll", "../../x86-mingw32/PDCurses"
34
+
25
35
  sh "make -f mingwin32.mak clean all _linux_w64=1 WIDE=Y DLL=Y"
26
36
  cp "pdcurses.dll", "../../x64-mingw32/PDCurses"
27
37
  end
@@ -32,6 +42,7 @@ namespace :clean do
32
42
  desc "Clean PDCurses"
33
43
  task :pdcurses do
34
44
  chdir "vendor/PDCurses/win32" do
45
+ sh "nmake -f vcwin32.mak clean" if $mswin
35
46
  sh "make -f mingwin32.mak clean _linux_w64=1"
36
47
  end
37
48
  end
@@ -39,6 +50,14 @@ end
39
50
 
40
51
  spec = eval(File.read(File.expand_path("curses.gemspec", __dir__)))
41
52
  Rake::ExtensionTask.new(spec.name, spec) do |ext|
53
+ if $mswin
54
+ ext.config_options << '--with-curses-include=' +
55
+ File.expand_path("vendor/PDCurses", __dir__) +
56
+ ' --with-curses-version=function --enable-pdcurses-wide' +
57
+ ' --with-curses-lib=' +
58
+ File.expand_path("vendor/#{RUBY_PLATFORM}/PDCurses", __dir__)
59
+ end
60
+
42
61
  ext.cross_compile = true
43
62
  ext.cross_platform = ["x86-mingw32", "x64-mingw32"]
44
63
  ext.cross_config_options << '--with-curses-include=' +
@@ -12,6 +12,5 @@ test: off
12
12
  deploy: off
13
13
  environment:
14
14
  matrix:
15
- - ruby_version: "21-x64"
16
15
  - ruby_version: "22-x64"
17
16
  - ruby_version: "23-x64"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new { |s|
2
2
  s.name = "curses"
3
- s.version = "1.2.1"
3
+ s.version = "1.2.2"
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"
@@ -3030,6 +3030,26 @@ window_get_char(VALUE obj)
3030
3030
  #endif
3031
3031
  }
3032
3032
 
3033
+ #ifdef HAVE_PDC_GET_KEY_MODIFIERS
3034
+ static VALUE
3035
+ curses_get_key_modifiers(VALUE obj)
3036
+ {
3037
+ return ULONG2NUM(PDC_get_key_modifiers());
3038
+ }
3039
+
3040
+ static VALUE
3041
+ curses_return_key_modifiers(VALUE obj, VALUE flag)
3042
+ {
3043
+ return INT2NUM(PDC_return_key_modifiers(RTEST(flag)));
3044
+ }
3045
+
3046
+ static VALUE
3047
+ curses_save_key_modifiers(VALUE obj, VALUE flag)
3048
+ {
3049
+ return INT2NUM(PDC_save_key_modifiers(RTEST(flag)));
3050
+ }
3051
+ #endif
3052
+
3033
3053
  /*------------------------- Initialization -------------------------*/
3034
3054
 
3035
3055
  /*
@@ -3193,6 +3213,11 @@ Init_curses(void)
3193
3213
  rb_define_module_function(mCurses, "terminal_encoding=", curses_set_terminal_encoding, 1);
3194
3214
  rb_define_module_function(mCurses, "unget_char", curses_unget_char, 1);
3195
3215
  rb_define_module_function(mCurses, "get_char", curses_get_char, 0);
3216
+ #ifdef HAVE_PDC_GET_KEY_MODIFIERS
3217
+ rb_define_module_function(mCurses, "get_key_modifiers", curses_get_key_modifiers, 0);
3218
+ rb_define_module_function(mCurses, "return_key_modifiers", curses_return_key_modifiers, 1);
3219
+ rb_define_module_function(mCurses, "save_key_modifiers", curses_save_key_modifiers, 1);
3220
+ #endif
3196
3221
 
3197
3222
  {
3198
3223
  VALUE version;
@@ -3335,7 +3360,7 @@ Init_curses(void)
3335
3360
  rb_undef_method(cPad, "subwin");
3336
3361
  #endif
3337
3362
 
3338
- #define rb_curses_define_const(c) rb_define_const(mCurses,#c,UINT2NUM(c))
3363
+ #define rb_curses_define_const(c) rb_define_const(mCurses,#c,CHTYPE2NUM(c))
3339
3364
 
3340
3365
  #ifdef USE_COLOR
3341
3366
  /* Document-const: A_ATTRIBUTES
@@ -4758,6 +4783,49 @@ Init_curses(void)
4758
4783
  rb_define_const(mCurses, name, INT2FIX(c - 'A' + 1));
4759
4784
  }
4760
4785
  }
4786
+ #ifdef PDC_KEY_MODIFIER_SHIFT
4787
+ /* PDCurses-specific keys */
4788
+ rb_curses_define_const(ALT_0);
4789
+ rb_curses_define_const(ALT_1);
4790
+ rb_curses_define_const(ALT_2);
4791
+ rb_curses_define_const(ALT_3);
4792
+ rb_curses_define_const(ALT_4);
4793
+ rb_curses_define_const(ALT_5);
4794
+ rb_curses_define_const(ALT_6);
4795
+ rb_curses_define_const(ALT_7);
4796
+ rb_curses_define_const(ALT_8);
4797
+ rb_curses_define_const(ALT_9);
4798
+ rb_curses_define_const(ALT_A);
4799
+ rb_curses_define_const(ALT_B);
4800
+ rb_curses_define_const(ALT_C);
4801
+ rb_curses_define_const(ALT_D);
4802
+ rb_curses_define_const(ALT_E);
4803
+ rb_curses_define_const(ALT_F);
4804
+ rb_curses_define_const(ALT_G);
4805
+ rb_curses_define_const(ALT_H);
4806
+ rb_curses_define_const(ALT_I);
4807
+ rb_curses_define_const(ALT_J);
4808
+ rb_curses_define_const(ALT_K);
4809
+ rb_curses_define_const(ALT_L);
4810
+ rb_curses_define_const(ALT_M);
4811
+ rb_curses_define_const(ALT_N);
4812
+ rb_curses_define_const(ALT_O);
4813
+ rb_curses_define_const(ALT_P);
4814
+ rb_curses_define_const(ALT_Q);
4815
+ rb_curses_define_const(ALT_R);
4816
+ rb_curses_define_const(ALT_S);
4817
+ rb_curses_define_const(ALT_T);
4818
+ rb_curses_define_const(ALT_U);
4819
+ rb_curses_define_const(ALT_V);
4820
+ rb_curses_define_const(ALT_W);
4821
+ rb_curses_define_const(ALT_X);
4822
+ rb_curses_define_const(ALT_Y);
4823
+ rb_curses_define_const(ALT_Z);
4824
+ rb_curses_define_const(PDC_KEY_MODIFIER_SHIFT);
4825
+ rb_curses_define_const(PDC_KEY_MODIFIER_CONTROL);
4826
+ rb_curses_define_const(PDC_KEY_MODIFIER_ALT);
4827
+ rb_curses_define_const(PDC_KEY_MODIFIER_NUMLOCK);
4828
+ #endif
4761
4829
  #undef rb_curses_define_const
4762
4830
 
4763
4831
  rb_set_end_proc(curses_finalize, 0);
@@ -63,7 +63,7 @@ if header_library
63
63
  touchwin untouchwin wtouchln is_linetouched is_wintouched
64
64
  def_prog_mode reset_prog_mode timeout wtimeout nodelay
65
65
  init_color wcolor_set use_default_colors assume_default_colors
66
- newpad unget_wch get_wch wget_wch)
66
+ newpad unget_wch get_wch wget_wch PDC_get_key_modifiers)
67
67
  have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
68
68
  end
69
69
  convertible_int('chtype', [["#undef MOUSE_MOVED\n"]]+curses) or abort
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.1
4
+ version: 1.2.2
5
5
  platform: ruby
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-03-27 00:00:00.000000000 Z
12
+ date: 2017-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler