Commit Graph

573 Commits

Author SHA1 Message Date
jdc ca32a8e578 We don't need to call __init_getch here, as it is called from
screen.c:newterm().
2007-11-18 10:01:04 +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
jdc 55f0d59917 Make sure we copy the relevant cell (and not the first cell) for
each line that we copy.

We also need to touch the destination window here.

Fixes display bug in atc(6).  Bug reported by and fix tested by
David Holland.
2007-11-08 06:39:31 +00:00
jdc 52cd399dde Make sure we don't shrink windows or sub-windows so that they end up
with zero length or height.
2007-11-08 06:34:34 +00:00
jdc c4eef94666 Only resize curscr, __virtscr and stdscr when the screen is resized.
Note the behaviour of sub-windows when the parent window is resized.

Fixes PR pkg/37129.
2007-10-25 20:42:07 +00:00
jdc 542a57c041 Return "-1" for unknown keys and only return NULL for errors.
Make the key name string a static buffer.  The specification allows this,
so the previous behaviour would leak a small amount of memory, as the
application wouldn't free the returned string.

Fixes one part of PR pkg/37062.
2007-10-25 20:32:40 +00:00
martin 167a3a9d68 Make it build without HAVE_WCHAR 2007-10-06 20:14:41 +00:00
martin b3fd7f365b Make the non-WCHAR variant compilable. 2007-10-06 18:31:33 +00:00
jdc fe324c36e9 Set the column width when changing the background using wbkgd(), otherwise
we will see zero width characters in refresh.c:makech().
2007-09-19 22:13:14 +00:00
jdc 260ad27047 We don't need separate #ifdef's for __ALTCHARSET and WA_ALTCHARSET, as they
are defined to be the same in curses.h.
2007-09-19 22:00:43 +00:00
jdc c172664803 Add debugging for the WCHAR cases. 2007-09-19 21:59:37 +00:00
blymn 2b4f2c9caf Fix a crash caused by having a single NULL character as a string capability.
This fix is about the best we can do given the current interfaces. We
could extend the cgetcap(3) interfaces with a function that would return
a character count and handle this in libterm which would provide a more
complete fix and allow a NULL character in a string capability.
2007-08-28 12:28:18 +00:00
jdc 34bea28655 Fix resizing bug where the values of LINES and/or COLS changed while we
were resizing windows, leading to inconsistencies between the sizes of
stdscr and curscr.

