Commit Graph

  • f8c6a556a6 Dynamic allocation for struct slk -- especially since it's almost four times as big now. William McBrine 2006-10-31 14:37:58 +00:00
  • 7aaadb8bb0 Renamed slk_save to slk; moved slk_start_col into slk. William McBrine 2006-10-31 13:48:46 +00:00
  • 759a68e9b6 Free the slk_winptr window in delscreen(). William McBrine 2006-10-31 13:42:50 +00:00
  • b9f972ccd0 "label_fmt" was confusingly used for two completely different purposes, as both a function parameter and a global; also, the parameter names didn't match the ones in the man section. William McBrine 2006-10-30 10:36:23 +00:00
  • 89ad0d963f Unused variable. William McBrine 2006-10-30 09:23:53 +00:00
  • 5291fed5c1 A more sensible slk.c -- setting labels and drawing them are cleanly separated, and slk_wset() works correctly now. Also, slk_clear() removes the buttons completely, as in ncurses. William McBrine 2006-10-30 09:08:15 +00:00
  • b226078f90 More efficient... however, I now realize that any of the functions that calls _redraw() will mangle any label set by slk_wset(). So, this needs more work. William McBrine 2006-10-29 16:17:48 +00:00
  • 6a179b1588 Slightly more efficient. William McBrine 2006-10-29 16:02:22 +00:00
  • a86ec54da2 Actually it makes more sense to just drop characters > 255 instead of taking the lower 8 bits. William McBrine 2006-10-29 15:22:39 +00:00
  • 5457ea8b22 Truncate ch to 8 bits in wgetnstr() so that the echoed character matches what we put into the string. William McBrine 2006-10-29 13:59:39 +00:00
  • 3911f32e5c Implemented slk_wset(). This is the last of the X/Open functions, although some are only stubs right now. William McBrine 2006-10-29 13:47:39 +00:00
  • 6632f8520d Implemented slk_wset(). This has the added advantage of eliminating some OpenBSD warnings by dropping use of strcpy(). :-) To Do: Streamline. William McBrine 2006-10-29 13:46:06 +00:00
  • 1b0b8b7342 Implementation of get_wstr() family. To Do: Test this, and get_wch(). William McBrine 2006-10-29 12:43:45 +00:00
  • 56b3b35dec Implementation of get_wch() family. William McBrine 2006-10-29 12:05:13 +00:00
  • 1a7ab6371e "unsigned int" -> "unsigned". Only leaving it in curses.h for clarity. William McBrine 2006-10-28 13:26:01 +00:00
  • 55593d7d81 Partial support for Unicode input in Win32. This works with ALT-keypad (also enabled now), and should work with real keyboard input, but doesn't work with Paste -- for some reason, when pasting, the keys over 0x7f are only returned on KeyUp events, not KeyDown. New mechanism for distinguishing special keys: SP->key_code (also to be used later with get_wch()), replaces the >= 256 check in wgetch() (although it's implemented the same way in PDC_get_bios_key() for the moment, except in Win32). William McBrine 2006-10-28 13:22:03 +00:00
  • 8f129bb417 Minor simplification of PDC_check_bios_key() / PDC_get_bios_key() / _win32_kbhit() -- WaitForSingleObject() call not needed. William McBrine 2006-10-27 12:31:20 +00:00
  • aa65383c63 Watcom's .autodepend doesn't work for .exe's. William McBrine 2006-10-26 11:02:17 +00:00
  • 1dc02ab69e Allow backspace editing of nocbreak buffer. William McBrine 2006-10-24 11:16:22 +00:00
  • 8da83ce350 With keypad mode off, pressing a keypad key would discard that key but then cause a blocking read for the next key, regardless of no/half delay mode. Also, removed _rawgetch(). To Do: Check the interaction of no/half delay mode with nocbreak(). Do we even want to support nocbreak() mode? William McBrine 2006-10-24 04:11:46 +00:00
  • 32a7026b78 Only one test for key == -1. William McBrine 2006-10-24 03:07:27 +00:00
  • 986d483168 The loop and breaks are superfluous here. William McBrine 2006-10-24 01:50:32 +00:00
  • 0d94f388f6 Don't really need breakout() or _getch_win. William McBrine 2006-10-24 01:49:25 +00:00
  • 55109b4a58 Removed PDC_validchar() etc. This still needs a lot more work. William McBrine 2006-10-24 00:12:32 +00:00
  • f3b0d01e62 Portability charts for attr_t functions. To Do: Complete documentation. William McBrine 2006-10-23 06:09:36 +00:00
  • b5b7176234 It makes more sense for traceon() and traceoff() to be in pdcdebug.c. William McBrine 2006-10-23 05:55:01 +00:00
  • 233bb83deb Portability chart for flushinp() belongs here now. William McBrine 2006-10-23 05:47:34 +00:00
  • 3b815eadbb Prototypes and portability charts for wide-character functions. To Do: Full documentation. William McBrine 2006-10-23 05:46:32 +00:00
  • a3d640534b Updated portability charts (removed "'88", flagged functions as Y in X/Open column if they're in the current (1996) standard); removed comments about macro implementation where no longer applicable. William McBrine 2006-10-23 05:03:31 +00:00
  • 52ae62eb18 Superfluous _win32_getch(); abort on redirected input (a temporary solution). William McBrine 2006-10-21 19:39:51 +00:00
  • b13f097aba Use intr() instead of int86() for 16-bit Watcom -- less overhead (int86() is just a wrapper for intr(), and allows access to flags. Unfortunately there's no protected-mode equivalent. William McBrine 2006-10-20 19:39:31 +00:00
  • 9107c5f2d8 Excess spaces. William McBrine 2006-10-19 01:54:47 +00:00
  • ef67eed7b4 Had fflush() around MessageBeep() here (unnoted patch), but it doesn't really seem to make a difference. I can't duplicate the bug report where the beep comes late (and this is the fix), although I _do_ get slow beeps with the DOS version, if I switch to DOS (rather than BIOS) _input_. Confusing, eh? William McBrine 2006-10-18 23:11:41 +00:00
  • 1241bfa21f Common initialization for orgcbr and orig_cursor. William McBrine 2006-10-18 23:09:16 +00:00
  • 83accde49e New definition for 16-bit regs; more use of them; and a fix for PDC_set_ctrl_break(), which has been broken since before 2.0 (it just called the get function again, rather than the set function). William McBrine 2006-10-18 22:35:11 +00:00
  • 1914c543c0 Dropped the "No distribution..." clause. It was widely violated anyway. I only kept it in 2.8, rewriting it to mention trademark, to make it clear that PDCurses was always public domain, despite the seemingly contradictory wording in the boilerplate, and that trademark (not copyright) was the only basis for restricting distribution in this case. But I don't want to be like the Mozilla Foundation. William McBrine 2006-10-15 02:42:26 +00:00
  • 8f9d3cef0c More stuff that doesn't need to be in curses.h. William McBrine 2006-10-13 23:29:27 +00:00
  • c597460cdd The distinction between _sysgetch() and _rawgetch(), which was meaningful in Pccurses 1.x, has not been so since before PDCurses 2.0. And I can't make sense of the ctrl-break logic even in the context of 1.x, but it definitely doesn't work now. William McBrine 2006-10-13 20:54:53 +00:00
  • 901888a9bc Limit the number of colors handled by the init_color() test, for ncurses. (It still doesn't work that well under ncurses, because of poor ACS_BLOCK support, and the effects of A_BOLD vary by terminal.) William McBrine 2006-10-12 18:14:46 +00:00
  • 5d6f2b24d8 Color chart and init_color() test. Could be better. William McBrine 2006-10-12 11:05:43 +00:00
  • 11d62f0d7d COLORS is not reset before the fork, so use MAX_COLORS instead. William McBrine 2006-10-12 11:04:56 +00:00
  • c4927f3fbd Minor tweaks. William McBrine 2006-10-12 02:26:01 +00:00
  • 3f71502438 New function, PDC_set_blink(), that toggles blinking on or off, and also sets COLORS (to 8 if blinking is active, 16 otherwise). Blinking is set to FALSE on startup, if possible. Only implemented for DOS (EGA and VGA) and OS/2; X11 doesn't support blinking, and I can't find a way to change it in Win32 (which so far always is set to intensity mode anyway, for me, though I've heard it might be otherwise -- in 9x?). COLORS is now set to 0 until start_color() is called. William McBrine 2006-10-12 02:24:19 +00:00
  • b7344fd427 With 16 colors, the full 256 color pairs may actually be required. William McBrine 2006-10-11 08:07:58 +00:00
  • cd9255a90b OK, COLORS is now 16. 0-7 are as before; 8-15 are the bright versions, directly accessible now and usable with init_pair(). A_BOLD and A_BLINK also work as before with colors 0-7, and have no effect with 8-15. Ultimately I want to make this dependent on whether flashing mode is enabled (8 if it is, 16 if not), and disable flashing by default. William McBrine 2006-10-11 07:29:10 +00:00
  • 30a313d0da Removed useless constant PDC_COLORS... besides, this is about to become a variable. William McBrine 2006-10-11 06:21:21 +00:00
  • 2b86942acb More casing/underscore regulation. William McBrine 2006-10-09 14:35:58 +00:00
  • 71be91157d PDC_kbhit() was redundant. William McBrine 2006-10-09 14:30:47 +00:00
  • 8c8cb82d70 More leading underscores for static functions. William McBrine 2006-10-09 14:18:12 +00:00
  • c3b36fc8ed Removed camel casing where possible; use standard pdc_ prefixes for console handles; _ for static functions. William McBrine 2006-10-09 14:08:46 +00:00
  • 27080848b3 Use DIVROUND() instead of (double) cast in Win32's init_color() and color_pair(); saves some floating-point overhead in LCC, at least. William McBrine 2006-10-09 04:51:41 +00:00
  • d4a75fd5a2 Unneeded initialization (Borland warning). William McBrine 2006-10-09 04:36:10 +00:00
  • 2eeadc23e8 Updated build number. William McBrine 2006-10-09 00:18:01 +00:00
  • 010aba2ff5 Archive pdcos2.h. William McBrine 2006-10-09 00:14:57 +00:00
  • d50fb84bdf Don't need these externs anymore. William McBrine 2006-10-09 00:12:41 +00:00
  • c0a01636cb Added a common pdcos2.h for OS/2, like pdcwin.h for Win32. William McBrine 2006-10-09 00:11:14 +00:00
  • f420d166bc Working init_color() and color_content() for Win32. Based mostly on James Brown's setconsoleinfo.c (www.catch22.net). There are a number of limitations with this: 1) Works only on NT family. 2) Works only in windowed mode, and if called in full-screen mode, switches to windowed (I could get around this with XP-only APIs); however, colors set in windowed mode hold in full-screen. 3) Resets the font to the Default settings, overriding any per-window (Properties) settings. 4) Cannot read current palette -- only the registry settings. Calling init_color() will reset to registry values + any mods made by PDCurses since initscr(). Some of these might be fixable. William McBrine 2006-10-08 23:46:54 +00:00
  • 581fdb34db And here it is. Not much to it... originally I thought I'd define the CONSOLE_INFO struct here, but as it turns out, I'm confining it to pdcscrn.c. Ah well. William McBrine 2006-10-08 23:39:41 +00:00
  • 5f40b690e3 Archive pdcwin.h. William McBrine 2006-10-08 21:03:32 +00:00
  • 1529a4c072 PDCURSES_DOS_H is not used here. William McBrine 2006-10-08 20:57:01 +00:00
  • b228b60eea Instead of defining CURSES_LIBRARY to include curspriv.h, include curses.h (and define CURSES_LIBRARY) from curspriv.h. Also created pdcwin.h, and moved some things there. William McBrine 2006-10-08 20:54:30 +00:00
  • cc95b915db Spacing. William McBrine 2006-10-01 18:51:50 +00:00
  • 799f4e1cd0 The tests here are redundant, unless someone calls PDC_init_color() or PDC_color_content() directly, in which case they deserve what they get. William McBrine 2006-10-01 18:49:10 +00:00
  • cb36178ecd Common EGA palette check to egapal(); comments. William McBrine 2006-10-01 01:09:33 +00:00
  • 482b1b8066 Excess parens. William McBrine 2006-10-01 00:44:53 +00:00
  • 9cbffe1b00 Range checking for red, blue, and green init_color() parameters. William McBrine 2006-09-30 15:50:44 +00:00
  • 3d5def42a8 Per common recommedations, DJGPP now uses __dpmi_int() instead of int86() or _go32_etc. This breaks compatibility with DJGPP 1.x; but then, DJGPP 2.x is ten years old, and free. William McBrine 2006-09-30 15:45:04 +00:00
  • 95ed8cfd37 Working init_color() and color_content() for DOS. These only work for VGA. init_color() works in full-screen mode under Win 9x, XP and OS/2; in windowed mode, it works in 9x, but only for subsequent drawing, so a refresh is required. In XP and OS/2, you can change the palette, and the changed values are preserved, but the colors don't actually change. It also works in DOSBox. Also, got rid of the NOW_WORKS stuff -- just have to zero out the dpmi registers, and it now works. More to do here. William McBrine 2006-09-29 13:47:21 +00:00
  • e2e19176f9 Working init_color() and color_content() for X11. Also, I'd somehow flipped the green and blue parameters on the empty versions, on all platforms; plus a minor simplification for sb.c. This may not be the final version. William McBrine 2006-09-27 07:21:27 +00:00
  • 35a71d87df As a special PDCurses extension, color_content() and init_color() take up to COLORS * 2, with the high numbers being the color used with A_BOLD. There might be a better way to do this... William McBrine 2006-09-25 20:04:36 +00:00
  • 55c856fb6b Empty framework for real init_color() support. William McBrine 2006-09-25 19:25:19 +00:00
  • be39bb9568 Redundancies -> macros. William McBrine 2006-09-25 19:23:02 +00:00
  • ca27a996b0 Brought back PDC_sysname(), in a new form. This eliminates the last platform ifdefs from curspriv.h -- the only ones remaining are in curses.h. William McBrine 2006-09-25 06:34:41 +00:00
  • e600bdf4c3 Since getmaxx and getmaxy are no longer macros, the old warning suppression method won't work. Instead, just check for PDCURSES (even though other implementations also support the functions). To Do: Figure out a better way to handle this. William McBrine 2006-09-25 00:09:22 +00:00
  • 5e6563c176 Smaller (less redundant). William McBrine 2006-09-24 23:49:15 +00:00
  • 24554e721f Added get..x and get..y. These things still aren't up to date. William McBrine 2006-09-24 22:22:11 +00:00
  • a54a9ee579 Obsolete comment. William McBrine 2006-09-24 21:24:28 +00:00
  • a82bf5564a No more need for NOMACROS. William McBrine 2006-09-24 21:23:43 +00:00
  • 7f5298a7fa Removed most macros -- all those covered by NOMACROS, plus get..y and get..x. Also added getcury() and getcurx() functions. There were numerous problems with the macros (poor maintainability, interference with namespaces, bloated executables, etc.), and only one supposed advantage: performance. Testing (even on a simulated 4 MHz machine) does not show this advantage. The function call overhead is trivial compared to other bottlenecks. The only other reason to keep them would be tradition... and the faint possibility that someone, somewhere is ifdef'ing off them (the same problem that undid my attempted enums). But in this case, I really doubt it. Note that Larsson's Pccurses didn't use the macros; comments by Frotz suggest he added them to conform to the standard, but they aren't required by issue 4 version 2 (while the functions are). William McBrine 2006-09-24 21:22:33 +00:00
  • d5ffc84994 Formatting. William McBrine 2006-09-22 18:57:38 +00:00
  • 19cb3ee8c5 Although it shows prototypes for COLOR_PAIR() and PAIR_NUMBER(), X/Open actually says that these should only be macros. (More exactly, the macro is required to be available (even ifdef NOMACROS), and the function is not.) William McBrine 2006-09-22 17:12:37 +00:00
  • 7d1266c9ef Useless comments. William McBrine 2006-09-22 16:11:08 +00:00
  • 4cec25a407 Replaced instances of "colour" with "color" for consistency. William McBrine 2006-09-22 15:39:30 +00:00
  • 041e4cd01c Moved MSC, int86 defines and bios.h include from curses.h to pdcdos.h; moved _NAIVE_DOS_REGS define from gccdos.mak to pdcdos.h. William McBrine 2006-09-21 16:09:34 +00:00
  • 08fffc017f More compact declaration of external variables. William McBrine 2006-09-21 08:38:26 +00:00
  • 9cf481d848 Comments. William McBrine 2006-09-21 08:17:46 +00:00
  • bf86090137 A more compact representation of the ACS_* defines. Hopefully not too cryptic. William McBrine 2006-09-21 08:03:42 +00:00
  • 3fe08f27fd Minor simplification. William McBrine 2006-09-20 20:19:31 +00:00
  • ba2eb4a631 Slightly more compact... hopefully no less clear. William McBrine 2006-09-20 20:00:55 +00:00
  • bd2ea5bbe0 OK, forget it -- changing to an array for ACS_* breaks too many things. But the new definitions for WACS_* are retained (so at least those will work when PDC_WIDE is mistakenly omitted), along with the ugly new acs_values[] initialization in testcurs, which is still the only way to do it right. William McBrine 2006-09-20 08:56:30 +00:00
  • 3514b6a6a8 Argh -- with pdc_acs[], the acs_values[] initializer didn't work in many compilers. This is the only way to do it that works regardless of how ACS_* are defined. William McBrine 2006-09-20 08:21:40 +00:00
  • 5dcc97bf35 Added a new table, pdc_acs[], and moved the definitions to the platform directories. Pros: Uses the correct (Unicode) values when PDC_WIDE is set when compiling the library, but not the executable; better platform separation; smaller curses.h; allows run-time redefinition of ACS_* values; more like other curses implementations. Cons: The table is duplicated in DOS, OS/2 and Win32. I used pdc_acs[], rather than the traditional acs_map[], because the traditional acs_map[] is mostly unused space, and because I don't really want to encourage direct references to this table. This may not be the final form. William McBrine 2006-09-20 07:36:04 +00:00
  • 781bec97ad _wacs_map -> pdc_wacs William McBrine 2006-09-20 06:42:03 +00:00
  • 8f4ac48a51 More unused return values. William McBrine 2006-09-11 20:12:03 +00:00
  • 682fa74f30 Combined Endwin() into ExitProcess(). William McBrine 2006-09-11 20:02:48 +00:00
  • e8619570d1 Moved XCsay() to XC_say() in pdcx11.c; more extensive use of XC_LOG. William McBrine 2006-09-11 19:45:17 +00:00
  • e3868a61c0 Formatting. William McBrine 2006-09-11 18:41:04 +00:00
  • 3173c79b60 Some macros that do aid brevity. William McBrine 2006-09-11 07:32:58 +00:00
  • 924b096af9 A few more. William McBrine 2006-09-11 05:38:22 +00:00
  • c8d07eedc6 Removed the "XCurses" prefix from static functions, and removed some macros that did nothing for clarity or brevity. William McBrine 2006-09-10 22:29:00 +00:00