curses 1.4.6 → 1.5.0
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/.github/workflows/push_gem.yml +6 -4
- data/README.md +8 -1
- data/curses.gemspec +2 -2
- data/ext/curses/curses.c +188 -12
- data/ext/curses/extconf.rb +3 -2
- data/lib/curses.rb +7 -0
- data/sample/attr_demo.rb +4 -2
- data/sample/screen.rb +9 -0
- data/vendor/PDCurses/.gitignore +47 -0
- data/vendor/PDCurses/.travis.yml +49 -0
- data/vendor/PDCurses/CMakeLists.txt +68 -0
- data/vendor/PDCurses/HISTORY.md +2036 -0
- data/vendor/PDCurses/IMPLEMNT.md +327 -0
- data/vendor/PDCurses/Makefile +27 -0
- data/vendor/PDCurses/README.md +77 -0
- data/vendor/PDCurses/acs_defs.h +265 -0
- data/vendor/PDCurses/appveyor.yml +218 -0
- data/vendor/PDCurses/cmake/README.md +71 -0
- data/vendor/PDCurses/cmake/build_dependencies.cmake +178 -0
- data/vendor/PDCurses/cmake/build_options.cmake +25 -0
- data/vendor/PDCurses/cmake/dll_version.cmake +26 -0
- data/vendor/PDCurses/cmake/gen_config_header.cmake +43 -0
- data/vendor/PDCurses/cmake/get_version.cmake +17 -0
- data/vendor/PDCurses/cmake/make_uninstall.cmake +19 -0
- data/vendor/PDCurses/cmake/project_common.cmake +121 -0
- data/vendor/PDCurses/cmake/resource.in.cmake +52 -0
- data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +83 -0
- data/vendor/PDCurses/cmake/target_arch.cmake +36 -0
- data/vendor/PDCurses/cmake/version.in.cmake +73 -0
- data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +96 -0
- data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +106 -0
- data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +105 -0
- data/vendor/PDCurses/curses.h +1846 -0
- data/vendor/PDCurses/curspriv.h +134 -0
- data/vendor/PDCurses/demos/README.md +25 -0
- data/vendor/PDCurses/demos/firework.c +144 -0
- data/vendor/PDCurses/demos/newtest.c +581 -0
- data/vendor/PDCurses/demos/ozdemo.c +447 -0
- data/vendor/PDCurses/demos/ptest.c +283 -0
- data/vendor/PDCurses/demos/rain.c +157 -0
- data/vendor/PDCurses/demos/testcurs.c +1607 -0
- data/vendor/PDCurses/demos/tui.c +1048 -0
- data/vendor/PDCurses/demos/tui.h +65 -0
- data/vendor/PDCurses/demos/tuidemo.c +233 -0
- data/vendor/PDCurses/demos/version.c +61 -0
- data/vendor/PDCurses/demos/worm.c +432 -0
- data/vendor/PDCurses/demos/xmas.c +955 -0
- data/vendor/PDCurses/dos/CMakeLists.txt +47 -0
- data/vendor/PDCurses/dos/Makefile +105 -0
- data/vendor/PDCurses/dos/Makefile.bcc +83 -0
- data/vendor/PDCurses/dos/Makefile.dmc +257 -0
- data/vendor/PDCurses/dos/Makefile.msc +113 -0
- data/vendor/PDCurses/dos/Makefile.wcc +107 -0
- data/vendor/PDCurses/dos/README.md +51 -0
- data/vendor/PDCurses/dos/bccdos.lrf +9 -0
- data/vendor/PDCurses/dos/mscdos.lrf +50 -0
- data/vendor/PDCurses/dos/pdcclip.c +132 -0
- data/vendor/PDCurses/dos/pdcdisp.c +135 -0
- data/vendor/PDCurses/dos/pdcdos.h +194 -0
- data/vendor/PDCurses/dos/pdcgetsc.c +98 -0
- data/vendor/PDCurses/dos/pdckbd.c +513 -0
- data/vendor/PDCurses/dos/pdcscrn.c +785 -0
- data/vendor/PDCurses/dos/pdcsetsc.c +101 -0
- data/vendor/PDCurses/dos/pdcutil.c +212 -0
- data/vendor/PDCurses/libobjs.mif +26 -0
- data/vendor/PDCurses/makedist.mif +20 -0
- data/vendor/PDCurses/man/Makefile +37 -0
- data/vendor/PDCurses/man/README.md +21 -0
- data/vendor/PDCurses/man/intro.md +361 -0
- data/vendor/PDCurses/man/manext.c +119 -0
- data/vendor/PDCurses/man/sdl.md +152 -0
- data/vendor/PDCurses/man/sdl2.md +58 -0
- data/vendor/PDCurses/man/x11.md +407 -0
- data/vendor/PDCurses/ncurses/CMakeLists.txt +66 -0
- data/vendor/PDCurses/ncurses/README.md +26 -0
- data/vendor/PDCurses/ncurses/makefile +29 -0
- data/vendor/PDCurses/os2/CMakeLists.txt +41 -0
- data/vendor/PDCurses/os2/Makefile +132 -0
- data/vendor/PDCurses/os2/Makefile.bcc +90 -0
- data/vendor/PDCurses/os2/Makefile.wcc +43 -0
- data/vendor/PDCurses/os2/README.md +43 -0
- data/vendor/PDCurses/os2/iccos2.lrf +50 -0
- data/vendor/PDCurses/os2/iccos2.mak +256 -0
- data/vendor/PDCurses/os2/pdcclip.c +188 -0
- data/vendor/PDCurses/os2/pdcdisp.c +93 -0
- data/vendor/PDCurses/os2/pdcgetsc.c +89 -0
- data/vendor/PDCurses/os2/pdckbd.c +521 -0
- data/vendor/PDCurses/os2/pdcos2.h +55 -0
- data/vendor/PDCurses/os2/pdcscrn.c +449 -0
- data/vendor/PDCurses/os2/pdcsetsc.c +112 -0
- data/vendor/PDCurses/os2/pdcutil.c +52 -0
- data/vendor/PDCurses/panel.h +56 -0
- data/vendor/PDCurses/pdcurses/README.md +25 -0
- data/vendor/PDCurses/pdcurses/addch.c +693 -0
- data/vendor/PDCurses/pdcurses/addchstr.c +245 -0
- data/vendor/PDCurses/pdcurses/addstr.c +240 -0
- data/vendor/PDCurses/pdcurses/attr.c +359 -0
- data/vendor/PDCurses/pdcurses/beep.c +68 -0
- data/vendor/PDCurses/pdcurses/bkgd.c +223 -0
- data/vendor/PDCurses/pdcurses/border.c +411 -0
- data/vendor/PDCurses/pdcurses/clear.c +159 -0
- data/vendor/PDCurses/pdcurses/color.c +298 -0
- data/vendor/PDCurses/pdcurses/debug.c +109 -0
- data/vendor/PDCurses/pdcurses/delch.c +96 -0
- data/vendor/PDCurses/pdcurses/deleteln.c +211 -0
- data/vendor/PDCurses/pdcurses/deprec.c +27 -0
- data/vendor/PDCurses/pdcurses/getch.c +417 -0
- data/vendor/PDCurses/pdcurses/getstr.c +474 -0
- data/vendor/PDCurses/pdcurses/getyx.c +139 -0
- data/vendor/PDCurses/pdcurses/inch.c +127 -0
- data/vendor/PDCurses/pdcurses/inchstr.c +214 -0
- data/vendor/PDCurses/pdcurses/initscr.c +367 -0
- data/vendor/PDCurses/pdcurses/inopts.c +324 -0
- data/vendor/PDCurses/pdcurses/insch.c +271 -0
- data/vendor/PDCurses/pdcurses/insstr.c +264 -0
- data/vendor/PDCurses/pdcurses/instr.c +246 -0
- data/vendor/PDCurses/pdcurses/kernel.c +259 -0
- data/vendor/PDCurses/pdcurses/keyname.c +157 -0
- data/vendor/PDCurses/pdcurses/mouse.c +438 -0
- data/vendor/PDCurses/pdcurses/move.c +57 -0
- data/vendor/PDCurses/pdcurses/outopts.c +159 -0
- data/vendor/PDCurses/pdcurses/overlay.c +214 -0
- data/vendor/PDCurses/pdcurses/pad.c +260 -0
- data/vendor/PDCurses/pdcurses/panel.c +633 -0
- data/vendor/PDCurses/pdcurses/printw.c +126 -0
- data/vendor/PDCurses/pdcurses/refresh.c +279 -0
- data/vendor/PDCurses/pdcurses/scanw.c +578 -0
- data/vendor/PDCurses/pdcurses/scr_dump.c +213 -0
- data/vendor/PDCurses/pdcurses/scroll.c +101 -0
- data/vendor/PDCurses/pdcurses/slk.c +591 -0
- data/vendor/PDCurses/pdcurses/termattr.c +182 -0
- data/vendor/PDCurses/pdcurses/terminfo.c +217 -0
- data/vendor/PDCurses/pdcurses/touch.c +163 -0
- data/vendor/PDCurses/pdcurses/util.c +312 -0
- data/vendor/PDCurses/pdcurses/window.c +569 -0
- data/vendor/PDCurses/sdl1/Makefile +129 -0
- data/vendor/PDCurses/sdl1/Makefile.mng +110 -0
- data/vendor/PDCurses/sdl1/README.md +31 -0
- data/vendor/PDCurses/sdl1/deffont.h +385 -0
- data/vendor/PDCurses/sdl1/deficon.h +23 -0
- data/vendor/PDCurses/sdl1/pdcclip.c +131 -0
- data/vendor/PDCurses/sdl1/pdcdisp.c +373 -0
- data/vendor/PDCurses/sdl1/pdcgetsc.c +30 -0
- data/vendor/PDCurses/sdl1/pdckbd.c +405 -0
- data/vendor/PDCurses/sdl1/pdcscrn.c +414 -0
- data/vendor/PDCurses/sdl1/pdcsdl.h +31 -0
- data/vendor/PDCurses/sdl1/pdcsetsc.c +64 -0
- data/vendor/PDCurses/sdl1/pdcutil.c +40 -0
- data/vendor/PDCurses/sdl1/sdltest.c +79 -0
- data/vendor/PDCurses/sdl2/CMakeLists.txt +76 -0
- data/vendor/PDCurses/sdl2/Makefile +135 -0
- data/vendor/PDCurses/sdl2/Makefile.vc +164 -0
- data/vendor/PDCurses/sdl2/README.md +34 -0
- data/vendor/PDCurses/sdl2/deffont.h +385 -0
- data/vendor/PDCurses/sdl2/deficon.h +23 -0
- data/vendor/PDCurses/sdl2/pdcclip.c +93 -0
- data/vendor/PDCurses/sdl2/pdcdisp.c +534 -0
- data/vendor/PDCurses/sdl2/pdcgetsc.c +30 -0
- data/vendor/PDCurses/sdl2/pdckbd.c +480 -0
- data/vendor/PDCurses/sdl2/pdcscrn.c +443 -0
- data/vendor/PDCurses/sdl2/pdcsdl.h +33 -0
- data/vendor/PDCurses/sdl2/pdcsetsc.c +67 -0
- data/vendor/PDCurses/sdl2/pdcutil.c +39 -0
- data/vendor/PDCurses/sdl2/sdltest.c +81 -0
- data/vendor/PDCurses/term.h +48 -0
- data/vendor/PDCurses/version.mif +7 -0
- data/vendor/PDCurses/vt/CMakeLists.txt +28 -0
- data/vendor/PDCurses/vt/Makefile +135 -0
- data/vendor/PDCurses/vt/Makefile.bcc +111 -0
- data/vendor/PDCurses/vt/Makefile.dmc +258 -0
- data/vendor/PDCurses/vt/Makefile.vc +144 -0
- data/vendor/PDCurses/vt/Makefile.wcc +107 -0
- data/vendor/PDCurses/vt/README.md +64 -0
- data/vendor/PDCurses/vt/pdcclip.c +20 -0
- data/vendor/PDCurses/vt/pdcdisp.c +284 -0
- data/vendor/PDCurses/vt/pdcgetsc.c +27 -0
- data/vendor/PDCurses/vt/pdckbd.c +394 -0
- data/vendor/PDCurses/vt/pdcscrn.c +434 -0
- data/vendor/PDCurses/vt/pdcsetsc.c +45 -0
- data/vendor/PDCurses/vt/pdcutil.c +43 -0
- data/vendor/PDCurses/vt/pdcvt.h +16 -0
- data/vendor/PDCurses/watcom.mif +68 -0
- data/vendor/PDCurses/wincon/CMakeLists.txt +27 -0
- data/vendor/PDCurses/wincon/Makefile.bcc +88 -0
- data/vendor/PDCurses/wincon/Makefile.dmc +256 -0
- data/vendor/PDCurses/wincon/Makefile.lcc +273 -0
- data/vendor/PDCurses/wincon/Makefile.mng +176 -0
- data/vendor/PDCurses/wincon/Makefile.vc +144 -0
- data/vendor/PDCurses/wincon/Makefile.wcc +51 -0
- data/vendor/PDCurses/wincon/README.md +85 -0
- data/vendor/PDCurses/wincon/pdcclip.c +174 -0
- data/vendor/PDCurses/wincon/pdcdisp.c +143 -0
- data/vendor/PDCurses/wincon/pdcgetsc.c +55 -0
- data/vendor/PDCurses/wincon/pdckbd.c +786 -0
- data/vendor/PDCurses/wincon/pdcscrn.c +717 -0
- data/vendor/PDCurses/wincon/pdcsetsc.c +91 -0
- data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
- data/vendor/PDCurses/wincon/pdcurses.rc +28 -0
- data/vendor/PDCurses/wincon/pdcutil.c +41 -0
- data/vendor/PDCurses/wincon/pdcwin.h +31 -0
- data/vendor/PDCurses/wingui/CMakeLists.txt +27 -0
- data/vendor/PDCurses/wingui/Makefile.bcc +85 -0
- data/vendor/PDCurses/wingui/Makefile.dmc +259 -0
- data/vendor/PDCurses/wingui/Makefile.lcc +273 -0
- data/vendor/PDCurses/wingui/Makefile.mng +171 -0
- data/vendor/PDCurses/wingui/Makefile.vc +144 -0
- data/vendor/PDCurses/wingui/Makefile.wcc +51 -0
- data/vendor/PDCurses/wingui/README.md +93 -0
- data/vendor/PDCurses/wingui/pdcclip.c +174 -0
- data/vendor/PDCurses/wingui/pdcdisp.c +718 -0
- data/vendor/PDCurses/wingui/pdcgetsc.c +30 -0
- data/vendor/PDCurses/wingui/pdckbd.c +143 -0
- data/vendor/PDCurses/wingui/pdcscrn.c +2797 -0
- data/vendor/PDCurses/wingui/pdcsetsc.c +89 -0
- data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
- data/vendor/PDCurses/wingui/pdcurses.rc +28 -0
- data/vendor/PDCurses/wingui/pdcutil.c +61 -0
- data/vendor/PDCurses/wingui/pdcwin.h +122 -0
- data/vendor/PDCurses/x11/Makefile.in +754 -0
- data/vendor/PDCurses/x11/PDCurses.spec +82 -0
- data/vendor/PDCurses/x11/README.md +62 -0
- data/vendor/PDCurses/x11/ScrollBox.c +319 -0
- data/vendor/PDCurses/x11/ScrollBox.h +51 -0
- data/vendor/PDCurses/x11/ScrollBoxP.h +70 -0
- data/vendor/PDCurses/x11/aclocal.m4 +994 -0
- data/vendor/PDCurses/x11/big_icon.xbm +46 -0
- data/vendor/PDCurses/x11/compose.h +201 -0
- data/vendor/PDCurses/x11/config.guess +1500 -0
- data/vendor/PDCurses/x11/config.h.in +100 -0
- data/vendor/PDCurses/x11/config.sub +1616 -0
- data/vendor/PDCurses/x11/configure +6700 -0
- data/vendor/PDCurses/x11/configure.ac +295 -0
- data/vendor/PDCurses/x11/debian/changelog +6 -0
- data/vendor/PDCurses/x11/debian/compat +1 -0
- data/vendor/PDCurses/x11/debian/control +11 -0
- data/vendor/PDCurses/x11/debian/copyright +27 -0
- data/vendor/PDCurses/x11/debian/rules +98 -0
- data/vendor/PDCurses/x11/install-sh +253 -0
- data/vendor/PDCurses/x11/little_icon.xbm +14 -0
- data/vendor/PDCurses/x11/ncurses_cfg.h +45 -0
- data/vendor/PDCurses/x11/pdcclip.c +173 -0
- data/vendor/PDCurses/x11/pdcdisp.c +85 -0
- data/vendor/PDCurses/x11/pdcgetsc.c +28 -0
- data/vendor/PDCurses/x11/pdckbd.c +104 -0
- data/vendor/PDCurses/x11/pdcscrn.c +258 -0
- data/vendor/PDCurses/x11/pdcsetsc.c +95 -0
- data/vendor/PDCurses/x11/pdcutil.c +52 -0
- data/vendor/PDCurses/x11/pdcx11.c +316 -0
- data/vendor/PDCurses/x11/pdcx11.h +191 -0
- data/vendor/PDCurses/x11/sb.c +155 -0
- data/vendor/PDCurses/x11/x11.c +3686 -0
- data/vendor/PDCurses/x11/xcurses-config.in +81 -0
- metadata +249 -8
@@ -0,0 +1,361 @@
|
|
1
|
+
PDCurses User's Guide
|
2
|
+
=====================
|
3
|
+
|
4
|
+
Curses Overview
|
5
|
+
---------------
|
6
|
+
|
7
|
+
The X/Open Curses Interface Definition describes a set of C-Language
|
8
|
+
functions that provide screen-handling and updating, which are
|
9
|
+
collectively known as the curses library.
|
10
|
+
|
11
|
+
The curses library permits manipulation of data structures called
|
12
|
+
windows which may be thought of as two-dimensional arrays of
|
13
|
+
characters representing all or part of a terminal's screen. The
|
14
|
+
windows are manipulated using a procedural interface described
|
15
|
+
elsewhere. The curses package maintains a record of what characters
|
16
|
+
are on the screen. At the most basic level, manipulation is done with
|
17
|
+
the routines move() and addch() which are used to "move" the curses
|
18
|
+
around and add characters to the default window, stdscr, which
|
19
|
+
represents the whole screen.
|
20
|
+
|
21
|
+
An application may use these routines to add data to the window in any
|
22
|
+
convenient order. Once all data have been added, the routine
|
23
|
+
refresh() is called. The package then determines what changes have
|
24
|
+
been made which affect the screen. The screen contents are then
|
25
|
+
changed to reflect those characters now in the window, using a
|
26
|
+
sequence of operations optimized for the type of terminal in use.
|
27
|
+
|
28
|
+
At a higher level routines combining the actions of move() and addch()
|
29
|
+
are defined, as are routines to add whole strings and to perform
|
30
|
+
format conversions in the manner of printf().
|
31
|
+
|
32
|
+
Interfaces are also defined to erase the entire window and to specify
|
33
|
+
the attributes of individual characters in the window. Attributes
|
34
|
+
such as inverse video, underline and blink can be used on a
|
35
|
+
per-character basis.
|
36
|
+
|
37
|
+
New windows can be created by allowing the application to build
|
38
|
+
several images of the screen and display the appropriate one very
|
39
|
+
quickly. New windows are created using the routine newwin(). For
|
40
|
+
each routine that manipulates the default window, stdscr, there is a
|
41
|
+
corresponding routine prefixed with w to manipulate the contents of a
|
42
|
+
specified window; for example, move() and wmove(). In fact, move(...)
|
43
|
+
is functionally equivalent to wmove( stdscr, ...). This is similar to
|
44
|
+
the interface offered by printf(...) and fprintf(stdout, ...).
|
45
|
+
|
46
|
+
Windows do not have to correspond to the entire screen. It is
|
47
|
+
possible to create smaller windows, and also to indicate that the
|
48
|
+
window is only partially visible on the screen. Furthermore, large
|
49
|
+
windows or pads, which are bigger than the actual screen size, may be
|
50
|
+
created.
|
51
|
+
|
52
|
+
Interfaces are also defined to allow input character manipulation and
|
53
|
+
to disable and enable many input attributes: character echo, single
|
54
|
+
character input with or without signal processing (cbreak or raw
|
55
|
+
modes), carriage returns mapping to newlines, screen scrolling, etc.
|
56
|
+
|
57
|
+
|
58
|
+
Data Types and the \<curses.h\> Header
|
59
|
+
--------------------------------------
|
60
|
+
|
61
|
+
The data types supported by curses are described in this section.
|
62
|
+
|
63
|
+
As the library supports a procedural interface to the data types, actual
|
64
|
+
structure contents are not described. All curses data are manipulated
|
65
|
+
using the routines provided.
|
66
|
+
|
67
|
+
|
68
|
+
### The \<curses.h\> Header
|
69
|
+
|
70
|
+
The \<curses.h\> header defines various constants and declares the data
|
71
|
+
types that are available to the application.
|
72
|
+
|
73
|
+
|
74
|
+
### Data Types
|
75
|
+
|
76
|
+
The following data types are declared:
|
77
|
+
|
78
|
+
WINDOW * pointer to screen representation
|
79
|
+
SCREEN * pointer to terminal descriptor
|
80
|
+
bool boolean data type
|
81
|
+
chtype representation of a character in a window
|
82
|
+
cchar_t the wide-character equivalent of chtype
|
83
|
+
attr_t for WA_-style attributes
|
84
|
+
|
85
|
+
The actual WINDOW and SCREEN objects used to store information are
|
86
|
+
created by the corresponding routines and a pointer to them is provided.
|
87
|
+
All manipulation is through that pointer.
|
88
|
+
|
89
|
+
|
90
|
+
### Variables
|
91
|
+
|
92
|
+
The following variables are defined:
|
93
|
+
|
94
|
+
LINES number of lines on terminal screen
|
95
|
+
COLS number of columns on terminal screen
|
96
|
+
stdscr pointer to the default screen window
|
97
|
+
curscr pointer to the current screen image
|
98
|
+
SP pointer to the current SCREEN struct
|
99
|
+
Mouse_status status of the mouse
|
100
|
+
COLORS number of colors available
|
101
|
+
COLOR_PAIRS number of color pairs available
|
102
|
+
TABSIZE size of one TAB block
|
103
|
+
acs_map[] alternate character set map
|
104
|
+
ttytype[] terminal name/description
|
105
|
+
|
106
|
+
|
107
|
+
### Constants
|
108
|
+
|
109
|
+
The following constants are defined:
|
110
|
+
|
111
|
+
#### General
|
112
|
+
|
113
|
+
FALSE boolean false value
|
114
|
+
TRUE boolean true value
|
115
|
+
NULL zero pointer value
|
116
|
+
ERR value returned on error condition
|
117
|
+
OK value returned on successful completion
|
118
|
+
|
119
|
+
#### Video Attributes
|
120
|
+
|
121
|
+
Normally, attributes are a property of the character.
|
122
|
+
|
123
|
+
For chtype:
|
124
|
+
|
125
|
+
A_ALTCHARSET use the alternate character set
|
126
|
+
A_BLINK bright background or blinking
|
127
|
+
A_BOLD bright foreground or bold
|
128
|
+
A_DIM half bright -- no effect in PDCurses
|
129
|
+
A_INVIS invisible
|
130
|
+
A_ITALIC italic
|
131
|
+
A_LEFTLINE line along the left edge
|
132
|
+
A_PROTECT protected (?) -- PDCurses renders this as a
|
133
|
+
combination of the *LINE attributes
|
134
|
+
A_REVERSE reverse video
|
135
|
+
A_RIGHTLINE line along the right edge
|
136
|
+
A_STANDOUT terminal's best highlighting mode
|
137
|
+
A_UNDERLINE underline
|
138
|
+
|
139
|
+
A_ATTRIBUTES bit-mask to extract attributes
|
140
|
+
A_CHARTEXT bit-mask to extract a character
|
141
|
+
A_COLOR bit-mask to extract a color-pair
|
142
|
+
|
143
|
+
Not all attributes will work on all terminals. A_RIGHTLINE, A_LEFTLINE
|
144
|
+
and A_ITALIC are specific to PDCurses. A_INVIS and A_ITALIC are given
|
145
|
+
the same value in PDCurses.
|
146
|
+
|
147
|
+
For attr_t:
|
148
|
+
|
149
|
+
WA_ALTCHARSET same as A_ALTCHARSET
|
150
|
+
WA_BLINK same as A_BLINK
|
151
|
+
WA_BOLD same as A_BOLD
|
152
|
+
WA_DIM same as A_DIM
|
153
|
+
WA_INVIS same as A_INVIS
|
154
|
+
WA_LEFT same as A_LEFTLINE
|
155
|
+
WA_PROTECT same as A_PROTECT
|
156
|
+
WA_REVERSE same as A_REVERSE
|
157
|
+
WA_RIGHT same as A_RIGHTLINE
|
158
|
+
WA_STANDOUT same as A_STANDOUT
|
159
|
+
WA_UNDERLINE same as A_UNDERLINE
|
160
|
+
|
161
|
+
Note that while A_LEFTLINE and A_RIGHTLINE are PDCurses-specific,
|
162
|
+
WA_LEFT and WA_RIGHT are standard. The following are also defined, for
|
163
|
+
compatibility, but currently have no effect in PDCurses: WA_HORIZONTAL,
|
164
|
+
WA_LOW, WA_TOP, WA_VERTICAL.
|
165
|
+
|
166
|
+
### The Alternate Character Set
|
167
|
+
|
168
|
+
For use in chtypes and with related functions. These are a portable way
|
169
|
+
to represent graphics characters on different terminals.
|
170
|
+
|
171
|
+
VT100-compatible symbols -- box characters:
|
172
|
+
|
173
|
+
ACS_ULCORNER upper left box corner
|
174
|
+
ACS_LLCORNER lower left box corner
|
175
|
+
ACS_URCORNER upper right box corner
|
176
|
+
ACS_LRCORNER lower right box corner
|
177
|
+
ACS_RTEE right "T"
|
178
|
+
ACS_LTEE left "T"
|
179
|
+
ACS_BTEE bottom "T"
|
180
|
+
ACS_TTEE top "T"
|
181
|
+
ACS_HLINE horizontal line
|
182
|
+
ACS_VLINE vertical line
|
183
|
+
ACS_PLUS plus sign, cross, or four-corner piece
|
184
|
+
|
185
|
+
VT100-compatible symbols -- other:
|
186
|
+
|
187
|
+
ACS_S1 scan line 1
|
188
|
+
ACS_S9 scan line 9
|
189
|
+
ACS_DIAMOND diamond
|
190
|
+
ACS_CKBOARD checkerboard -- 50% grey
|
191
|
+
ACS_DEGREE degree symbol
|
192
|
+
ACS_PLMINUS plus/minus sign
|
193
|
+
ACS_BULLET bullet
|
194
|
+
|
195
|
+
Teletype 5410v1 symbols -- these are defined in SysV curses, but are not
|
196
|
+
well-supported by most terminals. Stick to VT100 characters for optimum
|
197
|
+
portability:
|
198
|
+
|
199
|
+
ACS_LARROW left arrow
|
200
|
+
ACS_RARROW right arrow
|
201
|
+
ACS_DARROW down arrow
|
202
|
+
ACS_UARROW up arrow
|
203
|
+
ACS_BOARD checkerboard -- lighter (less dense) than
|
204
|
+
ACS_CKBOARD
|
205
|
+
ACS_LANTERN lantern symbol
|
206
|
+
ACS_BLOCK solid block
|
207
|
+
|
208
|
+
That goes double for these -- undocumented SysV symbols. Don't use them:
|
209
|
+
|
210
|
+
ACS_S3 scan line 3
|
211
|
+
ACS_S7 scan line 7
|
212
|
+
ACS_LEQUAL less than or equal
|
213
|
+
ACS_GEQUAL greater than or equal
|
214
|
+
ACS_PI pi
|
215
|
+
ACS_NEQUAL not equal
|
216
|
+
ACS_STERLING pounds sterling symbol
|
217
|
+
|
218
|
+
Box character aliases:
|
219
|
+
|
220
|
+
ACS_BSSB same as ACS_ULCORNER
|
221
|
+
ACS_SSBB same as ACS_LLCORNER
|
222
|
+
ACS_BBSS same as ACS_URCORNER
|
223
|
+
ACS_SBBS same as ACS_LRCORNER
|
224
|
+
ACS_SBSS same as ACS_RTEE
|
225
|
+
ACS_SSSB same as ACS_LTEE
|
226
|
+
ACS_SSBS same as ACS_BTEE
|
227
|
+
ACS_BSSS same as ACS_TTEE
|
228
|
+
ACS_BSBS same as ACS_HLINE
|
229
|
+
ACS_SBSB same as ACS_VLINE
|
230
|
+
ACS_SSSS same as ACS_PLUS
|
231
|
+
|
232
|
+
For cchar_t and wide-character functions, WACS_ equivalents are also
|
233
|
+
defined.
|
234
|
+
|
235
|
+
### Colors
|
236
|
+
|
237
|
+
For use with init_pair(), color_set(), etc.:
|
238
|
+
|
239
|
+
COLOR_BLACK
|
240
|
+
COLOR_BLUE
|
241
|
+
COLOR_GREEN
|
242
|
+
COLOR_CYAN
|
243
|
+
COLOR_RED
|
244
|
+
COLOR_MAGENTA
|
245
|
+
COLOR_YELLOW
|
246
|
+
COLOR_WHITE
|
247
|
+
|
248
|
+
Use these instead of numeric values. The definition of the colors
|
249
|
+
depends on the implementation of curses.
|
250
|
+
|
251
|
+
|
252
|
+
### Input Values
|
253
|
+
|
254
|
+
The following constants might be returned by getch() if keypad() has
|
255
|
+
been enabled. Note that not all of these may be supported on a
|
256
|
+
particular terminal:
|
257
|
+
|
258
|
+
KEY_BREAK break key
|
259
|
+
KEY_DOWN the four arrow keys
|
260
|
+
KEY_UP
|
261
|
+
KEY_LEFT
|
262
|
+
KEY_RIGHT
|
263
|
+
KEY_HOME home key (upward+left arrow)
|
264
|
+
KEY_BACKSPACE backspace
|
265
|
+
KEY_F0 function keys; space for 64 keys is reserved
|
266
|
+
KEY_F(n) (KEY_F0+(n))
|
267
|
+
KEY_DL delete line
|
268
|
+
KEY_IL insert line
|
269
|
+
KEY_DC delete character
|
270
|
+
KEY_IC insert character
|
271
|
+
KEY_EIC exit insert character mode
|
272
|
+
KEY_CLEAR clear screen
|
273
|
+
KEY_EOS clear to end of screen
|
274
|
+
KEY_EOL clear to end of line
|
275
|
+
KEY_SF scroll 1 line forwards
|
276
|
+
KEY_SR scroll 1 line backwards (reverse)
|
277
|
+
KEY_NPAGE next page
|
278
|
+
KEY_PPAGE previous page
|
279
|
+
KEY_STAB set tab
|
280
|
+
KEY_CTAB clear tab
|
281
|
+
KEY_CATAB clear all tabs
|
282
|
+
KEY_ENTER enter or send
|
283
|
+
KEY_SRESET soft (partial) reset
|
284
|
+
KEY_RESET reset or hard reset
|
285
|
+
KEY_PRINT print or copy
|
286
|
+
KEY_LL home down or bottom (lower left)
|
287
|
+
KEY_A1 upper left of virtual keypad
|
288
|
+
KEY_A3 upper right of virtual keypad
|
289
|
+
KEY_B2 center of virtual keypad
|
290
|
+
KEY_C1 lower left of virtual keypad
|
291
|
+
KEY_C3 lower right of virtual keypad
|
292
|
+
|
293
|
+
KEY_BTAB Back tab key
|
294
|
+
KEY_BEG Beginning key
|
295
|
+
KEY_CANCEL Cancel key
|
296
|
+
KEY_CLOSE Close key
|
297
|
+
KEY_COMMAND Cmd (command) key
|
298
|
+
KEY_COPY Copy key
|
299
|
+
KEY_CREATE Create key
|
300
|
+
KEY_END End key
|
301
|
+
KEY_EXIT Exit key
|
302
|
+
KEY_FIND Find key
|
303
|
+
KEY_HELP Help key
|
304
|
+
KEY_MARK Mark key
|
305
|
+
KEY_MESSAGE Message key
|
306
|
+
KEY_MOVE Move key
|
307
|
+
KEY_NEXT Next object key
|
308
|
+
KEY_OPEN Open key
|
309
|
+
KEY_OPTIONS Options key
|
310
|
+
KEY_PREVIOUS Previous object key
|
311
|
+
KEY_REDO Redo key
|
312
|
+
KEY_REFERENCE Reference key
|
313
|
+
KEY_REFRESH Refresh key
|
314
|
+
KEY_REPLACE Replace key
|
315
|
+
KEY_RESTART Restart key
|
316
|
+
KEY_RESUME Resume key
|
317
|
+
KEY_SAVE Save key
|
318
|
+
KEY_SBEG Shifted beginning key
|
319
|
+
KEY_SCANCEL Shifted cancel key
|
320
|
+
KEY_SCOMMAND Shifted command key
|
321
|
+
KEY_SCOPY Shifted copy key
|
322
|
+
KEY_SCREATE Shifted create key
|
323
|
+
KEY_SDC Shifted delete char key
|
324
|
+
KEY_SDL Shifted delete line key
|
325
|
+
KEY_SELECT Select key
|
326
|
+
KEY_SEND Shifted end key
|
327
|
+
KEY_SEOL Shifted clear line key
|
328
|
+
KEY_SEXIT Shifted exit key
|
329
|
+
KEY_SFIND Shifted find key
|
330
|
+
KEY_SHELP Shifted help key
|
331
|
+
KEY_SHOME Shifted home key
|
332
|
+
KEY_SIC Shifted input key
|
333
|
+
KEY_SLEFT Shifted left arrow key
|
334
|
+
KEY_SMESSAGE Shifted message key
|
335
|
+
KEY_SMOVE Shifted move key
|
336
|
+
KEY_SNEXT Shifted next key
|
337
|
+
KEY_SOPTIONS Shifted options key
|
338
|
+
KEY_SPREVIOUS Shifted prev key
|
339
|
+
KEY_SPRINT Shifted print key
|
340
|
+
KEY_SREDO Shifted redo key
|
341
|
+
KEY_SREPLACE Shifted replace key
|
342
|
+
KEY_SRIGHT Shifted right arrow
|
343
|
+
KEY_SRSUME Shifted resume key
|
344
|
+
KEY_SSAVE Shifted save key
|
345
|
+
KEY_SSUSPEND Shifted suspend key
|
346
|
+
KEY_SUNDO Shifted undo key
|
347
|
+
KEY_SUSPEND Suspend key
|
348
|
+
KEY_UNDO Undo key
|
349
|
+
|
350
|
+
The virtual keypad is arranged like this:
|
351
|
+
|
352
|
+
A1 up A3
|
353
|
+
left B2 right
|
354
|
+
C1 down C3
|
355
|
+
|
356
|
+
This list is incomplete -- see curses.h for the full list, and use the
|
357
|
+
testcurs demo to see what values are actually returned. The above are
|
358
|
+
just the keys required by X/Open. In particular, PDCurses defines many
|
359
|
+
CTL_ and ALT_ combinations; these are not portable.
|
360
|
+
|
361
|
+
--------------------------------------------------------------------------
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/***********************************************************************/
|
2
|
+
/* MANEXT - Extract manual pages from C source code. */
|
3
|
+
/***********************************************************************/
|
4
|
+
/*
|
5
|
+
* MANEXT - A program to extract manual pages from C source code.
|
6
|
+
* Copyright (C) 1991-1996 Mark Hessling
|
7
|
+
*
|
8
|
+
* This program is free software; you can redistribute it and/or
|
9
|
+
* modify it under the terms of the GNU General Public License as
|
10
|
+
* published by the Free Software Foundation; either version 2 of
|
11
|
+
* the License, or any later version.
|
12
|
+
*
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16
|
+
* General Public License for more details.
|
17
|
+
*
|
18
|
+
* If you make modifications to this software that you feel increases
|
19
|
+
* it usefulness for the rest of the community, please email the
|
20
|
+
* changes, enhancements, bug fixes as well as any and all ideas to me.
|
21
|
+
* This software is going to be maintained and enhanced as deemed
|
22
|
+
* necessary by the community.
|
23
|
+
*
|
24
|
+
* Mark Hessling <mark@rexx.org>
|
25
|
+
*/
|
26
|
+
|
27
|
+
#include <stdio.h>
|
28
|
+
#include <stdlib.h>
|
29
|
+
#include <string.h>
|
30
|
+
|
31
|
+
#define MAX_LINE 255
|
32
|
+
|
33
|
+
void display_info()
|
34
|
+
{
|
35
|
+
fprintf(stderr, "\nMANEXT 1.03 Copyright (C) 1991-1996 Mark Hessling\n"
|
36
|
+
"All rights reserved.\n"
|
37
|
+
"MANEXT is distributed under the terms of the GNU\n"
|
38
|
+
"General Public License and comes with NO WARRANTY.\n"
|
39
|
+
"See the file COPYING for details.\n"
|
40
|
+
"\nUsage: manext sourcefile [...]\n\n");
|
41
|
+
}
|
42
|
+
|
43
|
+
int main(int argc, char **argv)
|
44
|
+
{
|
45
|
+
char s[MAX_LINE + 1]; /* input line */
|
46
|
+
int i;
|
47
|
+
FILE *fp;
|
48
|
+
|
49
|
+
#ifdef __EMX__
|
50
|
+
_wildcard(&argc, &argv);
|
51
|
+
#endif
|
52
|
+
if (strcmp(argv[1], "-h") == 0)
|
53
|
+
{
|
54
|
+
display_info();
|
55
|
+
exit(1);
|
56
|
+
}
|
57
|
+
|
58
|
+
for (i = 1; i < argc; i++)
|
59
|
+
{
|
60
|
+
if ((fp = fopen(argv[i], "r")) == NULL)
|
61
|
+
{
|
62
|
+
fprintf(stderr, "\nCould not open %s\n", argv[i]);
|
63
|
+
continue;
|
64
|
+
}
|
65
|
+
|
66
|
+
while (!feof(fp))
|
67
|
+
{
|
68
|
+
if (fgets(s, (int)sizeof(s), fp) == NULL)
|
69
|
+
{
|
70
|
+
if (ferror(fp) != 0)
|
71
|
+
{
|
72
|
+
fprintf(stderr, "*** Error reading %s. Exiting.\n",
|
73
|
+
argv[i]);
|
74
|
+
exit(1);
|
75
|
+
}
|
76
|
+
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
|
80
|
+
/* check for manual entry marker at beginning of line */
|
81
|
+
|
82
|
+
if (strncmp(s, "/*man-start*", 12) != 0)
|
83
|
+
continue;
|
84
|
+
|
85
|
+
/* inner loop */
|
86
|
+
|
87
|
+
for (;;)
|
88
|
+
{
|
89
|
+
/* read next line of manual entry */
|
90
|
+
|
91
|
+
if (fgets(s, (int)sizeof(s), fp) == NULL)
|
92
|
+
{
|
93
|
+
if (ferror(fp) != 0)
|
94
|
+
{
|
95
|
+
fprintf(stderr, "*** Error reading %s. Exiting.\n",
|
96
|
+
argv[i]);
|
97
|
+
exit(1);
|
98
|
+
}
|
99
|
+
|
100
|
+
break;
|
101
|
+
}
|
102
|
+
|
103
|
+
/* check for end of entry marker */
|
104
|
+
|
105
|
+
if (strncmp(s, "**man-end", 9) == 0)
|
106
|
+
break;
|
107
|
+
|
108
|
+
printf("%s", s);
|
109
|
+
}
|
110
|
+
|
111
|
+
printf("\n\n-----------------------------------"
|
112
|
+
"---------------------------------------\n\n");
|
113
|
+
}
|
114
|
+
|
115
|
+
fclose(fp);
|
116
|
+
}
|
117
|
+
|
118
|
+
return 0;
|
119
|
+
}
|
@@ -0,0 +1,152 @@
|
|
1
|
+
SDL Considerations
|
2
|
+
==================
|
3
|
+
|
4
|
+
There are no special requirements to use PDCurses for SDL -- all
|
5
|
+
PDCurses-compatible code should work fine. (In fact, you can even build
|
6
|
+
against the Win32 console pdcurses.dll, and then swap in the SDL
|
7
|
+
pdcurses.dll.) Nothing extra is needed beyond the base SDL library.
|
8
|
+
However, there are some optional special features, described here.
|
9
|
+
|
10
|
+
The principal limitation of this port is that input is currently
|
11
|
+
restricted to ASCII (i.e., 0-127), plus the special keys like KEY_LEFT.
|
12
|
+
(You could have Unicode input, but then the input wouldn't match the
|
13
|
+
output, which is in Code Page 437.) Also, see the note about the
|
14
|
+
potential for incomplete output under "PDC_update_rects()", below.
|
15
|
+
|
16
|
+
|
17
|
+
Fonts
|
18
|
+
-----
|
19
|
+
|
20
|
+
The font is a simple BMP, 32 characters wide by 8 characters tall,
|
21
|
+
preferably with a palette. (BMPs without palettes still work, but in
|
22
|
+
that case, no attributes will be available, nor will the cursor work.)
|
23
|
+
The first entry in the palette (usually black) is treated as the
|
24
|
+
background color; the last entry (usually white) is treated as the
|
25
|
+
foreground. These are changed or made transparent as appropriate; any
|
26
|
+
other colors in the palette are passed through unchanged. So -- although
|
27
|
+
a one-bit depth is sufficient for a normal font -- you could redraw some
|
28
|
+
characters as multi-colored tiles.
|
29
|
+
|
30
|
+
The font must be monospaced. The size of each character is derived by
|
31
|
+
dividing the width of the BMP by 32 and the height by 8. There is no
|
32
|
+
constraint on the dimensions.
|
33
|
+
|
34
|
+
As provided in the default font and expected by acs_map[], the font is
|
35
|
+
in Code Page 437 form. But you can of course use any layout if you're
|
36
|
+
not relying on correct values for the ACS_* macros.
|
37
|
+
|
38
|
+
The font can be set via the environment variable PDC_FONT. If it's not
|
39
|
+
set, PDCurses looks for a file named "pdcfont.bmp" in the current
|
40
|
+
directory at the time of initscr(). If neither is found, it uses the
|
41
|
+
built-in default font encoded in deffont.h.
|
42
|
+
|
43
|
+
|
44
|
+
Backgrounds
|
45
|
+
-----------
|
46
|
+
|
47
|
+
PDCurses for SDL supports an optional background image BMP. This is used
|
48
|
+
whenever start_color() has not been called (see the ptest demo for an
|
49
|
+
example), or when use_default_colors() has been called after
|
50
|
+
start_color(), and the background color of a pair has been set to -1
|
51
|
+
(see ozdemo, worm, and rain for examples). The usage parallels that of
|
52
|
+
ncurses in an appropriate terminal (e.g., Gnome Terminal). The image is
|
53
|
+
tiled to cover the PDCurses window, and can be any size or depth.
|
54
|
+
|
55
|
+
As with the font, you can point to a location for the background via the
|
56
|
+
environment variable PDC_BACKGROUND; "pdcback.bmp" is the fallback.
|
57
|
+
(There is no default background.)
|
58
|
+
|
59
|
+
|
60
|
+
Icons
|
61
|
+
-----
|
62
|
+
|
63
|
+
The icon (used with SDL_WM_SetIcon() -- not used for the executable
|
64
|
+
file) can be set via the environment variable PDC_ICON, and falls back
|
65
|
+
to "pdcicon.bmp", and then to the built-in icon from deficon.h. The
|
66
|
+
built-in icon is the PDCurses logo, as seen in ../x11/little_icon.xbm.
|
67
|
+
The SDL docs say that the icon must be 32x32, at least for use with MS
|
68
|
+
Windows.
|
69
|
+
|
70
|
+
If pdc_screen is preinitialized (see below), PDCurses does not attempt
|
71
|
+
to set the icon.
|
72
|
+
|
73
|
+
|
74
|
+
Screen size
|
75
|
+
-----------
|
76
|
+
|
77
|
+
The default screen size is 80x25 characters (whatever size they may be),
|
78
|
+
but you can override this via the environment variables PDC_COLS and/or
|
79
|
+
PDC_LINES. (Some other ports use COLS and LINES; this is not done here
|
80
|
+
because those values are, or should be, those of the controlling
|
81
|
+
terminal, and PDCurses for SDL is independent of the terminal.) If
|
82
|
+
pdc_screen is preinitialized (see below), these are ignored.
|
83
|
+
|
84
|
+
|
85
|
+
Integration with SDL
|
86
|
+
--------------------
|
87
|
+
|
88
|
+
If you want to go further, you can mix PDCurses and SDL functions. (Of
|
89
|
+
course this is extremely non-portable!) To aid you, there are several
|
90
|
+
external variables and functions specific to the SDL port; you could
|
91
|
+
include pdcsdl.h, or just add the declarations you need in your code:
|
92
|
+
|
93
|
+
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
94
|
+
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
95
|
+
|
96
|
+
void PDC_update_rects(void);
|
97
|
+
void PDC_retile(void);
|
98
|
+
|
99
|
+
pdc_screen is the main surface, created by SDL_SetVideoMode(), unless
|
100
|
+
it's preset before initscr(). You can perform normal SDL operations on
|
101
|
+
this surface, but PDCurses won't respect them when it updates. (For
|
102
|
+
that, see PDC_retile().) As an alternative, you can preinitialize this
|
103
|
+
surface before calling initscr(). In that case, you can use pdc_sheight,
|
104
|
+
pdc_swidth, pdc_yoffset and/or pdc_xoffset (q.v.) to confine PDCurses to
|
105
|
+
only a specific area of the surface, reserving the rest for other SDL
|
106
|
+
operations. If you preinitialize pdc_screen, you'll have to close it
|
107
|
+
yourself; PDCurses will ignore resize events, and won't try to set the
|
108
|
+
icon. Also note that if you preinitialize pdc_screen, it need not be the
|
109
|
+
display surface.
|
110
|
+
|
111
|
+
pdc_font, pdc_icon, and pdc_back are the SDL_surfaces for the font,
|
112
|
+
icon, and background, respectively. You can set any or all of them
|
113
|
+
before initscr(), and thus override any of the other ways to set them.
|
114
|
+
But note that pdc_icon will be ignored if pdc_screen is preset.
|
115
|
+
|
116
|
+
pdc_sheight and pdc_swidth are the dimensions of the area of pdc_screen
|
117
|
+
to be used by PDCurses. You can preset them before initscr(); if either
|
118
|
+
is not set, it defaults to the full screen size minus the x or y offset,
|
119
|
+
as appropriate.
|
120
|
+
|
121
|
+
pdc_xoffset and pdc_yoffset are the x and y offset for the area of
|
122
|
+
pdc_screen to be used by PDCurses. See the sdltest demo for an example.
|
123
|
+
|
124
|
+
PDC_retile() makes a copy of pdc_screen, then tiles it with the
|
125
|
+
background image, if any. The resulting surface is used as the
|
126
|
+
background for transparent character cells. PDC_retile() is called from
|
127
|
+
initscr() and resize_term(). However, you can also use it at other
|
128
|
+
times, to take advantage of the way it copies pdc_screen: Draw some SDL
|
129
|
+
stuff; call PDC_retile(); do some curses stuff -- it will use whatever
|
130
|
+
was on pdc_screen as the background. Then you can erase the curses
|
131
|
+
screen, do some more SDL stuff, and call PDC_retile() again to make a
|
132
|
+
new background. (If you don't erase the curses screen, it will be
|
133
|
+
incorporated into the background when you call PDC_retile().) But this
|
134
|
+
only works if no background image is set.
|
135
|
+
|
136
|
+
PDC_update_rects() is how the screen actually gets updated. For
|
137
|
+
performance reasons, when drawing, PDCurses for SDL maintains a table of
|
138
|
+
rectangles that need updating, and only updates (by calling this
|
139
|
+
function) during getch(), napms(), or when the table gets full.
|
140
|
+
Normally, this is sufficient; but if you're pausing in some way other
|
141
|
+
than by using napms(), and you're not doing keyboard checks, you may get
|
142
|
+
an incomplete update. If that happens, you can call PDC_update_rects()
|
143
|
+
manually.
|
144
|
+
|
145
|
+
|
146
|
+
Interaction with stdio
|
147
|
+
----------------------
|
148
|
+
|
149
|
+
As with X11, it's a bad idea to mix curses and stdio calls. (In fact,
|
150
|
+
that's true for PDCurses on any platform; but especially these two,
|
151
|
+
which don't run under terminals.) Depending on how SDL is built, stdout
|
152
|
+
and stderr may be redirected to files.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
SDL2 Considerations
|
2
|
+
===================
|
3
|
+
|
4
|
+
Most of the information in the [SDL Considerations](sdl.md) document is also
|
5
|
+
valid for the SDL2 platform. This document describes the differences.
|
6
|
+
|
7
|
+
|
8
|
+
Integration with SDL2
|
9
|
+
---------------------
|
10
|
+
|
11
|
+
As mentioned in the [SDL Considerations](sdl.md) document, the SDL port uses
|
12
|
+
the following variables:
|
13
|
+
|
14
|
+
SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
15
|
+
int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
16
|
+
|
17
|
+
The SDL2 port adds:
|
18
|
+
|
19
|
+
SDL_Window *pdc_window;
|
20
|
+
|
21
|
+
These can be used or modified in your own code. Like the `pdc_screen` variable
|
22
|
+
used by the SDL port, you can initialize `pdc_window` in your own code. See the
|
23
|
+
sdltest demo for an example. If it's not initialized, PDCurses will do it for
|
24
|
+
you. If PDCurses initializes `pdc_window`, it will clean up/deallocate these
|
25
|
+
variables on exit.
|
26
|
+
|
27
|
+
|
28
|
+
Fonts
|
29
|
+
-----
|
30
|
+
|
31
|
+
If the `PDC_WIDE` flag is set during compilation, SDL2_ttf is used to render
|
32
|
+
fonts. This allows for use of a full UCS-2 (16 bit Unicode) character set.
|
33
|
+
|
34
|
+
Using SDL2_ttf adds:
|
35
|
+
|
36
|
+
TTF_Font *pdc_ttffont;
|
37
|
+
int pdc_font_size;
|
38
|
+
|
39
|
+
The default TrueType font can be modified by setting a define during compile
|
40
|
+
time (e.g. `-DPDC_FONT_PATH=/usr/share/fonts/truetype/dejavu/`). This can be
|
41
|
+
overridden by initializing `pdc_ttffont` in your own code. Similar
|
42
|
+
to the `PDC_FONT` environment variable for bitmap fonts, one can also override
|
43
|
+
TTF fonts using the `PDC_FONT` environment variables. Unless modified during
|
44
|
+
compile time, the defaults are:
|
45
|
+
|
46
|
+
Windows: C:/Windows/Fonts/lucon.ttf
|
47
|
+
OS X: /Library/Fonts/Courier New.ttf
|
48
|
+
Other: /usr/share/fonts/truetype/freefont/FreeMono.ttf
|
49
|
+
|
50
|
+
Font size can be set using the `PDC_FONT_SIZE` environment variable or by
|
51
|
+
setting the value of `pdc_font_size` in your own code. The default size is 18.
|
52
|
+
|
53
|
+
|
54
|
+
Clipboard
|
55
|
+
---------
|
56
|
+
|
57
|
+
SDL2 port uses functionality provided by the SDL2 clipboard functions to add
|
58
|
+
basic clipboard support.
|