Commit Graph
848 Commits
Author SHA1 Message Date
X512 ceaf2dd2d6 app_server: add gradient stroke support
TODO: HTML5 remote desktop client.

Change-Id: Ie2a32c4a498462578476d29a7000ea0b6f86810b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9625
Reviewed-by: waddlesplash <[email protected]>
2026-01-04 22:56:43 +00:00
SED4906 64f088f495 BAlert: play user-selected sound
* Alert sounds are separate from notifications

Change-Id: I9e5545084faea354ddd339154c10b54d6479b404
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8477
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-03 13:41:24 +00:00
Kacper Kasper ccf8b1e96f BTab: decouple display label from view name.
In BeOS, the tab label was synchronized with the view name. This means
BTab::SetLabel would change the view name. This behavior is unexpected,
and also annoying, for example it prevents using localized tab labels
but fixed view names for scripting.

* Document this divergence from BeOS in the Haiku book
* Detect if we're running in a BeOS app to preserve the old behavior
  then

Change-Id: I5b758a035fe8752cee2ea7789a30ea47a01467b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/122
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-12-02 08:00:36 +00:00
X512 647aba7574 ServerLink: move Read*/Attach* method implementations to LinkSender/Receiver
Change-Id: Ib4dec3348b1438bbdfbaf18146d8aebb1978c39c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9631
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-08 16:42:25 +00:00
John Scipione e362f604f4 Revert Interface Kit: BWindow owns (and deletes) menu sem and friends
This reverts commits:
39083dd0f7
0f430ba35c
ac55439364

Fixes #19553

Change-Id: I40f9a694079d4376221099e1d1b99208aeb207b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9416
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-30 17:43:51 +00:00
Augustin Cavalier 8e86be8509 libbe_build: Synchronize BBitmap implementation with the main one.
BView-related code removed or disabled, of course, but this now uses
the ColorConversions class, and adds some more ImportBits APIs from that.

Change-Id: I805cef159bac52173ef16030eae69e83db6f061b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9391
Reviewed-by: waddlesplash <[email protected]>
2025-06-24 22:47:45 +00:00
X512 a73ec86407 Shape: remove unused code
Change-Id: I5fc23415aa79d216f04cdf0481794b3fa4c35bdf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9304
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-05-21 20:23:53 +00:00
waddlesplash 888ea83454 Revert "BTextView: Update word-wise/line-wise shortcuts"
This reverts commit 74ef92bc55.

Change-Id: I441d9cce87670e17141051fded594ae8aa6fc1fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9299
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-05-21 17:46:34 +00:00
Augustin Cavalier c6f736315a BSlider: Copy the UpdateText inside UpdateTextChanged.
We can't rely on it not changing between calls, especially as
MaxUpdateTextWidth() changes the value and re-gets it, and
that's called at the end of this method always. So we need to
keep our own copy rather than using the one that's owned by
the subclass.

Fixes a use-after-free uncovered by the guarded heap in VolumeSlider,
reported in #19493.
2025-03-21 11:54:37 -04:00
Augustin Cavalier 2deebfa44b BMenuBar: Move new reserved field to the proper place.
Without this, the amount of padding on the end of the class changes,
which could affect the ABI of any classes that inherit from this one.
2025-02-19 15:10:55 -05:00
John Scipione ac55439364 Interface Kit: BWindow owns (and deletes) menu sem
_Uninstall() before _Hide() in BMenu because the window must
be available when we _Uninstall() especially for shortcuts.

Remove #define and always assume USE_CACHED_MENUWINDOW.

_Uninstall() whenever we _Hide() in BMenu.

Change-Id: I5dae85f6edf1f0b4ccf67a6d9d77470576671cee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9012
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 17:28:00 +00:00
John Scipione 5ee786c31f Interface Kit: Fix missing Alt key in menu shortcuts
The shortcut detection was working, just not the display of the
modifiers in the menu. I've added back the necessary code to fix
this in BMenuItem.

