Commit Graph
100 Commits
Author SHA1 Message Date
Máximo Castañeda 1f3bc6f056 app_server: fix build for older FreeType
5c254dff8c updated FreeType build packages for x86_64 and x86_gcc2,
including a change in app_server to adapt to a different pointer type
in a FT_Outline member. Other arches are still using older versions
of FreeType, though, so they need the older type.

Change-Id: I4ad934821a338e93e3827069618948e77eae66e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10306
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Máximo Castañeda <[email protected]>
2026-01-31 14:51:12 +00:00
Máximo Castañeda c33f1b8ccd Deskbar: fix loop exit when adding a team
We want to check all apps until we find the one we are looking for, not
just the first.

Error introduced in fb885767b6.

Fixes: #19152
Change-Id: I8b7c5a7c2fcd530b13c70f7a1addda583e30ecdc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10076
Reviewed-by: Máximo Castañeda <[email protected]>
2025-12-10 01:29:08 +00:00
Máximo Castañeda 2f598715f1 usb_disk: remove spaces at beginning of normalized name
Happens when the device has an empty vendor name.

Change-Id: Ib401749763a2e7ffe292feef41595f2dfae17d82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10028
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-27 09:17:05 +00:00
Máximo Castañeda fed6a37b4f bootloader console: encode output
EFI wants UCS-2, BIOS uses CP437. Other systems untouched.

As a side effect, the high bits don't spill anymore into other fields.

Fixes: #18016
Change-Id: I704e8b8ab5e2c0d07ebbe033b3313245252ffd5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9976
Reviewed-by: waddlesplash <[email protected]>
2025-11-25 20:20:32 +00:00
Máximo Castañeda 1e76bade06 Tracker scripting: count visible items
When using type-ahead filtering, the list of all entries is not the same
as the list of the visible ones. `PoseAtIndex`, `FindPose` and
`SelectPoses` all  work on the visible entries, so count those.

Fixes: #5529
Change-Id: I65cf67e544f515508b08bb661ee594244ab94952
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9680
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-05 19:58:42 +00:00
Máximo Castañeda 45f3d65457 Storage Kit: do what the method says in InstalledTypes::_AddSupertype
That is, just add the supertype if it does not exist. Leave getting it
to the callers that need it.

Fixes: #19653
Change-Id: I79d804161d28684e16a0d84ec3a2fb6788c0b506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9436
Reviewed-by: waddlesplash <[email protected]>
2025-07-01 18:07:08 +00:00
Máximo Castañeda 86caaf1c50 UserBootscript: avoid opening nonexistent files
Fixes: #19612
Change-Id: I6fe210e087adbd094cbfb5625d54fbe958f72473
2025-06-11 12:48:09 +02:00
Máximo Castañeda bbac6dc904 app_server: transform text decoration lines
Apply the full affine transformation, not just a translation.

Change-Id: Ifbb4ce0e3be3b0746474fcefad2d00c08a2f3513
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9131
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-03-17 18:57:19 +00:00
Máximo Castañeda 396f9dc3e2 app_server: fix text drawing with clipping path
Until we have a subpixel antialiasing + mask pipeline, fallback to
vector glyph data and grayscale AA.

Fixes: #19435
Change-Id: Ibc102f4a1054a378e28f2882df84828891500155
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9130
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-03-17 18:57:19 +00:00
Máximo Castañeda 28cd4f5dd7 app_server: check glyph bounding box
AGG scanline storage is initialized with min and max coordinates with
maximum absolute values in the opposite direction, defining an invalid
rect that is updated when something is rendered. For a whitespace glyph
nothing is rendered, so we get an invalid bounding box. The moment we
offset that, the values overflow giving a valid enormous rect, which we
later use.

Fixes a crash in TextRenderer tests.

Change-Id: Ia8bbbcfd27bab6e6954eb890d9c783d04037794d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9129
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-17 18:13:04 +00:00
Máximo Castañeda ab1f14f362 tests/app_server: test some AGGTextRenderer paths
Change-Id: I099029590f5d9ee5d86fa0701c3858fc4f630df7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9128
Reviewed-by: waddlesplash <[email protected]>
2025-03-17 18:13:04 +00:00
Máximo Castañeda af381ebd19 test_app_server: fix build after hrev58397
Change-Id: I81c64db2adf21f6cea15e99f15e765c108d34506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9118
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-11 02:07:19 +00:00
Máximo Castañeda 72f8f120b0 API docs: fix syntax
Lack of closing tag discards page for generation.

