* Each io_context now has a "inherit_fds" member that decides whether
or not this context allows to inherit FDs to its children.
* This replaces the former O_CLOEXEC mechanism.
Make sure that the caret starts blinking half a second after it last moved.
The previous solution using Pulse() had a number of problems:
* The caret could be hidden during moving it or during typing. It would then
be shown again very soon after, i.e. when typing the next character or
when moving it to the next offset. But it looks bad anyway.
* When the caret stopped moving, it started blinking a random amount of
time afterwards, getting back into the rhythm of Pulse() messages.
However, starting to blink a constant time after the caret last moved,
looks much more satisfying.
* It now uses a font that's 3/4 the size of the plain font; ie. there
shouldn't be any change with the default font size.
* Also cleaned up some weird layout code on the way.
* You can specify which borders will be drawn using the
BControlLook::B_TOP_BORDER, ... constants.
* Adapted Mail to no longer need the SetInsets() hack.
* Use a scale factor depending on the font size.
* Be more generous when it comes to the max width.
* Use StringWidth() for the default size of the size and status columns.
* Moved entirely into MainWindow.
* Moved duplicated code into separate methods.
* Resize the main window on larger screens by default, as we can make
use of the extra space.
* Use BWindow::MoveOnScreen() instead of make_sure_frame_is_on_screen()
as the former has more info. And is even smarter now as it can
optionally resize windows to fit on screen.
* Center window on screen by default (ie. when there are no settings).
... and invalidate based on TextChangedEvents. I am not yet sure whether
TextChangeEvent needs separate counts for removed and changed paragraphs.
It is most likely not yet correct and may either update too many paragraph
layouts or miss updating some at the end.
TextDocument:
* Moved implementation of Remove() and Insert() into private methods.
* Reimplement all public Insert() methods and Remove() on top of Replace().
* In Replace(), send a TextChangedEvent. Added TODO for sending a
TextChangingEvent, although at this point, I am not sure if it will be
needed at all.
The int32 was cast to a ssize_t which has a different size on 64 bit,
therefore clobbering the stack.
Also remove the use of basic type references in arguments, which
probably was the reason for doing the above in the first place.
The cleanup commit df48d3f9a8 broke
constructing a BPicture from an archive due to an incomplete rename.
The passed in BMessage was used as the data buffer instead of the
extracted data field.
Fixes the application side crash of #12340. Seeing how long this was
broken without anyone noticing, the feature doesn't seem to be very
popular.
This introduces a more sane API (currently private) that allows for
safer and possibly more efficient implementations:
* It uses a struct of named and typed function pointers instead of just
a void pointer array. This adds type safety to the callbacks so the
compiler can figure out if things match up before subtle bugs get
introduced.
* It provides bounds for all strings/buffers passed to the callbacks.
* It uses const references instead of implicitly copying arguments.
* It folds stroke_x/fill_x pairs into draw_x functions with a fill
argument to reduce the amount of functions needed.
* It uses unsigned values where negative values make no sense.
The old API has been implemented on top of the new one using adapter
functions. It makes copies of all data passed to the callbacks which
effectively keeps the picture data from being modified. This matches
with the R5 behaviour.
This also reimplements the buffer parsing to be safe against corrupted
data by validating that the types actually fit in the provided sizes
and buffers (using a templated reader).
Since this class is used from the app_server with user provided data,
making it more safe is important even though it comes with a slight
overhead (replicating R5 behaviour, i.e. crashing the app_server when
corrupted data is fed, doesn't seem very appropriate here).
While not thread-safe, it should still be possible to use it in
non-threaded programs, or with locking on the application side.
The "thread-safe" implementation we got from NetBSD called abort(),
which is not a good solution. Restore the non-thread-safe
implementation, which should still work.
Fixes issues in openssh and mtr, and possibly other ported apps.
* Added HeaderTextControl that draws the text in black, and uses the
panel background without a frame when it's disabled. Only the label
is still drawn as disabled.
* Changed AddressTextControl to behave in the same way.
* The date view is now a HeaderTextControl, too.
* Unfortunately, the label is not vertically aligned with the contents.
* Added missing const to some getter methods.
* Date() now tries to parse the date of the mail, and return it as
a time_t; you can still retrieve the actual string via
HeaderField("Date") if you have to.
* Mail now shows the time in the local time zone, and with the
current locale.