BWindow does the heavy lifting of preparing the keys and
modifiers. I have changes _FindShortcut() used by BMenuItem to
send the prepared modifiers back to BMenuItem.

Set the parameters raw in the constructor, they will get fixed
up in Install().

I also make sure to use the prepped version of the key and mods
in BWindow::AddShortcut() to remove the old one. This is a minor
update that eliminates an edge failure case of malformed input.

Fixes #19395 a regression from hrev58589.

Change-Id: I4333f89149ff843f92dbffbd53d58ffc2def6760
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8943
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2025-02-07 17:00:56 +00:00
PulkoMandy af5f256338 InterfaceDefs: complete ASCII control char definitions
Make it clear that this enum just defines ASCII control characters, and
there is no 'free space'. Also add comment showing which key combination
produces each control character.

Change-Id: I01884132842281cce6c13dd9398b1aeddadae58a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8899
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-04 17:19:28 +00:00
Niklas Poslovski 6670202514 ControlLook: Use B_PANEL_TEXT_COLOR for scrollbar arrows
Change-Id: I7a291842eeaaba00176cb4473a075fad1d3d6293
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8895
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-03 17:18:51 +00:00
John Scipione 5610706bb6 BMenuItem: Remove _DrawFunctionChar() cruft added in hrev58589
Change-Id: I7fbc1dc194be91705646f6e822d03e9773bd649a
2025-02-03 02:39:27 -05:00
John Scipione 16c6cc4418 BTextView: Fixup AdoptSystemColors() and HasSystemColors()
Replace private _UsesSystemColors() with public HasSystemColors()
and make sure to consider the tints when checking if system colors
are used or not.

Document HasSytemColors() in the Haiku Book.

Change-Id: I78de4904d5ddb24b98ad27eb93d4e5ccb330d76a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8897
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-03 00:14:52 +00:00
John Scipione 74ef92bc55 BTextView: Update word-wise/line-wise shortcuts
... and set alternates. This is updated because we can now set
shortcuts without B_COMMAND_KEY. Setup Alt for Win/Linux mode.

* Word-wise shortcuts Option+arrows.
* Line-wise shortcuts Alt+arrows AND Ctrl+arrows for
  Win/Linux mode and for when there's a conflict.

Otherwise these shortcuts are not expected to conflict.

Add shortcuts for Alt+Backspace and Alt+Delete to delete to
the beginning or end of line instead of word.

Split out vertical and horizontal shortcuts so that if one is
used by an app we at least get the other one.

Fixes #9913

Change-Id: I0124fec7df4585a70ded8d3e7bf2aa8cb4acecb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7289
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-02 19:18:35 +00:00
1e2091ced5 Interface Kit: Add support for shortcuts w/o Command
Introduce B_NO_COMMAND_KEY modifier that is used when a
shortcut has no Command modifier, otherwise B_COMMAND_KEY
modifier is added.

This is conceptually different from B_NO_MODIFIERS in that it
allows other modifiers such as B_CONTROL_KEY, B_SHIFT_KEY and
B_OPTION_KEY to be added to a shortcut, but not B_COMMAND_KEY.

This option is required to remove B_COMMAND_KEY because the
Command modifier is assumed to be present on all shortcuts.
This allows us to break this assumption without breaking apps
written before this change and assume B_COMMAND_KEY to be
present even if it has not been explictly added.

Document B_NO_COMMAND_KEY in BMenuItem and BWindow docs.

Fixes #7078

Co-authored-by: X512 <[email protected]>
Co-authored-by: Ryan Leavengood <[email protected]>

Change-Id: If0e20cd848112898f4425ede8c17231dc50deb8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7293
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2025-02-02 19:18:35 +00:00
John Scipione bd2d95cf90 InterfaceDefs: Reorder enums in ascending order, show gaps
Change-Id: I926d0f02e74ea97c302bc4d1794819b60be2874b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8864
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-27 17:19:49 +00:00
John Scipione 9105063938 BTextView: Use document colors on AdoptSystemColors()
AdoptSystemColors() tints document background color to match panel
color if uneditable.

