notcurses 0.0.1 → 0.0.2

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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/Gemfile +2 -0
  4. data/Gemfile.lock +9 -1
  5. data/Rakefile +11 -0
  6. data/Rakefile.new +28 -0
  7. data/TODO +19 -0
  8. data/checksums/notcurses-0.0.1.gem.sha512 +1 -0
  9. data/data/PurpleDrank.jpg +0 -0
  10. data/data/Windows10Logo.png +0 -0
  11. data/data/aidsrobots.jpeg +0 -0
  12. data/data/atma.png +0 -0
  13. data/data/changes.jpg +0 -0
  14. data/data/changes.xcf +0 -0
  15. data/data/chunli01.png +0 -0
  16. data/data/chunli02.png +0 -0
  17. data/data/chunli03.png +0 -0
  18. data/data/chunli04.png +0 -0
  19. data/data/chunli05.png +0 -0
  20. data/data/chunli06.png +0 -0
  21. data/data/chunli07.png +0 -0
  22. data/data/chunli08.png +0 -0
  23. data/data/chunli09.png +0 -0
  24. data/data/chunli1.bmp +0 -0
  25. data/data/chunli10.png +0 -0
  26. data/data/chunli11.png +0 -0
  27. data/data/chunli12.png +0 -0
  28. data/data/chunli13.png +0 -0
  29. data/data/chunli14.png +0 -0
  30. data/data/chunli15.png +0 -0
  31. data/data/chunli16.png +0 -0
  32. data/data/chunli17.png +0 -0
  33. data/data/chunli18.png +0 -0
  34. data/data/chunli19.png +0 -0
  35. data/data/chunli2.bmp +0 -0
  36. data/data/chunli20.png +0 -0
  37. data/data/chunli21.png +0 -0
  38. data/data/chunli22.png +0 -0
  39. data/data/chunli23.png +0 -0
  40. data/data/chunli24.png +0 -0
  41. data/data/chunli25.png +0 -0
  42. data/data/chunli26.png +0 -0
  43. data/data/chunli27.png +0 -0
  44. data/data/chunli28.png +0 -0
  45. data/data/chunli29.png +0 -0
  46. data/data/chunli3.bmp +0 -0
  47. data/data/chunli30.png +0 -0
  48. data/data/chunli31.png +0 -0
  49. data/data/chunli32.png +1 -0
  50. data/data/chunli33.png +1 -0
  51. data/data/chunli34.png +1 -0
  52. data/data/chunli35.png +1 -0
  53. data/data/chunli36.png +1 -0
  54. data/data/chunli37.png +1 -0
  55. data/data/chunli38.png +0 -0
  56. data/data/chunli39.png +1 -0
  57. data/data/chunli4.bmp +0 -0
  58. data/data/chunli40.png +0 -0
  59. data/data/chunli41.png +1 -0
  60. data/data/chunli42.png +1 -0
  61. data/data/chunli43.png +1 -0
  62. data/data/chunli44.png +1 -0
  63. data/data/chunli45.png +0 -0
  64. data/data/chunli5.bmp +0 -0
  65. data/data/chunli6.bmp +0 -0
  66. data/data/chunli7.bmp +0 -0
  67. data/data/chunli8.bmp +0 -0
  68. data/data/covid19.jpg +0 -0
  69. data/data/dsscaw-purp.png +0 -0
  70. data/data/eagles.png +0 -0
  71. data/data/fm6.mov +0 -0
  72. data/data/fonts.jpg +0 -0
  73. data/data/freebsd.png +0 -0
  74. data/data/lamepatents.jpg +0 -0
  75. data/data/megaman2.bmp +0 -0
  76. data/data/natasha-blur.png +0 -0
  77. data/data/natasha-blur.xcf +0 -0
  78. data/data/normal.png +0 -0
  79. data/data/normal.xcf +0 -0
  80. data/data/notcurses.png +0 -0
  81. data/data/notcursesIII.mov +0 -0
  82. data/data/onedot.png +0 -0
  83. data/data/samoa.avi +0 -0
  84. data/data/samoa.osp +296 -0
  85. data/data/spaceship.png +0 -0
  86. data/data/tetris-background.jpg +0 -0
  87. data/data/tetris-background.xcf +0 -0
  88. data/data/warmech.bmp +0 -0
  89. data/data/worldmap.png +0 -0
  90. data/exe/notcurses-ruby-testscript +57 -0
  91. data/ext/notcurses/extconf.rb +56 -17
  92. data/ext/notcurses/{notcurses_wrap.c → src/notcurses_wrap.c} +55459 -18930
  93. data/ext/notcurses/swig/notcurses.i +552 -0
  94. data/lib/notcurses/swig_mixins/struct_initializer.rb +25 -0
  95. data/lib/notcurses/swig_mixins/to_h.rb +22 -0
  96. data/lib/notcurses/version.rb +1 -1
  97. data/lib/notcurses.rb +34 -1
  98. metadata +98 -11
  99. data/ext/notcurses/Makefile +0 -269
  100. data/ext/notcurses/notcurses.i +0 -282
  101. data/ext/notcurses/notcurses_wrapper.h +0 -20
  102. /data/ext/notcurses/{ncplane_vprintf_aligned.c → src/ruby_ncplane_vprintf_aligned.c} +0 -0
  103. /data/ext/notcurses/{ncplane_vprintf_stained.c → src/ruby_ncplane_vprintf_stained.c} +0 -0
  104. /data/ext/notcurses/{ncplane_vprintf_yx.c → src/ruby_ncplane_vprintf_yx.c} +0 -0
  105. /data/ext/notcurses/{modified_ruby_std_wstring.i → swig/modified_ruby_std_wstring.i} +0 -0
