curses 1.4.4 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/macos.yml +1 -1
  4. data/.github/workflows/push_gem.yml +48 -0
  5. data/.github/workflows/ubuntu.yml +2 -2
  6. data/.github/workflows/windows.yml +2 -2
  7. data/History.md +23 -0
  8. data/README.md +7 -0
  9. data/curses.gemspec +1 -1
  10. data/ext/curses/curses.c +7 -7
  11. data/sample/colors.rb +6 -1
  12. data/sample/form.rb +1 -1
  13. data/sample/menu.rb +2 -0
  14. metadata +9 -251
  15. data/vendor/PDCurses/.gitignore +0 -47
  16. data/vendor/PDCurses/.travis.yml +0 -49
  17. data/vendor/PDCurses/CMakeLists.txt +0 -68
  18. data/vendor/PDCurses/HISTORY.md +0 -2036
  19. data/vendor/PDCurses/IMPLEMNT.md +0 -327
  20. data/vendor/PDCurses/Makefile +0 -27
  21. data/vendor/PDCurses/README.md +0 -77
  22. data/vendor/PDCurses/acs_defs.h +0 -265
  23. data/vendor/PDCurses/appveyor.yml +0 -218
  24. data/vendor/PDCurses/cmake/README.md +0 -71
  25. data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
  26. data/vendor/PDCurses/cmake/build_options.cmake +0 -25
  27. data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
  28. data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
  29. data/vendor/PDCurses/cmake/get_version.cmake +0 -17
  30. data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
  31. data/vendor/PDCurses/cmake/project_common.cmake +0 -121
  32. data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
  33. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
  34. data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
  35. data/vendor/PDCurses/cmake/version.in.cmake +0 -73
  36. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
  37. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
  38. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
  39. data/vendor/PDCurses/curses.h +0 -1846
  40. data/vendor/PDCurses/curspriv.h +0 -134
  41. data/vendor/PDCurses/demos/README.md +0 -25
  42. data/vendor/PDCurses/demos/firework.c +0 -144
  43. data/vendor/PDCurses/demos/newtest.c +0 -581
  44. data/vendor/PDCurses/demos/ozdemo.c +0 -447
  45. data/vendor/PDCurses/demos/ptest.c +0 -283
  46. data/vendor/PDCurses/demos/rain.c +0 -157
  47. data/vendor/PDCurses/demos/testcurs.c +0 -1607
  48. data/vendor/PDCurses/demos/tui.c +0 -1048
  49. data/vendor/PDCurses/demos/tui.h +0 -65
  50. data/vendor/PDCurses/demos/tuidemo.c +0 -233
  51. data/vendor/PDCurses/demos/version.c +0 -61
  52. data/vendor/PDCurses/demos/worm.c +0 -432
  53. data/vendor/PDCurses/demos/xmas.c +0 -955
  54. data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
  55. data/vendor/PDCurses/dos/Makefile +0 -105
  56. data/vendor/PDCurses/dos/Makefile.bcc +0 -83
  57. data/vendor/PDCurses/dos/Makefile.dmc +0 -257
  58. data/vendor/PDCurses/dos/Makefile.msc +0 -113
  59. data/vendor/PDCurses/dos/Makefile.wcc +0 -107
  60. data/vendor/PDCurses/dos/README.md +0 -51
  61. data/vendor/PDCurses/dos/bccdos.lrf +0 -9
  62. data/vendor/PDCurses/dos/mscdos.lrf +0 -50
  63. data/vendor/PDCurses/dos/pdcclip.c +0 -132
  64. data/vendor/PDCurses/dos/pdcdisp.c +0 -135
  65. data/vendor/PDCurses/dos/pdcdos.h +0 -194
  66. data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
  67. data/vendor/PDCurses/dos/pdckbd.c +0 -513
  68. data/vendor/PDCurses/dos/pdcscrn.c +0 -785
  69. data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
  70. data/vendor/PDCurses/dos/pdcutil.c +0 -212
  71. data/vendor/PDCurses/libobjs.mif +0 -26
  72. data/vendor/PDCurses/makedist.mif +0 -20
  73. data/vendor/PDCurses/man/Makefile +0 -37
  74. data/vendor/PDCurses/man/README.md +0 -21
  75. data/vendor/PDCurses/man/intro.md +0 -361
  76. data/vendor/PDCurses/man/manext.c +0 -119
  77. data/vendor/PDCurses/man/sdl.md +0 -152
  78. data/vendor/PDCurses/man/sdl2.md +0 -58
  79. data/vendor/PDCurses/man/x11.md +0 -407
  80. data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
  81. data/vendor/PDCurses/ncurses/README.md +0 -26
  82. data/vendor/PDCurses/ncurses/makefile +0 -29
  83. data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
  84. data/vendor/PDCurses/os2/Makefile +0 -132
  85. data/vendor/PDCurses/os2/Makefile.bcc +0 -90
  86. data/vendor/PDCurses/os2/Makefile.wcc +0 -43
  87. data/vendor/PDCurses/os2/README.md +0 -43
  88. data/vendor/PDCurses/os2/iccos2.lrf +0 -50
  89. data/vendor/PDCurses/os2/iccos2.mak +0 -256
  90. data/vendor/PDCurses/os2/pdcclip.c +0 -188
  91. data/vendor/PDCurses/os2/pdcdisp.c +0 -93
  92. data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
  93. data/vendor/PDCurses/os2/pdckbd.c +0 -521
  94. data/vendor/PDCurses/os2/pdcos2.h +0 -55
  95. data/vendor/PDCurses/os2/pdcscrn.c +0 -449
  96. data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
  97. data/vendor/PDCurses/os2/pdcutil.c +0 -52
  98. data/vendor/PDCurses/panel.h +0 -56
  99. data/vendor/PDCurses/pdcurses/README.md +0 -25
  100. data/vendor/PDCurses/pdcurses/addch.c +0 -693
  101. data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
  102. data/vendor/PDCurses/pdcurses/addstr.c +0 -240
  103. data/vendor/PDCurses/pdcurses/attr.c +0 -359
  104. data/vendor/PDCurses/pdcurses/beep.c +0 -68
  105. data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
  106. data/vendor/PDCurses/pdcurses/border.c +0 -411
  107. data/vendor/PDCurses/pdcurses/clear.c +0 -159
  108. data/vendor/PDCurses/pdcurses/color.c +0 -298
  109. data/vendor/PDCurses/pdcurses/debug.c +0 -109
  110. data/vendor/PDCurses/pdcurses/delch.c +0 -96
  111. data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
  112. data/vendor/PDCurses/pdcurses/deprec.c +0 -27
  113. data/vendor/PDCurses/pdcurses/getch.c +0 -417
  114. data/vendor/PDCurses/pdcurses/getstr.c +0 -474
  115. data/vendor/PDCurses/pdcurses/getyx.c +0 -139
  116. data/vendor/PDCurses/pdcurses/inch.c +0 -127
  117. data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
  118. data/vendor/PDCurses/pdcurses/initscr.c +0 -367
  119. data/vendor/PDCurses/pdcurses/inopts.c +0 -324
  120. data/vendor/PDCurses/pdcurses/insch.c +0 -271
  121. data/vendor/PDCurses/pdcurses/insstr.c +0 -264
  122. data/vendor/PDCurses/pdcurses/instr.c +0 -246
  123. data/vendor/PDCurses/pdcurses/kernel.c +0 -259
  124. data/vendor/PDCurses/pdcurses/keyname.c +0 -157
  125. data/vendor/PDCurses/pdcurses/mouse.c +0 -438
  126. data/vendor/PDCurses/pdcurses/move.c +0 -57
  127. data/vendor/PDCurses/pdcurses/outopts.c +0 -159
  128. data/vendor/PDCurses/pdcurses/overlay.c +0 -214
  129. data/vendor/PDCurses/pdcurses/pad.c +0 -260
  130. data/vendor/PDCurses/pdcurses/panel.c +0 -633
  131. data/vendor/PDCurses/pdcurses/printw.c +0 -126
  132. data/vendor/PDCurses/pdcurses/refresh.c +0 -279
  133. data/vendor/PDCurses/pdcurses/scanw.c +0 -578
  134. data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
  135. data/vendor/PDCurses/pdcurses/scroll.c +0 -101
  136. data/vendor/PDCurses/pdcurses/slk.c +0 -591
  137. data/vendor/PDCurses/pdcurses/termattr.c +0 -182
  138. data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
  139. data/vendor/PDCurses/pdcurses/touch.c +0 -163
  140. data/vendor/PDCurses/pdcurses/util.c +0 -312
  141. data/vendor/PDCurses/pdcurses/window.c +0 -569
  142. data/vendor/PDCurses/sdl1/Makefile +0 -129
  143. data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
  144. data/vendor/PDCurses/sdl1/README.md +0 -31
  145. data/vendor/PDCurses/sdl1/deffont.h +0 -385
  146. data/vendor/PDCurses/sdl1/deficon.h +0 -23
  147. data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
  148. data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
  149. data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
  150. data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
  151. data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
  152. data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
  153. data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
  154. data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
  155. data/vendor/PDCurses/sdl1/sdltest.c +0 -79
  156. data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
  157. data/vendor/PDCurses/sdl2/Makefile +0 -135
  158. data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
  159. data/vendor/PDCurses/sdl2/README.md +0 -34
  160. data/vendor/PDCurses/sdl2/deffont.h +0 -385
  161. data/vendor/PDCurses/sdl2/deficon.h +0 -23
  162. data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
  163. data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
  164. data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
  165. data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
  166. data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
  167. data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
  168. data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
  169. data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
  170. data/vendor/PDCurses/sdl2/sdltest.c +0 -81
  171. data/vendor/PDCurses/term.h +0 -48
  172. data/vendor/PDCurses/version.mif +0 -7
  173. data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
  174. data/vendor/PDCurses/vt/Makefile +0 -135
  175. data/vendor/PDCurses/vt/Makefile.bcc +0 -111
  176. data/vendor/PDCurses/vt/Makefile.dmc +0 -258
  177. data/vendor/PDCurses/vt/Makefile.vc +0 -144
  178. data/vendor/PDCurses/vt/Makefile.wcc +0 -107
  179. data/vendor/PDCurses/vt/README.md +0 -64
  180. data/vendor/PDCurses/vt/pdcclip.c +0 -20
  181. data/vendor/PDCurses/vt/pdcdisp.c +0 -284
  182. data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
  183. data/vendor/PDCurses/vt/pdckbd.c +0 -394
  184. data/vendor/PDCurses/vt/pdcscrn.c +0 -434
  185. data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
  186. data/vendor/PDCurses/vt/pdcutil.c +0 -43
  187. data/vendor/PDCurses/vt/pdcvt.h +0 -16
  188. data/vendor/PDCurses/watcom.mif +0 -68
  189. data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
  190. data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
  191. data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
  192. data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
  193. data/vendor/PDCurses/wincon/Makefile.mng +0 -176
  194. data/vendor/PDCurses/wincon/Makefile.vc +0 -144
  195. data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
  196. data/vendor/PDCurses/wincon/README.md +0 -85
  197. data/vendor/PDCurses/wincon/pdcclip.c +0 -174
  198. data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
  199. data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
  200. data/vendor/PDCurses/wincon/pdckbd.c +0 -786
  201. data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
  202. data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
  203. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  204. data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
  205. data/vendor/PDCurses/wincon/pdcutil.c +0 -41
  206. data/vendor/PDCurses/wincon/pdcwin.h +0 -31
  207. data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
  208. data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
  209. data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
  210. data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
  211. data/vendor/PDCurses/wingui/Makefile.mng +0 -171
  212. data/vendor/PDCurses/wingui/Makefile.vc +0 -144
  213. data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
  214. data/vendor/PDCurses/wingui/README.md +0 -93
  215. data/vendor/PDCurses/wingui/pdcclip.c +0 -174
  216. data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
  217. data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
  218. data/vendor/PDCurses/wingui/pdckbd.c +0 -143
  219. data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
  220. data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
  221. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  222. data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
  223. data/vendor/PDCurses/wingui/pdcutil.c +0 -61
  224. data/vendor/PDCurses/wingui/pdcwin.h +0 -122
  225. data/vendor/PDCurses/x11/Makefile.in +0 -754
  226. data/vendor/PDCurses/x11/PDCurses.spec +0 -82
  227. data/vendor/PDCurses/x11/README.md +0 -62
  228. data/vendor/PDCurses/x11/ScrollBox.c +0 -319
  229. data/vendor/PDCurses/x11/ScrollBox.h +0 -51
  230. data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
  231. data/vendor/PDCurses/x11/aclocal.m4 +0 -994
  232. data/vendor/PDCurses/x11/big_icon.xbm +0 -46
  233. data/vendor/PDCurses/x11/compose.h +0 -201
  234. data/vendor/PDCurses/x11/config.guess +0 -1500
  235. data/vendor/PDCurses/x11/config.h.in +0 -100
  236. data/vendor/PDCurses/x11/config.sub +0 -1616
  237. data/vendor/PDCurses/x11/configure +0 -6700
  238. data/vendor/PDCurses/x11/configure.ac +0 -295
  239. data/vendor/PDCurses/x11/debian/changelog +0 -6
  240. data/vendor/PDCurses/x11/debian/compat +0 -1
  241. data/vendor/PDCurses/x11/debian/control +0 -11
  242. data/vendor/PDCurses/x11/debian/copyright +0 -27
  243. data/vendor/PDCurses/x11/debian/rules +0 -98
  244. data/vendor/PDCurses/x11/install-sh +0 -253
  245. data/vendor/PDCurses/x11/little_icon.xbm +0 -14
  246. data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
  247. data/vendor/PDCurses/x11/pdcclip.c +0 -173
  248. data/vendor/PDCurses/x11/pdcdisp.c +0 -85
  249. data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
  250. data/vendor/PDCurses/x11/pdckbd.c +0 -104
  251. data/vendor/PDCurses/x11/pdcscrn.c +0 -258
  252. data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
  253. data/vendor/PDCurses/x11/pdcutil.c +0 -52
  254. data/vendor/PDCurses/x11/pdcx11.c +0 -316
  255. data/vendor/PDCurses/x11/pdcx11.h +0 -191
  256. data/vendor/PDCurses/x11/sb.c +0 -155
  257. data/vendor/PDCurses/x11/x11.c +0 -3686
  258. data/vendor/PDCurses/x11/xcurses-config.in +0 -81