Calling MakeEditable() will automatically apply or unapply uneditable
background tint if you have previously called AdoptSystemColors().

Parent BView::AdoptSystemColors() sets panel colors, we want document
colors here. Do not alter text color - only view, low and high colors
are changed.

Document AdoptSystemColors() and MakeEditable() in BTextView docs.

Change-Id: Ib215735f27bb01fc2f95fcf2fee0185e5fc83f70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8263
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-17 16:57:38 +00:00
Niklas Poslovski 2f8543fe8c interface_kit/ChannelSlider: Fix binary compatibility breakage
Change-Id: I350c80baf7508a9db9a176e3ee050042fafa9321
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8828
Reviewed-by: waddlesplash <[email protected]>
2025-01-13 20:07:35 +00:00
Niklas Poslovski 08028803b1 interface_kit/ChannelSlider: Divide value by 1000 and show one digit after the point.
Fixes #17600

Change-Id: I4357655915270e0ed61f0ce305f299555578bb8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8384
Reviewed-by: waddlesplash <[email protected]>
2025-01-11 18:37:00 +00:00
Augustin Cavalier 27e83b8be8 input: Adjust input_pointing_device_subtype enumeration and usages.
Follow input_device_type above: we don't have _TYPE or _SUBTYPE on
the end, but _POINTING in the middle, because these aren't in a global
"subtype" enumeration, but a B_POINTING_DEVICE-specific enumeration.

Also don't bother adding the UNKNOWN type to messages that have no
type; if it's not included, UNKNOWN is implied. Saves a few CPU cycles.

Change-Id: I9088b9fcee63bf001b43febbe1e3ac17eb1792b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8635
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-12-11 19:11:45 +00:00
Gustaf Alhäll b08fdcde6f PadBlocker: Avoid blocking non-trackpad devices
Exposes a new field on mouse events named "device" that specifices what
type of device the event originates from. This is then used in
PadBlocker to ignore events that don't originate from trackpads.

This field should also be exposed to the public API in case any program
in userspace want to use it, as it may be useful for other purposes.

Fixes #19238 and #17821

Change-Id: Ic0f8c088cf5d2b0414a8e69498b48f2a3e370d73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8557
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-11-18 16:45:04 +00:00
X512 8776466030 BRect: add 2 argument width, height constructor
Left top position will be set to zero.

It is a common pattern to define `BRect` value with only width and height so it allow to simplify code a bit.

Change-Id: Ie14644843324c9e5bcc55e7cfbd557a8884559d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8535
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-11-11 16:56:19 +00:00
X512 2b0aa4245b BShape: use BShape::Private class to access private methods.
Avoid declaring random friend classes in public header. Allow to access
private methods from arbitrary source if needed.

Change-Id: Iac2cf0ca59e483aa0657e3fe1fc47080c661cf8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8534
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-11-11 16:56:19 +00:00
X512 e892302909 BShape: add move construction and assignment support
GCC 2 support is also provided with `MoveFrom` method.

Change-Id: Ifedaf0b1406a5a2cb6bf3465249cea0f360e06d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8531
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-11-11 16:56:19 +00:00
X512 80fcf2df19 BRegion: add move construction and assignment support
GCC 2 support is also provided with `MoveFrom` method.

Change-Id: Ibd062f501fdeb5538ade6c84dcafb61cff70cc32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8529
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-11-11 16:56:19 +00:00
X512 2141d2fe3a input: fix KEY_power key code conflict with japanese \_ key
- This key code is inherited from BeOS, where it was used for the power
  key on Apple ADB keyboards
- Since then, we have introduced a new system for "multimedia" keys,
  that uses HID key codes directly instead of defining our own mappings