Change-Id: Ibe5b5618c59a29e063b46d1897145a59ab57c8dc
2025-02-21 13:01:07 +01:00
Máximo Castañeda a73a1b0318 input_server: fix private method name
As noticed by Oscar Lesta.

Change-Id: I4e9a401540a363d2ce1189eb8ceed891a98254cd
2025-02-21 12:34:55 +01:00
Máximo Castañeda 6894c8a7f7 app_server: don't minimize on single click on resize corner
hrev55002 unintentionally turned a single click in the resize corner of
a window into a minimize command. Change that back and minimize only on
double-click, like with the tab and other border parts.

Fixes: #19137
Change-Id: Ic9c76c809531d718fac911eaf668770edc3e5b89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8427
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-09-30 19:55:33 +00:00
Máximo Castañeda cbc8ea5218 input_server: don't lock device list for mouse settings
Instead of traversing the list of input devices when we are not given a
mouse name, update a list of currently running ones on device start and
stop. This makes the input_server message loop independent of other
threads holding the device list lock.

Fixes: #19100
Change-Id: I2d0d55da04fa506bef88bf731e1a719a64958a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8359
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-30 15:54:20 +00:00
Máximo Castañeda 978af2370b app_server: avoid duplicate scan of font directories
When scanning a directory for fonts we also include its subdirectories.
Those may already be in the list and may even have been scanned before.
That happens in a typical setup, where the system fonts directory is
obviously included and then a subdirectory is added as part of the
default mappings.

See #18979

Change-Id: I92c6b7965aee030520402e2d53c4190fdca8b0e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8001
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-12 17:26:50 +00:00
Máximo Castañeda 2ef4221668 Input server: add some mouse settings checks
Workarounds broken settings as in #18973.

Change-Id: I9723cba7fc46ab624da54ebaf3e6e9e1fa547d66
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7962
Reviewed-by: waddlesplash <[email protected]>
2024-08-08 22:35:46 +00:00
Máximo Castañeda 5c9ff09463 AboutSystem: terminate copyright list
Fixes: #18963
Change-Id: I525627ce9008aef43d3b99d231865fe5598e1994
2024-08-01 18:26:00 +02:00
Máximo Castañeda 13e1bd391b app_server: lock font manager in PicturePlayers accesses
Change-Id: I0a5e59d7141167d8fb22d9cf23baeddd2ea8a8df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7922
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-01 04:21:50 +00:00
Máximo Castañeda 78d164f7ee app_server: update font manager revision on font addition and removal
The revision number is used to know if the font list has changed, and
that's where it happens.

Fixes the revision going back when a font directory is removed.

Change-Id: Ib9bb0f463177aff11665c0083604f4a7e35395eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7921
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-08-01 04:21:50 +00:00
Máximo Castañeda e03d9e134c BFont: reset to plain font on font unload
It may not be ID 0 if it has been changed from the default.

Change-Id: I9aef328ee243d85c2cd37b47666440e0e54e66c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7920
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-08-01 04:21:50 +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 df803c0f3f input_server: handle empty-named mouse settings requests
When reading data, return it from one of the connected devices, or from
defaults if there's none. When changing data, do it for all connected
devices.

Fixes: #16617
Change-Id: I36e0f9929c833905d146d19b02be136a3588026a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7837
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-07-29 17:30:39 +00:00
Máximo Castañeda 85e84ddefb Input server and preferences: clean up
Remove compatibility with legacy settings format.
The preferences app doesn't need to read and save the settings file:
devices are enumerated and their properties retrieved from the
input_server. When something changes, the input_server updates the data.

Change-Id: Id1ea6f2532a1c8a173e9ba9818dd911fd6f4aa10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7877
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-07-29 17:30:39 +00:00
Máximo Castañeda a5df3d5221 MediaPlayer: fix subtitles
- Setting word wrapping and resizing the BTextView to the video size
  before adding the text moves the subtitles to where they are supposed
  to be, and breaks long lines that would be cut off.
