PDCurses
PDCurses copied to clipboard
Curses window properties
Added the following functions:
- is_cleared()
- is_immedok()
- is_nodelay()
- is_scrollok()
- is_syncok()
Note : these are extensions found in ncurses
to enable the WINDOW
structure to be opaque. We'd need a few more of those functions (is_idcok()
, is_idlok()
, is_keypad()
, is_leaveok()
... see above link) to actually get opacity. But quite aside from that, it might be nice to have the added ncurses
compatibility.
I think your info is pretty bogus. idcok(), idlok() are no-ops (aka no operations) in pdcurses. so therefore is_idcok() and is_idlok() are pointless. and the is_keypad() and is_leaveok() functions are already part of pdcurses 3.9.
is_idcok()
and is_idlok()
are not pointless if you'd like to compile the same code with both ncurses and PDCurses. Which, as the documentation points out, is why idcok()
and idlok()
are present, as no-ops : they, too, are "pointless", but are provided "for compatibility with other Curses implementations." to aid portability. By your reasoning, they'd be absent, too.
It looks to me as if
#define is_idcok( win) FALSE
#define is_idlok( win) FALSE
would do the job (i.e., we never have hardware control going on).
Fair point about is_keypad()
and is_leaveok()
being already present in PDCurses, though. (Also, is_pad()
.) Those appear to be the only three "opacity" functions already present; my point that most of them are missing stands. (I had grepped for a couple of them in the code, didn't find them, and leapt to the conclusion that we were missing all of them.)
:+1: you are right
Decided to not make them #define's, good or bad I don't know ...
The PDCurses code does not appear to take a strong "macros are always evil" stance. But it does lean to function use, so you probably made the right choice.
I note you added some code to suppress warnings about unused parameters. PDCurses is loaded with unused parameters. (Compile with -Wextra
in GCC and see them all pop out.) I would not mind seeing (void)unused_param
in all such cases, and then turning on the relevant compiler warnings. I like running with maximum warnings, so quite a bit of my code has something like
#define UNUSED_PARAMETER( param) ((void)(param))
...
UNUSED_PARAMETER( ignored_param);
But that's probably for a different push request, and I don't know if William would be at all interested.
Yeah
@Bill-Gray: Do you plan to integrate any of these? Which if any functions are missing to reach a reasonable well support here?
If submitted, I'd pull this into PDCursesMod. Looking at the ncurses
opaque window functions, I see we'd be missing is_notimeout()
, is_subwin()
, wgetdelay()
, wgetscrreg()
, and wgetparent()
. I'd see nothing wrong with adding those five functions as well. And it can be convenient to be able to use the ncurses
test code and to be able to build programs for both PDCurses* and ncurses
with minimal changes.
Ok, lets see if I can add those as well. Maybe I do it tonight.
That's fine. Do what you think is the best choice.
Would've been fun if William made a 4.0 release in the future. Some time has passed since 3.9 was released. :+1:
Else he can do it himself if he like...
Added these functions, with minor changes for the slightly different styles between PDCurses and PDCursesMod. Thank you!