newt 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/ruby_newt/extconf.rb +3 -5
- data/ext/ruby_newt/ruby_newt.c +13 -3
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5359a4863477fd0ef9301a39de7f52eec456a006e55c12fe8dbab231f0e46eb4
|
4
|
+
data.tar.gz: 563df08ba0b46e638a855a6ce62f17360e054125bd886086294d0ceb05e2f4b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab12bfb6e2bfd73116c94fe7489bee4063351092f900e91648fbb3ec85d128ba67b137d0fc143a725ca2b77633fe25b16918392bd08cab9edee2118c362c8b4
|
7
|
+
data.tar.gz: 5950e44aa2201eaff12e0d3725f0ff9f573cd2f3bf829068c660e304544052f17f55695efb731d6d042a63ad99d297f573ac7081d41089819fde4b539a5611d9
|
data/ext/ruby_newt/extconf.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
have_library('slang', 'SLsmg_refresh')
|
7
|
-
have_library('newt', 'newtInit')
|
3
|
+
pkg_config('slang')
|
4
|
+
pkg_config('libnewt')
|
8
5
|
|
9
6
|
append_cflags(ENV['CFLAGS'])
|
10
7
|
append_ldflags(ENV['LDFLAGS'])
|
8
|
+
|
11
9
|
create_makefile('ruby_newt/ruby_newt')
|
data/ext/ruby_newt/ruby_newt.c
CHANGED
@@ -38,10 +38,10 @@ static struct newtColors newtColors;
|
|
38
38
|
#define IVAR_DATA (rb_intern("newt_ivar_data"))
|
39
39
|
#define IVAR_COLS (rb_intern("newt_ivar_cols"))
|
40
40
|
#define IVAR_ROWS (rb_intern("newt_ivar_rows"))
|
41
|
-
#define IVAR_FILTER_CALLBACK (rb_intern("newt_ivar_filter_callback"))
|
42
41
|
#define CVAR_SUSPEND_CALLBACK (rb_intern("newt_cvar_suspend_callback"))
|
43
42
|
#define CVAR_HELP_CALLBACK (rb_intern("newt_cvar_help_callback"))
|
44
|
-
#define
|
43
|
+
#define IVAR_FILTER_CALLBACK (rb_intern("newt_ivar_filter_callback"))
|
44
|
+
#define IVAR_WIDGET_CALLBACK (rb_intern("newt_ivar_widget_callback"))
|
45
45
|
|
46
46
|
#define ARG_ERROR(given, expected) \
|
47
47
|
rb_raise(rb_eArgError, "wrong number of arguments (given %d, expected %s)", \
|
@@ -121,6 +121,13 @@ static inline Widget_data *widget_data_get(VALUE self)
|
|
121
121
|
return data;
|
122
122
|
}
|
123
123
|
|
124
|
+
NORETURN(static VALUE newt_s_alloc(VALUE klass));
|
125
|
+
static VALUE newt_s_alloc(VALUE klass)
|
126
|
+
{
|
127
|
+
rb_raise(rb_eTypeError, "allocator undefined for %"PRIsVALUE, klass);
|
128
|
+
UNREACHABLE_RETURN(Qnil);
|
129
|
+
}
|
130
|
+
|
124
131
|
static void free_widget(void *ptr)
|
125
132
|
{
|
126
133
|
Widget_data *data = (Widget_data *) ptr;
|
@@ -697,7 +704,7 @@ static VALUE rb_ext_Widget_callback(int argc, VALUE *argv, VALUE self)
|
|
697
704
|
Get_newtComponent(self, co);
|
698
705
|
cb = rb_struct_new(rb_ext_sCallback, self, rb_binding_new(), argv[0], data, NULL);
|
699
706
|
rb_obj_freeze(cb);
|
700
|
-
|
707
|
+
rb_ivar_set(self, IVAR_WIDGET_CALLBACK, cb);
|
701
708
|
newtComponentAddCallback(co, rb_ext_Widget_callback_function, (void *) cb);
|
702
709
|
return Qnil;
|
703
710
|
}
|
@@ -1774,6 +1781,7 @@ void Init_ruby_newt(){
|
|
1774
1781
|
rb_define_module_function(mNewt, "reflow_text", rb_ext_ReflowText, 4);
|
1775
1782
|
|
1776
1783
|
mScreen = rb_define_class_under(mNewt, "Screen", rb_cObject);
|
1784
|
+
rb_define_alloc_func(mScreen, newt_s_alloc);
|
1777
1785
|
rb_define_module_function(mScreen, "init", rb_ext_Screen_Init, 0);
|
1778
1786
|
rb_define_module_function(mScreen, "new", rb_ext_Screen_new, 0);
|
1779
1787
|
rb_define_module_function(mScreen, "cls", rb_ext_Screen_Cls, 0);
|
@@ -1806,6 +1814,7 @@ void Init_ruby_newt(){
|
|
1806
1814
|
rb_ext_sCallback = rb_struct_define("NewtCallback", "widget", "context", "callback", "data", NULL);
|
1807
1815
|
|
1808
1816
|
cWidget = rb_define_class_under(mNewt, "Widget", rb_cObject);
|
1817
|
+
rb_define_alloc_func(cWidget, newt_s_alloc);
|
1809
1818
|
rb_define_method(cWidget, "callback", rb_ext_Widget_callback, -1);
|
1810
1819
|
rb_define_method(cWidget, "takes_focus", rb_ext_Widget_takesFocus, 1);
|
1811
1820
|
rb_define_method(cWidget, "get_position", rb_ext_Widget_GetPosition, 0);
|
@@ -1895,6 +1904,7 @@ void Init_ruby_newt(){
|
|
1895
1904
|
rb_define_method(cForm, "watch_fd", rb_ext_Form_WatchFd, 2);
|
1896
1905
|
|
1897
1906
|
cExitStruct = rb_define_class_under(cForm, "ExitStruct", rb_cObject);
|
1907
|
+
rb_define_alloc_func(cExitStruct, newt_s_alloc);
|
1898
1908
|
rb_define_private_method(rb_singleton_class(cExitStruct), "new", NULL, 0);
|
1899
1909
|
rb_define_method(cExitStruct, "reason", rb_ext_ExitStruct_reason, 0);
|
1900
1910
|
rb_define_method(cExitStruct, "watch", rb_ext_ExitStruct_watch, 0);
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noritsugu Nakamura
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-05-23 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: Ruby bindings for newt TUI library
|
17
17
|
email: foreman-dev@googlegroups.com
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
86
|
+
rubygems_version: 3.5.9
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Ruby bindings for newt
|