- Show last subtitle entry: _IndexFor returns the index at which to
  insert a new subtitle for some start time, so when getting an existing
  one, we always need the previous index. Before the change we would do
  that after checking the time of the subtitle at the returned index,
  which for the times of the last one would be outside the list.
- Improve charset detection by using the whole file. Just the first line
  of subtitle text may be too short to be useful, and to get there we
  should have decoded the file first. The refactor also fixes not getting
  the last entry from the file.
- While not subtitle related, fix typo in aspect ratio menu shortcuts.

Fixes: 18151
Change-Id: I83fae735d31bce4616da9128a46be15763c30591
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7833
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-07-08 20:10:10 +00:00
Máximo Castañeda 8773f8b854 BTextView: improve layout without word wrapping
- Don't add the insets twice for the preferred width when it is clamped
  to the minimum one.
- Set the minimum size to the preferred one.
- Line breaking depends on text content, not available width, so can be
  done without a valid text rect.

Change-Id: I511d07a8e0ed78330a232679495a1564bfcd22cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7818
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-07-08 10:56:53 +00:00
Máximo Castañeda 1828888741 CharacterMap: gray-out characters without glyphs in the chosen font
Change-Id: I1a52757579069f7e7fa3a67a5335fe6549379bcb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7830
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-07-06 13:12:21 +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 36087e77db CharacterMap: fix block filter
Some of the Unicode blocks correspond to the union of two blocks as
defined in BeOS (for example, "Arabic" includes B_BASIC_ARABIC_BLOCK and
B_ARABIC_EXTENDED_BLOCK), making the `Includes` test inadequate.

Change-Id: Ib1a358f6be8a8f517c6b8a3642536b3e75d365a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7828
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-07-06 13:12:21 +00:00
Máximo Castañeda d6669c48ad BHandler: fix IsWatched
Using map[key] inserts the key in the map if it wasn't there, making it
non-empty.

Change-Id: I4404b896126aee202780b6e93e7c17c69ca8f34d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7787
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-06-24 17:45:27 +00:00
Máximo Castañeda 61db1f4908 kernel/arch: Fix format specifier for area_id
Change-Id: I1430a68c92fa9c5db96b0d36cc01242ccbf456de
2024-05-29 13:55:30 +02:00
Máximo Castañeda 446ff222af Tracker: search for the localized decimal separator
Now that string_for_size return localized numbers, we can't assume the
decimal separator is a dot.

Fixes: #18900
Change-Id: I872d75b0e9e4eb5d085e04bfd4e8c26101a5b1b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7671
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-05-17 07:24:37 +00:00
Máximo Castañeda 7766057761 CharacterMap: fix hex representation
Fill the buffer also for NUL character.
Give the buffers at least the minimum needed: 4 characters for each of
at most 4 bytes and an extra one for the ending NULL.

Fixes: #18651
Change-Id: I1ca931ad5673baaca3fb08ebfe189dca7093c80e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7666
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-05-03 21:15:18 +00:00
Máximo Castañeda 7866929cf9 app_server: make FontFamily referenceable
FontStyle will be keeping the references, so the family will exist as
long as there's a style pointing to it.

Change-Id: I639f7914be924a84d5db5882c638a4dac665aa23
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7634
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-05-02 18:05:38 +00:00
Máximo Castañeda 0b8508801b app_server: keep pinned fonts accessible by ID after removal
On font removal styles may still be referenced by views, pictures or
whatever else. In that case, what we were doing had the following
effects:
- The style is still available through the family. So it is still
  returned when listing fonts.
- The style is not available by ID. So a few app server messages will
  fail, including those for string width or character escapements.
Moreover, if the removal was due to an update, adding the style again
fails because we already have one by that name. If all the old
references are finally dropped, we end up without the old nor the
updated style.

We now do the opposite: until all references are dropped, a style can
still be fetched by ID (that is, by an object that loaded it before
being removed), but it is not listed anymore (so it won't be given to an
app loading a font by name or by changing the style of a font of the
same family).

