mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-24 07:45:21 +00:00
Merge remote-tracking branch 'wmcbrine/PDCurses/master' into merge/wmcbrine
This commit is contained in:
@@ -794,9 +794,9 @@ PDCurses 2.7 - 2005/12/30
|
||||
|
||||
INTRODUCTION:
|
||||
|
||||
Hello all. As of a few weeks ago, I'm the new maintainer for PDCurses.
|
||||
Here's a brief summary of changes in this release. (More details are
|
||||
available in the CVS log and trackers on SourceForge.)
|
||||
Hello all. As of a few weeks ago, I'm the new maintainer for PDCurses.
|
||||
Here's a brief summary of changes in this release. (More details are
|
||||
available in the CVS log and trackers on SourceForge.)
|
||||
|
||||
NEW FEATURES:
|
||||
|
||||
@@ -902,27 +902,27 @@ BUGS FIXED:
|
||||
|
||||
ACKNOWLEDGEMENTS:
|
||||
|
||||
Walter Briscoe
|
||||
Jean-Pierre Demailly
|
||||
Ruslan Fedyarov
|
||||
Warren Gay
|
||||
Florian Grosse-Coosmann
|
||||
Vladimir Kokovic
|
||||
Matt Maloy
|
||||
K.H. Man
|
||||
Michael Ryazanov
|
||||
Ron Thibodeau
|
||||
Alexandr Zamaraev
|
||||
- Walter Briscoe
|
||||
- Jean-Pierre Demailly
|
||||
- Ruslan Fedyarov
|
||||
- Warren Gay
|
||||
- Florian Grosse-Coosmann
|
||||
- Vladimir Kokovic
|
||||
- Matt Maloy
|
||||
- K.H. Man
|
||||
- Michael Ryazanov
|
||||
- Ron Thibodeau
|
||||
- Alexandr Zamaraev
|
||||
|
||||
and of course, MARK HESSLING, for his over 13 years of service as the
|
||||
maintainer of PDCurses. Plus, thanks to all who've reported bugs or
|
||||
requested features. Apologies to anyone I've forgotten.
|
||||
and of course, MARK HESSLING, for his over 13 years of service as the
|
||||
maintainer of PDCurses. Plus, thanks to all who've reported bugs or
|
||||
requested features. Apologies to anyone I've forgotten.
|
||||
|
||||
I've tested this version on Turbo C++ 3.0 and Borland C++ 3.1 for DOS;
|
||||
DJGPP 2.X; Open Watcom 1.3 for DOS (16 and 32-bit), Windows and OS/2;
|
||||
EMX 0.9d and the "newgcc" version of EMX; Borland C++ 5.5 for Windows;
|
||||
recent versions of MinGW, Cygwin, LCC-Win32 and Microsoft Visual C++;
|
||||
and gcc under several flavors of Linux, Mac OS X, *BSD and Solaris.
|
||||
I've tested this version on Turbo C++ 3.0 and Borland C++ 3.1 for DOS;
|
||||
DJGPP 2.X; Open Watcom 1.3 for DOS (16 and 32-bit), Windows and OS/2;
|
||||
EMX 0.9d and the "newgcc" version of EMX; Borland C++ 5.5 for Windows;
|
||||
recent versions of MinGW, Cygwin, LCC-Win32 and Microsoft Visual C++;
|
||||
and gcc under several flavors of Linux, Mac OS X, *BSD and Solaris.
|
||||
|
||||
-- William McBrine
|
||||
|
||||
@@ -1128,15 +1128,15 @@ NEW COMPILER SUPPORT:
|
||||
|
||||
ACKNOWLEDGEMENTS: (for this release)
|
||||
|
||||
Georg Fuchs for various changes.
|
||||
Juan David Palomar for pointing out getnstr() was not implemented.
|
||||
William McBrine for fix to allow black/black as valid color pair.
|
||||
Peter Preus for pointing out the missing bccos2.mak file.
|
||||
Laura Michaels for a couple of bug fixes and changes required to
|
||||
support Mingw32 compiler.
|
||||
Frank Heckenbach for PDC_get_input_fd() and some portability fixes and
|
||||
the fixes for panel library.
|
||||
Matthias Burian for the lcc-win32 compiler support.
|
||||
- Georg Fuchs for various changes.
|
||||
- Juan David Palomar for pointing out getnstr() was not implemented.
|
||||
- William McBrine for fix to allow black/black as valid color pair.
|
||||
- Peter Preus for pointing out the missing bccos2.mak file.
|
||||
- Laura Michaels for a couple of bug fixes and changes required to
|
||||
support Mingw32 compiler.
|
||||
- Frank Heckenbach for PDC_get_input_fd() and some portability fixes and
|
||||
the fixes for panel library.
|
||||
- Matthias Burian for the lcc-win32 compiler support.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -1145,7 +1145,7 @@ PDCurses 2.3 - 1998/07/09
|
||||
|
||||
INTRODUCTION:
|
||||
|
||||
This release of PDCurses includes the following changes:
|
||||
This release of PDCurses includes the following changes:
|
||||
|
||||
- added more System V R4 functions
|
||||
|
||||
@@ -1163,9 +1163,9 @@ INTRODUCTION:
|
||||
|
||||
- long chtype extended to non-Unix ports
|
||||
|
||||
The name of the statically built library is pdcurses.lib (or
|
||||
pdcurses.a). The name of the DLL import library (where applicable) is
|
||||
curses.lib.
|
||||
The name of the statically built library is pdcurses.lib (or
|
||||
pdcurses.a). The name of the DLL import library (where applicable) is
|
||||
curses.lib.
|
||||
|
||||
BUGS FIXED:
|
||||
|
||||
@@ -1187,30 +1187,30 @@ NEW COMPILER SUPPORT:
|
||||
|
||||
EXTRA OPTIONS:
|
||||
|
||||
PDCurses recognizes two environment variables which determines the
|
||||
initialization and finalization behavior. These environment variables
|
||||
do not apply to the X11 port.
|
||||
PDCurses recognizes two environment variables which determines the
|
||||
initialization and finalization behavior. These environment variables
|
||||
do not apply to the X11 port.
|
||||
|
||||
PDC_PRESERVE_SCREEN
|
||||
If this environment variable is set, PDCurses will not clear the screen
|
||||
to the default white on black on startup. This allows you to overlay
|
||||
a window over the top of the existing screen background.
|
||||
PDC_PRESERVE_SCREEN -
|
||||
If this environment variable is set, PDCurses will not clear the screen
|
||||
to the default white on black on startup. This allows you to overlay
|
||||
a window over the top of the existing screen background.
|
||||
|
||||
PDC_RESTORE_SCREEN
|
||||
If this environment variable is set, PDCurses will take a copy of the
|
||||
contents of the screen at the time that PDCurses is started; initscr(),
|
||||
and when endwin() is called, the screen will be restored.
|
||||
PDC_RESTORE_SCREEN -
|
||||
If this environment variable is set, PDCurses will take a copy of the
|
||||
contents of the screen at the time that PDCurses is started; initscr(),
|
||||
and when endwin() is called, the screen will be restored.
|
||||
|
||||
|
||||
ACKNOWLEDGEMENTS: (for this release)
|
||||
|
||||
Chris Szurgot for original Win32 port.
|
||||
Gurusamy Sarathy for some updates to the Win32 port.
|
||||
Kim Huron for the slk..() functions.
|
||||
Florian Grosse Coosmann for some bug fixes.
|
||||
Esa Peuha for reducing compiler warnings.
|
||||
Augustin Martin Domingo for patches to X11 port to enable accented
|
||||
characters.
|
||||
- Chris Szurgot for original Win32 port.
|
||||
- Gurusamy Sarathy for some updates to the Win32 port.
|
||||
- Kim Huron for the slk..() functions.
|
||||
- Florian Grosse Coosmann for some bug fixes.
|
||||
- Esa Peuha for reducing compiler warnings.
|
||||
- Augustin Martin Domingo for patches to X11 port to enable accented
|
||||
characters.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -1242,7 +1242,7 @@ BUGS FIXED:
|
||||
- mvwin() checked the wrong coordinates
|
||||
|
||||
- removed DESQview shadow memory buffer checking bug in curses.h in
|
||||
#define for wstandout()
|
||||
\#define for wstandout()
|
||||
|
||||
- lots of others I can't remember
|
||||
|
||||
@@ -1444,10 +1444,10 @@ DIRECTIONS:
|
||||
|
||||
where environment_options are:
|
||||
|
||||
OS (host operating system)
|
||||
COMP (compiler)
|
||||
OPT (optimized version or debug version) - optional. default Y
|
||||
TOS (target operating system) - optional. default OS
|
||||
OS (host operating system)
|
||||
COMP (compiler)
|
||||
OPT (optimized version or debug version) - optional. default Y
|
||||
TOS (target operating system) - optional. default OS
|
||||
|
||||
see the makefile for valid combinations
|
||||
|
||||
@@ -1525,14 +1525,14 @@ BUGS and UNFINISHED BUSINESS:
|
||||
|
||||
ACKNOWLEDGEMENTS:
|
||||
|
||||
John 'Frotz' Fa'atuai, the previous maintainer for providing an
|
||||
excellent base for further development.
|
||||
John Burnell <johnb@kea.am.dsir.govt.nz>, for the OS/2 port.
|
||||
John Steele, Jason (finally NOT a John) Shumate....
|
||||
for various fixes and suggestions.
|
||||
Eberhardt Mattes (author of emx) for allowing code based on his
|
||||
C library to be included with PDCurses.
|
||||
Several others for their support, moral and actual.
|
||||
- John 'Frotz' Fa'atuai, the previous maintainer for providing an
|
||||
excellent base for further development.
|
||||
- John Burnell <johnb@kea.am.dsir.govt.nz>, for the OS/2 port.
|
||||
- John Steele, Jason (finally NOT a John) Shumate....
|
||||
for various fixes and suggestions.
|
||||
- Eberhardt Mattes (author of emx) for allowing code based on his
|
||||
C library to be included with PDCurses.
|
||||
- Several others for their support, moral and actual.
|
||||
|
||||
-- Mark Hessling
|
||||
|
||||
@@ -1,133 +1,133 @@
|
||||
PDCurses Implementor's Guide
|
||||
============================
|
||||
|
||||
Version 1.3 - 200?/??/?? - notes about official ports
|
||||
Version 1.2 - 2007/07/11 - added PDC_init_pair(), PDC_pair_content(),
|
||||
version history; removed pdc_atrtab
|
||||
Version 1.1 - 2007/06/06 - minor cosmetic change
|
||||
Version 1.0 - 2007/04/01 - initial revision
|
||||
- Version 1.3 - 20??/??/?? - notes about official ports, new indentation
|
||||
style; markdown
|
||||
- Version 1.2 - 2007/07/11 - added PDC_init_pair(), PDC_pair_content(),
|
||||
version history; removed pdc_atrtab
|
||||
- Version 1.1 - 2007/06/06 - minor cosmetic change
|
||||
- Version 1.0 - 2007/04/01 - initial revision
|
||||
|
||||
This document is for those wishing to port PDCurses to a new platform,
|
||||
or just wanting to better understand how it works. Nothing here should
|
||||
be needed for application programming; for that, refer to PDCurses.txt,
|
||||
as built in doc/, or distributed as a file separate from this source
|
||||
package. This document assumes that you've read the user-level
|
||||
documentation and are very familiar with application-level curses
|
||||
This document is for those wishing to port PDCurses to a new platform,
|
||||
or just wanting to better understand how it works. Nothing here should
|
||||
be needed for application programming; for that, refer to PDCurses.md,
|
||||
as built in doc/, or distributed as a file separate from this source
|
||||
package. This document assumes that you've read the user-level
|
||||
documentation and are very familiar with application-level curses
|
||||
programming.
|
||||
|
||||
If you want to submit your port for possible inclusion into the main
|
||||
If you want to submit your port for possible inclusion into the main
|
||||
PDCurses distribution, please follow these guidelines:
|
||||
|
||||
- Don't modify anything in the pdcurses directory or in other port
|
||||
directories. Don't modify curses.h or curspriv.h unless absolutely
|
||||
- Don't modify anything in the pdcurses directory or in other port
|
||||
directories. Don't modify curses.h or curspriv.h unless absolutely
|
||||
necessary. (And prefer modifying curspriv.h over curses.h.)
|
||||
|
||||
- Use the same indentation style, naming and scope conventions as the
|
||||
- Use the same indentation style, naming and scope conventions as the
|
||||
existing code.
|
||||
|
||||
- Release all your code to the public domain -- no copyright. Code
|
||||
- Release all your code to the public domain -- no copyright. Code
|
||||
under GPL, BSD, etc. will not be accepted.
|
||||
|
||||
|
||||
DATA STRUCTURES
|
||||
---------------
|
||||
Data Structures
|
||||
===============
|
||||
|
||||
A port of PDCurses must provide acs_map[], a 128-element array of
|
||||
chtypes, with values laid out based on the Alternate Character Set of
|
||||
the VT100 (see curses.h). PDC_transform_line() must use this table; when
|
||||
it encounters a chtype with the A_ALTCHARSET flag set, and an A_CHARTEXT
|
||||
value in the range 0-127, it must render it using the A_CHARTEXT portion
|
||||
of the corresponding value from this table, instead of the original
|
||||
value. Also, values may be read from this table by apps, and passed
|
||||
through functions such as waddch(), which does no special processing on
|
||||
control characters (0-31 and 127) when the A_ALTCHARSET flag is set.
|
||||
Thus, any control characters used in acs_map[] should also have the
|
||||
A_ALTCHARSET flag set. Implementations should provide suitable values
|
||||
for all the ACS_ macros defined in curses.h; other values in the table
|
||||
should be filled with their own indices (e.g., acs_map['E'] == 'E'). The
|
||||
table can be either hardwired, or filled by PDC_scr_open(). Existing
|
||||
A port of PDCurses must provide acs_map[], a 128-element array of
|
||||
chtypes, with values laid out based on the Alternate Character Set of
|
||||
the VT100 (see curses.h). PDC_transform_line() must use this table; when
|
||||
it encounters a chtype with the A_ALTCHARSET flag set, and an A_CHARTEXT
|
||||
value in the range 0-127, it must render it using the A_CHARTEXT portion
|
||||
of the corresponding value from this table, instead of the original
|
||||
value. Also, values may be read from this table by apps, and passed
|
||||
through functions such as waddch(), which does no special processing on
|
||||
control characters (0-31 and 127) when the A_ALTCHARSET flag is set.
|
||||
Thus, any control characters used in acs_map[] should also have the
|
||||
A_ALTCHARSET flag set. Implementations should provide suitable values
|
||||
for all the ACS_ macros defined in curses.h; other values in the table
|
||||
should be filled with their own indices (e.g., acs_map['E'] == 'E'). The
|
||||
table can be either hardwired, or filled by PDC_scr_open(). Existing
|
||||
ports define it in pdcdisp.c, but this is not required.
|
||||
|
||||
|
||||
FUNCTIONS
|
||||
---------
|
||||
Functions
|
||||
=========
|
||||
|
||||
A port of PDCurses must implement the following functions, with extern
|
||||
scope. These functions are traditionally divided into several modules,
|
||||
as indicated below; this division is not required (only the functions
|
||||
are), but may make it easier to follow for someone familiar with the
|
||||
A port of PDCurses must implement the following functions, with extern
|
||||
scope. These functions are traditionally divided into several modules,
|
||||
as indicated below; this division is not required (only the functions
|
||||
are), but may make it easier to follow for someone familiar with the
|
||||
existing ports.
|
||||
|
||||
Any other functions you create as part of your implementation should
|
||||
have static scope, if possible. If they can't be static, they should be
|
||||
named with the "PDC_" prefix. This minimizes the risk of collision with
|
||||
Any other functions you create as part of your implementation should
|
||||
have static scope, if possible. If they can't be static, they should be
|
||||
named with the "PDC_" prefix. This minimizes the risk of collision with
|
||||
an application's choices.
|
||||
|
||||
Current PDCurses style also uses a single leading underscore with the
|
||||
name of any static function; and modified BSD/Allman-style indentation,
|
||||
approximately equivalent to "indent -kr -i8 -bl -bli0", with adjustments
|
||||
to keep every line under 80 columns. This isn't essential, but a
|
||||
consistent style helps readability.
|
||||
Current PDCurses style also uses a single leading underscore with the
|
||||
name of any static function; and modified BSD/Allman-style indentation,
|
||||
approximately equivalent to "indent -kr -nut -bl -bli0", with
|
||||
adjustments to keep every line under 80 columns.
|
||||
|
||||
|
||||
pdcdisp.c:
|
||||
----------
|
||||
|
||||
void PDC_gotoyx(int y, int x);
|
||||
### void PDC_gotoyx(int y, int x);
|
||||
|
||||
Move the physical cursor (as opposed to the logical cursor affected by
|
||||
wmove()) to the given location. This is called mainly from doupdate().
|
||||
In general, this function need not compare the old location with the new
|
||||
Move the physical cursor (as opposed to the logical cursor affected by
|
||||
wmove()) to the given location. This is called mainly from doupdate().
|
||||
In general, this function need not compare the old location with the new
|
||||
one, and should just move the cursor unconditionally.
|
||||
|
||||
void PDC_transform_line(int lineno, int x, int len, const chtype *srcp);
|
||||
### void PDC_transform_line(int lineno, int x, int len, const chtype *srcp);
|
||||
|
||||
The core output routine. It takes len chtype entities from srcp (a
|
||||
pointer into curscr) and renders them to the physical screen at line
|
||||
lineno, column x. It must also translate characters 0-127 via acs_map[],
|
||||
if they're flagged with A_ALTCHARSET in the attribute portion of the
|
||||
The core output routine. It takes len chtype entities from srcp (a
|
||||
pointer into curscr) and renders them to the physical screen at line
|
||||
lineno, column x. It must also translate characters 0-127 via acs_map[],
|
||||
if they're flagged with A_ALTCHARSET in the attribute portion of the
|
||||
chtype.
|
||||
|
||||
|
||||
pdcgetsc.c:
|
||||
-----------
|
||||
|
||||
int PDC_get_columns(void);
|
||||
### int PDC_get_columns(void);
|
||||
|
||||
Returns the size of the screen in columns. It's used in resize_term() to
|
||||
set the new value of COLS. (Some existing implementations also call it
|
||||
Returns the size of the screen in columns. It's used in resize_term() to
|
||||
set the new value of COLS. (Some existing implementations also call it
|
||||
internally from PDC_scr_open(), but this is not required.)
|
||||
|
||||
int PDC_get_cursor_mode(void);
|
||||
### int PDC_get_cursor_mode(void);
|
||||
|
||||
Returns the size/shape of the cursor. The format of the result is
|
||||
unspecified, except that it must be returned as an int. This function is
|
||||
called from initscr(), and the result is stored in SP->orig_cursor,
|
||||
which is used by PDC_curs_set() to determine the size/shape of the
|
||||
Returns the size/shape of the cursor. The format of the result is
|
||||
unspecified, except that it must be returned as an int. This function is
|
||||
called from initscr(), and the result is stored in SP->orig_cursor,
|
||||
which is used by PDC_curs_set() to determine the size/shape of the
|
||||
cursor in normal visibility mode (curs_set(1)).
|
||||
|
||||
int PDC_get_rows(void);
|
||||
### int PDC_get_rows(void);
|
||||
|
||||
Returns the size of the screen in rows. It's used in resize_term() to
|
||||
set the new value of LINES. (Some existing implementations also call it
|
||||
Returns the size of the screen in rows. It's used in resize_term() to
|
||||
set the new value of LINES. (Some existing implementations also call it
|
||||
internally from PDC_scr_open(), but this is not required.)
|
||||
|
||||
|
||||
pdckbd.c:
|
||||
---------
|
||||
|
||||
bool PDC_check_key(void);
|
||||
### bool PDC_check_key(void);
|
||||
|
||||
Keyboard/mouse event check, called from wgetch(). Returns TRUE if
|
||||
there's an event ready to process. This function must be non-blocking.
|
||||
|
||||
void PDC_flushinp(void);
|
||||
### void PDC_flushinp(void);
|
||||
|
||||
This is the core of flushinp(). It discards any pending key or mouse
|
||||
events, removing them from any internal queue and from the OS queue, if
|
||||
applicable.
|
||||
|
||||
int PDC_get_key(void);
|
||||
### int PDC_get_key(void);
|
||||
|
||||
Get the next available key, or mouse event (indicated by a return of
|
||||
KEY_MOUSE), and remove it from the OS' input queue, if applicable. This
|
||||
@@ -146,180 +146,182 @@ happen on key up. But if this is not possible, it may return the
|
||||
modifier keys on key down (if and only if SP->return_key_modifiers is
|
||||
TRUE).
|
||||
|
||||
int PDC_modifiers_set(void);
|
||||
### int PDC_modifiers_set(void);
|
||||
|
||||
Called from PDC_return_key_modifiers(). If your platform needs to do
|
||||
anything in response to a change in SP->return_key_modifiers, do it
|
||||
Called from PDC_return_key_modifiers(). If your platform needs to do
|
||||
anything in response to a change in SP->return_key_modifiers, do it
|
||||
here. Returns OK or ERR, which is passed on by the caller.
|
||||
|
||||
int PDC_mouse_set(void);
|
||||
### int PDC_mouse_set(void);
|
||||
|
||||
Called by mouse_set(), mouse_on(), and mouse_off() -- all the functions
|
||||
that modify SP->_trap_mbe. If your platform needs to do anything in
|
||||
response to a change in SP->_trap_mbe (for example, turning the mouse
|
||||
cursor on or off), do it here. Returns OK or ERR, which is passed on by
|
||||
Called by mouse_set(), mouse_on(), and mouse_off() -- all the functions
|
||||
that modify SP->_trap_mbe. If your platform needs to do anything in
|
||||
response to a change in SP->_trap_mbe (for example, turning the mouse
|
||||
cursor on or off), do it here. Returns OK or ERR, which is passed on by
|
||||
the caller.
|
||||
|
||||
void PDC_set_keyboard_binary(bool on);
|
||||
### void PDC_set_keyboard_binary(bool on);
|
||||
|
||||
Set keyboard input to "binary" mode. If you need to do something to keep
|
||||
the OS from processing ^C, etc. on your platform, do it here. TRUE turns
|
||||
the mode on; FALSE reverts it. This function is called from raw() and
|
||||
Set keyboard input to "binary" mode. If you need to do something to keep
|
||||
the OS from processing ^C, etc. on your platform, do it here. TRUE turns
|
||||
the mode on; FALSE reverts it. This function is called from raw() and
|
||||
noraw().
|
||||
|
||||
|
||||
pdcscrn.c:
|
||||
----------
|
||||
|
||||
bool PDC_can_change_color(void);
|
||||
### bool PDC_can_change_color(void);
|
||||
|
||||
Returns TRUE if init_color() and color_content() give meaningful
|
||||
Returns TRUE if init_color() and color_content() give meaningful
|
||||
results, FALSE otherwise. Called from can_change_color().
|
||||
|
||||
int PDC_color_content(short color, short *red, short *green, short *blue);
|
||||
### int PDC_color_content(short color, short *red, short *green, short *blue);
|
||||
|
||||
The core of color_content(). This does all the work of that function,
|
||||
The core of color_content(). This does all the work of that function,
|
||||
except checking for values out of range and null pointers.
|
||||
|
||||
int PDC_init_color(short color, short red, short green, short blue);
|
||||
### int PDC_init_color(short color, short red, short green, short blue);
|
||||
|
||||
The core of init_color(). This does all the work of that function,
|
||||
The core of init_color(). This does all the work of that function,
|
||||
except checking for values out of range.
|
||||
|
||||
void PDC_init_pair(short pair, short fg, short bg);
|
||||
### void PDC_init_pair(short pair, short fg, short bg);
|
||||
|
||||
The core of init_pair(). This does all the work of that function, except
|
||||
checking for values out of range. The values passed to this function
|
||||
should be returned by a call to PDC_pair_content() with the same pair
|
||||
number. PDC_transform_line() should use the specified colors when
|
||||
The core of init_pair(). This does all the work of that function, except
|
||||
checking for values out of range. The values passed to this function
|
||||
should be returned by a call to PDC_pair_content() with the same pair
|
||||
number. PDC_transform_line() should use the specified colors when
|
||||
rendering a chtype with the given pair number.
|
||||
|
||||
int PDC_pair_content(short pair, short *fg, short *bg);
|
||||
### int PDC_pair_content(short pair, short *fg, short *bg);
|
||||
|
||||
The core of pair_content(). This does all the work of that function,
|
||||
The core of pair_content(). This does all the work of that function,
|
||||
except checking for values out of range and null pointers.
|
||||
|
||||
void PDC_reset_prog_mode(void);
|
||||
### void PDC_reset_prog_mode(void);
|
||||
|
||||
The non-portable functionality of reset_prog_mode() is handled here --
|
||||
whatever's not done in _restore_mode(). In current ports: In OS/2, this
|
||||
sets the keyboard to binary mode; in Win32, it enables or disables the
|
||||
The non-portable functionality of reset_prog_mode() is handled here --
|
||||
whatever's not done in _restore_mode(). In current ports: In OS/2, this
|
||||
sets the keyboard to binary mode; in Win32, it enables or disables the
|
||||
mouse pointer to match the saved mode; in others it does nothing.
|
||||
|
||||
void PDC_reset_shell_mode(void);
|
||||
### void PDC_reset_shell_mode(void);
|
||||
|
||||
The same thing, for reset_shell_mode(). In OS/2 and Win32, it restores
|
||||
The same thing, for reset_shell_mode(). In OS/2 and Win32, it restores
|
||||
the default console mode; in others it does nothing.
|
||||
|
||||
int PDC_resize_screen(int nlines, int ncols);
|
||||
### int PDC_resize_screen(int nlines, int ncols);
|
||||
|
||||
This does the main work of resize_term(). It may respond to non-zero
|
||||
parameters, by setting the screen to the specified size; to zero
|
||||
parameters, by setting the screen to a size chosen by the user at
|
||||
runtime, in an unspecified way (e.g., by dragging the edges of the
|
||||
window); or both. It may also do nothing, if there's no appropriate
|
||||
This does the main work of resize_term(). It may respond to non-zero
|
||||
parameters, by setting the screen to the specified size; to zero
|
||||
parameters, by setting the screen to a size chosen by the user at
|
||||
runtime, in an unspecified way (e.g., by dragging the edges of the
|
||||
window); or both. It may also do nothing, if there's no appropriate
|
||||
action for the platform.
|
||||
|
||||
void PDC_restore_screen_mode(int i);
|
||||
### void PDC_restore_screen_mode(int i);
|
||||
|
||||
Called from _restore_mode() in kernel.c, this function does the actual
|
||||
Called from _restore_mode() in kernel.c, this function does the actual
|
||||
mode changing, if applicable. Currently used only in DOS and OS/2.
|
||||
|
||||
void PDC_save_screen_mode(int i);
|
||||
### void PDC_save_screen_mode(int i);
|
||||
|
||||
Called from _save_mode() in kernel.c, this function saves the actual
|
||||
Called from _save_mode() in kernel.c, this function saves the actual
|
||||
screen mode, if applicable. Currently used only in DOS and OS/2.
|
||||
|
||||
void PDC_scr_close(void);
|
||||
### void PDC_scr_close(void);
|
||||
|
||||
The platform-specific part of endwin(). It may restore the image of the
|
||||
original screen saved by PDC_scr_open(), if the PDC_RESTORE_SCREEN
|
||||
environment variable is set; either way, if using an existing terminal,
|
||||
this function should restore it to the mode it had at startup, and move
|
||||
The platform-specific part of endwin(). It may restore the image of the
|
||||
original screen saved by PDC_scr_open(), if the PDC_RESTORE_SCREEN
|
||||
environment variable is set; either way, if using an existing terminal,
|
||||
this function should restore it to the mode it had at startup, and move
|
||||
the cursor to the lower left corner. (The X11 port does nothing.)
|
||||
|
||||
void PDC_scr_free(void);
|
||||
### void PDC_scr_free(void);
|
||||
|
||||
Frees the memory for SP allocated by PDC_scr_open(). Called by
|
||||
Frees the memory for SP allocated by PDC_scr_open(). Called by
|
||||
delscreen().
|
||||
|
||||
int PDC_scr_open(int argc, char **argv);
|
||||
### int PDC_scr_open(int argc, char **argv);
|
||||
|
||||
The platform-specific part of initscr(). It's actually called from
|
||||
Xinitscr(); the arguments, if present, correspond to those used with
|
||||
main(), and may be used to set the title of the terminal window, or for
|
||||
other, platform-specific purposes. (The arguments are currently used
|
||||
only in X11.) PDC_scr_open() must allocate memory for SP, and must
|
||||
initialize acs_map[] (unless it's preset) and several members of SP,
|
||||
including lines, cols, mouse_wait, orig_attr (and if orig_attr is TRUE,
|
||||
orig_fore and orig_back), mono, _restore and _preserve. (Although SP is
|
||||
used the same way in all ports, it's allocated here in order to allow
|
||||
the X11 port to map it to a block of shared memory.) If using an
|
||||
existing terminal, and the environment variable PDC_RESTORE_SCREEN is
|
||||
set, this function may also store the existing screen image for later
|
||||
The platform-specific part of initscr(). It's actually called from
|
||||
Xinitscr(); the arguments, if present, correspond to those used with
|
||||
main(), and may be used to set the title of the terminal window, or for
|
||||
other, platform-specific purposes. (The arguments are currently used
|
||||
only in X11.) PDC_scr_open() must allocate memory for SP, and must
|
||||
initialize acs_map[] (unless it's preset) and several members of SP,
|
||||
including lines, cols, mouse_wait, orig_attr (and if orig_attr is TRUE,
|
||||
orig_fore and orig_back), mono, _restore and _preserve. (Although SP is
|
||||
used the same way in all ports, it's allocated here in order to allow
|
||||
the X11 port to map it to a block of shared memory.) If using an
|
||||
existing terminal, and the environment variable PDC_RESTORE_SCREEN is
|
||||
set, this function may also store the existing screen image for later
|
||||
restoration by PDC_scr_close().
|
||||
|
||||
|
||||
pdcsetsc.c:
|
||||
-----------
|
||||
|
||||
int PDC_curs_set(int visibility);
|
||||
### int PDC_curs_set(int visibility);
|
||||
|
||||
Called from curs_set(). Changes the appearance of the cursor -- 0 turns
|
||||
it off, 1 is normal (the terminal's default, if applicable, as
|
||||
determined by SP->orig_cursor), and 2 is high visibility. The exact
|
||||
Called from curs_set(). Changes the appearance of the cursor -- 0 turns
|
||||
it off, 1 is normal (the terminal's default, if applicable, as
|
||||
determined by SP->orig_cursor), and 2 is high visibility. The exact
|
||||
appearance of these modes is not specified.
|
||||
|
||||
|
||||
pdcutil.c:
|
||||
----------
|
||||
|
||||
void PDC_beep(void);
|
||||
### void PDC_beep(void);
|
||||
|
||||
Emits a short audible beep. If this is not possible on your platform,
|
||||
you must set SP->audible to FALSE during initialization (i.e., from
|
||||
PDC_scr_open() -- not here); otherwise, set it to TRUE. This function is
|
||||
Emits a short audible beep. If this is not possible on your platform,
|
||||
you must set SP->audible to FALSE during initialization (i.e., from
|
||||
PDC_scr_open() -- not here); otherwise, set it to TRUE. This function is
|
||||
called from beep().
|
||||
|
||||
void PDC_napms(int ms);
|
||||
### void PDC_napms(int ms);
|
||||
|
||||
This is the core delay routine, called by napms(). It pauses for about
|
||||
(the X/Open spec says "at least") ms milliseconds, then returns. High
|
||||
degrees of accuracy and precision are not expected (though desirable, if
|
||||
you can achieve them). More important is that this function gives back
|
||||
the process' time slice to the OS, so that PDCurses idles at low CPU
|
||||
This is the core delay routine, called by napms(). It pauses for about
|
||||
(the X/Open spec says "at least") ms milliseconds, then returns. High
|
||||
degrees of accuracy and precision are not expected (though desirable, if
|
||||
you can achieve them). More important is that this function gives back
|
||||
the process' time slice to the OS, so that PDCurses idles at low CPU
|
||||
usage.
|
||||
|
||||
const char *PDC_sysname(void);
|
||||
### const char *PDC_sysname(void);
|
||||
|
||||
Returns a short string describing the platform, such as "DOS" or "X11".
|
||||
This is used by longname(). It must be no more than 100 characters; it
|
||||
Returns a short string describing the platform, such as "DOS" or "X11".
|
||||
This is used by longname(). It must be no more than 100 characters; it
|
||||
should be much, much shorter (existing platforms use no more than 5).
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
The following functions are implemented in the platform directories, but
|
||||
are accessed directly by apps. Refer to the user documentation for their
|
||||
More functions
|
||||
==============
|
||||
|
||||
The following functions are implemented in the platform directories, but
|
||||
are accessed directly by apps. Refer to the user documentation for their
|
||||
descriptions:
|
||||
|
||||
|
||||
pdcclip.c:
|
||||
----------
|
||||
|
||||
int PDC_clearclipboard(void);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
### int PDC_clearclipboard(void);
|
||||
### int PDC_freeclipboard(char *contents);
|
||||
### int PDC_getclipboard(char **contents, long *length);
|
||||
### int PDC_setclipboard(const char *contents, long length);
|
||||
|
||||
|
||||
pdckbd.c:
|
||||
---------
|
||||
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
### unsigned long PDC_get_input_fd(void);
|
||||
|
||||
|
||||
pdcsetsc.c:
|
||||
-----------
|
||||
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
### int PDC_set_blink(bool blinkon);
|
||||
### void PDC_set_title(const char *title);
|
||||
27
Makefile
Normal file
27
Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
# Make archives for distribution
|
||||
|
||||
include version.mif
|
||||
|
||||
PDC_DIR=PDCurses-$(VERDOT)
|
||||
|
||||
ZIPFILE = pdcurs$(VER).zip
|
||||
TARBALL = $(PDC_DIR).tar.gz
|
||||
|
||||
all:
|
||||
@echo Look in folders for platform-specific build instructions.
|
||||
|
||||
manual:
|
||||
cd doc; $(MAKE) $(MFLAGS) $@
|
||||
|
||||
$(ZIPFILE):
|
||||
zip -9ory $(ZIPFILE) *
|
||||
|
||||
zip: $(ZIPFILE)
|
||||
|
||||
../$(TARBALL):
|
||||
(cd ..; tar cvf - $(PDC_DIR)/* | gzip -9 > $(TARBALL))
|
||||
|
||||
dist: ../$(TARBALL)
|
||||
|
||||
rpm: ../$(TARBALL)
|
||||
rpmbuild -ba x11/PDCurses.spec
|
||||
108
Makefile.in
108
Makefile.in
@@ -1,108 +0,0 @@
|
||||
# Makefile for PDCurses library for X11
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir =@srcdir@
|
||||
prefix =@prefix@
|
||||
exec_prefix =$(DESTDIR)@exec_prefix@
|
||||
libdir =$(exec_prefix)/lib
|
||||
bindir =$(exec_prefix)/bin
|
||||
includedir =$(exec_prefix)/include
|
||||
pdcursesdir =./x11
|
||||
|
||||
INSTALL =$(srcdir)/install-sh
|
||||
RANLIB =@RANLIB@
|
||||
SHLPRE = @SHLPRE@
|
||||
SHLPST = @SHLPST@
|
||||
SHLFILE = XCurses
|
||||
|
||||
include $(srcdir)/version.mif
|
||||
|
||||
PDC_DIR=PDCurses-$(VERDOT)
|
||||
|
||||
ZIPFILE = pdcurs$(VER).zip
|
||||
TARBALL = $(PDC_DIR).tar.gz
|
||||
|
||||
all \
|
||||
clean \
|
||||
distclean \
|
||||
mostlyclean \
|
||||
realclean ::
|
||||
cd x11; $(MAKE) $(MFLAGS) $@
|
||||
cd doc; $(MAKE) $(MFLAGS) $@
|
||||
|
||||
install ::
|
||||
$(INSTALL) -d -m 755 $(libdir)
|
||||
$(INSTALL) -d -m 755 $(bindir)
|
||||
$(INSTALL) -d -m 755 $(includedir)
|
||||
$(INSTALL) -d -m 755 $(includedir)/xcurses
|
||||
$(INSTALL) -c -m 644 $(srcdir)/curses.h $(includedir)/xcurses.h
|
||||
$(INSTALL) -c -m 644 $(srcdir)/curses.h $(includedir)/xcurses/curses.h
|
||||
sed -e 's/#include <curses.h>/#include <xcurses.h>/' \
|
||||
< $(srcdir)/panel.h > ./xpanel.h
|
||||
$(INSTALL) -m 644 ./xpanel.h $(includedir)/xpanel.h
|
||||
$(INSTALL) -c -m 644 $(srcdir)/panel.h $(includedir)/xcurses/panel.h
|
||||
$(INSTALL) -c -m 644 $(srcdir)/term.h $(includedir)/xcurses/term.h
|
||||
$(INSTALL) -c -m 644 $(pdcursesdir)/libXCurses.a $(libdir)/libXCurses.a
|
||||
-$(RANLIB) $(libdir)/libXCurses.a
|
||||
-$(INSTALL) -c -m 755 $(pdcursesdir)/$(SHLPRE)$(SHLFILE)$(SHLPST) \
|
||||
$(libdir)/$(SHLPRE)$(SHLFILE)$(SHLPST)
|
||||
ln -f -s $(libdir)/$(SHLPRE)$(SHLFILE)$(SHLPST) \
|
||||
$(libdir)/$(SHLPRE)Xpanel$(SHLPST)
|
||||
ln -f -s $(libdir)/libXCurses.a $(libdir)/libXpanel.a
|
||||
-$(RANLIB) $(libdir)/libXpanel.a
|
||||
$(INSTALL) -c -m 755 x11/xcurses-config $(bindir)/xcurses-config
|
||||
|
||||
clean ::
|
||||
rm -f config.log config.cache config.status
|
||||
|
||||
distclean ::
|
||||
rm -f config.log config.cache config.status
|
||||
rm -f config.h Makefile x11/xcurses-config
|
||||
|
||||
manual:
|
||||
cd doc; $(MAKE) $(MFLAGS) $@
|
||||
|
||||
$(ZIPFILE):
|
||||
zip -9y $(ZIPFILE) README HISTORY IMPLEMNT *.spec *.mif *.def \
|
||||
Makefile.in config.h.in configure configure.ac config.guess \
|
||||
config.sub x11/xcurses-config.in install-sh aclocal.m4 curses.h \
|
||||
curspriv.h panel.h term.h pdcurses/README \
|
||||
pdcurses/*.c demos/README demos/*.c demos/*.h dos/README dos/*.c \
|
||||
dos/*.h dos/*.mak dos/*.lrf os2/README os2/*.c os2/*.h os2/*.mak \
|
||||
os2/*.lrf sdl1/README sdl1/*.c sdl1/*.h sdl1/Make* \
|
||||
win32/README win32/*.c win32/*.h win32/*.mak \
|
||||
win32/*.ico win32/*.rc x11/README x11/*.c x11/*.h x11/Makefile.* \
|
||||
x11/*.xbm doc/*.txt doc/manext.c doc/Makefile
|
||||
|
||||
zip: $(ZIPFILE)
|
||||
|
||||
../$(TARBALL):
|
||||
(cd ..; tar cvf - $(PDC_DIR)/README $(PDC_DIR)/HISTORY \
|
||||
$(PDC_DIR)/IMPLEMNT $(PDC_DIR)/*.spec $(PDC_DIR)/*.mif \
|
||||
$(PDC_DIR)/*.def $(PDC_DIR)/Makefile.in $(PDC_DIR)/aclocal.m4 \
|
||||
$(PDC_DIR)/config.h.in $(PDC_DIR)/configure \
|
||||
$(PDC_DIR)/config.guess $(PDC_DIR)/x11/xcurses-config.in \
|
||||
$(PDC_DIR)/config.sub $(PDC_DIR)/configure.ac \
|
||||
$(PDC_DIR)/install-sh $(PDC_DIR)/curses.h $(PDC_DIR)/curspriv.h \
|
||||
$(PDC_DIR)/panel.h $(PDC_DIR)/term.h \
|
||||
$(PDC_DIR)/pdcurses/README $(PDC_DIR)/pdcurses/*.c \
|
||||
$(PDC_DIR)/demos/README $(PDC_DIR)/demos/*.c $(PDC_DIR)/demos/*.h \
|
||||
$(PDC_DIR)/doc/*.txt $(PDC_DIR)/dos/README $(PDC_DIR)/dos/*.c \
|
||||
$(PDC_DIR)/dos/*.h $(PDC_DIR)/dos/*.mak $(PDC_DIR)/dos/*.lrf \
|
||||
$(PDC_DIR)/os2/README $(PDC_DIR)/os2/*.c $(PDC_DIR)/os2/*.h \
|
||||
$(PDC_DIR)/os2/*.mak $(PDC_DIR)/os2/*.lrf \
|
||||
$(PDC_DIR)/sdl1/README $(PDC_DIR)/sdl1/*.c $(PDC_DIR)/sdl1/*.h \
|
||||
$(PDC_DIR)/sdl1/Make* $(PDC_DIR)/win32/README $(PDC_DIR)/win32/*.c \
|
||||
$(PDC_DIR)/win32/*.h $(PDC_DIR)/win32/*.mak \
|
||||
$(PDC_DIR)/win32/*.ico $(PDC_DIR)/win32/*.rc $(PDC_DIR)/x11/README \
|
||||
$(PDC_DIR)/x11/*.c $(PDC_DIR)/x11/*.xbm $(PDC_DIR)/x11/*.h \
|
||||
$(PDC_DIR)/x11/Makefile.* $(PDC_DIR)/doc/manext.c \
|
||||
$(PDC_DIR)/doc/Makefile | gzip -9 > $(TARBALL))
|
||||
|
||||
dist: ../$(TARBALL)
|
||||
|
||||
rpm: ../$(TARBALL)
|
||||
rpmbuild -ba $(srcdir)/PDCurses.spec
|
||||
@@ -4,9 +4,9 @@ Welcome to PDCurses!
|
||||
Public Domain Curses, aka PDCurses, is an implementation of X/Open
|
||||
curses for multiple platforms. The latest version can be found at:
|
||||
|
||||
http://pdcurses.sourceforge.net/
|
||||
http://pdcurses.org/
|
||||
|
||||
For changes, see the HISTORY file.
|
||||
For changes, see the [HISTORY](HISTORY.md) file.
|
||||
|
||||
|
||||
Legal Stuff
|
||||
@@ -30,8 +30,15 @@ Ports
|
||||
|
||||
PDCurses has been ported to DOS, OS/2, Win32, X11 and SDL. A directory
|
||||
containing the port-specific source files exists for each of these
|
||||
platforms. Build instructions are in the README file for each platform.
|
||||
platforms.
|
||||
|
||||
Build instructions are in the README file for each platform:
|
||||
|
||||
- [DOS](dos/README.md)
|
||||
- [OS/2](os2/README.md)
|
||||
- [SDL](sdl1/README.md)
|
||||
- [Win32](win32/README.md)
|
||||
- [X11](x11/README.md)
|
||||
|
||||
Distribution Status
|
||||
-------------------
|
||||
@@ -45,4 +52,4 @@ described within it.
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
William McBrine <wmcbrine@users.sf.net>
|
||||
William McBrine <wmcbrine@gmail.com>
|
||||
30
curses.h
30
curses.h
@@ -1,7 +1,5 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: curses.h,v 1.295 2008/07/15 17:13:25 wmcbrine Exp $ */
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* PDCurses *
|
||||
*----------------------------------------------------------------------*/
|
||||
@@ -142,12 +140,16 @@ typedef struct
|
||||
* 10000 <- mouse position report
|
||||
* 100000 <- mouse wheel up
|
||||
* 1000000 <- mouse wheel down
|
||||
* 10000000 <- mouse wheel left
|
||||
* 100000000 <- mouse wheel right
|
||||
*/
|
||||
|
||||
#define PDC_MOUSE_MOVED 0x0008
|
||||
#define PDC_MOUSE_POSITION 0x0010
|
||||
#define PDC_MOUSE_WHEEL_UP 0x0020
|
||||
#define PDC_MOUSE_WHEEL_DOWN 0x0040
|
||||
#define PDC_MOUSE_WHEEL_LEFT 0x0080
|
||||
#define PDC_MOUSE_WHEEL_RIGHT 0x0100
|
||||
|
||||
#define A_BUTTON_CHANGED (Mouse_status.changes & 7)
|
||||
#define MOUSE_MOVED (Mouse_status.changes & PDC_MOUSE_MOVED)
|
||||
@@ -156,6 +158,8 @@ typedef struct
|
||||
#define BUTTON_STATUS(x) (Mouse_status.button[(x) - 1])
|
||||
#define MOUSE_WHEEL_UP (Mouse_status.changes & PDC_MOUSE_WHEEL_UP)
|
||||
#define MOUSE_WHEEL_DOWN (Mouse_status.changes & PDC_MOUSE_WHEEL_DOWN)
|
||||
#define MOUSE_WHEEL_LEFT (Mouse_status.changes & PDC_MOUSE_WHEEL_LEFT)
|
||||
#define MOUSE_WHEEL_RIGHT (Mouse_status.changes & PDC_MOUSE_WHEEL_RIGHT)
|
||||
|
||||
/* mouse bit-masks */
|
||||
|
||||
@@ -365,10 +369,10 @@ The following is the structure of a win->_attrs chtype:
|
||||
|
||||
short form:
|
||||
|
||||
-------------------------------------------------
|
||||
|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
|
||||
-------------------------------------------------
|
||||
color number | attrs | character eg 'a'
|
||||
+-----------------------------------------------+
|
||||
|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
|
||||
+-----------------------------------------------+
|
||||
color number | attrs | character eg 'a'
|
||||
|
||||
The available non-color attributes are bold, reverse and blink. Others
|
||||
have no effect. The high order char is an index into an array of
|
||||
@@ -377,10 +381,10 @@ pairs (5 bits) plus 3 bits for other attributes.
|
||||
|
||||
long form:
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|..| 3| 2| 1| 0|
|
||||
----------------------------------------------------------------------------
|
||||
color number | modifiers | character eg 'a'
|
||||
+--------------------------------------------------------------------+
|
||||
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|..| 2| 1| 0|
|
||||
+--------------------------------------------------------------------+
|
||||
color number | modifiers | character eg 'a'
|
||||
|
||||
The available non-color attributes are bold, underline, invisible,
|
||||
right-line, left-line, protect, reverse and blink. 256 color pairs (8
|
||||
@@ -409,7 +413,6 @@ bits), 8 bits for other attributes, and 16 bits for character data.
|
||||
# define A_ITALIC A_INVIS
|
||||
# define A_PROTECT (A_UNDERLINE | A_LEFTLINE | A_RIGHTLINE)
|
||||
|
||||
# define PDC_ATTR_SHIFT 19
|
||||
# define PDC_COLOR_SHIFT 24
|
||||
#else
|
||||
# define A_BOLD (chtype)0x0100 /* X/Open */
|
||||
@@ -429,7 +432,6 @@ bits), 8 bits for other attributes, and 16 bits for character data.
|
||||
# define A_ITALIC A_NORMAL
|
||||
# define A_INVIS A_NORMAL
|
||||
|
||||
# define PDC_ATTR_SHIFT 8
|
||||
# define PDC_COLOR_SHIFT 11
|
||||
#endif
|
||||
|
||||
@@ -443,6 +445,8 @@ bits), 8 bits for other attributes, and 16 bits for character data.
|
||||
/* For use with attr_t -- X/Open says, "these shall be distinct", so
|
||||
this is a non-conforming implementation. */
|
||||
|
||||
#define WA_NORMAL A_NORMAL
|
||||
|
||||
#define WA_ALTCHARSET A_ALTCHARSET
|
||||
#define WA_BLINK A_BLINK
|
||||
#define WA_BOLD A_BOLD
|
||||
@@ -460,6 +464,8 @@ bits), 8 bits for other attributes, and 16 bits for character data.
|
||||
#define WA_TOP A_NORMAL
|
||||
#define WA_VERTICAL A_NORMAL
|
||||
|
||||
#define WA_ATTRIBUTES A_ATTRIBUTES
|
||||
|
||||
/*** Alternate character set macros ***/
|
||||
|
||||
/* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: curspriv.h,v 1.158 2008/07/13 16:08:16 wmcbrine Exp $ */
|
||||
|
||||
/* Private definitions and declarations for use within PDCurses.
|
||||
These should generally not be referenced by applications. */
|
||||
|
||||
#ifndef __CURSES_INTERNALS__
|
||||
#define __CURSES_INTERNALS__ 1
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define CURSES_LIBRARY
|
||||
#include <curses.h>
|
||||
|
||||
@@ -113,10 +107,8 @@ size_t PDC_wcstombs(char *, const wchar_t *, size_t);
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
# define PDC_LOG(x) if (pdc_trace_on) PDC_debug x
|
||||
# define RCSID(x) static const char *rcsid = x;
|
||||
#else
|
||||
# define PDC_LOG(x)
|
||||
# define RCSID(x)
|
||||
#endif
|
||||
|
||||
/* Internal macros for attributes */
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* $Id: firework.c,v 1.25 2008/07/13 16:08:17 wmcbrine Exp $ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <curses.h>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* illustrates the use of colors for text output.
|
||||
*
|
||||
* Hacks by jbuhler@cs.washington.edu on 12/29/96
|
||||
*
|
||||
* $Id: newdemo.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* $Id: ptest.c,v 1.24 2008/07/13 16:08:17 wmcbrine Exp $ */
|
||||
|
||||
#include <curses.h>
|
||||
#include <panel.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: rain.c,v 1.11 2008/07/13 16:08:17 wmcbrine Exp $ */
|
||||
|
||||
#include <curses.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
*
|
||||
* wrs(5/28/93) -- modified to be consistent (perform identically)
|
||||
* with either PDCurses or under Unix System V, R4
|
||||
*
|
||||
* $Id: testcurs.c,v 1.85 2008/07/14 12:35:23 wmcbrine Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XOPEN_SOURCE_EXTENDED
|
||||
@@ -449,6 +447,10 @@ void inputTest(WINDOW *win)
|
||||
waddstr(win, "wheel up: ");
|
||||
else if (MOUSE_WHEEL_DOWN)
|
||||
waddstr(win, "wheel dn: ");
|
||||
else if (MOUSE_WHEEL_LEFT)
|
||||
waddstr(win, "wheel lt: ");
|
||||
else if (MOUSE_WHEEL_RIGHT)
|
||||
waddstr(win, "wheel rt: ");
|
||||
else if ((BUTTON_STATUS(button) &
|
||||
BUTTON_ACTION_MASK) == BUTTON_PRESSED)
|
||||
waddstr(win, "pressed: ");
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
/*
|
||||
* 'textual user interface'
|
||||
*
|
||||
* $Id: tui.c,v 1.34 2008/07/14 12:35:23 wmcbrine Exp $
|
||||
*
|
||||
* Author : P.J. Kunst <kunst@prl.philips.nl>
|
||||
* Date : 25-02-93
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* 'textual user interface'
|
||||
*
|
||||
* $Id: tui.h,v 1.11 2008/07/14 12:35:23 wmcbrine Exp $
|
||||
*
|
||||
* Author : P.J. Kunst <kunst@prl.philips.nl>
|
||||
* Date : 25-02-93
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $Id: tuidemo.c,v 1.22 2008/07/14 12:35:23 wmcbrine Exp $
|
||||
*
|
||||
* Author : P.J. Kunst <kunst@prl.philips.nl>
|
||||
* Date : 25-02-93
|
||||
*
|
||||
@@ -76,7 +74,7 @@ void showfile(char *fname)
|
||||
{
|
||||
int i, bh = bodylen();
|
||||
FILE *fp;
|
||||
char buf[MAXSTRLEN];
|
||||
char buf[MAXSTRLEN], *result;
|
||||
bool ateof = FALSE;
|
||||
|
||||
statusmsg("FileBrowser: Hit key to continue, Q to quit");
|
||||
@@ -90,9 +88,9 @@ void showfile(char *fname)
|
||||
for (i = 0; i < bh - 1 && !ateof; i++)
|
||||
{
|
||||
buf[0] = '\0';
|
||||
fgets(buf, MAXSTRLEN, fp);
|
||||
result = fgets(buf, MAXSTRLEN, fp);
|
||||
|
||||
if (strlen(buf))
|
||||
if (result && strlen(buf))
|
||||
bodymsg(buf);
|
||||
else
|
||||
ateof = TRUE;
|
||||
|
||||
@@ -50,8 +50,6 @@ Options:
|
||||
-l <n> set worm length
|
||||
-n <n> set number of worms
|
||||
-t make worms leave droppings
|
||||
|
||||
$Id: worm.c,v 1.16 2008/07/13 16:08:17 wmcbrine Exp $
|
||||
*/
|
||||
|
||||
#include <curses.h>
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/* $Id: xmas.c,v 1.29 2008/07/13 16:08:17 wmcbrine Exp $ */
|
||||
|
||||
#include <curses.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
34
doc/Makefile
34
doc/Makefile
@@ -2,25 +2,25 @@
|
||||
|
||||
all: manual
|
||||
|
||||
manual: PDCurses.txt
|
||||
manual: PDCurses.md
|
||||
|
||||
PDCurses.txt: manext
|
||||
cat intro.txt > PDCurses.txt
|
||||
echo PDCurses Definitions and Variables >> PDCurses.txt
|
||||
echo ================================== >> PDCurses.txt
|
||||
./manext ../curses.h >> PDCurses.txt
|
||||
echo PDCurses Functions >> PDCurses.txt
|
||||
echo ================== >> PDCurses.txt
|
||||
./manext ../pdcurses/*.c >> PDCurses.txt
|
||||
./manext ../x11/*.c >> PDCurses.txt
|
||||
cat x11.txt >> PDCurses.txt
|
||||
echo >> PDCurses.txt
|
||||
echo >> PDCurses.txt
|
||||
PDCurses.md: manext intro.md x11.md sdl.md ../curses.h
|
||||
cat intro.md > PDCurses.md
|
||||
echo PDCurses Definitions and Variables >> PDCurses.md
|
||||
echo ================================== >> PDCurses.md
|
||||
./manext ../curses.h >> PDCurses.md
|
||||
echo PDCurses Functions >> PDCurses.md
|
||||
echo ================== >> PDCurses.md
|
||||
./manext ../pdcurses/*.c >> PDCurses.md
|
||||
./manext ../x11/*.c >> PDCurses.md
|
||||
cat x11.md >> PDCurses.md
|
||||
echo >> PDCurses.md
|
||||
echo >> PDCurses.md
|
||||
echo \
|
||||
-------------------------------------------------------------------------- \
|
||||
>> PDCurses.txt
|
||||
echo >> PDCurses.txt
|
||||
cat sdl.txt >> PDCurses.txt
|
||||
>> PDCurses.md
|
||||
echo >> PDCurses.md
|
||||
cat sdl.md >> PDCurses.md
|
||||
|
||||
manext: manext.c
|
||||
|
||||
@@ -28,7 +28,7 @@ install:
|
||||
echo Does nothing at the moment
|
||||
|
||||
clean:
|
||||
-rm -rf *.o manext PDCurses.txt
|
||||
-rm -rf *.o manext PDCurses.md
|
||||
|
||||
distclean: clean
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
PDCurses Documentation
|
||||
======================
|
||||
|
||||
Some plain text documents to provide a basic overview of PDCurses and
|
||||
details for specific platforms, along with a program to combine them
|
||||
with the "man page" sections from the source code files, into
|
||||
"PDCurses.txt".
|
||||
Some plain text documents to provide a basic overview of PDCurses and
|
||||
details for specific platforms, along with a program to combine them
|
||||
with the "man page" sections from the source code files, into
|
||||
"PDCurses.md".
|
||||
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
. Type "make". ("make clean" to remove the built files.) A Unix-like
|
||||
environment is required for the Makefile. This is called automatically
|
||||
- Type "make". ("make clean" to remove the built files.) A Unix-like
|
||||
environment is required for the Makefile. This is called automatically
|
||||
when doing a top-level make of the X11 port.
|
||||
|
||||
|
||||
361
doc/intro.md
Normal file
361
doc/intro.md
Normal file
@@ -0,0 +1,361 @@
|
||||
PDCurses User's Guide
|
||||
=====================
|
||||
|
||||
Curses Overview
|
||||
---------------
|
||||
|
||||
The X/Open Curses Interface Definition describes a set of C-Language
|
||||
functions that provide screen-handling and updating, which are
|
||||
collectively known as the curses library.
|
||||
|
||||
The curses library permits manipulation of data structures called
|
||||
windows which may be thought of as two-dimensional arrays of
|
||||
characters representing all or part of a terminal's screen. The
|
||||
windows are manipulated using a procedural interface described
|
||||
elsewhere. The curses package maintains a record of what characters
|
||||
are on the screen. At the most basic level, manipulation is done with
|
||||
the routines move() and addch() which are used to "move" the curses
|
||||
around and add characters to the default window, stdscr, which
|
||||
represents the whole screen.
|
||||
|
||||
An application may use these routines to add data to the window in any
|
||||
convenient order. Once all data have been added, the routine
|
||||
refresh() is called. The package then determines what changes have
|
||||
been made which affect the screen. The screen contents are then
|
||||
changed to reflect those characters now in the window, using a
|
||||
sequence of operations optimized for the type of terminal in use.
|
||||
|
||||
At a higher level routines combining the actions of move() and addch()
|
||||
are defined, as are routines to add whole strings and to perform
|
||||
format conversions in the manner of printf().
|
||||
|
||||
Interfaces are also defined to erase the entire window and to specify
|
||||
the attributes of individual characters in the window. Attributes
|
||||
such as inverse video, underline and blink can be used on a
|
||||
per-character basis.
|
||||
|
||||
New windows can be created by allowing the application to build
|
||||
several images of the screen and display the appropriate one very
|
||||
quickly. New windows are created using the routine newwin(). For
|
||||
each routine that manipulates the default window, stdscr, there is a
|
||||
corresponding routine prefixed with w to manipulate the contents of a
|
||||
specified window; for example, move() and wmove(). In fact, move(...)
|
||||
is functionally equivalent to wmove( stdscr, ...). This is similar to
|
||||
the interface offered by printf(...) and fprintf(stdout, ...).
|
||||
|
||||
Windows do not have to correspond to the entire screen. It is
|
||||
possible to create smaller windows, and also to indicate that the
|
||||
window is only partially visible on the screen. Furthermore, large
|
||||
windows or pads, which are bigger than the actual screen size, may be
|
||||
created.
|
||||
|
||||
Interfaces are also defined to allow input character manipulation and
|
||||
to disable and enable many input attributes: character echo, single
|
||||
character input with or without signal processing (cbreak or raw
|
||||
modes), carriage returns mapping to newlines, screen scrolling, etc.
|
||||
|
||||
|
||||
Data Types and the \<curses.h\> Header
|
||||
--------------------------------------
|
||||
|
||||
The data types supported by curses are described in this section.
|
||||
|
||||
As the library supports a procedural interface to the data types, actual
|
||||
structure contents are not described. All curses data are manipulated
|
||||
using the routines provided.
|
||||
|
||||
|
||||
### The \<curses.h\> Header
|
||||
|
||||
The \<curses.h\> header defines various constants and declares the data
|
||||
types that are available to the application.
|
||||
|
||||
|
||||
### Data Types
|
||||
|
||||
The following data types are declared:
|
||||
|
||||
WINDOW * pointer to screen representation
|
||||
SCREEN * pointer to terminal descriptor
|
||||
bool boolean data type
|
||||
chtype representation of a character in a window
|
||||
cchar_t the wide-character equivalent of chtype
|
||||
attr_t for WA_-style attributes
|
||||
|
||||
The actual WINDOW and SCREEN objects used to store information are
|
||||
created by the corresponding routines and a pointer to them is provided.
|
||||
All manipulation is through that pointer.
|
||||
|
||||
|
||||
### Variables
|
||||
|
||||
The following variables are defined:
|
||||
|
||||
LINES number of lines on terminal screen
|
||||
COLS number of columns on terminal screen
|
||||
stdscr pointer to the default screen window
|
||||
curscr pointer to the current screen image
|
||||
SP pointer to the current SCREEN struct
|
||||
Mouse_status status of the mouse
|
||||
COLORS number of colors available
|
||||
COLOR_PAIRS number of color pairs available
|
||||
TABSIZE size of one TAB block
|
||||
acs_map[] alternate character set map
|
||||
ttytype[] terminal name/description
|
||||
|
||||
|
||||
### Constants
|
||||
|
||||
The following constants are defined:
|
||||
|
||||
#### General
|
||||
|
||||
FALSE boolean false value
|
||||
TRUE boolean true value
|
||||
NULL zero pointer value
|
||||
ERR value returned on error condition
|
||||
OK value returned on successful completion
|
||||
|
||||
#### Video Attributes
|
||||
|
||||
Normally, attributes are a property of the character.
|
||||
|
||||
For chtype:
|
||||
|
||||
A_ALTCHARSET use the alternate character set
|
||||
A_BLINK bright background or blinking
|
||||
A_BOLD bright foreground or bold
|
||||
A_DIM half bright -- no effect in PDCurses
|
||||
A_INVIS invisible
|
||||
A_ITALIC italic
|
||||
A_LEFTLINE line along the left edge
|
||||
A_PROTECT protected (?) -- PDCurses renders this as a
|
||||
combination of the *LINE attributes
|
||||
A_REVERSE reverse video
|
||||
A_RIGHTLINE line along the right edge
|
||||
A_STANDOUT terminal's best highlighting mode
|
||||
A_UNDERLINE underline
|
||||
|
||||
A_ATTRIBUTES bit-mask to extract attributes
|
||||
A_CHARTEXT bit-mask to extract a character
|
||||
A_COLOR bit-mask to extract a color-pair
|
||||
|
||||
Not all attributes will work on all terminals. A_RIGHTLINE, A_LEFTLINE
|
||||
and A_ITALIC are specific to PDCurses. A_INVIS and A_ITALIC are given
|
||||
the same value in PDCurses.
|
||||
|
||||
For attr_t:
|
||||
|
||||
WA_ALTCHARSET same as A_ALTCHARSET
|
||||
WA_BLINK same as A_BLINK
|
||||
WA_BOLD same as A_BOLD
|
||||
WA_DIM same as A_DIM
|
||||
WA_INVIS same as A_INVIS
|
||||
WA_LEFT same as A_LEFTLINE
|
||||
WA_PROTECT same as A_PROTECT
|
||||
WA_REVERSE same as A_REVERSE
|
||||
WA_RIGHT same as A_RIGHTLINE
|
||||
WA_STANDOUT same as A_STANDOUT
|
||||
WA_UNDERLINE same as A_UNDERLINE
|
||||
|
||||
Note that while A_LEFTLINE and A_RIGHTLINE are PDCurses-specific,
|
||||
WA_LEFT and WA_RIGHT are standard. The following are also defined, for
|
||||
compatibility, but currently have no effect in PDCurses: WA_HORIZONTAL,
|
||||
WA_LOW, WA_TOP, WA_VERTICAL.
|
||||
|
||||
### The Alternate Character Set
|
||||
|
||||
For use in chtypes and with related functions. These are a portable way
|
||||
to represent graphics characters on different terminals.
|
||||
|
||||
VT100-compatible symbols -- box characters:
|
||||
|
||||
ACS_ULCORNER upper left box corner
|
||||
ACS_LLCORNER lower left box corner
|
||||
ACS_URCORNER upper right box corner
|
||||
ACS_LRCORNER lower right box corner
|
||||
ACS_RTEE right "T"
|
||||
ACS_LTEE left "T"
|
||||
ACS_BTEE bottom "T"
|
||||
ACS_TTEE top "T"
|
||||
ACS_HLINE horizontal line
|
||||
ACS_VLINE vertical line
|
||||
ACS_PLUS plus sign, cross, or four-corner piece
|
||||
|
||||
VT100-compatible symbols -- other:
|
||||
|
||||
ACS_S1 scan line 1
|
||||
ACS_S9 scan line 9
|
||||
ACS_DIAMOND diamond
|
||||
ACS_CKBOARD checkerboard -- 50% grey
|
||||
ACS_DEGREE degree symbol
|
||||
ACS_PLMINUS plus/minus sign
|
||||
ACS_BULLET bullet
|
||||
|
||||
Teletype 5410v1 symbols -- these are defined in SysV curses, but are not
|
||||
well-supported by most terminals. Stick to VT100 characters for optimum
|
||||
portability:
|
||||
|
||||
ACS_LARROW left arrow
|
||||
ACS_RARROW right arrow
|
||||
ACS_DARROW down arrow
|
||||
ACS_UARROW up arrow
|
||||
ACS_BOARD checkerboard -- lighter (less dense) than
|
||||
ACS_CKBOARD
|
||||
ACS_LANTERN lantern symbol
|
||||
ACS_BLOCK solid block
|
||||
|
||||
That goes double for these -- undocumented SysV symbols. Don't use them:
|
||||
|
||||
ACS_S3 scan line 3
|
||||
ACS_S7 scan line 7
|
||||
ACS_LEQUAL less than or equal
|
||||
ACS_GEQUAL greater than or equal
|
||||
ACS_PI pi
|
||||
ACS_NEQUAL not equal
|
||||
ACS_STERLING pounds sterling symbol
|
||||
|
||||
Box character aliases:
|
||||
|
||||
ACS_BSSB same as ACS_ULCORNER
|
||||
ACS_SSBB same as ACS_LLCORNER
|
||||
ACS_BBSS same as ACS_URCORNER
|
||||
ACS_SBBS same as ACS_LRCORNER
|
||||
ACS_SBSS same as ACS_RTEE
|
||||
ACS_SSSB same as ACS_LTEE
|
||||
ACS_SSBS same as ACS_BTEE
|
||||
ACS_BSSS same as ACS_TTEE
|
||||
ACS_BSBS same as ACS_HLINE
|
||||
ACS_SBSB same as ACS_VLINE
|
||||
ACS_SSSS same as ACS_PLUS
|
||||
|
||||
For cchar_t and wide-character functions, WACS_ equivalents are also
|
||||
defined.
|
||||
|
||||
### Colors
|
||||
|
||||
For use with init_pair(), color_set(), etc.:
|
||||
|
||||
COLOR_BLACK
|
||||
COLOR_BLUE
|
||||
COLOR_GREEN
|
||||
COLOR_CYAN
|
||||
COLOR_RED
|
||||
COLOR_MAGENTA
|
||||
COLOR_YELLOW
|
||||
COLOR_WHITE
|
||||
|
||||
Use these instead of numeric values. The definition of the colors
|
||||
depends on the implementation of curses.
|
||||
|
||||
|
||||
### Input Values
|
||||
|
||||
The following constants might be returned by getch() if keypad() has
|
||||
been enabled. Note that not all of these may be supported on a
|
||||
particular terminal:
|
||||
|
||||
KEY_BREAK break key
|
||||
KEY_DOWN the four arrow keys
|
||||
KEY_UP
|
||||
KEY_LEFT
|
||||
KEY_RIGHT
|
||||
KEY_HOME home key (upward+left arrow)
|
||||
KEY_BACKSPACE backspace
|
||||
KEY_F0 function keys; space for 64 keys is reserved
|
||||
KEY_F(n) (KEY_F0+(n))
|
||||
KEY_DL delete line
|
||||
KEY_IL insert line
|
||||
KEY_DC delete character
|
||||
KEY_IC insert character
|
||||
KEY_EIC exit insert character mode
|
||||
KEY_CLEAR clear screen
|
||||
KEY_EOS clear to end of screen
|
||||
KEY_EOL clear to end of line
|
||||
KEY_SF scroll 1 line forwards
|
||||
KEY_SR scroll 1 line backwards (reverse)
|
||||
KEY_NPAGE next page
|
||||
KEY_PPAGE previous page
|
||||
KEY_STAB set tab
|
||||
KEY_CTAB clear tab
|
||||
KEY_CATAB clear all tabs
|
||||
KEY_ENTER enter or send
|
||||
KEY_SRESET soft (partial) reset
|
||||
KEY_RESET reset or hard reset
|
||||
KEY_PRINT print or copy
|
||||
KEY_LL home down or bottom (lower left)
|
||||
KEY_A1 upper left of virtual keypad
|
||||
KEY_A3 upper right of virtual keypad
|
||||
KEY_B2 center of virtual keypad
|
||||
KEY_C1 lower left of virtual keypad
|
||||
KEY_C3 lower right of virtual keypad
|
||||
|
||||
KEY_BTAB Back tab key
|
||||
KEY_BEG Beginning key
|
||||
KEY_CANCEL Cancel key
|
||||
KEY_CLOSE Close key
|
||||
KEY_COMMAND Cmd (command) key
|
||||
KEY_COPY Copy key
|
||||
KEY_CREATE Create key
|
||||
KEY_END End key
|
||||
KEY_EXIT Exit key
|
||||
KEY_FIND Find key
|
||||
KEY_HELP Help key
|
||||
KEY_MARK Mark key
|
||||
KEY_MESSAGE Message key
|
||||
KEY_MOVE Move key
|
||||
KEY_NEXT Next object key
|
||||
KEY_OPEN Open key
|
||||
KEY_OPTIONS Options key
|
||||
KEY_PREVIOUS Previous object key
|
||||
KEY_REDO Redo key
|
||||
KEY_REFERENCE Reference key
|
||||
KEY_REFRESH Refresh key
|
||||
KEY_REPLACE Replace key
|
||||
KEY_RESTART Restart key
|
||||
KEY_RESUME Resume key
|
||||
KEY_SAVE Save key
|
||||
KEY_SBEG Shifted beginning key
|
||||
KEY_SCANCEL Shifted cancel key
|
||||
KEY_SCOMMAND Shifted command key
|
||||
KEY_SCOPY Shifted copy key
|
||||
KEY_SCREATE Shifted create key
|
||||
KEY_SDC Shifted delete char key
|
||||
KEY_SDL Shifted delete line key
|
||||
KEY_SELECT Select key
|
||||
KEY_SEND Shifted end key
|
||||
KEY_SEOL Shifted clear line key
|
||||
KEY_SEXIT Shifted exit key
|
||||
KEY_SFIND Shifted find key
|
||||
KEY_SHELP Shifted help key
|
||||
KEY_SHOME Shifted home key
|
||||
KEY_SIC Shifted input key
|
||||
KEY_SLEFT Shifted left arrow key
|
||||
KEY_SMESSAGE Shifted message key
|
||||
KEY_SMOVE Shifted move key
|
||||
KEY_SNEXT Shifted next key
|
||||
KEY_SOPTIONS Shifted options key
|
||||
KEY_SPREVIOUS Shifted prev key
|
||||
KEY_SPRINT Shifted print key
|
||||
KEY_SREDO Shifted redo key
|
||||
KEY_SREPLACE Shifted replace key
|
||||
KEY_SRIGHT Shifted right arrow
|
||||
KEY_SRSUME Shifted resume key
|
||||
KEY_SSAVE Shifted save key
|
||||
KEY_SSUSPEND Shifted suspend key
|
||||
KEY_SUNDO Shifted undo key
|
||||
KEY_SUSPEND Suspend key
|
||||
KEY_UNDO Undo key
|
||||
|
||||
The virtual keypad is arranged like this:
|
||||
|
||||
A1 up A3
|
||||
left B2 right
|
||||
C1 down C3
|
||||
|
||||
This list is incomplete -- see curses.h for the full list, and use the
|
||||
testcurs demo to see what values are actually returned. The above are
|
||||
just the keys required by X/Open. In particular, PDCurses defines many
|
||||
CTL_ and ALT_ combinations; these are not portable.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
834
doc/intro.txt
834
doc/intro.txt
@@ -1,834 +0,0 @@
|
||||
PDCurses User's Guide
|
||||
=====================
|
||||
|
||||
Curses Overview
|
||||
---------------
|
||||
|
||||
The X/Open Curses Interface Definition describes a set of C-Language
|
||||
functions that provide screen-handling and updating, which are
|
||||
collectively known as the curses library.
|
||||
|
||||
The curses library permits manipulation of data structures called
|
||||
windows which may be thought of as two-dimensional arrays of
|
||||
characters representing all or part of a terminal's screen. The
|
||||
windows are manipulated using a procedural interface described
|
||||
elsewhere. The curses package maintains a record of what characters
|
||||
are on the screen. At the most basic level, manipulation is done with
|
||||
the routines move() and addch() which are used to "move" the curses
|
||||
around and add characters to the default window, stdscr, which
|
||||
represents the whole screen.
|
||||
|
||||
An application may use these routines to add data to the window in any
|
||||
convenient order. Once all data have been added, the routine
|
||||
refresh() is called. The package then determines what changes have
|
||||
been made which affect the screen. The screen contents are then
|
||||
changed to reflect those characters now in the window, using a
|
||||
sequence of operations optimized for the type of terminal in use.
|
||||
|
||||
At a higher level routines combining the actions of move() and addch()
|
||||
are defined, as are routines to add whole strings and to perform
|
||||
format conversions in the manner of printf().
|
||||
|
||||
Interfaces are also defined to erase the entire window and to specify
|
||||
the attributes of individual characters in the window. Attributes
|
||||
such as inverse video, underline and blink can be used on a
|
||||
per-character basis.
|
||||
|
||||
New windows can be created by allowing the application to build
|
||||
several images of the screen and display the appropriate one very
|
||||
quickly. New windows are created using the routine newwin(). For
|
||||
each routine that manipulates the default window, stdscr, there is a
|
||||
corresponding routine prefixed with w to manipulate the contents of a
|
||||
specified window; for example, move() and wmove(). In fact, move(...)
|
||||
is functionally equivalent to wmove( stdscr, ...). This is similar to
|
||||
the interface offered by printf(...) and fprintf(stdout, ...).
|
||||
|
||||
Windows do not have to correspond to the entire screen. It is
|
||||
possible to create smaller windows, and also to indicate that the
|
||||
window is only partially visible on the screen. Furthermore, large
|
||||
windows or pads, which are bigger than the actual screen size, may be
|
||||
created.
|
||||
|
||||
Interfaces are also defined to allow input character manipulation and
|
||||
to disable and enable many input attributes: character echo, single
|
||||
character input with or without signal processing (cbreak or raw
|
||||
modes), carriage returns mapping to newlines, screen scrolling, etc.
|
||||
|
||||
|
||||
Data Types and the <curses.h> Header
|
||||
------------------------------------
|
||||
|
||||
The data types supported by curses are described in this section.
|
||||
|
||||
As the library supports a procedural interface to the data types, actual
|
||||
structure contents are not described. All curses data are manipulated
|
||||
using the routines provided.
|
||||
|
||||
|
||||
THE <curses.h> HEADER
|
||||
|
||||
The <curses.h> header defines various constants and declares the data
|
||||
types that are available to the application.
|
||||
|
||||
|
||||
DATA TYPES
|
||||
|
||||
The following data types are declared:
|
||||
|
||||
WINDOW * pointer to screen representation
|
||||
SCREEN * pointer to terminal descriptor
|
||||
bool boolean data type
|
||||
chtype representation of a character in a window
|
||||
cchar_t the wide-character equivalent of chtype
|
||||
attr_t for WA_-style attributes
|
||||
|
||||
The actual WINDOW and SCREEN objects used to store information are
|
||||
created by the corresponding routines and a pointer to them is provided.
|
||||
All manipulation is through that pointer.
|
||||
|
||||
|
||||
VARIABLES
|
||||
|
||||
The following variables are defined:
|
||||
|
||||
LINES number of lines on terminal screen
|
||||
COLS number of columns on terminal screen
|
||||
stdscr pointer to the default screen window
|
||||
curscr pointer to the current screen image
|
||||
SP pointer to the current SCREEN struct
|
||||
Mouse_status status of the mouse
|
||||
COLORS number of colors available
|
||||
COLOR_PAIRS number of color pairs available
|
||||
TABSIZE size of one TAB block
|
||||
acs_map[] alternate character set map
|
||||
ttytype[] terminal name/description
|
||||
|
||||
|
||||
CONSTANTS
|
||||
|
||||
The following constants are defined:
|
||||
|
||||
GENERAL
|
||||
|
||||
FALSE boolean false value
|
||||
TRUE boolean true value
|
||||
NULL zero pointer value
|
||||
ERR value returned on error condition
|
||||
OK value returned on successful completion
|
||||
|
||||
VIDEO ATTRIBUTES
|
||||
|
||||
Normally, attributes are a property of the character.
|
||||
|
||||
For chtype:
|
||||
|
||||
A_ALTCHARSET use the alternate character set
|
||||
A_BLINK bright background or blinking
|
||||
A_BOLD bright foreground or bold
|
||||
A_DIM half bright -- no effect in PDCurses
|
||||
A_INVIS invisible
|
||||
A_ITALIC italic
|
||||
A_LEFTLINE line along the left edge
|
||||
A_PROTECT protected (?) -- PDCurses renders this as a
|
||||
combination of the *LINE attributes
|
||||
A_REVERSE reverse video
|
||||
A_RIGHTLINE line along the right edge
|
||||
A_STANDOUT terminal's best highlighting mode
|
||||
A_UNDERLINE underline
|
||||
|
||||
A_ATTRIBUTES bit-mask to extract attributes
|
||||
A_CHARTEXT bit-mask to extract a character
|
||||
A_COLOR bit-mask to extract a color-pair
|
||||
|
||||
Not all attributes will work on all terminals. A_RIGHTLINE, A_LEFTLINE
|
||||
and A_ITALIC are specific to PDCurses. A_INVIS and A_ITALIC are given
|
||||
the same value in PDCurses.
|
||||
|
||||
For attr_t:
|
||||
|
||||
WA_ALTCHARSET same as A_ALTCHARSET
|
||||
WA_BLINK same as A_BLINK
|
||||
WA_BOLD same as A_BOLD
|
||||
WA_DIM same as A_DIM
|
||||
WA_INVIS same as A_INVIS
|
||||
WA_LEFT same as A_LEFTLINE
|
||||
WA_PROTECT same as A_PROTECT
|
||||
WA_REVERSE same as A_REVERSE
|
||||
WA_RIGHT same as A_RIGHTLINE
|
||||
WA_STANDOUT same as A_STANDOUT
|
||||
WA_UNDERLINE same as A_UNDERLINE
|
||||
|
||||
Note that while A_LEFTLINE and A_RIGHTLINE are PDCurses-specific,
|
||||
WA_LEFT and WA_RIGHT are standard. The following are also defined, for
|
||||
compatibility, but currently have no effect in PDCurses: WA_HORIZONTAL,
|
||||
WA_LOW, WA_TOP, WA_VERTICAL.
|
||||
|
||||
THE ALTERNATE CHARACTER SET
|
||||
|
||||
For use in chtypes and with related functions. These are a portable way
|
||||
to represent graphics characters on different terminals.
|
||||
|
||||
VT100-compatible symbols -- box characters:
|
||||
|
||||
ACS_ULCORNER upper left box corner
|
||||
ACS_LLCORNER lower left box corner
|
||||
ACS_URCORNER upper right box corner
|
||||
ACS_LRCORNER lower right box corner
|
||||
ACS_RTEE right "T"
|
||||
ACS_LTEE left "T"
|
||||
ACS_BTEE bottom "T"
|
||||
ACS_TTEE top "T"
|
||||
ACS_HLINE horizontal line
|
||||
ACS_VLINE vertical line
|
||||
ACS_PLUS plus sign, cross, or four-corner piece
|
||||
|
||||
VT100-compatible symbols -- other:
|
||||
|
||||
ACS_S1 scan line 1
|
||||
ACS_S9 scan line 9
|
||||
ACS_DIAMOND diamond
|
||||
ACS_CKBOARD checkerboard -- 50% grey
|
||||
ACS_DEGREE degree symbol
|
||||
ACS_PLMINUS plus/minus sign
|
||||
ACS_BULLET bullet
|
||||
|
||||
Teletype 5410v1 symbols -- these are defined in SysV curses, but
|
||||
are not well-supported by most terminals. Stick to VT100 characters
|
||||
for optimum portability:
|
||||
|
||||
ACS_LARROW left arrow
|
||||
ACS_RARROW right arrow
|
||||
ACS_DARROW down arrow
|
||||
ACS_UARROW up arrow
|
||||
ACS_BOARD checkerboard -- lighter (less dense) than
|
||||
ACS_CKBOARD
|
||||
ACS_LANTERN lantern symbol
|
||||
ACS_BLOCK solid block
|
||||
|
||||
That goes double for these -- undocumented SysV symbols. Don't use
|
||||
them:
|
||||
|
||||
ACS_S3 scan line 3
|
||||
ACS_S7 scan line 7
|
||||
ACS_LEQUAL less than or equal
|
||||
ACS_GEQUAL greater than or equal
|
||||
ACS_PI pi
|
||||
ACS_NEQUAL not equal
|
||||
ACS_STERLING pounds sterling symbol
|
||||
|
||||
Box character aliases:
|
||||
|
||||
ACS_BSSB same as ACS_ULCORNER
|
||||
ACS_SSBB same as ACS_LLCORNER
|
||||
ACS_BBSS same as ACS_URCORNER
|
||||
ACS_SBBS same as ACS_LRCORNER
|
||||
ACS_SBSS same as ACS_RTEE
|
||||
ACS_SSSB same as ACS_LTEE
|
||||
ACS_SSBS same as ACS_BTEE
|
||||
ACS_BSSS same as ACS_TTEE
|
||||
ACS_BSBS same as ACS_HLINE
|
||||
ACS_SBSB same as ACS_VLINE
|
||||
ACS_SSSS same as ACS_PLUS
|
||||
|
||||
For cchar_t and wide-character functions, WACS_ equivalents are also
|
||||
defined.
|
||||
|
||||
COLORS
|
||||
|
||||
For use with init_pair(), color_set(), etc.:
|
||||
|
||||
COLOR_BLACK
|
||||
COLOR_BLUE
|
||||
COLOR_GREEN
|
||||
COLOR_CYAN
|
||||
COLOR_RED
|
||||
COLOR_MAGENTA
|
||||
COLOR_YELLOW
|
||||
COLOR_WHITE
|
||||
|
||||
Use these instead of numeric values. The definition of the colors
|
||||
depends on the implementation of curses.
|
||||
|
||||
|
||||
INPUT VALUES
|
||||
|
||||
The following constants might be returned by getch() if keypad() has
|
||||
been enabled. Note that not all of these may be supported on a
|
||||
particular terminal:
|
||||
|
||||
KEY_BREAK break key
|
||||
KEY_DOWN the four arrow keys
|
||||
KEY_UP
|
||||
KEY_LEFT
|
||||
KEY_RIGHT
|
||||
KEY_HOME home key (upward+left arrow)
|
||||
KEY_BACKSPACE backspace
|
||||
KEY_F0 function keys; space for 64 keys is reserved
|
||||
KEY_F(n) (KEY_F0+(n))
|
||||
KEY_DL delete line
|
||||
KEY_IL insert line
|
||||
KEY_DC delete character
|
||||
KEY_IC insert character
|
||||
KEY_EIC exit insert character mode
|
||||
KEY_CLEAR clear screen
|
||||
KEY_EOS clear to end of screen
|
||||
KEY_EOL clear to end of line
|
||||
KEY_SF scroll 1 line forwards
|
||||
KEY_SR scroll 1 line backwards (reverse)
|
||||
KEY_NPAGE next page
|
||||
KEY_PPAGE previous page
|
||||
KEY_STAB set tab
|
||||
KEY_CTAB clear tab
|
||||
KEY_CATAB clear all tabs
|
||||
KEY_ENTER enter or send
|
||||
KEY_SRESET soft (partial) reset
|
||||
KEY_RESET reset or hard reset
|
||||
KEY_PRINT print or copy
|
||||
KEY_LL home down or bottom (lower left)
|
||||
KEY_A1 upper left of virtual keypad
|
||||
KEY_A3 upper right of virtual keypad
|
||||
KEY_B2 center of virtual keypad
|
||||
KEY_C1 lower left of virtual keypad
|
||||
KEY_C3 lower right of virtual keypad
|
||||
|
||||
KEY_BTAB Back tab key
|
||||
KEY_BEG Beginning key
|
||||
KEY_CANCEL Cancel key
|
||||
KEY_CLOSE Close key
|
||||
KEY_COMMAND Cmd (command) key
|
||||
KEY_COPY Copy key
|
||||
KEY_CREATE Create key
|
||||
KEY_END End key
|
||||
KEY_EXIT Exit key
|
||||
KEY_FIND Find key
|
||||
KEY_HELP Help key
|
||||
KEY_MARK Mark key
|
||||
KEY_MESSAGE Message key
|
||||
KEY_MOVE Move key
|
||||
KEY_NEXT Next object key
|
||||
KEY_OPEN Open key
|
||||
KEY_OPTIONS Options key
|
||||
KEY_PREVIOUS Previous object key
|
||||
KEY_REDO Redo key
|
||||
KEY_REFERENCE Reference key
|
||||
KEY_REFRESH Refresh key
|
||||
KEY_REPLACE Replace key
|
||||
KEY_RESTART Restart key
|
||||
KEY_RESUME Resume key
|
||||
KEY_SAVE Save key
|
||||
KEY_SBEG Shifted beginning key
|
||||
KEY_SCANCEL Shifted cancel key
|
||||
KEY_SCOMMAND Shifted command key
|
||||
KEY_SCOPY Shifted copy key
|
||||
KEY_SCREATE Shifted create key
|
||||
KEY_SDC Shifted delete char key
|
||||
KEY_SDL Shifted delete line key
|
||||
KEY_SELECT Select key
|
||||
KEY_SEND Shifted end key
|
||||
KEY_SEOL Shifted clear line key
|
||||
KEY_SEXIT Shifted exit key
|
||||
KEY_SFIND Shifted find key
|
||||
KEY_SHELP Shifted help key
|
||||
KEY_SHOME Shifted home key
|
||||
KEY_SIC Shifted input key
|
||||
KEY_SLEFT Shifted left arrow key
|
||||
KEY_SMESSAGE Shifted message key
|
||||
KEY_SMOVE Shifted move key
|
||||
KEY_SNEXT Shifted next key
|
||||
KEY_SOPTIONS Shifted options key
|
||||
KEY_SPREVIOUS Shifted prev key
|
||||
KEY_SPRINT Shifted print key
|
||||
KEY_SREDO Shifted redo key
|
||||
KEY_SREPLACE Shifted replace key
|
||||
KEY_SRIGHT Shifted right arrow
|
||||
KEY_SRSUME Shifted resume key
|
||||
KEY_SSAVE Shifted save key
|
||||
KEY_SSUSPEND Shifted suspend key
|
||||
KEY_SUNDO Shifted undo key
|
||||
KEY_SUSPEND Suspend key
|
||||
KEY_UNDO Undo key
|
||||
|
||||
The virtual keypad is arranged like this:
|
||||
|
||||
A1 up A3
|
||||
left B2 right
|
||||
C1 down C3
|
||||
|
||||
This list is incomplete -- see curses.h for the full list, and use the
|
||||
testcurs demo to see what values are actually returned. The above are
|
||||
just the keys required by X/Open. In particular, PDCurses defines many
|
||||
CTL_ and ALT_ combinations; these are not portable.
|
||||
|
||||
|
||||
FUNCTIONS
|
||||
|
||||
The following table lists each curses routine and the name of the manual
|
||||
page on which it is described.
|
||||
|
||||
Functions from the X/Open curses standard -- complete, except for
|
||||
getch() and ungetch(), which are implemented as macros for DOS
|
||||
compatibility:
|
||||
|
||||
Curses Function Manual Page Name
|
||||
|
||||
addch addch
|
||||
addchnstr addchstr
|
||||
addchstr addchstr
|
||||
addnstr addstr
|
||||
addstr addstr
|
||||
attroff attr
|
||||
attron attr
|
||||
attrset attr
|
||||
attr_get attr
|
||||
attr_off attr
|
||||
attr_on attr
|
||||
attr_set attr
|
||||
baudrate termattr
|
||||
beep beep
|
||||
bkgd bkgd
|
||||
bkgdset bkgd
|
||||
border border
|
||||
box border
|
||||
can_change_color color
|
||||
cbreak inopts
|
||||
chgat attr
|
||||
clearok outopts
|
||||
clear clear
|
||||
clrtobot clear
|
||||
clrtoeol clear
|
||||
color_content color
|
||||
color_set attr
|
||||
copywin overlay
|
||||
curs_set kernel
|
||||
def_prog_mode kernel
|
||||
def_shell_mode kernel
|
||||
del_curterm terminfo
|
||||
delay_output util
|
||||
delch delch
|
||||
deleteln deleteln
|
||||
delscreen initscr
|
||||
delwin window
|
||||
derwin window
|
||||
doupdate refresh
|
||||
dupwin window
|
||||
echochar addch
|
||||
echo inopts
|
||||
endwin initscr
|
||||
erasechar termattr
|
||||
erase clear
|
||||
filter util
|
||||
flash beep
|
||||
flushinp getch
|
||||
getbkgd bkgd
|
||||
getnstr getstr
|
||||
getstr getstr
|
||||
getwin scr_dump
|
||||
halfdelay inopts
|
||||
has_colors color
|
||||
has_ic termattr
|
||||
has_il termattr
|
||||
hline border
|
||||
idcok outopts
|
||||
idlok outopts
|
||||
immedok outopts
|
||||
inchnstr inchstr
|
||||
inchstr inchstr
|
||||
inch inch
|
||||
init_color color
|
||||
init_pair color
|
||||
initscr initscr
|
||||
innstr instr
|
||||
insch insch
|
||||
insdelln deleteln
|
||||
insertln deleteln
|
||||
insnstr innstr
|
||||
insstr innstr
|
||||
instr instr
|
||||
intrflush inopts
|
||||
isendwin initscr
|
||||
is_linetouched touch
|
||||
is_wintouched touch
|
||||
keyname keyname
|
||||
keypad inopts
|
||||
killchar termattr
|
||||
leaveok outopts
|
||||
longname termattr
|
||||
meta inopts
|
||||
move move
|
||||
mvaddch addch
|
||||
mvaddchnstr addchstr
|
||||
mvaddchstr addchstr
|
||||
mvaddnstr addstr
|
||||
mvaddstr addstr
|
||||
mvchgat attr
|
||||
mvcur terminfo
|
||||
mvdelch delch
|
||||
mvderwin window
|
||||
mvgetch getch
|
||||
mvgetnstr getstr
|
||||
mvgetstr getstr
|
||||
mvhline border
|
||||
mvinch inch
|
||||
mvinchnstr inchstr
|
||||
mvinchstr inchstr
|
||||
mvinnstr instr
|
||||
mvinsch insch
|
||||
mvinsnstr insstr
|
||||
mvinsstr insstr
|
||||
mvinstr instr
|
||||
mvprintw printw
|
||||
mvscanw scanw
|
||||
mvvline border
|
||||
mvwaddchnstr addchstr
|
||||
mvwaddchstr addchstr
|
||||
mvwaddch addch
|
||||
mvwaddnstr addstr
|
||||
mvwaddstr addstr
|
||||
mvwchgat attr
|
||||
mvwdelch delch
|
||||
mvwgetch getch
|
||||
mvwgetnstr getstr
|
||||
mvwgetstr getstr
|
||||
mvwhline border
|
||||
mvwinchnstr inchstr
|
||||
mvwinchstr inchstr
|
||||
mvwinch inch
|
||||
mvwinnstr instr
|
||||
mvwinsch insch
|
||||
mvwinsnstr insstr
|
||||
mvwinsstr insstr
|
||||
mvwinstr instr
|
||||
mvwin window
|
||||
mvwprintw printw
|
||||
mvwscanw scanw
|
||||
mvwvline border
|
||||
napms kernel
|
||||
newpad pad
|
||||
newterm initscr
|
||||
newwin window
|
||||
nl inopts
|
||||
nocbreak inopts
|
||||
nodelay inopts
|
||||
noecho inopts
|
||||
nonl inopts
|
||||
noqiflush inopts
|
||||
noraw inopts
|
||||
notimeout inopts
|
||||
overlay overlay
|
||||
overwrite overlay
|
||||
pair_content color
|
||||
pechochar pad
|
||||
pnoutrefresh pad
|
||||
prefresh pad
|
||||
printw printw
|
||||
putp terminfo
|
||||
putwin scr_dump
|
||||
qiflush inopts
|
||||
raw inopts
|
||||
redrawwin refresh
|
||||
refresh refresh
|
||||
reset_prog_mode kernel
|
||||
reset_shell_mode kernel
|
||||
resetty kernel
|
||||
restartterm terminfo
|
||||
ripoffline kernel
|
||||
savetty kernel
|
||||
scanw scanw
|
||||
scr_dump scr_dump
|
||||
scr_init scr_dump
|
||||
scr_restore scr_dump
|
||||
scr_set scr_dump
|
||||
scrl scroll
|
||||
scroll scroll
|
||||
scrollok outopts
|
||||
set_term initscr
|
||||
setscrreg outopts
|
||||
setterm terminfo
|
||||
setupterm terminfo
|
||||
slk_attroff slk
|
||||
slk_attr_off slk
|
||||
slk_attron slk
|
||||
slk_attr_on slk
|
||||
slk_attrset slk
|
||||
slk_attr_set slk
|
||||
slk_clear slk
|
||||
slk_color slk
|
||||
slk_init slk
|
||||
slk_label slk
|
||||
slk_noutrefresh slk
|
||||
slk_refresh slk
|
||||
slk_restore slk
|
||||
slk_set slk
|
||||
slk_touch slk
|
||||
standend attr
|
||||
standout attr
|
||||
start_color color
|
||||
subpad pad
|
||||
subwin window
|
||||
syncok window
|
||||
termattrs termattrs
|
||||
term_attrs termattrs
|
||||
termname termattrs
|
||||
tgetent termcap
|
||||
tgetflag termcap
|
||||
tgetnum termcap
|
||||
tgetstr termcap
|
||||
tgoto termcap
|
||||
tigetflag terminfo
|
||||
tigetnum terminfo
|
||||
tigetstr terminfo
|
||||
timeout inopts
|
||||
touchline touch
|
||||
touchwin touch
|
||||
tparm terminfo
|
||||
tputs terminfo
|
||||
typeahead inopts
|
||||
untouchwin touch
|
||||
use_env util
|
||||
vidattr terminfo
|
||||
vid_attr terminfo
|
||||
vidputs terminfo
|
||||
vid_puts terminfo
|
||||
vline border
|
||||
vw_printw printw
|
||||
vwprintw printw
|
||||
vw_scanw scanw
|
||||
vwscanw scanw
|
||||
waddchnstr addchstr
|
||||
waddchstr addchstr
|
||||
waddch addch
|
||||
waddnstr addstr
|
||||
waddstr addstr
|
||||
wattroff attr
|
||||
wattron attr
|
||||
wattrset attr
|
||||
wattr_get attr
|
||||
wattr_off attr
|
||||
wattr_on attr
|
||||
wattr_set attr
|
||||
wbkgdset bkgd
|
||||
wbkgd bkgd
|
||||
wborder border
|
||||
wchgat attr
|
||||
wclear clear
|
||||
wclrtobot clear
|
||||
wclrtoeol clear
|
||||
wcolor_set attr
|
||||
wcursyncup window
|
||||
wdelch delch
|
||||
wdeleteln deleteln
|
||||
wechochar addch
|
||||
werase clear
|
||||
wgetch getch
|
||||
wgetnstr getstr
|
||||
wgetstr getstr
|
||||
whline border
|
||||
winchnstr inchstr
|
||||
winchstr inchstr
|
||||
winch inch
|
||||
winnstr instr
|
||||
winsch insch
|
||||
winsdelln deleteln
|
||||
winsertln deleteln
|
||||
winsnstr insstr
|
||||
winsstr insstr
|
||||
winstr instr
|
||||
wmove move
|
||||
wnoutrefresh refresh
|
||||
wprintw printw
|
||||
wredrawln refresh
|
||||
wrefresh refresh
|
||||
wscanw scanw
|
||||
wscrl scroll
|
||||
wsetscrreg outopts
|
||||
wstandend attr
|
||||
wstandout attr
|
||||
wsyncdown window
|
||||
wsyncup window
|
||||
wtimeout inopts
|
||||
wtouchln touch
|
||||
wvline border
|
||||
|
||||
Wide-character functions from the X/Open standard -- these are only
|
||||
available when PDCurses is built with PDC_WIDE defined, and the
|
||||
prototypes are only available from curses.h when PDC_WIDE is defined
|
||||
before its inclusion in your app:
|
||||
|
||||
addnwstr addstr
|
||||
addwstr addstr
|
||||
add_wch addch
|
||||
add_wchnstr addchstr
|
||||
add_wchstr addchstr
|
||||
border_set border
|
||||
box_set border
|
||||
echo_wchar addch
|
||||
erasewchar termattr
|
||||
getbkgrnd bkgd
|
||||
getcchar util
|
||||
getn_wstr getstr
|
||||
get_wch getch
|
||||
get_wstr getstr
|
||||
hline_set border
|
||||
innwstr instr
|
||||
ins_nwstr insstr
|
||||
ins_wch insch
|
||||
ins_wstr insstr
|
||||
inwstr instr
|
||||
in_wch inch
|
||||
in_wchnstr inchstr
|
||||
in_wchstr inchstr
|
||||
key_name keyname
|
||||
killwchar termattr
|
||||
mvaddnwstr addstr
|
||||
mvaddwstr addstr
|
||||
mvadd_wch addch
|
||||
mvadd_wchnstr addchstr
|
||||
mvadd_wchstr addchstr
|
||||
mvgetn_wstr getstr
|
||||
mvget_wch getch
|
||||
mvget_wstr getstr
|
||||
mvhline_set border
|
||||
mvinnwstr instr
|
||||
mvins_nwstr insstr
|
||||
mvins_wch insch
|
||||
mvins_wstr insstr
|
||||
mvinwstr instr
|
||||
mvwaddnwstr addstr
|
||||
mvwaddwstr addstr
|
||||
mvwadd_wch addch
|
||||
mvwadd_wchnstr addchstr
|
||||
mvwadd_wchstr addchstr
|
||||
mvwgetn_wstr getstr
|
||||
mvwget_wch getch
|
||||
mvwget_wstr getstr
|
||||
mvwhline_set border
|
||||
mvwinnwstr instr
|
||||
mvwins_nwstr insstr
|
||||
mvwins_wch insch
|
||||
mvwins_wstr insstr
|
||||
mvwin_wch inch
|
||||
mvwin_wchnstr inchstr
|
||||
mvwin_wchstr inchstr
|
||||
mvwinwstr instr
|
||||
mvwvline_set border
|
||||
pecho_wchar pad
|
||||
setcchar util
|
||||
slk_wset slk
|
||||
unget_wch getch
|
||||
vline_set border
|
||||
waddnwstr addstr
|
||||
waddwstr addstr
|
||||
wadd_wch addch
|
||||
wadd_wchnstr addchstr
|
||||
wadd_wchstr addchstr
|
||||
wbkgrnd bkgd
|
||||
wbkgrndset bkgd
|
||||
wborder_set border
|
||||
wecho_wchar addch
|
||||
wgetbkgrnd bkgd
|
||||
wgetn_wstr getstr
|
||||
wget_wch getch
|
||||
wget_wstr getstr
|
||||
whline_set border
|
||||
winnwstr instr
|
||||
wins_nwstr insstr
|
||||
wins_wch insch
|
||||
wins_wstr insstr
|
||||
winwstr instr
|
||||
win_wch inch
|
||||
win_wchnstr inchstr
|
||||
win_wchstr inchstr
|
||||
wunctrl util
|
||||
wvline_set border
|
||||
|
||||
Quasi-standard functions, from Sys V or BSD curses:
|
||||
|
||||
getattrs attr
|
||||
getbegx getyx
|
||||
getbegy getyx
|
||||
getmaxx getyx
|
||||
getmaxy getyx
|
||||
getparx getyx
|
||||
getparx getyx
|
||||
traceoff debug
|
||||
traceon debug
|
||||
unctrl util
|
||||
|
||||
Classic PDCurses mouse functions, based on Sys V:
|
||||
|
||||
mouse_set mouse
|
||||
mouse_on mouse
|
||||
mouse_off mouse
|
||||
request_mouse_pos mouse
|
||||
map_button mouse
|
||||
wmouse_position mouse
|
||||
getmouse mouse
|
||||
getbmap mouse
|
||||
|
||||
Functions from ncurses:
|
||||
|
||||
assume_default_colors color
|
||||
curses_version initscr
|
||||
has_key keyname
|
||||
use_default_colors color
|
||||
wresize window
|
||||
|
||||
mouseinterval mouse
|
||||
mousemask mouse
|
||||
mouse_trafo mouse
|
||||
nc_getmouse mouse
|
||||
ungetmouse mouse
|
||||
wenclose mouse
|
||||
wmouse_trafo mouse
|
||||
|
||||
PDCurses-specific functions -- avoid these in code that's intended to be
|
||||
portable:
|
||||
|
||||
addrawch addch
|
||||
insrawch insch
|
||||
is_termresized initscr
|
||||
mvaddrawch addch
|
||||
mvdeleteln deleteln
|
||||
mvinsertln deleteln
|
||||
mvinsrawch insch
|
||||
mvwaddrawch addch
|
||||
mvwdeleteln deleteln
|
||||
mvwinsertln deleteln
|
||||
mvwinsrawch insch
|
||||
raw_output outopts
|
||||
resize_term initscr
|
||||
resize_window window
|
||||
slk_wlabel slk
|
||||
waddrawch addch
|
||||
winsrawch insch
|
||||
wordchar termattr
|
||||
|
||||
PDC_debug debug
|
||||
PDC_ungetch getch
|
||||
PDC_set_blink pdcsetsc
|
||||
PDC_set_line_color color
|
||||
PDC_set_title pdcsetsc
|
||||
|
||||
PDC_clearclipboard pdcclip
|
||||
PDC_freeclipboard pdcclip
|
||||
PDC_getclipboard pdcclip
|
||||
PDC_setclipboard pdcclip
|
||||
|
||||
PDC_get_input_fd pdckbd
|
||||
PDC_get_key_modifiers getch
|
||||
PDC_return_key_modifiers getch
|
||||
PDC_save_key_modifiers getch
|
||||
|
||||
Functions specific to the X11 port of PDCurses:
|
||||
|
||||
Xinitscr initscr
|
||||
XCursesExit -
|
||||
sb_init sb
|
||||
sb_set_horz sb
|
||||
sb_set_vert sb
|
||||
sb_get_horz sb
|
||||
sb_get_vert sb
|
||||
sb_refresh sb
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
SDL Considerations
|
||||
==================
|
||||
|
||||
There are no special requirements to use PDCurses for SDL -- all
|
||||
PDCurses-compatible code should work fine. (In fact, you can even build
|
||||
against the Win32 console pdcurses.dll, and then swap in the SDL
|
||||
pdcurses.dll.) Nothing extra is needed beyond the base SDL library.
|
||||
There are no special requirements to use PDCurses for SDL -- all
|
||||
PDCurses-compatible code should work fine. (In fact, you can even build
|
||||
against the Win32 console pdcurses.dll, and then swap in the SDL
|
||||
pdcurses.dll.) Nothing extra is needed beyond the base SDL library.
|
||||
However, there are some optional special features, described here.
|
||||
|
||||
The principal limitation of this port is that input is currently
|
||||
restricted to ASCII (i.e., 0-127), plus the special keys like KEY_LEFT.
|
||||
(You could have Unicode input, but then the input wouldn't match the
|
||||
output, which is in Code Page 437.) Also, see the note about the
|
||||
The principal limitation of this port is that input is currently
|
||||
restricted to ASCII (i.e., 0-127), plus the special keys like KEY_LEFT.
|
||||
(You could have Unicode input, but then the input wouldn't match the
|
||||
output, which is in Code Page 437.) Also, see the note about the
|
||||
potential for incomplete output under "PDC_update_rects()", below.
|
||||
|
||||
|
||||
Fonts
|
||||
-----
|
||||
|
||||
The font is a simple BMP, 32 characters wide by 8 characters tall,
|
||||
preferably with a palette. (BMPs without palettes still work, but in
|
||||
that case, no attributes will be available, nor will the cursor work.)
|
||||
The first entry in the palette (usually black) is treated as the
|
||||
background color; the last entry (usually white) is treated as the
|
||||
foreground. These are changed or made transparent as appropriate; any
|
||||
other colors in the palette are passed through unchanged. So -- although
|
||||
a one-bit depth is sufficient for a normal font -- you could redraw some
|
||||
The font is a simple BMP, 32 characters wide by 8 characters tall,
|
||||
preferably with a palette. (BMPs without palettes still work, but in
|
||||
that case, no attributes will be available, nor will the cursor work.)
|
||||
The first entry in the palette (usually black) is treated as the
|
||||
background color; the last entry (usually white) is treated as the
|
||||
foreground. These are changed or made transparent as appropriate; any
|
||||
other colors in the palette are passed through unchanged. So -- although
|
||||
a one-bit depth is sufficient for a normal font -- you could redraw some
|
||||
characters as multi-colored tiles.
|
||||
|
||||
The font must be monospaced. The size of each character is derived by
|
||||
dividing the width of the BMP by 32 and the height by 8. There is no
|
||||
The font must be monospaced. The size of each character is derived by
|
||||
dividing the width of the BMP by 32 and the height by 8. There is no
|
||||
constraint on the dimensions.
|
||||
|
||||
As provided in the default font and expected by acs_map[], the font is
|
||||
in Code Page 437 form. But you can of course use any layout if you're
|
||||
As provided in the default font and expected by acs_map[], the font is
|
||||
in Code Page 437 form. But you can of course use any layout if you're
|
||||
not relying on correct values for the ACS_* macros.
|
||||
|
||||
The font can be set via the environment variable PDC_FONT. If it's not
|
||||
set, PDCurses looks for a file named "pdcfont.bmp" in the current
|
||||
directory at the time of initscr(). If neither is found, it uses the
|
||||
The font can be set via the environment variable PDC_FONT. If it's not
|
||||
set, PDCurses looks for a file named "pdcfont.bmp" in the current
|
||||
directory at the time of initscr(). If neither is found, it uses the
|
||||
built-in default font encoded in deffont.h.
|
||||
|
||||
|
||||
@@ -90,11 +90,11 @@ course this is extremely non-portable!) To aid you, there are several
|
||||
external variables and functions specific to the SDL port; you could
|
||||
include pdcsdl.h, or just add the declarations you need in your code:
|
||||
|
||||
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
||||
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
||||
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
||||
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
||||
|
||||
void PDC_update_rects(void);
|
||||
void PDC_retile(void);
|
||||
void PDC_update_rects(void);
|
||||
void PDC_retile(void);
|
||||
|
||||
pdc_screen is the main surface, created by SDL_SetVideoMode(), unless
|
||||
it's preset before initscr(). You can perform normal SDL operations on
|
||||
407
doc/x11.md
Normal file
407
doc/x11.md
Normal file
@@ -0,0 +1,407 @@
|
||||
X11 Considerations
|
||||
==================
|
||||
|
||||
PDCurses for X11 uses the System V IPC shared memory facility, along
|
||||
with sockets, to share data between the curses program and the child
|
||||
process created to manage the X stuff.
|
||||
|
||||
When compiling your application, you need to include the \<curses.h\> or
|
||||
\<xcurses.h\> that comes with PDCurses. You also need to link your code
|
||||
with libXCurses. You may need to link with the following libraries under
|
||||
X11R5:
|
||||
|
||||
Xaw Xmu Xt X11
|
||||
|
||||
or, under X11R6:
|
||||
|
||||
Xaw Xmu Xt X11 SM ICE Xext
|
||||
|
||||
You can run "xcurses-config --libs" to show the link parameters for your
|
||||
system. If using dynamic linking, on some systems, "-lXCurses" suffices.
|
||||
|
||||
By calling Xinitscr() rather than initscr(), you can pass your program
|
||||
name and resource overrides to PDCurses. The program name is used as the
|
||||
title of the X window, and for defining X resources specific to your
|
||||
program.
|
||||
|
||||
|
||||
Interaction with stdio
|
||||
----------------------
|
||||
|
||||
Be aware that curses programs that expect to have a normal tty
|
||||
underneath them will be very disappointed! Output directed to stdout
|
||||
will go to the xterm that invoked the PDCurses application, or to the
|
||||
console if not invoked directly from an xterm. Similarly, stdin will
|
||||
expect its input from the same place as stdout.
|
||||
|
||||
|
||||
X Resources
|
||||
-----------
|
||||
|
||||
PDCurses for X11 recognizes the following resources:
|
||||
|
||||
### lines
|
||||
|
||||
Specifies the number of lines the "screen" will have. Directly equates
|
||||
to LINES. There is no theoretical maximum. The minimum value must be 2.
|
||||
Default: 24
|
||||
|
||||
### cols
|
||||
|
||||
Specifies the number of columns the "screen" will have. Directly equates
|
||||
to COLS. There is no theoretical maximum. The minimum value must be 2.
|
||||
Default: 80
|
||||
|
||||
### normalFont
|
||||
|
||||
The name of a fixed width font. Default: 7x13
|
||||
|
||||
### italicFont
|
||||
|
||||
The name of a fixed width font to be used for characters with A_ITALIC
|
||||
attributes. Must have the same cell size as normalFont. Default: 7x13
|
||||
(obviously not an italic font)
|
||||
|
||||
### pointer
|
||||
|
||||
The name of a valid pointer cursor. Default: xterm
|
||||
|
||||
### pointerForeColor
|
||||
|
||||
The foreground color of the pointer. Default: black
|
||||
|
||||
### pointerBackColor
|
||||
|
||||
The background color of the pointer. Default: white
|
||||
|
||||
### cursorColor
|
||||
|
||||
### textCursor
|
||||
|
||||
The alignment of the text cursor; horizontal or vertical. Default:
|
||||
horizontal
|
||||
|
||||
### colorBlack
|
||||
|
||||
The color of the COLOR_BLACK attribute. Default: Black
|
||||
|
||||
### colorRed
|
||||
|
||||
The color of the COLOR_RED attribute. Default: red3
|
||||
|
||||
### colorGreen
|
||||
|
||||
The color of the COLOR_GREEN attribute. Default: green3
|
||||
|
||||
### colorYellow
|
||||
|
||||
The color of the COLOR_YELLOW attribute. Default: yellow3
|
||||
|
||||
### colorBlue
|
||||
|
||||
The color of the COLOR_BLUE attribute. Default: blue3
|
||||
|
||||
### colorMagenta
|
||||
|
||||
The color of the COLOR_MAGENTA attribute. Default: magenta3
|
||||
|
||||
### colorCyan
|
||||
|
||||
The color of the COLOR_CYAN attribute. Default: cyan3
|
||||
|
||||
### colorWhite
|
||||
|
||||
The color of the COLOR_WHITE attribute. Default: Grey
|
||||
|
||||
### colorBoldBlack
|
||||
|
||||
COLOR_BLACK combined with A_BOLD. Default: grey40
|
||||
|
||||
### colorBoldRed
|
||||
|
||||
COLOR_RED combined with A_BOLD. Default: red1
|
||||
|
||||
### colorBoldGreen
|
||||
|
||||
COLOR_GREEN combined with A_BOLD. Default: green1
|
||||
|
||||
### colorBoldYellow
|
||||
|
||||
COLOR_YELLOW combined with A_BOLD. Default: yellow1
|
||||
|
||||
### colorBoldBlue
|
||||
|
||||
COLOR_BLUE combined with A_BOLD. Default: blue1
|
||||
|
||||
### colorBoldMagenta
|
||||
|
||||
COLOR_MAGENTA combined with A_BOLD. Default: magenta1
|
||||
|
||||
### colorBoldCyan
|
||||
|
||||
COLOR_CYAN combined with A_BOLD. Default: cyan1
|
||||
|
||||
### colorBoldWhite
|
||||
|
||||
COLOR_WHITE combined with A_BOLD. Default: White
|
||||
|
||||
### bitmap
|
||||
|
||||
The name of a valid bitmap file of depth 1 (black and white) used for
|
||||
the application's icon. The file is an X bitmap. Default: a 32x32 or
|
||||
64x64 pixmap depending on the window manager
|
||||
|
||||
### pixmap
|
||||
|
||||
The name of a valid pixmap file of any depth supported by the window
|
||||
manager (color) for the application's icon, The file is an X11 pixmap.
|
||||
This resource is only available if the libXpm package has been installed
|
||||
(most systems have this by default). This resource overrides the
|
||||
"bitmap" resource. Default: none, uses default bitmap above
|
||||
|
||||
### translations
|
||||
|
||||
Translations enable the user to customize the action that occurs when a
|
||||
key, combination of keys, or a button is pressed. The translations are
|
||||
similar to those used by xterm.
|
||||
|
||||
Defaults:
|
||||
|
||||
<Key>: XCursesKeyPress()
|
||||
<KeyUp>: XCursesKeyPress()
|
||||
<BtnDown>: XCursesButton()
|
||||
<BtnUp>: XCursesButton()
|
||||
<BtnMotion>: XCursesButton()
|
||||
|
||||
The most useful action for KeyPress translations is string(). The
|
||||
argument to the string() action can be either a string or a hex
|
||||
representation of a character; e.g., string(0x1b) will send the ASCII
|
||||
escape character to the application; string("[11~") will send [ 1 1 ~ ,
|
||||
as separate keystrokes.
|
||||
|
||||
### shmmin
|
||||
|
||||
On most systems, there are two Unix kernel parameters that determine the
|
||||
allowable size of a shared memory segment. These parameters are usually
|
||||
something like SHMMIN and SHMMAX. To use shared memory, a program must
|
||||
allocate a segment of shared memory that is between these two values.
|
||||
Usually these values are like 1 for SHMMIN and some large number for
|
||||
SHMMAX. Sometimes the Unix kernel is configured to have a value of
|
||||
SHMMIN that is bigger than the size of one of the shared memory segments
|
||||
that libXCurses uses. On these systems an error message like:
|
||||
|
||||
Cannot allocate shared memory for SCREEN: Invalid argument
|
||||
|
||||
will result. To overcome this problem, this resource should be set to
|
||||
the kernel value for SHMMIN. This ensures that a shared memory segment
|
||||
will always be bigger than the kernel value for SHMMIN (and hopefully
|
||||
less than SHMMAX!) Default: 0
|
||||
|
||||
### borderColor
|
||||
|
||||
The color of the border around the screen. Default: black
|
||||
|
||||
### borderWidth
|
||||
|
||||
The width in pixels of the border around the screen. Default: 0
|
||||
|
||||
### clickPeriod
|
||||
|
||||
The period (in milliseconds) between a button press and a button release
|
||||
that determines if a click of a button has occurred. Default: 100
|
||||
|
||||
### doubleClickPeriod
|
||||
|
||||
The period (in milliseconds) between two button press events that
|
||||
determines if a double click of a button has occurred. Default: 200
|
||||
|
||||
### composeKey
|
||||
|
||||
The name of the X key that defines the "compose key", which is used to
|
||||
enter characters in the Latin-1 character set above 0xA0. (See "Compose
|
||||
Keys for Latin-1" below.) This is used only when PDCurses is built
|
||||
without XIM support. While in compose mode, the text cursor will appear
|
||||
as a hollow rectangle. Default: Multi_key
|
||||
|
||||
|
||||
Using Resources
|
||||
---------------
|
||||
|
||||
All applications have a top-level class name of "XCurses". If Xinitscr()
|
||||
is used, it sets an application's top-level widget name. (Otherwise the
|
||||
name defaults to "PDCurses".)
|
||||
|
||||
Examples for app-defaults or .Xdefaults:
|
||||
|
||||
!
|
||||
! resources for XCurses class of programs
|
||||
!
|
||||
XCurses*lines: 30
|
||||
XCurses*cols: 80
|
||||
XCurses*normalFont: 9x13
|
||||
XCurses*bitmap: /tmp/xcurses.xbm
|
||||
XCurses*pointer: top_left_arrow
|
||||
!
|
||||
! resources for testcurs - XCurses
|
||||
!
|
||||
testcurs.colorRed: orange
|
||||
testcurs.colorBlack: midnightblue
|
||||
testcurs.lines: 25
|
||||
*testcurs.Translations: #override \n \
|
||||
<Key>F12: string(0x1b) string("[11~") \n
|
||||
!
|
||||
! resources for THE - XCurses
|
||||
!
|
||||
! resources with the * wildcard can be overridden by a parameter passed
|
||||
! to initscr()
|
||||
!
|
||||
the*normalFont: 9x15
|
||||
the*lines: 40
|
||||
the*cols: 86
|
||||
the*pointer: xterm
|
||||
the*pointerForeColor: white
|
||||
the*pointerBackColor: black
|
||||
!
|
||||
! resources with the . format can not be overridden by a parameter passed
|
||||
! to Xinitscr()
|
||||
!
|
||||
the.bitmap: /home/mark/the/the64.xbm
|
||||
the.pixmap: /home/mark/the/the64.xpm
|
||||
|
||||
Resources may also be passed as parameters to the Xinitscr() function.
|
||||
Parameters are strings in the form of switches; e.g., to set the color
|
||||
"red" to "indianred", and the number of lines to 30, the string passed
|
||||
to Xinitscr would be: "-colorRed indianred -lines 30"
|
||||
|
||||
|
||||
Compose Keys for Latin-1
|
||||
------------------------
|
||||
|
||||
When built without XIM support, PDCurses for X11 provides its own,
|
||||
limited compose key system for Latin-1 characters. The available
|
||||
combinations are listed here. For a given character, any of the
|
||||
combinations shown in the last column may be used. To generate a
|
||||
character, press the "compose" key followed by one of the pairs of
|
||||
keystrokes. Where no key is evident, the spacebar is used. Thus, to
|
||||
generate the NO-BREAK SPACE, press the "compose" key followed by two
|
||||
hits of the spacebar.
|
||||
|
||||
With a typical modern X server, you can get many more compose key
|
||||
combinations by using XIM instead. Configure PDCurses with --enable-xim
|
||||
to use XIM support.
|
||||
|
||||
This document is encoded in UTF-8.
|
||||
|
||||
Hex| Dec |Chr| Description ISO 10646-1:1993(E) | Compose key combinations
|
||||
---+-----+---+---------------------------------+-------------------------
|
||||
A0 | 160 | | NO-BREAK SPACE |
|
||||
A1 | 161 | ¡ | INVERTED EXCLAMATION MARK | ! !!
|
||||
A2 | 162 | ¢ | CENT SIGN | c| |c c/ c$ C$ C|
|
||||
A3 | 163 | £ | POUND SIGN | L- L$ L= l- l$ l= |-
|
||||
A4 | 164 | ¤ | CURRENCY SIGN | xo ox XO g$
|
||||
A5 | 165 | ¥ | YEN SIGN | =y y= =Y Y= Y- y$ y-
|
||||
A6 | 166 | ¦ | BROKEN BAR | | || vb VB |^
|
||||
A7 | 167 | § | SECTION SIGN | SO SS s! S! so
|
||||
A8 | 168 | ¨ | DIAERESIS | " ""
|
||||
A9 | 169 | © | COPYRIGHT SIGN | CO co OC
|
||||
AA | 170 | ª | FEMININE ORDINAL INDICATOR | sa SA a_ A_
|
||||
AB | 171 | « | LEFT DOUBLE ANGLE QUOTES | <<
|
||||
AC | 172 | ¬ | NOT SIGN | -, no NO
|
||||
AD | 173 | | SOFT HYPHEN | - --
|
||||
AE | 174 | ® | REGISTERED SIGN | RO ro OR
|
||||
AF | 175 | ¯ | MACRON | -^ _^ __
|
||||
B0 | 176 | ° | DEGREE SIGN | o 0^ 0* de DE ^0
|
||||
B1 | 177 | ± | PLUS-MINUS SIGN | -+ +-
|
||||
B2 | 178 | ² | SUPERSCRIPT TWO | 2 2^ s2 ^2
|
||||
B3 | 179 | ³ | SUPERSCRIPT THREE | 3 3^ s3 ^3
|
||||
B4 | 180 | ´ | ACUTE ACCENT | ' ''
|
||||
B5 | 181 | µ | MICRO SIGN | u /u /U *m *M
|
||||
B6 | 182 | ¶ | PILCROW SIGN | p! P! pg PG
|
||||
B7 | 183 | · | MIDDLE DOT | . .^ ..
|
||||
B8 | 184 | ¸ | CEDILLA | , ,,
|
||||
B9 | 185 | ¹ | SUPERSCRIPT ONE | 1 1^ s1 ^1
|
||||
BA | 186 | º | MASCULINE ORDINAL INDICATOR | o_ s0 S0
|
||||
BB | 187 | » | RIGHT DOUBLE ANGLE QUOTES | >>
|
||||
BC | 188 | ¼ | VULGAR FRACTION ONE QUARTER | 14
|
||||
BD | 189 | ½ | VULGAR FRACTION ONE HALF | 12
|
||||
BE | 190 | ¾ | VULGAR FRACTION THREE QUARTERS | 34
|
||||
BF | 191 | ¿ | INVERTED QUESTION MARK | ? ??
|
||||
C0 | 192 | À | CAPITAL A WITH GRAVE ACCENT | `A A`
|
||||
C1 | 193 | Á | CAPITAL A WITH ACUTE ACCENT | 'A A'
|
||||
C2 | 194 | Â | CAPITAL A WITH CIRCUMFLEX ACCENT| ^A A^ A>
|
||||
C3 | 195 | Ã | CAPITAL A WITH TILDE | ~A A~ A-
|
||||
C4 | 196 | Ä | CAPITAL A WITH DIAERESIS | "A A"
|
||||
C5 | 197 | Å | CAPITAL A WITH RING ABOVE | oA Ao A* OA *A
|
||||
C6 | 198 | Æ | CAPITAL LIGATURE AE | AE
|
||||
C7 | 199 | Ç | CAPITAL C WITH CEDILLA | ,C C,
|
||||
C8 | 200 | È | CAPITAL E WITH GRAVE ACCENT | `E E`
|
||||
C9 | 201 | É | CAPITAL E WITH ACUTE ACCENT | 'E E'
|
||||
CA | 202 | Ê | CAPITAL E WITH CIRCUMFLEX ACCENT| ^E E^ E>
|
||||
CB | 203 | Ë | CAPITAL E WITH DIAERESIS | "E E"
|
||||
CC | 204 | Ì | CAPITAL I WITH GRAVE ACCENT | `I I`
|
||||
CD | 205 | Í | CAPITAL I WITH ACUTE ACCENT | 'I I'
|
||||
CE | 206 | Î | CAPITAL I WITH CIRCUMFLEX ACCENT| ^I I^ I>
|
||||
CF | 207 | Ï | CAPITAL I WITH DIAERESIS | "I I"
|
||||
D0 | 208 | Ð | CAPITAL ETH | D-
|
||||
D1 | 209 | Ñ | CAPITAL N WITH TILDE | ~N N~ N-
|
||||
D2 | 210 | Ò | CAPITAL O WITH GRAVE ACCENT | `O O`
|
||||
D3 | 211 | Ó | CAPITAL O WITH ACUTE ACCENT | 'O O'
|
||||
D4 | 212 | Ô | CAPITAL O WITH CIRCUMFLEX ACCENT| ^O O^ O>
|
||||
D5 | 213 | Õ | CAPITAL O WITH TILDE | ~O O~ O-
|
||||
D6 | 214 | Ö | CAPITAL O WITH DIAERESIS | "O O"
|
||||
D7 | 215 | × | MULTIPLICATION SIGN | x xx XX mu MU
|
||||
D8 | 216 | Ø | CAPITAL O WITH STROKE | /O O/
|
||||
D9 | 217 | Ù | CAPITAL U WITH GRAVE ACCENT | `U U`
|
||||
DA | 218 | Ú | CAPITAL U WITH ACUTE ACCENT | 'U U'
|
||||
DB | 219 | Û | CAPITAL U WITH CIRCUMFLEX ACCENT| ^U U^ U>
|
||||
DC | 220 | Ü | CAPITAL U WITH DIAERESIS | "U U"
|
||||
DD | 221 | Ý | CAPITAL Y WITH ACUTE ACCENT | 'Y Y'
|
||||
DE | 222 | Þ | CAPITAL THORN | P TH |P
|
||||
DF | 223 | ß | SMALL SHARP S | ss
|
||||
E0 | 224 | à | SMALL A WITH GRAVE ACCENT | `a a`
|
||||
E1 | 225 | á | SMALL A WITH ACUTE ACCENT | 'a a'
|
||||
E2 | 226 | â | SMALL A WITH CIRCUMFLEX ACCENT | ^a a^ a>
|
||||
E3 | 227 | ã | SMALL A WITH TILDE | ~a a~ a-
|
||||
E4 | 228 | ä | SMALL A WITH DIAERESIS | "a a"
|
||||
E5 | 229 | å | SMALL A WITH RING ABOVE | oa ao Oa a* *a
|
||||
E6 | 230 | æ | SMALL LIGATURE AE | ae
|
||||
E7 | 231 | ç | SMALL C WITH CEDILLA | ,c c,
|
||||
E8 | 232 | è | SMALL E WITH GRAVE ACCENT | `e e`
|
||||
E9 | 233 | é | SMALL E WITH ACUTE ACCENT | 'e e'
|
||||
EA | 234 | ê | SMALL E WITH CIRCUMFLEX ACCENT | ^e e^ e>
|
||||
EB | 235 | ë | SMALL E WITH DIAERESIS | "e e"
|
||||
EC | 236 | ì | SMALL I WITH GRAVE ACCENT | `i i`
|
||||
ED | 237 | í | SMALL I WITH ACUTE ACCENT | 'i i'
|
||||
EE | 238 | î | SMALL I WITH CIRCUMFLEX ACCENT | ^i i^ i>
|
||||
EF | 239 | ï | SMALL I WITH DIAERESIS | "i i"
|
||||
F0 | 240 | ð | SMALL ETH | d-
|
||||
F1 | 241 | ñ | SMALL N WITH TILDE | ~n n~ n-
|
||||
F2 | 242 | ò | SMALL O WITH GRAVE ACCENT | `o o`
|
||||
F3 | 243 | ó | SMALL O WITH ACUTE ACCENT | 'o o'
|
||||
F4 | 244 | ô | SMALL O WITH CIRCUMFLEX ACCENT | ^o o^ o>
|
||||
F5 | 245 | õ | SMALL O WITH TILDE | ~o o~ o-
|
||||
F6 | 246 | ö | SMALL O WITH DIAERESIS | "o o"
|
||||
F7 | 247 | ÷ | DIVISION SIGN | -: :-
|
||||
F8 | 248 | ø | SMALL O WITH OBLIQUE BAR | /o o/
|
||||
F9 | 249 | ù | SMALL U WITH GRAVE ACCENT | `u u`
|
||||
FA | 250 | ú | SMALL U WITH ACUTE ACCENT | 'u u'
|
||||
FB | 251 | û | SMALL U WITH CIRCUMFLEX ACCENT | ^u u^ u>
|
||||
FC | 252 | ü | SMALL U WITH DIAERESIS | "u u"
|
||||
FD | 253 | ý | SMALL Y WITH ACUTE ACCENT | 'y y'
|
||||
FE | 254 | þ | SMALL THORN | p th |p
|
||||
FF | 255 | ÿ | SMALL Y WITH DIAERESIS | "y y"
|
||||
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
XCursesProgramName is no longer used. To set the program name, you must
|
||||
use Xinitscr(), or PDC_set_title() to set just the window title.
|
||||
|
||||
The XCursesExit() function is now called automatically via atexit().
|
||||
(Multiple calls to it are OK, so you don't need to remove it if you've
|
||||
already added it for previous versions of PDCurses.)
|
||||
|
||||
XCURSES is no longer defined automatically, but need not be defined,
|
||||
unless you want the X11-specific prototypes. (Normal curses programs
|
||||
won't need it.)
|
||||
416
doc/x11.txt
416
doc/x11.txt
@@ -1,416 +0,0 @@
|
||||
X11 Considerations
|
||||
==================
|
||||
|
||||
PDCurses for X11 uses the System V IPC shared memory facility, along
|
||||
with sockets, to share data between the curses program and the child
|
||||
process created to manage the X stuff.
|
||||
|
||||
When compiling your application, you need to include the <curses.h> or
|
||||
<xcurses.h> that comes with PDCurses. You also need to link your code
|
||||
with libXCurses. You may need to link with the following libraries under
|
||||
X11R5:
|
||||
Xaw Xmu Xt X11
|
||||
|
||||
or, under X11R6:
|
||||
Xaw Xmu Xt X11 SM ICE Xext
|
||||
|
||||
You can run "xcurses-config --libs" to show the link parameters for your
|
||||
system. If using dynamic linking, on some systems, "-lXCurses" suffices.
|
||||
|
||||
By calling Xinitscr() rather than initscr(), you can pass your program
|
||||
name and resource overrides to PDCurses. The program name is used as the
|
||||
title of the X window, and for defining X resources specific to your
|
||||
program.
|
||||
|
||||
|
||||
Interaction with stdio
|
||||
----------------------
|
||||
|
||||
Be aware that curses programs that expect to have a normal tty
|
||||
underneath them will be very disappointed! Output directed to stdout
|
||||
will go to the xterm that invoked the PDCurses application, or to the
|
||||
console if not invoked directly from an xterm. Similarly, stdin will
|
||||
expect its input from the same place as stdout.
|
||||
|
||||
|
||||
X Resources
|
||||
-----------
|
||||
|
||||
PDCurses for X11 recognizes the following resources:
|
||||
|
||||
lines
|
||||
cols
|
||||
normalFont
|
||||
italicFont
|
||||
pointer
|
||||
pointerForeColor
|
||||
pointerBackColor
|
||||
cursorColor
|
||||
textCursor
|
||||
colorBlack
|
||||
colorRed
|
||||
colorGreen
|
||||
colorYellow
|
||||
colorBlue
|
||||
colorMagenta
|
||||
colorCyan
|
||||
colorWhite
|
||||
colorBoldBlack
|
||||
colorBoldRed
|
||||
colorBoldGreen
|
||||
colorBoldYellow
|
||||
colorBoldBlue
|
||||
colorBoldMagenta
|
||||
colorBoldCyan
|
||||
colorBoldWhite
|
||||
bitmap
|
||||
pixmap
|
||||
translations
|
||||
shmmin
|
||||
borderWidth
|
||||
borderColor
|
||||
clickPeriod
|
||||
doubleClickPeriod
|
||||
composeKey
|
||||
|
||||
lines: Specifies the number of lines the "screen" will have.
|
||||
Directly equates to LINES.
|
||||
There is no theoretical maximum.
|
||||
The minimum value must be 2.
|
||||
Default: 24
|
||||
|
||||
cols: Specifies the number of columns the "screen" will have.
|
||||
Directly equates to COLS.
|
||||
There is no theoretical maximum.
|
||||
The minimum value must be 2.
|
||||
Default: 80
|
||||
|
||||
normalFont: The name of a fixed width font.
|
||||
Default: 7x13
|
||||
|
||||
italicFont: The name of a fixed width font to be used for
|
||||
characters with A_ITALIC attributes. Must have the
|
||||
same cell size as normalFont.
|
||||
Default: 7x13 (obviously not an italic font)
|
||||
|
||||
pointer: The name of a valid pointer cursor.
|
||||
Default: xterm
|
||||
|
||||
pointerForeColor: The foreground color of the pointer.
|
||||
Default: black
|
||||
|
||||
pointerBackColor: The background color of the pointer.
|
||||
Default: white
|
||||
|
||||
textCursor: The alignment of the text cursor; horizontal or vertical.
|
||||
Default: horizontal
|
||||
|
||||
colorBlack: The color of the COLOR_BLACK attribute.
|
||||
Default: Black
|
||||
|
||||
colorRed: The color of the COLOR_RED attribute.
|
||||
Default: red3
|
||||
|
||||
colorGreen: The color of the COLOR_GREEN attribute.
|
||||
Default: green3
|
||||
|
||||
colorYellow: The color of the COLOR_YELLOW attribute.
|
||||
Default: yellow3
|
||||
|
||||
colorBlue: The color of the COLOR_BLUE attribute.
|
||||
Default: blue3
|
||||
|
||||
colorMagenta: The color of the COLOR_MAGENTA attribute.
|
||||
Default: magenta3
|
||||
|
||||
colorCyan: The color of the COLOR_CYAN attribute.
|
||||
Default: cyan3
|
||||
|
||||
colorWhite: The color of the COLOR_WHITE attribute.
|
||||
Default: Grey
|
||||
|
||||
colorBoldBlack: COLOR_BLACK combined with A_BOLD.
|
||||
Default: grey40
|
||||
|
||||
colorBoldRed: COLOR_RED combined with A_BOLD.
|
||||
Default: red1
|
||||
|
||||
colorBoldGreen: COLOR_GREEN combined with A_BOLD.
|
||||
Default: green1
|
||||
|
||||
colorBoldYellow: COLOR_YELLOW combined with A_BOLD.
|
||||
Default: yellow1
|
||||
|
||||
colorBoldBlue: COLOR_BLUE combined with A_BOLD.
|
||||
Default: blue1
|
||||
|
||||
colorBoldMagenta: COLOR_MAGENTA combined with A_BOLD.
|
||||
Default: magenta1
|
||||
|
||||
colorBoldCyan: COLOR_CYAN combined with A_BOLD.
|
||||
Default: cyan1
|
||||
|
||||
colorBoldWhite: COLOR_WHITE combined with A_BOLD.
|
||||
Default: White
|
||||
|
||||
bitmap: The name of a valid bitmap file of depth 1 (black and white)
|
||||
used for the application's icon. The file is an X bitmap.
|
||||
Default: a 32x32 or 64x64 pixmap depending on the
|
||||
window manager
|
||||
|
||||
pixmap: The name of a valid pixmap file of any depth
|
||||
supported by the window manager (color) for the
|
||||
application's icon, The file is an X11 pixmap. This
|
||||
resource is only available if the libXpm package has
|
||||
been installed (most systems have this by default).
|
||||
This resource overrides the "bitmap" resource.
|
||||
Default: none, uses default bitmap above
|
||||
|
||||
translations: Translations enable the user to customize the action
|
||||
that occurs when a key, combination of keys, or a
|
||||
button is pressed. The translations are similar to
|
||||
those used by xterm.
|
||||
Defaults:
|
||||
<Key>: XCursesKeyPress()
|
||||
<KeyUp>: XCursesKeyPress()
|
||||
<BtnDown>: XCursesButton()
|
||||
<BtnUp>: XCursesButton()
|
||||
<BtnMotion>: XCursesButton()
|
||||
|
||||
The most useful action for KeyPress translations is
|
||||
string(). The argument to the string() action can be
|
||||
either a string or a hex representation of a
|
||||
character; e.g., string(0x1b) will send the ASCII
|
||||
escape character to the application; string("[11~")
|
||||
will send [ 1 1 ~ , as separate keystrokes.
|
||||
|
||||
shmmin: On most systems, there are two Unix kernel parameters
|
||||
that determine the allowable size of a shared memory
|
||||
segment. These parameters are usually something like
|
||||
SHMMIN and SHMMAX. To use shared memory, a program
|
||||
must allocate a segment of shared memory that is
|
||||
between these two values. Usually these values are
|
||||
like 1 for SHMMIN and some large number for SHMMAX.
|
||||
Sometimes the Unix kernel is configured to have a
|
||||
value of SHMMIN that is bigger than the size of one
|
||||
of the shared memory segments that libXCurses uses.
|
||||
On these systems an error message like:
|
||||
|
||||
Cannot allocate shared memory for SCREEN: Invalid argument
|
||||
|
||||
will result. To overcome this problem, this resource
|
||||
should be set to the kernel value for SHMMIN. This
|
||||
ensures that a shared memory segment will always be
|
||||
bigger than the kernel value for SHMMIN (and
|
||||
hopefully less than SHMMAX!)
|
||||
|
||||
Default: 0
|
||||
|
||||
borderColor: The color of the border around the screen.
|
||||
Default: black
|
||||
|
||||
borderWidth: The width in pixels of the border around the screen.
|
||||
Default: 0
|
||||
|
||||
clickPeriod: The period (in milliseconds) between a button
|
||||
press and a button release that determines if a click
|
||||
of a button has occurred.
|
||||
Default: 100
|
||||
|
||||
doubleClickPeriod: The period (in milliseconds) between two button
|
||||
press events that determines if a double click
|
||||
of a button has occurred.
|
||||
Default: 200
|
||||
|
||||
composeKey: The name of the X key that defines the "compose key",
|
||||
which is used to enter characters in the Latin-1
|
||||
character set above 0xA0. (See "Compose Keys for
|
||||
Latin-1" below.) This is used only when PDCurses is
|
||||
built without XIM support. While in compose mode, the
|
||||
text cursor will appear as a hollow rectangle.
|
||||
Default: Multi_key
|
||||
|
||||
|
||||
Using Resources
|
||||
---------------
|
||||
|
||||
All applications have a top-level class name of "XCurses". If Xinitscr()
|
||||
is used, it sets an application's top-level widget name. (Otherwise the
|
||||
name defaults to "PDCurses".)
|
||||
|
||||
Examples for app-defaults or .Xdefaults:
|
||||
|
||||
!
|
||||
! resources for XCurses class of programs
|
||||
!
|
||||
XCurses*lines: 30
|
||||
XCurses*cols: 80
|
||||
XCurses*normalFont: 9x13
|
||||
XCurses*bitmap: /tmp/xcurses.xbm
|
||||
XCurses*pointer: top_left_arrow
|
||||
!
|
||||
! resources for testcurs - XCurses
|
||||
!
|
||||
testcurs.colorRed: orange
|
||||
testcurs.colorBlack: midnightblue
|
||||
testcurs.lines: 25
|
||||
*testcurs.Translations: #override \n \
|
||||
<Key>F12: string(0x1b) string("[11~") \n
|
||||
!
|
||||
! resources for THE - XCurses
|
||||
!
|
||||
! resources with the * wildcard can be overridden by a parameter passed
|
||||
! to initscr()
|
||||
!
|
||||
the*normalFont: 9x15
|
||||
the*lines: 40
|
||||
the*cols: 86
|
||||
the*pointer: xterm
|
||||
the*pointerForeColor: white
|
||||
the*pointerBackColor: black
|
||||
!
|
||||
! resources with the . format can not be overridden by a parameter passed
|
||||
! to Xinitscr()
|
||||
!
|
||||
the.bitmap: /home/mark/the/the64.xbm
|
||||
the.pixmap: /home/mark/the/the64.xpm
|
||||
|
||||
Resources may also be passed as parameters to the Xinitscr() function.
|
||||
Parameters are strings in the form of switches; e.g., to set the color
|
||||
"red" to "indianred", and the number of lines to 30, the string passed
|
||||
to Xinitscr would be: "-colorRed indianred -lines 30"
|
||||
|
||||
|
||||
Compose Keys for Latin-1
|
||||
------------------------
|
||||
|
||||
When built without XIM support, PDCurses for X11 provides its own,
|
||||
limited compose key system for Latin-1 characters. The available
|
||||
combinations are listed here. For a given character, any of the
|
||||
combinations shown in the last column may be used. To generate a
|
||||
character, press the "compose" key followed by one of the pairs of
|
||||
keystrokes. Where no key is evident, the spacebar is used. Thus, to
|
||||
generate the NO-BREAK SPACE, press the "compose" key followed by two
|
||||
hits of the spacebar.
|
||||
|
||||
With a typical modern X server, you can get many more compose key
|
||||
combinations by using XIM instead. Configure PDCurses with --enable-xim
|
||||
to use XIM support.
|
||||
|
||||
This document is encoded in UTF-8.
|
||||
|
||||
+----+-----+---+---------------------------------+---------------------------+
|
||||
|Hex | Dec |Chr| Description ISO 10646-1:1993(E) | Compose key combinations |
|
||||
+----+-----+---+---------------------------------+---------------------------+
|
||||
| A0 | 160 | | NO-BREAK SPACE | |
|
||||
| A1 | 161 | ¡ | INVERTED EXCLAMATION MARK | ! !! |
|
||||
| A2 | 162 | ¢ | CENT SIGN | c| |c c/ c$ C$ C| |
|
||||
| A3 | 163 | £ | POUND SIGN | L- L$ L= l- l$ l= |-|
|
||||
| A4 | 164 | ¤ | CURRENCY SIGN | xo ox XO g$ |
|
||||
| A5 | 165 | ¥ | YEN SIGN | =y y= =Y Y= Y- y$ y-|
|
||||
| A6 | 166 | ¦ | BROKEN BAR | | || vb VB |^ |
|
||||
| A7 | 167 | § | SECTION SIGN | SO SS s! S! so |
|
||||
| A8 | 168 | ¨ | DIAERESIS | " "" |
|
||||
| A9 | 169 | © | COPYRIGHT SIGN | CO co OC |
|
||||
| AA | 170 | ª | FEMININE ORDINAL INDICATOR | sa SA a_ A_ |
|
||||
| AB | 171 | « | LEFT DOUBLE ANGLE QUOTES | << |
|
||||
| AC | 172 | ¬ | NOT SIGN | -, no NO |
|
||||
| AD | 173 | | SOFT HYPHEN | - -- |
|
||||
| AE | 174 | ® | REGISTERED SIGN | RO ro OR |
|
||||
| AF | 175 | ¯ | MACRON | -^ _^ __ |
|
||||
| B0 | 176 | ° | DEGREE SIGN | o 0^ 0* de DE ^0 |
|
||||
| B1 | 177 | ± | PLUS-MINUS SIGN | -+ +- |
|
||||
| B2 | 178 | ² | SUPERSCRIPT TWO | 2 2^ s2 ^2 |
|
||||
| B3 | 179 | ³ | SUPERSCRIPT THREE | 3 3^ s3 ^3 |
|
||||
| B4 | 180 | ´ | ACUTE ACCENT | ' '' |
|
||||
| B5 | 181 | µ | MICRO SIGN | u /u /U *m *M |
|
||||
| B6 | 182 | ¶ | PILCROW SIGN | p! P! pg PG |
|
||||
| B7 | 183 | · | MIDDLE DOT | . .^ .. |
|
||||
| B8 | 184 | ¸ | CEDILLA | , ,, |
|
||||
| B9 | 185 | ¹ | SUPERSCRIPT ONE | 1 1^ s1 ^1 |
|
||||
| BA | 186 | º | MASCULINE ORDINAL INDICATOR | o_ s0 S0 |
|
||||
| BB | 187 | » | RIGHT DOUBLE ANGLE QUOTES | >> |
|
||||
| BC | 188 | ¼ | VULGAR FRACTION ONE QUARTER | 14 |
|
||||
| BD | 189 | ½ | VULGAR FRACTION ONE HALF | 12 |
|
||||
| BE | 190 | ¾ | VULGAR FRACTION THREE QUARTERS | 34 |
|
||||
| BF | 191 | ¿ | INVERTED QUESTION MARK | ? ?? |
|
||||
| C0 | 192 | À | CAPITAL A WITH GRAVE ACCENT | `A A` |
|
||||
| C1 | 193 | Á | CAPITAL A WITH ACUTE ACCENT | 'A A' |
|
||||
| C2 | 194 | Â | CAPITAL A WITH CIRCUMFLEX ACCENT| ^A A^ A> |
|
||||
| C3 | 195 | Ã | CAPITAL A WITH TILDE | ~A A~ A- |
|
||||
| C4 | 196 | Ä | CAPITAL A WITH DIAERESIS | "A A" |
|
||||
| C5 | 197 | Å | CAPITAL A WITH RING ABOVE | oA Ao A* OA *A |
|
||||
| C6 | 198 | Æ | CAPITAL LIGATURE AE | AE |
|
||||
| C7 | 199 | Ç | CAPITAL C WITH CEDILLA | ,C C, |
|
||||
| C8 | 200 | È | CAPITAL E WITH GRAVE ACCENT | `E E` |
|
||||
| C9 | 201 | É | CAPITAL E WITH ACUTE ACCENT | 'E E' |
|
||||
| CA | 202 | Ê | CAPITAL E WITH CIRCUMFLEX ACCENT| ^E E^ E> |
|
||||
| CB | 203 | Ë | CAPITAL E WITH DIAERESIS | "E E" |
|
||||
| CC | 204 | Ì | CAPITAL I WITH GRAVE ACCENT | `I I` |
|
||||
| CD | 205 | Í | CAPITAL I WITH ACUTE ACCENT | 'I I' |
|
||||
| CE | 206 | Î | CAPITAL I WITH CIRCUMFLEX ACCENT| ^I I^ I> |
|
||||
| CF | 207 | Ï | CAPITAL I WITH DIAERESIS | "I I" |
|
||||
| D0 | 208 | Ð | CAPITAL ETH | D- |
|
||||
| D1 | 209 | Ñ | CAPITAL N WITH TILDE | ~N N~ N- |
|
||||
| D2 | 210 | Ò | CAPITAL O WITH GRAVE ACCENT | `O O` |
|
||||
| D3 | 211 | Ó | CAPITAL O WITH ACUTE ACCENT | 'O O' |
|
||||
| D4 | 212 | Ô | CAPITAL O WITH CIRCUMFLEX ACCENT| ^O O^ O> |
|
||||
| D5 | 213 | Õ | CAPITAL O WITH TILDE | ~O O~ O- |
|
||||
| D6 | 214 | Ö | CAPITAL O WITH DIAERESIS | "O O" |
|
||||
| D7 | 215 | × | MULTIPLICATION SIGN | x xx XX mu MU |
|
||||
| D8 | 216 | Ø | CAPITAL O WITH STROKE | /O O/ |
|
||||
| D9 | 217 | Ù | CAPITAL U WITH GRAVE ACCENT | `U U` |
|
||||
| DA | 218 | Ú | CAPITAL U WITH ACUTE ACCENT | 'U U' |
|
||||
| DB | 219 | Û | CAPITAL U WITH CIRCUMFLEX ACCENT| ^U U^ U> |
|
||||
| DC | 220 | Ü | CAPITAL U WITH DIAERESIS | "U U" |
|
||||
| DD | 221 | Ý | CAPITAL Y WITH ACUTE ACCENT | 'Y Y' |
|
||||
| DE | 222 | Þ | CAPITAL THORN | P TH |P |
|
||||
| DF | 223 | ß | SMALL SHARP S | ss |
|
||||
| E0 | 224 | à | SMALL A WITH GRAVE ACCENT | `a a` |
|
||||
| E1 | 225 | á | SMALL A WITH ACUTE ACCENT | 'a a' |
|
||||
| E2 | 226 | â | SMALL A WITH CIRCUMFLEX ACCENT | ^a a^ a> |
|
||||
| E3 | 227 | ã | SMALL A WITH TILDE | ~a a~ a- |
|
||||
| E4 | 228 | ä | SMALL A WITH DIAERESIS | "a a" |
|
||||
| E5 | 229 | å | SMALL A WITH RING ABOVE | oa ao Oa a* *a |
|
||||
| E6 | 230 | æ | SMALL LIGATURE AE | ae |
|
||||
| E7 | 231 | ç | SMALL C WITH CEDILLA | ,c c, |
|
||||
| E8 | 232 | è | SMALL E WITH GRAVE ACCENT | `e e` |
|
||||
| E9 | 233 | é | SMALL E WITH ACUTE ACCENT | 'e e' |
|
||||
| EA | 234 | ê | SMALL E WITH CIRCUMFLEX ACCENT | ^e e^ e> |
|
||||
| EB | 235 | ë | SMALL E WITH DIAERESIS | "e e" |
|
||||
| EC | 236 | ì | SMALL I WITH GRAVE ACCENT | `i i` |
|
||||
| ED | 237 | í | SMALL I WITH ACUTE ACCENT | 'i i' |
|
||||
| EE | 238 | î | SMALL I WITH CIRCUMFLEX ACCENT | ^i i^ i> |
|
||||
| EF | 239 | ï | SMALL I WITH DIAERESIS | "i i" |
|
||||
| F0 | 240 | ð | SMALL ETH | d- |
|
||||
| F1 | 241 | ñ | SMALL N WITH TILDE | ~n n~ n- |
|
||||
| F2 | 242 | ò | SMALL O WITH GRAVE ACCENT | `o o` |
|
||||
| F3 | 243 | ó | SMALL O WITH ACUTE ACCENT | 'o o' |
|
||||
| F4 | 244 | ô | SMALL O WITH CIRCUMFLEX ACCENT | ^o o^ o> |
|
||||
| F5 | 245 | õ | SMALL O WITH TILDE | ~o o~ o- |
|
||||
| F6 | 246 | ö | SMALL O WITH DIAERESIS | "o o" |
|
||||
| F7 | 247 | ÷ | DIVISION SIGN | -: :- |
|
||||
| F8 | 248 | ø | SMALL O WITH OBLIQUE BAR | /o o/ |
|
||||
| F9 | 249 | ù | SMALL U WITH GRAVE ACCENT | `u u` |
|
||||
| FA | 250 | ú | SMALL U WITH ACUTE ACCENT | 'u u' |
|
||||
| FB | 251 | û | SMALL U WITH CIRCUMFLEX ACCENT | ^u u^ u> |
|
||||
| FC | 252 | ü | SMALL U WITH DIAERESIS | "u u" |
|
||||
| FD | 253 | ý | SMALL Y WITH ACUTE ACCENT | 'y y' |
|
||||
| FE | 254 | þ | SMALL THORN | p th |p |
|
||||
| FF | 255 | ÿ | SMALL Y WITH DIAERESIS | "y y" |
|
||||
+----+-----+---+---------------------------------+---------------------------+
|
||||
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
XCursesProgramName is no longer used. To set the program name, you must
|
||||
use Xinitscr(), or PDC_set_title() to set just the window title.
|
||||
|
||||
The XCursesExit() function is now called automatically via atexit().
|
||||
(Multiple calls to it are OK, so you don't need to remove it if you've
|
||||
already added it for previous versions of PDCurses.)
|
||||
|
||||
XCURSES is no longer defined automatically, but need not be defined,
|
||||
unless you want the X11-specific prototypes. (Normal curses programs
|
||||
won't need it.)
|
||||
@@ -7,26 +7,26 @@ This directory contains PDCurses source code files specific to DOS.
|
||||
Building
|
||||
--------
|
||||
|
||||
. Choose the appropriate makefile for your compiler:
|
||||
- Choose the appropriate makefile for your compiler:
|
||||
|
||||
bccdos.mak - Borland C++ 3.0+
|
||||
gccdos.mak - DJGPP V2
|
||||
mscdos.mak - Microsoft C
|
||||
wccdos16.mak - Watcom 10.6+ (16-bit)
|
||||
wccdos4g.mak - Watcom 10.6+ (32-bit)
|
||||
bccdos.mak - Borland C++ 3.0+
|
||||
gccdos.mak - DJGPP V2
|
||||
mscdos.mak - Microsoft C
|
||||
wccdos16.mak - Open Watcom 1.8+ (16-bit)
|
||||
wccdos4g.mak - Open Watcom 1.8+ (32-bit)
|
||||
|
||||
. For 16-bit compilers, you can change the memory MODEL in the makefile.
|
||||
- For 16-bit compilers, you can change the memory MODEL in the makefile.
|
||||
(Large model is the default, and recommended.)
|
||||
|
||||
. Optionally, you can build in a different directory than the platform
|
||||
- Optionally, you can build in a different directory than the platform
|
||||
directory by setting PDCURSES_SRCDIR to point to the directory where
|
||||
you unpacked PDCurses, and changing to your target directory:
|
||||
|
||||
set PDCURSES_SRCDIR=c:\pdcurses
|
||||
set PDCURSES_SRCDIR=c:\pdcurses
|
||||
|
||||
. Build it:
|
||||
- Build it:
|
||||
|
||||
make -f makefile
|
||||
make -f makefile
|
||||
|
||||
(For Watcom, use "wmake" instead of "make"; for MSVC, "nmake".) You'll
|
||||
get the libraries (pdcurses.lib or .a, depending on your compiler; and
|
||||
@@ -46,4 +46,5 @@ Acknowledgements
|
||||
----------------
|
||||
|
||||
Watcom C port was provided by Pieter Kunst <kunst@prl.philips.nl>
|
||||
|
||||
DJGPP 1.x port was provided by David Nugent <davidn@csource.oz.au>
|
||||
@@ -1,6 +1,6 @@
|
||||
# NMAKE Makefile for PDCurses library - Microsoft C for DOS
|
||||
#
|
||||
# Usage: nmake -f [path\]dosmsc.mak [DEBUG=] [target]
|
||||
# Usage: nmake -f [path\]mscdos.mak [DEBUG=] [target]
|
||||
#
|
||||
# where target can be any of:
|
||||
# [all|demos|pdcurses.lib|testcurs.exe...]
|
||||
|
||||
@@ -2,46 +2,49 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcclip.c,v 1.33 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: clipboard
|
||||
clipboard
|
||||
---------
|
||||
|
||||
Synopsis:
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
### Description
|
||||
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
|
||||
Return Values:
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
|
||||
### Return Values
|
||||
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.65 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these
|
||||
match code page 437 and compatible pages (CP850, CP852, etc.) */
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: pdcdos.h,v 1.30 2008/07/13 16:08:17 wmcbrine Exp $ */
|
||||
|
||||
#include <curspriv.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
# define PDC_ATTR_SHIFT 19
|
||||
#else
|
||||
# define PDC_ATTR_SHIFT 8
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(_QC)
|
||||
# define MSC 1
|
||||
#endif
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcgetsc.c,v 1.42 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* return width of screen/viewport */
|
||||
|
||||
22
dos/pdckbd.c
22
dos/pdckbd.c
@@ -11,21 +11,23 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.87 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdckbd
|
||||
pdckbd
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
### Description
|
||||
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.89 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
|
||||
@@ -2,32 +2,34 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcsetsc.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdcsetsc
|
||||
pdcsetsc
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcdos.h"
|
||||
|
||||
RCSID("$Id: pdcutil.c,v 1.24 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
void PDC_beep(void)
|
||||
{
|
||||
PDCREGS regs;
|
||||
|
||||
@@ -8,8 +8,8 @@ dist: $(PDCLIBS)
|
||||
echo $(PLATFORM2). >> file_id.diz
|
||||
echo Source available in PDCURS$(VER).ZIP >> file_id.diz
|
||||
echo Public Domain. >> file_id.diz
|
||||
echo $(PDCURSES_SRCDIR)\README > flist
|
||||
echo $(PDCURSES_SRCDIR)\HISTORY >> flist
|
||||
echo $(PDCURSES_SRCDIR)\README.md > flist
|
||||
echo $(PDCURSES_SRCDIR)\HISTORY.md >> flist
|
||||
echo $(PDCURSES_SRCDIR)\curses.h >> flist
|
||||
echo $(PDCURSES_SRCDIR)\panel.h >> flist
|
||||
echo $(PDCURSES_SRCDIR)\term.h >> flist
|
||||
|
||||
@@ -7,22 +7,22 @@ This directory contains PDCurses source code files specific to OS/2.
|
||||
Building
|
||||
--------
|
||||
|
||||
. Choose the appropriate makefile for your compiler:
|
||||
- Choose the appropriate makefile for your compiler:
|
||||
|
||||
bccos2.mak - Borland C++ 2.0
|
||||
gccos2.mak - EMX 0.9b+
|
||||
iccos2.mak - C Set/2
|
||||
wccos2.mak - Watcom 10.6+ (32-bit)
|
||||
bccos2.mak - Borland C++ 2.0
|
||||
gccos2.mak - EMX 0.9b+
|
||||
iccos2.mak - C Set/2
|
||||
wccos2.mak - Open Watcom 1.8+
|
||||
|
||||
. Optionally, you can build in a different directory than the platform
|
||||
- Optionally, you can build in a different directory than the platform
|
||||
directory by setting PDCURSES_SRCDIR to point to the directory where
|
||||
you unpacked PDCurses, and changing to your target directory:
|
||||
|
||||
set PDCURSES_SRCDIR=c:\pdcurses
|
||||
set PDCURSES_SRCDIR=c:\pdcurses
|
||||
|
||||
. Build it:
|
||||
- Build it:
|
||||
|
||||
make -f makefilename
|
||||
make -f makefilename
|
||||
|
||||
(For Watcom, use "wmake" instead of "make"; for MSVC or C Set/2,
|
||||
"nmake".) You'll get the libraries (pdcurses.lib or .a, depending on
|
||||
@@ -34,7 +34,7 @@ Building
|
||||
You can also use the optional parameter "DLL=Y" with EMX, to build the
|
||||
library as a DLL:
|
||||
|
||||
make -f gccos2.mak DLL=Y
|
||||
make -f gccos2.mak DLL=Y
|
||||
|
||||
|
||||
Distribution Status
|
||||
@@ -2,44 +2,47 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcclip.c,v 1.33 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: clipboard
|
||||
clipboard
|
||||
---------
|
||||
|
||||
Synopsis:
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
### Description
|
||||
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
|
||||
Return Values:
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
|
||||
### Return Values
|
||||
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.49 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these
|
||||
match code page 437 and compatible pages (CP850, CP852, etc.) */
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcgetsc.c,v 1.39 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/* return width of screen/viewport */
|
||||
|
||||
int PDC_get_columns(void)
|
||||
|
||||
22
os2/pdckbd.c
22
os2/pdckbd.c
@@ -8,21 +8,23 @@ defined(__TURBOC__)
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.89 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdckbd
|
||||
pdckbd
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
### Description
|
||||
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: pdcos2.h,v 1.9 2008/08/14 06:38:35 wmcbrine Exp $ */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define USE_OS2_H 1 /* Use the os2.h for the compiler */
|
||||
# define APIRET USHORT
|
||||
@@ -24,6 +22,12 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
# define PDC_ATTR_SHIFT 19
|
||||
#else
|
||||
# define PDC_ATTR_SHIFT 8
|
||||
#endif
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
# define PDCTHUNK(x) ((ptr_16)(x))
|
||||
# ifdef __386__
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.76 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
# define PDC_OFFSET 32
|
||||
#else
|
||||
|
||||
@@ -2,32 +2,34 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcsetsc.c,v 1.44 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdcsetsc
|
||||
pdcsetsc
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcos2.h"
|
||||
|
||||
RCSID("$Id: pdcutil.c,v 1.14 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
#if defined(OS2) && !defined(__EMX__)
|
||||
APIRET APIENTRY DosSleep(ULONG ulTime);
|
||||
#endif
|
||||
|
||||
2
panel.h
2
panel.h
@@ -1,7 +1,5 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: panel.h,v 1.19 2008/07/13 16:08:16 wmcbrine Exp $ */
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* Panels for PDCurses *
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
175
pdcurses/addch.c
175
pdcurses/addch.c
@@ -2,111 +2,114 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: addch.c,v 1.54 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: addch
|
||||
addch
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int addch(const chtype ch);
|
||||
int waddch(WINDOW *win, const chtype ch);
|
||||
int mvaddch(int y, int x, const chtype ch);
|
||||
int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
|
||||
int echochar(const chtype ch);
|
||||
int wechochar(WINDOW *win, const chtype ch);
|
||||
### Synopsis
|
||||
|
||||
int addrawch(chtype ch);
|
||||
int waddrawch(WINDOW *win, chtype ch);
|
||||
int mvaddrawch(int y, int x, chtype ch);
|
||||
int mvwaddrawch(WINDOW *win, int y, int x, chtype ch);
|
||||
int addch(const chtype ch);
|
||||
int waddch(WINDOW *win, const chtype ch);
|
||||
int mvaddch(int y, int x, const chtype ch);
|
||||
int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
|
||||
int echochar(const chtype ch);
|
||||
int wechochar(WINDOW *win, const chtype ch);
|
||||
|
||||
int add_wch(const cchar_t *wch);
|
||||
int wadd_wch(WINDOW *win, const cchar_t *wch);
|
||||
int mvadd_wch(int y, int x, const cchar_t *wch);
|
||||
int mvwadd_wch(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
int echo_wchar(const cchar_t *wch);
|
||||
int wecho_wchar(WINDOW *win, const cchar_t *wch);
|
||||
int addrawch(chtype ch);
|
||||
int waddrawch(WINDOW *win, chtype ch);
|
||||
int mvaddrawch(int y, int x, chtype ch);
|
||||
int mvwaddrawch(WINDOW *win, int y, int x, chtype ch);
|
||||
|
||||
Description:
|
||||
addch() adds the chtype ch to the default window (stdscr) at the
|
||||
current cursor position, and advances the cursor. Note that
|
||||
chtypes can convey both text (a single character) and
|
||||
attributes, including a color pair. add_wch() is the wide-
|
||||
character version of this function, taking a pointer to a
|
||||
cchar_t instead of a chtype.
|
||||
int add_wch(const cchar_t *wch);
|
||||
int wadd_wch(WINDOW *win, const cchar_t *wch);
|
||||
int mvadd_wch(int y, int x, const cchar_t *wch);
|
||||
int mvwadd_wch(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
int echo_wchar(const cchar_t *wch);
|
||||
int wecho_wchar(WINDOW *win, const cchar_t *wch);
|
||||
|
||||
waddch() is like addch(), but also lets you specify the window.
|
||||
(This is in fact the core output routine.) wadd_wch() is the
|
||||
wide version.
|
||||
### Description
|
||||
|
||||
mvaddch() moves the cursor to the specified (y, x) position, and
|
||||
adds ch to stdscr. mvadd_wch() is the wide version.
|
||||
addch() adds the chtype ch to the default window (stdscr) at the
|
||||
current cursor position, and advances the cursor. Note that
|
||||
chtypes can convey both text (a single character) and
|
||||
attributes, including a color pair. add_wch() is the wide-
|
||||
character version of this function, taking a pointer to a
|
||||
cchar_t instead of a chtype.
|
||||
|
||||
mvwaddch() moves the cursor to the specified position and adds
|
||||
ch to the specified window. mvwadd_wch() is the wide version.
|
||||
waddch() is like addch(), but also lets you specify the window.
|
||||
(This is in fact the core output routine.) wadd_wch() is the
|
||||
wide version.
|
||||
|
||||
echochar() adds ch to stdscr at the current cursor position and
|
||||
calls refresh(). echo_wchar() is the wide version.
|
||||
mvaddch() moves the cursor to the specified (y, x) position, and
|
||||
adds ch to stdscr. mvadd_wch() is the wide version.
|
||||
|
||||
wechochar() adds ch to the specified window and calls
|
||||
wrefresh(). wecho_wchar() is the wide version.
|
||||
mvwaddch() moves the cursor to the specified position and adds
|
||||
ch to the specified window. mvwadd_wch() is the wide version.
|
||||
|
||||
addrawch(), waddrawch(), mvaddrawch() and mvwaddrawch() are
|
||||
PDCurses-specific wrappers for addch() etc. that disable the
|
||||
translation of control characters.
|
||||
echochar() adds ch to stdscr at the current cursor position and
|
||||
calls refresh(). echo_wchar() is the wide version.
|
||||
|
||||
The following applies to all these functions:
|
||||
wechochar() adds ch to the specified window and calls
|
||||
wrefresh(). wecho_wchar() is the wide version.
|
||||
|
||||
If the cursor moves on to the right margin, an automatic newline
|
||||
is performed. If scrollok is enabled, and a character is added
|
||||
to the bottom right corner of the window, the scrolling region
|
||||
will be scrolled up one line. If scrolling is not allowed, ERR
|
||||
will be returned.
|
||||
addrawch(), waddrawch(), mvaddrawch() and mvwaddrawch() are
|
||||
PDCurses-specific wrappers for addch() etc. that disable the
|
||||
translation of control characters.
|
||||
|
||||
If ch is a tab, newline, or backspace, the cursor will be moved
|
||||
appropriately within the window. If ch is a newline, the
|
||||
clrtoeol routine is called before the cursor is moved to the
|
||||
beginning of the next line. If newline mapping is off, the
|
||||
cursor will be moved to the next line, but the x coordinate will
|
||||
be unchanged. If ch is a tab the cursor is moved to the next
|
||||
tab position within the window. If ch is another control
|
||||
character, it will be drawn in the ^X notation. Calling the
|
||||
inch() routine after adding a control character returns the
|
||||
representation of the control character, not the control
|
||||
character.
|
||||
The following applies to all these functions:
|
||||
|
||||
Video attributes can be combined with a character by ORing them
|
||||
into the parameter. Text, including attributes, can be copied
|
||||
from one place to another by using inch() and addch().
|
||||
If the cursor moves on to the right margin, an automatic newline
|
||||
is performed. If scrollok is enabled, and a character is added
|
||||
to the bottom right corner of the window, the scrolling region
|
||||
will be scrolled up one line. If scrolling is not allowed, ERR
|
||||
will be returned.
|
||||
|
||||
Note that in PDCurses, for now, a cchar_t and a chtype are the
|
||||
same. The text field is 16 bits wide, and is treated as Unicode
|
||||
(UCS-2) when PDCurses is built with wide-character support
|
||||
(define PDC_WIDE). So, in functions that take a chtype, like
|
||||
addch(), both the wide and narrow versions will handle Unicode.
|
||||
But for portability, you should use the wide functions.
|
||||
If ch is a tab, newline, or backspace, the cursor will be moved
|
||||
appropriately within the window. If ch is a newline, the
|
||||
clrtoeol routine is called before the cursor is moved to the
|
||||
beginning of the next line. If newline mapping is off, the
|
||||
cursor will be moved to the next line, but the x coordinate will
|
||||
be unchanged. If ch is a tab the cursor is moved to the next
|
||||
tab position within the window. If ch is another control
|
||||
character, it will be drawn in the ^X notation. Calling the
|
||||
inch() routine after adding a control character returns the
|
||||
representation of the control character, not the control
|
||||
character.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
Video attributes can be combined with a character by ORing them
|
||||
into the parameter. Text, including attributes, can be copied
|
||||
from one place to another by using inch() and addch().
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
addch Y Y Y
|
||||
waddch Y Y Y
|
||||
mvaddch Y Y Y
|
||||
mvwaddch Y Y Y
|
||||
echochar Y - 3.0
|
||||
wechochar Y - 3.0
|
||||
addrawch - - -
|
||||
waddrawch - - -
|
||||
mvaddrawch - - -
|
||||
mvwaddrawch - - -
|
||||
add_wch Y
|
||||
wadd_wch Y
|
||||
mvadd_wch Y
|
||||
mvwadd_wch Y
|
||||
echo_wchar Y
|
||||
wecho_wchar Y
|
||||
Note that in PDCurses, for now, a cchar_t and a chtype are the
|
||||
same. The text field is 16 bits wide, and is treated as Unicode
|
||||
(UCS-2) when PDCurses is built with wide-character support
|
||||
(define PDC_WIDE). So, in functions that take a chtype, like
|
||||
addch(), both the wide and narrow versions will handle Unicode.
|
||||
But for portability, you should use the wide functions.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
addch Y Y Y
|
||||
waddch Y Y Y
|
||||
mvaddch Y Y Y
|
||||
mvwaddch Y Y Y
|
||||
echochar Y - 3.0
|
||||
wechochar Y - 3.0
|
||||
addrawch - - -
|
||||
waddrawch - - -
|
||||
mvaddrawch - - -
|
||||
mvwaddrawch - - -
|
||||
add_wch Y
|
||||
wadd_wch Y
|
||||
mvadd_wch Y
|
||||
mvwadd_wch Y
|
||||
echo_wchar Y
|
||||
wecho_wchar Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,64 +2,67 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: addchstr.c,v 1.43 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: addchstr
|
||||
addchstr
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int addchstr(const chtype *ch);
|
||||
int addchnstr(const chtype *ch, int n);
|
||||
int waddchstr(WINDOW *win, const chtype *ch);
|
||||
int waddchnstr(WINDOW *win, const chtype *ch, int n);
|
||||
int mvaddchstr(int y, int x, const chtype *ch);
|
||||
int mvaddchnstr(int y, int x, const chtype *ch, int n);
|
||||
int mvwaddchstr(WINDOW *, int y, int x, const chtype *ch);
|
||||
int mvwaddchnstr(WINDOW *, int y, int x, const chtype *ch, int n);
|
||||
### Synopsis
|
||||
|
||||
int add_wchstr(const cchar_t *wch);
|
||||
int add_wchnstr(const cchar_t *wch, int n);
|
||||
int wadd_wchstr(WINDOW *win, const cchar_t *wch);
|
||||
int wadd_wchnstr(WINDOW *win, const cchar_t *wch, int n);
|
||||
int mvadd_wchstr(int y, int x, const cchar_t *wch);
|
||||
int mvadd_wchnstr(int y, int x, const cchar_t *wch, int n);
|
||||
int mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
int mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wch,
|
||||
int n);
|
||||
int addchstr(const chtype *ch);
|
||||
int addchnstr(const chtype *ch, int n);
|
||||
int waddchstr(WINDOW *win, const chtype *ch);
|
||||
int waddchnstr(WINDOW *win, const chtype *ch, int n);
|
||||
int mvaddchstr(int y, int x, const chtype *ch);
|
||||
int mvaddchnstr(int y, int x, const chtype *ch, int n);
|
||||
int mvwaddchstr(WINDOW *, int y, int x, const chtype *ch);
|
||||
int mvwaddchnstr(WINDOW *, int y, int x, const chtype *ch, int n);
|
||||
|
||||
Description:
|
||||
These routines write a chtype or cchar_t string directly into
|
||||
the window structure, starting at the current or specified
|
||||
position. The four routines with n as the last argument copy at
|
||||
most n elements, but no more than will fit on the line. If n =
|
||||
-1 then the whole string is copied, up to the maximum number
|
||||
that will fit on the line.
|
||||
int add_wchstr(const cchar_t *wch);
|
||||
int add_wchnstr(const cchar_t *wch, int n);
|
||||
int wadd_wchstr(WINDOW *win, const cchar_t *wch);
|
||||
int wadd_wchnstr(WINDOW *win, const cchar_t *wch, int n);
|
||||
int mvadd_wchstr(int y, int x, const cchar_t *wch);
|
||||
int mvadd_wchnstr(int y, int x, const cchar_t *wch, int n);
|
||||
int mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
int mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wch,
|
||||
int n);
|
||||
|
||||
The cursor position is not advanced. These routines do not check
|
||||
for newline or other special characters, nor does any line
|
||||
wrapping occur.
|
||||
### Description
|
||||
|
||||
Return Value:
|
||||
All functions return OK or ERR.
|
||||
These routines write a chtype or cchar_t string directly into
|
||||
the window structure, starting at the current or specified
|
||||
position. The four routines with n as the last argument copy at
|
||||
most n elements, but no more than will fit on the line. If n =
|
||||
-1 then the whole string is copied, up to the maximum number
|
||||
that will fit on the line.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
addchstr Y - 4.0
|
||||
waddchstr Y - 4.0
|
||||
mvaddchstr Y - 4.0
|
||||
mvwaddchstr Y - 4.0
|
||||
addchnstr Y - 4.0
|
||||
waddchnstr Y - 4.0
|
||||
mvaddchnstr Y - 4.0
|
||||
mvwaddchnstr Y - 4.0
|
||||
add_wchstr Y
|
||||
wadd_wchstr Y
|
||||
mvadd_wchstr Y
|
||||
mvwadd_wchstr Y
|
||||
add_wchnstr Y
|
||||
wadd_wchnstr Y
|
||||
mvadd_wchnstr Y
|
||||
mvwadd_wchnstr Y
|
||||
The cursor position is not advanced. These routines do not check
|
||||
for newline or other special characters, nor does any line
|
||||
wrapping occur.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK or ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
addchstr Y - 4.0
|
||||
waddchstr Y - 4.0
|
||||
mvaddchstr Y - 4.0
|
||||
mvwaddchstr Y - 4.0
|
||||
addchnstr Y - 4.0
|
||||
waddchnstr Y - 4.0
|
||||
mvaddchnstr Y - 4.0
|
||||
mvwaddchnstr Y - 4.0
|
||||
add_wchstr Y
|
||||
wadd_wchstr Y
|
||||
mvadd_wchstr Y
|
||||
mvwadd_wchstr Y
|
||||
add_wchnstr Y
|
||||
wadd_wchnstr Y
|
||||
mvadd_wchnstr Y
|
||||
mvwadd_wchnstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,62 +2,65 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: addstr.c,v 1.44 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: addstr
|
||||
addstr
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int addstr(const char *str);
|
||||
int addnstr(const char *str, int n);
|
||||
int waddstr(WINDOW *win, const char *str);
|
||||
int waddnstr(WINDOW *win, const char *str, int n);
|
||||
int mvaddstr(int y, int x, const char *str);
|
||||
int mvaddnstr(int y, int x, const char *str, int n);
|
||||
int mvwaddstr(WINDOW *win, int y, int x, const char *str);
|
||||
int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
|
||||
### Synopsis
|
||||
|
||||
int addwstr(const wchar_t *wstr);
|
||||
int addnwstr(const wchar_t *wstr, int n);
|
||||
int waddwstr(WINDOW *win, const wchar_t *wstr);
|
||||
int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
|
||||
int mvaddwstr(int y, int x, const wchar_t *wstr);
|
||||
int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
|
||||
int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
|
||||
int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
|
||||
int addstr(const char *str);
|
||||
int addnstr(const char *str, int n);
|
||||
int waddstr(WINDOW *win, const char *str);
|
||||
int waddnstr(WINDOW *win, const char *str, int n);
|
||||
int mvaddstr(int y, int x, const char *str);
|
||||
int mvaddnstr(int y, int x, const char *str, int n);
|
||||
int mvwaddstr(WINDOW *win, int y, int x, const char *str);
|
||||
int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
|
||||
|
||||
Description:
|
||||
These routines write all the characters of the null-terminated
|
||||
string str or wide-character string wstr to the given window.
|
||||
The functionality is similar to calling waddch() once for each
|
||||
character in the string; except that, when PDCurses is built
|
||||
with wide-character support enabled, the narrow-character
|
||||
functions treat the string as a multibyte string in the current
|
||||
locale, and convert it. The routines with n as the last
|
||||
argument write at most n characters; if n is negative, then the
|
||||
entire string will be added.
|
||||
int addwstr(const wchar_t *wstr);
|
||||
int addnwstr(const wchar_t *wstr, int n);
|
||||
int waddwstr(WINDOW *win, const wchar_t *wstr);
|
||||
int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
|
||||
int mvaddwstr(int y, int x, const wchar_t *wstr);
|
||||
int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
|
||||
int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
|
||||
int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
|
||||
|
||||
Return Value:
|
||||
All functions return OK or ERR.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
addstr Y Y Y
|
||||
waddstr Y Y Y
|
||||
mvaddstr Y Y Y
|
||||
mvwaddstr Y Y Y
|
||||
addnstr Y - 4.0
|
||||
waddnstr Y - 4.0
|
||||
mvaddnstr Y - 4.0
|
||||
mvwaddnstr Y - 4.0
|
||||
addwstr Y
|
||||
waddwstr Y
|
||||
mvaddwstr Y
|
||||
mvwaddwstr Y
|
||||
addnwstr Y
|
||||
waddnwstr Y
|
||||
mvaddnwstr Y
|
||||
mvwaddnwstr Y
|
||||
These routines write all the characters of the null-terminated
|
||||
string str or wide-character string wstr to the given window.
|
||||
The functionality is similar to calling waddch() once for each
|
||||
character in the string; except that, when PDCurses is built
|
||||
with wide-character support enabled, the narrow-character
|
||||
functions treat the string as a multibyte string in the current
|
||||
locale, and convert it. The routines with n as the last
|
||||
argument write at most n characters; if n is negative, then the
|
||||
entire string will be added.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK or ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
addstr Y Y Y
|
||||
waddstr Y Y Y
|
||||
mvaddstr Y Y Y
|
||||
mvwaddstr Y Y Y
|
||||
addnstr Y - 4.0
|
||||
waddnstr Y - 4.0
|
||||
mvaddnstr Y - 4.0
|
||||
mvwaddnstr Y - 4.0
|
||||
addwstr Y
|
||||
waddwstr Y
|
||||
mvaddwstr Y
|
||||
mvwaddwstr Y
|
||||
addnwstr Y
|
||||
waddnwstr Y
|
||||
mvaddnwstr Y
|
||||
mvwaddnwstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
157
pdcurses/attr.c
157
pdcurses/attr.c
@@ -2,98 +2,101 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: attr.c,v 1.41 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: attr
|
||||
attr
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
int attroff(chtype attrs);
|
||||
int wattroff(WINDOW *win, chtype attrs);
|
||||
int attron(chtype attrs);
|
||||
int wattron(WINDOW *win, chtype attrs);
|
||||
int attrset(chtype attrs);
|
||||
int wattrset(WINDOW *win, chtype attrs);
|
||||
int standend(void);
|
||||
int wstandend(WINDOW *win);
|
||||
int standout(void);
|
||||
int wstandout(WINDOW *win);
|
||||
### Synopsis
|
||||
|
||||
int color_set(short color_pair, void *opts);
|
||||
int wcolor_set(WINDOW *win, short color_pair, void *opts);
|
||||
int attroff(chtype attrs);
|
||||
int wattroff(WINDOW *win, chtype attrs);
|
||||
int attron(chtype attrs);
|
||||
int wattron(WINDOW *win, chtype attrs);
|
||||
int attrset(chtype attrs);
|
||||
int wattrset(WINDOW *win, chtype attrs);
|
||||
int standend(void);
|
||||
int wstandend(WINDOW *win);
|
||||
int standout(void);
|
||||
int wstandout(WINDOW *win);
|
||||
|
||||
int attr_get(attr_t *attrs, short *color_pair, void *opts);
|
||||
int attr_off(attr_t attrs, void *opts);
|
||||
int attr_on(attr_t attrs, void *opts);
|
||||
int attr_set(attr_t attrs, short color_pair, void *opts);
|
||||
int wattr_get(WINDOW *win, attr_t *attrs, short *color_pair,
|
||||
void *opts);
|
||||
int wattr_off(WINDOW *win, attr_t attrs, void *opts);
|
||||
int wattr_on(WINDOW *win, attr_t attrs, void *opts);
|
||||
int wattr_set(WINDOW *win, attr_t attrs, short color_pair,
|
||||
void *opts);
|
||||
int color_set(short color_pair, void *opts);
|
||||
int wcolor_set(WINDOW *win, short color_pair, void *opts);
|
||||
|
||||
int chgat(int n, attr_t attr, short color, const void *opts);
|
||||
int mvchgat(int y, int x, int n, attr_t attr, short color,
|
||||
const void *opts);
|
||||
int mvwchgat(WINDOW *win, int y, int x, int n, attr_t attr,
|
||||
short color, const void *opts);
|
||||
int wchgat(WINDOW *win, int n, attr_t attr, short color,
|
||||
int attr_get(attr_t *attrs, short *color_pair, void *opts);
|
||||
int attr_off(attr_t attrs, void *opts);
|
||||
int attr_on(attr_t attrs, void *opts);
|
||||
int attr_set(attr_t attrs, short color_pair, void *opts);
|
||||
int wattr_get(WINDOW *win, attr_t *attrs, short *color_pair,
|
||||
void *opts);
|
||||
int wattr_off(WINDOW *win, attr_t attrs, void *opts);
|
||||
int wattr_on(WINDOW *win, attr_t attrs, void *opts);
|
||||
int wattr_set(WINDOW *win, attr_t attrs, short color_pair,
|
||||
void *opts);
|
||||
|
||||
int chgat(int n, attr_t attr, short color, const void *opts);
|
||||
int mvchgat(int y, int x, int n, attr_t attr, short color,
|
||||
const void *opts);
|
||||
int mvwchgat(WINDOW *win, int y, int x, int n, attr_t attr,
|
||||
short color, const void *opts);
|
||||
int wchgat(WINDOW *win, int n, attr_t attr, short color,
|
||||
const void *opts);
|
||||
|
||||
chtype getattrs(WINDOW *win);
|
||||
chtype getattrs(WINDOW *win);
|
||||
|
||||
Description:
|
||||
These functions manipulate the current attributes and/or colors
|
||||
of the named window. These attributes can be any combination
|
||||
of A_STANDOUT, A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
|
||||
### Description
|
||||
|
||||
These constants are defined in <curses.h> and can be combined
|
||||
with the bitwise-OR operator (|).
|
||||
These functions manipulate the current attributes and/or colors
|
||||
of the named window. These attributes can be any combination
|
||||
of A_STANDOUT, A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
|
||||
|
||||
The current attributes of a window are applied to all chtypes
|
||||
that are written into the window with waddch(). Attributes are
|
||||
a property of the chtype, and move with the character through
|
||||
any scrolling or insert/delete operations.
|
||||
These constants are defined in <curses.h> and can be combined
|
||||
with the bitwise-OR operator (|).
|
||||
|
||||
attrset() sets the current attributes of the given window to
|
||||
attrs. attroff() turns off the named attributes without
|
||||
affecting any other attributes; attron() turns them on.
|
||||
color_set() sets the window color to the value of color_pair.
|
||||
The current attributes of a window are applied to all chtypes
|
||||
that are written into the window with waddch(). Attributes are
|
||||
a property of the chtype, and move with the character through
|
||||
any scrolling or insert/delete operations.
|
||||
|
||||
standout() is the same as attron(A_STANDOUT). standend() is the
|
||||
same as attrset(A_NORMAL); that is, it turns off all attributes.
|
||||
attrset() sets the current attributes of the given window to
|
||||
attrs. attroff() turns off the named attributes without
|
||||
affecting any other attributes; attron() turns them on.
|
||||
color_set() sets the window color to the value of color_pair.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
standout() is the same as attron(A_STANDOUT). standend() is the
|
||||
same as attrset(A_NORMAL); that is, it turns off all attributes.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
attroff Y Y Y
|
||||
wattroff Y Y Y
|
||||
attron Y Y Y
|
||||
wattron Y Y Y
|
||||
attrset Y Y Y
|
||||
wattrset Y Y Y
|
||||
standend Y Y Y
|
||||
wstandend Y Y Y
|
||||
standout Y Y Y
|
||||
wstandout Y Y Y
|
||||
color_set Y
|
||||
wcolor_set Y
|
||||
attr_get Y
|
||||
wattr_get Y
|
||||
attr_on Y
|
||||
wattr_on Y
|
||||
attr_off Y
|
||||
wattr_off Y
|
||||
attr_set Y
|
||||
wattr_set Y
|
||||
chgat Y
|
||||
wchgat Y
|
||||
mvchgat Y
|
||||
mvwchgat Y
|
||||
getattrs -
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
attroff Y Y Y
|
||||
wattroff Y Y Y
|
||||
attron Y Y Y
|
||||
wattron Y Y Y
|
||||
attrset Y Y Y
|
||||
wattrset Y Y Y
|
||||
standend Y Y Y
|
||||
wstandend Y Y Y
|
||||
standout Y Y Y
|
||||
wstandout Y Y Y
|
||||
color_set Y
|
||||
wcolor_set Y
|
||||
attr_get Y
|
||||
wattr_get Y
|
||||
attr_on Y
|
||||
wattr_on Y
|
||||
attr_off Y
|
||||
wattr_off Y
|
||||
attr_set Y
|
||||
wattr_set Y
|
||||
chgat Y
|
||||
wchgat Y
|
||||
mvchgat Y
|
||||
mvwchgat Y
|
||||
getattrs -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,30 +2,33 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: beep.c,v 1.34 2008/07/13 16:08:17 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: beep
|
||||
beep
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
int beep(void);
|
||||
int flash(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
beep() sounds the audible bell on the terminal, if possible;
|
||||
if not, it calls flash().
|
||||
int beep(void);
|
||||
int flash(void);
|
||||
|
||||
flash() "flashes" the screen, by inverting the foreground and
|
||||
background of every cell, pausing, and then restoring the
|
||||
original attributes.
|
||||
### Description
|
||||
|
||||
Return Value:
|
||||
These functions return OK.
|
||||
beep() sounds the audible bell on the terminal, if possible;
|
||||
if not, it calls flash().
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
beep Y Y Y
|
||||
flash Y Y Y
|
||||
flash() "flashes" the screen, by inverting the foreground and
|
||||
background of every cell, pausing, and then restoring the
|
||||
original attributes.
|
||||
|
||||
### Return Value
|
||||
|
||||
These functions return OK.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
beep Y Y Y
|
||||
flash Y Y Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,58 +2,61 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: bkgd.c,v 1.39 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: bkgd
|
||||
bkgd
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
int bkgd(chtype ch);
|
||||
void bkgdset(chtype ch);
|
||||
chtype getbkgd(WINDOW *win);
|
||||
int wbkgd(WINDOW *win, chtype ch);
|
||||
void wbkgdset(WINDOW *win, chtype ch);
|
||||
### Synopsis
|
||||
|
||||
int bkgrnd(const cchar_t *wch);
|
||||
void bkgrndset(const cchar_t *wch);
|
||||
int getbkgrnd(cchar_t *wch);
|
||||
int wbkgrnd(WINDOW *win, const cchar_t *wch);
|
||||
void wbkgrndset(WINDOW *win, const cchar_t *wch);
|
||||
int wgetbkgrnd(WINDOW *win, cchar_t *wch);
|
||||
int bkgd(chtype ch);
|
||||
void bkgdset(chtype ch);
|
||||
chtype getbkgd(WINDOW *win);
|
||||
int wbkgd(WINDOW *win, chtype ch);
|
||||
void wbkgdset(WINDOW *win, chtype ch);
|
||||
|
||||
Description:
|
||||
bkgdset() and wbkgdset() manipulate the background of a window.
|
||||
The background is a chtype consisting of any combination of
|
||||
attributes and a character; it is combined with each chtype
|
||||
added or inserted to the window by waddch() or winsch(). Only
|
||||
the attribute part is used to set the background of non-blank
|
||||
characters, while both character and attributes are used for
|
||||
blank positions.
|
||||
int bkgrnd(const cchar_t *wch);
|
||||
void bkgrndset(const cchar_t *wch);
|
||||
int getbkgrnd(cchar_t *wch);
|
||||
int wbkgrnd(WINDOW *win, const cchar_t *wch);
|
||||
void wbkgrndset(WINDOW *win, const cchar_t *wch);
|
||||
int wgetbkgrnd(WINDOW *win, cchar_t *wch);
|
||||
|
||||
bkgd() and wbkgd() not only change the background, but apply it
|
||||
immediately to every cell in the window.
|
||||
### Description
|
||||
|
||||
The attributes that are defined with the attrset()/attron() set
|
||||
of functions take precedence over the background attributes if
|
||||
there is a conflict (e.g., different color pairs).
|
||||
bkgdset() and wbkgdset() manipulate the background of a window.
|
||||
The background is a chtype consisting of any combination of
|
||||
attributes and a character; it is combined with each chtype
|
||||
added or inserted to the window by waddch() or winsch(). Only
|
||||
the attribute part is used to set the background of non-blank
|
||||
characters, while both character and attributes are used for
|
||||
blank positions.
|
||||
|
||||
Return Value:
|
||||
bkgd() and wbkgd() return OK, unless the window is NULL, in
|
||||
which case they return ERR.
|
||||
bkgd() and wbkgd() not only change the background, but apply it
|
||||
immediately to every cell in the window.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
bkgd Y - 4.0
|
||||
bkgdset Y - 4.0
|
||||
getbkgd Y
|
||||
wbkgd Y - 4.0
|
||||
wbkgdset Y - 4.0
|
||||
bkgrnd Y
|
||||
bkgrndset Y
|
||||
getbkgrnd Y
|
||||
wbkgrnd Y
|
||||
wbkgrndset Y
|
||||
wgetbkgrnd Y
|
||||
The attributes that are defined with the attrset()/attron() set
|
||||
of functions take precedence over the background attributes if
|
||||
there is a conflict (e.g., different color pairs).
|
||||
|
||||
### Return Value
|
||||
|
||||
bkgd() and wbkgd() return OK, unless the window is NULL, in
|
||||
which case they return ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
bkgd Y - 4.0
|
||||
bkgdset Y - 4.0
|
||||
getbkgd Y
|
||||
wbkgd Y - 4.0
|
||||
wbkgdset Y - 4.0
|
||||
bkgrnd Y
|
||||
bkgrndset Y
|
||||
getbkgrnd Y
|
||||
wbkgrnd Y
|
||||
wbkgrndset Y
|
||||
wgetbkgrnd Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,95 +2,98 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: border.c,v 1.53 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: border
|
||||
border
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl,
|
||||
chtype tr, chtype bl, chtype br);
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts,
|
||||
chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
|
||||
int box(WINDOW *win, chtype verch, chtype horch);
|
||||
int hline(chtype ch, int n);
|
||||
int vline(chtype ch, int n);
|
||||
int whline(WINDOW *win, chtype ch, int n);
|
||||
int wvline(WINDOW *win, chtype ch, int n);
|
||||
int mvhline(int y, int x, chtype ch, int n);
|
||||
int mvvline(int y, int x, chtype ch, int n);
|
||||
int mvwhline(WINDOW *win, int y, int x, chtype ch, int n);
|
||||
int mvwvline(WINDOW *win, int y, int x, chtype ch, int n);
|
||||
### Synopsis
|
||||
|
||||
int border_set(const cchar_t *ls, const cchar_t *rs,
|
||||
const cchar_t *ts, const cchar_t *bs,
|
||||
const cchar_t *tl, const cchar_t *tr,
|
||||
const cchar_t *bl, const cchar_t *br);
|
||||
int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs,
|
||||
const cchar_t *ts, const cchar_t *bs,
|
||||
const cchar_t *tl, const cchar_t *tr,
|
||||
const cchar_t *bl, const cchar_t *br);
|
||||
int box_set(WINDOW *win, const cchar_t *verch, const cchar_t *horch);
|
||||
int hline_set(const cchar_t *wch, int n);
|
||||
int vline_set(const cchar_t *wch, int n);
|
||||
int whline_set(WINDOW *win, const cchar_t *wch, int n);
|
||||
int wvline_set(WINDOW *win, const cchar_t *wch, int n);
|
||||
int mvhline_set(int y, int x, const cchar_t *wch, int n);
|
||||
int mvvline_set(int y, int x, const cchar_t *wch, int n);
|
||||
int mvwhline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n);
|
||||
int mvwvline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n);
|
||||
int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl,
|
||||
chtype tr, chtype bl, chtype br);
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts,
|
||||
chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
|
||||
int box(WINDOW *win, chtype verch, chtype horch);
|
||||
int hline(chtype ch, int n);
|
||||
int vline(chtype ch, int n);
|
||||
int whline(WINDOW *win, chtype ch, int n);
|
||||
int wvline(WINDOW *win, chtype ch, int n);
|
||||
int mvhline(int y, int x, chtype ch, int n);
|
||||
int mvvline(int y, int x, chtype ch, int n);
|
||||
int mvwhline(WINDOW *win, int y, int x, chtype ch, int n);
|
||||
int mvwvline(WINDOW *win, int y, int x, chtype ch, int n);
|
||||
|
||||
Description:
|
||||
border(), wborder(), and box() draw a border around the edge of
|
||||
the window. If any argument is zero, an appropriate default is
|
||||
used:
|
||||
int border_set(const cchar_t *ls, const cchar_t *rs,
|
||||
const cchar_t *ts, const cchar_t *bs,
|
||||
const cchar_t *tl, const cchar_t *tr,
|
||||
const cchar_t *bl, const cchar_t *br);
|
||||
int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs,
|
||||
const cchar_t *ts, const cchar_t *bs,
|
||||
const cchar_t *tl, const cchar_t *tr,
|
||||
const cchar_t *bl, const cchar_t *br);
|
||||
int box_set(WINDOW *win, const cchar_t *verch, const cchar_t *horch);
|
||||
int hline_set(const cchar_t *wch, int n);
|
||||
int vline_set(const cchar_t *wch, int n);
|
||||
int whline_set(WINDOW *win, const cchar_t *wch, int n);
|
||||
int wvline_set(WINDOW *win, const cchar_t *wch, int n);
|
||||
int mvhline_set(int y, int x, const cchar_t *wch, int n);
|
||||
int mvvline_set(int y, int x, const cchar_t *wch, int n);
|
||||
int mvwhline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n);
|
||||
int mvwvline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n);
|
||||
|
||||
ls left side of border ACS_VLINE
|
||||
rs right side of border ACS_VLINE
|
||||
ts top side of border ACS_HLINE
|
||||
bs bottom side of border ACS_HLINE
|
||||
tl top left corner of border ACS_ULCORNER
|
||||
tr top right corner of border ACS_URCORNER
|
||||
bl bottom left corner of border ACS_LLCORNER
|
||||
br bottom right corner of border ACS_LRCORNER
|
||||
### Description
|
||||
|
||||
hline() and whline() draw a horizontal line, using ch, starting
|
||||
from the current cursor position. The cursor position does not
|
||||
change. The line is at most n characters long, or as many as
|
||||
will fit in the window.
|
||||
border(), wborder(), and box() draw a border around the edge of
|
||||
the window. If any argument is zero, an appropriate default is
|
||||
used:
|
||||
|
||||
vline() and wvline() draw a vertical line, using ch, starting
|
||||
from the current cursor position. The cursor position does not
|
||||
change. The line is at most n characters long, or as many as
|
||||
will fit in the window.
|
||||
ls left side of border ACS_VLINE
|
||||
rs right side of border ACS_VLINE
|
||||
ts top side of border ACS_HLINE
|
||||
bs bottom side of border ACS_HLINE
|
||||
tl top left corner of border ACS_ULCORNER
|
||||
tr top right corner of border ACS_URCORNER
|
||||
bl bottom left corner of border ACS_LLCORNER
|
||||
br bottom right corner of border ACS_LRCORNER
|
||||
|
||||
Return Value:
|
||||
These functions return OK on success and ERR on error.
|
||||
hline() and whline() draw a horizontal line, using ch, starting
|
||||
from the current cursor position. The cursor position does not
|
||||
change. The line is at most n characters long, or as many as
|
||||
will fit in the window.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
border Y - 4.0
|
||||
wborder Y - 4.0
|
||||
box Y Y Y
|
||||
hline Y - 4.0
|
||||
vline Y - 4.0
|
||||
whline Y - 4.0
|
||||
wvline Y - 4.0
|
||||
mvhline Y
|
||||
mvvline Y
|
||||
mvwhline Y
|
||||
mvwvline Y
|
||||
border_set Y
|
||||
wborder_set Y
|
||||
box_set Y
|
||||
hline_set Y
|
||||
vline_set Y
|
||||
whline_set Y
|
||||
wvline_set Y
|
||||
mvhline_set Y
|
||||
mvvline_set Y
|
||||
mvwhline_set Y
|
||||
mvwvline_set Y
|
||||
vline() and wvline() draw a vertical line, using ch, starting
|
||||
from the current cursor position. The cursor position does not
|
||||
change. The line is at most n characters long, or as many as
|
||||
will fit in the window.
|
||||
|
||||
### Return Value
|
||||
|
||||
These functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
border Y - 4.0
|
||||
wborder Y - 4.0
|
||||
box Y Y Y
|
||||
hline Y - 4.0
|
||||
vline Y - 4.0
|
||||
whline Y - 4.0
|
||||
wvline Y - 4.0
|
||||
mvhline Y
|
||||
mvvline Y
|
||||
mvwhline Y
|
||||
mvwvline Y
|
||||
border_set Y
|
||||
wborder_set Y
|
||||
box_set Y
|
||||
hline_set Y
|
||||
vline_set Y
|
||||
whline_set Y
|
||||
wvline_set Y
|
||||
mvhline_set Y
|
||||
mvvline_set Y
|
||||
mvwhline_set Y
|
||||
mvwvline_set Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,48 +2,51 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: clear.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: clear
|
||||
clear
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int clear(void);
|
||||
int wclear(WINDOW *win);
|
||||
int erase(void);
|
||||
int werase(WINDOW *win);
|
||||
int clrtobot(void);
|
||||
int wclrtobot(WINDOW *win);
|
||||
int clrtoeol(void);
|
||||
int wclrtoeol(WINDOW *win);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
erase() and werase() copy blanks (i.e. the background chtype) to
|
||||
every cell of the window.
|
||||
int clear(void);
|
||||
int wclear(WINDOW *win);
|
||||
int erase(void);
|
||||
int werase(WINDOW *win);
|
||||
int clrtobot(void);
|
||||
int wclrtobot(WINDOW *win);
|
||||
int clrtoeol(void);
|
||||
int wclrtoeol(WINDOW *win);
|
||||
|
||||
clear() and wclear() are similar to erase() and werase(), but
|
||||
they also call clearok() to ensure that the the window is
|
||||
cleared on the next wrefresh().
|
||||
### Description
|
||||
|
||||
clrtobot() and wclrtobot() clear the window from the current
|
||||
cursor position to the end of the window.
|
||||
erase() and werase() copy blanks (i.e. the background chtype) to
|
||||
every cell of the window.
|
||||
|
||||
clrtoeol() and wclrtoeol() clear the window from the current
|
||||
cursor position to the end of the current line.
|
||||
clear() and wclear() are similar to erase() and werase(), but
|
||||
they also call clearok() to ensure that the the window is
|
||||
cleared on the next wrefresh().
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
clrtobot() and wclrtobot() clear the window from the current
|
||||
cursor position to the end of the window.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
clear Y Y Y
|
||||
wclear Y Y Y
|
||||
erase Y Y Y
|
||||
werase Y Y Y
|
||||
clrtobot Y Y Y
|
||||
wclrtobot Y Y Y
|
||||
clrtoeol Y Y Y
|
||||
wclrtoeol Y Y Y
|
||||
clrtoeol() and wclrtoeol() clear the window from the current
|
||||
cursor position to the end of the current line.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
clear Y Y Y
|
||||
wclear Y Y Y
|
||||
erase Y Y Y
|
||||
werase Y Y Y
|
||||
clrtobot Y Y Y
|
||||
wclrtobot Y Y Y
|
||||
clrtoeol Y Y Y
|
||||
wclrtoeol Y Y Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -86,14 +89,16 @@ int clrtoeol(void)
|
||||
|
||||
int wclrtobot(WINDOW *win)
|
||||
{
|
||||
int savey = win->_cury;
|
||||
int savex = win->_curx;
|
||||
int savey, savex;
|
||||
|
||||
PDC_LOG(("wclrtobot() - called\n"));
|
||||
|
||||
if (!win)
|
||||
return ERR;
|
||||
|
||||
savey = win->_cury;
|
||||
savex = win->_curx;
|
||||
|
||||
/* should this involve scrolling region somehow ? */
|
||||
|
||||
if (win->_cury + 1 < win->_maxy)
|
||||
|
||||
143
pdcurses/color.c
143
pdcurses/color.c
@@ -2,92 +2,95 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: color.c,v 1.83 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: color
|
||||
color
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int start_color(void);
|
||||
int init_pair(short pair, short fg, short bg);
|
||||
int init_color(short color, short red, short green, short blue);
|
||||
bool has_colors(void);
|
||||
bool can_change_color(void);
|
||||
int color_content(short color, short *red, short *green, short *blue);
|
||||
int pair_content(short pair, short *fg, short *bg);
|
||||
### Synopsis
|
||||
|
||||
int assume_default_colors(int f, int b);
|
||||
int use_default_colors(void);
|
||||
int start_color(void);
|
||||
int init_pair(short pair, short fg, short bg);
|
||||
int init_color(short color, short red, short green, short blue);
|
||||
bool has_colors(void);
|
||||
bool can_change_color(void);
|
||||
int color_content(short color, short *red, short *green, short *blue);
|
||||
int pair_content(short pair, short *fg, short *bg);
|
||||
|
||||
int PDC_set_line_color(short color);
|
||||
int assume_default_colors(int f, int b);
|
||||
int use_default_colors(void);
|
||||
|
||||
Description:
|
||||
To use these routines, start_color() must be called, usually
|
||||
immediately after initscr(). Colors are always used in pairs,
|
||||
referred to as color-pairs. A color-pair consists of a
|
||||
foreground color and a background color. A color-pair is
|
||||
initialized via init_pair(). After initialization, COLOR_PAIR(n)
|
||||
can be used like any other video attribute.
|
||||
int PDC_set_line_color(short color);
|
||||
|
||||
start_color() initializes eight basic colors (black, red, green,
|
||||
yellow, blue, magenta, cyan, and white), and two global
|
||||
variables; COLORS and COLOR_PAIRS (respectively defining the
|
||||
maximum number of colors and color-pairs the terminal is capable
|
||||
of displaying).
|
||||
### Description
|
||||
|
||||
init_pair() changes the definition of a color-pair. It takes
|
||||
three arguments: the number of the color-pair to be redefined,
|
||||
and the new values of the foreground and background colors. The
|
||||
pair number must be between 0 and COLOR_PAIRS - 1, inclusive.
|
||||
The foreground and background must be between 0 and COLORS - 1,
|
||||
inclusive. If the color pair was previously initialized, the
|
||||
screen is refreshed, and all occurrences of that color-pair are
|
||||
changed to the new definition.
|
||||
To use these routines, start_color() must be called, usually
|
||||
immediately after initscr(). Colors are always used in pairs,
|
||||
referred to as color-pairs. A color-pair consists of a
|
||||
foreground color and a background color. A color-pair is
|
||||
initialized via init_pair(). After initialization, COLOR_PAIR(n)
|
||||
can be used like any other video attribute.
|
||||
|
||||
has_colors() indicates if the terminal supports, and can
|
||||
maniplulate color. It returns TRUE or FALSE.
|
||||
start_color() initializes eight basic colors (black, red, green,
|
||||
yellow, blue, magenta, cyan, and white), and two global
|
||||
variables; COLORS and COLOR_PAIRS (respectively defining the
|
||||
maximum number of colors and color-pairs the terminal is capable
|
||||
of displaying).
|
||||
|
||||
can_change_color() indicates if the terminal has the capability
|
||||
to change the definition of its colors.
|
||||
init_pair() changes the definition of a color-pair. It takes
|
||||
three arguments: the number of the color-pair to be redefined,
|
||||
and the new values of the foreground and background colors. The
|
||||
pair number must be between 0 and COLOR_PAIRS - 1, inclusive.
|
||||
The foreground and background must be between 0 and COLORS - 1,
|
||||
inclusive. If the color pair was previously initialized, the
|
||||
screen is refreshed, and all occurrences of that color-pair are
|
||||
changed to the new definition.
|
||||
|
||||
pair_content() is used to determine what the colors of a given
|
||||
color-pair consist of.
|
||||
has_colors() indicates if the terminal supports, and can
|
||||
maniplulate color. It returns TRUE or FALSE.
|
||||
|
||||
assume_default_colors() and use_default_colors() emulate the
|
||||
ncurses extensions of the same names. assume_default_colors(f,
|
||||
b) is essentially the same as init_pair(0, f, b) (which isn't
|
||||
allowed); it redefines the default colors. use_default_colors()
|
||||
allows the use of -1 as a foreground or background color with
|
||||
init_pair(), and calls assume_default_colors(-1, -1); -1
|
||||
represents the foreground or background color that the terminal
|
||||
had at startup. If the environment variable PDC_ORIGINAL_COLORS
|
||||
is set at the time start_color() is called, that's equivalent to
|
||||
calling use_default_colors().
|
||||
can_change_color() indicates if the terminal has the capability
|
||||
to change the definition of its colors.
|
||||
|
||||
PDC_set_line_color() is used to set the color, globally, for
|
||||
the color of the lines drawn for the attributes: A_UNDERLINE,
|
||||
A_OVERLINE, A_LEFTLINE and A_RIGHTLINE. A value of -1 (the
|
||||
default) indicates that the current foreground color should be
|
||||
used.
|
||||
pair_content() is used to determine what the colors of a given
|
||||
color-pair consist of.
|
||||
|
||||
NOTE: COLOR_PAIR() and PAIR_NUMBER() are implemented as macros.
|
||||
assume_default_colors() and use_default_colors() emulate the
|
||||
ncurses extensions of the same names. assume_default_colors(f,
|
||||
b) is essentially the same as init_pair(0, f, b) (which isn't
|
||||
allowed); it redefines the default colors. use_default_colors()
|
||||
allows the use of -1 as a foreground or background color with
|
||||
init_pair(), and calls assume_default_colors(-1, -1); -1
|
||||
represents the foreground or background color that the terminal
|
||||
had at startup. If the environment variable PDC_ORIGINAL_COLORS
|
||||
is set at the time start_color() is called, that's equivalent to
|
||||
calling use_default_colors().
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error, except for
|
||||
has_colors() and can_change_colors(), which return TRUE or FALSE.
|
||||
PDC_set_line_color() is used to set the color, globally, for
|
||||
the color of the lines drawn for the attributes: A_UNDERLINE,
|
||||
A_OVERLINE, A_LEFTLINE and A_RIGHTLINE. A value of -1 (the
|
||||
default) indicates that the current foreground color should be
|
||||
used.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
start_color Y - 3.2
|
||||
init_pair Y - 3.2
|
||||
init_color Y - 3.2
|
||||
has_colors Y - 3.2
|
||||
can_change_color Y - 3.2
|
||||
color_content Y - 3.2
|
||||
pair_content Y - 3.2
|
||||
assume_default_colors - - -
|
||||
use_default_colors - - -
|
||||
PDC_set_line_color - - -
|
||||
NOTE: COLOR_PAIR() and PAIR_NUMBER() are implemented as macros.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error, except for
|
||||
has_colors() and can_change_colors(), which return TRUE or FALSE.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
start_color Y - 3.2
|
||||
init_pair Y - 3.2
|
||||
init_color Y - 3.2
|
||||
has_colors Y - 3.2
|
||||
can_change_color Y - 3.2
|
||||
color_content Y - 3.2
|
||||
pair_content Y - 3.2
|
||||
assume_default_colors - - -
|
||||
use_default_colors - - -
|
||||
PDC_set_line_color - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,30 +2,32 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: debug.c,v 1.7 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: debug
|
||||
debug
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
void traceon(void);
|
||||
void traceoff(void);
|
||||
void PDC_debug(const char *, ...);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
traceon() and traceoff() toggle the recording of debugging
|
||||
information to the file "trace". Although not standard, similar
|
||||
functions are in some other curses implementations.
|
||||
void traceon(void);
|
||||
void traceoff(void);
|
||||
void PDC_debug(const char *, ...);
|
||||
|
||||
PDC_debug() is the function that writes to the file, based on
|
||||
whether traceon() has been called. It's used from the PDC_LOG()
|
||||
macro.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
traceon - - -
|
||||
traceoff - - -
|
||||
PDC_debug - - -
|
||||
traceon() and traceoff() toggle the recording of debugging
|
||||
information to the file "trace". Although not standard, similar
|
||||
functions are in some other curses implementations.
|
||||
|
||||
PDC_debug() is the function that writes to the file, based on
|
||||
whether traceon() has been called. It's used from the PDC_LOG()
|
||||
macro.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
traceon - - -
|
||||
traceoff - - -
|
||||
PDC_debug - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,33 +2,36 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: delch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: delch
|
||||
delch
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int delch(void);
|
||||
int wdelch(WINDOW *win);
|
||||
int mvdelch(int y, int x);
|
||||
int mvwdelch(WINDOW *win, int y, int x);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
The character under the cursor in the window is deleted. All
|
||||
characters to the right on the same line are moved to the left
|
||||
one position and the last character on the line is filled with
|
||||
a blank. The cursor position does not change (after moving to
|
||||
y, x if coordinates are specified).
|
||||
int delch(void);
|
||||
int wdelch(WINDOW *win);
|
||||
int mvdelch(int y, int x);
|
||||
int mvwdelch(WINDOW *win, int y, int x);
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
delch Y Y Y
|
||||
wdelch Y Y Y
|
||||
mvdelch Y Y Y
|
||||
mvwdelch Y Y Y
|
||||
The character under the cursor in the window is deleted. All
|
||||
characters to the right on the same line are moved to the left
|
||||
one position and the last character on the line is filled with
|
||||
a blank. The cursor position does not change (after moving to
|
||||
y, x if coordinates are specified).
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
delch Y Y Y
|
||||
wdelch Y Y Y
|
||||
mvdelch Y Y Y
|
||||
mvwdelch Y Y Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,51 +2,54 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: deleteln.c,v 1.35 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: deleteln
|
||||
deleteln
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int deleteln(void);
|
||||
int wdeleteln(WINDOW *win);
|
||||
int insdelln(int n);
|
||||
int winsdelln(WINDOW *win, int n);
|
||||
int insertln(void);
|
||||
int winsertln(WINDOW *win);
|
||||
### Synopsis
|
||||
|
||||
int mvdeleteln(int y, int x);
|
||||
int mvwdeleteln(WINDOW *win, int y, int x);
|
||||
int mvinsertln(int y, int x);
|
||||
int mvwinsertln(WINDOW *win, int y, int x);
|
||||
int deleteln(void);
|
||||
int wdeleteln(WINDOW *win);
|
||||
int insdelln(int n);
|
||||
int winsdelln(WINDOW *win, int n);
|
||||
int insertln(void);
|
||||
int winsertln(WINDOW *win);
|
||||
|
||||
Description:
|
||||
With the deleteln() and wdeleteln() functions, the line under
|
||||
the cursor in the window is deleted. All lines below the
|
||||
current line are moved up one line. The bottom line of the
|
||||
window is cleared. The cursor position does not change.
|
||||
int mvdeleteln(int y, int x);
|
||||
int mvwdeleteln(WINDOW *win, int y, int x);
|
||||
int mvinsertln(int y, int x);
|
||||
int mvwinsertln(WINDOW *win, int y, int x);
|
||||
|
||||
With the insertln() and winsertn() functions, a blank line is
|
||||
inserted above the current line and the bottom line is lost.
|
||||
### Description
|
||||
|
||||
mvdeleteln(), mvwdeleteln(), mvinsertln() and mvwinsertln()
|
||||
allow moving the cursor and inserting/deleting in one call.
|
||||
With the deleteln() and wdeleteln() functions, the line under
|
||||
the cursor in the window is deleted. All lines below the
|
||||
current line are moved up one line. The bottom line of the
|
||||
window is cleared. The cursor position does not change.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
With the insertln() and winsertn() functions, a blank line is
|
||||
inserted above the current line and the bottom line is lost.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
deleteln Y Y Y
|
||||
wdeleteln Y Y Y
|
||||
mvdeleteln - - -
|
||||
mvwdeleteln - - -
|
||||
insdelln Y - 4.0
|
||||
winsdelln Y - 4.0
|
||||
insertln Y Y Y
|
||||
winsertln Y Y Y
|
||||
mvinsertln - - -
|
||||
mvwinsertln - - -
|
||||
mvdeleteln(), mvwdeleteln(), mvinsertln() and mvwinsertln()
|
||||
allow moving the cursor and inserting/deleting in one call.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
deleteln Y Y Y
|
||||
wdeleteln Y Y Y
|
||||
mvdeleteln - - -
|
||||
mvwdeleteln - - -
|
||||
insdelln Y - 4.0
|
||||
winsdelln Y - 4.0
|
||||
insertln Y Y Y
|
||||
winsertln Y Y Y
|
||||
mvinsertln - - -
|
||||
mvwinsertln - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: deprec.c,v 1.6 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/* Deprecated functions. These should not be used, and will eventually
|
||||
be removed. They're here solely for the benefit of applications that
|
||||
linked to them in older versions of PDCurses. */
|
||||
|
||||
127
pdcurses/getch.c
127
pdcurses/getch.c
@@ -2,82 +2,85 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: getch.c,v 1.72 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: getch
|
||||
getch
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int getch(void);
|
||||
int wgetch(WINDOW *win);
|
||||
int mvgetch(int y, int x);
|
||||
int mvwgetch(WINDOW *win, int y, int x);
|
||||
int ungetch(int ch);
|
||||
int flushinp(void);
|
||||
### Synopsis
|
||||
|
||||
int get_wch(wint_t *wch);
|
||||
int wget_wch(WINDOW *win, wint_t *wch);
|
||||
int mvget_wch(int y, int x, wint_t *wch);
|
||||
int mvwget_wch(WINDOW *win, int y, int x, wint_t *wch);
|
||||
int unget_wch(const wchar_t wch);
|
||||
int getch(void);
|
||||
int wgetch(WINDOW *win);
|
||||
int mvgetch(int y, int x);
|
||||
int mvwgetch(WINDOW *win, int y, int x);
|
||||
int ungetch(int ch);
|
||||
int flushinp(void);
|
||||
|
||||
unsigned long PDC_get_key_modifiers(void);
|
||||
int PDC_save_key_modifiers(bool flag);
|
||||
int PDC_return_key_modifiers(bool flag);
|
||||
int get_wch(wint_t *wch);
|
||||
int wget_wch(WINDOW *win, wint_t *wch);
|
||||
int mvget_wch(int y, int x, wint_t *wch);
|
||||
int mvwget_wch(WINDOW *win, int y, int x, wint_t *wch);
|
||||
int unget_wch(const wchar_t wch);
|
||||
|
||||
Description:
|
||||
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
|
||||
a character is read from the terminal associated with the window.
|
||||
In nodelay mode, if there is no input waiting, the value ERR is
|
||||
returned. In delay mode, the program will hang until the system
|
||||
passes text through to the program. Depending on the setting of
|
||||
cbreak(), this will be after one character or after the first
|
||||
newline. Unless noecho() has been set, the character will also
|
||||
be echoed into the designated window.
|
||||
unsigned long PDC_get_key_modifiers(void);
|
||||
int PDC_save_key_modifiers(bool flag);
|
||||
int PDC_return_key_modifiers(bool flag);
|
||||
|
||||
If keypad() is TRUE, and a function key is pressed, the token for
|
||||
that function key will be returned instead of the raw characters.
|
||||
Possible function keys are defined in <curses.h> with integers
|
||||
beginning with 0401, whose names begin with KEY_.
|
||||
### Description
|
||||
|
||||
If nodelay(win, TRUE) has been called on the window and no input
|
||||
is waiting, the value ERR is returned.
|
||||
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
|
||||
a character is read from the terminal associated with the window.
|
||||
In nodelay mode, if there is no input waiting, the value ERR is
|
||||
returned. In delay mode, the program will hang until the system
|
||||
passes text through to the program. Depending on the setting of
|
||||
cbreak(), this will be after one character or after the first
|
||||
newline. Unless noecho() has been set, the character will also
|
||||
be echoed into the designated window.
|
||||
|
||||
ungetch() places ch back onto the input queue to be returned by
|
||||
the next call to wgetch().
|
||||
If keypad() is TRUE, and a function key is pressed, the token for
|
||||
that function key will be returned instead of the raw characters.
|
||||
Possible function keys are defined in <curses.h> with integers
|
||||
beginning with 0401, whose names begin with KEY_.
|
||||
|
||||
flushinp() throws away any type-ahead that has been typed by the
|
||||
user and has not yet been read by the program.
|
||||
If nodelay(win, TRUE) has been called on the window and no input
|
||||
is waiting, the value ERR is returned.
|
||||
|
||||
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
|
||||
control, alt, numlock) effective at the time of the last getch()
|
||||
call, if PDC_save_key_modifiers(TRUE) has been called before the
|
||||
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
|
||||
modifier(s) were set. PDC_return_key_modifiers() tells getch()
|
||||
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
|
||||
etc.). These may not work on all platforms.
|
||||
ungetch() places ch back onto the input queue to be returned by
|
||||
the next call to wgetch().
|
||||
|
||||
NOTE: getch() and ungetch() are implemented as macros, to avoid
|
||||
conflict with many DOS compiler's runtime libraries.
|
||||
flushinp() throws away any type-ahead that has been typed by the
|
||||
user and has not yet been read by the program.
|
||||
|
||||
Return Value:
|
||||
These functions return ERR or the value of the character, meta
|
||||
character or function key token.
|
||||
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
|
||||
control, alt, numlock) effective at the time of the last getch()
|
||||
call, if PDC_save_key_modifiers(TRUE) has been called before the
|
||||
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
|
||||
modifier(s) were set. PDC_return_key_modifiers() tells getch()
|
||||
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
|
||||
etc.). These may not work on all platforms.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
getch Y Y Y
|
||||
wgetch Y Y Y
|
||||
mvgetch Y Y Y
|
||||
mvwgetch Y Y Y
|
||||
ungetch Y Y Y
|
||||
flushinp Y Y Y
|
||||
get_wch Y
|
||||
wget_wch Y
|
||||
mvget_wch Y
|
||||
mvwget_wch Y
|
||||
unget_wch Y
|
||||
PDC_get_key_modifiers - - -
|
||||
NOTE: getch() and ungetch() are implemented as macros, to avoid
|
||||
conflict with many DOS compiler's runtime libraries.
|
||||
|
||||
### Return Value
|
||||
|
||||
These functions return ERR or the value of the character, meta
|
||||
character or function key token.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
getch Y Y Y
|
||||
wgetch Y Y Y
|
||||
mvgetch Y Y Y
|
||||
mvwgetch Y Y Y
|
||||
ungetch Y Y Y
|
||||
flushinp Y Y Y
|
||||
get_wch Y
|
||||
wget_wch Y
|
||||
mvget_wch Y
|
||||
mvwget_wch Y
|
||||
unget_wch Y
|
||||
PDC_get_key_modifiers - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,65 +2,68 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: getstr.c,v 1.51 2008/07/14 04:24:51 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: getstr
|
||||
getstr
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int getstr(char *str);
|
||||
int wgetstr(WINDOW *win, char *str);
|
||||
int mvgetstr(int y, int x, char *str);
|
||||
int mvwgetstr(WINDOW *win, int y, int x, char *str);
|
||||
int getnstr(char *str, int n);
|
||||
int wgetnstr(WINDOW *win, char *str, int n);
|
||||
int mvgetnstr(int y, int x, char *str, int n);
|
||||
int mvwgetnstr(WINDOW *win, int y, int x, char *str, int n);
|
||||
### Synopsis
|
||||
|
||||
int get_wstr(wint_t *wstr);
|
||||
int wget_wstr(WINDOW *win, wint_t *wstr);
|
||||
int mvget_wstr(int y, int x, wint_t *wstr);
|
||||
int mvwget_wstr(WINDOW *win, int, int, wint_t *wstr);
|
||||
int getn_wstr(wint_t *wstr, int n);
|
||||
int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
|
||||
int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
|
||||
int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
|
||||
int getstr(char *str);
|
||||
int wgetstr(WINDOW *win, char *str);
|
||||
int mvgetstr(int y, int x, char *str);
|
||||
int mvwgetstr(WINDOW *win, int y, int x, char *str);
|
||||
int getnstr(char *str, int n);
|
||||
int wgetnstr(WINDOW *win, char *str, int n);
|
||||
int mvgetnstr(int y, int x, char *str, int n);
|
||||
int mvwgetnstr(WINDOW *win, int y, int x, char *str, int n);
|
||||
|
||||
Description:
|
||||
These routines call wgetch() repeatedly to build a string,
|
||||
interpreting erase and kill characters along the way, until a
|
||||
newline or carriage return is received. When PDCurses is built
|
||||
with wide-character support enabled, the narrow-character
|
||||
functions convert the wgetch()'d values into a multibyte string
|
||||
in the current locale before returning it. The resulting string
|
||||
is placed in the area pointed to by *str. The routines with n as
|
||||
the last argument read at most n characters.
|
||||
int get_wstr(wint_t *wstr);
|
||||
int wget_wstr(WINDOW *win, wint_t *wstr);
|
||||
int mvget_wstr(int y, int x, wint_t *wstr);
|
||||
int mvwget_wstr(WINDOW *win, int, int, wint_t *wstr);
|
||||
int getn_wstr(wint_t *wstr, int n);
|
||||
int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
|
||||
int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
|
||||
int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
|
||||
|
||||
Note that there's no way to know how long the buffer passed to
|
||||
wgetstr() is, so use wgetnstr() to avoid buffer overflows.
|
||||
### Description
|
||||
|
||||
Return Value:
|
||||
This functions return ERR on failure or any other value on
|
||||
success.
|
||||
These routines call wgetch() repeatedly to build a string,
|
||||
interpreting erase and kill characters along the way, until a
|
||||
newline or carriage return is received. When PDCurses is built
|
||||
with wide-character support enabled, the narrow-character
|
||||
functions convert the wgetch()'d values into a multibyte string
|
||||
in the current locale before returning it. The resulting string
|
||||
is placed in the area pointed to by *str. The routines with n as
|
||||
the last argument read at most n characters.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
getstr Y Y Y
|
||||
wgetstr Y Y Y
|
||||
mvgetstr Y Y Y
|
||||
mvwgetstr Y Y Y
|
||||
getnstr Y - 4.0
|
||||
wgetnstr Y - 4.0
|
||||
mvgetnstr Y - -
|
||||
mvwgetnstr Y - -
|
||||
get_wstr Y
|
||||
wget_wstr Y
|
||||
mvget_wstr Y
|
||||
mvwget_wstr Y
|
||||
getn_wstr Y
|
||||
wgetn_wstr Y
|
||||
mvgetn_wstr Y
|
||||
mvwgetn_wstr Y
|
||||
Note that there's no way to know how long the buffer passed to
|
||||
wgetstr() is, so use wgetnstr() to avoid buffer overflows.
|
||||
|
||||
### Return Value
|
||||
|
||||
These functions return ERR on failure or any other value on
|
||||
success.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
getstr Y Y Y
|
||||
wgetstr Y Y Y
|
||||
mvgetstr Y Y Y
|
||||
mvwgetstr Y Y Y
|
||||
getnstr Y - 4.0
|
||||
wgetnstr Y - 4.0
|
||||
mvgetnstr Y - -
|
||||
mvwgetnstr Y - -
|
||||
get_wstr Y
|
||||
wget_wstr Y
|
||||
mvget_wstr Y
|
||||
mvwget_wstr Y
|
||||
getn_wstr Y
|
||||
wgetn_wstr Y
|
||||
mvgetn_wstr Y
|
||||
mvwgetn_wstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
110
pdcurses/getyx.c
110
pdcurses/getyx.c
@@ -2,71 +2,73 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: getyx.c,v 1.29 2008/07/15 17:13:26 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: getyx
|
||||
getyx
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
void getyx(WINDOW *win, int y, int x);
|
||||
void getparyx(WINDOW *win, int y, int x);
|
||||
void getbegyx(WINDOW *win, int y, int x);
|
||||
void getmaxyx(WINDOW *win, int y, int x);
|
||||
### Synopsis
|
||||
|
||||
void getsyx(int y, int x);
|
||||
int setsyx(int y, int x);
|
||||
void getyx(WINDOW *win, int y, int x);
|
||||
void getparyx(WINDOW *win, int y, int x);
|
||||
void getbegyx(WINDOW *win, int y, int x);
|
||||
void getmaxyx(WINDOW *win, int y, int x);
|
||||
|
||||
int getbegy(WINDOW *win);
|
||||
int getbegx(WINDOW *win);
|
||||
int getcury(WINDOW *win);
|
||||
int getcurx(WINDOW *win);
|
||||
int getpary(WINDOW *win);
|
||||
int getparx(WINDOW *win);
|
||||
int getmaxy(WINDOW *win);
|
||||
int getmaxx(WINDOW *win);
|
||||
void getsyx(int y, int x);
|
||||
int setsyx(int y, int x);
|
||||
|
||||
Description:
|
||||
The getyx() macro (defined in curses.h -- the prototypes here
|
||||
are merely illustrative) puts the current cursor position of the
|
||||
specified window into y and x. getbegyx() and getmaxyx() return
|
||||
the starting coordinates and size of the specified window,
|
||||
respectively. getparyx() returns the starting coordinates of the
|
||||
parent's window, if the specified window is a subwindow;
|
||||
otherwise it sets y and x to -1. These are all macros.
|
||||
int getbegy(WINDOW *win);
|
||||
int getbegx(WINDOW *win);
|
||||
int getcury(WINDOW *win);
|
||||
int getcurx(WINDOW *win);
|
||||
int getpary(WINDOW *win);
|
||||
int getparx(WINDOW *win);
|
||||
int getmaxy(WINDOW *win);
|
||||
int getmaxx(WINDOW *win);
|
||||
|
||||
getsyx() gets the coordinates of the virtual screen cursor, and
|
||||
stores them in y and x. If leaveok() is TRUE, it returns -1, -1.
|
||||
If lines have been removed with ripoffline(), then getsyx()
|
||||
includes these lines in its count; so, the returned y and x
|
||||
values should only be used with setsyx().
|
||||
### Description
|
||||
|
||||
setsyx() sets the virtual screen cursor to the y, x coordinates.
|
||||
If y, x are -1, -1, leaveok() is set TRUE.
|
||||
The getyx() macro (defined in curses.h -- the prototypes here
|
||||
are merely illustrative) puts the current cursor position of the
|
||||
specified window into y and x. getbegyx() and getmaxyx() return
|
||||
the starting coordinates and size of the specified window,
|
||||
respectively. getparyx() returns the starting coordinates of the
|
||||
parent's window, if the specified window is a subwindow;
|
||||
otherwise it sets y and x to -1. These are all macros.
|
||||
|
||||
getsyx() and setsyx() are meant to be used by a library routine
|
||||
that manipulates curses windows without altering the position of
|
||||
the cursor. Note that getsyx() is defined only as a macro.
|
||||
getsyx() gets the coordinates of the virtual screen cursor, and
|
||||
stores them in y and x. If leaveok() is TRUE, it returns -1, -1.
|
||||
If lines have been removed with ripoffline(), then getsyx()
|
||||
includes these lines in its count; so, the returned y and x
|
||||
values should only be used with setsyx().
|
||||
|
||||
getbegy(), getbegx(), getcurx(), getcury(), getmaxy(),
|
||||
getmaxx(), getpary(), and getparx() return the appropriate
|
||||
coordinate or size values, or ERR in the case of a NULL window.
|
||||
setsyx() sets the virtual screen cursor to the y, x coordinates.
|
||||
If y, x are -1, -1, leaveok() is set TRUE.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
getyx Y Y Y
|
||||
getparyx - - 4.0
|
||||
getbegyx - - 3.0
|
||||
getmaxyx - - 3.0
|
||||
getsyx - - 3.0
|
||||
setsyx - - 3.0
|
||||
getbegy - - -
|
||||
getbegx - - -
|
||||
getcury - - -
|
||||
getcurx - - -
|
||||
getpary - - -
|
||||
getparx - - -
|
||||
getmaxy - - -
|
||||
getmaxx - - -
|
||||
getsyx() and setsyx() are meant to be used by a library routine
|
||||
that manipulates curses windows without altering the position of
|
||||
the cursor. Note that getsyx() is defined only as a macro.
|
||||
|
||||
getbegy(), getbegx(), getcurx(), getcury(), getmaxy(),
|
||||
getmaxx(), getpary(), and getparx() return the appropriate
|
||||
coordinate or size values, or ERR in the case of a NULL window.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
getyx Y Y Y
|
||||
getparyx - - 4.0
|
||||
getbegyx - - 3.0
|
||||
getmaxyx - - 3.0
|
||||
getsyx - - 3.0
|
||||
setsyx - - 3.0
|
||||
getbegy - - -
|
||||
getbegx - - -
|
||||
getcury - - -
|
||||
getcurx - - -
|
||||
getpary - - -
|
||||
getparx - - -
|
||||
getmaxy - - -
|
||||
getmaxx - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,43 +2,45 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: inch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: inch
|
||||
inch
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
chtype inch(void);
|
||||
chtype winch(WINDOW *win);
|
||||
chtype mvinch(int y, int x);
|
||||
chtype mvwinch(WINDOW *win, int y, int x);
|
||||
### Synopsis
|
||||
|
||||
int in_wch(cchar_t *wcval);
|
||||
int win_wch(WINDOW *win, cchar_t *wcval);
|
||||
int mvin_wch(int y, int x, cchar_t *wcval);
|
||||
int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
|
||||
chtype inch(void);
|
||||
chtype winch(WINDOW *win);
|
||||
chtype mvinch(int y, int x);
|
||||
chtype mvwinch(WINDOW *win, int y, int x);
|
||||
|
||||
Description:
|
||||
The inch() functions retrieve the character and attribute from
|
||||
the current or specified window position, in the form of a
|
||||
chtype. If a NULL window is specified, (chtype)ERR is returned.
|
||||
int in_wch(cchar_t *wcval);
|
||||
int win_wch(WINDOW *win, cchar_t *wcval);
|
||||
int mvin_wch(int y, int x, cchar_t *wcval);
|
||||
int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
|
||||
|
||||
The in_wch() functions are the wide-character versions; instead
|
||||
of returning a chtype, they store a cchar_t at the address
|
||||
specified by wcval, and return OK or ERR. (No value is stored
|
||||
when ERR is returned.) Note that in PDCurses, chtype and cchar_t
|
||||
are the same.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
inch Y Y Y
|
||||
winch Y Y Y
|
||||
mvinch Y Y Y
|
||||
mvwinch Y Y Y
|
||||
in_wch Y
|
||||
win_wch Y
|
||||
mvin_wch Y
|
||||
mvwin_wch Y
|
||||
The inch() functions retrieve the character and attribute from
|
||||
the current or specified window position, in the form of a
|
||||
chtype. If a NULL window is specified, (chtype)ERR is returned.
|
||||
|
||||
The in_wch() functions are the wide-character versions; instead
|
||||
of returning a chtype, they store a cchar_t at the address
|
||||
specified by wcval, and return OK or ERR. (No value is stored
|
||||
when ERR is returned.) Note that in PDCurses, chtype and cchar_t
|
||||
are the same.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
inch Y Y Y
|
||||
winch Y Y Y
|
||||
mvinch Y Y Y
|
||||
mvwinch Y Y Y
|
||||
in_wch Y
|
||||
win_wch Y
|
||||
mvin_wch Y
|
||||
mvwin_wch Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,57 +2,60 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: inchstr.c,v 1.34 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: inchstr
|
||||
inchstr
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
int inchstr(chtype *ch);
|
||||
int inchnstr(chtype *ch, int n);
|
||||
int winchstr(WINDOW *win, chtype *ch);
|
||||
int winchnstr(WINDOW *win, chtype *ch, int n);
|
||||
int mvinchstr(int y, int x, chtype *ch);
|
||||
int mvinchnstr(int y, int x, chtype *ch, int n);
|
||||
int mvwinchstr(WINDOW *, int y, int x, chtype *ch);
|
||||
int mvwinchnstr(WINDOW *, int y, int x, chtype *ch, int n);
|
||||
### Synopsis
|
||||
|
||||
int in_wchstr(cchar_t *wch);
|
||||
int in_wchnstr(cchar_t *wch, int n);
|
||||
int win_wchstr(WINDOW *win, cchar_t *wch);
|
||||
int win_wchnstr(WINDOW *win, cchar_t *wch, int n);
|
||||
int mvin_wchstr(int y, int x, cchar_t *wch);
|
||||
int mvin_wchnstr(int y, int x, cchar_t *wch, int n);
|
||||
int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wch);
|
||||
int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wch, int n);
|
||||
int inchstr(chtype *ch);
|
||||
int inchnstr(chtype *ch, int n);
|
||||
int winchstr(WINDOW *win, chtype *ch);
|
||||
int winchnstr(WINDOW *win, chtype *ch, int n);
|
||||
int mvinchstr(int y, int x, chtype *ch);
|
||||
int mvinchnstr(int y, int x, chtype *ch, int n);
|
||||
int mvwinchstr(WINDOW *, int y, int x, chtype *ch);
|
||||
int mvwinchnstr(WINDOW *, int y, int x, chtype *ch, int n);
|
||||
|
||||
Description:
|
||||
These routines read a chtype or cchar_t string from the window,
|
||||
starting at the current or specified position, and ending at the
|
||||
right margin, or after n elements, whichever is less.
|
||||
int in_wchstr(cchar_t *wch);
|
||||
int in_wchnstr(cchar_t *wch, int n);
|
||||
int win_wchstr(WINDOW *win, cchar_t *wch);
|
||||
int win_wchnstr(WINDOW *win, cchar_t *wch, int n);
|
||||
int mvin_wchstr(int y, int x, cchar_t *wch);
|
||||
int mvin_wchnstr(int y, int x, cchar_t *wch, int n);
|
||||
int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wch);
|
||||
int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wch, int n);
|
||||
|
||||
Return Value:
|
||||
All functions return the number of elements read, or ERR on
|
||||
error.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
inchstr Y - 4.0
|
||||
winchstr Y - 4.0
|
||||
mvinchstr Y - 4.0
|
||||
mvwinchstr Y - 4.0
|
||||
inchnstr Y - 4.0
|
||||
winchnstr Y - 4.0
|
||||
mvinchnstr Y - 4.0
|
||||
mvwinchnstr Y - 4.0
|
||||
in_wchstr Y
|
||||
win_wchstr Y
|
||||
mvin_wchstr Y
|
||||
mvwin_wchstr Y
|
||||
in_wchnstr Y
|
||||
win_wchnstr Y
|
||||
mvin_wchnstr Y
|
||||
mvwin_wchnstr Y
|
||||
These routines read a chtype or cchar_t string from the window,
|
||||
starting at the current or specified position, and ending at the
|
||||
right margin, or after n elements, whichever is less.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return the number of elements read, or ERR on
|
||||
error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
inchstr Y - 4.0
|
||||
winchstr Y - 4.0
|
||||
mvinchstr Y - 4.0
|
||||
mvwinchstr Y - 4.0
|
||||
inchnstr Y - 4.0
|
||||
winchnstr Y - 4.0
|
||||
mvinchnstr Y - 4.0
|
||||
mvwinchnstr Y - 4.0
|
||||
in_wchstr Y
|
||||
win_wchstr Y
|
||||
mvin_wchstr Y
|
||||
mvwin_wchstr Y
|
||||
in_wchnstr Y
|
||||
win_wchnstr Y
|
||||
mvin_wchnstr Y
|
||||
mvwin_wchnstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,89 +2,92 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: initscr.c,v 1.114 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: initscr
|
||||
initscr
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
WINDOW *initscr(void);
|
||||
WINDOW *Xinitscr(int argc, char *argv[]);
|
||||
int endwin(void);
|
||||
bool isendwin(void);
|
||||
SCREEN *newterm(const char *type, FILE *outfd, FILE *infd);
|
||||
SCREEN *set_term(SCREEN *new);
|
||||
void delscreen(SCREEN *sp);
|
||||
### Synopsis
|
||||
|
||||
int resize_term(int nlines, int ncols);
|
||||
bool is_termresized(void);
|
||||
const char *curses_version(void);
|
||||
WINDOW *initscr(void);
|
||||
WINDOW *Xinitscr(int argc, char *argv[]);
|
||||
int endwin(void);
|
||||
bool isendwin(void);
|
||||
SCREEN *newterm(const char *type, FILE *outfd, FILE *infd);
|
||||
SCREEN *set_term(SCREEN *new);
|
||||
void delscreen(SCREEN *sp);
|
||||
|
||||
Description:
|
||||
initscr() should be the first curses routine called. It will
|
||||
initialize all curses data structures, and arrange that the
|
||||
first call to refresh() will clear the screen. In case of
|
||||
error, initscr() will write a message to standard error and end
|
||||
the program.
|
||||
int resize_term(int nlines, int ncols);
|
||||
bool is_termresized(void);
|
||||
const char *curses_version(void);
|
||||
|
||||
endwin() should be called before exiting or escaping from curses
|
||||
mode temporarily. It will restore tty modes, move the cursor to
|
||||
the lower left corner of the screen and reset the terminal into
|
||||
the proper non-visual mode. To resume curses after a temporary
|
||||
escape, call refresh() or doupdate().
|
||||
### Description
|
||||
|
||||
isendwin() returns TRUE if endwin() has been called without a
|
||||
subsequent refresh, unless SP is NULL.
|
||||
initscr() should be the first curses routine called. It will
|
||||
initialize all curses data structures, and arrange that the
|
||||
first call to refresh() will clear the screen. In case of
|
||||
error, initscr() will write a message to standard error and end
|
||||
the program.
|
||||
|
||||
In some implementations of curses, newterm() allows the use of
|
||||
multiple terminals. Here, it's just an alternative interface for
|
||||
initscr(). It always returns SP, or NULL.
|
||||
endwin() should be called before exiting or escaping from curses
|
||||
mode temporarily. It will restore tty modes, move the cursor to
|
||||
the lower left corner of the screen and reset the terminal into
|
||||
the proper non-visual mode. To resume curses after a temporary
|
||||
escape, call refresh() or doupdate().
|
||||
|
||||
delscreen() frees the memory allocated by newterm() or
|
||||
initscr(), since it's not freed by endwin(). This function is
|
||||
usually not needed. In PDCurses, the parameter must be the
|
||||
value of SP, and delscreen() sets SP to NULL.
|
||||
isendwin() returns TRUE if endwin() has been called without a
|
||||
subsequent refresh, unless SP is NULL.
|
||||
|
||||
set_term() does nothing meaningful in PDCurses, but is included
|
||||
for compatibility with other curses implementations.
|
||||
In some implementations of curses, newterm() allows the use of
|
||||
multiple terminals. Here, it's just an alternative interface for
|
||||
initscr(). It always returns SP, or NULL.
|
||||
|
||||
resize_term() is effectively two functions: When called with
|
||||
nonzero values for nlines and ncols, it attempts to resize the
|
||||
screen to the given size. When called with (0, 0), it merely
|
||||
adjusts the internal structures to match the current size after
|
||||
the screen is resized by the user. On the currently supported
|
||||
platforms, this functionality is mutually exclusive: X11 allows
|
||||
user resizing, while DOS, OS/2 and Win32 allow programmatic
|
||||
resizing. If you want to support user resizing, you should check
|
||||
for getch() returning KEY_RESIZE, and/or call is_termresized()
|
||||
at appropriate times; if either condition occurs, call
|
||||
resize_term(0, 0). Then, with either user or programmatic
|
||||
resizing, you'll have to resize any windows you've created, as
|
||||
appropriate; resize_term() only handles stdscr and curscr.
|
||||
delscreen() frees the memory allocated by newterm() or
|
||||
initscr(), since it's not freed by endwin(). This function is
|
||||
usually not needed. In PDCurses, the parameter must be the
|
||||
value of SP, and delscreen() sets SP to NULL.
|
||||
|
||||
is_termresized() returns TRUE if the curses screen has been
|
||||
resized by the user, and a call to resize_term() is needed.
|
||||
Checking for KEY_RESIZE is generally preferable, unless you're
|
||||
not handling the keyboard.
|
||||
set_term() does nothing meaningful in PDCurses, but is included
|
||||
for compatibility with other curses implementations.
|
||||
|
||||
curses_version() returns a string describing the version of
|
||||
PDCurses.
|
||||
resize_term() is effectively two functions: When called with
|
||||
nonzero values for nlines and ncols, it attempts to resize the
|
||||
screen to the given size. When called with (0, 0), it merely
|
||||
adjusts the internal structures to match the current size after
|
||||
the screen is resized by the user. On the currently supported
|
||||
platforms, this functionality is mutually exclusive: X11 allows
|
||||
user resizing, while DOS, OS/2 and Win32 allow programmatic
|
||||
resizing. If you want to support user resizing, you should check
|
||||
for getch() returning KEY_RESIZE, and/or call is_termresized()
|
||||
at appropriate times; if either condition occurs, call
|
||||
resize_term(0, 0). Then, with either user or programmatic
|
||||
resizing, you'll have to resize any windows you've created, as
|
||||
appropriate; resize_term() only handles stdscr and curscr.
|
||||
|
||||
Return Value:
|
||||
All functions return NULL on error, except endwin(), which
|
||||
returns ERR on error.
|
||||
is_termresized() returns TRUE if the curses screen has been
|
||||
resized by the user, and a call to resize_term() is needed.
|
||||
Checking for KEY_RESIZE is generally preferable, unless you're
|
||||
not handling the keyboard.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
initscr Y Y Y
|
||||
endwin Y Y Y
|
||||
isendwin Y - 3.0
|
||||
newterm Y - Y
|
||||
set_term Y - Y
|
||||
delscreen Y - 4.0
|
||||
resize_term - - -
|
||||
is_termresized - - -
|
||||
curses_version - - -
|
||||
curses_version() returns a string describing the version of
|
||||
PDCurses.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return NULL on error, except endwin(), which
|
||||
returns ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
initscr Y Y Y
|
||||
endwin Y Y Y
|
||||
isendwin Y - 3.0
|
||||
newterm Y - Y
|
||||
set_term Y - Y
|
||||
delscreen Y - 4.0
|
||||
resize_term - - -
|
||||
is_termresized - - -
|
||||
curses_version - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,115 +2,118 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: inopts.c,v 1.43 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: inopts
|
||||
inopts
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int cbreak(void);
|
||||
int nocbreak(void);
|
||||
int echo(void);
|
||||
int noecho(void);
|
||||
int halfdelay(int tenths);
|
||||
int intrflush(WINDOW *win, bool bf);
|
||||
int keypad(WINDOW *win, bool bf);
|
||||
int meta(WINDOW *win, bool bf);
|
||||
int nl(void);
|
||||
int nonl(void);
|
||||
int nodelay(WINDOW *win, bool bf);
|
||||
int notimeout(WINDOW *win, bool bf);
|
||||
int raw(void);
|
||||
int noraw(void);
|
||||
void noqiflush(void);
|
||||
void qiflush(void);
|
||||
void timeout(int delay);
|
||||
void wtimeout(WINDOW *win, int delay);
|
||||
int typeahead(int fildes);
|
||||
### Synopsis
|
||||
|
||||
int crmode(void);
|
||||
int nocrmode(void);
|
||||
int cbreak(void);
|
||||
int nocbreak(void);
|
||||
int echo(void);
|
||||
int noecho(void);
|
||||
int halfdelay(int tenths);
|
||||
int intrflush(WINDOW *win, bool bf);
|
||||
int keypad(WINDOW *win, bool bf);
|
||||
int meta(WINDOW *win, bool bf);
|
||||
int nl(void);
|
||||
int nonl(void);
|
||||
int nodelay(WINDOW *win, bool bf);
|
||||
int notimeout(WINDOW *win, bool bf);
|
||||
int raw(void);
|
||||
int noraw(void);
|
||||
void noqiflush(void);
|
||||
void qiflush(void);
|
||||
void timeout(int delay);
|
||||
void wtimeout(WINDOW *win, int delay);
|
||||
int typeahead(int fildes);
|
||||
|
||||
Description:
|
||||
cbreak() and nocbreak() toggle cbreak mode. In cbreak mode,
|
||||
characters typed by the user are made available immediately, and
|
||||
erase/kill character processing is not performed. In nocbreak
|
||||
mode, typed characters are buffered until a newline or carriage
|
||||
return. Interrupt and flow control characters are unaffected by
|
||||
this mode. PDCurses always starts in cbreak mode.
|
||||
int crmode(void);
|
||||
int nocrmode(void);
|
||||
|
||||
echo() and noecho() control whether typed characters are echoed
|
||||
by the input routine. Initially, input characters are echoed.
|
||||
Subsequent calls to echo() and noecho() do not flush type-ahead.
|
||||
### Description
|
||||
|
||||
halfdelay() is similar to cbreak(), but allows for a time limit
|
||||
to be specified, in tenths of a second. This causes getch() to
|
||||
block for that period before returning ERR if no key has been
|
||||
received. tenths must be between 1 and 255.
|
||||
cbreak() and nocbreak() toggle cbreak mode. In cbreak mode,
|
||||
characters typed by the user are made available immediately, and
|
||||
erase/kill character processing is not performed. In nocbreak
|
||||
mode, typed characters are buffered until a newline or carriage
|
||||
return. Interrupt and flow control characters are unaffected by
|
||||
this mode. PDCurses always starts in cbreak mode.
|
||||
|
||||
keypad() controls whether getch() returns function/special keys
|
||||
as single key codes (e.g., the left arrow key as KEY_LEFT). Per
|
||||
X/Open, the default for keypad mode is OFF. You'll probably want
|
||||
it on. With keypad mode off, if a special key is pressed,
|
||||
getch() does nothing or returns ERR.
|
||||
echo() and noecho() control whether typed characters are echoed
|
||||
by the input routine. Initially, input characters are echoed.
|
||||
Subsequent calls to echo() and noecho() do not flush type-ahead.
|
||||
|
||||
nodelay() controls whether wgetch() is a non-blocking call. If
|
||||
the option is enabled, and no input is ready, wgetch() will
|
||||
return ERR. If disabled, wgetch() will hang until input is
|
||||
ready.
|
||||
halfdelay() is similar to cbreak(), but allows for a time limit
|
||||
to be specified, in tenths of a second. This causes getch() to
|
||||
block for that period before returning ERR if no key has been
|
||||
received. tenths must be between 1 and 255.
|
||||
|
||||
nl() enables the translation of a carriage return into a newline
|
||||
on input. nonl() disables this. Initially, the translation does
|
||||
occur.
|
||||
keypad() controls whether getch() returns function/special keys
|
||||
as single key codes (e.g., the left arrow key as KEY_LEFT). Per
|
||||
X/Open, the default for keypad mode is OFF. You'll probably want
|
||||
it on. With keypad mode off, if a special key is pressed,
|
||||
getch() does nothing or returns ERR.
|
||||
|
||||
raw() and noraw() toggle raw mode. Raw mode is similar to cbreak
|
||||
mode, in that characters typed are immediately passed through to
|
||||
the user program. The difference is that in raw mode, the INTR,
|
||||
QUIT, SUSP, and STOP characters are passed through without being
|
||||
interpreted, and without generating a signal.
|
||||
nodelay() controls whether wgetch() is a non-blocking call. If
|
||||
the option is enabled, and no input is ready, wgetch() will
|
||||
return ERR. If disabled, wgetch() will hang until input is
|
||||
ready.
|
||||
|
||||
In PDCurses, the meta() function sets raw mode on or off.
|
||||
nl() enables the translation of a carriage return into a newline
|
||||
on input. nonl() disables this. Initially, the translation does
|
||||
occur.
|
||||
|
||||
timeout() and wtimeout() set blocking or non-blocking reads for
|
||||
the specified window. The delay is measured in milliseconds. If
|
||||
it's negative, a blocking read is used; if zero, then non-
|
||||
blocking reads are done -- if no input is waiting, ERR is
|
||||
returned immediately. If the delay is positive, the read blocks
|
||||
for the delay period; if the period expires, ERR is returned.
|
||||
raw() and noraw() toggle raw mode. Raw mode is similar to cbreak
|
||||
mode, in that characters typed are immediately passed through to
|
||||
the user program. The difference is that in raw mode, the INTR,
|
||||
QUIT, SUSP, and STOP characters are passed through without being
|
||||
interpreted, and without generating a signal.
|
||||
|
||||
intrflush(), notimeout(), noqiflush(), qiflush() and typeahead()
|
||||
do nothing in PDCurses, but are included for compatibility with
|
||||
other curses implementations.
|
||||
In PDCurses, the meta() function sets raw mode on or off.
|
||||
|
||||
crmode() and nocrmode() are archaic equivalents to cbreak() and
|
||||
nocbreak(), respectively.
|
||||
timeout() and wtimeout() set blocking or non-blocking reads for
|
||||
the specified window. The delay is measured in milliseconds. If
|
||||
it's negative, a blocking read is used; if zero, then non-
|
||||
blocking reads are done -- if no input is waiting, ERR is
|
||||
returned immediately. If the delay is positive, the read blocks
|
||||
for the delay period; if the period expires, ERR is returned.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
intrflush(), notimeout(), noqiflush(), qiflush() and typeahead()
|
||||
do nothing in PDCurses, but are included for compatibility with
|
||||
other curses implementations.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
cbreak Y Y Y
|
||||
nocbreak Y Y Y
|
||||
echo Y Y Y
|
||||
noecho Y Y Y
|
||||
halfdelay Y - Y
|
||||
intrflush Y - Y
|
||||
keypad Y - Y
|
||||
meta Y - Y
|
||||
nl Y Y Y
|
||||
nonl Y Y Y
|
||||
nodelay Y - Y
|
||||
notimeout Y - Y
|
||||
raw Y Y Y
|
||||
noraw Y Y Y
|
||||
noqiflush Y - Y
|
||||
qiflush Y - Y
|
||||
timeout Y - Y
|
||||
wtimeout Y - Y
|
||||
typeahead Y - Y
|
||||
crmode -
|
||||
nocrmode -
|
||||
crmode() and nocrmode() are archaic equivalents to cbreak() and
|
||||
nocbreak(), respectively.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
cbreak Y Y Y
|
||||
nocbreak Y Y Y
|
||||
echo Y Y Y
|
||||
noecho Y Y Y
|
||||
halfdelay Y - Y
|
||||
intrflush Y - Y
|
||||
keypad Y - Y
|
||||
meta Y - Y
|
||||
nl Y Y Y
|
||||
nonl Y Y Y
|
||||
nodelay Y - Y
|
||||
notimeout Y - Y
|
||||
raw Y Y Y
|
||||
noraw Y Y Y
|
||||
noqiflush Y - Y
|
||||
qiflush Y - Y
|
||||
timeout Y - Y
|
||||
wtimeout Y - Y
|
||||
typeahead Y - Y
|
||||
crmode -
|
||||
nocrmode -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,59 +2,62 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: insch.c,v 1.44 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: insch
|
||||
insch
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int insch(chtype ch);
|
||||
int winsch(WINDOW *win, chtype ch);
|
||||
int mvinsch(int y, int x, chtype ch);
|
||||
int mvwinsch(WINDOW *win, int y, int x, chtype ch);
|
||||
### Synopsis
|
||||
|
||||
int insrawch(chtype ch);
|
||||
int winsrawch(WINDOW *win, chtype ch);
|
||||
int mvinsrawch(int y, int x, chtype ch);
|
||||
int mvwinsrawch(WINDOW *win, int y, int x, chtype ch);
|
||||
int insch(chtype ch);
|
||||
int winsch(WINDOW *win, chtype ch);
|
||||
int mvinsch(int y, int x, chtype ch);
|
||||
int mvwinsch(WINDOW *win, int y, int x, chtype ch);
|
||||
|
||||
int ins_wch(const cchar_t *wch);
|
||||
int wins_wch(WINDOW *win, const cchar_t *wch);
|
||||
int mvins_wch(int y, int x, const cchar_t *wch);
|
||||
int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
int insrawch(chtype ch);
|
||||
int winsrawch(WINDOW *win, chtype ch);
|
||||
int mvinsrawch(int y, int x, chtype ch);
|
||||
int mvwinsrawch(WINDOW *win, int y, int x, chtype ch);
|
||||
|
||||
Description:
|
||||
The insch() functions insert a chtype into the window at the
|
||||
current or specified cursor position. The cursor is NOT
|
||||
advanced. A newline is equivalent to clrtoeol(); tabs are
|
||||
expanded; other control characters are converted as with
|
||||
unctrl().
|
||||
int ins_wch(const cchar_t *wch);
|
||||
int wins_wch(WINDOW *win, const cchar_t *wch);
|
||||
int mvins_wch(int y, int x, const cchar_t *wch);
|
||||
int mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch);
|
||||
|
||||
The ins_wch() functions are the wide-character
|
||||
equivalents, taking cchar_t pointers rather than chtypes.
|
||||
### Description
|
||||
|
||||
Video attributes can be combined with a character by ORing
|
||||
them into the parameter. Text, including attributes, can be
|
||||
copied from one place to another using inch() and insch().
|
||||
The insch() functions insert a chtype into the window at the
|
||||
current or specified cursor position. The cursor is NOT
|
||||
advanced. A newline is equivalent to clrtoeol(); tabs are
|
||||
expanded; other control characters are converted as with
|
||||
unctrl().
|
||||
|
||||
insrawch() etc. are PDCurses-specific wrappers for insch() etc.
|
||||
that disable the translation of control characters.
|
||||
The ins_wch() functions are the wide-character
|
||||
equivalents, taking cchar_t pointers rather than chtypes.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
Video attributes can be combined with a character by ORing
|
||||
them into the parameter. Text, including attributes, can be
|
||||
copied from one place to another using inch() and insch().
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
insch Y Y Y
|
||||
winsch Y Y Y
|
||||
mvinsch Y Y Y
|
||||
mvwinsch Y Y Y
|
||||
insrawch - - -
|
||||
winsrawch - - -
|
||||
ins_wch Y
|
||||
wins_wch Y
|
||||
mvins_wch Y
|
||||
mvwins_wch Y
|
||||
insrawch() etc. are PDCurses-specific wrappers for insch() etc.
|
||||
that disable the translation of control characters.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
insch Y Y Y
|
||||
winsch Y Y Y
|
||||
mvinsch Y Y Y
|
||||
mvwinsch Y Y Y
|
||||
insrawch - - -
|
||||
winsrawch - - -
|
||||
ins_wch Y
|
||||
wins_wch Y
|
||||
mvins_wch Y
|
||||
mvwins_wch Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,64 +2,67 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: insstr.c,v 1.46 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: insstr
|
||||
insstr
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int insstr(const char *str);
|
||||
int insnstr(const char *str, int n);
|
||||
int winsstr(WINDOW *win, const char *str);
|
||||
int winsnstr(WINDOW *win, const char *str, int n);
|
||||
int mvinsstr(int y, int x, const char *str);
|
||||
int mvinsnstr(int y, int x, const char *str, int n);
|
||||
int mvwinsstr(WINDOW *win, int y, int x, const char *str);
|
||||
int mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n);
|
||||
### Synopsis
|
||||
|
||||
int ins_wstr(const wchar_t *wstr);
|
||||
int ins_nwstr(const wchar_t *wstr, int n);
|
||||
int wins_wstr(WINDOW *win, const wchar_t *wstr);
|
||||
int wins_nwstr(WINDOW *win, const wchar_t *wstr, int n);
|
||||
int mvins_wstr(int y, int x, const wchar_t *wstr);
|
||||
int mvins_nwstr(int y, int x, const wchar_t *wstr, int n);
|
||||
int mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr);
|
||||
int mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
|
||||
int insstr(const char *str);
|
||||
int insnstr(const char *str, int n);
|
||||
int winsstr(WINDOW *win, const char *str);
|
||||
int winsnstr(WINDOW *win, const char *str, int n);
|
||||
int mvinsstr(int y, int x, const char *str);
|
||||
int mvinsnstr(int y, int x, const char *str, int n);
|
||||
int mvwinsstr(WINDOW *win, int y, int x, const char *str);
|
||||
int mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n);
|
||||
|
||||
Description:
|
||||
The insstr() functions insert a character string into a window
|
||||
at the current cursor position, by repeatedly calling winsch().
|
||||
When PDCurses is built with wide-character support enabled, the
|
||||
narrow-character functions treat the string as a multibyte
|
||||
string in the current locale, and convert it first. All
|
||||
characters to the right of the cursor are moved to the right,
|
||||
with the possibility of the rightmost characters on the line
|
||||
being lost. The cursor position does not change (after moving
|
||||
to y, x, if specified). The routines with n as the last
|
||||
argument insert at most n characters; if n is negative, then the
|
||||
entire string is inserted.
|
||||
int ins_wstr(const wchar_t *wstr);
|
||||
int ins_nwstr(const wchar_t *wstr, int n);
|
||||
int wins_wstr(WINDOW *win, const wchar_t *wstr);
|
||||
int wins_nwstr(WINDOW *win, const wchar_t *wstr, int n);
|
||||
int mvins_wstr(int y, int x, const wchar_t *wstr);
|
||||
int mvins_nwstr(int y, int x, const wchar_t *wstr, int n);
|
||||
int mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr);
|
||||
int mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
insstr Y - 4.0
|
||||
winsstr Y - 4.0
|
||||
mvinsstr Y - 4.0
|
||||
mvwinsstr Y - 4.0
|
||||
insnstr Y - 4.0
|
||||
winsnstr Y - 4.0
|
||||
mvinsnstr Y - 4.0
|
||||
mvwinsnstr Y - 4.0
|
||||
ins_wstr Y
|
||||
wins_wstr Y
|
||||
mvins_wstr Y
|
||||
mvwins_wstr Y
|
||||
ins_nwstr Y
|
||||
wins_nwstr Y
|
||||
mvins_nwstr Y
|
||||
mvwins_nwstr Y
|
||||
The insstr() functions insert a character string into a window
|
||||
at the current cursor position, by repeatedly calling winsch().
|
||||
When PDCurses is built with wide-character support enabled, the
|
||||
narrow-character functions treat the string as a multibyte
|
||||
string in the current locale, and convert it first. All
|
||||
characters to the right of the cursor are moved to the right,
|
||||
with the possibility of the rightmost characters on the line
|
||||
being lost. The cursor position does not change (after moving
|
||||
to y, x, if specified). The routines with n as the last
|
||||
argument insert at most n characters; if n is negative, then the
|
||||
entire string is inserted.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
insstr Y - 4.0
|
||||
winsstr Y - 4.0
|
||||
mvinsstr Y - 4.0
|
||||
mvwinsstr Y - 4.0
|
||||
insnstr Y - 4.0
|
||||
winsnstr Y - 4.0
|
||||
mvinsnstr Y - 4.0
|
||||
mvwinsnstr Y - 4.0
|
||||
ins_wstr Y
|
||||
wins_wstr Y
|
||||
mvins_wstr Y
|
||||
mvwins_wstr Y
|
||||
ins_nwstr Y
|
||||
wins_nwstr Y
|
||||
mvins_nwstr Y
|
||||
mvwins_nwstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,61 +2,64 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: instr.c,v 1.44 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: instr
|
||||
instr
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int instr(char *str);
|
||||
int innstr(char *str, int n);
|
||||
int winstr(WINDOW *win, char *str);
|
||||
int winnstr(WINDOW *win, char *str, int n);
|
||||
int mvinstr(int y, int x, char *str);
|
||||
int mvinnstr(int y, int x, char *str, int n);
|
||||
int mvwinstr(WINDOW *win, int y, int x, char *str);
|
||||
int mvwinnstr(WINDOW *win, int y, int x, char *str, int n);
|
||||
### Synopsis
|
||||
|
||||
int inwstr(wchar_t *wstr);
|
||||
int innwstr(wchar_t *wstr, int n);
|
||||
int winwstr(WINDOW *win, wchar_t *wstr);
|
||||
int winnwstr(WINDOW *win, wchar_t *wstr, int n);
|
||||
int mvinwstr(int y, int x, wchar_t *wstr);
|
||||
int mvinnwstr(int y, int x, wchar_t *wstr, int n);
|
||||
int mvwinwstr(WINDOW *win, int y, int x, wchar_t *wstr);
|
||||
int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n);
|
||||
int instr(char *str);
|
||||
int innstr(char *str, int n);
|
||||
int winstr(WINDOW *win, char *str);
|
||||
int winnstr(WINDOW *win, char *str, int n);
|
||||
int mvinstr(int y, int x, char *str);
|
||||
int mvinnstr(int y, int x, char *str, int n);
|
||||
int mvwinstr(WINDOW *win, int y, int x, char *str);
|
||||
int mvwinnstr(WINDOW *win, int y, int x, char *str, int n);
|
||||
|
||||
Description:
|
||||
These functions take characters (or wide characters) from the
|
||||
current or specified position in the window, and return them as
|
||||
a string in str (or wstr). Attributes are ignored. The functions
|
||||
with n as the last argument return a string at most n characters
|
||||
long.
|
||||
int inwstr(wchar_t *wstr);
|
||||
int innwstr(wchar_t *wstr, int n);
|
||||
int winwstr(WINDOW *win, wchar_t *wstr);
|
||||
int winnwstr(WINDOW *win, wchar_t *wstr, int n);
|
||||
int mvinwstr(int y, int x, wchar_t *wstr);
|
||||
int mvinnwstr(int y, int x, wchar_t *wstr, int n);
|
||||
int mvwinwstr(WINDOW *win, int y, int x, wchar_t *wstr);
|
||||
int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n);
|
||||
|
||||
Return Value:
|
||||
Upon successful completion, innstr(), mvinnstr(), mvwinnstr()
|
||||
and winnstr() return the number of characters actually read into
|
||||
the string; instr(), mvinstr(), mvwinstr() and winstr() return
|
||||
OK. Otherwise, all these functions return ERR.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
instr Y - 4.0
|
||||
winstr Y - 4.0
|
||||
mvinstr Y - 4.0
|
||||
mvwinstr Y - 4.0
|
||||
innstr Y - 4.0
|
||||
winnstr Y - 4.0
|
||||
mvinnstr Y - 4.0
|
||||
mvwinnstr Y - 4.0
|
||||
inwstr Y
|
||||
winwstr Y
|
||||
mvinwstr Y
|
||||
mvwinwstr Y
|
||||
innwstr Y
|
||||
winnwstr Y
|
||||
mvinnwstr Y
|
||||
mvwinnwstr Y
|
||||
These functions take characters (or wide characters) from the
|
||||
current or specified position in the window, and return them as
|
||||
a string in str (or wstr). Attributes are ignored. The functions
|
||||
with n as the last argument return a string at most n characters
|
||||
long.
|
||||
|
||||
### Return Value
|
||||
|
||||
Upon successful completion, innstr(), mvinnstr(), mvwinnstr()
|
||||
and winnstr() return the number of characters actually read into
|
||||
the string; instr(), mvinstr(), mvwinstr() and winstr() return
|
||||
OK. Otherwise, all these functions return ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
instr Y - 4.0
|
||||
winstr Y - 4.0
|
||||
mvinstr Y - 4.0
|
||||
mvwinstr Y - 4.0
|
||||
innstr Y - 4.0
|
||||
winnstr Y - 4.0
|
||||
mvinnstr Y - 4.0
|
||||
mvwinnstr Y - 4.0
|
||||
inwstr Y
|
||||
winwstr Y
|
||||
mvinwstr Y
|
||||
mvwinwstr Y
|
||||
innwstr Y
|
||||
winnwstr Y
|
||||
mvinnwstr Y
|
||||
mvwinnwstr Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,84 +2,87 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: kernel.c,v 1.78 2008/07/15 17:13:26 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: kernel
|
||||
kernel
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int def_prog_mode(void);
|
||||
int def_shell_mode(void);
|
||||
int reset_prog_mode(void);
|
||||
int reset_shell_mode(void);
|
||||
int resetty(void);
|
||||
int savetty(void);
|
||||
int ripoffline(int line, int (*init)(WINDOW *, int));
|
||||
int curs_set(int visibility);
|
||||
int napms(int ms);
|
||||
### Synopsis
|
||||
|
||||
int draino(int ms);
|
||||
int resetterm(void);
|
||||
int fixterm(void);
|
||||
int saveterm(void);
|
||||
int def_prog_mode(void);
|
||||
int def_shell_mode(void);
|
||||
int reset_prog_mode(void);
|
||||
int reset_shell_mode(void);
|
||||
int resetty(void);
|
||||
int savetty(void);
|
||||
int ripoffline(int line, int (*init)(WINDOW *, int));
|
||||
int curs_set(int visibility);
|
||||
int napms(int ms);
|
||||
|
||||
Description:
|
||||
def_prog_mode() and def_shell_mode() save the current terminal
|
||||
modes as the "program" (in curses) or "shell" (not in curses)
|
||||
state for use by the reset_prog_mode() and reset_shell_mode()
|
||||
functions. This is done automatically by initscr().
|
||||
int draino(int ms);
|
||||
int resetterm(void);
|
||||
int fixterm(void);
|
||||
int saveterm(void);
|
||||
|
||||
reset_prog_mode() and reset_shell_mode() restore the terminal to
|
||||
"program" (in curses) or "shell" (not in curses) state. These
|
||||
are done automatically by endwin() and doupdate() after an
|
||||
endwin(), so they would normally not be called before these
|
||||
functions.
|
||||
### Description
|
||||
|
||||
savetty() and resetty() save and restore the state of the
|
||||
terminal modes. savetty() saves the current state in a buffer,
|
||||
and resetty() restores the state to what it was at the last call
|
||||
to savetty().
|
||||
def_prog_mode() and def_shell_mode() save the current terminal
|
||||
modes as the "program" (in curses) or "shell" (not in curses)
|
||||
state for use by the reset_prog_mode() and reset_shell_mode()
|
||||
functions. This is done automatically by initscr().
|
||||
|
||||
curs_set() alters the appearance of the cursor. A visibility of
|
||||
0 makes it disappear; 1 makes it appear "normal" (usually an
|
||||
underline) and 2 makes it "highly visible" (usually a block).
|
||||
reset_prog_mode() and reset_shell_mode() restore the terminal to
|
||||
"program" (in curses) or "shell" (not in curses) state. These
|
||||
are done automatically by endwin() and doupdate() after an
|
||||
endwin(), so they would normally not be called before these
|
||||
functions.
|
||||
|
||||
ripoffline() reduces the size of stdscr by one line. If the
|
||||
"line" parameter is positive, the line is removed from the top
|
||||
of the screen; if negative, from the bottom. Up to 5 lines can
|
||||
be ripped off stdscr by calling ripoffline() repeatedly. The
|
||||
function argument, init, is called from within initscr() or
|
||||
newterm(), so ripoffline() must be called before either of these
|
||||
functions. The init function receives a pointer to a one-line
|
||||
WINDOW, and the width of the window. Calling ripoffline() with a
|
||||
NULL init function pointer is an error.
|
||||
savetty() and resetty() save and restore the state of the
|
||||
terminal modes. savetty() saves the current state in a buffer,
|
||||
and resetty() restores the state to what it was at the last call
|
||||
to savetty().
|
||||
|
||||
napms() suspends the program for the specified number of
|
||||
milliseconds. draino() is an archaic equivalent.
|
||||
curs_set() alters the appearance of the cursor. A visibility of
|
||||
0 makes it disappear; 1 makes it appear "normal" (usually an
|
||||
underline) and 2 makes it "highly visible" (usually a block).
|
||||
|
||||
resetterm(), fixterm() and saveterm() are archaic equivalents
|
||||
for reset_shell_mode(), reset_prog_mode() and def_prog_mode(),
|
||||
respectively.
|
||||
ripoffline() reduces the size of stdscr by one line. If the
|
||||
"line" parameter is positive, the line is removed from the top
|
||||
of the screen; if negative, from the bottom. Up to 5 lines can
|
||||
be ripped off stdscr by calling ripoffline() repeatedly. The
|
||||
function argument, init, is called from within initscr() or
|
||||
newterm(), so ripoffline() must be called before either of these
|
||||
functions. The init function receives a pointer to a one-line
|
||||
WINDOW, and the width of the window. Calling ripoffline() with a
|
||||
NULL init function pointer is an error.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error, except
|
||||
curs_set(), which returns the previous visibility.
|
||||
napms() suspends the program for the specified number of
|
||||
milliseconds. draino() is an archaic equivalent.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
def_prog_mode Y Y Y
|
||||
def_shell_mode Y Y Y
|
||||
reset_prog_mode Y Y Y
|
||||
reset_shell_mode Y Y Y
|
||||
resetty Y Y Y
|
||||
savetty Y Y Y
|
||||
ripoffline Y - 3.0
|
||||
curs_set Y - 3.0
|
||||
napms Y Y Y
|
||||
draino -
|
||||
resetterm -
|
||||
fixterm -
|
||||
saveterm -
|
||||
resetterm(), fixterm() and saveterm() are archaic equivalents
|
||||
for reset_shell_mode(), reset_prog_mode() and def_prog_mode(),
|
||||
respectively.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error, except
|
||||
curs_set(), which returns the previous visibility.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
def_prog_mode Y Y Y
|
||||
def_shell_mode Y Y Y
|
||||
reset_prog_mode Y Y Y
|
||||
reset_shell_mode Y Y Y
|
||||
resetty Y Y Y
|
||||
savetty Y Y Y
|
||||
ripoffline Y - 3.0
|
||||
curs_set Y - 3.0
|
||||
napms Y Y Y
|
||||
draino -
|
||||
resetterm -
|
||||
fixterm -
|
||||
saveterm -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,41 +2,47 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: keyname.c,v 1.8 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: keyname
|
||||
keyname
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
char *keyname(int key);
|
||||
### Synopsis
|
||||
|
||||
char *key_name(wchar_t c);
|
||||
char *keyname(int key);
|
||||
|
||||
bool has_key(int key);
|
||||
char *key_name(wchar_t c);
|
||||
|
||||
Description:
|
||||
keyname() returns a string corresponding to the argument key.
|
||||
key may be any key returned by wgetch().
|
||||
bool has_key(int key);
|
||||
|
||||
key_name() is the wide-character version. It takes a wchar_t
|
||||
parameter, but still returns a char *.
|
||||
### Description
|
||||
|
||||
has_key() returns TRUE for recognized keys, FALSE otherwise.
|
||||
This function is an ncurses extension.
|
||||
keyname() returns a string corresponding to the argument key.
|
||||
key may be any key returned by wgetch().
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
keyname Y - 3.0
|
||||
key_name Y
|
||||
has_key - - -
|
||||
key_name() is the wide-character version. It takes a wchar_t
|
||||
parameter, but still returns a char *.
|
||||
|
||||
has_key() returns TRUE for recognized keys, FALSE otherwise.
|
||||
This function is an ncurses extension.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
keyname Y - 3.0
|
||||
key_name Y
|
||||
has_key - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char *keyname(int key)
|
||||
{
|
||||
static char _keyname[14];
|
||||
|
||||
/* Key names must be in exactly the same order as in curses.h */
|
||||
|
||||
static char *key_name[] =
|
||||
static char *key_names[] =
|
||||
{
|
||||
"KEY_BREAK", "KEY_DOWN", "KEY_UP", "KEY_LEFT", "KEY_RIGHT",
|
||||
"KEY_HOME", "KEY_BACKSPACE", "KEY_F0", "KEY_F(1)", "KEY_F(2)",
|
||||
@@ -102,10 +108,10 @@ char *keyname(int key)
|
||||
|
||||
PDC_LOG(("keyname() - called: key %d\n", key));
|
||||
|
||||
if ((key >= 0) && (key < 0x80))
|
||||
return unctrl((chtype)key);
|
||||
strcpy(_keyname, ((key >= 0) && (key < 0x80)) ? unctrl((chtype)key) :
|
||||
has_key(key) ? key_names[key - KEY_MIN] : "UNKNOWN KEY");
|
||||
|
||||
return has_key(key) ? key_name[key - KEY_MIN] : "UNKNOWN KEY";
|
||||
return _keyname;
|
||||
}
|
||||
|
||||
bool has_key(int key)
|
||||
|
||||
248
pdcurses/mouse.c
248
pdcurses/mouse.c
@@ -2,150 +2,152 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: mouse.c,v 1.45 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: mouse
|
||||
mouse
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int mouse_set(unsigned long mbe);
|
||||
int mouse_on(unsigned long mbe);
|
||||
int mouse_off(unsigned long mbe);
|
||||
int request_mouse_pos(void);
|
||||
int map_button(unsigned long button);
|
||||
void wmouse_position(WINDOW *win, int *y, int *x);
|
||||
unsigned long getmouse(void);
|
||||
unsigned long getbmap(void);
|
||||
### Synopsis
|
||||
|
||||
int mouseinterval(int wait);
|
||||
bool wenclose(const WINDOW *win, int y, int x);
|
||||
bool wmouse_trafo(const WINDOW *win, int *y, int *x, bool to_screen);
|
||||
bool mouse_trafo(int *y, int *x, bool to_screen);
|
||||
mmask_t mousemask(mmask_t mask, mmask_t *oldmask);
|
||||
int nc_getmouse(MEVENT *event);
|
||||
int ungetmouse(MEVENT *event);
|
||||
int mouse_set(unsigned long mbe);
|
||||
int mouse_on(unsigned long mbe);
|
||||
int mouse_off(unsigned long mbe);
|
||||
int request_mouse_pos(void);
|
||||
int map_button(unsigned long button);
|
||||
void wmouse_position(WINDOW *win, int *y, int *x);
|
||||
unsigned long getmouse(void);
|
||||
unsigned long getbmap(void);
|
||||
|
||||
Description:
|
||||
As of PDCurses 3.0, there are two separate mouse interfaces: the
|
||||
classic interface, which is based on the undocumented Sys V
|
||||
mouse functions; and an ncurses-compatible interface. Both are
|
||||
active at all times, and you can mix and match functions from
|
||||
each, though it's not recommended. The ncurses interface is
|
||||
essentially an emulation layer built on top of the classic
|
||||
interface; it's here to allow easier porting of ncurses apps.
|
||||
int mouseinterval(int wait);
|
||||
bool wenclose(const WINDOW *win, int y, int x);
|
||||
bool wmouse_trafo(const WINDOW *win, int *y, int *x, bool to_screen);
|
||||
bool mouse_trafo(int *y, int *x, bool to_screen);
|
||||
mmask_t mousemask(mmask_t mask, mmask_t *oldmask);
|
||||
int nc_getmouse(MEVENT *event);
|
||||
int ungetmouse(MEVENT *event);
|
||||
|
||||
The classic interface: mouse_set(), mouse_on(), mouse_off(),
|
||||
request_mouse_pos(), map_button(), wmouse_position(),
|
||||
getmouse(), and getbmap(). An application using this interface
|
||||
would start by calling mouse_set() or mouse_on() with a non-zero
|
||||
value, often ALL_MOUSE_EVENTS. Then it would check for a
|
||||
KEY_MOUSE return from getch(). If found, it would call
|
||||
request_mouse_pos() to get the current mouse status.
|
||||
### Description
|
||||
|
||||
mouse_set(), mouse_on() and mouse_off() are analagous to
|
||||
attrset(), attron() and attroff(). These functions set the
|
||||
mouse button events to trap. The button masks used in these
|
||||
functions are defined in curses.h and can be or'ed together.
|
||||
They are the group of masks starting with BUTTON1_RELEASED.
|
||||
As of PDCurses 3.0, there are two separate mouse interfaces: the
|
||||
classic interface, which is based on the undocumented Sys V
|
||||
mouse functions; and an ncurses-compatible interface. Both are
|
||||
active at all times, and you can mix and match functions from
|
||||
each, though it's not recommended. The ncurses interface is
|
||||
essentially an emulation layer built on top of the classic
|
||||
interface; it's here to allow easier porting of ncurses apps.
|
||||
|
||||
request_mouse_pos() requests curses to fill in the Mouse_status
|
||||
structure with the current state of the mouse.
|
||||
The classic interface: mouse_set(), mouse_on(), mouse_off(),
|
||||
request_mouse_pos(), map_button(), wmouse_position(),
|
||||
getmouse(), and getbmap(). An application using this interface
|
||||
would start by calling mouse_set() or mouse_on() with a non-zero
|
||||
value, often ALL_MOUSE_EVENTS. Then it would check for a
|
||||
KEY_MOUSE return from getch(). If found, it would call
|
||||
request_mouse_pos() to get the current mouse status.
|
||||
|
||||
map_button() enables the specified mouse action to activate the
|
||||
Soft Label Keys if the action occurs over the area of the screen
|
||||
where the Soft Label Keys are displayed. The mouse actions are
|
||||
defined in curses.h in the group that starts with BUTTON_RELEASED.
|
||||
mouse_set(), mouse_on() and mouse_off() are analagous to
|
||||
attrset(), attron() and attroff(). These functions set the
|
||||
mouse button events to trap. The button masks used in these
|
||||
functions are defined in curses.h and can be or'ed together.
|
||||
They are the group of masks starting with BUTTON1_RELEASED.
|
||||
|
||||
wmouse_position() determines if the current mouse position is
|
||||
within the window passed as an argument. If the mouse is
|
||||
outside the current window, -1 is returned in the y and x
|
||||
arguments; otherwise the y and x coordinates of the mouse
|
||||
(relative to the top left corner of the window) are returned in
|
||||
y and x.
|
||||
request_mouse_pos() requests curses to fill in the Mouse_status
|
||||
structure with the current state of the mouse.
|
||||
|
||||
getmouse() returns the current status of the trapped mouse
|
||||
buttons as set by mouse_set() or mouse_on().
|
||||
map_button() enables the specified mouse action to activate the
|
||||
Soft Label Keys if the action occurs over the area of the screen
|
||||
where the Soft Label Keys are displayed. The mouse actions are
|
||||
defined in curses.h in the group that starts with BUTTON_RELEASED.
|
||||
|
||||
getbmap() returns the current status of the button action used
|
||||
to map a mouse action to the Soft Label Keys as set by the
|
||||
map_button() function.
|
||||
wmouse_position() determines if the current mouse position is
|
||||
within the window passed as an argument. If the mouse is
|
||||
outside the current window, -1 is returned in the y and x
|
||||
arguments; otherwise the y and x coordinates of the mouse
|
||||
(relative to the top left corner of the window) are returned in
|
||||
y and x.
|
||||
|
||||
The ncurses interface: mouseinterval(), wenclose(),
|
||||
wmouse_trafo(), mouse_trafo(), mousemask(), nc_getmouse(), and
|
||||
ungetmouse(). A typical application using this interface would
|
||||
start by calling mousemask() with a non-zero value, often
|
||||
ALL_MOUSE_EVENTS. Then it would check for a KEY_MOUSE return
|
||||
from getch(). If found, it would call nc_getmouse() to get the
|
||||
current mouse status.
|
||||
getmouse() returns the current status of the trapped mouse
|
||||
buttons as set by mouse_set() or mouse_on().
|
||||
|
||||
mouseinterval() sets the timeout for a mouse click. On all
|
||||
current platforms, PDCurses receives mouse button press and
|
||||
release events, but must synthesize click events. It does this
|
||||
by checking whether a release event is queued up after a press
|
||||
event. If it gets a press event, and there are no more events
|
||||
waiting, it will wait for the timeout interval, then check again
|
||||
for a release. A press followed by a release is reported as
|
||||
BUTTON_CLICKED; otherwise it's passed through as BUTTON_PRESSED.
|
||||
The default timeout is 150ms; valid values are 0 (no clicks
|
||||
reported) through 1000ms. In x11, the timeout can also be set
|
||||
via the clickPeriod resource. The return value from
|
||||
mouseinterval() is the old timeout. To check the old value
|
||||
without setting a new one, call it with a parameter of -1. Note
|
||||
that although there's no classic equivalent for this function
|
||||
(apart from the clickPeriod resource), the value set applies in
|
||||
both interfaces.
|
||||
getbmap() returns the current status of the button action used
|
||||
to map a mouse action to the Soft Label Keys as set by the
|
||||
map_button() function.
|
||||
|
||||
wenclose() reports whether the given screen-relative y, x
|
||||
coordinates fall within the given window.
|
||||
The ncurses interface: mouseinterval(), wenclose(),
|
||||
wmouse_trafo(), mouse_trafo(), mousemask(), nc_getmouse(), and
|
||||
ungetmouse(). A typical application using this interface would
|
||||
start by calling mousemask() with a non-zero value, often
|
||||
ALL_MOUSE_EVENTS. Then it would check for a KEY_MOUSE return
|
||||
from getch(). If found, it would call nc_getmouse() to get the
|
||||
current mouse status.
|
||||
|
||||
wmouse_trafo() converts between screen-relative and window-
|
||||
relative coordinates. A to_screen parameter of TRUE means to
|
||||
convert from window to screen; otherwise the reverse. The
|
||||
function returns FALSE if the coordinates aren't within the
|
||||
window, or if any of the parameters are NULL. The coordinates
|
||||
have been converted when the function returns TRUE.
|
||||
mouseinterval() sets the timeout for a mouse click. On all
|
||||
current platforms, PDCurses receives mouse button press and
|
||||
release events, but must synthesize click events. It does this
|
||||
by checking whether a release event is queued up after a press
|
||||
event. If it gets a press event, and there are no more events
|
||||
waiting, it will wait for the timeout interval, then check again
|
||||
for a release. A press followed by a release is reported as
|
||||
BUTTON_CLICKED; otherwise it's passed through as BUTTON_PRESSED.
|
||||
The default timeout is 150ms; valid values are 0 (no clicks
|
||||
reported) through 1000ms. In x11, the timeout can also be set
|
||||
via the clickPeriod resource. The return value from
|
||||
mouseinterval() is the old timeout. To check the old value
|
||||
without setting a new one, call it with a parameter of -1. Note
|
||||
that although there's no classic equivalent for this function
|
||||
(apart from the clickPeriod resource), the value set applies in
|
||||
both interfaces.
|
||||
|
||||
mouse_trafo() is the stdscr version of wmouse_trafo().
|
||||
wenclose() reports whether the given screen-relative y, x
|
||||
coordinates fall within the given window.
|
||||
|
||||
mousemask() is nearly equivalent to mouse_set(), but instead of
|
||||
OK/ERR, it returns the value of the mask after setting it. (This
|
||||
isn't necessarily the same value passed in, since the mask could
|
||||
be altered on some platforms.) And if the second parameter is a
|
||||
non-null pointer, mousemask() stores the previous mask value
|
||||
there. Also, since the ncurses interface doesn't work with
|
||||
PDCurses' BUTTON_MOVED events, mousemask() filters them out.
|
||||
wmouse_trafo() converts between screen-relative and window-
|
||||
relative coordinates. A to_screen parameter of TRUE means to
|
||||
convert from window to screen; otherwise the reverse. The
|
||||
function returns FALSE if the coordinates aren't within the
|
||||
window, or if any of the parameters are NULL. The coordinates
|
||||
have been converted when the function returns TRUE.
|
||||
|
||||
nc_getmouse() returns the current mouse status in an MEVENT
|
||||
struct. This is equivalent to ncurses' getmouse(), renamed to
|
||||
avoid conflict with PDCurses' getmouse(). But if you define
|
||||
NCURSES_MOUSE_VERSION (preferably as 2) before including
|
||||
curses.h, it defines getmouse() to nc_getmouse(), along with a
|
||||
few other redefintions needed for compatibility with ncurses
|
||||
code. nc_getmouse() calls request_mouse_pos(), which (not
|
||||
getmouse()) is the classic equivalent.
|
||||
mouse_trafo() is the stdscr version of wmouse_trafo().
|
||||
|
||||
ungetmouse() is the mouse equivalent of ungetch(). However,
|
||||
PDCurses doesn't maintain a queue of mouse events; only one can
|
||||
be pushed back, and it can overwrite or be overwritten by real
|
||||
mouse events.
|
||||
mousemask() is nearly equivalent to mouse_set(), but instead of
|
||||
OK/ERR, it returns the value of the mask after setting it. (This
|
||||
isn't necessarily the same value passed in, since the mask could
|
||||
be altered on some platforms.) And if the second parameter is a
|
||||
non-null pointer, mousemask() stores the previous mask value
|
||||
there. Also, since the ncurses interface doesn't work with
|
||||
PDCurses' BUTTON_MOVED events, mousemask() filters them out.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
mouse_set - - 4.0
|
||||
mouse_on - - 4.0
|
||||
mouse_off - - 4.0
|
||||
request_mouse_pos - - 4.0
|
||||
map_button - - 4.0
|
||||
wmouse_position - - 4.0
|
||||
getmouse - - 4.0
|
||||
getbmap - - 4.0
|
||||
mouseinterval - - -
|
||||
wenclose - - -
|
||||
wmouse_trafo - - -
|
||||
mouse_trafo - - -
|
||||
mousemask - - -
|
||||
nc_getmouse - - -
|
||||
ungetmouse - - -
|
||||
nc_getmouse() returns the current mouse status in an MEVENT
|
||||
struct. This is equivalent to ncurses' getmouse(), renamed to
|
||||
avoid conflict with PDCurses' getmouse(). But if you define
|
||||
NCURSES_MOUSE_VERSION (preferably as 2) before including
|
||||
curses.h, it defines getmouse() to nc_getmouse(), along with a
|
||||
few other redefintions needed for compatibility with ncurses
|
||||
code. nc_getmouse() calls request_mouse_pos(), which (not
|
||||
getmouse()) is the classic equivalent.
|
||||
|
||||
ungetmouse() is the mouse equivalent of ungetch(). However,
|
||||
PDCurses doesn't maintain a queue of mouse events; only one can
|
||||
be pushed back, and it can overwrite or be overwritten by real
|
||||
mouse events.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
mouse_set - - 4.0
|
||||
mouse_on - - 4.0
|
||||
mouse_off - - 4.0
|
||||
request_mouse_pos - - 4.0
|
||||
map_button - - 4.0
|
||||
wmouse_position - - 4.0
|
||||
getmouse - - 4.0
|
||||
getbmap - - 4.0
|
||||
mouseinterval - - -
|
||||
wenclose - - -
|
||||
wmouse_trafo - - -
|
||||
mouse_trafo - - -
|
||||
mousemask - - -
|
||||
nc_getmouse - - -
|
||||
ungetmouse - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,28 +2,31 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: move.c,v 1.28 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: move
|
||||
move
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
int move(int y, int x);
|
||||
int wmove(WINDOW *win, int y, int x);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
The cursor associated with the window is moved to the given
|
||||
location. This does not move the physical cursor of the
|
||||
terminal until refresh() is called. The position specified is
|
||||
relative to the upper left corner of the window, which is (0,0).
|
||||
int move(int y, int x);
|
||||
int wmove(WINDOW *win, int y, int x);
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
move Y Y Y
|
||||
wmove Y Y Y
|
||||
The cursor associated with the window is moved to the given
|
||||
location. This does not move the physical cursor of the
|
||||
terminal until refresh() is called. The position specified is
|
||||
relative to the upper left corner of the window, which is (0,0).
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
move Y Y Y
|
||||
wmove Y Y Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,66 +2,69 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: outopts.c,v 1.39 2008/07/14 12:22:13 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: outopts
|
||||
outopts
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
int clearok(WINDOW *win, bool bf);
|
||||
int idlok(WINDOW *win, bool bf);
|
||||
void idcok(WINDOW *win, bool bf);
|
||||
void immedok(WINDOW *win, bool bf);
|
||||
int leaveok(WINDOW *win, bool bf);
|
||||
int setscrreg(int top, int bot);
|
||||
int wsetscrreg(WINDOW *win, int top, int bot);
|
||||
int scrollok(WINDOW *win, bool bf);
|
||||
### Synopsis
|
||||
|
||||
int raw_output(bool bf);
|
||||
int clearok(WINDOW *win, bool bf);
|
||||
int idlok(WINDOW *win, bool bf);
|
||||
void idcok(WINDOW *win, bool bf);
|
||||
void immedok(WINDOW *win, bool bf);
|
||||
int leaveok(WINDOW *win, bool bf);
|
||||
int setscrreg(int top, int bot);
|
||||
int wsetscrreg(WINDOW *win, int top, int bot);
|
||||
int scrollok(WINDOW *win, bool bf);
|
||||
|
||||
Description:
|
||||
With clearok(), if bf is TRUE, the next call to wrefresh() with
|
||||
this window will clear the screen completely and redraw the
|
||||
entire screen.
|
||||
int raw_output(bool bf);
|
||||
|
||||
immedok(), called with a second argument of TRUE, causes an
|
||||
automatic wrefresh() every time a change is made to the
|
||||
specified window.
|
||||
### Description
|
||||
|
||||
Normally, the hardware cursor is left at the location of the
|
||||
window being refreshed. leaveok() allows the cursor to be
|
||||
left wherever the update happens to leave it. It's useful
|
||||
for applications where the cursor is not used, since it reduces
|
||||
the need for cursor motions. If possible, the cursor is made
|
||||
invisible when this option is enabled.
|
||||
With clearok(), if bf is TRUE, the next call to wrefresh() with
|
||||
this window will clear the screen completely and redraw the
|
||||
entire screen.
|
||||
|
||||
wsetscrreg() sets a scrolling region in a window; "top" and
|
||||
"bot" are the line numbers for the top and bottom margins. If
|
||||
this option and scrollok() are enabled, any attempt to move off
|
||||
the bottom margin will cause all lines in the scrolling region
|
||||
to scroll up one line. setscrreg() is the stdscr version.
|
||||
immedok(), called with a second argument of TRUE, causes an
|
||||
automatic wrefresh() every time a change is made to the
|
||||
specified window.
|
||||
|
||||
idlok() and idcok() do nothing in PDCurses, but are provided for
|
||||
compatibility with other curses implementations.
|
||||
Normally, the hardware cursor is left at the location of the
|
||||
window being refreshed. leaveok() allows the cursor to be
|
||||
left wherever the update happens to leave it. It's useful
|
||||
for applications where the cursor is not used, since it reduces
|
||||
the need for cursor motions. If possible, the cursor is made
|
||||
invisible when this option is enabled.
|
||||
|
||||
raw_output() enables the output of raw characters using the
|
||||
standard *add* and *ins* curses functions (that is, it disables
|
||||
translation of control characters).
|
||||
wsetscrreg() sets a scrolling region in a window; "top" and
|
||||
"bot" are the line numbers for the top and bottom margins. If
|
||||
this option and scrollok() are enabled, any attempt to move off
|
||||
the bottom margin will cause all lines in the scrolling region
|
||||
to scroll up one line. setscrreg() is the stdscr version.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
idlok() and idcok() do nothing in PDCurses, but are provided for
|
||||
compatibility with other curses implementations.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
clearok Y Y Y
|
||||
idlok Y Y Y
|
||||
idcok Y - 4.0
|
||||
immedok Y - 4.0
|
||||
leaveok Y Y Y
|
||||
setscrreg Y Y Y
|
||||
wsetscrreg Y Y Y
|
||||
scrollok Y Y Y
|
||||
raw_output - - -
|
||||
raw_output() enables the output of raw characters using the
|
||||
standard *add* and *ins* curses functions (that is, it disables
|
||||
translation of control characters).
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
clearok Y Y Y
|
||||
idlok Y Y Y
|
||||
idcok Y - 4.0
|
||||
immedok Y - 4.0
|
||||
leaveok Y Y Y
|
||||
setscrreg Y Y Y
|
||||
wsetscrreg Y Y Y
|
||||
scrollok Y Y Y
|
||||
raw_output - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,44 +2,47 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: overlay.c,v 1.36 2008/07/14 12:35:23 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: overlay
|
||||
overlay
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
int overlay(const WINDOW *src_w, WINDOW *dst_w)
|
||||
int overwrite(const WINDOW *src_w, WINDOW *dst_w)
|
||||
int copywin(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
|
||||
int src_tc, int dst_tr, int dst_tc, int dst_br,
|
||||
int dst_bc, bool overlay)
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
overlay() and overwrite() copy all the text from src_w into
|
||||
dst_w. The windows need not be the same size. Those characters
|
||||
in the source window that intersect with the destination window
|
||||
are copied, so that the characters appear in the same physical
|
||||
position on the screen. The difference between the two functions
|
||||
is that overlay() is non-destructive (blanks are not copied)
|
||||
while overwrite() is destructive (blanks are copied).
|
||||
int overlay(const WINDOW *src_w, WINDOW *dst_w)
|
||||
int overwrite(const WINDOW *src_w, WINDOW *dst_w)
|
||||
int copywin(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
|
||||
int src_tc, int dst_tr, int dst_tc, int dst_br,
|
||||
int dst_bc, bool overlay)
|
||||
|
||||
copywin() is similar, but doesn't require that the two windows
|
||||
overlap. The arguments src_tc and src_tr specify the top left
|
||||
corner of the region to be copied. dst_tc, dst_tr, dst_br, and
|
||||
dst_bc specify the region within the destination window to copy
|
||||
to. The argument "overlay", if TRUE, indicates that the copy is
|
||||
done non-destructively (as in overlay()); blanks in the source
|
||||
window are not copied to the destination window. When overlay is
|
||||
FALSE, blanks are copied.
|
||||
### Description
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
overlay() and overwrite() copy all the text from src_w into
|
||||
dst_w. The windows need not be the same size. Those characters
|
||||
in the source window that intersect with the destination window
|
||||
are copied, so that the characters appear in the same physical
|
||||
position on the screen. The difference between the two functions
|
||||
is that overlay() is non-destructive (blanks are not copied)
|
||||
while overwrite() is destructive (blanks are copied).
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
overlay Y Y Y
|
||||
overwrite Y Y Y
|
||||
copywin Y - 3.0
|
||||
copywin() is similar, but doesn't require that the two windows
|
||||
overlap. The arguments src_tc and src_tr specify the top left
|
||||
corner of the region to be copied. dst_tc, dst_tr, dst_br, and
|
||||
dst_bc specify the region within the destination window to copy
|
||||
to. The argument "overlay", if TRUE, indicates that the copy is
|
||||
done non-destructively (as in overlay()); blanks in the source
|
||||
window are not copied to the destination window. When overlay is
|
||||
FALSE, blanks are copied.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
overlay Y Y Y
|
||||
overwrite Y Y Y
|
||||
copywin Y - 3.0
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -48,7 +51,7 @@ RCSID("$Id: overlay.c,v 1.36 2008/07/14 12:35:23 wmcbrine Exp $")
|
||||
|
||||
static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
|
||||
int src_tc, int src_br, int src_bc, int dst_tr,
|
||||
int dst_tc, bool overlay)
|
||||
int dst_tc, bool _overlay)
|
||||
{
|
||||
int col, line, y1, fc, *minchng, *maxchng;
|
||||
chtype *w1ptr, *w2ptr;
|
||||
@@ -79,7 +82,7 @@ static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
|
||||
for (col = 0; col < xdiff; col++)
|
||||
{
|
||||
if ((*w1ptr) != (*w2ptr) &&
|
||||
!((*w1ptr & A_CHARTEXT) == ' ' && overlay))
|
||||
!((*w1ptr & A_CHARTEXT) == ' ' && _overlay))
|
||||
{
|
||||
*w2ptr = *w1ptr;
|
||||
|
||||
@@ -113,14 +116,12 @@ static int _copy_win(const WINDOW *src_w, WINDOW *dst_w, int src_tr,
|
||||
return OK;
|
||||
}
|
||||
|
||||
int overlay(const WINDOW *src_w, WINDOW *dst_w)
|
||||
int _copy_overlap(const WINDOW *src_w, WINDOW *dst_w, bool overlay)
|
||||
{
|
||||
int first_line, first_col, last_line, last_col;
|
||||
int src_start_x, src_start_y, dst_start_x, dst_start_y;
|
||||
int xdiff, ydiff;
|
||||
|
||||
PDC_LOG(("overlay() - called\n"));
|
||||
|
||||
if (!src_w || !dst_w)
|
||||
return ERR;
|
||||
|
||||
@@ -167,68 +168,25 @@ int overlay(const WINDOW *src_w, WINDOW *dst_w)
|
||||
|
||||
return _copy_win(src_w, dst_w, src_start_y, src_start_x,
|
||||
src_start_y + ydiff, src_start_x + xdiff,
|
||||
dst_start_y, dst_start_x, TRUE);
|
||||
dst_start_y, dst_start_x, overlay);
|
||||
}
|
||||
|
||||
int overlay(const WINDOW *src_w, WINDOW *dst_w)
|
||||
{
|
||||
PDC_LOG(("overlay() - called\n"));
|
||||
|
||||
return _copy_overlap(src_w, dst_w, TRUE);
|
||||
}
|
||||
|
||||
int overwrite(const WINDOW *src_w, WINDOW *dst_w)
|
||||
{
|
||||
int first_line, first_col, last_line, last_col;
|
||||
int src_start_x, src_start_y, dst_start_x, dst_start_y;
|
||||
int xdiff, ydiff;
|
||||
|
||||
PDC_LOG(("overwrite() - called\n"));
|
||||
|
||||
if (!src_w || !dst_w)
|
||||
return ERR;
|
||||
|
||||
first_col = max(dst_w->_begx, src_w->_begx);
|
||||
first_line = max(dst_w->_begy, src_w->_begy);
|
||||
|
||||
last_col = min(src_w->_begx + src_w->_maxx, dst_w->_begx + dst_w->_maxx);
|
||||
last_line = min(src_w->_begy + src_w->_maxy, dst_w->_begy + dst_w->_maxy);
|
||||
|
||||
/* determine the overlapping region of the two windows in real
|
||||
coordinates */
|
||||
|
||||
/* if no overlapping region, do nothing */
|
||||
|
||||
if ((last_col < first_col) || (last_line < first_line))
|
||||
return OK;
|
||||
|
||||
/* size of overlapping region */
|
||||
|
||||
xdiff = last_col - first_col;
|
||||
ydiff = last_line - first_line;
|
||||
|
||||
if (src_w->_begx <= dst_w->_begx)
|
||||
{
|
||||
src_start_x = dst_w->_begx - src_w->_begx;
|
||||
dst_start_x = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst_start_x = src_w->_begx - dst_w->_begx;
|
||||
src_start_x = 0;
|
||||
}
|
||||
|
||||
if (src_w->_begy <= dst_w->_begy)
|
||||
{
|
||||
src_start_y = dst_w->_begy - src_w->_begy;
|
||||
dst_start_y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst_start_y = src_w->_begy - dst_w->_begy;
|
||||
src_start_y = 0;
|
||||
}
|
||||
|
||||
return _copy_win(src_w, dst_w, src_start_y, src_start_x,
|
||||
src_start_y + ydiff, src_start_x + xdiff,
|
||||
dst_start_y, dst_start_x, FALSE);
|
||||
return _copy_overlap(src_w, dst_w, FALSE);
|
||||
}
|
||||
|
||||
int copywin(const WINDOW *src_w, WINDOW *dst_w, int src_tr, int src_tc,
|
||||
int dst_tr, int dst_tc, int dst_br, int dst_bc, int overlay)
|
||||
int dst_tr, int dst_tc, int dst_br, int dst_bc, int _overlay)
|
||||
{
|
||||
int src_end_x, src_end_y;
|
||||
int src_rows, src_cols, dst_rows, dst_cols;
|
||||
@@ -236,8 +194,8 @@ int copywin(const WINDOW *src_w, WINDOW *dst_w, int src_tr, int src_tc,
|
||||
|
||||
PDC_LOG(("copywin() - called\n"));
|
||||
|
||||
if (!src_w || !dst_w || dst_w == curscr || dst_br > dst_w->_maxy
|
||||
|| dst_bc > dst_w->_maxx || dst_tr < 0 || dst_tc < 0)
|
||||
if (!src_w || !dst_w || dst_w == curscr || dst_br >= dst_w->_maxy
|
||||
|| dst_bc >= dst_w->_maxx || dst_tr < 0 || dst_tc < 0)
|
||||
return ERR;
|
||||
|
||||
src_rows = src_w->_maxy - src_tr;
|
||||
@@ -252,5 +210,5 @@ int copywin(const WINDOW *src_w, WINDOW *dst_w, int src_tr, int src_tc,
|
||||
src_end_x = src_tc + min_cols;
|
||||
|
||||
return _copy_win(src_w, dst_w, src_tr, src_tc, src_end_y, src_end_x,
|
||||
dst_tr, dst_tc, overlay);
|
||||
dst_tr, dst_tc, _overlay);
|
||||
}
|
||||
|
||||
101
pdcurses/pad.c
101
pdcurses/pad.c
@@ -2,67 +2,70 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: pad.c,v 1.50 2008/07/14 12:22:13 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pad
|
||||
pad
|
||||
---
|
||||
|
||||
Synopsis:
|
||||
WINDOW *newpad(int nlines, int ncols);
|
||||
WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
int prefresh(WINDOW *win, int py, int px, int sy1, int sx1,
|
||||
int sy2, int sx2);
|
||||
int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1,
|
||||
int sy2, int sx2);
|
||||
int pechochar(WINDOW *pad, chtype ch);
|
||||
int pecho_wchar(WINDOW *pad, const cchar_t *wch);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
A pad is a special kind of window, which is not restricted by
|
||||
the screen size, and is not necessarily associated with a
|
||||
particular part of the screen. You can use a pad when you need
|
||||
a large window, and only a part of the window will be on the
|
||||
screen at one time. Pads are not refreshed automatically (e.g.,
|
||||
from scrolling or echoing of input). You can't call wrefresh()
|
||||
with a pad as an argument; use prefresh() or pnoutrefresh()
|
||||
instead. Note that these routines require additional parameters
|
||||
to specify the part of the pad to be displayed, and the location
|
||||
to use on the screen.
|
||||
WINDOW *newpad(int nlines, int ncols);
|
||||
WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
int prefresh(WINDOW *win, int py, int px, int sy1, int sx1,
|
||||
int sy2, int sx2);
|
||||
int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1,
|
||||
int sy2, int sx2);
|
||||
int pechochar(WINDOW *pad, chtype ch);
|
||||
int pecho_wchar(WINDOW *pad, const cchar_t *wch);
|
||||
|
||||
newpad() creates a new pad data structure.
|
||||
### Description
|
||||
|
||||
subpad() creates a new sub-pad within a pad, at position (begy,
|
||||
begx), with dimensions of nlines lines and ncols columns. This
|
||||
position is relative to the pad, and not to the screen as with
|
||||
subwin. Changes to either the parent pad or sub-pad will affect
|
||||
both. When using sub-pads, you may need to call touchwin()
|
||||
before calling prefresh().
|
||||
A pad is a special kind of window, which is not restricted by
|
||||
the screen size, and is not necessarily associated with a
|
||||
particular part of the screen. You can use a pad when you need
|
||||
a large window, and only a part of the window will be on the
|
||||
screen at one time. Pads are not refreshed automatically (e.g.,
|
||||
from scrolling or echoing of input). You can't call wrefresh()
|
||||
with a pad as an argument; use prefresh() or pnoutrefresh()
|
||||
instead. Note that these routines require additional parameters
|
||||
to specify the part of the pad to be displayed, and the location
|
||||
to use on the screen.
|
||||
|
||||
pnoutrefresh() copies the specified pad to the virtual screen.
|
||||
newpad() creates a new pad data structure.
|
||||
|
||||
prefresh() calls pnoutrefresh(), followed by doupdate().
|
||||
subpad() creates a new sub-pad within a pad, at position (begy,
|
||||
begx), with dimensions of nlines lines and ncols columns. This
|
||||
position is relative to the pad, and not to the screen as with
|
||||
subwin. Changes to either the parent pad or sub-pad will affect
|
||||
both. When using sub-pads, you may need to call touchwin()
|
||||
before calling prefresh().
|
||||
|
||||
These routines are analogous to wnoutrefresh() and wrefresh().
|
||||
(py, px) specifies the upper left corner of the part of the pad
|
||||
to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen
|
||||
rectangle that will contain the selected part of the pad.
|
||||
pnoutrefresh() copies the specified pad to the virtual screen.
|
||||
|
||||
pechochar() is functionally equivalent to addch() followed by
|
||||
a call to prefresh(), with the last-used coordinates and
|
||||
dimensions. pecho_wchar() is the wide-character version.
|
||||
prefresh() calls pnoutrefresh(), followed by doupdate().
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
These routines are analogous to wnoutrefresh() and wrefresh().
|
||||
(py, px) specifies the upper left corner of the part of the pad
|
||||
to be displayed; (sy1, sx1) and (sy2, sx2) describe the screen
|
||||
rectangle that will contain the selected part of the pad.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
newpad Y - Y
|
||||
subpad Y - Y
|
||||
prefresh Y - Y
|
||||
pnoutrefresh Y - Y
|
||||
pechochar Y - 3.0
|
||||
pecho_wchar Y
|
||||
pechochar() is functionally equivalent to addch() followed by
|
||||
a call to prefresh(), with the last-used coordinates and
|
||||
dimensions. pecho_wchar() is the wide-character version.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
newpad Y - Y
|
||||
subpad Y - Y
|
||||
prefresh Y - Y
|
||||
pnoutrefresh Y - Y
|
||||
pechochar Y - 3.0
|
||||
pecho_wchar Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
189
pdcurses/panel.c
189
pdcurses/panel.c
@@ -2,124 +2,127 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: panel.c,v 1.8 2008/07/14 12:35:23 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: panel
|
||||
panel
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int bottom_panel(PANEL *pan);
|
||||
int del_panel(PANEL *pan);
|
||||
int hide_panel(PANEL *pan);
|
||||
int move_panel(PANEL *pan, int starty, int startx);
|
||||
PANEL *new_panel(WINDOW *win);
|
||||
PANEL *panel_above(const PANEL *pan);
|
||||
PANEL *panel_below(const PANEL *pan);
|
||||
int panel_hidden(const PANEL *pan);
|
||||
const void *panel_userptr(const PANEL *pan);
|
||||
WINDOW *panel_window(const PANEL *pan);
|
||||
int replace_panel(PANEL *pan, WINDOW *win);
|
||||
int set_panel_userptr(PANEL *pan, const void *uptr);
|
||||
int show_panel(PANEL *pan);
|
||||
int top_panel(PANEL *pan);
|
||||
void update_panels(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
The panel library is built using the curses library, and any
|
||||
program using panels routines must call one of the curses
|
||||
initialization routines such as initscr(). A program using these
|
||||
routines must be linked with the panels and curses libraries.
|
||||
The header <panel.h> includes the header <curses.h>.
|
||||
int bottom_panel(PANEL *pan);
|
||||
int del_panel(PANEL *pan);
|
||||
int hide_panel(PANEL *pan);
|
||||
int move_panel(PANEL *pan, int starty, int startx);
|
||||
PANEL *new_panel(WINDOW *win);
|
||||
PANEL *panel_above(const PANEL *pan);
|
||||
PANEL *panel_below(const PANEL *pan);
|
||||
int panel_hidden(const PANEL *pan);
|
||||
const void *panel_userptr(const PANEL *pan);
|
||||
WINDOW *panel_window(const PANEL *pan);
|
||||
int replace_panel(PANEL *pan, WINDOW *win);
|
||||
int set_panel_userptr(PANEL *pan, const void *uptr);
|
||||
int show_panel(PANEL *pan);
|
||||
int top_panel(PANEL *pan);
|
||||
void update_panels(void);
|
||||
|
||||
The panels package gives the applications programmer a way to
|
||||
have depth relationships between curses windows; a curses window
|
||||
is associated with every panel. The panels routines allow curses
|
||||
windows to overlap without making visible the overlapped
|
||||
portions of underlying windows. The initial curses window,
|
||||
stdscr, lies beneath all panels. The set of currently visible
|
||||
panels is the 'deck' of panels.
|
||||
### Description
|
||||
|
||||
The panels package allows the applications programmer to create
|
||||
panels, fetch and set their associated windows, shuffle panels
|
||||
in the deck, and manipulate panels in other ways.
|
||||
The panel library is built using the curses library, and any
|
||||
program using panels routines must call one of the curses
|
||||
initialization routines such as initscr(). A program using these
|
||||
routines must be linked with the panels and curses libraries.
|
||||
The header <panel.h> includes the header <curses.h>.
|
||||
|
||||
bottom_panel() places pan at the bottom of the deck. The size,
|
||||
location and contents of the panel are unchanged.
|
||||
The panels package gives the applications programmer a way to
|
||||
have depth relationships between curses windows; a curses window
|
||||
is associated with every panel. The panels routines allow curses
|
||||
windows to overlap without making visible the overlapped
|
||||
portions of underlying windows. The initial curses window,
|
||||
stdscr, lies beneath all panels. The set of currently visible
|
||||
panels is the 'deck' of panels.
|
||||
|
||||
del_panel() deletes pan, but not its associated winwow.
|
||||
The panels package allows the applications programmer to create
|
||||
panels, fetch and set their associated windows, shuffle panels
|
||||
in the deck, and manipulate panels in other ways.
|
||||
|
||||
hide_panel() removes a panel from the deck and thus hides it
|
||||
from view.
|
||||
bottom_panel() places pan at the bottom of the deck. The size,
|
||||
location and contents of the panel are unchanged.
|
||||
|
||||
move_panel() moves the curses window associated with pan, so
|
||||
that its upper lefthand corner is at the supplied coordinates.
|
||||
(Do not use mvwin() on the window.)
|
||||
del_panel() deletes pan, but not its associated winwow.
|
||||
|
||||
new_panel() creates a new panel associated with win and returns
|
||||
the panel pointer. The new panel is placed at the top of the
|
||||
deck.
|
||||
hide_panel() removes a panel from the deck and thus hides it
|
||||
from view.
|
||||
|
||||
panel_above() returns a pointer to the panel in the deck above
|
||||
pan, or NULL if pan is the top panel. If the value of pan passed
|
||||
is NULL, this function returns a pointer to the bottom panel in
|
||||
the deck.
|
||||
move_panel() moves the curses window associated with pan, so
|
||||
that its upper lefthand corner is at the supplied coordinates.
|
||||
(Do not use mvwin() on the window.)
|
||||
|
||||
panel_below() returns a pointer to the panel in the deck below
|
||||
pan, or NULL if pan is the bottom panel. If the value of pan
|
||||
passed is NULL, this function returns a pointer to the top panel
|
||||
in the deck.
|
||||
new_panel() creates a new panel associated with win and returns
|
||||
the panel pointer. The new panel is placed at the top of the
|
||||
deck.
|
||||
|
||||
panel_hidden() returns OK if pan is hidden and ERR if it is not.
|
||||
panel_above() returns a pointer to the panel in the deck above
|
||||
pan, or NULL if pan is the top panel. If the value of pan passed
|
||||
is NULL, this function returns a pointer to the bottom panel in
|
||||
the deck.
|
||||
|
||||
panel_userptr() - Each panel has a user pointer available for
|
||||
maintaining relevant information. This function returns a
|
||||
pointer to that information previously set up by
|
||||
set_panel_userptr().
|
||||
panel_below() returns a pointer to the panel in the deck below
|
||||
pan, or NULL if pan is the bottom panel. If the value of pan
|
||||
passed is NULL, this function returns a pointer to the top panel
|
||||
in the deck.
|
||||
|
||||
panel_window() returns a pointer to the curses window associated
|
||||
with the panel.
|
||||
panel_hidden() returns OK if pan is hidden and ERR if it is not.
|
||||
|
||||
replace_panel() replaces the current window of pan with win.
|
||||
panel_userptr() - Each panel has a user pointer available for
|
||||
maintaining relevant information. This function returns a
|
||||
pointer to that information previously set up by
|
||||
set_panel_userptr().
|
||||
|
||||
set_panel_userptr() - Each panel has a user pointer available
|
||||
for maintaining relevant information. This function sets the
|
||||
value of that information.
|
||||
panel_window() returns a pointer to the curses window associated
|
||||
with the panel.
|
||||
|
||||
show_panel() makes a previously hidden panel visible and places
|
||||
it back in the deck on top.
|
||||
replace_panel() replaces the current window of pan with win.
|
||||
|
||||
top_panel() places pan on the top of the deck. The size,
|
||||
location and contents of the panel are unchanged.
|
||||
set_panel_userptr() - Each panel has a user pointer available
|
||||
for maintaining relevant information. This function sets the
|
||||
value of that information.
|
||||
|
||||
update_panels() refreshes the virtual screen to reflect the
|
||||
depth relationships between the panels in the deck. The user
|
||||
must use doupdate() to refresh the physical screen.
|
||||
show_panel() makes a previously hidden panel visible and places
|
||||
it back in the deck on top.
|
||||
|
||||
Return Value:
|
||||
Each routine that returns a pointer to an object returns NULL if
|
||||
an error occurs. Each panel routine that returns an integer,
|
||||
returns OK if it executes successfully and ERR if it does not.
|
||||
top_panel() places pan on the top of the deck. The size,
|
||||
location and contents of the panel are unchanged.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
bottom_panel - - Y
|
||||
del_panel - - Y
|
||||
hide_panel - - Y
|
||||
move_panel - - Y
|
||||
new_panel - - Y
|
||||
panel_above - - Y
|
||||
panel_below - - Y
|
||||
panel_hidden - - Y
|
||||
panel_userptr - - Y
|
||||
panel_window - - Y
|
||||
replace_panel - - Y
|
||||
set_panel_userptr - - Y
|
||||
show_panel - - Y
|
||||
top_panel - - Y
|
||||
update_panels - - Y
|
||||
update_panels() refreshes the virtual screen to reflect the
|
||||
depth relationships between the panels in the deck. The user
|
||||
must use doupdate() to refresh the physical screen.
|
||||
|
||||
### Return Value
|
||||
|
||||
Each routine that returns a pointer to an object returns NULL if
|
||||
an error occurs. Each panel routine that returns an integer,
|
||||
returns OK if it executes successfully and ERR if it does not.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
bottom_panel - - Y
|
||||
del_panel - - Y
|
||||
hide_panel - - Y
|
||||
move_panel - - Y
|
||||
new_panel - - Y
|
||||
panel_above - - Y
|
||||
panel_below - - Y
|
||||
panel_hidden - - Y
|
||||
panel_userptr - - Y
|
||||
panel_window - - Y
|
||||
replace_panel - - Y
|
||||
set_panel_userptr - - Y
|
||||
show_panel - - Y
|
||||
top_panel - - Y
|
||||
update_panels - - Y
|
||||
|
||||
Credits:
|
||||
Original Author - Warren Tucker <wht@n4hgf.mt-park.ga.us>
|
||||
Original Author - Warren Tucker <wht@n4hgf.mt-park.ga.us>
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,37 +2,40 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: printw.c,v 1.40 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: printw
|
||||
printw
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int printw(const char *fmt, ...);
|
||||
int wprintw(WINDOW *win, const char *fmt, ...);
|
||||
int mvprintw(int y, int x, const char *fmt, ...);
|
||||
int mvwprintw(WINDOW *win, int y, int x, const char *fmt,...);
|
||||
int vwprintw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
int vw_printw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
The printw() functions add a formatted string to the window at
|
||||
the current or specified cursor position. The format strings are
|
||||
the same as used in the standard C library's printf(). (printw()
|
||||
can be used as a drop-in replacement for printf().)
|
||||
int printw(const char *fmt, ...);
|
||||
int wprintw(WINDOW *win, const char *fmt, ...);
|
||||
int mvprintw(int y, int x, const char *fmt, ...);
|
||||
int mvwprintw(WINDOW *win, int y, int x, const char *fmt,...);
|
||||
int vwprintw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
int vw_printw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
|
||||
Return Value:
|
||||
All functions return the number of characters printed, or
|
||||
ERR on error.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
printw Y Y Y
|
||||
wprintw Y Y Y
|
||||
mvprintw Y Y Y
|
||||
mvwprintw Y Y Y
|
||||
vwprintw Y - 4.0
|
||||
vw_printw Y
|
||||
The printw() functions add a formatted string to the window at
|
||||
the current or specified cursor position. The format strings are
|
||||
the same as used in the standard C library's printf(). (printw()
|
||||
can be used as a drop-in replacement for printf().)
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return the number of characters printed, or
|
||||
ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
printw Y Y Y
|
||||
wprintw Y Y Y
|
||||
mvprintw Y Y Y
|
||||
mvwprintw Y Y Y
|
||||
vwprintw Y - 4.0
|
||||
vw_printw Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,55 +2,58 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: refresh.c,v 1.56 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: refresh
|
||||
refresh
|
||||
-------
|
||||
|
||||
Synopsis:
|
||||
int refresh(void);
|
||||
int wrefresh(WINDOW *win);
|
||||
int wnoutrefresh(WINDOW *win);
|
||||
int doupdate(void);
|
||||
int redrawwin(WINDOW *win);
|
||||
int wredrawln(WINDOW *win, int beg_line, int num_lines);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
wrefresh() copies the named window to the physical terminal
|
||||
screen, taking into account what is already there in order to
|
||||
optimize cursor movement. refresh() does the same, using stdscr.
|
||||
These routines must be called to get any output on the terminal,
|
||||
as other routines only manipulate data structures. Unless
|
||||
leaveok() has been enabled, the physical cursor of the terminal
|
||||
is left at the location of the window's cursor.
|
||||
int refresh(void);
|
||||
int wrefresh(WINDOW *win);
|
||||
int wnoutrefresh(WINDOW *win);
|
||||
int doupdate(void);
|
||||
int redrawwin(WINDOW *win);
|
||||
int wredrawln(WINDOW *win, int beg_line, int num_lines);
|
||||
|
||||
wnoutrefresh() and doupdate() allow multiple updates with more
|
||||
efficiency than wrefresh() alone. wrefresh() works by first
|
||||
calling wnoutrefresh(), which copies the named window to the
|
||||
virtual screen. It then calls doupdate(), which compares the
|
||||
virtual screen to the physical screen and does the actual
|
||||
update. A series of calls to wrefresh() will result in
|
||||
alternating calls to wnoutrefresh() and doupdate(), causing
|
||||
several bursts of output to the screen. By first calling
|
||||
wnoutrefresh() for each window, it is then possible to call
|
||||
doupdate() only once.
|
||||
### Description
|
||||
|
||||
In PDCurses, redrawwin() is equivalent to touchwin(), and
|
||||
wredrawln() is the same as touchline(). In some other curses
|
||||
implementations, there's a subtle distinction, but it has no
|
||||
meaning in PDCurses.
|
||||
wrefresh() copies the named window to the physical terminal
|
||||
screen, taking into account what is already there in order to
|
||||
optimize cursor movement. refresh() does the same, using stdscr.
|
||||
These routines must be called to get any output on the terminal,
|
||||
as other routines only manipulate data structures. Unless
|
||||
leaveok() has been enabled, the physical cursor of the terminal
|
||||
is left at the location of the window's cursor.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
wnoutrefresh() and doupdate() allow multiple updates with more
|
||||
efficiency than wrefresh() alone. wrefresh() works by first
|
||||
calling wnoutrefresh(), which copies the named window to the
|
||||
virtual screen. It then calls doupdate(), which compares the
|
||||
virtual screen to the physical screen and does the actual
|
||||
update. A series of calls to wrefresh() will result in
|
||||
alternating calls to wnoutrefresh() and doupdate(), causing
|
||||
several bursts of output to the screen. By first calling
|
||||
wnoutrefresh() for each window, it is then possible to call
|
||||
doupdate() only once.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
refresh Y Y Y
|
||||
wrefresh Y Y Y
|
||||
wnoutrefresh Y Y Y
|
||||
doupdate Y Y Y
|
||||
redrawwin Y - 4.0
|
||||
wredrawln Y - 4.0
|
||||
In PDCurses, redrawwin() is equivalent to touchwin(), and
|
||||
wredrawln() is the same as touchline(). In some other curses
|
||||
implementations, there's a subtle distinction, but it has no
|
||||
meaning in PDCurses.
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
refresh Y Y Y
|
||||
wrefresh Y Y Y
|
||||
wnoutrefresh Y Y Y
|
||||
doupdate Y Y Y
|
||||
redrawwin Y - 4.0
|
||||
wredrawln Y - 4.0
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: scanw.c,v 1.42 2008/07/14 12:22:13 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: scanw
|
||||
scanw
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int scanw(const char *fmt, ...);
|
||||
int wscanw(WINDOW *win, const char *fmt, ...);
|
||||
int mvscanw(int y, int x, const char *fmt, ...);
|
||||
int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...);
|
||||
int vwscanw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
int vw_scanw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
These routines correspond to the standard C library's scanf()
|
||||
family. Each gets a string from the window via wgetnstr(), and
|
||||
uses the resulting line as input for the scan.
|
||||
int scanw(const char *fmt, ...);
|
||||
int wscanw(WINDOW *win, const char *fmt, ...);
|
||||
int mvscanw(int y, int x, const char *fmt, ...);
|
||||
int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...);
|
||||
int vwscanw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
int vw_scanw(WINDOW *win, const char *fmt, va_list varglist);
|
||||
|
||||
Return Value:
|
||||
On successful completion, these functions return the number of
|
||||
items successfully matched. Otherwise they return ERR.
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
scanw Y Y Y
|
||||
wscanw Y Y Y
|
||||
mvscanw Y Y Y
|
||||
mvwscanw Y Y Y
|
||||
vwscanw Y - 4.0
|
||||
vw_scanw Y
|
||||
These routines correspond to the standard C library's scanf()
|
||||
family. Each gets a string from the window via wgetnstr(), and
|
||||
uses the resulting line as input for the scan.
|
||||
|
||||
### Return Value
|
||||
|
||||
On successful completion, these functions return the number of
|
||||
items successfully matched. Otherwise they return ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
scanw Y Y Y
|
||||
wscanw Y Y Y
|
||||
mvscanw Y Y Y
|
||||
mvwscanw Y Y Y
|
||||
vwscanw Y - 4.0
|
||||
vw_scanw Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,56 +2,59 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: scr_dump.c,v 1.30 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: scr_dump
|
||||
scr_dump
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int putwin(WINDOW *win, FILE *filep);
|
||||
WINDOW *getwin(FILE *filep);
|
||||
int scr_dump(const char *filename);
|
||||
int scr_init(const char *filename);
|
||||
int scr_restore(const char *filename);
|
||||
int scr_set(const char *filename);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
getwin() reads window-related data previously stored in a file
|
||||
by putwin(). It then creates and initialises a new window using
|
||||
that data.
|
||||
int putwin(WINDOW *win, FILE *filep);
|
||||
WINDOW *getwin(FILE *filep);
|
||||
int scr_dump(const char *filename);
|
||||
int scr_init(const char *filename);
|
||||
int scr_restore(const char *filename);
|
||||
int scr_set(const char *filename);
|
||||
|
||||
putwin() writes all data associated with a window into a file,
|
||||
using an unspecified format. This information can be retrieved
|
||||
later using getwin().
|
||||
### Description
|
||||
|
||||
scr_dump() writes the current contents of the virtual screen to
|
||||
the file named by filename in an unspecified format.
|
||||
getwin() reads window-related data previously stored in a file
|
||||
by putwin(). It then creates and initialises a new window using
|
||||
that data.
|
||||
|
||||
scr_restore() function sets the virtual screen to the contents
|
||||
of the file named by filename, which must have been written
|
||||
using scr_dump(). The next refresh operation restores the screen
|
||||
to the way it looked in the dump file.
|
||||
putwin() writes all data associated with a window into a file,
|
||||
using an unspecified format. This information can be retrieved
|
||||
later using getwin().
|
||||
|
||||
In PDCurses, scr_init() does nothing, and scr_set() is a synonym
|
||||
for scr_restore(). Also, scr_dump() and scr_restore() save and
|
||||
load from curscr. This differs from some other implementations,
|
||||
where scr_init() works with curscr, and scr_restore() works with
|
||||
newscr; but the effect should be the same. (PDCurses has no
|
||||
newscr.)
|
||||
scr_dump() writes the current contents of the virtual screen to
|
||||
the file named by filename in an unspecified format.
|
||||
|
||||
Return Value:
|
||||
On successful completion, getwin() returns a pointer to the
|
||||
window it created. Otherwise, it returns a null pointer. Other
|
||||
functions return OK or ERR.
|
||||
scr_restore() function sets the virtual screen to the contents
|
||||
of the file named by filename, which must have been written
|
||||
using scr_dump(). The next refresh operation restores the screen
|
||||
to the way it looked in the dump file.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
putwin Y
|
||||
getwin Y
|
||||
scr_dump Y
|
||||
scr_init Y
|
||||
scr_restore Y
|
||||
scr_set Y
|
||||
In PDCurses, scr_init() does nothing, and scr_set() is a synonym
|
||||
for scr_restore(). Also, scr_dump() and scr_restore() save and
|
||||
load from curscr. This differs from some other implementations,
|
||||
where scr_init() works with curscr, and scr_restore() works with
|
||||
newscr; but the effect should be the same. (PDCurses has no
|
||||
newscr.)
|
||||
|
||||
### Return Value
|
||||
|
||||
On successful completion, getwin() returns a pointer to the
|
||||
window it created. Otherwise, it returns a null pointer. Other
|
||||
functions return OK or ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
putwin Y
|
||||
getwin Y
|
||||
scr_dump Y
|
||||
scr_init Y
|
||||
scr_restore Y
|
||||
scr_set Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: scroll.c,v 1.36 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: scroll
|
||||
scroll
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
int scroll(WINDOW *win);
|
||||
int scrl(int n);
|
||||
int wscrl(WINDOW *win, int n);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
scroll() causes the window to scroll up one line. This involves
|
||||
moving the lines in the window data strcture.
|
||||
int scroll(WINDOW *win);
|
||||
int scrl(int n);
|
||||
int wscrl(WINDOW *win, int n);
|
||||
|
||||
### Description
|
||||
|
||||
scroll() causes the window to scroll up one line. This involves
|
||||
moving the lines in the window data strcture.
|
||||
|
||||
With a positive n, scrl() and wscrl() scroll the window up n
|
||||
lines (line i + n becomes i); otherwise they scroll the window
|
||||
down n lines.
|
||||
With a positive n, scrl() and wscrl() scroll the window up n
|
||||
lines (line i + n becomes i); otherwise they scroll the window
|
||||
down n lines.
|
||||
|
||||
For these functions to work, scrolling must be enabled via
|
||||
scrollok(). Note also that scrolling is not allowed if the
|
||||
supplied window is a pad.
|
||||
For these functions to work, scrolling must be enabled via
|
||||
scrollok(). Note also that scrolling is not allowed if the
|
||||
supplied window is a pad.
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
### Return Value
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
scroll Y Y Y
|
||||
scrl Y - 4.0
|
||||
wscrl Y - 4.0
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
scroll Y Y Y
|
||||
scrl Y - 4.0
|
||||
wscrl Y - 4.0
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
129
pdcurses/slk.c
129
pdcurses/slk.c
@@ -2,82 +2,85 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: slk.c,v 1.61 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: slk
|
||||
slk
|
||||
---
|
||||
|
||||
Synopsis:
|
||||
int slk_init(int fmt);
|
||||
int slk_set(int labnum, const char *label, int justify);
|
||||
int slk_refresh(void);
|
||||
int slk_noutrefresh(void);
|
||||
char *slk_label(int labnum);
|
||||
int slk_clear(void);
|
||||
int slk_restore(void);
|
||||
int slk_touch(void);
|
||||
int slk_attron(const chtype attrs);
|
||||
int slk_attr_on(const attr_t attrs, void *opts);
|
||||
int slk_attrset(const chtype attrs);
|
||||
int slk_attr_set(const attr_t attrs, short color_pair, void *opts);
|
||||
int slk_attroff(const chtype attrs);
|
||||
int slk_attr_off(const attr_t attrs, void *opts);
|
||||
int slk_color(short color_pair);
|
||||
### Synopsis
|
||||
|
||||
int slk_wset(int labnum, const wchar_t *label, int justify);
|
||||
int slk_init(int fmt);
|
||||
int slk_set(int labnum, const char *label, int justify);
|
||||
int slk_refresh(void);
|
||||
int slk_noutrefresh(void);
|
||||
char *slk_label(int labnum);
|
||||
int slk_clear(void);
|
||||
int slk_restore(void);
|
||||
int slk_touch(void);
|
||||
int slk_attron(const chtype attrs);
|
||||
int slk_attr_on(const attr_t attrs, void *opts);
|
||||
int slk_attrset(const chtype attrs);
|
||||
int slk_attr_set(const attr_t attrs, short color_pair, void *opts);
|
||||
int slk_attroff(const chtype attrs);
|
||||
int slk_attr_off(const attr_t attrs, void *opts);
|
||||
int slk_color(short color_pair);
|
||||
|
||||
int PDC_mouse_in_slk(int y, int x);
|
||||
void PDC_slk_free(void);
|
||||
void PDC_slk_initialize(void);
|
||||
int slk_wset(int labnum, const wchar_t *label, int justify);
|
||||
|
||||
wchar_t *slk_wlabel(int labnum)
|
||||
int PDC_mouse_in_slk(int y, int x);
|
||||
void PDC_slk_free(void);
|
||||
void PDC_slk_initialize(void);
|
||||
|
||||
Description:
|
||||
These functions manipulate a window that contain Soft Label Keys
|
||||
(SLK). To use the SLK functions, a call to slk_init() must be
|
||||
made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
|
||||
lines from the useable screen, depending on the format selected.
|
||||
wchar_t *slk_wlabel(int labnum)
|
||||
|
||||
The line(s) removed from the screen are used as a separate
|
||||
window, in which SLKs are displayed.
|
||||
### Description
|
||||
|
||||
slk_init() requires a single parameter which describes the
|
||||
format of the SLKs as follows:
|
||||
These functions manipulate a window that contain Soft Label Keys
|
||||
(SLK). To use the SLK functions, a call to slk_init() must be
|
||||
made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
|
||||
lines from the useable screen, depending on the format selected.
|
||||
|
||||
The line(s) removed from the screen are used as a separate
|
||||
window, in which SLKs are displayed.
|
||||
|
||||
slk_init() requires a single parameter which describes the
|
||||
format of the SLKs as follows:
|
||||
|
||||
0 3-2-3 format
|
||||
1 4-4 format
|
||||
2 4-4-4 format (ncurses extension)
|
||||
3 4-4-4 format with index line (ncurses extension)
|
||||
2 lines used
|
||||
55 5-5 format (pdcurses format)
|
||||
0 3-2-3 format
|
||||
1 4-4 format
|
||||
2 4-4-4 format (ncurses extension)
|
||||
3 4-4-4 format with index line (ncurses extension)
|
||||
2 lines used
|
||||
55 5-5 format (pdcurses format)
|
||||
|
||||
slk_refresh(), slk_noutrefresh() and slk_touch() are analogous
|
||||
to refresh(), noutrefresh() and touch().
|
||||
slk_refresh(), slk_noutrefresh() and slk_touch() are analogous
|
||||
to refresh(), noutrefresh() and touch().
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error.
|
||||
### Return Value
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
slk_init Y - Y
|
||||
slk_set Y - Y
|
||||
slk_refresh Y - Y
|
||||
slk_noutrefresh Y - Y
|
||||
slk_label Y - Y
|
||||
slk_clear Y - Y
|
||||
slk_restore Y - Y
|
||||
slk_touch Y - Y
|
||||
slk_attron Y - Y
|
||||
slk_attrset Y - Y
|
||||
slk_attroff Y - Y
|
||||
slk_attr_on Y
|
||||
slk_attr_set Y
|
||||
slk_attr_off Y
|
||||
slk_wset Y
|
||||
PDC_mouse_in_slk - - -
|
||||
PDC_slk_free - - -
|
||||
PDC_slk_initialize - - -
|
||||
slk_wlabel - - -
|
||||
All functions return OK on success and ERR on error.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
slk_init Y - Y
|
||||
slk_set Y - Y
|
||||
slk_refresh Y - Y
|
||||
slk_noutrefresh Y - Y
|
||||
slk_label Y - Y
|
||||
slk_clear Y - Y
|
||||
slk_restore Y - Y
|
||||
slk_touch Y - Y
|
||||
slk_attron Y - Y
|
||||
slk_attrset Y - Y
|
||||
slk_attroff Y - Y
|
||||
slk_attr_on Y
|
||||
slk_attr_set Y
|
||||
slk_attr_off Y
|
||||
slk_wset Y
|
||||
PDC_mouse_in_slk - - -
|
||||
PDC_slk_free - - -
|
||||
PDC_slk_initialize - - -
|
||||
slk_wlabel - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,69 +2,71 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: termattr.c,v 1.54 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: termattr
|
||||
termattr
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int baudrate(void);
|
||||
char erasechar(void);
|
||||
bool has_ic(void);
|
||||
bool has_il(void);
|
||||
char killchar(void);
|
||||
char *longname(void);
|
||||
chtype termattrs(void);
|
||||
attr_t term_attrs(void);
|
||||
char *termname(void);
|
||||
### Synopsis
|
||||
|
||||
int erasewchar(wchar_t *ch);
|
||||
int killwchar(wchar_t *ch);
|
||||
int baudrate(void);
|
||||
char erasechar(void);
|
||||
bool has_ic(void);
|
||||
bool has_il(void);
|
||||
char killchar(void);
|
||||
char *longname(void);
|
||||
chtype termattrs(void);
|
||||
attr_t term_attrs(void);
|
||||
char *termname(void);
|
||||
|
||||
char wordchar(void);
|
||||
int erasewchar(wchar_t *ch);
|
||||
int killwchar(wchar_t *ch);
|
||||
|
||||
Description:
|
||||
baudrate() is supposed to return the output speed of the
|
||||
terminal. In PDCurses, it simply returns INT_MAX.
|
||||
char wordchar(void);
|
||||
|
||||
has_ic and has_il() return TRUE. These functions have meaning in
|
||||
some other implementations of curses.
|
||||
### Description
|
||||
|
||||
erasechar() and killchar() return ^H and ^U, respectively -- the
|
||||
ERASE and KILL characters. In other curses implementations,
|
||||
these may vary by terminal type. erasewchar() and killwchar()
|
||||
are the wide-character versions; they take a pointer to a
|
||||
location in which to store the character, and return OK or ERR.
|
||||
baudrate() is supposed to return the output speed of the
|
||||
terminal. In PDCurses, it simply returns INT_MAX.
|
||||
|
||||
longname() returns a pointer to a static area containing a
|
||||
verbose description of the current terminal. The maximum length
|
||||
of the string is 128 characters. It is defined only after the
|
||||
call to initscr() or newterm().
|
||||
has_ic and has_il() return TRUE. These functions have meaning in
|
||||
some other implementations of curses.
|
||||
|
||||
termname() returns a pointer to a static area containing a
|
||||
short description of the current terminal (14 characters).
|
||||
erasechar() and killchar() return ^H and ^U, respectively -- the
|
||||
ERASE and KILL characters. In other curses implementations,
|
||||
these may vary by terminal type. erasewchar() and killwchar()
|
||||
are the wide-character versions; they take a pointer to a
|
||||
location in which to store the character, and return OK or ERR.
|
||||
|
||||
termattrs() returns a logical OR of all video attributes
|
||||
supported by the terminal.
|
||||
longname() returns a pointer to a static area containing a
|
||||
verbose description of the current terminal. The maximum length
|
||||
of the string is 128 characters. It is defined only after the
|
||||
call to initscr() or newterm().
|
||||
|
||||
wordchar() is a PDCurses extension of the concept behind the
|
||||
functions erasechar() and killchar(), returning the "delete
|
||||
word" character, ^W.
|
||||
termname() returns a pointer to a static area containing a
|
||||
short description of the current terminal (14 characters).
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
baudrate Y Y Y
|
||||
erasechar Y Y Y
|
||||
has_ic Y Y Y
|
||||
has_il Y Y Y
|
||||
killchar Y Y Y
|
||||
longname Y Y Y
|
||||
termattrs Y Y Y
|
||||
termname Y Y Y
|
||||
erasewchar Y
|
||||
killwchar Y
|
||||
term_attrs Y
|
||||
wordchar - - -
|
||||
termattrs() returns a logical OR of all video attributes
|
||||
supported by the terminal.
|
||||
|
||||
wordchar() is a PDCurses extension of the concept behind the
|
||||
functions erasechar() and killchar(), returning the "delete
|
||||
word" character, ^W.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
baudrate Y Y Y
|
||||
erasechar Y Y Y
|
||||
has_ic Y Y Y
|
||||
has_il Y Y Y
|
||||
killchar Y Y Y
|
||||
longname Y Y Y
|
||||
termattrs Y Y Y
|
||||
termname Y Y Y
|
||||
erasewchar Y
|
||||
killwchar Y
|
||||
term_attrs Y
|
||||
wordchar - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -137,9 +139,11 @@ attr_t term_attrs(void)
|
||||
|
||||
char *termname(void)
|
||||
{
|
||||
static char _termname[14] = "pdcurses";
|
||||
|
||||
PDC_LOG(("termname() - called\n"));
|
||||
|
||||
return "pdcurses";
|
||||
return _termname;
|
||||
}
|
||||
|
||||
char wordchar(void)
|
||||
|
||||
@@ -2,47 +2,49 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: terminfo.c,v 1.37 2008/07/21 12:29:20 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: terminfo
|
||||
terminfo
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int mvcur(int oldrow, int oldcol, int newrow, int newcol);
|
||||
int vidattr(chtype attr);
|
||||
int vid_attr(attr_t attr, short color_pair, void *opt);
|
||||
int vidputs(chtype attr, int (*putfunc)(int));
|
||||
int vid_puts(attr_t attr, short color_pair, void *opt,
|
||||
int (*putfunc)(int));
|
||||
### Synopsis
|
||||
|
||||
int del_curterm(TERMINAL *);
|
||||
int putp(const char *);
|
||||
int restartterm(const char *, int, int *);
|
||||
TERMINAL *set_curterm(TERMINAL *);
|
||||
int setterm(const char *term);
|
||||
int setupterm(const char *, int, int *);
|
||||
int tgetent(char *, const char *);
|
||||
int tgetflag(const char *);
|
||||
int tgetnum(const char *);
|
||||
char *tgetstr(const char *, char **);
|
||||
char *tgoto(const char *, int, int);
|
||||
int tigetflag(const char *);
|
||||
int tigetnum(const char *);
|
||||
char *tigetstr(const char *);
|
||||
char *tparm(const char *,long, long, long, long, long, long,
|
||||
int mvcur(int oldrow, int oldcol, int newrow, int newcol);
|
||||
int vidattr(chtype attr);
|
||||
int vid_attr(attr_t attr, short color_pair, void *opt);
|
||||
int vidputs(chtype attr, int (*putfunc)(int));
|
||||
int vid_puts(attr_t attr, short color_pair, void *opt,
|
||||
int (*putfunc)(int));
|
||||
|
||||
int del_curterm(TERMINAL *);
|
||||
int putp(const char *);
|
||||
int restartterm(const char *, int, int *);
|
||||
TERMINAL *set_curterm(TERMINAL *);
|
||||
int setterm(const char *term);
|
||||
int setupterm(const char *, int, int *);
|
||||
int tgetent(char *, const char *);
|
||||
int tgetflag(const char *);
|
||||
int tgetnum(const char *);
|
||||
char *tgetstr(const char *, char **);
|
||||
char *tgoto(const char *, int, int);
|
||||
int tigetflag(const char *);
|
||||
int tigetnum(const char *);
|
||||
char *tigetstr(const char *);
|
||||
char *tparm(const char *,long, long, long, long, long, long,
|
||||
long, long, long);
|
||||
int tputs(const char *, int, int (*)(int));
|
||||
int tputs(const char *, int, int (*)(int));
|
||||
|
||||
Description:
|
||||
mvcur() lets you move the physical cursor without updating any
|
||||
window cursor positions. It returns OK or ERR.
|
||||
### Description
|
||||
|
||||
The rest of these functions are currently implemented as stubs,
|
||||
returning the appropriate errors and doing nothing else.
|
||||
mvcur() lets you move the physical cursor without updating any
|
||||
window cursor positions. It returns OK or ERR.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
mvcur Y Y Y
|
||||
The rest of these functions are currently implemented as stubs,
|
||||
returning the appropriate errors and doing nothing else.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
mvcur Y Y Y
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,54 +2,57 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: touch.c,v 1.29 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: touch
|
||||
touch
|
||||
-----
|
||||
|
||||
Synopsis:
|
||||
int touchwin(WINDOW *win);
|
||||
int touchline(WINDOW *win, int start, int count);
|
||||
int untouchwin(WINDOW *win);
|
||||
int wtouchln(WINDOW *win, int y, int n, int changed);
|
||||
bool is_linetouched(WINDOW *win, int line);
|
||||
bool is_wintouched(WINDOW *win);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
touchwin() and touchline() throw away all information about
|
||||
which parts of the window have been touched, pretending that the
|
||||
entire window has been drawn on. This is sometimes necessary
|
||||
when using overlapping windows, since a change to one window
|
||||
will affect the other window, but the records of which lines
|
||||
have been changed in the other window will not reflect the
|
||||
change.
|
||||
int touchwin(WINDOW *win);
|
||||
int touchline(WINDOW *win, int start, int count);
|
||||
int untouchwin(WINDOW *win);
|
||||
int wtouchln(WINDOW *win, int y, int n, int changed);
|
||||
bool is_linetouched(WINDOW *win, int line);
|
||||
bool is_wintouched(WINDOW *win);
|
||||
|
||||
untouchwin() marks all lines in the window as unchanged since
|
||||
the last call to wrefresh().
|
||||
### Description
|
||||
|
||||
wtouchln() makes n lines in the window, starting at line y, look
|
||||
as if they have (changed == 1) or have not (changed == 0) been
|
||||
changed since the last call to wrefresh().
|
||||
touchwin() and touchline() throw away all information about
|
||||
which parts of the window have been touched, pretending that the
|
||||
entire window has been drawn on. This is sometimes necessary
|
||||
when using overlapping windows, since a change to one window
|
||||
will affect the other window, but the records of which lines
|
||||
have been changed in the other window will not reflect the
|
||||
change.
|
||||
|
||||
is_linetouched() returns TRUE if the specified line in the
|
||||
specified window has been changed since the last call to
|
||||
wrefresh().
|
||||
untouchwin() marks all lines in the window as unchanged since
|
||||
the last call to wrefresh().
|
||||
|
||||
is_wintouched() returns TRUE if the specified window
|
||||
has been changed since the last call to wrefresh().
|
||||
wtouchln() makes n lines in the window, starting at line y, look
|
||||
as if they have (changed == 1) or have not (changed == 0) been
|
||||
changed since the last call to wrefresh().
|
||||
|
||||
Return Value:
|
||||
All functions return OK on success and ERR on error except
|
||||
is_wintouched() and is_linetouched().
|
||||
is_linetouched() returns TRUE if the specified line in the
|
||||
specified window has been changed since the last call to
|
||||
wrefresh().
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
touchwin Y Y Y
|
||||
touchline Y - 3.0
|
||||
untouchwin Y - 4.0
|
||||
wtouchln Y Y Y
|
||||
is_linetouched Y - 4.0
|
||||
is_wintouched Y - 4.0
|
||||
is_wintouched() returns TRUE if the specified window
|
||||
has been changed since the last call to wrefresh().
|
||||
|
||||
### Return Value
|
||||
|
||||
All functions return OK on success and ERR on error except
|
||||
is_wintouched() and is_linetouched().
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
touchwin Y Y Y
|
||||
touchline Y - 3.0
|
||||
untouchwin Y - 4.0
|
||||
wtouchln Y Y Y
|
||||
is_linetouched Y - 4.0
|
||||
is_wintouched Y - 4.0
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
111
pdcurses/util.c
111
pdcurses/util.c
@@ -2,75 +2,78 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: util.c,v 1.71 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: util
|
||||
util
|
||||
----
|
||||
|
||||
Synopsis:
|
||||
char *unctrl(chtype c);
|
||||
void filter(void);
|
||||
void use_env(bool x);
|
||||
int delay_output(int ms);
|
||||
### Synopsis
|
||||
|
||||
int getcchar(const cchar_t *wcval, wchar_t *wch, attr_t *attrs,
|
||||
short *color_pair, void *opts);
|
||||
int setcchar(cchar_t *wcval, const wchar_t *wch, const attr_t attrs,
|
||||
short color_pair, const void *opts);
|
||||
wchar_t *wunctrl(cchar_t *wc);
|
||||
char *unctrl(chtype c);
|
||||
void filter(void);
|
||||
void use_env(bool x);
|
||||
int delay_output(int ms);
|
||||
|
||||
int PDC_mbtowc(wchar_t *pwc, const char *s, size_t n);
|
||||
size_t PDC_mbstowcs(wchar_t *dest, const char *src, size_t n);
|
||||
size_t PDC_wcstombs(char *dest, const wchar_t *src, size_t n);
|
||||
int getcchar(const cchar_t *wcval, wchar_t *wch, attr_t *attrs,
|
||||
short *color_pair, void *opts);
|
||||
int setcchar(cchar_t *wcval, const wchar_t *wch, const attr_t attrs,
|
||||
short color_pair, const void *opts);
|
||||
wchar_t *wunctrl(cchar_t *wc);
|
||||
|
||||
Description:
|
||||
unctrl() expands the text portion of the chtype c into a
|
||||
printable string. Control characters are changed to the "^X"
|
||||
notation; others are passed through. wunctrl() is the wide-
|
||||
character version of the function.
|
||||
int PDC_mbtowc(wchar_t *pwc, const char *s, size_t n);
|
||||
size_t PDC_mbstowcs(wchar_t *dest, const char *src, size_t n);
|
||||
size_t PDC_wcstombs(char *dest, const wchar_t *src, size_t n);
|
||||
|
||||
filter() and use_env() are no-ops in PDCurses.
|
||||
### Description
|
||||
|
||||
delay_output() inserts an ms millisecond pause in output.
|
||||
unctrl() expands the text portion of the chtype c into a
|
||||
printable string. Control characters are changed to the "^X"
|
||||
notation; others are passed through. wunctrl() is the wide-
|
||||
character version of the function.
|
||||
|
||||
getcchar() works in two modes: When wch is not NULL, it reads
|
||||
the cchar_t pointed to by wcval and stores the attributes in
|
||||
attrs, the color pair in color_pair, and the text in the
|
||||
wide-character string wch. When wch is NULL, getcchar() merely
|
||||
returns the number of wide characters in wcval. In either mode,
|
||||
the opts argument is unused.
|
||||
filter() and use_env() are no-ops in PDCurses.
|
||||
|
||||
setcchar constructs a cchar_t at wcval from the wide-character
|
||||
text at wch, the attributes in attr and the color pair in
|
||||
color_pair. The opts argument is unused.
|
||||
delay_output() inserts an ms millisecond pause in output.
|
||||
|
||||
Currently, the length returned by getcchar() is always 1 or 0.
|
||||
Similarly, setcchar() will only take the first wide character
|
||||
from wch, and ignore any others that it "should" take (i.e.,
|
||||
combining characters). Nor will it correctly handle any
|
||||
character outside the basic multilingual plane (UCS-2).
|
||||
getcchar() works in two modes: When wch is not NULL, it reads
|
||||
the cchar_t pointed to by wcval and stores the attributes in
|
||||
attrs, the color pair in color_pair, and the text in the
|
||||
wide-character string wch. When wch is NULL, getcchar() merely
|
||||
returns the number of wide characters in wcval. In either mode,
|
||||
the opts argument is unused.
|
||||
|
||||
Return Value:
|
||||
unctrl() and wunctrl() return NULL on failure. delay_output()
|
||||
always returns OK.
|
||||
setcchar constructs a cchar_t at wcval from the wide-character
|
||||
text at wch, the attributes in attr and the color pair in
|
||||
color_pair. The opts argument is unused.
|
||||
|
||||
getcchar() returns the number of wide characters wcval points to
|
||||
when wch is NULL; when it's not, getcchar() returns OK or ERR.
|
||||
Currently, the length returned by getcchar() is always 1 or 0.
|
||||
Similarly, setcchar() will only take the first wide character
|
||||
from wch, and ignore any others that it "should" take (i.e.,
|
||||
combining characters). Nor will it correctly handle any
|
||||
character outside the basic multilingual plane (UCS-2).
|
||||
|
||||
setcchar() returns OK or ERR.
|
||||
### Return Value
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
unctrl Y Y Y
|
||||
filter Y - 3.0
|
||||
use_env Y - 4.0
|
||||
delay_output Y Y Y
|
||||
getcchar Y
|
||||
setcchar Y
|
||||
wunctrl Y
|
||||
PDC_mbtowc - - -
|
||||
PDC_mbstowcs - - -
|
||||
PDC_wcstombs - - -
|
||||
unctrl() and wunctrl() return NULL on failure. delay_output()
|
||||
always returns OK.
|
||||
|
||||
getcchar() returns the number of wide characters wcval points to
|
||||
when wch is NULL; when it's not, getcchar() returns OK or ERR.
|
||||
|
||||
setcchar() returns OK or ERR.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
unctrl Y Y Y
|
||||
filter Y - 3.0
|
||||
use_env Y - 4.0
|
||||
delay_output Y Y Y
|
||||
getcchar Y
|
||||
setcchar Y
|
||||
wunctrl Y
|
||||
PDC_mbtowc - - -
|
||||
PDC_mbstowcs - - -
|
||||
PDC_wcstombs - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,131 +2,135 @@
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
RCSID("$Id: window.c,v 1.62 2008/07/13 16:08:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: window
|
||||
window
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
WINDOW *newwin(int nlines, int ncols, int begy, int begx);
|
||||
WINDOW *derwin(WINDOW* orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
WINDOW *subwin(WINDOW* orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
WINDOW *dupwin(WINDOW *win);
|
||||
int delwin(WINDOW *win);
|
||||
int mvwin(WINDOW *win, int y, int x);
|
||||
int mvderwin(WINDOW *win, int pary, int parx);
|
||||
int syncok(WINDOW *win, bool bf);
|
||||
void wsyncup(WINDOW *win);
|
||||
void wcursyncup(WINDOW *win);
|
||||
void wsyncdown(WINDOW *win);
|
||||
### Synopsis
|
||||
|
||||
WINDOW *resize_window(WINDOW *win, int nlines, int ncols);
|
||||
int wresize(WINDOW *win, int nlines, int ncols);
|
||||
WINDOW *PDC_makelines(WINDOW *win);
|
||||
WINDOW *PDC_makenew(int nlines, int ncols, int begy, int begx);
|
||||
void PDC_sync(WINDOW *win);
|
||||
WINDOW *newwin(int nlines, int ncols, int begy, int begx);
|
||||
WINDOW *derwin(WINDOW* orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
WINDOW *subwin(WINDOW* orig, int nlines, int ncols,
|
||||
int begy, int begx);
|
||||
WINDOW *dupwin(WINDOW *win);
|
||||
int delwin(WINDOW *win);
|
||||
int mvwin(WINDOW *win, int y, int x);
|
||||
int mvderwin(WINDOW *win, int pary, int parx);
|
||||
int syncok(WINDOW *win, bool bf);
|
||||
void wsyncup(WINDOW *win);
|
||||
void wcursyncup(WINDOW *win);
|
||||
void wsyncdown(WINDOW *win);
|
||||
|
||||
Description:
|
||||
newwin() creates a new window with the given number of lines,
|
||||
nlines and columns, ncols. The upper left corner of the window
|
||||
is at line begy, column begx. If nlines is zero, it defaults to
|
||||
LINES - begy; ncols to COLS - begx. Create a new full-screen
|
||||
window by calling newwin(0, 0, 0, 0).
|
||||
WINDOW *resize_window(WINDOW *win, int nlines, int ncols);
|
||||
int wresize(WINDOW *win, int nlines, int ncols);
|
||||
WINDOW *PDC_makelines(WINDOW *win);
|
||||
WINDOW *PDC_makenew(int nlines, int ncols, int begy, int begx);
|
||||
void PDC_sync(WINDOW *win);
|
||||
|
||||
delwin() deletes the named window, freeing all associated
|
||||
memory. In the case of overlapping windows, subwindows should be
|
||||
deleted before the main window.
|
||||
### Description
|
||||
|
||||
mvwin() moves the window so that the upper left-hand corner is
|
||||
at position (y,x). If the move would cause the window to be off
|
||||
the screen, it is an error and the window is not moved. Moving
|
||||
subwindows is allowed.
|
||||
newwin() creates a new window with the given number of lines,
|
||||
nlines and columns, ncols. The upper left corner of the window
|
||||
is at line begy, column begx. If nlines is zero, it defaults to
|
||||
LINES - begy; ncols to COLS - begx. Create a new full-screen
|
||||
window by calling newwin(0, 0, 0, 0).
|
||||
|
||||
subwin() creates a new subwindow within a window. The
|
||||
dimensions of the subwindow are nlines lines and ncols columns.
|
||||
The subwindow is at position (begy, begx) on the screen. This
|
||||
position is relative to the screen, and not to the window orig.
|
||||
Changes made to either window will affect both. When using this
|
||||
routine, you will often need to call touchwin() before calling
|
||||
wrefresh().
|
||||
delwin() deletes the named window, freeing all associated
|
||||
memory. In the case of overlapping windows, subwindows should be
|
||||
deleted before the main window.
|
||||
|
||||
derwin() is the same as subwin(), except that begy and begx are
|
||||
relative to the origin of the window orig rather than the
|
||||
screen. There is no difference between subwindows and derived
|
||||
windows.
|
||||
mvwin() moves the window so that the upper left-hand corner is
|
||||
at position (y,x). If the move would cause the window to be off
|
||||
the screen, it is an error and the window is not moved. Moving
|
||||
subwindows is allowed.
|
||||
|
||||
mvderwin() moves a derived window (or subwindow) inside its
|
||||
parent window. The screen-relative parameters of the window are
|
||||
not changed. This routine is used to display different parts of
|
||||
the parent window at the same physical position on the screen.
|
||||
subwin() creates a new subwindow within a window. The
|
||||
dimensions of the subwindow are nlines lines and ncols columns.
|
||||
The subwindow is at position (begy, begx) on the screen. This
|
||||
position is relative to the screen, and not to the window orig.
|
||||
Changes made to either window will affect both. When using this
|
||||
routine, you will often need to call touchwin() before calling
|
||||
wrefresh().
|
||||
|
||||
dupwin() creates an exact duplicate of the window win.
|
||||
derwin() is the same as subwin(), except that begy and begx are
|
||||
relative to the origin of the window orig rather than the
|
||||
screen. There is no difference between subwindows and derived
|
||||
windows.
|
||||
|
||||
wsyncup() causes a touchwin() of all of the window's parents.
|
||||
mvderwin() moves a derived window (or subwindow) inside its
|
||||
parent window. The screen-relative parameters of the window are
|
||||
not changed. This routine is used to display different parts of
|
||||
the parent window at the same physical position on the screen.
|
||||
|
||||
If wsyncok() is called with a second argument of TRUE, this
|
||||
causes a wsyncup() to be called every time the window is
|
||||
changed.
|
||||
dupwin() creates an exact duplicate of the window win.
|
||||
|
||||
wcursyncup() causes the current cursor position of all of a
|
||||
window's ancestors to reflect the current cursor position of the
|
||||
current window.
|
||||
wsyncup() causes a touchwin() of all of the window's parents.
|
||||
|
||||
wsyncdown() causes a touchwin() of the current window if any of
|
||||
its parent's windows have been touched.
|
||||
If wsyncok() is called with a second argument of TRUE, this
|
||||
causes a wsyncup() to be called every time the window is
|
||||
changed.
|
||||
|
||||
resize_window() allows the user to resize an existing window. It
|
||||
returns the pointer to the new window, or NULL on failure.
|
||||
wcursyncup() causes the current cursor position of all of a
|
||||
window's ancestors to reflect the current cursor position of the
|
||||
current window.
|
||||
|
||||
wresize() is an ncurses-compatible wrapper for resize_window().
|
||||
Note that, unlike ncurses, it will NOT process any subwindows of
|
||||
the window. (However, you still can call it _on_ subwindows.) It
|
||||
returns OK or ERR.
|
||||
wsyncdown() causes a touchwin() of the current window if any of
|
||||
its parent's windows have been touched.
|
||||
|
||||
PDC_makenew() allocates all data for a new WINDOW * except the
|
||||
actual lines themselves. If it's unable to allocate memory for
|
||||
the window structure, it will free all allocated memory and
|
||||
return a NULL pointer.
|
||||
resize_window() allows the user to resize an existing window. It
|
||||
returns the pointer to the new window, or NULL on failure.
|
||||
|
||||
PDC_makelines() allocates the memory for the lines.
|
||||
wresize() is an ncurses-compatible wrapper for resize_window().
|
||||
Note that, unlike ncurses, it will NOT process any subwindows of
|
||||
the window. (However, you still can call it _on_ subwindows.) It
|
||||
returns OK or ERR.
|
||||
|
||||
PDC_sync() handles wrefresh() and wsyncup() calls when a window
|
||||
is changed.
|
||||
PDC_makenew() allocates all data for a new WINDOW * except the
|
||||
actual lines themselves. If it's unable to allocate memory for
|
||||
the window structure, it will free all allocated memory and
|
||||
return a NULL pointer.
|
||||
|
||||
Return Value:
|
||||
newwin(), subwin(), derwin() and dupwin() return a pointer
|
||||
to the new window, or NULL on failure. delwin(), mvwin(),
|
||||
mvderwin() and syncok() return OK or ERR. wsyncup(),
|
||||
wcursyncup() and wsyncdown() return nothing.
|
||||
PDC_makelines() allocates the memory for the lines.
|
||||
|
||||
Errors:
|
||||
It is an error to call resize_window() before calling initscr().
|
||||
Also, an error will be generated if we fail to create a newly
|
||||
sized replacement window for curscr, or stdscr. This could
|
||||
happen when increasing the window size. NOTE: If this happens,
|
||||
the previously successfully allocated windows are left alone;
|
||||
i.e., the resize is NOT cancelled for those windows.
|
||||
PDC_sync() handles wrefresh() and wsyncup() calls when a window
|
||||
is changed.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
newwin Y Y Y
|
||||
delwin Y Y Y
|
||||
mvwin Y Y Y
|
||||
subwin Y Y Y
|
||||
derwin Y - Y
|
||||
mvderwin Y - Y
|
||||
dupwin Y - 4.0
|
||||
wsyncup Y - 4.0
|
||||
syncok Y - 4.0
|
||||
wcursyncup Y - 4.0
|
||||
wsyncdown Y - 4.0
|
||||
resize_window - - -
|
||||
wresize - - -
|
||||
PDC_makelines - - -
|
||||
PDC_makenew - - -
|
||||
PDC_sync - - -
|
||||
### Return Value
|
||||
|
||||
newwin(), subwin(), derwin() and dupwin() return a pointer
|
||||
to the new window, or NULL on failure. delwin(), mvwin(),
|
||||
mvderwin() and syncok() return OK or ERR. wsyncup(),
|
||||
wcursyncup() and wsyncdown() return nothing.
|
||||
|
||||
### Errors
|
||||
|
||||
It is an error to call resize_window() before calling initscr().
|
||||
Also, an error will be generated if we fail to create a newly
|
||||
sized replacement window for curscr, or stdscr. This could
|
||||
happen when increasing the window size. NOTE: If this happens,
|
||||
the previously successfully allocated windows are left alone;
|
||||
i.e., the resize is NOT cancelled for those windows.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
newwin Y Y Y
|
||||
delwin Y Y Y
|
||||
mvwin Y Y Y
|
||||
subwin Y Y Y
|
||||
derwin Y - Y
|
||||
mvderwin Y - Y
|
||||
dupwin Y - 4.0
|
||||
wsyncup Y - 4.0
|
||||
syncok Y - 4.0
|
||||
wcursyncup Y - 4.0
|
||||
wsyncdown Y - 4.0
|
||||
resize_window - - -
|
||||
wresize - - -
|
||||
PDC_makelines - - -
|
||||
PDC_makenew - - -
|
||||
PDC_sync - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -191,7 +195,7 @@ WINDOW *PDC_makelines(WINDOW *win)
|
||||
{
|
||||
int i, j, nlines, ncols;
|
||||
|
||||
PDC_LOG(("PDC_makelines() - called: lines %d cols %d\n", nlines, ncols));
|
||||
PDC_LOG(("PDC_makelines() - called\n"));
|
||||
|
||||
if (!win)
|
||||
return (WINDOW *)NULL;
|
||||
@@ -323,6 +327,7 @@ WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begy, int begx)
|
||||
win->_leaveit = orig->_leaveit;
|
||||
win->_scroll = orig->_scroll;
|
||||
win->_nodelay = orig->_nodelay;
|
||||
win->_delayms = orig->_delayms;
|
||||
win->_use_keypad = orig->_use_keypad;
|
||||
win->_immed = orig->_immed;
|
||||
win->_sync = orig->_sync;
|
||||
@@ -410,6 +415,7 @@ WINDOW *dupwin(WINDOW *win)
|
||||
new->_leaveit = win->_leaveit;
|
||||
new->_scroll = win->_scroll;
|
||||
new->_nodelay = win->_nodelay;
|
||||
new->_delayms = win->_delayms;
|
||||
new->_use_keypad = win->_use_keypad;
|
||||
new->_tmarg = win->_tmarg;
|
||||
new->_bmarg = win->_bmarg;
|
||||
@@ -462,8 +468,8 @@ WINDOW *resize_window(WINDOW *win, int nlines, int ncols)
|
||||
return (WINDOW *)NULL;
|
||||
}
|
||||
|
||||
save_curx = min(win->_curx, new->_maxx);
|
||||
save_cury = min(win->_cury, new->_maxy);
|
||||
save_curx = min(win->_curx, (new->_maxx - 1));
|
||||
save_cury = min(win->_cury, (new->_maxy - 1));
|
||||
|
||||
if (!(win->_flags & (_SUBPAD|_SUBWIN)))
|
||||
{
|
||||
@@ -486,6 +492,7 @@ WINDOW *resize_window(WINDOW *win, int nlines, int ncols)
|
||||
new->_leaveit = win->_leaveit;
|
||||
new->_scroll = win->_scroll;
|
||||
new->_nodelay = win->_nodelay;
|
||||
new->_delayms = win->_delayms;
|
||||
new->_use_keypad = win->_use_keypad;
|
||||
new->_tmarg = (win->_tmarg > new->_maxy - 1) ? 0 : win->_tmarg;
|
||||
new->_bmarg = (win->_bmarg == win->_maxy - 1) ?
|
||||
|
||||
@@ -19,9 +19,18 @@ SLIBS = $(shell sdl-config --libs)
|
||||
SFLAGS += -DHAVE_VSNPRINTF -DHAVE_VSSCANF
|
||||
|
||||
ifeq ($(DEBUG),Y)
|
||||
CFLAGS = -g -Wall -DPDCDEBUG
|
||||
CFLAGS = -g -Wall -DPDCDEBUG -fPIC
|
||||
else
|
||||
CFLAGS = -O2 -Wall
|
||||
CFLAGS = -O2 -Wall -fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(WIDE),Y)
|
||||
CFLAGS += -DPDC_WIDE
|
||||
SLIBS += -lSDL_ttf
|
||||
endif
|
||||
|
||||
ifeq ($(UTF8),Y)
|
||||
CFLAGS += -DPDC_FORCE_UTF8
|
||||
endif
|
||||
|
||||
BUILD = $(CC) $(CFLAGS) -I$(PDCURSES_SRCDIR)
|
||||
@@ -92,7 +101,7 @@ xmas: $(demodir)/xmas.c
|
||||
$(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
sdltest: $(osdir)/sdltest.c
|
||||
$(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
|
||||
$(BUILD) $(DEMOFLAGS) $(SFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
tui.o: $(demodir)/tui.c $(demodir)/tui.h
|
||||
$(BUILD) -c $(DEMOFLAGS) $(demodir)/tui.c
|
||||
|
||||
@@ -12,12 +12,23 @@ osdir = $(PDCURSES_SRCDIR)/sdl1
|
||||
|
||||
PDCURSES_SDL_H = $(osdir)/pdcsdl.h
|
||||
|
||||
SLIBS = -lSDL
|
||||
|
||||
ifeq ($(DEBUG),Y)
|
||||
CFLAGS = -g -Wall -DPDCDEBUG
|
||||
else
|
||||
CFLAGS = -O2 -Wall
|
||||
endif
|
||||
|
||||
ifeq ($(WIDE),Y)
|
||||
CFLAGS += -DPDC_WIDE
|
||||
SLIBS += -lSDL_ttf
|
||||
endif
|
||||
|
||||
ifeq ($(UTF8),Y)
|
||||
CFLAGS += -DPDC_FORCE_UTF8
|
||||
endif
|
||||
|
||||
CC = gcc
|
||||
BUILD = $(CC) $(CFLAGS) -I$(PDCURSES_SRCDIR)
|
||||
LDFLAGS = -mwindows $(LIBCURSES)
|
||||
@@ -34,13 +45,13 @@ ifeq ($(DLL),Y)
|
||||
LIBFLAGS = -Wl,--out-implib,libpdcurses.a -shared -o
|
||||
LIBCURSES = pdcurses.dll
|
||||
CLEAN = $(LIBCURSES) *.a $(DEFFILE)
|
||||
POST = -lSDL
|
||||
POST = $(SLIBS)
|
||||
else
|
||||
LIBEXE = ar
|
||||
LIBFLAGS = rcv
|
||||
LIBCURSES = libpdcurses.a
|
||||
CLEAN = *.a
|
||||
LDFLAGS += -lSDL
|
||||
LDFLAGS += $(SLIBS)
|
||||
endif
|
||||
|
||||
DEMOS += sdltest.exe
|
||||
|
||||
@@ -7,12 +7,12 @@ This is a port of PDCurses for SDL.
|
||||
Building
|
||||
--------
|
||||
|
||||
. On *nix (including Linux and Mac OS X), run "make" in the sdl1
|
||||
- On *nix (including Linux and Mac OS X), run "make" in the sdl1
|
||||
directory. There is no configure script (yet?) for this port. This
|
||||
assumes a working sdl-config, and GNU make. It builds the library
|
||||
libpdcurses.a (dynamic lib not implemented).
|
||||
|
||||
With MinGW, run "make -f Makefile.mng". This assumes SDL is installed
|
||||
- With MinGW, run "make -f Makefile.mng". This assumes SDL is installed
|
||||
in the standard directories. The MinGW makefile accepts the optional
|
||||
parameters "DLL=Y" and "DEBUG=Y", as with the console version. (Wide-
|
||||
character support is not yet implemented for SDL.) Both makefiles
|
||||
@@ -30,4 +30,4 @@ The files in this directory are released to the Public Domain.
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
SDL port was provided by William McBrine <wmcbrine@users.sf.net>
|
||||
SDL port was provided by William McBrine <wmcbrine@gmail.com>
|
||||
@@ -2,46 +2,49 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcclip.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: clipboard
|
||||
clipboard
|
||||
---------
|
||||
|
||||
Synopsis:
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
int PDC_getclipboard(char **contents, long *length);
|
||||
int PDC_setclipboard(const char *contents, long length);
|
||||
int PDC_freeclipboard(char *contents);
|
||||
int PDC_clearclipboard(void);
|
||||
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
### Description
|
||||
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
PDC_getclipboard() gets the textual contents of the system's
|
||||
clipboard. This function returns the contents of the clipboard
|
||||
in the contents argument. It is the responsibilitiy of the
|
||||
caller to free the memory returned, via PDC_freeclipboard().
|
||||
The length of the clipboard contents is returned in the length
|
||||
argument.
|
||||
|
||||
Return Values:
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
PDC_setclipboard copies the supplied text into the system's
|
||||
clipboard, emptying the clipboard prior to the copy.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
PDC_clearclipboard() clears the internal clipboard.
|
||||
|
||||
### Return Values
|
||||
|
||||
indicator of success/failure of call.
|
||||
PDC_CLIP_SUCCESS the call was successful
|
||||
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
|
||||
the clipboard contents
|
||||
PDC_CLIP_EMPTY the clipboard contains no text
|
||||
PDC_CLIP_ACCESS_ERROR no clipboard support
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_getclipboard - - -
|
||||
PDC_setclipboard - - -
|
||||
PDC_freeclipboard - - -
|
||||
PDC_clearclipboard - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -118,7 +121,7 @@ int PDC_clearclipboard(void)
|
||||
{
|
||||
PDC_LOG(("PDC_clearclipboard() - called\n"));
|
||||
|
||||
if (pdc_SDL_clipboard)
|
||||
if (pdc_SDL_clipboard)
|
||||
{
|
||||
free(pdc_SDL_clipboard);
|
||||
pdc_SDL_clipboard = NULL;
|
||||
|
||||
108
sdl1/pdcdisp.c
108
sdl1/pdcdisp.c
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -19,24 +17,43 @@ chtype acs_map[128] =
|
||||
A(28), A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&',
|
||||
'\'', '(', ')', '*',
|
||||
|
||||
# ifdef PDC_WIDE
|
||||
0x2192, 0x2190, 0x2191, 0x2193,
|
||||
# else
|
||||
A(0x1a), A(0x1b), A(0x18), A(0x19),
|
||||
# endif
|
||||
|
||||
'/',
|
||||
|
||||
# ifdef PDC_WIDE
|
||||
0x2588,
|
||||
# else
|
||||
0xdb,
|
||||
# endif
|
||||
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
|
||||
'>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
|
||||
|
||||
# ifdef PDC_WIDE
|
||||
0x2666, 0x2592,
|
||||
# else
|
||||
A(0x04), 0xb1,
|
||||
# endif
|
||||
|
||||
'b', 'c', 'd', 'e',
|
||||
|
||||
# ifdef PDC_WIDE
|
||||
0x00b0, 0x00b1, 0x2591, 0x00a4, 0x2518, 0x2510, 0x250c, 0x2514,
|
||||
0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524,
|
||||
0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3,
|
||||
0x00b7,
|
||||
# else
|
||||
0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d,
|
||||
0x2d, 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3,
|
||||
0xf2, 0xe3, 0xd8, 0x9c, 0xf9,
|
||||
# endif
|
||||
|
||||
A(127)
|
||||
};
|
||||
@@ -62,7 +79,7 @@ void PDC_update_rects(void)
|
||||
{
|
||||
if (rectcount)
|
||||
{
|
||||
/* if the maximum number of rects has been reached, we're
|
||||
/* if the maximum number of rects has been reached, we're
|
||||
probably better off doing a full screen update */
|
||||
|
||||
if (rectcount == MAXRECT)
|
||||
@@ -102,13 +119,16 @@ static void _set_attr(chtype ch)
|
||||
|
||||
if (newfg != foregr)
|
||||
{
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
#ifndef PDC_WIDE
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
pdc_color + newfg, pdc_flastc, 1);
|
||||
#endif
|
||||
foregr = newfg;
|
||||
}
|
||||
|
||||
if (newbg != backgr)
|
||||
{
|
||||
#ifndef PDC_WIDE
|
||||
if (newbg == -1)
|
||||
SDL_SetColorKey(pdc_font, SDL_SRCCOLORKEY, 0);
|
||||
else
|
||||
@@ -119,7 +139,7 @@ static void _set_attr(chtype ch)
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
pdc_color + newbg, 0, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
backgr = newbg;
|
||||
}
|
||||
|
||||
@@ -134,6 +154,9 @@ void PDC_gotoyx(int row, int col)
|
||||
SDL_Rect src, dest;
|
||||
chtype ch;
|
||||
int oldrow, oldcol;
|
||||
#ifdef PDC_WIDE
|
||||
Uint16 chstr[2] = {0, 0};
|
||||
#endif
|
||||
|
||||
PDC_LOG(("PDC_gotoyx() - called: row %d col %d from row %d col %d\n",
|
||||
row, col, SP->cursrow, SP->curscol));
|
||||
@@ -151,8 +174,8 @@ void PDC_gotoyx(int row, int col)
|
||||
if (!SP->visibility)
|
||||
return;
|
||||
|
||||
/* draw a new cursor by overprinting the existing character in
|
||||
reverse, either the full cell (when visibility == 2) or the
|
||||
/* draw a new cursor by overprinting the existing character in
|
||||
reverse, either the full cell (when visibility == 2) or the
|
||||
lowest quarter of it (when visibility == 1) */
|
||||
|
||||
ch = curscr->_y[row][col] ^ A_REVERSE;
|
||||
@@ -169,10 +192,29 @@ void PDC_gotoyx(int row, int col)
|
||||
dest.y = (row + 1) * pdc_fheight - src.h + pdc_yoffset;
|
||||
dest.x = col * pdc_fwidth + pdc_xoffset;
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
chstr[0] = ch & A_CHARTEXT;
|
||||
|
||||
pdc_font = TTF_RenderUNICODE_Solid(pdc_ttffont, chstr, pdc_color[foregr]);
|
||||
if (pdc_font)
|
||||
{
|
||||
dest.h = src.h;
|
||||
dest.w = src.w;
|
||||
src.x = 0;
|
||||
src.y = 0;
|
||||
SDL_SetColorKey(pdc_font, 0, 0);
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL, pdc_color + backgr, 0, 1);
|
||||
SDL_BlitSurface(pdc_font, &src, pdc_screen, &dest);
|
||||
SDL_FreeSurface(pdc_font);
|
||||
pdc_font = NULL;
|
||||
}
|
||||
#else
|
||||
|
||||
src.x = (ch & 0xff) % 32 * pdc_fwidth;
|
||||
src.y = (ch & 0xff) / 32 * pdc_fheight + (pdc_fheight - src.h);
|
||||
|
||||
SDL_BlitSurface(pdc_font, &src, pdc_screen, &dest);
|
||||
#endif
|
||||
|
||||
if (oldrow != row || oldcol != col)
|
||||
{
|
||||
@@ -188,12 +230,33 @@ void PDC_gotoyx(int row, int col)
|
||||
static void _highlight(SDL_Rect *src, SDL_Rect *dest, chtype ch)
|
||||
{
|
||||
short col = SP->line_color;
|
||||
#ifdef PDC_WIDE
|
||||
Uint16 chstr[2] = {'_', 0};
|
||||
#endif
|
||||
|
||||
if (SP->mono)
|
||||
return;
|
||||
|
||||
if (ch & A_UNDERLINE)
|
||||
{
|
||||
#ifdef PDC_WIDE
|
||||
if (col == -1)
|
||||
col = foregr;
|
||||
|
||||
pdc_font = TTF_RenderUNICODE_Solid(pdc_ttffont, chstr, pdc_color[col]);
|
||||
if (pdc_font)
|
||||
{
|
||||
src->x = 0;
|
||||
src->y = 0;
|
||||
|
||||
if (backgr != -1)
|
||||
SDL_SetColorKey(pdc_font, SDL_SRCCOLORKEY, 0);
|
||||
|
||||
SDL_BlitSurface(pdc_font, src, pdc_screen, dest);
|
||||
SDL_FreeSurface(pdc_font);
|
||||
pdc_font = NULL;
|
||||
}
|
||||
#else
|
||||
if (col != -1)
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
pdc_color + col, pdc_flastc, 1);
|
||||
@@ -212,6 +275,7 @@ static void _highlight(SDL_Rect *src, SDL_Rect *dest, chtype ch)
|
||||
if (col != -1)
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
pdc_color + foregr, pdc_flastc, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ch & (A_LEFTLINE|A_RIGHTLINE))
|
||||
@@ -242,6 +306,9 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||
{
|
||||
SDL_Rect src, dest, lastrect;
|
||||
int j;
|
||||
#ifdef PDC_WIDE
|
||||
Uint16 chstr[2] = {0, 0};
|
||||
#endif
|
||||
|
||||
PDC_LOG(("PDC_transform_line() - called: lineno=%d\n", lineno));
|
||||
|
||||
@@ -270,17 +337,23 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||
else
|
||||
if (lastrect.y != dest.y)
|
||||
uprect[rectcount++] = dest;
|
||||
}
|
||||
}
|
||||
else
|
||||
uprect[rectcount++] = dest;
|
||||
|
||||
dest.w = pdc_fwidth;
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
src.x = 0;
|
||||
src.y = 0;
|
||||
#endif
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
{
|
||||
chtype ch = srcp[j];
|
||||
|
||||
_set_attr(ch);
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
if (ch & A_ALTCHARSET && !(ch & 0xff80))
|
||||
ch = (ch & (A_ATTRIBUTES ^ A_ALTCHARSET)) | acs_map[ch & 0x7f];
|
||||
@@ -288,10 +361,29 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||
if (backgr == -1)
|
||||
SDL_LowerBlit(pdc_tileback, &dest, pdc_screen, &dest);
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
chstr[0] = ch & A_CHARTEXT;
|
||||
pdc_font = TTF_RenderUNICODE_Solid(pdc_ttffont, chstr,
|
||||
pdc_color[foregr]);
|
||||
|
||||
if (pdc_font)
|
||||
{
|
||||
if (backgr != -1)
|
||||
{
|
||||
SDL_SetColorKey(pdc_font, 0, 0);
|
||||
SDL_SetPalette(pdc_font, SDL_LOGPAL,
|
||||
pdc_color + backgr, 0, 1);
|
||||
}
|
||||
SDL_BlitSurface(pdc_font, &src, pdc_screen, &dest);
|
||||
SDL_FreeSurface(pdc_font);
|
||||
pdc_font = NULL;
|
||||
}
|
||||
#else
|
||||
src.x = (ch & 0xff) % 32 * pdc_fwidth;
|
||||
src.y = (ch & 0xff) / 32 * pdc_fheight;
|
||||
|
||||
SDL_LowerBlit(pdc_font, &src, pdc_screen, &dest);
|
||||
#endif
|
||||
|
||||
if (ch & (A_UNDERLINE|A_LEFTLINE|A_RIGHTLINE))
|
||||
_highlight(&src, &dest, ch);
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcgetsc.c,v 1.8 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
/* get the cursor size/shape */
|
||||
|
||||
int PDC_get_cursor_mode(void)
|
||||
|
||||
@@ -2,21 +2,23 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.20 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdckbd
|
||||
pdckbd
|
||||
------
|
||||
|
||||
Synopsis:
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
unsigned long PDC_get_input_fd(void);
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
### Description
|
||||
|
||||
PDC_get_input_fd() returns the file descriptor that PDCurses
|
||||
reads its input from. It can be used for select().
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_get_input_fd - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@@ -282,12 +284,24 @@ static int _process_mouse_event(void)
|
||||
|
||||
/* handle scroll wheel */
|
||||
|
||||
if ((btn == 4 || btn == 5) && action == BUTTON_RELEASED)
|
||||
if ((btn >= 4 && btn <= 7) && action == BUTTON_RELEASED)
|
||||
{
|
||||
pdc_mouse_status.x = pdc_mouse_status.y = -1;
|
||||
|
||||
pdc_mouse_status.changes = (btn == 5) ?
|
||||
PDC_MOUSE_WHEEL_DOWN : PDC_MOUSE_WHEEL_UP;
|
||||
switch (btn)
|
||||
{
|
||||
case 4:
|
||||
pdc_mouse_status.changes = PDC_MOUSE_WHEEL_UP;
|
||||
break;
|
||||
case 5:
|
||||
pdc_mouse_status.changes = PDC_MOUSE_WHEEL_DOWN;
|
||||
break;
|
||||
case 6:
|
||||
pdc_mouse_status.changes = PDC_MOUSE_WHEEL_LEFT;
|
||||
break;
|
||||
case 7:
|
||||
pdc_mouse_status.changes = PDC_MOUSE_WHEEL_RIGHT;
|
||||
}
|
||||
|
||||
return KEY_MOUSE;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,26 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.34 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef PDC_WIDE
|
||||
#include "deffont.h"
|
||||
#endif
|
||||
#include "deficon.h"
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
# ifndef PDC_FONT_PATH
|
||||
# ifdef _WIN32
|
||||
#define PDC_FONT_PATH "C:/Windows/Fonts/lucon.ttf"
|
||||
# elif defined(__APPLE__)
|
||||
#define PDC_FONT_PATH "/Library/Fonts/Courier New.ttf"
|
||||
# else
|
||||
#define PDC_FONT_PATH "/usr/share/fonts/truetype/freefont/FreeMono.ttf"
|
||||
# endif
|
||||
# endif
|
||||
TTF_Font *pdc_ttffont = NULL;
|
||||
int pdc_font_size = 18;
|
||||
#endif
|
||||
|
||||
SDL_Surface *pdc_screen = NULL, *pdc_font = NULL, *pdc_icon = NULL,
|
||||
*pdc_back = NULL, *pdc_tileback = NULL;
|
||||
int pdc_sheight = 0, pdc_swidth = 0, pdc_yoffset = 0, pdc_xoffset = 0;
|
||||
@@ -21,12 +35,31 @@ bool pdc_own_screen;
|
||||
|
||||
static struct {short f, b;} atrtab[PDC_COLOR_PAIRS];
|
||||
|
||||
static void _clean(void)
|
||||
{
|
||||
#ifdef PDC_WIDE
|
||||
if (pdc_ttffont)
|
||||
{
|
||||
TTF_CloseFont(pdc_ttffont);
|
||||
TTF_Quit();
|
||||
}
|
||||
#endif
|
||||
SDL_FreeSurface(pdc_tileback);
|
||||
SDL_FreeSurface(pdc_back);
|
||||
SDL_FreeSurface(pdc_icon);
|
||||
SDL_FreeSurface(pdc_font);
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void PDC_retile(void)
|
||||
{
|
||||
if (pdc_tileback)
|
||||
SDL_FreeSurface(pdc_tileback);
|
||||
|
||||
pdc_tileback = SDL_DisplayFormat(pdc_screen);
|
||||
if (pdc_tileback == NULL)
|
||||
return;
|
||||
|
||||
if (pdc_back)
|
||||
{
|
||||
@@ -85,9 +118,42 @@ int PDC_scr_open(int argc, char **argv)
|
||||
return ERR;
|
||||
}
|
||||
|
||||
atexit(SDL_Quit);
|
||||
atexit(_clean);
|
||||
}
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
if (!pdc_ttffont)
|
||||
{
|
||||
const char *ptsz, *fname;
|
||||
|
||||
if (TTF_Init() == -1)
|
||||
{
|
||||
fprintf(stderr, "Could not start SDL_TTF: %s\n", SDL_GetError());
|
||||
return ERR;
|
||||
}
|
||||
|
||||
ptsz = getenv("PDC_FONT_SIZE");
|
||||
if (ptsz != NULL)
|
||||
pdc_font_size = atoi(ptsz);
|
||||
if (pdc_font_size <= 0)
|
||||
pdc_font_size = 18;
|
||||
|
||||
fname = getenv("PDC_FONT");
|
||||
pdc_ttffont = TTF_OpenFont(fname ? fname : PDC_FONT_PATH,
|
||||
pdc_font_size);
|
||||
}
|
||||
|
||||
if (!pdc_ttffont)
|
||||
{
|
||||
fprintf(stderr, "Could not load font\n");
|
||||
return ERR;
|
||||
}
|
||||
|
||||
TTF_SetFontKerning(pdc_ttffont, 0);
|
||||
TTF_SetFontHinting(pdc_ttffont, TTF_HINTING_MONO);
|
||||
|
||||
SP->mono = FALSE;
|
||||
#else
|
||||
if (!pdc_font)
|
||||
{
|
||||
const char *fname = getenv("PDC_FONT");
|
||||
@@ -104,6 +170,7 @@ int PDC_scr_open(int argc, char **argv)
|
||||
}
|
||||
|
||||
SP->mono = !pdc_font->format->palette;
|
||||
#endif
|
||||
|
||||
if (!SP->mono && !pdc_back)
|
||||
{
|
||||
@@ -120,11 +187,15 @@ int PDC_scr_open(int argc, char **argv)
|
||||
else
|
||||
SP->orig_attr = FALSE;
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
TTF_SizeText(pdc_ttffont, "W", &pdc_fwidth, &pdc_fheight);
|
||||
#else
|
||||
pdc_fheight = pdc_font->h / 8;
|
||||
pdc_fwidth = pdc_font->w / 32;
|
||||
|
||||
if (!SP->mono)
|
||||
pdc_flastc = pdc_font->format->palette->ncolors - 1;
|
||||
#endif
|
||||
|
||||
if (pdc_own_screen && !pdc_icon)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
/* Public Domain Curses */
|
||||
|
||||
/* $Id: pdcsdl.h,v 1.17 2008/07/14 04:24:52 wmcbrine Exp $ */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL.h>
|
||||
#ifdef PDC_WIDE
|
||||
#include <SDL_ttf.h>
|
||||
#endif
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
PDCEX TTF_Font *pdc_ttffont;
|
||||
PDCEX int pdc_font_size;
|
||||
#endif
|
||||
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
||||
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
||||
|
||||
|
||||
@@ -2,32 +2,34 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcsetsc.c,v 1.7 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
Name: pdcsetsc
|
||||
pdcsetsc
|
||||
--------
|
||||
|
||||
Synopsis:
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
### Synopsis
|
||||
|
||||
Description:
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
int PDC_set_blink(bool blinkon);
|
||||
void PDC_set_title(const char *title);
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
### Description
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
PDC_set_blink() toggles whether the A_BLINK attribute sets an
|
||||
actual blink mode (TRUE), or sets the background color to high
|
||||
intensity (FALSE). The default is platform-dependent (FALSE in
|
||||
most cases). It returns OK if it could set the state to match
|
||||
the given parameter, ERR otherwise. Current platforms also
|
||||
adjust the value of COLORS according to this function -- 16 for
|
||||
FALSE, and 8 for TRUE.
|
||||
|
||||
PDC_set_title() sets the title of the window in which the curses
|
||||
program is running. This function may not do anything on some
|
||||
platforms. (Currently it only works in Win32 and X11.)
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
PDC_set_blink - - -
|
||||
PDC_set_title - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "pdcsdl.h"
|
||||
|
||||
RCSID("$Id: pdcutil.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $")
|
||||
|
||||
void PDC_beep(void)
|
||||
{
|
||||
PDC_LOG(("PDC_beep() - called\n"));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user