-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Normalize geometry arguments across all functions #2320
Conversation
What about |
pointers did not change with this PR. they might with #1777. i started down that road and the churn would be deafening. i'm completely unsure as to whether it's worthwhile. |
c8ea125
to
b6f1515
Compare
Ah ok. I'm a big fan of having as much type consistency in the library as possible. But yeah you'll have to decide how much churn is worthwhile... |
it is truly immense, if i go all the way through and make them |
indeed, doing it incrementally sounds reasonable |
hrmmmmmmmmmmmm. i'm suddenly wondering if we don't actually want to admit hrmmmmmmmmmmmm. ugh, yeah, this was a mistake. lengths as yep, i fucked this up. oh well, glad it didn't get released. all coordinates are going to go back to |
try, fail, learn, try again :) it's the loop of success! I'm thinking another option would be to interpret In Rust it's easier to express these semantics by using an Anyhow the decision must be made according to what makes most sense for the C Api. If that's what your heart tells you then that's it, and I'll wrap around it no prob. |
indeed, only the USA, Liberia, and Myanmar still refuse to use metric types. what the rest of the world calls i would worry about the ability for wrappers to access this preprocessor definition, and also given that the internals are gonna stay ints...
i wholeheartedly support you exposing it in this fashion.
tell you what i'm gonna do i'm get on my knees and put it in the Lord's hands. coincidentally, He's also colloquially known as FOOTIELARGE, caps and everything. |
Deprecate notcurses_mouse_{enable, disable}. Reimplement them for now as wrappers around notcurses_mice_enable(). New function notcurses_mice_disable() is a static inline wrapper around notcurses_mice_enable(). The latter function takes an unsigned bitmask of event types. We now turn on the "all motion" tracking DECSET if NCMICE_MOVE_EVENT is requested. Update the documentation, and kill some obsolete lines. Add the ypx and xpx fields to ncinput, to indicate pixel offset within a cell. Add nckey NCKEY_MOTION for button-free motion events. Update notcurses-input to pass NCMICE_ALL_EVENTS and decode NCKEY_MOTION. Only emit mouse sequences when connected to a TTY (or GPM). Closes #2320. Request RGB XTGETTCAP. Fix bug in error check in notcurses_render_to_buffer(). Decode multiple XTGETTCAP responses.
Yeah I meant UINT_MAX... I just found another case where FOOTIELARGE has to make a decision. I'm seeing all of the fields in ncvgeom are |
those can and probably ought all be unsigned |
that's great. BTW do you know which of fields can have a valid 0 value? I'm guessing |
in ncvgeom? if you pass a NULL
|
Deprecate notcurses_mouse_{enable, disable}. Reimplement them for now as wrappers around notcurses_mice_enable(). New function notcurses_mice_disable() is a static inline wrapper around notcurses_mice_enable(). The latter function takes an unsigned bitmask of event types. We now turn on the "all motion" tracking DECSET if NCMICE_MOVE_EVENT is requested. Update the documentation, and kill some obsolete lines. Add the ypx and xpx fields to ncinput, to indicate pixel offset within a cell. Add nckey NCKEY_MOTION for button-free motion events. Update notcurses-input to pass NCMICE_ALL_EVENTS and decode NCKEY_MOTION. Only emit mouse sequences when connected to a TTY (or GPM). Closes #2320. Request RGB XTGETTCAP. Fix bug in error check in notcurses_render_to_buffer(). Decode multiple XTGETTCAP responses.
@dankamongmen then would it be safe to say that valid values of pix{yx}, cdim{yx}, rpix{yx}, rcell{yx} and scale{yx} are never gonna be 0? |
correct. you can get that for certain invocations of ncvisual_geom, though. |
ok that's great.
yes, and that's why I'm creating a thin wrapper over |
These are the new refactored methods:
In case you want to check them. |
We take geometries in more than a dozen functions as parameters. We were handling them differently in different places: sometimes -1 meant "all available", sometimes 0 did (and negatives were all errors), for some any non-positive number was an error. All geometries and lenghts are now passed as
unsigned
, and 0 means "everything" where that is appropriate. Closes #1696.