Fixes: #18868
Change-Id: Ia64744afeb9297fd446e437d08636733b6dc0aec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7633
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-05-02 18:05:38 +00:00
Máximo Castañeda 31e7087b07 app_server: remove new font family from the manager in case of error
Change-Id: I8a1538b9706ed1c6eb5d104332ddbf3b7f223faa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7632
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-05-02 18:05:38 +00:00
Máximo Castañeda f657c49d1c app_server: font style 0 may not exist
In which case failure to find it in the styles hash table does not tell
us anything about the existence of its family.

Change-Id: I77c8960a96e7283547650daae67ea71fd022567e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7631
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-05-02 18:05:38 +00:00
Máximo Castañeda 0464fca49a BSpinner: restore local copy of control value
8cc8ec9ef9 fixed a problem due to BSpinner
using its own variable to store the value instead of resorting to
BControl's one. That was accessed with a inline method, so programs
compiled before the change get the spinner's value from a place that in
newer revisions contain garbage. Copy the value to that position after
changes, so that it is available for both old and new apps.

Fixes: #18898
Change-Id: I01679bfcb5b208e04ea85d7ec38cc655305d532a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7657
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-04-30 19:12:36 +00:00
Máximo Castañeda ff3b6fb75b Remove unnecessary dependencies on localestub
Introduced in hrev57710, they are the remnants of a previous version of
the change, not needed with the final one.

Change-Id: I03dbb86fd8963897dfed7bd77772e4ac97a8e739
2024-04-25 16:43:01 +02:00
Máximo Castañeda 28b96e105f IK, libshared: fix string formatting of size and rate
- Out of bounds index for values that would use a bigger unit than
  available.
- Jumping from bytes to MiB, without using KiB despite being better.
- Wrong catalog key for base units.
- BSizeColumn showing incorrect values for sizes less than 1 MiB.
- Extraction of catalog messages for BSizeColumn.

Fixes: #18892
Change-Id: Ib36a30a29b425654ab569537b11c8c56093ddc2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7626
Reviewed-by: waddlesplash <[email protected]>
2024-04-24 19:29:03 +00:00
Máximo Castañeda a193d1e157 Tracker: remove spurious enum value
Introduced in 90510b4af9 with no use. As
those values are the page indices of the list in the settings window,
adding the later pages fail.

Fixes: #18890
Change-Id: I9b28f8b279163ea1b54e5659c95c2fd80bb88ed2
2024-04-18 17:28:43 +02:00
Máximo Castañeda 11ec18db9c ffmpeg: return AVERROR_EOF instead of 0 on stream end
Fixes: #18877
Change-Id: I1ce8b14089570fa42526819b8cb961a45998020b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7601
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2024-04-06 11:28:12 +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
Máximo Castañeda 118eb80985 app_server: update Symbols2 font name
It's changed in the version included in current noto package.

Fixes #18815

Change-Id: I6e2db902dff0f72f1a13ef5eafb2b9963e466e4a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7425
Reviewed-by: Máximo Castañeda <[email protected]>
2024-02-23 15:37:08 +00:00
Máximo Castañeda 1ad4f095e9 FileTypes ApplicationTypesWindow: fix UI updates
Fixes #5050 and the info staying empty after selecting a just
deselected item.

Change-Id: I519f7b260658e8e5a1671b854b0980d2fcde8352
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7370
Reviewed-by: Máximo Castañeda <[email protected]>
2024-02-03 20:41:25 +00:00
Máximo Castañeda 3c51bab74e runtime_loader: remove unnecessary loop
Left behind when we moved from changing only /usr/bin/env to anything
under /usr/bin.

Change-Id: I9ceba844e18deda5f3d395fc6b5df84a1a8ce363
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7360
Reviewed-by: waddlesplash <[email protected]>
2024-01-29 18:58:44 +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
Máximo Castañeda 787179956b tools/elfsymbolpatcher: fix format warnings
Change-Id: I3e7d2feff9e8bfae981d2f16f95adb835870cdd5
2024-01-29 19:30:26 +01:00
Máximo Castañeda d579eb9efe HaikuBook: minor fixes
Fix some copy-pasta and strange grammar.
Remove a note that seems unnecessary in context and easy to misinterpret
out of context.

Change-Id: If1ce26b293c8098c260a9697fb0ef0611a4958c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7358
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-29 18:15:16 +00:00
Máximo Castañeda 26a211b054 Remove trigraphs
Fixes arm64 build

