Commit Graph

42 Commits

Author SHA1 Message Date
christos 5fe8b8f1c1 remove unused variable 2013-11-10 03:14:16 +00:00
blymn 69b405aa23 Rename the old __waddbytes function to _cursesi_waddbytes and add a
parameter that controls whether or not certain characters in the
string are interpreted or not (things like tab being expanded).

Make __waddbytes a wrapper for _cursesi_waddbytes that passes all
parameters and sets the flag for character interpretation for backward
compatibility.

Fix an incipient bug in _cursesi_waddbytes where garbage would have
been written to the terminal if the terminal TABSIZE was set > 8 and
character interpretation is on.

Convert all internal __waddbytes calls to use _cursesi_waddbytes, fix
the function prototypes and add a new flag that will be used later.

Fix the addchstr family functions so that they call _cursesi_waddbytes
with character interpretation off as per SUSV2.
2013-11-09 11:16:59 +00:00
roy 2e2213ef89 Add TABSIZE, which is derived from terminfo init_tabs.
Use this when processing \t.
If TABSIZE is set in the environment, this takes precedence.
2013-10-16 19:59:29 +00:00
joerg b341a73a57 Fix memset usage. 2011-07-01 01:19:33 +00:00
wiz 3d3c5d42cb Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
2010-12-16 17:42:25 +00:00
tnozaki 115137ad39 to initialize mbstate_t, use memset instead mbrtowc. 2010-11-23 05:38:35 +00:00
drochner 452834f264 misc fixes and improvements:
-call setlocale(LC_CTYPE, "") before nl_langinfo(CODESET) if the
 locale settings is (still) at "C" - otherwise the CODESET doesn't work
-fix the type of the WACS_* symbols -- this needs to be cchar_t*
-add safeguards where the return value of wcwidth() is used for
 loop counters or indexing -- it can be -1
-use more common code in the widechar support case -- in particular
 let the wchar functions do the work even if chtype ones were called
-implement wcursyncup/wsyncup/wsyncdown
-somewhat experimental: allow ACS_* variables to refer to WACS_*
 table entries -- this way, programs using the old chtype using API
 can use UTF8 line drawing on terminals which support UTF8 but not
 ACS switching
-fix some logics bugs in UTF8 recognition and ALTCHARSET handling
2010-02-23 19:48:26 +00:00
roy 43d5eb454b Prepare curses for the possibility of changing from termcap to terminfo.
term.h #defines lines, pad_char and no_color_video macros which conflict
with existing curses code. We change lines to alines and nlines depending
on use, pad_char to padchar and no_color_video becomes no_color_attributes
but with a strong alias from no_color_video.
2009-07-22 16:57:14 +00:00
tnozaki c71a9f1dad use mbrtowc() instead of mbtowc(). 2008-07-04 16:52:10 +00:00
jdc 194f45e187 Fix the handling for added carriage return characters.
Should fix the "staircase effect" part of PR 36560.
2007-11-08 06:42:22 +00:00
blymn e124de36d8 Merge in wide curses code done as a Summer of Code project by
Ruibiao Qiu.
2007-05-28 15:01:53 +00:00
jdc 1f221324cf Add debug "areas" that allow selective debugging by setting the
"CURSES_TRACE_MASK" environment variable.  Postive vales include
debug areas, negative values exclude them.
2007-01-21 13:25:36 +00:00
jdc 978ab4ad4e Background characters and attributes don't need to be kept per character
cell, as they are merged when characters are added.  Remove the per cell
storage and clarify the manual page.  Pointed out by ruibiao@.
2006-01-15 11:43:54 +00:00
dsl b176defcde Revert most of rev 1.27 of addbytes.c and associated changes.
Posix requires that adding '\n' does clrtoeol() and 'x = 0'.
(Making "\r\n" erase the text that has just been displayed.)
Remove __NONL test from addbytes, __NONL is a property of the output device.
2003-08-10 07:37:11 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
dsl c841017dd9 Do something more sensible for waddbytes(..., "\r\n", ...);
I'm not sure about the clrtoeol() at all though - maybe it should
be done as part of scroll()?
Leave 'x' alone when __NONL set.
2003-07-31 10:36:00 +00:00
dsl c7ba282830 Stop blank line being added when newline is processed with __ISPASTEOL set. 2003-06-26 10:22:33 +00:00
dsl d75ec8181e Fix resize of windows with subwins.
Let window size be given as a -ver number => lines from bottom.
Fix trace calls of pointers
(approved by Brett Lumn)
2003-02-17 11:07:19 +00:00
jdc 02559eb653 Always update the change pointers. Otherwise, we could end up not
displaying 'blank' characters when overlapping windows are displayed.
(Exposed by changes in revision 1.49 of refresh.c.)
2002-12-23 12:26:07 +00:00
blymn 8d2591041a * Added new function idcok - this closes PR 10802
* Added sentinels to the line structures when in debug mode to try
  to pick up data overwrite problems, if they occur.