metadata CHANGED
@@ -1,42 +1,129 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Snake Blitzken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-23 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Notcurses is a modern reimagining of the classic TUI library curses.
14
14
  It supports true color, has stock widgets, and should be familiar enough to anyone
15
15
  familiar with curses, though it is not an API-compatible drop-in.
16
16
  email:
17
17
  - git@slithernix.com
18
- executables: []
18
+ executables:
19
+ - notcurses-ruby-testscript
19
20
  extensions:
20
21
  - ext/notcurses/extconf.rb
21
22
  extra_rdoc_files: []
22
23
  files:
23
24
  - ".rubocop.yml"
24
25
  - ".ruby-version"
26
+ - CHANGELOG.md
25
27
  - Gemfile
26
28
  - Gemfile.lock
27
29
  - README.md
28
30
  - Rakefile
29
- - ext/notcurses/Makefile
31
+ - Rakefile.new
32
+ - TODO
33
+ - checksums/notcurses-0.0.1.gem.sha512
34
+ - data/PurpleDrank.jpg
35
+ - data/Windows10Logo.png
36
+ - data/aidsrobots.jpeg
37
+ - data/atma.png
38
+ - data/changes.jpg
39
+ - data/changes.xcf
40
+ - data/chunli01.png
41
+ - data/chunli02.png
42
+ - data/chunli03.png
43
+ - data/chunli04.png
44
+ - data/chunli05.png
45
+ - data/chunli06.png
46
+ - data/chunli07.png
47
+ - data/chunli08.png
48
+ - data/chunli09.png
49
+ - data/chunli1.bmp
50
+ - data/chunli10.png
51
+ - data/chunli11.png
52
+ - data/chunli12.png
53
+ - data/chunli13.png
54
+ - data/chunli14.png
55
+ - data/chunli15.png
56
+ - data/chunli16.png
57
+ - data/chunli17.png
58
+ - data/chunli18.png
59
+ - data/chunli19.png
60
+ - data/chunli2.bmp
61
+ - data/chunli20.png
62
+ - data/chunli21.png
63
+ - data/chunli22.png
64
+ - data/chunli23.png
65
+ - data/chunli24.png
66
+ - data/chunli25.png
67
+ - data/chunli26.png
68
+ - data/chunli27.png
69
+ - data/chunli28.png
70
+ - data/chunli29.png
71
+ - data/chunli3.bmp
72
+ - data/chunli30.png
73
+ - data/chunli31.png
74
+ - data/chunli32.png
75
+ - data/chunli33.png
76
+ - data/chunli34.png
77
+ - data/chunli35.png
78
+ - data/chunli36.png
79
+ - data/chunli37.png
80
+ - data/chunli38.png
81
+ - data/chunli39.png
82
+ - data/chunli4.bmp
83
+ - data/chunli40.png
84
+ - data/chunli41.png
85
+ - data/chunli42.png
86
+ - data/chunli43.png
87
+ - data/chunli44.png
88
+ - data/chunli45.png
89
+ - data/chunli5.bmp
90
+ - data/chunli6.bmp
91
+ - data/chunli7.bmp
92
+ - data/chunli8.bmp
93
+ - data/covid19.jpg
94
+ - data/dsscaw-purp.png
95
+ - data/eagles.png
96
+ - data/fm6.mov
97
+ - data/fonts.jpg
98
+ - data/freebsd.png
99
+ - data/lamepatents.jpg
100
+ - data/megaman2.bmp
101
+ - data/natasha-blur.png
102
+ - data/natasha-blur.xcf
103
+ - data/normal.png
104
+ - data/normal.xcf
105
+ - data/notcurses.png
106
+ - data/notcursesIII.mov
107
+ - data/onedot.png
108
+ - data/samoa.avi
109
+ - data/samoa.osp
110
+ - data/spaceship.png
111
+ - data/tetris-background.jpg
112
+ - data/tetris-background.xcf
113
+ - data/warmech.bmp
114
+ - data/worldmap.png
115
+ - exe/notcurses-ruby-testscript
30
116
  - ext/notcurses/extconf.rb