Change-Id: I8e266871df8f124539a4b5d6fb267931e6506dd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6769
Reviewed-by: Adrien Destugues <[email protected]>
2023-08-02 11:43:59 +00:00
Máximo Castañeda 44233abf11 Painter: change to a solid pattern for gradients
Gradients don't use patterns, but then some common drawing code makes
decisions based on them. Let's set the pattern to B_SOLID_HIGH so that
we get the expected result, in particular one that does not depend on
the last pattern used by a previous operation.

Fixes #18370.

Change-Id: I9d71c6d334d77be8fe4783a072b8df519486d74e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6416
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Stephan Aßmus <[email protected]>
2023-05-12 09:15:12 +00:00
Máximo Castañeda 7858871ed4 DrawState: disable drawing when clipping to an invalid rect
An invalid rect would mean an empty area to clip to. Its inverse would
be an infinite area with no holes.

Fixes #18395.

Change-Id: I5c739149e539ab63e9aaab6e8716aa73e3ee9d2f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6406
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2023-05-04 14:43:48 +00:00
Máximo Castañeda b00da680fb BTabView: remove obsolete code
Seems to come mostly from before the move to ControlLook, and it's not
been working for some time as the drawing rect passed now to
DrawInactiveTab is invalid in one direction. tabsBounds should be
initialized to tabFrame (as set before DrawTabFrame changes it), but
then BeControlLook would draw something we don't want.

If HaikuControlLook (or any other) wants something special for the last
tab, it should handle that itself using the tab indexes.

Change-Id: Iabecb27d1d30d91423c51e7bc03cf7906e530afe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6397
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-04-29 16:15:13 +00:00
Máximo Castañeda cd6e756df5 FlatControlLook: fix clipping
Remove ConstrainClippingRegion calls as they do not take into account
view transformations.
Clip drawing to the drawing rect, not the updated area.

Part of #12890

Change-Id: Icbc07f5431cf8ee826f28e6d5683135d1171d75a
2023-04-29 11:17:14 +02: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
Máximo Castañeda e70df3f778 app_server: AppFontManager does not need a BLooper
Saves at least a thread and a few semaphores per app.

Change-Id: Ied43e5944471918b34b897722346a25d159090df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6073
Reviewed-by: waddlesplash <[email protected]>
2023-02-25 11:34:57 +00:00
Máximo Castañeda 6ae6a38e53 app_server: refactor font managers
Move common add/remove code to the base class and improve encapsulation.
Loading FreeType is the responsibility of the global font manager.
Rename FontManagerBase back to FontManager.

Change-Id: I9396112f01583e19d03011106fd1fa1e37958ee8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6072
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-02-25 11:34:46 +00:00
Máximo Castañeda 76b2fd5bed app_server: include the manager in the font cache key
App-loaded fonts get the same IDs for different apps, so the cache
entries can be easily overwritten or used for an unexpected font. The
FontManager adds a unique chunk to the string.

Change-Id: I67ea9971784f425370d1aad516af4dae8489c45b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6071
Tested-by: Automation <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-02-25 11:34:46 +00:00
Máximo Castañeda 46f36ae4e0 app_server FontManager: remove not owned family deletion
On adding a font, we may or not have other faces of the same family, so
we may be trying to add the new face to an already managed family. In
that case, we can't delete it when we get an error inserting the new
style.

This same code was already in place before the user fonts, but it's much
more unlikely to trigger, except maybe on purpose. A later patch
refactoring a bunch of things will join both into the base class.

Fixes #18169

Change-Id: I78053b6e941c18b952fc2bd64f393e26d3d53b0a
2023-02-13 11:49:09 +01:00
Máximo Castañeda b5c5eec531 app_server: don't return FreeType errors
They don't code Haiku errors and they are positive.

