New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win32a changes submitted #6
Conversation
I've been using this recently and its been running smoothly. I did have a few issues getting it to work along the way, but I believe those were my mistakes. I really do hope this gets merged with the main repo. |
This needs to be rebased to solve conflicts. |
Merged, not rebased. Rebasing is considered a bad practice. |
curses.h
Outdated
#if defined( CHTYPE_32) | ||
#define CHTYPE_LONG 1 /* chtypes will be 32 bits */ | ||
#elif !defined( CHTYPE_16) | ||
#define CHTYPE_LONG 2 /* chtypes will be (default) 64 bits */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if CHTYPE_16 is defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Luke,
On 2016-03-23 00:26, Luke-Jr wrote:
In curses.h #6 (comment):
@@ -34,11 +34,16 @@ PDCurses portable platform definitions list:
#define XOPEN 1 /* X/Open Curses routines /
#define SYSVcurses 1 / System V Curses routines /
#define BSDcurses 1 / BSD Curses routines /
-#define CHTYPE_LONG 1 / size of chtype; long */
+#if defined( CHTYPE_32)
- #define CHTYPE_LONG 1 /* chtypes will be 32 bits */
+#elif !defined( CHTYPE_16)- #define CHTYPE_LONG 2 /* chtypes will be (default) 64 bits */
What if CHTYPE_16 is defined?
In that case, CHTYPE_LONG is left undefined.
There's some discussion of this in curses.h (search for "Originally,
PDCurses used a short" and read from there.) Until Win32a came along,
your options were to leave CHTYPE_LONG undefined, in which case you
got 16-bit chtypes and some limited attributes and colors; or you
could #define CHTYPE_LONG 1 and get 32-bit chtypes, basic Unicode
support (i.e., up to U+FFFF), and plenty of colors and attributes.
Since this was a binary decision, it made sense to have the options
be "either CHTYPE_LONG is defined, or it isn't." Making it a ternary
choice, with 64-bit chtypes as an option, threw a spanner into the
works. For backward compatibility, I just set things up so that
option was enabled with #define CHTYPE_LONG 2.
-- Bill
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/wmcbrine/PDCurses/pull/6/files/c1ab1e40dc35a905edd65e5263ce9d7029d5e452#r57108353
BTW, is it possible to build this such that the console vs GDI decision can be made at runtime (eg, via a command-line option)? |
I'd say that merges and huge commits are hard to review, so rebasing and splitting changes into small independent PRs is often the only way forward. Depends on reviewer, though. |
Technically it is possible, but I am not sure that it is a good fit for this PR. |
Hi Luke, On 2016-03-23 00:31, Luke-Jr wrote:
I suppose it could be done, with a great deal of revision. (A lot Note that SDL would also be a choice, so you could load up all
|
On 2016-03-23 04:54, anatoly techtonik wrote:
You're both getting beyond my very limited knowledge of git (only The "Golden Rule of Rebasing", described here, https://www.atlassian.com/git/tutorials/merging-vs-rebasing/conceptual-overview suggests some possible problems (I think) with rebasing. Dunno if this would help, but... since the time I forked from If I do that, wmcbrine/PDCurses/master could be rolled back Seems to me this ought to simplify the problem, but as a Git -- Bill
|
The purpose of runtime selection would be to avoid opening a separate window when invoked from a command prompt. |
@Bill-Gray I would try to split it into several small logical changes using:
If you fork |
Hi Anatoly, There are several problems here. Some of them may seem troublesome I know that William has some reservations about the proposed changes I'm not very interested in splitting things up until I know which, The changes I've submitted begin with a huge dose of changes made http://www.projectpluto.com/win32a.htm which is nearly useless for GitHub purposes. Ideally, I'd have been Since I submitted this pull request back in January, by the way, I've -- Bill On 2016-08-11 05:58, anatoly techtonik wrote:
|
Hi @Bill-Gray. This will never be merged unless somebody helps you to split this huge piece of work into separate small pull requests - one feature per request. It is very hard to review big pieces of code when people have only got about 15 minutes of free time on their side project such as PDCurses during the day (or even week). I spent 5 from 15 already by answering. =) |
On 2016-10-24 04:32, anatoly techtonik wrote:
I'm pretty much proceeding under the assumption that it won't get I also don't see this as a big problem. We will effectively have I perhaps should have pushed harder for a merge back in March 2010 But at this point, breaking up the changes between March 2010 (when Unless I hear objections, I'll withdraw this pull request and the -- Bill |
Although I've taken many of the other changes here into my tree, I have yet to include the actual "Win32a" port, because I would've had to dumb it down to fit it into the intentionally limited framework of 3.5 (in particular, no 64-bit chtype, nor anything that depends on it), only to build it up again later. But I do plan to include it in a future version (soon), that more radically revamps PDCurses. |
Glad to hear this is apt to happen, and I agree with your strategy of getting other bits, such as 64-bit chtypes, in place first (and you've been getting some pieces of the puzzle into place: bold/italic fonts, real blinking, etc.) As best I can tell, the main obstacle to merging the Win32a port and associated changes is that it's a significant pain in the anatomy. Nothing that's rocket surgery, but it's a lot of changes. I don't think there are major philosophical differences to be bridged (and I'm quite flexible on minor philosophical differences). If you see changes I could make in my fork that would simplify the process, please let me know. (One that I've started on is applying some of your changes, where possible/appropriate, to my fork, thereby making them at least slightly less "different". There's quite a bit more that I can do there, though.) |
@Bill-Gray Can you please give a short update about "back-merging changes of this repo to your fork"? I think it would be good to do so (and provide a new release in the other repo to verify that all the changes work before more approaches are done to merge the two repos). @wmcbrine Can you please give a short update/details about 64bit chtype addition and other changes you see necessary before '(fully) merging the Bill-Gray fork (especially win32a)? |
@GitMensch : not entirely sure what you mean by this... I've been pleased to see a lot of interesting things in @wmcbrine's updates in the last few months, and have gotten around to putting some of his fixes and improvements into my fork. I was rather impressed that William found a way to get blinking text and 256 colors in the Win32 console. I'd be grabbing still more of his improvements, but I've some contract work that has been taking most of my time for a while now. I'm also just glad to see that "official" PDCurses has some life to it. Unfortunately, we've now diverged a lot. Previously, I'd kept up with William's changes, so that my fork was essentially "official" PDCurses plus changes. A merger now would be painful, though not impossible, if William is so inclined. It would probably start with adding 64-bit chtypes. Doing that would not really be very difficult. I think that at that point, the Win32a code could simply be slurped in. Since "official" PDCurses doesn't have Win32a at all, there would be no issue with conflicts with existing code. After that, we could put dimmed, overlined, blinking, struck-out, RGB, full Unicode, etc. capabilities into other platforms that can support them (basically X11 and SDL1 and 2). That would take some more serious effort, but shouldn't be rocket surgery, especially since all of it does already work in the forked version. But again, I've no idea if William is interested in this, and this is his repo. |
…on the availability of xterm-like sequences
…t least 'sort of', though further effort is apt to be needed
…, the key is _not_ 'already handled', and marking that flag will cause the next character to be treated as if _it_ had already been handled.
…h C90-style /* comments */.
…SE before including curses.h, to invoke the ncurses-style mouse interface, instead of NCURSES_MOUSE_VERSION. (The old way will also still work.)
… out (correctly) that we access c[count], i.e., an uninitialized value. Reversing the order of comparisons avoids that access, has no actual effect on the code, and stops Valgrind from complaining.
…tream (wmcbrine) version as well.
…ot 64-bit chtypes and more than 16 colors. In that case, you get the square of the number of colors (i.e., each pair of colors can be a color pair), up to INT_MAX or 20 bits worth of color pairs. This really should be determined at compile time, but I didn't see a way of doing that.
…32K color pairs and 16M color palette)
…), and put it where William has it.
… for pointing this out). Reinstated INFOEX=N flag.
…ilds' issue #116 (we think).
… of ncurses or PDCurses drawing)
…curses or PDCurses drawing). Should have been added in to previous commit.
…ssue in wmcbrine fork of PDCurses, applies here as well).
…DCurses#67) so that it follows ncurses practice of returning the maximum mouse interval. I don't see the value of returning ERR. Also followed Simon Sobisch's comment that the maximum interval ought to be a defined constant and greater than 1000.
…if you've called them before 'initscr()', you're doing something wrong and would like to know about it.
…ill some work to do before it runs correctly (will require ncurses' direct-colors model). Realized some 'break' statements were missing (to no ill effect, but still... they should be there.)
…lled mid-write. (Something I only noticed with 'picsview' expanded to a huge screen and with lots of resizing.) You have to notice that not all bytes were written, check to make sure that a signal handler really was the problem, then try again until all bytes do get written.
…n font, rather than getting it from ROM.
…than or equal to 16. Replaced the GNU Unifont-based font (which is non-public-domain) with a public-domain 8 x 14 VGA font.
I'm assuming this is essentially a fossil pull request, and am closing it. |
With this, "mainstream" PDCurses should be updated to include the new Win32a flavor. Other flavors are not greatly affected, except as described at http://projectpluto.com/win32a.htm#2015may31 and in the commit comments. So I think this will be straightforward, even though it's a fair bit of code.