Commit Graph

21 Commits

Author SHA1 Message Date
blymn 9c6a0e327d Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.
2022-12-20 04:57:01 +00:00
blymn 301bf8cc44 Make the default colour pair be pair 0 which appears to match other
curses implementations.
2022-04-12 07:03:04 +00:00
blymn f1942931a2 Correct (hopefully) the handling of wide characters.
* Remove the WCOL family of macros, these were "stealing" the upper bits
  of a character attribute to store the column width of a character.  No
  warning was given about this in curses.h which meant it was easy to
  accidentally reuse the bits in use by the WCOL macros (we already did).
  Add couple of 16bit ints to the character structure iff HAVE_WCHAR is
  true to hold the display width and wide char related flags (just
  continuation at the moment)
* Convert all instances of WCOL macros to just reference the column width
  in the char structure so it is not obfuscated.
* Fix cursor positioning so placing a cursor in the middle of a wide char
  actually does just that.
* Fix plod so it understands that if the cursor is going to be positioned
  in the middle of a wide char it cannot just reprint the char to get there.
* Fix plodput so it correctly counts the number of output characters for
  wide characters.
* Fix slk routines to properly size the wctomb() buffer.
2022-01-25 03:05:06 +00:00
blymn 47946660f2 Revert change for array definition, it was incorrect, thanks Uwe. 2022-01-06 20:50:18 +00:00
blymn ebe5c3e633 Properly size and array to hold the larget return from wctomb. 2022-01-06 06:18:13 +00:00
rin b09154d5e3 Style fixes most for __CTRACE(). 2021-09-06 07:45:48 +00:00
rin 0bd3a62045 Expand __CTRACE() to __nothing #ifndef DEBUG.
Remove most of #ifdef DEBUG around __CTRACE() calls.

No binary changes, except for line numbers for assert().
2021-09-06 07:03:49 +00:00
christos 596ba706cc This is a mess; always define MB_LEN_MAX so both the regular and libhack
version of curses compiles. Really we should not be defining MB_LEN_MAX here,
and include <limits.h> in curses_private.h to get it.
2021-08-15 12:39:39 +00:00
christos 9494102ed0 need limits.h 2021-08-15 11:54:12 +00:00
christos 1ac1056e8d Use MBL_LEN_MAX (constant) so that SSP works 2021-08-15 11:44:39 +00:00
martin 042ecb94ba Fix printf format for size_t 2021-06-24 15:41:25 +00:00
blymn 5e680e5b3e Make sure we don't use wide char routines when DISABLE_WCHAR is in
effect.
2021-06-24 05:53:05 +00:00
blymn e5cd7ade44 Fix how the slk are drawn by making sure we use ins_wchar in the
bottom left of the screen to avoid a scroll because this may cause
an ERR if scrollok is false.
2021-06-22 07:26:45 +00:00
uwe 4753bc1e70 __slk_set_finalise - fix length vs. width confusion 2019-07-28 00:51:59 +00:00
uwe 96ffe7929a __slk_set - fix calculating "len" for HAVE_WCHAR 2019-07-28 00:15:38 +00:00
uwe 7cefafafd5 Put slk_color() undef #ifdef HAVE_WCHAR too. 2019-07-27 00:58:34 +00:00
uwe acf023e482 Put wide character functions under #ifdef HAVE_WCHAR 2019-07-27 00:46:43 +00:00
roy ae348ab5a5 curses: once __slk_init is called, reset slk_fmt
This allows soft label keys to be used on more than one terminal.
2018-10-04 19:11:09 +00:00
roy 0a1d3be0c8 curses: declare SLK format as invalid until slk_init(3) called
If we don't, then when __slk_init with a valid format of 0 it sets
up labels to be drawn without a window.
2018-10-04 18:40:41 +00:00
roy 3c94ec04f2 Just return ERR instead of asserting if someone calls the slk routines
to affect the ripped off window before the window is actually ripped off.
2017-01-30 17:15:52 +00:00
roy a2ac1ce48c Implement POSIX Curses Soft Label Key functions. 2017-01-24 17:27:30 +00:00