31
- - ext/notcurses/modified_ruby_std_wstring.i
32
- - ext/notcurses/ncplane_vprintf_aligned.c
33
- - ext/notcurses/ncplane_vprintf_stained.c
34
- - ext/notcurses/ncplane_vprintf_yx.c
35
- - ext/notcurses/notcurses.i
36
- - ext/notcurses/notcurses_wrap.c
37
- - ext/notcurses/notcurses_wrapper.h
117
+ - ext/notcurses/src/notcurses_wrap.c
118
+ - ext/notcurses/src/ruby_ncplane_vprintf_aligned.c
119
+ - ext/notcurses/src/ruby_ncplane_vprintf_stained.c
120
+ - ext/notcurses/src/ruby_ncplane_vprintf_yx.c
121
+ - ext/notcurses/swig/modified_ruby_std_wstring.i
122
+ - ext/notcurses/swig/notcurses.i
38
123
  - ext/notcurses/test
39
124
  - lib/notcurses.rb
125
+ - lib/notcurses/swig_mixins/struct_initializer.rb
126
+ - lib/notcurses/swig_mixins/to_h.rb
40
127
  - lib/notcurses/version.rb
41
128
  - lib/tasks/compile_notcurses_so.rake
42
129
  - notcurses.gemspec
@@ -1,269 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- # V=0 quiet, V=1 verbose. other values don't work.
5
- V = 0
6
- V0 = $(V:0=)
7
- Q1 = $(V:1=)
8
- Q = $(Q1:0=@)
9
- ECHO1 = $(V:1=@ :)
10
- ECHO = $(ECHO1:0=@ echo)
11
- NULLCMD = :
12
-
13
- #### Start of system configuration section. ####
14
-
15
- srcdir = .
16
- topdir = /usr/local/rvm/rubies/ruby-3.2.0/include/ruby-3.2.0
17
- hdrdir = $(topdir)
18
- arch_hdrdir = /usr/local/rvm/rubies/ruby-3.2.0/include/ruby-3.2.0/x86_64-linux
19
- PATH_SEPARATOR = :
20
- VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
21
- prefix = $(DESTDIR)/usr/local/rvm/rubies/ruby-3.2.0
22
- rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
- rubyarchprefix = $(rubylibprefix)/$(arch)
24
- rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
25
- exec_prefix = $(prefix)
26
- vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
27
- sitearchhdrdir = $(sitehdrdir)/$(sitearch)
28
- rubyarchhdrdir = $(rubyhdrdir)/$(arch)
29
- vendorhdrdir = $(rubyhdrdir)/vendor_ruby
30
- sitehdrdir = $(rubyhdrdir)/site_ruby
31
- rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
32
- vendorarchdir = $(vendorlibdir)/$(sitearch)
33
- vendorlibdir = $(vendordir)/$(ruby_version)
34
- vendordir = $(rubylibprefix)/vendor_ruby
35
- sitearchdir = $(sitelibdir)/$(sitearch)
36
- sitelibdir = $(sitedir)/$(ruby_version)
37
- sitedir = $(rubylibprefix)/site_ruby
38
- rubyarchdir = $(rubylibdir)/$(arch)
39
- rubylibdir = $(rubylibprefix)/$(ruby_version)
40
- sitearchincludedir = $(includedir)/$(sitearch)
41
- archincludedir = $(includedir)/$(arch)
42
- sitearchlibdir = $(libdir)/$(sitearch)
43
- archlibdir = $(libdir)/$(arch)
44
- ridir = $(datarootdir)/$(RI_BASE_NAME)
45
- mandir = $(datarootdir)/man
46
- localedir = $(datarootdir)/locale
47
- libdir = $(exec_prefix)/lib
48
- psdir = $(docdir)
49
- pdfdir = $(docdir)
50
- dvidir = $(docdir)
51
- htmldir = $(docdir)
52
- infodir = $(datarootdir)/info
53
- docdir = $(datarootdir)/doc/$(PACKAGE)
54
- oldincludedir = $(DESTDIR)/usr/include
55
- includedir = $(prefix)/include
56
- runstatedir = $(localstatedir)/run
57
- localstatedir = $(prefix)/var
58
- sharedstatedir = $(prefix)/com
59
- sysconfdir = $(DESTDIR)/etc
60
- datadir = $(datarootdir)
61
- datarootdir = $(prefix)/share
62
- libexecdir = $(exec_prefix)/libexec
63
- sbindir = $(exec_prefix)/sbin
64
- bindir = $(exec_prefix)/bin
65
- archdir = $(rubyarchdir)
66
-
67
-
68
- CC_WRAPPER =
69
- CC = gcc
70
- CXX = g++
71
- LIBRUBY = $(LIBRUBY_SO)
72
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
73
- LIBRUBYARG_SHARED = -Wl,-rpath,'$${ORIGIN}/../lib' -Wl,-rpath,'$${ORIGIN}/../lib' -l$(RUBY_SO_NAME)
74
- LIBRUBYARG_STATIC = -Wl,-rpath,'$${ORIGIN}/../lib' -Wl,-rpath,'$${ORIGIN}/../lib' -l$(RUBY_SO_NAME)-static $(MAINLIBS)
75
- empty =
76
- OUTFLAG = -o $(empty)
77
- COUTFLAG = -o $(empty)
78
- CSRCFLAG = $(empty)
79
-
80
- RUBY_EXTCONF_H =
81
- cflags = $(optflags) $(debugflags) $(warnflags)
82
- cxxflags =
83
- optflags = -O3 -fno-fast-math
84
- debugflags = -ggdb3
85
- warnflags = -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef
86
- cppflags =
87
- CCDLFLAGS = -fPIC
88
- CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC -I/usr/include/notcurses $(ARCH_FLAG)
89
- INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
90
- DEFS =
91
- CPPFLAGS = $(DEFS) $(cppflags)
92
- CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG)
93
- ldflags = -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed
94
- dldflags = -Wl,--compress-debug-sections=zlib
95
- ARCH_FLAG =
96
- DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
97
- LDSHARED = $(CC) -shared
98
- LDSHAREDXX = $(CXX) -shared
99
- AR = gcc-ar
100
- EXEEXT =
101
-
102
- RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
103
- RUBY_SO_NAME = ruby
104
- RUBYW_INSTALL_NAME =
105
- RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
106
- RUBYW_BASE_NAME = rubyw
107
- RUBY_BASE_NAME = ruby
108
-
109
- arch = x86_64-linux
110
- sitearch = $(arch)
111
- ruby_version = 3.2.0
112
- ruby = $(bindir)/$(RUBY_BASE_NAME)
113
- RUBY = $(ruby)
114
- BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
115
- ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
116
-
117
- RM = rm -f
118
- RM_RF = rm -fr
119
- RMDIRS = rmdir --ignore-fail-on-non-empty -p
120
- MAKEDIRS = /usr/bin/mkdir -p
121
- INSTALL = /usr/bin/install
122
- INSTALL_PROG = $(INSTALL) -m 0755
123
- INSTALL_DATA = $(INSTALL) -m 644
124
- COPY = cp
125
- TOUCH = exit >
126
-
127
- #### End of system configuration section. ####
128
-
129
- preload =
130
- libpath = . $(libdir)
131
- LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
132
- DEFFILE =
133
-
134
- CLEANFILES = mkmf.log
135
- DISTCLEANFILES =
136
- DISTCLEANDIRS =
137
-
138
- extout =
139
- extout_prefix =
140
- target_prefix =
141
- LOCAL_LIBS =
142
- LIBS = $(LIBRUBYARG_SHARED) -lnotcurses-core -lnotcurses -lm -lpthread -lc
143
- ORIG_SRCS = ncplane_vprintf_aligned.c ncplane_vprintf_stained.c ncplane_vprintf_yx.c notcurses_wrap.c
144
- SRCS = $(ORIG_SRCS) ncplane_vprintf_aligned.c ncplane_vprintf_stained.c ncplane_vprintf_yx.c notcurses_wrap.c
145
- OBJS = ncplane_vprintf_aligned.o ncplane_vprintf_stained.o ncplane_vprintf_yx.o notcurses_wrap.o
146
- HDRS = $(srcdir)/notcurses_wrapper.h
147
- LOCAL_HDRS =
148
- TARGET = notcurses
149
- TARGET_NAME = notcurses
150
- TARGET_ENTRY = Init_$(TARGET_NAME)
151
- DLLIB = $(TARGET).so
152
- EXTSTATIC =
153
- STATIC_LIB =
154
-
155
- TIMESTAMP_DIR = .
156
- BINDIR = $(bindir)
157
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
158
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
159
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
160
- HDRDIR = $(sitehdrdir)$(target_prefix)
161
- ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
162
- TARGET_SO_DIR =
163
- TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
164
- CLEANLIBS = $(TARGET_SO) false
165
- CLEANOBJS = $(OBJS) *.bak
166
- TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.time
167
-
168
- all: $(DLLIB)
169
- static: $(STATIC_LIB)
170
- .PHONY: all install static install-so install-rb
171
- .PHONY: clean clean-so clean-static clean-rb
172
-
173
- clean-static::
174
- clean-rb-default::
175
- clean-rb::
176
- clean-so::
177
- clean: clean-so clean-static clean-rb-default clean-rb
178
- -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
179
-
180
- distclean-rb-default::
181
- distclean-rb::
182
- distclean-so::
183
- distclean-static::
184
- distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
185
- -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
186
- -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
187
- -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
188
-
189
- realclean: distclean
190
- install: install-so install-rb
191
-
192
- install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
193
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
194
- clean-static::
195
- -$(Q)$(RM) $(STATIC_LIB)
196
- install-rb: pre-install-rb do-install-rb install-rb-default
197
- install-rb-default: pre-install-rb-default do-install-rb-default
198
- pre-install-rb: Makefile
199
- pre-install-rb-default: Makefile
200
- do-install-rb:
201
- do-install-rb-default:
202
- pre-install-rb-default:
203
- @$(NULLCMD)
204
- $(TARGET_SO_DIR_TIMESTAMP):
205
- $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
206
- $(Q) $(TOUCH) $@
207
-
208
- site-install: site-install-so site-install-rb
209
- site-install-so: install-so
210
- site-install-rb: install-rb
211
-
212
- .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
213
-
214
- .cc.o:
215
- $(ECHO) compiling $(<)
216
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
217
-
218
- .cc.S:
219
- $(ECHO) translating $(<)
220
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
221
-
222
- .mm.o:
223
- $(ECHO) compiling $(<)
224
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
225
-
226
- .mm.S:
227
- $(ECHO) translating $(<)
228
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
229
-
230
- .cxx.o:
231
- $(ECHO) compiling $(<)
232
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
233
-
234
- .cxx.S:
235
- $(ECHO) translating $(<)
236
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
237
-
238
- .cpp.o:
239
- $(ECHO) compiling $(<)
240
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
241
-
242
- .cpp.S:
243
- $(ECHO) translating $(<)
244
- $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
245
-
246
- .c.o:
247
- $(ECHO) compiling $(<)
248
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
249
-
250
- .c.S:
251
- $(ECHO) translating $(<)
252
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
253
-
254
- .m.o:
255
- $(ECHO) compiling $(<)
256
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
257
-
258
- .m.S:
259
- $(ECHO) translating $(<)
260
- $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
261
-
262
- $(TARGET_SO): $(OBJS) Makefile
263
- $(ECHO) linking shared-object $(DLLIB)
264
- -$(Q)$(RM) $(@)
265
- $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
266
-
267
-
268
-
269
- $(OBJS): $(HDRS) $(ruby_headers)
@@ -1,282 +0,0 @@
1
- %module notcurses
2
- %include <ruby/rubywstrings.swg>
3
- %ignore ALLOC;
4
- %ignore API;
5
- %ignore __attribute__;
6
- %ignore __attribute;
7
- %ignore __declspec;
8
- %ignore __nonnull;
9
- %define __attribute__(x)
10
- %enddef
11
- %define __attribute(x)
12
- %enddef
13
- %define __declspec(x)
14
- %enddef
15
- %define __nonnull(x)
16
- %enddef
17
- %include <./modified_ruby_std_wstring.i>
18
-
19
- %include <carrays.i>
20
- %include <cdata.i>
21
- %include <cmalloc.i>
22
- %include <constraints.i>
23
- %include <cpointer.i>
24
- %include <cstring.i>
25
- %include <inttypes.i>
26
- %include <math.i>
27
- %include <stdint.i>
28
- %include <wchar.i>
29
-
30
- %include <typemaps/attribute.swg>
31
- %include <typemaps/carrays.swg>
32
- %include <typemaps/cdata.swg>
33
- %include <typemaps/cmalloc.swg>
34
- %include <typemaps/cpointer.swg>
35
- %include <typemaps/cstrings.swg>
36
- %include <typemaps/cstring.swg>
37
- %include <typemaps/cwstring.swg>
38
- %include <typemaps/enumint.swg>
39
- %include <typemaps/exception.swg>
40
- %include <typemaps/factory.swg>
41
- %include <typemaps/fragments.swg>
42
- %include <typemaps/implicit.swg>
43
- %include <typemaps/inoutlist.swg>
44
- %include <typemaps/misctypes.swg>
45
- %include <typemaps/primtypes.swg>
46
- %include <typemaps/ptrtypes.swg>
47
- %include <typemaps/strings.swg>
48
- %include <typemaps/string.swg>
49
- %include <typemaps/swigmacros.swg>
50
- %include <typemaps/swigobject.swg>
51
- %include <typemaps/swigtypemaps.swg>
52
- %include <typemaps/swigtype.swg>
53
- %include <typemaps/typemaps.swg>
54
- %include <typemaps/valtypes.swg>
55
- %include <typemaps/void.swg>
56
- %include <typemaps/wstring.swg>
57
-
58
- %include <ruby/argcargv.i>
59
- %include <ruby/rubyautodoc.swg>
60
- %include <ruby/file.i>
61
- %include <ruby/progargcargv.i>
62
- %include <ruby/rubycomplex.swg>
63
- %include <ruby/rubykw.swg>
64
- %include <ruby/rubymacros.swg>
65
- %include <ruby/rubyprimtypes.swg>
66
- %include <ruby/rubystrings.swg>
67
- %include <ruby/timeval.i>
68
- %include <ruby/typemaps.i>
69
-
70
- // IO
71
- %{
72
- #include <fcntl.h>
73
- #include <unistd.h>
74
-
75
- // Helper function to determine file mode
76
- static const char* get_file_mode(int fd) {
77
- int flags = fcntl(fd, F_GETFL);
78
- if (flags == -1) return "r"; // Default to read mode on error
79
-
80
- int access_mode = flags & O_ACCMODE;
81
- int append_flag = flags & O_APPEND;
82
-
83
- if (access_mode == O_RDONLY) return "r";
84
- if (access_mode == O_WRONLY) return append_flag ? "a" : "w";
85
- if (access_mode == O_RDWR) return append_flag ? "a+" : "r+";
86
-
87
- return "r";
88
- }
89
- %}
90
-
91
- %typemap(in) FILE* {
92
- if ($input == Qnil) {
93
- $1 = NULL;
94
- } else if (rb_respond_to($input, rb_intern("fileno"))) {
95
- int fd = NUM2INT(rb_funcall($input, rb_intern("fileno"), 0));
96
- const char* mode = get_file_mode(fd);
97
- $1 = fdopen(dup(fd), mode);
98
- if (!$1) {
99
- rb_raise(rb_eIOError, "Unable to get FILE* from Ruby IO object");
100
- }
101
- } else {
102
- SWIG_exception(SWIG_TypeError, "Expected IO object or nil");
103
- }
104
- }
105
-
106
- %typemap(out) FILE* {
107
- if ($1 == NULL) {
108
- $result = Qnil;
109
- } else {
110
- int fd = fileno($1);
111
- if (fd == -1) {
112
- rb_raise(rb_eIOError, "Invalid file descriptor");
113
- }
114
- VALUE io_class = rb_const_get(rb_cObject, rb_intern("IO"));
115
- $result = rb_funcall(io_class, rb_intern("for_fd"), 1, INT2NUM(fd));
116
- rb_funcall($result, rb_intern("binmode"), 0);
117
- }
118
- }
119
-
120
-
121
- %typemap(argout) FILE** {
122
- if (*$1 != NULL) {
123
- int fd = fileno(*$1);
124
- if (fd == -1) {
125
- rb_raise(rb_eIOError, "Invalid file descriptor");
126
- }
127
- VALUE io_class = rb_const_get(rb_cObject, rb_intern("IO"));
128
- VALUE io_obj = rb_funcall(io_class, rb_intern("for_fd"), 1, INT2NUM(fd));
129
-
130
- // Set the mode of the IO object
131
- const char* mode = "r"; // Default to read mode
132
- if ((*$1)->_flags & _IO_NO_READS) {
133
- if ((*$1)->_flags & _IO_APPEND) {
134
- mode = "a";
135
- } else {
136
- mode = "w";
137
- }
138
- }
139
- if (!((*$1)->_flags & _IO_NO_WRITES)) {
140
- mode = (strcmp(mode, "r") == 0) ? "r+" : "w+";
141
- }
142
-
143
- // Set the mode
144
- rb_funcall(io_obj, rb_intern("set_encoding"), 1, rb_str_new2(mode));
145
-
146
- // Preserve the original encoding if possible
147
- VALUE enc = rb_funcall(io_obj, rb_intern("internal_encoding"), 0);
148
- if (enc == Qnil) {
149
- enc = rb_funcall(io_obj, rb_intern("external_encoding"), 0);
150
- }
151
- if (enc != Qnil) {
152
- rb_funcall(io_obj, rb_intern("set_encoding"), 1, enc);
153
- } else {
154
- // Fallback to binary mode if no encoding is detected
155
- rb_funcall(io_obj, rb_intern("binmode"), 0);
156
- }
157
-
158
- rb_io_taint_check(io_obj);
159
-
160
- $result = io_obj;
161
- } else {
162
- $result = Qnil;
163
- }
164
- }
165
-
166
- %typemap(in) FILE** (FILE* tempfile = NULL) {
167
- if ($input == Qnil) {
168
- $1 = &tempfile;
169
- } else if (rb_obj_is_kind_of($input, rb_cIO)) {
170
- VALUE fileno = rb_funcall($input, rb_intern("fileno"), 0);
171
- int fd = NUM2INT(fileno);
172
- const char* mode = StringValueCStr(rb_funcall($input, rb_intern("mode"), 0));
173
- tempfile = fdopen(dup(fd), mode);
174
- if (!tempfile) {
175
- rb_raise(rb_eIOError, "Could not create FILE* from Ruby IO object");
176
- }
177
- $1 = &tempfile;
178
- } else {
179
- SWIG_exception(SWIG_TypeError, "Expected IO object or nil");
180
- }
181
- }
182
-
183
- %typemap(freearg) FILE** {
184
- if (tempfile$argnum != NULL) {
185
- fclose(tempfile$argnum);
186
- }
187
- }
188
-
189
- // Integer Pointers
190
- %typemap(in) int* (int temp) {
191
- temp = NUM2INT($input);
192
- $1 = &temp;
193
- }
194
-
195
- %typemap(in) unsigned int* (unsigned int temp) {
196
- temp = NUM2UINT($input);
197
- $1 = &temp;
198
- }
199
-
200
- %typemap(in) long* (long temp) {
201
- temp = NUM2LONG($input);
202
- $1 = &temp;
203
- }
204
-
205
- %typemap(in) unsigned long* (unsigned long temp) {
206
- temp = NUM2ULONG($input);
207
- $1 = &temp;
208
- }
209
-
210
- %typemap(in) short* (short temp) {
211
- temp = NUM2SHORT($input);
212
- $1 = &temp;
213
- }
214
-
215
- %typemap(in) unsigned short* (unsigned short temp) {
216
- temp = NUM2USHORT($input);
217
- $1 = &temp;
218
- }
219
-
220
- //%typemap(in) char* (char temp) {
221
- // temp = NUM2CHR($input);
222
- // $1 = &temp;
223
- //}
224
-
225
- %typemap(in) unsigned char* (unsigned char temp) {
226
- temp = NUM2CHR($input);
227
- $1 = &temp;
228
- }
229
-
230
- %typemap(in) int64_t* (int64_t temp) {
231
- temp = NUM2LL($input);
232
- $1 = &temp;
233
- }
234
-
235
- %typemap(in) uint64_t* (uint64_t temp) {
236
- temp = NUM2ULL($input);
237
- $1 = &temp;
238
- }
239
-
240
- %typemap(argout) int*, unsigned int*, long*, unsigned long*, short*, unsigned short*, char*, unsigned char*, int64_t*, uint64_t* {
241
- if ($1 != NULL) {
242
- $result = INT2NUM(*$1);
243
- }
244
- }
245
-
246
- %{
247
- #include "version.h"
248
- #include "nckeys.h"
249
- #include "ncseqs.h"
250
- #include "direct.h"
251
- #include "notcurses.h"
252
-
253
- int ruby_ncplane_vprintf_yx(struct ncplane* n, int y, int x, const char* format, VALUE rb_args);
254
- int ruby_ncplane_vprintf_aligned(struct ncplane* n, int y, ncalign_e align, const char* format, VALUE rb_args);
255
- int ruby_ncplane_vprintf_stained(struct ncplane* n, const char* format, VALUE rb_args);
256
-
257
- int ruby_ncplane_vprintf(struct ncplane* n, const char* format, VALUE rb_args) {
258
- return ruby_ncplane_vprintf_yx(n, -1, -1, format, rb_args);
259
- }
260
- %}
261
-
262
- // Ignore problematic functions
263
- %ignore ncplane_vprintf_yx;
264
- %ignore ncplane_vprintf;
265
- %ignore ncplane_vprintf_aligned;
266
- %ignore ncplane_vprintf_stained;
267
-
268
- %include "version.h"
269
- %include "nckeys.h"
270
- %include "ncseqs.h"
271
- %include "direct.h"
272
- %include "notcurses.h"
273
-
274
- %rename("ncplane_vprintf_yx") ruby_ncplane_vprintf_yx;
275
- %rename("ncplane_vprintf_aligned") ruby_ncplane_vprintf_aligned;
276
- %rename("ncplane_vprintf_stained") ruby_ncplane_vprintf_stained;
277
- %rename("ncplane_vprintf") ruby_ncplane_vprintf;
278
-
279
- int ruby_ncplane_vprintf_yx(struct ncplane* n, int y, int x, const char* format, VALUE rb_args);
280
- int ruby_ncplane_vprintf_aligned(struct ncplane* n, int y, ncalign_e align, const char* format, VALUE rb_args);
281
- int ruby_ncplane_vprintf_stained(struct ncplane* n, const char* format, VALUE rb_args);
282
- int ruby_ncplane_vprintf(struct ncplane* n, const char* format, VALUE rb_args);
@@ -1,20 +0,0 @@
1
- #ifndef NOTCURSES_WRAPPER_H
2
- #define NOTCURSES_WRAPPER_H
3
-
4
- #define ALLOC
5
- #define API
6
- #define __attribute__(x)
7
- #define __attribute(x)
8
- #define __declspec(x)
9
- #define __nonnull(x)
10
-
11
- #include <notcurses/notcurses.h>
12
-
13
- #undef ALLOC
14
- #undef API
15
- #undef __attribute__
16
- #undef __attribute
17
- #undef __declspec
18
- #undef __nonnull
19
-
20
- #endif // NOTCURSES_WRAPPER_H