2002-07-19 13:22:41 +00:00
jdc 3f9388e3e3 Implement scrolling regions :
has_ic()
  has_il()
  setscrreg()
  wsetscrreg()
2001-04-20 12:56:08 +00:00
jdc 606508da77 Rename variables refering to termcap capabilities from NN to __tc_nn. Case
adjusted to match termcap capability.  A few other variable names renamed too
(ones related to or derived from termcap variables).
2000-12-19 21:34:24 +00:00
mycroft 40add0b991 Massively simplify some logic. 2000-04-28 22:44:33 +00:00
jdc 92a8633938 Set background character and attributes for added characters. 2000-04-18 22:45:23 +00:00
jdc 8e3f558953 Don't reset firstchp and lastchp even if this line was not dirty.
They could have been set previously by a parent window or sub-window.
2000-04-15 22:53:05 +00:00
blymn aaf74682b9 Added functions to replace what were previously macros in curses.h
(this is a requirement of SUSv2) - the old macro behaviour can be
restored by defining _CURSES_USE_MACROS.
Changed function prototypes to use ANSI style.
All externally visible functions now have ANSI style declarations.
2000-04-15 13:17:02 +00:00
jdc 40b39f92af Add color attribute manipulation. 2000-04-12 21:47:50 +00:00
blymn 23464ee534 Made data structures opaque 2000-04-11 13:57:08 +00:00
simonb e07c905939 Get rid of the evil trailing spaces and tabs. 1999-06-28 13:32:43 +00:00
mrg 586d4ce109 Upgrades the standard NetBSD curses library to provide some
of the SYSV curses facilities.  The added features are the collapsing
of arrow and function keysequences (as defined by termcap for the
terminal) into symbolic code returns thus relieving the application of
recognising multi-character key sequences.  Other features are the
capability to perform a timed wait for a key (good for when you are
not sure if there is a keypress ready or not) and the capability for
turning off the inter-key timeout when assembling multi-character
function keys.

this work was done by Julian Coleman <J.D.Coleman@newcastle.ac.uk>
and blymn@baea.com.au (Brett Lymn).  i'm just integrating it.  thanks
HEAPS guys!
1999-04-13 14:08:17 +00:00
perry 0b7831a37b remove obsolete register declarations 1998-02-03 19:12:13 +00:00
mikel 716747aa72 RCSid police, fix warnings 1997-07-22 07:36:20 +00:00
cgd d29088dab1 clean up import 1994-08-17 21:51:41 +00:00
cgd f2149bfd60 changes from branch 1994-01-24 08:36:38 +00:00
cgd 2f65b6139d repeat after me: "I hate rcs ids" 1993-11-09 04:06:43 +00:00
cgd 019bbd1316 update to new version from berkeley. doesn't compile yet, nor
does it have rcsid's.  this is for diffs.
1993-11-09 03:34:01 +00:00
mycroft 6d20662fcb waddbytes() is private; make the rest of *addbytes() be.
Make waddbytes() and waddstr() take a `const char *'.
1993-08-15 16:23:57 +00:00
mycroft 62a3457d0e New version from uunet. 1993-08-07 05:48:37 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
alm 75de25bb93 added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.

This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
        addch( ch | _STANDOUT );
        Normal interface use standout() and standend() functions instead.
        Many programs use 'char' type (with sign extention) for input characters
        and sign extention becomes _STANDOUT mode in this case.
        So, I refuse this future and allow 8-bit characters for programs,
        which is designed for 7-bit only ('char' type using instead of
        'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.

This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!

This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 05:34:14 +00:00
mycroft c2ef5bd114 Make tabs actually work. 1993-04-23 03:42:45 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00