Change-Id: Ibd9da5251117e8883262d8880bad3c88eea6c4a9
2023-02-13 11:49:09 +01:00
Máximo Castañeda 88b5bdf748 app_server: fix dangling references in user fonts
Change-Id: I213959b407245c6c0eb1208ebea7145f699366fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6061
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-02-12 08:47:36 +00:00
Máximo Castañeda 85d52d335d app_server: push FontManager knowledge to FontStyle creation
Change-Id: I98a68a894642147d398faf22591a22afef4c3ba2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6060
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-02-12 08:47:36 +00:00
Máximo Castañeda cb190a7dee app_server: new font code cleanup: includes and the like
Change-Id: I4b7f882fffc34be1984060838f13971c48d4abfc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6059
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-02-12 08:47:36 +00:00
Máximo Castañeda c83c6cde11 tests/app_server: fix loop direction
Change-Id: Ifb9324a8cd5d9cf4c2ed2016cd597673955007e7
2023-02-10 12:53:30 +01:00
Máximo Castañeda a34c877fd0 app_server: FontStyle lifecycle
FontFamily is babysitted by the FontManager. It doesn't own FontStyle
references, there's no place in it to release them.

FontManager owns a reference to the FontStyle, and it is in
fStyleHashTable. Putting a style there acquires a new reference, so we
can release the one from the new style. Removing a style from the map
releases the reference. We need to clear the map before shutting down
FreeType to get rid of our last references and let the styles die now
instead of afterwards to avoid double freeing the faces.

These solve the new crash from the previous patch. It didn't crash
before because even after the map was destroyed there were still
dangling references to the styles.

On removing a user font, the style will remove itself from the family
through the manager if that was the last reference, and the manager will
remove and delete the family if it has no more styles.

Change-Id: I460ff830fa8a8a5adb90dc8ea12120e1e50a5912
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6052
Reviewed-by: waddlesplash <[email protected]>
2023-02-08 17:58:48 +00:00
Máximo Castañeda 6d024fde1c app_server: fix double deletion of font families
The managed families are already deleted (in a correct way) in
FontManagerBase, so it's unnecessary to do it in GlobalFontManager.

Fixes #18245, though it surfaces another problem.

Change-Id: I93f1dcd1e0c1ec8d0657f3db6b484662e50c3487
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6051
Reviewed-by: waddlesplash <[email protected]>
2023-02-08 17:58:48 +00:00
Máximo Castañeda 72d2ba2f9c test_app_server: fix build
Change-Id: I4489359980f92accdb825446f697cdbc7ce8121e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6050
Reviewed-by: waddlesplash <[email protected]>
2023-02-08 17:58:48 +00:00
Máximo Castañeda 8e2cd40d9e FontManager: use correct constants for default styles
Reapply part of 12ae5308f2 that was lost in the long revision history of
user fonts. No big deal as the values are the same.

Change-Id: I26bbceb0380b33e35b105519a11e309500f9acf6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6006
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-01-18 17:26:43 +00:00
Máximo Castañeda 7a6e72c289 listdev: include dependency on generated file
listdev depends, through usb-utils.h, on the script-generated usbhdr.h.

Additionally, there's no dependency on kdevice_manager.h since 2008.

Change-Id: I77d36d6b5dca48415fcb98121ecb6d372cfa85ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5972
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-12-31 14:45:40 +00:00
Máximo Castañeda 753349fb2e WebPositive: save the cookie jar in the user settings directory also for the curl backend
The files and formats are different for libnetservices and curl
backends, but now they are under the same directory whatever the
installed haikuwebkit version uses.

Change-Id: Iab87d5fd27ebea1fa0a8967a9802dfa2fb11240a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5835
Reviewed-by: waddlesplash <[email protected]>
2022-11-28 19:49:07 +00:00
Máximo Castañeda 5728bdf606 BAlert: invalidate icon view on icon change
Invalidating the layout may not be enough for an update.

Fixes: #18069
Change-Id: I93f6b0feb043c7f317a9ff1e7af11b2047fc7cd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5821
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-11-17 21:39:13 +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
Máximo Castañeda baf401757e HaikuBook: small list levels and grammar tweaks
Change-Id: I186e38108a57a8a8b82dbfbdf27766730fe659e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5774
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Oscar Lesta <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-11-02 02:12:23 +00:00
Máximo Castañeda 7b3e89c094 PoorMan: some libhttpd fixes
The last thttpd update was less than perfect. A bad format string was
causing crashes on directory listings, and some of our changes were
removed, like PoorMan's setting for directory listings, leaks and thread
safety.