- The PS2 driver was using the HID keycode, but the USB driver was still
  using the BeOS defined one
- Japanese keyboards, which have a few more keys than US and European
  ones, reused the same keycode for something else

Since the power key does not need to be mapped by the keymap, move it
out of the way by using the HID keycode (key codes larger than 0x7f
cannot be mapped to UTF8 symbols). Remove all mentions of the use of
0x6b as a keycode for the power key, but add a note in the documentation
that BeOS did this.

To avoid further confusions, complete the documentation of extra
keycodes, and remove some definitions from keyboard_mouse_driver.h that
should have been in InterfaceDefs.h.

While researching this, I also found that some keys specific to Korean
keyboards were declared in the wrong place, as mapped codes instead of
unmapped ones (checked that by looking at the HID driver, which emits
these raw keycodes, and confirming that the mapped ones are not used in
any keymaps. Also added a note about the mapping of the extra modifier
keys in Japanese keyboards, which I think may be a problem since these
map to invalid UTF-8 byte sequences, but this is what the existing
keymap does, so leaving it as is for now until we can determine if this
can be changed or if we have to keep it that way.

Change-Id: I6a198a0840cba7739bdc78e0c65e5d8fd23956c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8047
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-08-19 16:00:25 +00:00
Máximo Castañeda caed67a8cb Input server: add mouse-specific API for button map and click speed
Convert users of those and other parameters to the new API.
Fix mouse preferences "Default" button not changing button map.

Change-Id: I9184011fd3067fd0b229e1db6376c1b41f06dab9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7878
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-07-29 17:30:39 +00:00
Máximo Castañeda b8a45b3a2d BFont: allow skipping fallbacks in GetHasGlyphs
Change-Id: I5a68008d25cce34596fb5ce6fb07259ae56c3a3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7829
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-07-06 13:12:21 +00:00
Máximo Castañeda a31ade72ce BFont: remove default values from ambiguous method
Noticed by Joachim Mairböck after I hastily merged change 7402.

Also add named variation instance selection for fonts loaded from memory
areas like there already is for files.

Change-Id: I76de22181dc39559956c25987165be2f8a8c4a37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7493
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2024-03-10 09:18:45 +00:00
Jérôme Duval d0f06357f5 app_server FontManager: load all fonts and named-variants from a file
BFont::LoadFont can now use an index (0-based) and an optional named-instance (1-based)
to select the font variant from a file.
BFont::LoadFont can also use an index when loading from memory.

Change-Id: I0ce3eb6cc77d32cf43847416561eafe3063ca693
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7402
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Máximo Castañeda <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-03-01 18:04:33 +00:00
nep 9931e8eeee rgb_color: Add new APIs: Contrast(), IsLight(), IsDark()
- Remove perceptual_brightness
- Change implementation of rgb_color::Brightness() to the previous BPrivate::perceptual_brightness()
- Introduce convenience methods Contrast(rgb_color), IsLight() and IsDark()

Change-Id: Id677d4a32ce43d73bffecf9baf8cffaafb01a16d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7399
Reviewed-by: waddlesplash <[email protected]>
2024-02-26 20:24:25 +00:00
Trung Nguyen 4331338685 headers/os: Add name to spacing enum.
The `enum` containing `B_USE_DEFAULT_SPACING` and other members are
regularly used in default arguments.

Adding the name to this `enum` makes the header more generator-friendly
(see #6716).

Change-Id: I6676d2329bdb2152ccb37615345b97ba35f70563
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7377
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-02-04 08:13:53 +00:00
Máximo Castañeda 621200ebbd BOutlineListView: fix ItemUnderAt and accept NULL as superitem
ItemUnderAt was returning items that were not under the superitem (this
was fixed for EachItemUnder in hrev52210).
Make a NULL superitem mean the parent of the topmost items. Despite not
being explicitly documented in the BeBook, that's how BeOS works, the
MenuWorld test app uses it and, well, it's handy.

Change-Id: I2551e8ce874a6238c5e5fb1eb742e68e62d3928a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7359
Reviewed-by: Adrien Destugues <[email protected]>
2024-01-29 18:58:03 +00:00
John Scipione 82bfaa954d BListView: Add ScrollTo(index) method, auto-scroll on drag
Multi-select lists may also auto-scroll on drag now as well.

Document ScrollTo(index). Give Scrolling its own section.

Change-Id: I36284a28376a01bafd23ddb30162fc786fb41521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7213
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-24 02:45:59 +00:00
John Scipione 64a2e73375 Add _ViewWidth(), _ViewHeight(), _TextWidth(), _TextHeight()
private convenience methods to calculate the text view width and
height with insets and the text rect width and height without
insets respectively.

Also add _ViewRect() and _TextRect() methods for completeness,
but they are not currently used.

Change-Id: I0582bc93a0a3a6820bbb2262a1d726457309ab9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7162
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-08 10:14:14 +00:00
John Scipione 6761bf581f BListView: Update selection on mouse down and mouse up
A version of this feature was originally implemented in hrev50495
that allowed you to scroll through a list of list items while the
mouse was held down updating the selection as you went.

This feature was removed when we switched to selecting on mouse up
in hrev52062 and was never reimplimented when we switched back to
selecting on mouse down in hrev52121.

In BeOS R5 as you scrolled through a single-selection list with the
mouse button held down the selected item appeared to change, but
the selection didn't actually update until you released the mouse
button. The selection never changes on mouse down, only on mouse
up. You could click on one item then move your mouse off the first
item to a second item releasing your mouse button and it would
select the second item without ever selecting the first item.

In this commit we replicate this behavior with one exception, we
always select on mouse down, but still allow the selection to
change on mouse up.

The big difference between this and the BeOS behavior is that on
BeOS you could only select exactly one item on mouse up, while with
this you can select one item on mouse down and a second item on
mouse up.

ScrollToSelection() in MouseMoved() if mouse button is down and
we are not not dragging. This performs auto-scroll.

Create private _DoSelection() method copied from MouseDown().
Remove Thread.h include that is no longer used.

Fixes #15009 (and doesn't cause regression for #9190 #14264 #14289)

Change-Id: Icae02b8d37ed281390647504b4efa3d694ea522a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1956
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-05 22:10:10 +00:00
Trung Nguyen 8e8250e9dd headers: Explicitly hide BAlert functions
Explicitly hide some BAlert functions that ought to have been
deleted. This prevents binding generators from thinking that these
functions are available, causing undefined symbol errors during
link time.

Change-Id: I56f53808851b82a10f31015d2351d4e2c29b6f33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6718
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-07-18 16:43:33 +00:00
X512 da70563f7f interface/Size: fix -Wdeprecated-enum-float-conversion warning
Change-Id: I8ca131f57495f974a79292a42ba5ce42a47d2437
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6702
Reviewed-by: waddlesplash <[email protected]>
2023-07-15 13:10:33 +00:00
Trung Nguyen 3cb845283e headers/os: Make headers generator-friendly
Make Haiku headers a bit more friendly to binding generators by:
- Giving some `enum`s names (especially those that appear in
default arguments).
- Converting an internal `inline` function into a macro so that
the result could be evaluated in compile time.

Change-Id: I770674ad8fa7b24ac30b6b447d52a4b4c2530b8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6716
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-07-11 14:40:02 +00:00
PulkoMandy 4dbd474753 Add BIconUtils::GetSystemIcon
Allow to easily access the alert icons and anything that's added to app_server
resources.

Fixes #10887.

Convert BAlert, Debugger AlertWithCheckbox and Keymap ModifierKeysWindow
to make use of it, removing the duplicate code to locate app_server
resources.

The resources are initialized only once (per application), so there is no need
to reload them for every access to the icons.

In the ticket there is discussion about putting this in BControlLook,
but I think this should in fact be moved fully into app_server with
special drawing commands for well-known icons. That would avoid loading
and rendering the icon on the application side to then send it to
app_server (especially in remote_app_server case)?

In any case, this simple API can serve as a base for applications to
use, and we can change how it is implemented later on.

Change-Id: Id370526ae5cf165cfb8bc277bc8a7f46c26f542d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6463
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-24 10:58:48 +00:00
Máximo Castañeda e6a598a2f4 ControlLook: fix clipping
Remove ConstrainClippingRegion calls as they do not take into
account view transformations.
Clip drawing to the drawing rect, not the updated area.

Fixes #12890

Change-Id: Ie76cb83e0af03213008da78407de25261daea5df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4457
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-04-26 10:41:04 +00:00
PulkoMandy 5f88744263 BMenuField: allow to use non-fixed size in combination with layout mode
In fixed size mode, the menu field always uses all the available width.
In non-fixed size mode, the menu field will resize itself to be as small
as possible.

With layout, usually the difference isn't noticeable, since the layout
will already try to resize the control to the smallest possible size.
But there are a few cases where it makes a difference, when the layout
is over-constrained and the menu field can't be made as small as
possible. In that case, the menu field would be forced to fill its
allocated space, where we can instead make it a little smaller.

Change-Id: I911d497218a09aab3824865968558df5d4b3cf98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6076
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-02-21 10:47:46 +00:00
PulkoMandy fc2f1a3247 BMenuField: remove deprecated constructors
These were introduced by mistake during the addition of the layout
system. They have been private since 2011. It seems safe to assume that
nothing uses them anymore and they can now be removed safely.

Change-Id: I98d030096f9cb06fccc25233fe4da17d0213050e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6075
Tested-by: Automation <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-02-18 17:20:27 +00:00
Dale Cieslak 4f52a155e6 BFont: Minor code cleanup and autolocking for AppFontManager
* changed explicit locking to use Autolocker for gFontManager/fAppFontManager
in ServerApp, per comments in https://review.haiku-os.org/c/haiku/+/4790
* changed BFont::LoadFont (memory version) to use size_t for size and offset
* no functional changes

Change-Id: I438a4975d5bb1b2fa17bc54e9e171c31dadfeec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6003
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-02-06 09:21:12 +00:00
X512 f6c51a5dc4 BBitmap: add ability to specify client-defined area
Change-Id: Iae1550b3088b0f6c26b0b91d9acb7f7cbcc721d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4369
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: X512 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-01-02 18:07:53 +00:00
Dale Cieslak 85b82f8524 BFont: allow loading of user fonts from disk or memory
This patch adds an API call to BFont, called LoadFont, that
takes a string path to a font file. The user fonts are managed
via a new class called AppFontManager that inherits from the base
class FontManagerBase but adds the methods to add and remove user
fonts from disk or memory. There is also a new method called UnloadFont
to remove a user font, but on exit of an app all user fonts should be
automatically cleaned up.

Global/system fonts are managed by the GlobalFontManager, which is
a new class that also inherits from the base class FontManagerBase,
replacing the old "FontManager" class.

A maximum of 128 user fonts may be loaded, and memory fonts
may not exceed 20MB.

There's also an overloaded version of LoadFont that accepts
an area_id and loads the font from memory. A size and offset may
optionally be provided to allow for an area that contains more
than just a font.

Change-Id: I6add42bdf0c0cefc0e2e2a4984fd848c3e7269e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4790
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-17 12:32:09 +00:00
Máximo Castañeda 241f109ccb View: provide the transform between different coordinate spaces
There's currently no way for an application to convert between view and
drawing coordinates with a drawing states stack without keeping track of
all the transformations itself, which is not very convenient for helper
or library functions.

Handle other spaces too, for good measure.

Change-Id: Ic8404a1c111e273fff1eebf2f9f59f58246b796c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5775
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-11-13 04:04:30 +00:00