Should fix the curses part of PR lib/36702.
2007-08-27 19:54:29 +00:00
jdc a39089a88a Add KEY_RESIZE.
Fix use after free().
2007-08-04 08:36:49 +00:00
wiz ab6c3b4502 Use HTML escapes. Use Ss for subsection. Correct date. 2007-07-15 21:37:55 +00:00
jdc 7e0bb0168c Emphasise `ncurses'. 2007-07-13 11:16:11 +00:00
jdc 05ea77093a Note that the additional characters are for ncurses compatibility.
Pointed out by Thomas Dickey.
2007-07-13 11:15:33 +00:00
jdc f0b4a51625 Document line drawing and graphics characters. 2007-07-11 18:45:40 +00:00
jdc 65f3606f46 Add additional line drawing and characters.
Pointed out by pooka@.
2007-07-11 18:44:46 +00:00
xtraeme 42154df31a Do not typedef bool as char, just include stdbool.h. Fixes a build
failure with regress/include/okheaders.

Suggestion by mlelstv@ and ok by blymn@.
2007-07-01 10:53:59 +00:00
veego e4f44a55a6 Fix compile errors on i386 by changing %ld to %zu. 2007-05-29 19:07:19 +00:00
blymn eaa84a63c0 Change debug handling, now we write debug out iff CURSES_TRACE_FILE
has been set in the environment, this prevents people using MKDEBUGLIB
getting more than they bargained for.

Tidied up the debug settings in the Makefile to reflect the above change,
we no longer need to have FULL_DEBUG since nothing is written by default.
2007-05-29 13:20:21 +00:00
blymn 070937be37 Fix some compiler warnings.
Remove shadowed variable declarations when DEBUG is defined.
2007-05-29 11:10:55 +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 3ad888c757 Pull down the following from the wcurses branch:
ctrace.c: revision 1.16.2.2
  initscr.c: revision 1.27.18.2
Orginal commit message:

Do the debug initialisation only in ctrace.c.  Otherwise, it might not
get done, for example, if we start curses with setterm() and not initscr().
2007-01-22 21:14: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
blymn fa0b432b40 Wide curses merge 2007-01-21 11:38:58 +00:00
blymn 17c16404e9 This file originates from the ncurses distribution, thanks to the ncurses people for letting us use it 2007-01-21 11:38:58 +00:00
blymn 5dfe4c8b18 Wide curses merge 2007-01-21 11:38:58 +00:00
hubertf 55ac93d329 Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
2007-01-17 23:24:22 +00:00
jdc beb55bfff9 Handle cases where the application installs a SIGWINCH handler after the
curses one is installed by:

  1.  not reinstalling the curses one after restarting
  2.  not sending KEY_RESIZE

Also, update the size of curscr, stdscr and __virtscr to match the new
screen size, so that their sizes are always updated.

Fixes the cases where applications call endwin() and then refresh() in
their SIGWINCH handler (i.e. the resizing problems in PR pkg/27777).
2006-08-25 17:04:32 +00:00
jdc 52ef6583f9 Add some more debugging information. 2006-08-23 19:23:55 +00:00
jdc ed312f0773 When deleting windows and screens, also set to NULL the standard names
that refer to the window or screen just deleted.
Add some more debugging information.
2006-08-23 19:23:14 +00:00
jdc c4b88fb280 Make sure we update the correct window when changing colour pairs. 2006-08-23 19:20:37 +00:00
wiz 1c4f3b5dd5 Bump date for previous. 2006-07-29 23:47:39 +00:00
christos ad66eb8252 PR/34011: Julian Coleman: Limit timeout to 25.5 seconds. 2006-07-25 21:45:00 +00:00
christos c93c6166a0 Coverity CID 1246: Don't allow getc == -1 to propagate as an array index. 2006-03-19 01:58:48 +00:00
christos e9e2c8e419 Coverity 1552: Don't leak memory. 2006-03-19 01:53:11 +00:00
jdc b7f0401ba9 Handle both background character and background attribute. 2006-02-05 17:39:52 +00:00
jdc f4948e6f66 Curses_insert has been split into curses_insertch and curses_insertln for
a while now.  Adjust names to suit.
2006-02-05 17:07:13 +00:00
jdc b3fed27d5d Use the background attributes for the background when inserting characters. 2006-02-05 17:04:46 +00:00
jdc 7800e2b8b9 Use the window background colour, not the default colour.
Should fix PR install/32617
2006-01-26 07:26:37 +00:00
jdc f2efcd1a0b Note that subwindows inherit the background character and attributes
of the parent window.
2006-01-15 16:57:45 +00:00
wiz b482fe5453 Fix Xref, bump date for previous. 2006-01-15 11:45:54 +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
jdc 264b791562 Don't crash if asked to touch more lines than there are in a window. 2006-01-01 11:48:31 +00:00
dsl c58f95b0f5 Don't read entry after end of array.
Discovered by Neil Ludban running curses under 'ElecticFence'
2005-10-23 18:38:52 +00:00
christos cbb99f287d Deal with modern c++ casts. 2005-08-09 02:33:38 +00:00
jdc af1900d4d8 Make sure that werase() always marks the window as dirty. This fixes a
problem (reported by David Bariod on netbsd-help), where erasing an already
blank window would not clear the screen contents of overlapping windows.
2005-07-27 20:17:42 +00:00
christos fe6a3ed298 Make these work with today's curses and termcap reality. 2005-05-23 04:04:49 +00:00
wiz e2bc5f883e Bump date for touchline() correction, and drop trailing whitespace. 2005-03-04 11:41:36 +00:00
blymn fc90def939 Fixed incorrect documentation of the touchln() function. (thanks Wiz) 2005-03-04 11:15:47 +00:00
dsl 67b39d4957 Change first arg of __hash_more to const void * to remove need for double casts 2005-02-18 22:16:27 +00:00
yamt 98a0fd8d54 fix mvgetch prototype. 2004-12-13 23:51:11 +00:00
dsl 75c6c76be7 Fix (I hope) the bounding checks against the source window. 2004-08-02 18:47:52 +00:00
dsl 9214d0d9c1 overwrite() wasn't copying enough lines or columns.
copywin() couldn't seem to decide whether it should work in window or
screen coordinates - and managed to do neither.
Change copywin() to use window relative coords (as ncurses and solaris do),
and change overwrite() and overlay() to use the modified interface.
It is now possible to use overwrite() to save part of curscr while a
temporary window is drawn.
Fixes PR/26506
2004-08-01 21:48:24 +00:00
blymn 6b3a44ef27 Remove _cursesi_genbuf, it was not being set and caused a SIGSEGV
in getcap().  Fixed getcap() to use screen->cursesi_genbuf.
Thanks to Peter Bex for spotting this.  This closes pr lib/26404.
2004-07-24 13:10:47 +00:00
wiz a24a61f205 getcurx, getcury, getparx, and getpary also seem to be extensions. 2004-07-23 13:42:16 +00:00
wiz f849435424 Note that getbegx, getbegy, getmaxx, and getmaxy are extensions
to X/Open Curses. From Peter Bex in PR 26352.
2004-07-23 13:38:48 +00:00
christos 744eb72770 PR/25397: David A. Holland: bug in second loop of resizeterm
(win used uninitialized), hidden by wrong gcc appeasal.
2004-04-29 22:28:51 +00:00
uwe 85cb92089f Add trailing space that got lost from the string definition.
Pointed out in PR lib/25340 by Juho Juopperi.
2004-04-27 02:15:04 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
jdc eb71bd67da Add missing mvin* and mvwin* manual pages. 2004-04-21 06:24:32 +00:00
christos 9717f6662e check fflush() return code (from Julian Coleman) 2004-04-07 17:27:10 +00:00
wiz c74c0a1a12 Add a newline, remove a comma, and reword STANDARDS section
slightly.
2004-03-28 12:23:21 +00:00
jdc 3a817d94fd Increment libcurses minor to 1 (addition of *echochar()). 2004-03-28 08:59:15 +00:00
jdc a6a9a97d12 Changes to support *echochar().
Should fix PR lib/24927.
2004-03-28 08:58:37 +00:00
jdc 5eb61d5ca7 Implement *echochar().
Should fix PR lib/24927.
2004-03-28 08:58:13 +00:00
wiz 359ed99579 Add comma in enumerations, grammar fix, and replace &
with \*[Am] for html output.
2004-03-26 22:18:15 +00:00
jdc 8dded85639 Change TSTP handler back to using signal().
This fixes a problem where vi would not suspend.
Also, make sure that the signal handlers aren't set or removed multiple times.
Finally, add debug output when the signal handlers are set and removed.
2004-03-25 07:35:40 +00:00
jdc dd5d3aabfc Add (missing) mvgetch() and mvwgetch() manual pages. 2004-03-23 21:56:53 +00:00
jdc 34e5b04618 Clarify the getch() family return values.
Add (missing) mvgetch() and mvwgetch().
2004-03-23 21:53:34 +00:00
jdc 3d248dff59 Change the values of ERR and OK.
This makes our getch() and related functions conform to SUSv2.
Also fixes PR lib/15920.

XXX: This causes an API incompatability, but comes less than 27 hours after
     the libcurses major number was incremented, so should have minimal impact.
2004-03-23 21:35:29 +00:00
jdc 92cd5d7a66 We should check against NULL here.
From Brett Lymn.
2004-03-23 21:17:20 +00:00
wiz cb35afd77e No comma in an enumeration of only two elements. 2004-03-22 19:51:18 +00:00
jdc d1f213e76e "New sentence, new line". 2004-03-22 19:11:28 +00:00
jdc abf59ded7e Increment major number (to 6) because of the change to KEY_MAX, 2004-03-22 18:57:58 +00:00
jdc 140349e83f Because we are changing the libcurses major number, remove can_change_colors()
and change the attribute definitions so that we can support more colour pairs.
2004-03-22 18:57:38 +00:00
jdc efc30049d8 Add KEY_RESIZE support and a SIGWINCH handler.
Fixes PR bin/20032.
This requires a change to KEY_MAX, which affects libform and libmenu, so we
need to change libcurses major number.
2004-03-22 18:57:10 +00:00
wiz 789ce34c16 Remove duplicate article. 2004-03-16 19:51:08 +00:00
snj 9bfae9c898 Spelling fixes. 2004-03-16 19:27:35 +00:00
snj dcf4b5a2bf Spelling fix. 2004-03-16 19:26:56 +00:00
snj 668bade8ea Spelling fixes. 2004-03-16 19:25:39 +00:00
snj 83b07697ca Spelling fix. 2004-03-16 19:20:20 +00:00
snj 066778123d Drop trailing whitespace. 2004-03-16 19:08:15 +00:00
wiz f812f7e9a5 Fix off-by-one, okayed by jdc. 2004-03-16 10:58:25 +00:00
wiz 0cc0ff5935 Drop trailing space. 2004-03-16 09:46:36 +00:00
jdc a02733d775 s/can_change_colors/can_change_color/ 2004-03-16 07:55:05 +00:00
jdc 424b4f06a5 Clarify colour values that can be passed to init_pair(). 2004-03-16 07:54:32 +00:00
jdc ed325dfb85 Accept any negative number of init_pair(). Noticed by Peter Bex.
Swap red/blue and yellow/cyan if necessary in assume_default_colors().
2004-03-16 07:52:43 +00:00
jdc a61e837cb5 gcc -Wuninitialized 2004-03-16 07:49:01 +00:00
jdc 404624e2be We no longer need <signal.h>. 2004-03-16 07:48:18 +00:00
jdc 72d6b43902 s/colour/color/. From Douwe Keila. 2004-03-16 07:46:24 +00:00
jdc 6db03ed922 Minor style change. 2004-03-16 07:44:31 +00:00
christos 146f07a922 Fix the non working unctrl mess:
1. delete the incorrect duplicate macro from unctrl.h
2. move unctrl macros from curses.h to unctrl.h and make curses.h include
   unctrl.h in curses.h instead of duplicating their definition.
3. constify unctrl arrays; make length unsigned.
2004-02-14 18:23:45 +00:00
wiz 071711957c Use standard comment format. Fix typo. From Douwe Kiela. 2004-01-20 08:31:46 +00:00
wiz 81a9cc23f5 Add function descriptions. From Douwe Kiela. 2004-01-20 08:30:55 +00:00
wiz 4d74fb0ff9 Improve function descriptions. From Douwe Kiela. 2004-01-20 08:30:41 +00:00
wiz 60c0778ca6 Grammer fix. From Douwe Kiela. 2004-01-20 08:29:29 +00:00
wiz c365bab896 Mini KNF. From Douwe Kiela. 2004-01-20 08:29:09 +00:00