Fixes: #17329
Change-Id: I84d9862a0ebd5492a2542cf9776462e7fe7dbe77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5772
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-11-01 01:06:07 +00:00
Máximo Castañeda 2eab9be564 HaikuBook: fix xml
Change-Id: If6dfe4de919d946f1ff19946e1fa1abe726ea95f
2022-09-02 12:12:01 +02:00
Máximo Castañeda 0da59b2407 DesktopSettings: remove unnecessary includes
Change-Id: I94fbffbe359be954bf769299420d1df97b2da184
2022-09-02 12:10:31 +02:00
Máximo Castañeda a4dfc6aa74 app_server: fix deadlock in GlyphLayoutEngine
We want to first try fallbacks with the same style as the main font, if
available, but that introduces the chance of two threads trying to
acquire the same locks in different order, so keep at most the main font
and one fallback locked, and acquire them in a fixed order by address.

Fixes: #17850
Change-Id: Ic352fadc46eb257d2bca4804962b11ab1eb9fa12
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5557
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-08-25 17:16:55 +00:00
Máximo Castañeda 00a1f24972 PicturePlayer: update debug strings
Change-Id: I64a7dead30b8f484b63ba4d8055d93c626447755
2022-07-16 20:33:58 +02:00
Máximo Castañeda eedb92aace app_server: fix reporting of Origin in scaled views
The local state scale is applied from the origin. That is, the origin
value does not change with the local scale.

This fixes the value returned by BView::Origin() when recovered from the
app server instead of from the client cache.

Change-Id: Id628d8f334fab06e6a6d084c079cdca1cfa914c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5443
Reviewed-by: waddlesplash <[email protected]>
2022-07-11 17:51:22 +00:00
Máximo Castañeda ab52604b90 arm syscalls: add explicit dependency
Some syscall headers are generated during the build process, and jam is
not smart enough to add an automatic dependency.

Change-Id: I7c19da7aca9da4a52c4537a5f5c279fdbe24a48a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5435
Reviewed-by: waddlesplash <[email protected]>
2022-07-06 18:03:45 +00:00
Máximo Castañeda 2e75ef07fe Fix 32bit build
Change-Id: If7c2da0a28302f5535eda25999b1f877cbca1152
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5315
Reviewed-by: waddlesplash <[email protected]>
2022-05-16 16:05:09 +00:00
Máximo Castañeda 20b50a5cb4 app_server: update list of default ignorable code points
Update as per Unicode 14 (and draft 15)
Include the noncharacters. We don't really want the .notdef glyph for
them, except for U+FDD1 which we have reserved internally to force it
from webkit.

Fixes #17593

Change-Id: I5a62bf0e7753adacc81ea19b3351deb58d5c0653
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4984
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-02-20 08:36:19 +00:00
Máximo Castañeda 9a7906eadb PatternHandler: remove unused code
hrev17117 implemented B_OP_COPY with a special treatment for text.
hrev21929 introduced the color cache to speed up that text drawing.
hrev52753 removed the special treatment of text in B_OP_COPY, but left the
color cache and the text flag behind.

Change-Id: Ib506c80a660e829132bce3ec1cb354fcfbab266c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4931
Reviewed-by: waddlesplash <[email protected]>
2022-02-18 21:31:42 +00:00
Máximo Castañeda 1f357f79ca Painter: sync renderer color
SetDrawState sets the pattern directly and then calls the member
functions to update colors. As SetHighColor does not update the renderers
if color does not change, that means we lose sync in some corner cases.

Change-Id: I5f8771baa58643c559df243dcc1603983941faee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4930
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-02-18 21:31:42 +00:00
Máximo Castañeda 72acf6a91b generate_boot_screen: fix build
Change-Id: I4ce2a45887fd2f562216aa49e1bd34269bcfdef8
2022-02-09 21:32:32 +01:00
Máximo Castañeda 3a809d9273 riscv64 syscalls: add explicit dependency
Fixes #17518

Change-Id: Id64ee4c3a3d28a32f41d8303c4a8c0c8228838d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4862
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-01-12 05:31:51 +00:00
Máximo Castañeda 910ebfc4f5 ServerFont: keep style if possible when setting face flags
The current style probably has the correct style flags portion. Getting
a new style in that case is unnecessary, and problematic with some font
families that have several fonts mapping to the same style flag
(SemiBold, Bold and ExtraBold are all B_BOLD_FACE, for example): the
chosen one might be different than the one already set.

Fixes #17229

