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
[suggestion/implementing] Make term library draw in user defined areas +a fix #1527
Comments
Sounds great! This is actually something I had hoped to do one day, but eventually never got around to. Would definitely accept a good PR for this. Fixes: absolutely, please do. I'm not sure which part you mean with the copy/set, but even if I did I probably couldn't remember if there was any deeper meaning to it, so whatever works. And yeah, proper widechar support would be amazing. Side thought: how does term.getWindow() know what to return? I.e. how does it know the running program? I imagine using |
Originally I didn't even think about multiple windows, but that sounds nice, too.
And if I'm are already adding stuff like that I'd add the neat feature to specify a gpu for drawing. |
Ah, having a single area and just specifying the area for that would be a lot easier than what I had thought of, and seems a lot more reasonable short term; unless you want to give it a shot, which'd be great! As for an API... I'd actually not considered multiple windows per program (just one per, with its properties being stored in the process data). But something along those lines sounds good for full flexibility, yes. With the default window then being stored in the process data or so, inheriting its properties from the creating process (well, "process"). I think term.bind might be a little to inviting for confusion with gpu.bind, so term.setWindow sounds good to me. And sure, once there's a 'window' object, having a 'setGpu' on it sounds comparatively trivial and would be quite helpful I imagine. |
Current status: Testing & Bug Fixing |
Sounds great. For |
There is no scaling but the width and height in setArea/getArea can be negative to indicate that the lower/right border has a fixed distance to the lower/right end of the screen. You might need that information when you are drawing something. |
Ah, right, forgot about you mentioning the negative values. So those would be kept to dynamically adjust it on a resolution change I guess? I kind of lean towards getGlobalArea, as its in sync with toGlobal, but I've no strong opinion on that one, tbh :P |
May window system have multiple cursors or cursor is displayed only in current window? |
As in have a |
Each window has its own cursor. But there is no possibility to have multiple inputs at once since you can't run term.read in parallel. There also isn't the concept of a "focus" or "current window". The only filter for keyboards is that only the first keyboard( of the screen( bound to the GPU( used by the window running term.read))) is listened to. (It's only the first keyboard because you get one event per keyboard.) |
Yeah, the term lib is a bit broken wrt. to the event lib, that's in hindsight a design flaw I'm pretty annoyed with myself for. Given that the read logic is in the term lib, which is what's being edited, it should be possible to have that change focus though, no? (Still only one active, but hey) |
I'm currently prototyping a term library modification that adds the possibility to limit all term drawing operations to a user defined area. That can be useful if you want to have a split screen with the shell and other command line programs on the bottom and something like a "reactor state monitor" on top.
The API would only get 2 additional methods:
All values can be negative to indicate a side being relative to the lower right part of the screen.
The prototype works but is ugly and I'd like to do a partial rewrite of term.
So my question is: Would you accept a pull request for such a modification?
Since I'd have to rewrite some parts of the library anyway, I'd also take the freedom to change some other things:
The text was updated successfully, but these errors were encountered: