Commit Graph

819 Commits

Author SHA1 Message Date
roy
4650f8774d Fix warn macro usage.
Thanks to rofl0r.
2019-02-24 20:20:18 +00:00
dholland
43fda370f5 At some point we lost the text that explains the difference between
clear() and erase(). Or possibly we never had any. Put some back.
Bump date.
2019-01-11 06:14:39 +00:00
uwe
5b2acdab92 _wnoutrefresh - extend current position checks.
Also verify that dwin->cury >= begy (ditto for x), i.e. for pads make
sure that the current position is after the beginning of the displayed
portion.  While here refactor the checks for better readability.

We should probably combine the y and x checks b/c if one of them is
not in the range, the current position as a whole is not in the range
and it doesn't make sense to pick and set just the y or just the x
part of it.
2019-01-06 04:27:53 +00:00
uwe
aa9d3f22ec _wnoutrefresh - fix current position checks for pads
maxy is an absolute value and should not be adjusted for begy when we
check also absolute cury.  Note that this change does not affect
calculations for normal windows as for them we always pass zero for
begy.  Ditto for x.
2019-01-06 03:59:17 +00:00
uwe
182a153ef7 prefresh - fix current position calculations
The code was copy-pasted from wrefresh(), but for pads we need to
adjust for (pbegy, pbegx).

PR lib/53801
2019-01-06 03:46:11 +00:00
roy
ae8e2e2858 curses: Fix inverted logic when drawing LR corner with auto margins
Thanks to M. Levinson.
2018-11-30 04:38:14 +00:00
wiz
9be4740cf8 Grammar improvements. 2018-11-24 11:04:39 +00:00
uwe
80d62aa1ec attron(), attroff() - don't take a shortcut. 2018-11-24 01:04:18 +00:00
uwe
3981bd4fdf wattr_set - turn off all wide attributes (fix unedited copy/paste). 2018-11-23 11:16:59 +00:00
uwe
19b437abe9 Rename the reserved argument from "opt" to "opts" to match SUS text. 2018-11-23 11:15:14 +00:00
uwe
44b007ca68 Refactor. Move code to turn attributes on/off into separate
functions.  Express both old and new functions to manipulate
attributes using those functions.  Check that the the new API's opts
argument (reserved by the standard for future use) is NULL and error
out if not (like getcchar/setcchar).  No functional change intended.
2018-11-23 11:11:59 +00:00
uwe
801bc96314 Drop a few redundant casts of a variable to its own type. 2018-11-22 23:37:31 +00:00
uwe
485cf0548e Move getattrs() and wcolor_set() so that they are with their peers and
so that wide and non-wide functions are in the same order.  While here,
make __wcolor_set() static.  No functional change intended.
2018-11-22 23:29:09 +00:00
uwe
b717da4cab Drop HAVE_WCHAR ifdefs from code that is not even compiled with !HAVE_WCHAR.
We still try to mainain the ability to build our curses with
!HAVE_WCHAR, but it doesn't make sense to provide stubs for new wide
API functions that just error out when !HAVE_WCHAR.  Any code that
only uses old API (and can work with !HAVE_WCHAR curses) doesn't use
those new functions.  The code that uses new API obviosly cannot work
when all the new API is stubbed out.

So the plan is to drop the stubs.  This commit does that for files
that are not even compiled with !HAVE_WCHAR (not only those stubs are
useless, they were not even there to begin with).

Same object code is generated for the normal HAVE_WCHAR case.  Nothing
is even recompiled for !HAVE_WCHAR.

Ok by blymn@ jdc@ roy@
2018-11-22 22:16:45 +00:00
uwe
e0a45a7a9d We need insstr.c for !HAVE_WCHAR too. 2018-11-22 22:00:49 +00:00
uwe
9d5d4061af Compare pointers to NULL, not to zero. 2018-11-20 22:02:31 +00:00
uwe
042640f557 Drop bogus cast. 2018-11-20 21:42:52 +00:00
uwe
039bdd2780 Don't hide assignments inside tests. 2018-11-20 21:41:31 +00:00
uwe
49cc439a5a Fix color pair handling. color_pair argument is a pair number. 2018-11-20 17:48:19 +00:00
uwe
ce63d7aabc wbkgd - when updating window rendition for the new background character,
it's the old background characters that need to be updated, not spaces.