Change-Id: Ie8e73627cc0547df9d624a8fac07f521fc983d06
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4416
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-06 10:30:47 +00:00
Máximo Castañeda b009ef381b AlphaMask: fix bounds of inverse masks
For inverse masks the real bounds rect is the canvas, as the points that
pass through are the ones not drawn.

Change-Id: I420a5eca419b215b55e4c2362e2c7646465a4cd3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4455
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2021-10-14 18:49:18 +00:00
Máximo Castañeda c10931f3b0 app_server tests: stacking of inverse clipping
A few visual tests of clipping composition with different combinations of
layers with and without the inverse bit.

Change-Id: Icddb377508733463378f93b24075fd06e54ef2cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4454
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2021-10-14 18:49:18 +00:00
Máximo Castañeda c634a5cf32 nVidia driver: gcc2 build fix
Change-Id: I6b3f7d25ef66bd5789aa12dbccfd8e9da9701c0f
2021-09-07 21:08:00 +02:00
Máximo Castañeda ae56997857 BCountry: return country name
ICU's Locale::getDisplayName fills in the locale's name in the form
"language (country, variation)". We are interested in the country here.

Fixes #17081

Change-Id: Icb810dbe2c486d95251d4d06a48dfe3a000fa968
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4206
Reviewed-by: humdinger <[email protected]>
2021-07-13 15:03:47 +00:00
Máximo Castañeda 22dda7795d GlyphLayout: emit .nodef glyph for missing glyphs
Use glyph 0 when no glyph is found for a character in the current font
nor any of the fallbacks.

HasGlyphs has to bypass LayoutGlyphs because we want it to mark this
case as false, while still checking the fallbacks.

Change-Id: Ief8d9d53c91992c659922fb56b79be7172f4ab0d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4144
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2021-07-11 12:14:01 +00:00
Máximo Castañeda 4c23dfb3a3 posix: fix confstr
* Off-by-one error copying the string.
* As per the spec, return the buffer length for the string when passed a
  null pointer and 0 length.

Fixes https://github.com/haikuports/haikuports/issues/5821

Change-Id: Ic421f26db00f9820c6a617375e39f7341cd5ebc1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4110
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2021-06-27 08:58:15 +00:00
Máximo Castañeda 1aca853fc9 BMenu: fix menu items width in column layout
Change-Id: Ia16d51ff31760fef28bcceeab7b5c26a05cfbdad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4092
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2021-06-19 09:28:06 +00:00
Máximo Castañeda e41899a6fe BMenu: fix scroll activation
Fixes #14932

Change-Id: I72b16a26ea4d3cef0e9518381c583b23bdcadc22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4078
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2021-06-09 10:58:02 +00:00
Máximo Castañeda 46c95b5d09 BMenu: move menu over the menu bar only if there's more space there
Fixes #16773

Change-Id: I465c2f4366c11b7b0bacaed57c3d8fd33defe8a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4077
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2021-06-09 10:58:02 +00:00
Máximo Castañeda a60e5cb46e Get font metrics from a bitmap if there are no outlines
FreeType only provides some font parameters for scalable fonts. In
particular, we use the FT_Face values of units_per_EM, ascender,
descender and height, which are 0 for bitmap-only fonts.

Part of #16938.

Change-Id: Iea2d87ad95f3bc1c2e27fb041da0a27c6e68be91
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4042
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2021-06-04 07:39:02 +00:00
Máximo Castañeda bd6434b663 Revert "packagefs and IOCache: don't reread pages when we have them all."
This reverts commit dfc8e52638.

It needs more attention to its influence on other parts of the code.

Fixes #16954

Change-Id: Ibb764d81666434a198023bc345a45ef9d270eadb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3976
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2021-05-23 21:05:01 +00:00
Máximo Castañeda 3349a731ef nfs4: fix gcc2 build
gcc2 preprocessor reads `__func__,` as one token, yielding
dprintf("nfs4: %s()" "whatever"  "\n", );
and a parse error for the expansion of ERROR with only one parameter.
Separating the comma gives the result we want.

Change-Id: I5d20e2c06a796b7092b9f23162fa7bfb269318be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3899
Reviewed-by: Jérôme Duval <[email protected]>
2021-05-04 14:33:00 +00:00