@@ -1,107 +0,0 @@
1
- # Watcom WMAKE Makefile for PDCurses library - DOS (16 bit) or DOS/4GW Watcom C/C++ 10.6+
2
- #
3
- # Usage: wmake -f [path/]Makefile.wcc [DEBUG=Y] [MODEL=c|h|l|m|s|f]
4
- # [CROSS=Y|N] [CHTYPE=[-DCHTYPE_16|-DCHTYPE_32]] [target]
5
- #
6
- # where target can be any of:
7
- # [all|demos|pdcurses.lib|testcurs.exe...]
8
- #
9
- # and MODEL specifies the memory model (16-bit compact/huge/large/medium/
10
- # small, or 32-bit flat)
11
- #
12
- # and CROSS=Y (CROSS=N) means to assume we are (are not) cross-compiling
13
- # (default is to auto-detect)
14
- #
15
- # and CHTYPE is an optional compiler flag to set the size of chtype (default
16
- # is 64 bits)
17
-
18
- # Change the memory MODEL here, if desired
19
- !ifndef MODEL
20
- MODEL = l
21
- !endif
22
-
23
- !ifdef %PDCURSES_SRCDIR
24
- PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR)
25
- !else
26
- PDCURSES_SRCDIR = ..
27
- !endif
28
-
29
- !include $(PDCURSES_SRCDIR)/version.mif
30
-
31
- !ifndef CROSS
32
- !ifeq %SHELL /bin/bash
33
- # assume we are cross-compiling
34
- CROSS = Y
35
- !endif
36
- !ifeq %SHELL /bin/sh
37
- CROSS = Y
38
- !endif
39
- !ifeq %SHELL /bin/csh
40
- CROSS = Y
41
- !endif
42
- !ifeq %SHELL /bin/dash
43
- CROSS = Y
44
- !endif
45
- !endif
46
-
47
- osdir = $(PDCURSES_SRCDIR)/vt
48
- # Open Watcom README strongly recommends setting WATCOM environment variable...
49
- !ifeq CROSS Y
50
- !ifdef %WATCOM
51
- watcomdir = $(%WATCOM)
52
- !else
53
- watcomdir = "`which wcc | xargs realpath | xargs dirname`"/..
54
- !endif
55
- !endif
56
-
57
- !ifneq MODEL f
58
- CC = wcc
59
- TARGET = dos
60
- !else
61
- CC = wcc386
62
- TARGET = dos4g
63
- !endif
64
-
65
- CFLAGS = -bt=$(TARGET) -zq -wx -m$(MODEL) -i=$(PDCURSES_SRCDIR)
66
- CFLAGS += $(CHTYPE) -DDOS
67
- # the README also recommends setting INCLUDE; if absent, we need an extra -i=
68
- !ifndef %INCLUDE
69
- CFLAGS += -i=$(watcomdir)/h
70
- !endif
71
-
72
- !ifeq DEBUG Y
73
- CFLAGS += -d2 -DPDCDEBUG
74
- LDFLAGS = D W A op q sys $(TARGET)
75
- !else
76
- CFLAGS += -oneatx
77
- LDFLAGS = op q sys $(TARGET)
78
- !ifeq CROSS Y
79
- !ifneq MODEL f
80
- LDFLAGS += libp $(watcomdir)/lib286/dos\;$(watcomdir)/lib286
81
- !else
82
- LDFLAGS += libp $(watcomdir)/lib386/dos\;$(watcomdir)/lib386
83
- !endif
84
- !endif
85
- !endif
86
-
87
- LIBEXE = wlib -q -n -t
88
-
89
- !include $(PDCURSES_SRCDIR)/watcom.mif
90
-
91
- $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
92
- %write wccvt.lrf $(LIBOBJS) $(PDCOBJS)
93
- $(LIBEXE) $@ @wccvt.lrf
94
- -$(DEL) wccvt.lrf
95
- -$(COPY) $(LIBCURSES) panel.lib
96
-
97
- !ifneq MODEL f
98
- PLATFORM1 = Watcom C++ 16-bit DOS/VT
99
- PLATFORM2 = Open Watcom 1.6 for 16-bit DOS/VT
100
- ARCNAME = pdc$(VER)16w
101
- !else
102
- PLATFORM1 = Watcom C++ 32-bit DOS/VT
103
- PLATFORM2 = Open Watcom 1.6 for 32-bit DOS/VT
104
- ARCNAME = pdc$(VER)32w
105
- !endif
106
-
107
- !include $(PDCURSES_SRCDIR)/makedist.mif
@@ -1,64 +0,0 @@
1
- PDCurses for VT
2
- ================
3
-
4
- This directory contains source code to support PDCurses using a mix
5
- of VT-100, VT-200, and ANSI escape sequences to set colors, position
6
- the cursor, etc. Note that the name is misleading; it uses an olio of
7
- control sequences from
8
-
9
- https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html
10
-
11
- which may, or may not, work on your terminal (I've tested urxvt, xterm,
12
- and QTerminal).
13
-
14
- It assumes that 256 colors are available, but it can use full RGB on
15
- terminals that support it.
16
-
17
- This is a first pass; it mostly works, but some work remains to be done
18
- (see 'Caveats' below).
19
-
20
- Building
21
- --------
22
-
23
- In Linux, run `make` or `make WIDE=Y`. In *BSD, use `gmake` or `gmake WIDE=Y`.
24
-
25
- In theory, this could be tweaked to work in Windows 10, which now has
26
- some VT emulation. I do Windows as little as possible, so don't rely on
27
- me for that part.
28
-
29
- Caveats
30
- -------
31
-
32
- As currently set up, this is a bare-bones implementation. It relies on a
33
- terminal that supports at least 256 colors. RGB colors get remapped to the
34
- 6x6x6 color cube. If your terminal supports full RGB coloring (QTerminal
35
- and modern xterm, for example), you can set
36
-
37
- `PDC_VT=RGB`
38
-
39
- `export PDC_VT`
40
-
41
- This will eventually be expanded so one can explain to PDCurses the
42
- capabilities of the terminal, e.g.,
43
-
44
- `PDC_VT=RGB BOLD ITALIC BLINK`
45
-
46
- to say that the underlying terminal supports built-in bold, italic, and
47
- blinking text. (And/or the code may dig around in the terminfo database,
48
- as ncurses does. That would be the Right Way of doing it. Or at the
49
- very least, look at the TERM and COLORTERM environment variables.)
50
-
51
- Arrow keys and some function keys are recognized (see the `tbl` array
52
- in `pdckey.c`). Some mouse input is recognized. Shift, Ctrl, and Alt
53
- function keys and arrows are (mostly) not correctly identified; I've
54
- not figured out how those keys are supposed to be detected yet. Or if
55
- they can be.
56
-
57
- Test routines have been run on rxvt, xterm, and QTerminal only, on
58
- one Xubuntu box, plus some testing on TrueOS.
59
-
60
- Distribution Status
61
- -------------------
62
-
63
- The files in this directory are released to the Public Domain.
64
-
@@ -1,20 +0,0 @@
1
- int PDC_clearclipboard( void)
2
- {
3
- return( 0);
4
- }
5
-
6
- int PDC_freeclipboard( char *contents)
7
- {
8
- return( 0);
9
- }
10
-
11
- int PDC_getclipboard( char **contents, long *length)
12
- {
13
- return( 0);
14
- }
15
-
16
- int PDC_setclipboard( const char *contents, long length)
17
- {
18
- return( 0);
19
- }
20
-
@@ -1,284 +0,0 @@
1
- #define USE_UNICODE_ACS_CHARS 1
2
-
3
- #include <wchar.h>
4
- #include <assert.h>
5
-
6
- #define USE_UNICODE_ACS_CHARS 1
7
-
8
- #include "curses.h"
9
- #include "pdcvt.h"
10
- #include "acs_defs.h"
11
-
12
- void PDC_gotoyx(int y, int x)
13
- {
14
- printf( "\033[%d;%dH", y + 1, x + 1);
15
- }
16
-
17
- #define STANDOUT_ON "\033[3m"
18
- #define STANDOUT_OFF "\033[23m"
19
- #define UNDERLINE_ON "\033[4m"
20
- #define UNDERLINE_OFF "\033[24m"
21
- #define BLINK_ON "\033[5m"
22
- #define BLINK_OFF "\033[25m"
23
- #define BOLD_ON "\033[1m"
24
- #define BOLD_OFF "\033[22m"
25
- #define DIM_ON "\033[2m"
26
- #define DIM_OFF "\033[22m"
27
- #define STDOUT 0
28
-
29
- const chtype MAX_UNICODE = 0x110000;
30
-
31
- /* see 'addch.c' for an explanation of how combining chars are handled. */
32
-
33
- #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2 && defined( PDC_WIDE)
34
- #define USING_COMBINING_CHARACTER_SCHEME
35
- int PDC_expand_combined_characters( const cchar_t c, cchar_t *added); /* addch.c */
36
- #endif
37
-
38
-
39
- extern int PDC_really_blinking;
40
- extern chtype PDC_capabilities;
41
-
42
- /* This function 'intensifies' a color by shifting it toward white. */
43
- /* It used to average the input color with white. Then it did a */
44
- /* weighted average: 2/3 of the input color, 1/3 white, for a */
45
- /* lower "intensification" level. */
46
- /* Then Mark Hessling suggested that the output level should */
47
- /* remap zero to 85 (= 255 / 3, so one-third intensity), and input */
48
- /* of 192 or greater should be remapped to 255 (full intensity). */
49
- /* Assuming we want a linear response between zero and 192, that */
50
- /* leads to output = 85 + input * (255-85)/192. */
51
- /* This should lead to proper handling of bold text in legacy */
52
- /* apps, where "bold" means "high intensity". */
53
-
54
- static PACKED_RGB intensified_color( PACKED_RGB ival)
55
- {
56
- int rgb, i;
57
- PACKED_RGB oval = 0;
58
-
59
- for( i = 0; i < 3; i++, ival >>= 8)
60
- {
61
- rgb = (int)( ival & 0xff);
62
- if( rgb >= 192)
63
- rgb = 255;
64
- else
65
- rgb = 85 + rgb * (255 - 85) / 192;
66
- oval |= ((PACKED_RGB)rgb << (i * 8));
67
- }
68
- return( oval);
69
- }
70
-
71
- /* For use in adjusting colors for A_DIMmed characters. Just */
72
- /* knocks down the intensity of R, G, and B by 1/3. */
73
-
74
- static PACKED_RGB dimmed_color( PACKED_RGB ival)
75
- {
76
- unsigned i;
77
- PACKED_RGB oval = 0;
78
-
79
- for( i = 0; i < 3; i++, ival >>= 8)
80
- {
81
- unsigned rgb = (unsigned)( ival & 0xff);
82
-
83
- rgb -= (rgb / 3);
84
- oval |= ((PACKED_RGB)rgb << (i * 8));
85
- }
86
- return( oval);
87
- }
88
-
89
-
90
- /* PDC_get_rgb_values(), extract_packed_rgb(), intensified_component(), */
91
- /* intensified_color(), and dimmed_color() each exist in x11/x11.c, */
92
- /* win32a/pdcdisp.c, and sdl2/pdcdisp.c in forms slightly modified for */
93
- /* each platform. But they all look pretty much alike. */
94
-
95
- /* PDCurses stores RGBs in fifteen bits, five bits each */
96
- /* for red, green, blue. A PACKED_RGB uses eight bits per */
97
- /* channel. Hence the following. */
98
- #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2
99
- static PACKED_RGB extract_packed_rgb( const chtype color)
100
- {
101
- const int red = (int)( (color << 3) & 0xf8);
102
- const int green = (int)( (color >> 2) & 0xf8);
103
- const int blue = (int)( (color >> 7) & 0xf8);
104
-
105
- return( PACK_RGB( red, green, blue));
106
- }
107
- #endif
108
-
109
- void PDC_get_rgb_values( const chtype srcp,
110
- PACKED_RGB *foreground_rgb, PACKED_RGB *background_rgb)
111
- {
112
- const int color = (int)(( srcp & A_COLOR) >> PDC_COLOR_SHIFT);
113
- bool reverse_colors = ((srcp & A_REVERSE) ? TRUE : FALSE);
114
- bool intensify_backgnd = FALSE;
115
-
116
- #if defined( CHTYPE_LONG) && CHTYPE_LONG >= 2
117
- if( srcp & A_RGB_COLOR)
118
- {
119
- /* Extract RGB from 30 bits of the color field */
120
- *background_rgb = extract_packed_rgb( srcp >> PDC_COLOR_SHIFT);
121
- *foreground_rgb = extract_packed_rgb( srcp >> (PDC_COLOR_SHIFT + 15));
122
- }
123
- else
124
- #endif
125
- {
126
- extern PACKED_RGB *pdc_rgbs;
127
- short foreground_index, background_index;
128
-
129
- PDC_pair_content( (short)color, &foreground_index, &background_index);
130
- *foreground_rgb = pdc_rgbs[foreground_index];
131
- *background_rgb = pdc_rgbs[background_index];
132
- }
133
-
134
- if( srcp & A_BLINK)
135
- {
136
- extern int PDC_really_blinking; /* see 'pdcsetsc.c' */
137
-
138
- if( !PDC_really_blinking) /* convert 'blinking' to 'bold' */
139
- intensify_backgnd = TRUE;
140
- }
141
- if( reverse_colors)
142
- {
143
- const PACKED_RGB temp = *foreground_rgb;
144
-
145
- *foreground_rgb = *background_rgb;
146
- *background_rgb = temp;
147
- }
148
-
149
- if( srcp & A_BOLD)
150
- *foreground_rgb = intensified_color( *foreground_rgb);
151
- if( intensify_backgnd)
152
- *background_rgb = intensified_color( *background_rgb);
153
- if( srcp & A_DIM)
154
- *foreground_rgb = dimmed_color( *foreground_rgb);
155
- if( srcp & A_DIM)
156
- *background_rgb = dimmed_color( *background_rgb);
157
- }
158
-
159
- static char *color_string( char *otext, const PACKED_RGB rgb)
160
- {
161
- if( PDC_capabilities & A_RGB_COLOR)
162
- sprintf( otext, "2;%d;%d;%dm", Get_RValue( rgb),
163
- Get_GValue( rgb), Get_BValue( rgb));
164
- else
165
- {
166
- const int red = Get_RValue( rgb);
167
- const int green = Get_GValue( rgb);
168
- const int blue = Get_BValue( rgb);
169
- int idx;
170
-
171
- if( red == green && red == blue) /* gray scale: indices from */
172
- {
173
- if( red < 27) /* this would underflow; remap to black */
174
- idx = COLOR_BLACK;
175
- else if( red >= 243) /* this would overflow */
176
- idx = COLOR_WHITE;
177
- else
178
- idx = (red - 3) / 10 + 232; /* 232 to 255 */
179
- }
180
- else
181
- idx = ((blue - 35) / 40) + ((green - 35) / 40) * 6
182
- + ((red - 35) / 40) * 36 + 16;
183
-
184
- sprintf( otext, "5;%dm", idx);
185
- }
186
- return( otext);
187
- }
188
-
189
- static int get_sixteen_color_idx( const PACKED_RGB rgb)
190
- {
191
- int rval = 0;
192
-
193
- if( rgb & 0x800000) /* red value >= 128 */
194
- rval = 1;
195
- if( rgb & 0x8000) /* green value >= 128 */
196
- rval |= 2;
197
- if( rgb & 0x80) /* blue value >= 128 */
198
- rval |= 4;
199
- return( rval);
200
- }
201
-
202
- static void reset_color( const chtype ch)
203
- {
204
- static PACKED_RGB prev_bg = (PACKED_RGB)-1;
205
- static PACKED_RGB prev_fg = (PACKED_RGB)-1;
206
- PACKED_RGB bg, fg;
207
- char txt[20];
208
-
209
- PDC_get_rgb_values( ch, &fg, &bg);
210
- if( bg != prev_bg)
211
- {
212
- if( COLORS == 16)
213
- printf( "\033[4%dm", get_sixteen_color_idx( bg));
214
- else
215
- printf( "\033[48;%s", color_string( txt, bg));
216
- prev_bg = bg;
217
- }
218
- if( fg != prev_fg)
219
- {
220
- if( COLORS == 16)
221
- printf( "\033[3%dm", get_sixteen_color_idx( fg));
222
- else
223
- printf( "\033[38;%s", color_string( txt, fg));
224
- prev_fg = fg;
225
- }
226
- }
227
-
228
- void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
229
- {
230
- static chtype prev_ch = 0;
231
-
232
- assert( x >= 0);
233
- assert( len <= SP->cols - x);
234
- assert( lineno >= 0);
235
- assert( lineno < SP->lines);
236
- assert( len > 0);
237
- PDC_gotoyx( lineno, x);
238
- while( len--)
239
- {
240
- int ch = (int)( *srcp & A_CHARTEXT);
241
- chtype changes = *srcp ^ prev_ch;
242
-
243
- if( (*srcp & A_ALTCHARSET) && ch < 0x80)
244
- ch = acs_map[ch & 0x7f];
245
- if( ch < (int)' ' || (ch >= 0x80 && ch <= 0x9f))
246
- ch = ' ';
247
- if( changes & A_BOLD)
248
- printf( (*srcp & A_BOLD) ? BOLD_ON : BOLD_OFF);
249
- if( changes & A_UNDERLINE)
250
- printf( (*srcp & A_UNDERLINE) ? UNDERLINE_ON : UNDERLINE_OFF);
251
- if( changes & A_STANDOUT)
252
- printf( (*srcp & A_STANDOUT) ? STANDOUT_ON : STANDOUT_OFF);
253
- if( PDC_really_blinking && ( changes & A_BLINK))
254
- printf( (*srcp & A_BLINK) ? BLINK_ON : BLINK_OFF);
255
- if( changes & (A_COLOR | A_STANDOUT | A_BLINK))
256
- reset_color( *srcp);
257
- #ifdef PDC_WIDE
258
- if( ch < 128)
259
- printf( "%c", (char)ch);
260
- else if( ch < (int)MAX_UNICODE)
261
- printf( "%lc", (wchar_t)ch);
262
- #else
263
- printf( "%c", (char)ch);
264
- #endif
265
- #ifdef USING_COMBINING_CHARACTER_SCHEME
266
- else if( ch > (int)MAX_UNICODE) /* chars & fullwidth supported */
267
- {
268
- cchar_t root, newchar;
269
-
270
- root = ch;
271
- while( (root = PDC_expand_combined_characters( root,
272
- &newchar)) > MAX_UNICODE)
273
- ;
274
- printf( "%lc", (wchar_t)root);
275
- root = ch;
276
- while( (root = PDC_expand_combined_characters( root,
277
- &newchar)) > MAX_UNICODE)
278
- printf( "%lc", (wchar_t)newchar);
279
- printf( "%lc", (wchar_t)newchar);
280
- }
281
- #endif
282
- prev_ch = *srcp++;
283
- }
284
- }
@@ -1,27 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include <curspriv.h>
4
-
5
- int PDC_get_cursor_mode(void)
6
- {
7
- PDC_LOG(("PDC_get_cursor_mode() - called\n"));
8
-
9
- return SP->visibility;
10
- }
11
-
12
-
13
- int PDC_get_columns(void)
14
- {
15
- extern int PDC_cols;
16
-
17
- PDC_LOG(("PDC_get_columns() - called\n"));
18
- return( PDC_cols);
19
- }
20
-
21
- int PDC_get_rows(void)
22
- {
23
- extern int PDC_rows;
24
-
25
- PDC_LOG(("PDC_get_rows() - called\n"));
26
- return( PDC_rows);
27
- }