While here, simplify and also fix the bug introduced in 1.20 (that
lost the default color) - actually use the results of wbkgdset().
2018-11-19 20:37:04 +00:00
uwe
22b16841d0 Provide basic documentation on getcchar(3) and setcchar(3).
Looks like we don't have any of wide curses stuff documented, so this
seems to be a good place to start.  Needs more exposition on wide
attr_t and how it's related to non-wide chtype, etc, etc.
2018-11-19 01:08:21 +00:00
uwe
af85389f73 wbkgrnd - do not duplicate code that's already in wbkgrndset() 2018-11-18 22:53:22 +00:00
uwe
76bb992903 When we remove default color from attributes, just clear all __COLOR.
It's both a nono-optmization and matches the test used in counterpart
code that adds default color when none is set.
2018-11-18 22:34:32 +00:00
uwe
0b616789d6 Reorder "bkgrnd" functions to match the order of old "bkgd" functions. 2018-11-18 22:18:02 +00:00
uwe
5fc077791a Don't fuse HAVE_WCHAR and (trivial) !HAVE_WCHAR bodies into single
function definition.  Instead provide two sets of definitions under
single #ifdef.  Same object code is generated for both HAVE_WCHAR and
!HAVE_WCHAR.
2018-11-18 22:11:38 +00:00
uwe
ee4af76d2e wbkgd - do not duplicate the code that's already in wbkgdset()
that we do call anyway.
2018-11-18 21:01:16 +00:00
uwe
14d0245468 Fix comments on bkgdset() and friends to match reality. 2018-11-18 20:26:29 +00:00
uwe
3f33c7bd5f Don't mix private and public names for the same thing in one statement.
While here, fix harmless edito in a debug call.
2018-11-18 18:52:29 +00:00
uwe
5938495dd2 Reindent a few lineeq() calls now that we can w/out exceeding 80
columns limit.  Whitespace change only.
2018-11-18 02:46:24 +00:00
uwe
47498e515e Further tweak previous. Change the check order to be more logical.
No functional change intentded.  While here fix indentation.
2018-11-18 02:39:44 +00:00
uwe
89ed91e019 Merge one more #ifdef with mostly identical code in both branches.
The same object code is generated modulo gratuitously different order
of checks.
2018-11-18 02:34:39 +00:00
uwe
7013a4d9a5 Merge another #ifdefs that now has identical code in both branches
modulo swapped arguments to celleq() call.  Same object code is
generated otherwise for both HAVE_WCHAR and !HAVE_WCHAR
2018-11-18 02:17:24 +00:00
uwe
7539fe2666 Merge few #ifdefs that now have identical code in both branches.
Same object code is generated for both HAVE_WCHAR and !HAVE_WCHAR.
2018-11-18 01:54:30 +00:00
uwe
05cd1d4d96 Define celleq() and lineeq() for !HAVE_WCHAR too and use them instead
of explicit memcmp() calls.  Same object code is generated for both
HAVE_WCHAR and !HAVE_WCHAR, but we can now try to merge some of the
#ifdefs
2018-11-18 01:39:55 +00:00
uwe
d2a41e949e Oops, revert previous. Wrong tree. 2018-11-18 01:23:57 +00:00
uwe
e573989caa Comment out LIBDPLIBS so that this can be built outside of the tree. 2018-11-18 01:22:49 +00:00
uwe
e156886d4b Rename cellcmp() and linecmp() to celleq() and lineeq() respectively
and make them static.
2018-11-18 01:19:29 +00:00
uwe
291b9ad5db quickch - fix inverted checks.
I have to admit I have no idea what's going on here, but HAVE_WCHAR
code here inverted the sense of linecmp and cellcmp checks w.r.t the
!HAVE_WCHAR variant just above it.  Cf. also all other similar #ifdefs
in this file.

Found through source code inspection, not really tested.
2018-11-18 01:05:30 +00:00
uwe
02236eecfb cellcmp - use logical && not bitwise & 2018-11-18 00:45:44 +00:00
blymn
a887f4aff9 Fix for PR lib/52063
Many thanks to  Onno van der Linden (o.vd.linden@quicknet.nl) for providing
the bulk of the patch that fixes the issue.
2018-11-16 10:12:00 +00:00
uwe
540f2c17fd _cursesi_addbyte - fix function comment after what looks like an
editing accident.
2018-11-15 03:17:51 +00:00
blymn
e3b169cf11 Remove obsolete clauses from copyright block. Original copyright was
mine so should be ok to do.
2018-11-02 04:17:39 +00:00
wiz
c23b16b56b Add comma in enumeration. 2018-10-29 21:06:13 +00:00
uwe
4c629b7589 Fix indentation. 2018-10-29 01:27:39 +00:00
uwe
29dacce45c waddch - instead of enclosing every statement in #ifdef HAVE_WCHAR
just provide two separate definitions.

Same object code is generated for all four combinations of debug/wchar.
2018-10-29 01:19:54 +00:00
uwe
9635311de9 Fix operator precedence for !HAVE_WCHAR 2018-10-29 01:02:16 +00:00
uwe
8c2d3cb78d __CTRACE - don't call gettimeofday() twice. 2018-10-29 00:31:57 +00:00
uwe
d05568e5ff Make __CTRACE_init() static and ANSIfy its definition. 2018-10-29 00:25:20 +00:00
uwe
c71ebe1c3f Ignore terminfo padding specifications when checking whether
exit_attribute_mode contains exit_alt_charset_mode.

Fixes PR lib/53653.
2018-10-26 22:22:24 +00:00
uwe
3efeeb08cd Oops, update name in .Dt, bump date. 2018-10-25 10:41:00 +00:00